diff --git a/README.md b/README.md index 7ea8b61..bfffb52 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ Full details can be found in `hashit --help` or `hashit -h`. ``` $ hashit -h Hash It! -Version 1.2.0 +Version 1.4.0 Ben Boyter Usage: @@ -69,12 +69,13 @@ Flags: -c, --hash strings hashes to be run for each file (set to 'all' for all possible hashes) (default [md5,sha1,sha256,sha512]) --hashes list all supported hashes -h, --help help for hashit + --mtime enable mtime output --no-stream do not stream out results as processed -o, --output string output filename (default stdout) -p, --progress display progress of files as they are processed -r, --recursive recursive subdirectories are traversed --stream-size int min size of file in bytes where stream processing starts (default 1000000) - --threads int number of threads processing files, by default the number of CPU cores (default 8) + --threads int number of threads processing files, by default the number of CPU cores (default 20) --trace enable trace output -v, --verbose verbose output --version version for hashit @@ -91,22 +92,22 @@ README.md (6616 bytes) SHA512 e4d108219def5c36089f7cd45d4531548d52a41cc5992004c78e816fbe64d63a21bc7ea1303d7a31bd693bf4f5435c916fbbe4e9d3e1fd0b1982a9734b4ec739 $ hashit --hash all README.md -README.md (8964 bytes) - CRC32 a6f59c84 - xxHash64 d3b87287c02996de - MD4 f106887bd63a7b7c5269a039c501b6b6 - MD5 22ed507c2a5fc7b822c8080340d799ab - SHA1 2e74fa58da1f19b66b5826cf73d0c28a6c48aed6 - SHA256 c84475732426797adfc3b1f14717d1aeeee976ca19ddd596f2ea5e59c932a062 - SHA512 4f77e1d43cfcdb04c1ad99b5d53087b960ea7301da21f76de42cfefe77eb6f0bb3d2781db6c99f3f99d161e76c68d5a74a990b81e4e908a7104aef7d512efd31 -Blake2b-256 59627f6afdb0bcd783a9fe1f77763ff87c5768135e839fd9f16b440828f2a8e6 -Blake2b-512 9d00cd557c20b15ee85fdcc292d53604f4783d79dde6d3aada67391423633f28a1e5279519260b85171558bafc4b3785adc1854b88b004e402e49962426d86b4 - Blake3 dcef77d73bc12c8d931b253835eae13854d18b8b16c784c089929815592a4506 - SHA3-224 3912468ee2c0dfe3a4bf5f2bf4c2c36b684a465a73445d9651cf5e4d - SHA3-256 ca7bcbd1ad389727a2502cfd5b785968ebff7453551eb44ffd1e879f47fc00dc - SHA3-384 b97839411747e2174ed9d4dbf415e7945160746962f3208a4fd05ded8013c569da66db2fa8e8001c438896e160a153c7 - SHA3-512 be6ac69cbb38fd2dc2646e7ec3e04878c0bc8824fe196da63ac577fae35a026251ef59618e9584bc2fbb274424a6a5251aea0ab64148469eb1b704a6c836627e - +README.md (9460 bytes) + CRC32 8f023940 + xxHash64 8bc915722510645e + MD4 179e0501d57b741e822964a85a4f1923 + MD5 2a8517703f0ddf7be45d0d51b84f1e49 + SHA1 886521f2d1f8e4b461a364d3cad826636831eff5 + SHA256 cb664826dd6982d3d0350f4453b36bd0168a996a20b8e0e719f0e224cf761808 + SHA512 4894b771b8b7412a12ecb8bd6e9b2a5d1f7c540d0c293fddd6231fec18c13af7f1333f9cf621c1ce7677a363947f28a3ab706868e3ca2e93f2597b798e7a25d1 +Blake2b-256 5c8dd15df397217d742ca94ebd3f4d6b7c4bf74fc94b61e1ad14bd0b41882960 +Blake2b-512 c4e22434524549d882a475076092586e7543bbba5ff401761cecab8b016c9b877035e4b6a3c59ba8d7e95147a1f13bd54aa0ec300f833ddf4a87e7bd09982efc + Blake3 2b3e1660f329f570182e8f448e516d1ce545984e5a2d00046cd52689847e2894 + SHA3-224 9bceeaeed4d1ead3af3098429cbe3f1a729b40feebf3b9d576ca1210 + SHA3-256 ee226be159cbaee0a49d94e3a2a2bb9fa75d59a039e9149ae16f419a2d41e84d + SHA3-384 f9a1c8860b40fa58bb2f113bbae3ab7bfe25c8f5bfa4312dc4e09c75f678faf8005f7cbeac8f01f5adbd00ea480e694d + SHA3-512 d7e5d8b4abd2bdf2c9628e1698e08577c30a4626f303d3e3e0a8d3385068418adace23460c6303d2537ee35dd6963cb5c9a04fdee5bf6e307e2240835872775f + ed2k 179e0501d57b741e822964a85a4f1923 $ hashit scripts scripts/include.go (1835 bytes) @@ -116,36 +117,103 @@ scripts/include.go (1835 bytes) SHA512 b37ac5a309f9006b740fb0933fe5c4569923cab0fe822c1e2fbf0fbd2a15e9787681ec509ca9f7ea13d921a82257ecc3a32e2dfa18cc6892ea82978befe2629c ``` -hashit can produce `hashdeep` compatible audit files if you want to verify its output, +### Auditing -``` -$ hashit --format hashdeep processor -%%%% HASHDEEP-1.0 -%%%% size,md5,sha256,filename -## Invoked from: /home/bboyter/Go/src/github.com/boyter/hashit -## $ hashit --format hashdeep processor -## -12093,4bf92524edf098a6f5ada7b9ce6ae933,54be4e99f2635c00c6eb769a0342c2c040eac9b4f10627233e6dea8b9b20981b,processor/constants.go -18786,5b0971442f17ae00b7ad6087855d5089,b1074780eee33b1c7d548b1b94c6743691dcbc5c7d475d685c9ca77a8b7905ba,processor/workers.go -5856,58043d636928a4c0e7e6a04e69d385de,12f0e925a67d10da9327f11976c9156ba158458874d5d6fde632c27e27dead67,processor/processor.go -758,76697adfb4c818d816d3092c04fdeb46,af61af65db73a2aec2d2bea66468d9e7c44bc92bade2561754b426484a7f235b,processor/file.go -8883,8865704b023f417ffa2d6d347f5d2164,56a04cd56fb30b4ccb7b1344fbee119607b514eac57c99222dbe1319020adb5a,processor/formatters.go -444,22158f610b8a262ca8ae68424ad96ad9,47f026a06d7ced7ecbbdaf199926678cbc003b7a387eb9bbee78a2a0340297bf,processor/structs.go -2840,ce29ce9a95713628e1d8e43a51027ac1,7dcc785a34ce95c4e741e92177f221e6d05d9c1663481f35c54286fc6645934f,processor/workers_test.go -``` +`hashit` provides a powerful auditing feature that is compatible with `hashdeep`. This allows you to verify the integrity of a set of files by comparing their current state against a previously generated list of known hashes. + +You can use `hashit` to generate an audit file and have `hashdeep` verify it, or use `hashdeep` to generate the audit file and have `hashit` verify it. -The output of the above can be run through hashdeep for verification, +#### Generating an Audit File +To generate an audit file compatible with `hashdeep`, use the `--format hashdeep` flag. + +```shell +$ hashit --format hashdeep processor > audit.txt ``` -$ hashit --format hashdeep processor > audit.txt && hashdeep -l -r -a -v -k audit.txt processor + +This will create a file named `audit.txt` containing the hashes of the files in the `processor` directory. + +#### Verifying with `hashdeep` + +You can then use `hashdeep` to audit a directory against the file generated by `hashit`. + +```shell +# First, ensure hashdeep is installed +# Then, generate the audit file with hashit +$ hashit --format hashdeep processor > audit.txt + +# Now, audit with hashdeep +$ hashdeep -r -a -k audit.txt processor hashdeep: Audit passed - Files matched: 7 + Files matched: 8 Files partially matched: 0 Files moved: 0 New files found: 0 Known files not found: 0 ``` +#### Verifying with `hashit` + +Similarly, you can use `hashit` to audit against a file generated by `hashdeep`. `hashit`'s `-a` flag is used to specify the audit file. + +```shell +# First, ensure hashdeep is installed +# Then, generate the audit file with hashdeep +$ hashdeep -r processor > audit.txt + +# Now, audit with hashit +$ hashit -a audit.txt processor +hashit: Audit passed + Files examined: 8 +Known files expecting: 8 + Files matched: 8 + Files modified: 0 + Files moved: 0 + New files found: 0 + Files missing: 0 +``` + +#### Understanding Audit Results + +`hashit`'s audit output is designed to be similar to `hashdeep`'s verbose output, providing a clear summary of what has changed. + +Here's an example of a failed audit where a file was modified: + +```shell +# Setup a temporary directory for the example +$ mkdir -p /tmp/hashit-audit-test +$ echo "original content" > /tmp/hashit-audit-test/file.txt + +# Create an audit file +$ hashit --format hashdeep /tmp/hashit-audit-test > audit.txt + +# Modify the file +$ echo "new content" >> /tmp/hashit-audit-test/file.txt + +# Run the audit +$ hashit -a audit.txt /tmp/hashit-audit-test +hashit: Audit failed + Files examined: 1 +Known files expecting: 1 + Files matched: 0 + Files modified: 1 + Files moved: 0 + New files found: 0 + Files missing: 0 + +# Clean up +$ rm -rf /tmp/hashit-audit-test audit.txt +``` + +`hashit` can also detect moved files, distinguishing them from new or missing files. + +#### Key Differences from `hashdeep` + +While `hashit` aims for compatibility, there are some minor differences in the command-line interface: + +* **Audit Flag:** `hashdeep` uses two flags to start an audit (`-a -k `), whereas `hashit` uses a single flag that takes the audit file as its argument (`-a `). +* **Displaying Failed Hashes:** `hashdeep` has an `-X` flag to display the new hashes of modified files. `hashit` does not currently have an equivalent for this feature. + Note that you don't have to specify the directory you want to run against. Running `hashit` will assume you want to run against the current directory. If you supply a single argument to `hashit` and its a file it will process it. If you supply a single argument and it is a directory it will recurse that directory. diff --git a/assets/db/migrations.sql b/assets/db/migrations.sql index 813d070..d7216b9 100644 --- a/assets/db/migrations.sql +++ b/assets/db/migrations.sql @@ -16,5 +16,6 @@ create table if not exists file_hashes ( sha3_256 text, sha3_384 text, sha3_512 text, + ed2k text, size integer not null ); diff --git a/assets/db/queries.sql b/assets/db/queries.sql index 6aaaf76..b635762 100644 --- a/assets/db/queries.sql +++ b/assets/db/queries.sql @@ -3,9 +3,9 @@ -- name: FileHashInsertReplace :one insert or replace into file_hashes ( filepath, crc32, xxhash64, md4, md5, sha1, sha256, sha512, - blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, + blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, ed2k, size -) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) returning *; -- name: FileHashByFilePath :one diff --git a/go.mod b/go.mod index 2bc95d0..91bcc8f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/boyter/hashit -go 1.24 +go 1.25.0 require ( github.com/cespare/xxhash/v2 v2.3.0 @@ -9,8 +9,9 @@ require ( github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 github.com/spf13/cobra v1.8.1 github.com/zeebo/blake3 v0.2.3 + go.felesatra.moe/hash/ed2k v1.0.2 golang.org/x/crypto v0.31.0 - modernc.org/sqlite v1.36.0 + modernc.org/sqlite v1.40.1 ) require ( @@ -23,9 +24,9 @@ require ( github.com/ncruces/go-strftime v0.1.9 // indirect github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect github.com/spf13/pflag v1.0.5 // indirect - golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect - golang.org/x/sys v0.30.0 // indirect - modernc.org/libc v1.61.13 // indirect + golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b // indirect + golang.org/x/sys v0.36.0 // indirect + modernc.org/libc v1.66.10 // indirect modernc.org/mathutil v1.7.1 // indirect - modernc.org/memory v1.8.2 // indirect + modernc.org/memory v1.11.0 // indirect ) diff --git a/go.sum b/go.sum index f374876..0bb31d9 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,8 @@ github.com/djherbis/times v1.6.0 h1:w2ctJ92J8fBvWPxugmXIv7Nz7Q3iDMKNx9v5ocVH20c= github.com/djherbis/times v1.6.0/go.mod h1:gOHeRAz2h+VJNZ5Gmc/o7iD9k4wW7NMVqieYCY99oc0= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= -github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd h1:gbpYu9NMq8jhDVbvlGkMFWCjLFlqqEZjEmObmhUy6Vo= -github.com/google/pprof v0.0.0-20240409012703-83162a5b38cd/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs= +github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gosuri/uilive v0.0.4 h1:hUEBpQDj8D8jXgtCdBu7sWsy5sbW/5GhuO8KBwJ2jyY= @@ -37,43 +37,47 @@ github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg= github.com/zeebo/blake3 v0.2.3/go.mod h1:mjJjZpnsyIVtVgTOSpJ9vmRE4wgDeyt2HU3qXvvKCaQ= github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo= github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= +go.felesatra.moe/hash/ed2k v1.0.2 h1:veuWruebB5r8WCsQUyTbTFhVqlrGI58LlwH0G+JCBp0= +go.felesatra.moe/hash/ed2k v1.0.2/go.mod h1:iJcvQPdpma+fJfAHbrIFPjT6UYEN6GFsgkm+SB+QHdY= golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= -golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 h1:pVgRXcIictcr+lBQIFeiwuwtDIs4eL21OuM9nyAADmo= -golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= -golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b h1:M2rDM6z3Fhozi9O7NWsxAkg/yqS/lQJ6PmkyIV3YP+o= +golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20220615213510-4f61da869c0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc= -golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= +golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -modernc.org/cc/v4 v4.24.4 h1:TFkx1s6dCkQpd6dKurBNmpo+G8Zl4Sq/ztJ+2+DEsh0= -modernc.org/cc/v4 v4.24.4/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= -modernc.org/ccgo/v4 v4.23.16 h1:Z2N+kk38b7SfySC1ZkpGLN2vthNJP1+ZzGZIlH7uBxo= -modernc.org/ccgo/v4 v4.23.16/go.mod h1:nNma8goMTY7aQZQNTyN9AIoJfxav4nvTnvKThAeMDdo= -modernc.org/fileutil v1.3.0 h1:gQ5SIzK3H9kdfai/5x41oQiKValumqNTDXMvKo62HvE= -modernc.org/fileutil v1.3.0/go.mod h1:XatxS8fZi3pS8/hKG2GH/ArUogfxjpEKs3Ku3aK4JyQ= -modernc.org/gc/v2 v2.6.3 h1:aJVhcqAte49LF+mGveZ5KPlsp4tdGdAOT4sipJXADjw= -modernc.org/gc/v2 v2.6.3/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito= -modernc.org/libc v1.61.13 h1:3LRd6ZO1ezsFiX1y+bHd1ipyEHIJKvuprv0sLTBwLW8= -modernc.org/libc v1.61.13/go.mod h1:8F/uJWL/3nNil0Lgt1Dpz+GgkApWh04N3el3hxJcA6E= +modernc.org/cc/v4 v4.26.5 h1:xM3bX7Mve6G8K8b+T11ReenJOT+BmVqQj0FY5T4+5Y4= +modernc.org/cc/v4 v4.26.5/go.mod h1:uVtb5OGqUKpoLWhqwNQo/8LwvoiEBLvZXIQ/SmO6mL0= +modernc.org/ccgo/v4 v4.28.1 h1:wPKYn5EC/mYTqBO373jKjvX2n+3+aK7+sICCv4Fjy1A= +modernc.org/ccgo/v4 v4.28.1/go.mod h1:uD+4RnfrVgE6ec9NGguUNdhqzNIeeomeXf6CL0GTE5Q= +modernc.org/fileutil v1.3.40 h1:ZGMswMNc9JOCrcrakF1HrvmergNLAmxOPjizirpfqBA= +modernc.org/fileutil v1.3.40/go.mod h1:HxmghZSZVAz/LXcMNwZPA/DRrQZEVP9VX0V4LQGQFOc= +modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= +modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito= +modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= +modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= +modernc.org/libc v1.66.10 h1:yZkb3YeLx4oynyR+iUsXsybsX4Ubx7MQlSYEw4yj59A= +modernc.org/libc v1.66.10/go.mod h1:8vGSEwvoUoltr4dlywvHqjtAqHBaw0j1jI7iFBTAr2I= modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= -modernc.org/memory v1.8.2 h1:cL9L4bcoAObu4NkxOlKWBWtNHIsnnACGF/TbqQ6sbcI= -modernc.org/memory v1.8.2/go.mod h1:ZbjSvMO5NQ1A2i3bWeDiVMxIorXwdClKE/0SZ+BMotU= +modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI= +modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= modernc.org/opt v0.1.4 h1:2kNGMRiUjrp4LcaPuLY2PzUfqM/w9N23quVwhKt5Qm8= modernc.org/opt v0.1.4/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= -modernc.org/sqlite v1.36.0 h1:EQXNRn4nIS+gfsKeUTymHIz1waxuv5BzU7558dHSfH8= -modernc.org/sqlite v1.36.0/go.mod h1:7MPwH7Z6bREicF9ZVUR78P1IKuxfZ8mRIDHD0iD+8TU= +modernc.org/sqlite v1.40.1 h1:VfuXcxcUWWKRBuP8+BR9L7VnmusMgBNNnBYGEe9w/iY= +modernc.org/sqlite v1.40.1/go.mod h1:9fjQZ0mB1LLP0GYrp39oOJXx/I2sxEnZtzCmEQIKvGE= modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= diff --git a/main.go b/main.go index 0346904..28b960a 100644 --- a/main.go +++ b/main.go @@ -42,6 +42,13 @@ func main() { "text", "set output format [text, json, sum, hashdeep, hashonly, sqlite]", ) + flags.StringVarP( + &processor.AuditFile, + "audit", + "a", + "", + "audit against supplied file; audit file must be in hashdeep output format", + ) flags.BoolVarP( &processor.Recursive, "recursive", @@ -71,7 +78,7 @@ func main() { flags.Int64Var( &processor.StreamSize, "stream-size", - 1000000, + 1_000_000, "min size of file in bytes where stream processing starts", ) flags.BoolVarP( @@ -81,6 +88,12 @@ func main() { false, "verbose output", ) + flags.BoolVar( + &processor.VeryVerbose, + "vv", + false, + "very verbose output", + ) flags.BoolVarP( &processor.Progress, "progress", diff --git a/processor/database/db.go b/processor/database/db.go index dacb52e..85d4b8c 100644 --- a/processor/database/db.go +++ b/processor/database/db.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.27.0 +// sqlc v1.30.0 package database diff --git a/processor/database/models.go b/processor/database/models.go index 7a955ab..0433445 100644 --- a/processor/database/models.go +++ b/processor/database/models.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.27.0 +// sqlc v1.30.0 package database @@ -24,5 +24,6 @@ type FileHash struct { Sha3256 sql.NullString Sha3384 sql.NullString Sha3512 sql.NullString + Ed2k sql.NullString Size int64 } diff --git a/processor/database/queries.sql.go b/processor/database/queries.sql.go index 6565024..a01153f 100644 --- a/processor/database/queries.sql.go +++ b/processor/database/queries.sql.go @@ -1,6 +1,6 @@ // Code generated by sqlc. DO NOT EDIT. // versions: -// sqlc v1.27.0 +// sqlc v1.30.0 // source: queries.sql package database @@ -11,7 +11,7 @@ import ( ) const fileHashByFilePath = `-- name: FileHashByFilePath :one -select filepath, crc32, xxhash64, md4, md5, sha1, sha256, sha512, blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, size from file_hashes where filepath = ? +select filepath, crc32, xxhash64, md4, md5, sha1, sha256, sha512, blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, ed2k, size from file_hashes where filepath = ? ` func (q *Queries) FileHashByFilePath(ctx context.Context, filepath string) (FileHash, error) { @@ -33,6 +33,7 @@ func (q *Queries) FileHashByFilePath(ctx context.Context, filepath string) (File &i.Sha3256, &i.Sha3384, &i.Sha3512, + &i.Ed2k, &i.Size, ) return i, err @@ -42,10 +43,10 @@ const fileHashInsertReplace = `-- name: FileHashInsertReplace :one insert or replace into file_hashes ( filepath, crc32, xxhash64, md4, md5, sha1, sha256, sha512, - blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, + blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, ed2k, size -) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) -returning filepath, crc32, xxhash64, md4, md5, sha1, sha256, sha512, blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, size +) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) +returning filepath, crc32, xxhash64, md4, md5, sha1, sha256, sha512, blake2b_256, blake2b_512, blake3, sha3_224, sha3_256, sha3_384, sha3_512, ed2k, size ` type FileHashInsertReplaceParams struct { @@ -64,6 +65,7 @@ type FileHashInsertReplaceParams struct { Sha3256 sql.NullString Sha3384 sql.NullString Sha3512 sql.NullString + Ed2k sql.NullString Size int64 } @@ -85,6 +87,7 @@ func (q *Queries) FileHashInsertReplace(ctx context.Context, arg FileHashInsertR arg.Sha3256, arg.Sha3384, arg.Sha3512, + arg.Ed2k, arg.Size, ) var i FileHash @@ -104,6 +107,7 @@ func (q *Queries) FileHashInsertReplace(ctx context.Context, arg FileHashInsertR &i.Sha3256, &i.Sha3384, &i.Sha3512, + &i.Ed2k, &i.Size, ) return i, err diff --git a/processor/formatters.go b/processor/formatters.go index 105fe1f..03c09c1 100644 --- a/processor/formatters.go +++ b/processor/formatters.go @@ -59,6 +59,10 @@ func makeTimestampNano() int64 { } func fileSummarize(input chan Result) (string, bool) { + if AuditFile != "" { + return doAudit(input) + } + switch { case strings.ToLower(Format) == "json": return toJSON(input), true @@ -75,6 +79,123 @@ func fileSummarize(input chan Result) (string, bool) { return toText(input) } +const ( + Passed = "passed" + Failed = "failed" +) + +func doAudit(input chan Result) (string, bool) { + // open the audit file + file, err := os.ReadFile(AuditFile) + if err != nil { + printError(err.Error()) + return "", false + } + + hdl, err := NewAuditor(string(file)) + if err != nil { + printError(err.Error()) + return "", false + } + + examinedCount := 0 + matched := 0 + filesModified := 0 + moved := 0 + newFiles := 0 + + // TODO we actually need to do two things... check if the file we are + // getting from input, as well as check that every file also exists + // IE if we loop the input the file should be there + // but also every file in the hashdeep lookup should be pinged too + status := Passed + newFilesList := []Result{} + for res := range input { + examinedCount++ + r := hdl.Find(res.File, res.MD5, res.SHA256) + + switch r { + case FileMatched: + if VeryVerbose { + fmt.Printf("%v: Ok\n", res.File) + } + matched++ + case FileModified: + if Verbose { + fmt.Printf("%v: File modified\n", res.File) + } + filesModified++ + status = Failed + case FileNew: + if Verbose { + fmt.Printf("%v: File new\n", res.File) + } + newFiles++ + status = Failed + newFilesList = append(newFilesList, res) + default: + panic("unhandled default case") + } + } + + // with the above done it means we have accounted for every file in the input + // we now need to check which files we expected to match but did not + // but we also need to consider if the file was renamed or moved... + unmatched := hdl.GetUnmatched() + printDebug(fmt.Sprintf("doAudit: initial unmatched count: %d", len(unmatched))) + + // Create a map for quick lookup of unmatched files by their combined hash + unmatchedByHash := make(map[string]AuditRecord) + for _, um := range unmatched { + unmatchedByHash[um.MD5+um.SHA256] = um + } + printDebug(fmt.Sprintf("doAudit: unmatchedByHash count after creation: %d", len(unmatchedByHash))) + + // Process newFilesList to identify moved files + var genuinelyNewFiles []Result + for _, res := range newFilesList { + hashKey := res.MD5 + res.SHA256 + if umRecord, ok := unmatchedByHash[hashKey]; ok { + // This is a moved file + moved++ + if Verbose { + fmt.Printf("%v -> %v: File moved\n", umRecord.Filename, res.File) + } + // Remove from unmatchedByHash so it's not counted as missing + delete(unmatchedByHash, hashKey) + } else { + // This is a genuinely new file + genuinelyNewFiles = append(genuinelyNewFiles, res) + } + } + newFiles = len(genuinelyNewFiles) // Update newFiles count + + // Any remaining in unmatchedByHash are truly missing + filesMissing := len(unmatchedByHash) + printDebug(fmt.Sprintf("doAudit: filesMissing count after processing newFilesList: %d", filesMissing)) + if Verbose { + for _, um := range unmatchedByHash { + fmt.Printf("%v: File expected but not found\n", um.Filename) + } + } + + if filesMissing > 0 || newFiles > 0 || filesModified > 0 { + status = Failed + } + + // the below is output based on what we get from hashdeep + // verbose (not very verbose) + return fmt.Sprintf(`hashit: Audit %s + Files examined: %d +Known files expecting: %d + Files matched: %d + Files modified: %d + Files moved: %d + New files found: %d + Files missing: %d`+"\n", status, examinedCount, hdl.Count(), matched, filesModified, moved, newFiles, filesMissing), status == Passed + +} + // Mimics how md5sum sha1sum etc... work func toSum(input chan Result) string { var str strings.Builder @@ -130,6 +251,9 @@ func toSum(input chan Result) string { if hasHash(HashNames.Sha3512) { str.WriteString(res.Sha3512 + " " + res.File + "\n") } + if hasHash(HashNames.Ed2k) { + str.WriteString(res.Ed2k + " " + res.File + "\n") + } if !NoStream && FileOutput == "" { fmt.Print(str.String()) @@ -142,7 +266,6 @@ func toSum(input chan Result) string { func toHashOnly(input chan Result) (string, bool) { var str strings.Builder - valid := true for res := range input { if hasHash(HashNames.CRC32) { @@ -187,6 +310,9 @@ func toHashOnly(input chan Result) (string, bool) { if hasHash(HashNames.Sha3512) { str.WriteString(res.Sha3512 + "\n") } + if hasHash(HashNames.Ed2k) { + str.WriteString(res.Ed2k + "\n") + } if !NoStream && FileOutput == "" { fmt.Print(str.String()) @@ -194,12 +320,11 @@ func toHashOnly(input chan Result) (string, bool) { } } - return str.String(), valid + return str.String(), true } func toText(input chan Result) (string, bool) { var str strings.Builder - valid := true first := true for res := range input { @@ -253,6 +378,9 @@ func toText(input chan Result) (string, bool) { if hasHash(HashNames.Sha3512) { str.WriteString(" SHA3-512 " + res.Sha3512 + "\n") } + if hasHash(HashNames.Ed2k) { + str.WriteString(" ed2k " + res.Ed2k + "\n") + } if !NoStream && FileOutput == "" { fmt.Print(str.String()) @@ -260,7 +388,7 @@ func toText(input chan Result) (string, bool) { } } - return str.String(), valid + return str.String(), true } func toJSON(input chan Result) string { @@ -341,7 +469,9 @@ func toSqlite(input chan Result) (string, bool) { printError(fmt.Sprintf("problem connecting to db %s", FileOutput)) return "", false } - defer db.Close() + defer func(db *sql.DB) { + _ = db.Close() + }(db) db.SetMaxOpenConns(1) // we are writing, so set the number of writes to 1 queries := database.New(db) @@ -371,6 +501,7 @@ func toSqlite(input chan Result) (string, bool) { Sha3256: toSqlNull(res.Sha3256), Sha3384: toSqlNull(res.Sha3384), Sha3512: toSqlNull(res.Sha3512), + Ed2k: toSqlNull(res.Ed2k), Size: res.Bytes, }) if err != nil { @@ -427,6 +558,7 @@ func printHashes() { fmt.Printf(" SHA3-256 (%s)\n", HashNames.Sha3256) fmt.Printf(" SHA3-384 (%s)\n", HashNames.Sha3384) fmt.Printf(" SHA3-512 (%s)\n", HashNames.Sha3512) + fmt.Printf(" ed2k (%s)\n", HashNames.Ed2k) } func contains(list []string, v string) bool { diff --git a/processor/hashdeep_parser.go b/processor/hashdeep_parser.go new file mode 100644 index 0000000..6a37cac --- /dev/null +++ b/processor/hashdeep_parser.go @@ -0,0 +1,161 @@ +package processor + +import ( + "bufio" + "encoding/csv" + "strings" +) + +// AuditRecord represents a single entry from the hashdeep output +// but is designed to work with other formats in the future +type AuditRecord struct { + Size string + MD5 string + SHA256 string + Filename string + Matched bool +} + +// Auditor parses and holds a audit file which can then be used for audit purposes +// by providing methods to look up values by either name or hash and optimised for all +type Auditor struct { + fileLookup map[string]AuditRecord // filename optimised lookup + md5Lookup map[string][]AuditRecord // md5 optimised lookup +} + +// TODO modify to accept multiple types +func NewAuditor(input string) (*Auditor, error) { + hdl := Auditor{} + + file, err := hdl.parseHashdeepFile(input) + if err != nil { + return nil, err + } + hdl.fileLookup = file + + return &hdl, nil +} + +type FileStatus int + +const ( + FileMatched FileStatus = iota + FileModified + FileNew + FileMoved // both of the below come from parsing the audit + FileMissing +) + +func (hdl *Auditor) Count() int { + return len(hdl.fileLookup) +} + +func (hdl *Auditor) Find(file, md5, sha256 string) FileStatus { + r, ok := hdl.fileLookup[file] + if ok { + r.Matched = true + hdl.fileLookup[file] = r + + // ok file exists, check if the hash's match + if r.MD5 == md5 && r.SHA256 == sha256 { + + return FileMatched + } + + // hash does not match so file has changed + return FileModified + } + + return FileNew +} + +func (hdl *Auditor) FindByHash(md5, sha256 string) FileStatus { + for _, r := range hdl.fileLookup { + if r.MD5 == md5 && r.SHA256 == sha256 { + return FileMoved + } + } + + return FileNew +} + +func (hdl *Auditor) GetUnmatched() []AuditRecord { + unmatched := []AuditRecord{} + for _, r := range hdl.fileLookup { + if !r.Matched { + unmatched = append(unmatched, r) + } + } + return unmatched +} + +// parseHashdeepFile accepts a hashdeep format in and builds the internal +// audit processor on it +func (hdl *Auditor) parseHashdeepFile(input string) (map[string]AuditRecord, error) { + scanner := bufio.NewScanner(strings.NewReader(input)) + var header []string + auditLookup := map[string]AuditRecord{} + csvStarted := false + + // Read the string line by line + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + + // Skip empty lines + if line == "" { + continue + } + + // Handle header lines starting with % + if strings.HasPrefix(line, "%") { + // Extract the header (e.g., "size,md5,sha256,filename") + if strings.Contains(line, "size") { + header = strings.Split(strings.TrimPrefix(line, "%%%% "), ",") + csvStarted = true + } + continue + } + + // Skip comment lines starting with # + if strings.HasPrefix(line, "#") { + continue + } + + // Process CSV data lines once header is found + if csvStarted { + reader := csv.NewReader(strings.NewReader(line)) + // Allow for potential spaces after commas + reader.TrimLeadingSpace = true + record, err := reader.Read() + if err != nil { + return nil, err + } + + // Map record to AuditRecord based on header + var fh AuditRecord + for i, field := range header { + if i >= len(record) { + break + } + switch field { + case "size": + fh.Size = record[i] + case "md5": + fh.MD5 = record[i] + case "sha256": + fh.SHA256 = record[i] + case "filename": + fh.Filename = record[i] + } + } + + auditLookup[fh.Filename] = fh + } + } + + if err := scanner.Err(); err != nil { + return nil, err + } + + return auditLookup, nil +} diff --git a/processor/processor.go b/processor/processor.go index c82169e..f024084 100644 --- a/processor/processor.go +++ b/processor/processor.go @@ -20,6 +20,9 @@ var Version = "1.5.0 (beta)" // Verbose enables verbose logging output var Verbose = false +// VeryVerbose enables verbose logging output +var VeryVerbose = false + // Debug enables debug logging output var Debug = false @@ -65,9 +68,6 @@ var FileListQueueSize = 1000 // Number of bytes in a size to enable memory maps or streaming var StreamSize int64 = 1_000_000 -// If set will enable the internal file audit logic to kick in -var FileAudit = false - // FileInput indicates we have a file passed in which consists of a var FileInput = "" @@ -89,6 +89,7 @@ var HashNames = Result{ Sha3256: "sha3256", Sha3384: "sha3384", Sha3512: "sha3512", + Ed2k: "ed2k", } // Process is the main entry point of the command line it sets everything up and starts running @@ -107,13 +108,13 @@ func Process() { } } - // If nothing was supplied as an argument to run against assume run against everything in the + // If nothing was supplied as an argument to run against, assume run against everything in the // current directory recursively if len(DirFilePaths) == 0 { DirFilePaths = append(DirFilePaths, ".") } - // If a single argument is supplied enable recursive as if its a file no problem + // If a single argument is supplied, enable recursive as if it's a file no problem // but if its a directory the user probably wants to hash everything in that directory if len(DirFilePaths) == 1 { Recursive = true @@ -122,6 +123,12 @@ func Process() { // Clean up hashes by setting all input to lowercase Hash = formatHashInput() + // Where audit file is set we only want to process the hashes that hashdeep supports for this + // NB we will need to expand this in the future when supporting our own format + if AuditFile != "" { + Hash = []string{"md5", "sha256"} + } + // Results ready to be printed fileSummaryQueue := make(chan Result, FileListQueueSize) diff --git a/processor/structs.go b/processor/structs.go index 1b274e5..e9d59f8 100644 --- a/processor/structs.go +++ b/processor/structs.go @@ -21,6 +21,7 @@ type Result struct { Sha3256 string `json:",omitempty"` Sha3384 string `json:",omitempty"` Sha3512 string `json:",omitempty"` + Ed2k string `json:"ed2k,omitempty"` Bytes int64 MTime *time.Time `json:",omitzero"` } diff --git a/processor/workers.go b/processor/workers.go index 2ac30f8..ce77a27 100644 --- a/processor/workers.go +++ b/processor/workers.go @@ -25,6 +25,7 @@ import ( "github.com/gosuri/uiprogress" "github.com/minio/blake2b-simd" "github.com/zeebo/blake3" + "go.felesatra.moe/hash/ed2k" "golang.org/x/crypto/md4" "golang.org/x/crypto/sha3" ) @@ -166,6 +167,7 @@ func processScanner(filename string, fsize int, bar *uiprogress.Bar) (Result, er sha3_256_d := sha3.New256() sha3_384_d := sha3.New384() sha3_512_d := sha3.New512() + ed2k_d := ed2k.New() crc32c := make(chan []byte, 10) xxhash64c := make(chan []byte, 10) @@ -181,6 +183,7 @@ func processScanner(filename string, fsize int, bar *uiprogress.Bar) (Result, er sha3_256_c := make(chan []byte, 10) sha3_384_c := make(chan []byte, 10) sha3_512_c := make(chan []byte, 10) + ed2k_c := make(chan []byte, 10) var wg sync.WaitGroup @@ -320,6 +323,16 @@ func processScanner(filename string, fsize int, bar *uiprogress.Bar) (Result, er wg.Done() }() } + if hasHash(HashNames.Ed2k) { + wg.Add(1) + go func() { + for b := range ed2k_c { + // safe as it says it never returns an error + _, _ = ed2k_d.Write(b) + } + wg.Done() + }() + } sum := 0 data := make([]byte, 4_194_304) @@ -390,6 +403,9 @@ func processScanner(filename string, fsize int, bar *uiprogress.Bar) (Result, er if hasHash(HashNames.Sha3512) { sha3_512_c <- tmp[:n] } + if hasHash(HashNames.Ed2k) { + ed2k_c <- tmp[:n] + } if err == io.EOF { break @@ -410,6 +426,7 @@ func processScanner(filename string, fsize int, bar *uiprogress.Bar) (Result, er close(sha3_256_c) close(sha3_384_c) close(sha3_512_c) + close(ed2k_c) wg.Wait() @@ -430,6 +447,7 @@ func processScanner(filename string, fsize int, bar *uiprogress.Bar) (Result, er Sha3256: encodeIfHashEnabled(sha3_256_d, HashNames.Sha3256), Sha3384: encodeIfHashEnabled(sha3_384_d, HashNames.Sha3384), Sha3512: encodeIfHashEnabled(sha3_512_d, HashNames.Sha3512), + Ed2k: encodeIfHashEnabled(ed2k_d, HashNames.Ed2k), }, nil } @@ -452,6 +470,7 @@ func processStandardInput(output chan Result) { sha3_256_d := sha3.New256() sha3_384_d := sha3.New384() sha3_512_d := sha3.New512() + ed2k_d := ed2k.New() crc32c := make(chan []byte, 10) xxhash64c := make(chan []byte, 10) @@ -467,6 +486,7 @@ func processStandardInput(output chan Result) { sha3_256_c := make(chan []byte, 10) sha3_384_c := make(chan []byte, 10) sha3_512_c := make(chan []byte, 10) + ed2k_c := make(chan []byte, 10) var wg sync.WaitGroup @@ -606,6 +626,15 @@ func processStandardInput(output chan Result) { wg.Done() }() } + if hasHash(HashNames.Ed2k) { + wg.Add(1) + go func() { + for b := range ed2k_c { + _, _ = ed2k_d.Write(b) + } + wg.Done() + }() + } for { n, err := r.Read(buf[:cap(buf)]) @@ -668,6 +697,9 @@ func processStandardInput(output chan Result) { if hasHash(HashNames.Sha3512) { sha3_512_c <- buf } + if hasHash(HashNames.Ed2k) { + ed2k_c <- buf + } if err != nil && err != io.EOF { log.Fatal(err) @@ -688,6 +720,7 @@ func processStandardInput(output chan Result) { close(sha3_256_c) close(sha3_384_c) close(sha3_512_c) + close(ed2k_c) wg.Wait() @@ -708,6 +741,7 @@ func processStandardInput(output chan Result) { Sha3256: encodeIfHashEnabled(sha3_256_d, HashNames.Sha3256), Sha3384: encodeIfHashEnabled(sha3_384_d, HashNames.Sha3384), Sha3512: encodeIfHashEnabled(sha3_512_d, HashNames.Sha3512), + Ed2k: encodeIfHashEnabled(ed2k_d, HashNames.Ed2k), } close(output) @@ -918,6 +952,21 @@ func processReadFileParallel(filename string, content *[]byte) (Result, error) { }() } + if hasHash(HashNames.Ed2k) { + wg.Add(1) + go func() { + startTime = makeTimestampNano() + d := ed2k.New() + _, _ = d.Write(*content) + result.Ed2k = hex.EncodeToString(d.Sum(nil)) + + if Trace { + printTrace(fmt.Sprintf("nanoseconds processing ed2k: %s: %d", filename, makeTimestampNano()-startTime)) + } + wg.Done() + }() + } + wg.Wait() return result, nil } @@ -1080,6 +1129,17 @@ func processReadFile(filename string, content *[]byte) (Result, error) { } } + if hasHash(HashNames.Ed2k) { + startTime := makeTimestampNano() + d := ed2k.New() + _, _ = d.Write(*content) + result.Ed2k = hex.EncodeToString(d.Sum(nil)) + + if Trace { + printTrace(fmt.Sprintf("nanoseconds processing ed2k: %s: %d", filename, makeTimestampNano()-startTime)) + } + } + return result, nil } diff --git a/test-all.sh b/test-all.sh index 806fb24..103abfa 100755 --- a/test-all.sh +++ b/test-all.sh @@ -181,6 +181,15 @@ else exit fi +if echo "hello" | ./hashit --hash ed2k | grep -q -i '63481c78ae04c201fa01ea9d2b1db56d'; then + echo -e "${GREEN}PASSED stdin ed2k test" +else + echo -e "${RED}=======================================================" + echo -e "FAILED Should be able to process ed2k stdin" + echo -e "=======================================================" + exit +fi + a=$(./hashit --no-stream * | sort | md5sum) b=$(./hashit * | sort | md5sum) if [ "$a" == "$b" ]; then @@ -321,6 +330,18 @@ else exit fi + +mkdir -p /tmp/hashit/ +echo "hello" > /tmp/hashit/file +if hashdeep -r /tmp/hashit/ > audit.txt && hashit -a audit.txt /tmp/hashit/ | grep -q -i 'Audit passed'; then + echo -e "${GREEN}PASSED full hashdeep audit reverse test" +else + echo -e "${RED}=======================================================" + echo -e "FAILED Should be able to create full hashdeep audit reverse" + echo -e "=======================================================" + exit +fi + echo -e "${NC}Cleaning up..." rm ./hashit rm ./audit.txt diff --git a/test-hashdeep.sh b/test-hashdeep.sh new file mode 100755 index 0000000..f8b9be1 --- /dev/null +++ b/test-hashdeep.sh @@ -0,0 +1,177 @@ +#!/bin/bash + +# Exit on error +set -e + +# --- Configuration --- +GREEN='\033[1;32m' +RED='\033[0;31m' +NC='\033[0m' +TEST_DIR="/tmp/hashit-test" +AUDIT_FILE="audit.txt" + +# --- Helper Functions --- +print_pass() { + echo -e "${GREEN}PASSED: $1${NC}" +} + +print_fail() { + echo -e "${RED}FAILED: $1${NC}" + exit 1 +} + +# --- Setup and Cleanup --- +setup() { + echo "Setting up test environment in $TEST_DIR..." + rm -rf "$TEST_DIR" + mkdir -p "$TEST_DIR/dir1" + mkdir -p "$TEST_DIR/dir2" + echo "file1" > "$TEST_DIR/dir1/file1.txt" + echo "file2" > "$TEST_DIR/dir1/file2.txt" + echo "file3" > "$TEST_DIR/dir2/file3.txt" + echo "unique" > "$TEST_DIR/unique_file.txt" + echo "Building hashit..." + go build -ldflags="-s -w" +} + +cleanup() { + echo "Cleaning up..." + rm -rf "$TEST_DIR" + rm -f "$AUDIT_FILE" + rm -f ./hashit +} + +# --- Prerequisite Check --- +check_hashdeep() { + if ! command -v hashdeep &> /dev/null; then + echo "hashdeep could not be found. Please install it to run these tests." + exit 1 + fi + echo "hashdeep found." +} + +# --- Test Cases --- + +test_audit_success_hashit_to_hashdeep() { + echo "Running Test: Audit Success (hashit -> hashdeep)" + ./hashit --format hashdeep "$TEST_DIR" > "$AUDIT_FILE" + if hashdeep -l -r -a -k "$AUDIT_FILE" "$TEST_DIR" | grep -q 'Audit passed'; then + print_pass "hashit created a valid audit file for hashdeep" + else + print_fail "hashit did not create a valid audit file for hashdeep" + fi +} + +test_audit_success_hashdeep_to_hashit() { + echo "Running Test: Audit Success (hashdeep -> hashit)" + hashdeep -l -r "$TEST_DIR" > "$AUDIT_FILE" + if ./hashit -a "$AUDIT_FILE" "$TEST_DIR" | grep -q 'Audit passed'; then + print_pass "hashit correctly passed a hashdeep audit file" + else + print_fail "hashit did not pass a hashdeep audit file" + fi +} + +test_modified_file() { + echo "Running Test: Modified File Detection" + hashdeep -l -r "$TEST_DIR" > "$AUDIT_FILE" + echo "modified" >> "$TEST_DIR/dir1/file1.txt" + + output=$(./hashit -a "$AUDIT_FILE" "$TEST_DIR" || true) + + if echo "$output" | grep -q 'Audit failed' && echo "$output" | grep -q 'Files modified: 1'; then + print_pass "Correctly detected 1 modified file" + else + print_fail "Failed to detect 1 modified file. Output:\n$output" + fi +} + +test_new_file() { + echo "Running Test: New File Detection" + hashdeep -l -r "$TEST_DIR" > "$AUDIT_FILE" + echo "new file" > "$TEST_DIR/new_file.txt" + + output=$(./hashit -a "$AUDIT_FILE" "$TEST_DIR" || true) + + if echo "$output" | grep -q 'Audit failed' && echo "$output" | grep -q 'New files found: 1'; then + print_pass "Correctly detected 1 new file" + else + print_fail "Failed to detect 1 new file. Output:\n$output" + fi +} + +test_missing_file() { + echo "Running Test: Missing File Detection" + hashdeep -l -r "$TEST_DIR" > "$AUDIT_FILE" # This creates audit.txt + rm "$TEST_DIR/dir1/file1.txt" # This deletes a file from the test directory + + ls -l "$AUDIT_FILE" # Debugging line + + # This is where hashit is called, and it reports audit.txt missing + output=$(./hashit -a "$AUDIT_FILE" "$TEST_DIR" --debug 2>&1 || true) + + # The current implementation will show 1 missing file, which is what we want to test against. + # When the logic is improved, this test should still pass but for a different reason. + if echo "$output" | grep -q 'Audit failed' && echo "$output" | grep -q 'Files missing: 1'; then + print_pass "Correctly detected 1 missing file" + else + print_fail "Failed to detect 1 missing file. Output:\n$output" + fi +} + +test_moved_file() { + echo "Running Test: Moved File Detection" + hashdeep -l -r "$TEST_DIR" > "$AUDIT_FILE" + mv "$TEST_DIR/dir1/file1.txt" "$TEST_DIR/dir2/file1_moved.txt" + + output=$(./hashit -a "$AUDIT_FILE" "$TEST_DIR" || true) + + # This test WILL FAIL until the TODOs are implemented. + # The desired output is 'Files moved: 1'. + # The current (broken) output will be 'New files found: 1' and 'Files missing: 1'. + if echo "$output" | grep -q 'Audit failed' && echo "$output" | grep -q 'Files moved: 1'; then + print_pass "Correctly detected 1 moved file" + else + echo "NOTE: This test is expected to fail until the audit logic is implemented." + print_fail "Failed to detect 1 moved file. Output:\n$output" + fi +} + + +# --- Main Execution --- +trap cleanup EXIT + +check_hashdeep + +# Run tests +setup +test_audit_success_hashit_to_hashdeep +cleanup + +setup +test_audit_success_hashdeep_to_hashit +cleanup + +setup +test_modified_file +cleanup + +setup +test_new_file +cleanup + +setup +test_missing_file +cleanup + +# This test is expected to fail for now. +# I'm including it as per the plan. +# If you want me to remove it until the logic is implemented, let me know. +setup +test_moved_file +cleanup + + +echo -e "${GREEN}=================================================" +echo -e "ALL HASHDEEP TESTS PASSED (or failed as expected)" +echo -e "=================================================" diff --git a/vendor/go.felesatra.moe/hash/ed2k/LICENSE b/vendor/go.felesatra.moe/hash/ed2k/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/vendor/go.felesatra.moe/hash/ed2k/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/go.felesatra.moe/hash/ed2k/README.md b/vendor/go.felesatra.moe/hash/ed2k/README.md new file mode 100644 index 0000000..ff08326 --- /dev/null +++ b/vendor/go.felesatra.moe/hash/ed2k/README.md @@ -0,0 +1,3 @@ +# ed2k-go + +[![Go Reference](https://pkg.go.dev/badge/go.felesatra.moe/hash/ed2k.svg)](https://pkg.go.dev/go.felesatra.moe/hash/ed2k) diff --git a/vendor/go.felesatra.moe/hash/ed2k/ed2k.go b/vendor/go.felesatra.moe/hash/ed2k/ed2k.go new file mode 100644 index 0000000..df22fb7 --- /dev/null +++ b/vendor/go.felesatra.moe/hash/ed2k/ed2k.go @@ -0,0 +1,107 @@ +// Copyright (C) 2021 Allen Li +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// Package ed2k implements the eD2k hash. +// +// See https://en.wikipedia.org/wiki/Ed2k_URI_scheme. +package ed2k + +import ( + "hash" + + "golang.org/x/crypto/md4" +) + +// The blocksize of eD2k in bytes. +const BlockSize = md4.BlockSize + +// The size of an eD2k checksum in bytes. +const Size = md4.Size + +// The chunk size of eD2k in bytes. +const ChunkSize = 9728000 + +// A Hash is an implementation of hash.Hash for eD2k. +type Hash struct { + // Total bytes written so far. + written int64 + hashlist []byte + subhash hash.Hash +} + +// New returns a new Hash computing the eD2k checksum. +func New() *Hash { + return &Hash{ + subhash: md4.New(), + } +} + +// Write adds more data to the running hash. +// It never returns an error. +func (h *Hash) Write(p []byte) (int, error) { + total := len(p) + for len(p) > 0 { + p2 := h.limitNextChunk(p) + n, _ := h.subhash.Write(p2) + h.written += int64(n) + p = p[n:] + if h.written%ChunkSize == 0 { + h.hashlist = h.subhash.Sum(h.hashlist) + h.subhash.Reset() + } + } + return total, nil +} + +// limitNextChunk limits the input slice to at most the next chunk to write. +func (h *Hash) limitNextChunk(b []byte) []byte { + remainder := ChunkSize - int(h.written%ChunkSize) + if len(b) > remainder { + return b[:remainder] + } + return b +} + +// Sum appends the current hash to b and returns the resulting slice. +// It does not change the underlying hash state. +func (h *Hash) Sum(b []byte) []byte { + if h.written < ChunkSize { + return h.subhash.Sum(b) + } + if h.written == ChunkSize { + return append(b, h.hashlist...) + } + h2 := md4.New() + h2.Write(h.hashlist) + return h2.Sum(b) +} + +// Reset resets the Hash to its initial state. +func (h *Hash) Reset() { + h.written = 0 + h.hashlist = h.hashlist[:0] +} + +// Size returns the number of bytes Sum will return. +func (h *Hash) Size() int { + return Size +} + +// BlockSize returns the hash's underlying block size. +// The Write method must be able to accept any amount +// of data, but it may operate more efficiently if all writes +// are a multiple of the block size. +func (h *Hash) BlockSize() int { + return BlockSize +} diff --git a/vendor/golang.org/x/exp/LICENSE b/vendor/golang.org/x/exp/LICENSE index 6a66aea..2a7cf70 100644 --- a/vendor/golang.org/x/exp/LICENSE +++ b/vendor/golang.org/x/exp/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2009 The Go Authors. All rights reserved. +Copyright 2009 The Go Authors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are @@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer. copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. - * Neither the name of Google Inc. nor the names of its + * Neither the name of Google LLC nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. diff --git a/vendor/golang.org/x/exp/constraints/constraints.go b/vendor/golang.org/x/exp/constraints/constraints.go index 2c033df..9d260ba 100644 --- a/vendor/golang.org/x/exp/constraints/constraints.go +++ b/vendor/golang.org/x/exp/constraints/constraints.go @@ -6,6 +6,8 @@ // with type parameters. package constraints +import "cmp" + // Signed is a constraint that permits any signed integer type. // If future releases of Go add new predeclared signed integer types, // this constraint will be modified to include them. @@ -45,6 +47,8 @@ type Complex interface { // that supports the operators < <= >= >. // If future releases of Go add new ordered types, // this constraint will be modified to include them. -type Ordered interface { - Integer | Float | ~string -} +// +// This type is redundant since Go 1.21 introduced [cmp.Ordered]. +// +//go:fix inline +type Ordered = cmp.Ordered diff --git a/vendor/golang.org/x/sys/cpu/cpu.go b/vendor/golang.org/x/sys/cpu/cpu.go index 9c105f2..6354199 100644 --- a/vendor/golang.org/x/sys/cpu/cpu.go +++ b/vendor/golang.org/x/sys/cpu/cpu.go @@ -149,6 +149,18 @@ var ARM struct { _ CacheLinePad } +// The booleans in Loong64 contain the correspondingly named cpu feature bit. +// The struct is padded to avoid false sharing. +var Loong64 struct { + _ CacheLinePad + HasLSX bool // support 128-bit vector extension + HasLASX bool // support 256-bit vector extension + HasCRC32 bool // support CRC instruction + HasLAM_BH bool // support AM{SWAP/ADD}[_DB].{B/H} instruction + HasLAMCAS bool // support AMCAS[_DB].{B/H/W/D} instruction + _ CacheLinePad +} + // MIPS64X contains the supported CPU features of the current mips64/mips64le // platforms. If the current platform is not mips64/mips64le or the current // operating system is not Linux then all feature flags are false. @@ -220,6 +232,17 @@ var RISCV64 struct { HasZba bool // Address generation instructions extension HasZbb bool // Basic bit-manipulation extension HasZbs bool // Single-bit instructions extension + HasZvbb bool // Vector Basic Bit-manipulation + HasZvbc bool // Vector Carryless Multiplication + HasZvkb bool // Vector Cryptography Bit-manipulation + HasZvkt bool // Vector Data-Independent Execution Latency + HasZvkg bool // Vector GCM/GMAC + HasZvkn bool // NIST Algorithm Suite (AES/SHA256/SHA512) + HasZvknc bool // NIST Algorithm Suite with carryless multiply + HasZvkng bool // NIST Algorithm Suite with GCM + HasZvks bool // ShangMi Algorithm Suite + HasZvksc bool // ShangMi Algorithm Suite with carryless multiplication + HasZvksg bool // ShangMi Algorithm Suite with GCM _ CacheLinePad } diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go new file mode 100644 index 0000000..4f34114 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go @@ -0,0 +1,22 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cpu + +// HWCAP bits. These are exposed by the Linux kernel. +const ( + hwcap_LOONGARCH_LSX = 1 << 4 + hwcap_LOONGARCH_LASX = 1 << 5 +) + +func doinit() { + // TODO: Features that require kernel support like LSX and LASX can + // be detected here once needed in std library or by the compiler. + Loong64.HasLSX = hwcIsSet(hwCap, hwcap_LOONGARCH_LSX) + Loong64.HasLASX = hwcIsSet(hwCap, hwcap_LOONGARCH_LASX) +} + +func hwcIsSet(hwc uint, val uint) bool { + return hwc&val != 0 +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go index 7d902b6..a428dec 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_noinit.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 +//go:build linux && !arm && !arm64 && !loong64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 package cpu diff --git a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go index cb4a0c5..ad74153 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_linux_riscv64.go @@ -58,6 +58,15 @@ const ( riscv_HWPROBE_EXT_ZBA = 0x8 riscv_HWPROBE_EXT_ZBB = 0x10 riscv_HWPROBE_EXT_ZBS = 0x20 + riscv_HWPROBE_EXT_ZVBB = 0x20000 + riscv_HWPROBE_EXT_ZVBC = 0x40000 + riscv_HWPROBE_EXT_ZVKB = 0x80000 + riscv_HWPROBE_EXT_ZVKG = 0x100000 + riscv_HWPROBE_EXT_ZVKNED = 0x200000 + riscv_HWPROBE_EXT_ZVKNHB = 0x800000 + riscv_HWPROBE_EXT_ZVKSED = 0x1000000 + riscv_HWPROBE_EXT_ZVKSH = 0x2000000 + riscv_HWPROBE_EXT_ZVKT = 0x4000000 riscv_HWPROBE_KEY_CPUPERF_0 = 0x5 riscv_HWPROBE_MISALIGNED_FAST = 0x3 riscv_HWPROBE_MISALIGNED_MASK = 0x7 @@ -99,6 +108,20 @@ func doinit() { RISCV64.HasZba = isSet(v, riscv_HWPROBE_EXT_ZBA) RISCV64.HasZbb = isSet(v, riscv_HWPROBE_EXT_ZBB) RISCV64.HasZbs = isSet(v, riscv_HWPROBE_EXT_ZBS) + RISCV64.HasZvbb = isSet(v, riscv_HWPROBE_EXT_ZVBB) + RISCV64.HasZvbc = isSet(v, riscv_HWPROBE_EXT_ZVBC) + RISCV64.HasZvkb = isSet(v, riscv_HWPROBE_EXT_ZVKB) + RISCV64.HasZvkg = isSet(v, riscv_HWPROBE_EXT_ZVKG) + RISCV64.HasZvkt = isSet(v, riscv_HWPROBE_EXT_ZVKT) + // Cryptography shorthand extensions + RISCV64.HasZvkn = isSet(v, riscv_HWPROBE_EXT_ZVKNED) && + isSet(v, riscv_HWPROBE_EXT_ZVKNHB) && RISCV64.HasZvkb && RISCV64.HasZvkt + RISCV64.HasZvknc = RISCV64.HasZvkn && RISCV64.HasZvbc + RISCV64.HasZvkng = RISCV64.HasZvkn && RISCV64.HasZvkg + RISCV64.HasZvks = isSet(v, riscv_HWPROBE_EXT_ZVKSED) && + isSet(v, riscv_HWPROBE_EXT_ZVKSH) && RISCV64.HasZvkb && RISCV64.HasZvkt + RISCV64.HasZvksc = RISCV64.HasZvks && RISCV64.HasZvbc + RISCV64.HasZvksg = RISCV64.HasZvks && RISCV64.HasZvkg } if pairs[1].key != -1 { v := pairs[1].value & riscv_HWPROBE_MISALIGNED_MASK diff --git a/vendor/golang.org/x/sys/cpu/cpu_loong64.go b/vendor/golang.org/x/sys/cpu/cpu_loong64.go index 5586358..45ecb29 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_loong64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_loong64.go @@ -8,5 +8,43 @@ package cpu const cacheLineSize = 64 +// Bit fields for CPUCFG registers, Related reference documents: +// https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_cpucfg +const ( + // CPUCFG1 bits + cpucfg1_CRC32 = 1 << 25 + + // CPUCFG2 bits + cpucfg2_LAM_BH = 1 << 27 + cpucfg2_LAMCAS = 1 << 28 +) + func initOptions() { + options = []option{ + {Name: "lsx", Feature: &Loong64.HasLSX}, + {Name: "lasx", Feature: &Loong64.HasLASX}, + {Name: "crc32", Feature: &Loong64.HasCRC32}, + {Name: "lam_bh", Feature: &Loong64.HasLAM_BH}, + {Name: "lamcas", Feature: &Loong64.HasLAMCAS}, + } + + // The CPUCFG data on Loong64 only reflects the hardware capabilities, + // not the kernel support status, so features such as LSX and LASX that + // require kernel support cannot be obtained from the CPUCFG data. + // + // These features only require hardware capability support and do not + // require kernel specific support, so they can be obtained directly + // through CPUCFG + cfg1 := get_cpucfg(1) + cfg2 := get_cpucfg(2) + + Loong64.HasCRC32 = cfgIsSet(cfg1, cpucfg1_CRC32) + Loong64.HasLAMCAS = cfgIsSet(cfg2, cpucfg2_LAMCAS) + Loong64.HasLAM_BH = cfgIsSet(cfg2, cpucfg2_LAM_BH) +} + +func get_cpucfg(reg uint32) uint32 + +func cfgIsSet(cfg uint32, val uint32) bool { + return cfg&val != 0 } diff --git a/vendor/golang.org/x/sys/cpu/cpu_loong64.s b/vendor/golang.org/x/sys/cpu/cpu_loong64.s new file mode 100644 index 0000000..71cbaf1 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_loong64.s @@ -0,0 +1,13 @@ +// Copyright 2025 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#include "textflag.h" + +// func get_cpucfg(reg uint32) uint32 +TEXT ·get_cpucfg(SB), NOSPLIT|NOFRAME, $0 + MOVW reg+0(FP), R5 + // CPUCFG R5, R4 = 0x00006ca4 + WORD $0x00006ca4 + MOVW R4, ret+8(FP) + RET diff --git a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go index aca3199..0f617ae 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_riscv64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_riscv64.go @@ -16,5 +16,17 @@ func initOptions() { {Name: "zba", Feature: &RISCV64.HasZba}, {Name: "zbb", Feature: &RISCV64.HasZbb}, {Name: "zbs", Feature: &RISCV64.HasZbs}, + // RISC-V Cryptography Extensions + {Name: "zvbb", Feature: &RISCV64.HasZvbb}, + {Name: "zvbc", Feature: &RISCV64.HasZvbc}, + {Name: "zvkb", Feature: &RISCV64.HasZvkb}, + {Name: "zvkg", Feature: &RISCV64.HasZvkg}, + {Name: "zvkt", Feature: &RISCV64.HasZvkt}, + {Name: "zvkn", Feature: &RISCV64.HasZvkn}, + {Name: "zvknc", Feature: &RISCV64.HasZvknc}, + {Name: "zvkng", Feature: &RISCV64.HasZvkng}, + {Name: "zvks", Feature: &RISCV64.HasZvks}, + {Name: "zvksc", Feature: &RISCV64.HasZvksc}, + {Name: "zvksg", Feature: &RISCV64.HasZvksg}, } } diff --git a/vendor/golang.org/x/sys/cpu/parse.go b/vendor/golang.org/x/sys/cpu/parse.go index 762b63d..56a7e1a 100644 --- a/vendor/golang.org/x/sys/cpu/parse.go +++ b/vendor/golang.org/x/sys/cpu/parse.go @@ -13,7 +13,7 @@ import "strconv" // https://golang.org/cl/209597. func parseRelease(rel string) (major, minor, patch int, ok bool) { // Strip anything after a dash or plus. - for i := 0; i < len(rel); i++ { + for i := range len(rel) { if rel[i] == '-' || rel[i] == '+' { rel = rel[:i] break @@ -21,7 +21,7 @@ func parseRelease(rel string) (major, minor, patch int, ok bool) { } next := func() (int, bool) { - for i := 0; i < len(rel); i++ { + for i := range len(rel) { if rel[i] == '.' { ver, err := strconv.Atoi(rel[:i]) rel = rel[i+1:] diff --git a/vendor/golang.org/x/sys/unix/affinity_linux.go b/vendor/golang.org/x/sys/unix/affinity_linux.go index 6e5c81a..3c7a6d6 100644 --- a/vendor/golang.org/x/sys/unix/affinity_linux.go +++ b/vendor/golang.org/x/sys/unix/affinity_linux.go @@ -38,9 +38,7 @@ func SchedSetaffinity(pid int, set *CPUSet) error { // Zero clears the set s, so that it contains no CPUs. func (s *CPUSet) Zero() { - for i := range s { - s[i] = 0 - } + clear(s[:]) } func cpuBitsIndex(cpu int) int { diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index 6ab02b6..d1c8b26 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -349,6 +349,9 @@ struct ltchars { #define _HIDIOCGRAWPHYS HIDIOCGRAWPHYS(_HIDIOCGRAWPHYS_LEN) #define _HIDIOCGRAWUNIQ HIDIOCGRAWUNIQ(_HIDIOCGRAWUNIQ_LEN) +// Renamed in v6.16, commit c6d732c38f93 ("net: ethtool: remove duplicate defines for family info") +#define ETHTOOL_FAMILY_NAME ETHTOOL_GENL_NAME +#define ETHTOOL_FAMILY_VERSION ETHTOOL_GENL_VERSION ' includes_NetBSD=' diff --git a/vendor/golang.org/x/sys/unix/syscall_darwin.go b/vendor/golang.org/x/sys/unix/syscall_darwin.go index 099867d..7838ca5 100644 --- a/vendor/golang.org/x/sys/unix/syscall_darwin.go +++ b/vendor/golang.org/x/sys/unix/syscall_darwin.go @@ -602,6 +602,95 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI return } +const minIovec = 8 + +func Readv(fd int, iovs [][]byte) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = readv(fd, iovecs) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + n, err = preadv(fd, iovecs, offset) + readvRacedetect(iovecs, n, err) + return n, err +} + +func Writev(fd int, iovs [][]byte) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = writev(fd, iovecs) + writevRacedetect(iovecs, n) + return n, err +} + +func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) { + iovecs := make([]Iovec, 0, minIovec) + iovecs = appendBytes(iovecs, iovs) + if raceenabled { + raceReleaseMerge(unsafe.Pointer(&ioSync)) + } + n, err = pwritev(fd, iovecs, offset) + writevRacedetect(iovecs, n) + return n, err +} + +func appendBytes(vecs []Iovec, bs [][]byte) []Iovec { + for _, b := range bs { + var v Iovec + v.SetLen(len(b)) + if len(b) > 0 { + v.Base = &b[0] + } else { + v.Base = (*byte)(unsafe.Pointer(&_zero)) + } + vecs = append(vecs, v) + } + return vecs +} + +func writevRacedetect(iovecs []Iovec, n int) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceReadRange(unsafe.Pointer(iovecs[i].Base), m) + } + } +} + +func readvRacedetect(iovecs []Iovec, n int, err error) { + if !raceenabled { + return + } + for i := 0; n > 0 && i < len(iovecs); i++ { + m := int(iovecs[i].Len) + if m > n { + m = n + } + n -= m + if m > 0 { + raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) + } + } + if err == nil { + raceAcquire(unsafe.Pointer(&ioSync)) + } +} + //sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) @@ -705,3 +794,7 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI //sys write(fd int, p []byte) (n int, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys munmap(addr uintptr, length uintptr) (err error) +//sys readv(fd int, iovecs []Iovec) (n int, err error) +//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) +//sys writev(fd int, iovecs []Iovec) (n int, err error) +//sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index 230a945..4958a65 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -13,6 +13,7 @@ package unix import ( "encoding/binary" + "slices" "strconv" "syscall" "time" @@ -417,7 +418,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) { return nil, 0, EINVAL } sa.raw.Family = AF_UNIX - for i := 0; i < n; i++ { + for i := range n { sa.raw.Path[i] = int8(name[i]) } // length is family (uint16), name, NUL. @@ -507,7 +508,7 @@ func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) { psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm)) psm[0] = byte(sa.PSM) psm[1] = byte(sa.PSM >> 8) - for i := 0; i < len(sa.Addr); i++ { + for i := range len(sa.Addr) { sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i] } cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid)) @@ -589,11 +590,11 @@ func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i] = rx[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i+4] = tx[i] } return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil @@ -618,11 +619,11 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) { sa.raw.Family = AF_CAN sa.raw.Ifindex = int32(sa.Ifindex) n := (*[8]byte)(unsafe.Pointer(&sa.Name)) - for i := 0; i < 8; i++ { + for i := range 8 { sa.raw.Addr[i] = n[i] } p := (*[4]byte)(unsafe.Pointer(&sa.PGN)) - for i := 0; i < 4; i++ { + for i := range 4 { sa.raw.Addr[i+8] = p[i] } sa.raw.Addr[12] = sa.Addr @@ -911,7 +912,7 @@ func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) { // These are EBCDIC encoded by the kernel, but we still need to pad them // with blanks. Initializing with blanks allows the caller to feed in either // a padded or an unpadded string. - for i := 0; i < 8; i++ { + for i := range 8 { sa.raw.Nodeid[i] = ' ' sa.raw.User_id[i] = ' ' sa.raw.Name[i] = ' ' @@ -1148,7 +1149,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { var user [8]byte var name [8]byte - for i := 0; i < 8; i++ { + for i := range 8 { user[i] = byte(pp.User_id[i]) name[i] = byte(pp.Name[i]) } @@ -1173,11 +1174,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { Ifindex: int(pp.Ifindex), } name := (*[8]byte)(unsafe.Pointer(&sa.Name)) - for i := 0; i < 8; i++ { + for i := range 8 { name[i] = pp.Addr[i] } pgn := (*[4]byte)(unsafe.Pointer(&sa.PGN)) - for i := 0; i < 4; i++ { + for i := range 4 { pgn[i] = pp.Addr[i+8] } addr := (*[1]byte)(unsafe.Pointer(&sa.Addr)) @@ -1188,11 +1189,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) { Ifindex: int(pp.Ifindex), } rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) - for i := 0; i < 4; i++ { + for i := range 4 { rx[i] = pp.Addr[i] } tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) - for i := 0; i < 4; i++ { + for i := range 4 { tx[i] = pp.Addr[i+4] } return sa, nil @@ -2216,10 +2217,7 @@ func readvRacedetect(iovecs []Iovec, n int, err error) { return } for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } + m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) @@ -2270,10 +2268,7 @@ func writevRacedetect(iovecs []Iovec, n int) { return } for i := 0; n > 0 && i < len(iovecs); i++ { - m := int(iovecs[i].Len) - if m > n { - m = n - } + m := min(int(iovecs[i].Len), n) n -= m if m > 0 { raceReadRange(unsafe.Pointer(iovecs[i].Base), m) @@ -2320,12 +2315,7 @@ func isGroupMember(gid int) bool { return false } - for _, g := range groups { - if g == gid { - return true - } - } - return false + return slices.Contains(groups, gid) } func isCapDacOverrideSet() bool { diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index abc3955..18a3d9b 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -629,7 +629,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e //sys Kill(pid int, signum syscall.Signal) (err error) //sys Lchown(path string, uid int, gid int) (err error) //sys Link(path string, link string) (err error) -//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_llisten +//sys Listen(s int, backlog int) (err error) = libsocket.__xnet_listen //sys Lstat(path string, stat *Stat_t) (err error) //sys Madvise(b []byte, advice int) (err error) //sys Mkdir(path string, mode uint32) (err error) diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 4f432bf..b6db27d 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -319,6 +319,7 @@ const ( AUDIT_INTEGRITY_POLICY_RULE = 0x70f AUDIT_INTEGRITY_RULE = 0x70d AUDIT_INTEGRITY_STATUS = 0x70a + AUDIT_INTEGRITY_USERSPACE = 0x710 AUDIT_IPC = 0x517 AUDIT_IPC_SET_PERM = 0x51f AUDIT_IPE_ACCESS = 0x58c @@ -327,6 +328,8 @@ const ( AUDIT_KERNEL = 0x7d0 AUDIT_KERNEL_OTHER = 0x524 AUDIT_KERN_MODULE = 0x532 + AUDIT_LANDLOCK_ACCESS = 0x58f + AUDIT_LANDLOCK_DOMAIN = 0x590 AUDIT_LAST_FEATURE = 0x1 AUDIT_LAST_KERN_ANOM_MSG = 0x707 AUDIT_LAST_USER_MSG = 0x4af @@ -491,6 +494,7 @@ const ( BPF_F_BEFORE = 0x8 BPF_F_ID = 0x20 BPF_F_NETFILTER_IP_DEFRAG = 0x1 + BPF_F_PREORDER = 0x40 BPF_F_QUERY_EFFECTIVE = 0x1 BPF_F_REDIRECT_FLAGS = 0x19 BPF_F_REPLACE = 0x4 @@ -527,6 +531,7 @@ const ( BPF_LDX = 0x1 BPF_LEN = 0x80 BPF_LL_OFF = -0x200000 + BPF_LOAD_ACQ = 0x100 BPF_LSH = 0x60 BPF_MAJOR_VERSION = 0x1 BPF_MAXINSNS = 0x1000 @@ -554,6 +559,7 @@ const ( BPF_RET = 0x6 BPF_RSH = 0x70 BPF_ST = 0x2 + BPF_STORE_REL = 0x110 BPF_STX = 0x3 BPF_SUB = 0x10 BPF_TAG_SIZE = 0x8 @@ -843,9 +849,9 @@ const ( DM_UUID_FLAG = 0x4000 DM_UUID_LEN = 0x81 DM_VERSION = 0xc138fd00 - DM_VERSION_EXTRA = "-ioctl (2023-03-01)" + DM_VERSION_EXTRA = "-ioctl (2025-04-28)" DM_VERSION_MAJOR = 0x4 - DM_VERSION_MINOR = 0x30 + DM_VERSION_MINOR = 0x32 DM_VERSION_PATCHLEVEL = 0x0 DT_BLK = 0x6 DT_CHR = 0x2 @@ -936,11 +942,10 @@ const ( EPOLL_CTL_MOD = 0x3 EPOLL_IOC_TYPE = 0x8a EROFS_SUPER_MAGIC_V1 = 0xe0f5e1e2 - ESP_V4_FLOW = 0xa - ESP_V6_FLOW = 0xc - ETHER_FLOW = 0x12 ETHTOOL_BUSINFO_LEN = 0x20 ETHTOOL_EROMVERS_LEN = 0x20 + ETHTOOL_FAMILY_NAME = "ethtool" + ETHTOOL_FAMILY_VERSION = 0x1 ETHTOOL_FEC_AUTO = 0x2 ETHTOOL_FEC_BASER = 0x10 ETHTOOL_FEC_LLRS = 0x20 @@ -1203,13 +1208,18 @@ const ( FAN_DENY = 0x2 FAN_ENABLE_AUDIT = 0x40 FAN_EPIDFD = -0x2 + FAN_ERRNO_BITS = 0x8 + FAN_ERRNO_MASK = 0xff + FAN_ERRNO_SHIFT = 0x18 FAN_EVENT_INFO_TYPE_DFID = 0x3 FAN_EVENT_INFO_TYPE_DFID_NAME = 0x2 FAN_EVENT_INFO_TYPE_ERROR = 0x5 FAN_EVENT_INFO_TYPE_FID = 0x1 + FAN_EVENT_INFO_TYPE_MNT = 0x7 FAN_EVENT_INFO_TYPE_NEW_DFID_NAME = 0xc FAN_EVENT_INFO_TYPE_OLD_DFID_NAME = 0xa FAN_EVENT_INFO_TYPE_PIDFD = 0x4 + FAN_EVENT_INFO_TYPE_RANGE = 0x6 FAN_EVENT_METADATA_LEN = 0x18 FAN_EVENT_ON_CHILD = 0x8000000 FAN_FS_ERROR = 0x8000 @@ -1224,9 +1234,12 @@ const ( FAN_MARK_IGNORED_SURV_MODIFY = 0x40 FAN_MARK_IGNORE_SURV = 0x440 FAN_MARK_INODE = 0x0 + FAN_MARK_MNTNS = 0x110 FAN_MARK_MOUNT = 0x10 FAN_MARK_ONLYDIR = 0x8 FAN_MARK_REMOVE = 0x2 + FAN_MNT_ATTACH = 0x1000000 + FAN_MNT_DETACH = 0x2000000 FAN_MODIFY = 0x2 FAN_MOVE = 0xc0 FAN_MOVED_FROM = 0x40 @@ -1240,6 +1253,7 @@ const ( FAN_OPEN_EXEC = 0x1000 FAN_OPEN_EXEC_PERM = 0x40000 FAN_OPEN_PERM = 0x10000 + FAN_PRE_ACCESS = 0x100000 FAN_Q_OVERFLOW = 0x4000 FAN_RENAME = 0x10000000 FAN_REPORT_DFID_NAME = 0xc00 @@ -1247,6 +1261,7 @@ const ( FAN_REPORT_DIR_FID = 0x400 FAN_REPORT_FD_ERROR = 0x2000 FAN_REPORT_FID = 0x200 + FAN_REPORT_MNT = 0x4000 FAN_REPORT_NAME = 0x800 FAN_REPORT_PIDFD = 0x80 FAN_REPORT_TARGET_FID = 0x1000 @@ -1266,6 +1281,7 @@ const ( FIB_RULE_PERMANENT = 0x1 FIB_RULE_UNRESOLVED = 0x4 FIDEDUPERANGE = 0xc0189436 + FSCRYPT_ADD_KEY_FLAG_HW_WRAPPED = 0x1 FSCRYPT_KEY_DESCRIPTOR_SIZE = 0x8 FSCRYPT_KEY_DESC_PREFIX = "fscrypt:" FSCRYPT_KEY_DESC_PREFIX_SIZE = 0x8 @@ -1574,7 +1590,6 @@ const ( IPV6_DONTFRAG = 0x3e IPV6_DROP_MEMBERSHIP = 0x15 IPV6_DSTOPTS = 0x3b - IPV6_FLOW = 0x11 IPV6_FREEBIND = 0x4e IPV6_HDRINCL = 0x24 IPV6_HOPLIMIT = 0x34 @@ -1625,7 +1640,6 @@ const ( IPV6_TRANSPARENT = 0x4b IPV6_UNICAST_HOPS = 0x10 IPV6_UNICAST_IF = 0x4c - IPV6_USER_FLOW = 0xe IPV6_V6ONLY = 0x1a IPV6_VERSION = 0x60 IPV6_VERSION_MASK = 0xf0 @@ -1687,7 +1701,6 @@ const ( IP_TTL = 0x2 IP_UNBLOCK_SOURCE = 0x25 IP_UNICAST_IF = 0x32 - IP_USER_FLOW = 0xd IP_XFRM_POLICY = 0x11 ISOFS_SUPER_MAGIC = 0x9660 ISTRIP = 0x20 @@ -1809,7 +1822,11 @@ const ( LANDLOCK_ACCESS_FS_WRITE_FILE = 0x2 LANDLOCK_ACCESS_NET_BIND_TCP = 0x1 LANDLOCK_ACCESS_NET_CONNECT_TCP = 0x2 + LANDLOCK_CREATE_RULESET_ERRATA = 0x2 LANDLOCK_CREATE_RULESET_VERSION = 0x1 + LANDLOCK_RESTRICT_SELF_LOG_NEW_EXEC_ON = 0x2 + LANDLOCK_RESTRICT_SELF_LOG_SAME_EXEC_OFF = 0x1 + LANDLOCK_RESTRICT_SELF_LOG_SUBDOMAINS_OFF = 0x4 LANDLOCK_SCOPE_ABSTRACT_UNIX_SOCKET = 0x1 LANDLOCK_SCOPE_SIGNAL = 0x2 LINUX_REBOOT_CMD_CAD_OFF = 0x0 @@ -2485,6 +2502,10 @@ const ( PR_FP_EXC_UND = 0x40000 PR_FP_MODE_FR = 0x1 PR_FP_MODE_FRE = 0x2 + PR_FUTEX_HASH = 0x4e + PR_FUTEX_HASH_GET_IMMUTABLE = 0x3 + PR_FUTEX_HASH_GET_SLOTS = 0x2 + PR_FUTEX_HASH_SET_SLOTS = 0x1 PR_GET_AUXV = 0x41555856 PR_GET_CHILD_SUBREAPER = 0x25 PR_GET_DUMPABLE = 0x3 @@ -2644,6 +2665,10 @@ const ( PR_TAGGED_ADDR_ENABLE = 0x1 PR_TASK_PERF_EVENTS_DISABLE = 0x1f PR_TASK_PERF_EVENTS_ENABLE = 0x20 + PR_TIMER_CREATE_RESTORE_IDS = 0x4d + PR_TIMER_CREATE_RESTORE_IDS_GET = 0x2 + PR_TIMER_CREATE_RESTORE_IDS_OFF = 0x0 + PR_TIMER_CREATE_RESTORE_IDS_ON = 0x1 PR_TIMING_STATISTICAL = 0x0 PR_TIMING_TIMESTAMP = 0x1 PR_TSC_ENABLE = 0x1 @@ -2724,6 +2749,7 @@ const ( PTRACE_SETREGSET = 0x4205 PTRACE_SETSIGINFO = 0x4203 PTRACE_SETSIGMASK = 0x420b + PTRACE_SET_SYSCALL_INFO = 0x4212 PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG = 0x4210 PTRACE_SINGLESTEP = 0x9 PTRACE_SYSCALL = 0x18 @@ -2787,7 +2813,7 @@ const ( RTAX_UNSPEC = 0x0 RTAX_WINDOW = 0x3 RTA_ALIGNTO = 0x4 - RTA_MAX = 0x1e + RTA_MAX = 0x1f RTCF_DIRECTSRC = 0x4000000 RTCF_DOREDIRECT = 0x1000000 RTCF_LOG = 0x2000000 @@ -2864,10 +2890,12 @@ const ( RTM_DELACTION = 0x31 RTM_DELADDR = 0x15 RTM_DELADDRLABEL = 0x49 + RTM_DELANYCAST = 0x3d RTM_DELCHAIN = 0x65 RTM_DELLINK = 0x11 RTM_DELLINKPROP = 0x6d RTM_DELMDB = 0x55 + RTM_DELMULTICAST = 0x39 RTM_DELNEIGH = 0x1d RTM_DELNETCONF = 0x51 RTM_DELNEXTHOP = 0x69 @@ -2917,11 +2945,13 @@ const ( RTM_NEWACTION = 0x30 RTM_NEWADDR = 0x14 RTM_NEWADDRLABEL = 0x48 + RTM_NEWANYCAST = 0x3c RTM_NEWCACHEREPORT = 0x60 RTM_NEWCHAIN = 0x64 RTM_NEWLINK = 0x10 RTM_NEWLINKPROP = 0x6c RTM_NEWMDB = 0x54 + RTM_NEWMULTICAST = 0x38 RTM_NEWNDUSEROPT = 0x44 RTM_NEWNEIGH = 0x1c RTM_NEWNEIGHTBL = 0x40 @@ -2970,6 +3000,7 @@ const ( RTPROT_NTK = 0xf RTPROT_OPENR = 0x63 RTPROT_OSPF = 0xbc + RTPROT_OVN = 0x54 RTPROT_RA = 0x9 RTPROT_REDIRECT = 0x1 RTPROT_RIP = 0xbd @@ -2987,11 +3018,12 @@ const ( RUSAGE_THREAD = 0x1 RWF_APPEND = 0x10 RWF_ATOMIC = 0x40 + RWF_DONTCACHE = 0x80 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x7f + RWF_SUPPORTED = 0xff RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -3271,6 +3303,7 @@ const ( STATX_BTIME = 0x800 STATX_CTIME = 0x80 STATX_DIOALIGN = 0x2000 + STATX_DIO_READ_ALIGN = 0x20000 STATX_GID = 0x10 STATX_INO = 0x100 STATX_MNT_ID = 0x1000 @@ -3322,7 +3355,7 @@ const ( TASKSTATS_GENL_NAME = "TASKSTATS" TASKSTATS_GENL_VERSION = 0x1 TASKSTATS_TYPE_MAX = 0x6 - TASKSTATS_VERSION = 0xe + TASKSTATS_VERSION = 0x10 TCIFLUSH = 0x0 TCIOFF = 0x2 TCIOFLUSH = 0x2 @@ -3392,8 +3425,6 @@ const ( TCP_TX_DELAY = 0x25 TCP_ULP = 0x1f TCP_USER_TIMEOUT = 0x12 - TCP_V4_FLOW = 0x1 - TCP_V6_FLOW = 0x5 TCP_WINDOW_CLAMP = 0xa TCP_ZEROCOPY_RECEIVE = 0x23 TFD_TIMER_ABSTIME = 0x1 @@ -3503,6 +3534,7 @@ const ( TP_STATUS_WRONG_FORMAT = 0x4 TRACEFS_MAGIC = 0x74726163 TS_COMM_LEN = 0x20 + UBI_IOCECNFO = 0xc01c6f06 UDF_SUPER_MAGIC = 0x15013346 UDP_CORK = 0x1 UDP_ENCAP = 0x64 @@ -3515,8 +3547,6 @@ const ( UDP_NO_CHECK6_RX = 0x66 UDP_NO_CHECK6_TX = 0x65 UDP_SEGMENT = 0x67 - UDP_V4_FLOW = 0x2 - UDP_V6_FLOW = 0x6 UMOUNT_NOFOLLOW = 0x8 USBDEVICE_SUPER_MAGIC = 0x9fa2 UTIME_NOW = 0x3fffffff @@ -3559,7 +3589,7 @@ const ( WDIOS_TEMPPANIC = 0x4 WDIOS_UNKNOWN = -0x1 WEXITED = 0x4 - WGALLOWEDIP_A_MAX = 0x3 + WGALLOWEDIP_A_MAX = 0x4 WGDEVICE_A_MAX = 0x8 WGPEER_A_MAX = 0xa WG_CMD_MAX = 0x1 @@ -3673,6 +3703,7 @@ const ( XDP_SHARED_UMEM = 0x1 XDP_STATISTICS = 0x7 XDP_TXMD_FLAGS_CHECKSUM = 0x2 + XDP_TXMD_FLAGS_LAUNCH_TIME = 0x4 XDP_TXMD_FLAGS_TIMESTAMP = 0x1 XDP_TX_METADATA = 0x2 XDP_TX_RING = 0x3 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go index 7520761..1c37f9f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_386.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -360,6 +361,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -372,6 +374,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go index c68acda..6f54d34 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -361,6 +362,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -373,6 +375,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go index a8c607a..783ec5c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -366,6 +367,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -378,6 +380,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go index 18563dd..ca83d3b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go index 22912cd..607e611 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -353,6 +354,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -365,6 +367,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go index 29344eb..b9cb5bd 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go index 20d51fb..65b078a 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go index 321b609..5298a30 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go index 9bacdf1..7bc557c 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -359,6 +360,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x11 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x12 @@ -371,6 +373,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x1004 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x1006 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x1006 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go index c224272..152399b 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -414,6 +415,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 @@ -426,6 +428,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go index 6270c8e..1a1ce24 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -418,6 +419,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 @@ -430,6 +432,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go index 9966c19..4231a1f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go @@ -68,6 +68,7 @@ const ( CS8 = 0x300 CSIZE = 0x300 CSTOPB = 0x400 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x40 @@ -418,6 +419,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x14 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x15 @@ -430,6 +432,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x10 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x12 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x12 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go index 848e5fc..21c0e95 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -350,6 +351,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -362,6 +364,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go index 669b2ad..f00d1cd 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go @@ -68,6 +68,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0xfd12 ECCGETLAYOUT = 0x81484d11 ECCGETSTATS = 0x80104d12 ECHOCTL = 0x200 @@ -422,6 +423,7 @@ const ( SO_OOBINLINE = 0xa SO_PASSCRED = 0x10 SO_PASSPIDFD = 0x4c + SO_PASSRIGHTS = 0x53 SO_PASSSEC = 0x22 SO_PEEK_OFF = 0x2a SO_PEERCRED = 0x11 @@ -434,6 +436,7 @@ const ( SO_RCVBUFFORCE = 0x21 SO_RCVLOWAT = 0x12 SO_RCVMARK = 0x4b + SO_RCVPRIORITY = 0x52 SO_RCVTIMEO = 0x14 SO_RCVTIMEO_NEW = 0x42 SO_RCVTIMEO_OLD = 0x14 diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go index 4834e57..bc8d539 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go @@ -71,6 +71,7 @@ const ( CS8 = 0x30 CSIZE = 0x30 CSTOPB = 0x40 + DM_MPATH_PROBE_PATHS = 0x2000fd12 ECCGETLAYOUT = 0x41484d11 ECCGETSTATS = 0x40104d12 ECHOCTL = 0x200 @@ -461,6 +462,7 @@ const ( SO_OOBINLINE = 0x100 SO_PASSCRED = 0x2 SO_PASSPIDFD = 0x55 + SO_PASSRIGHTS = 0x5c SO_PASSSEC = 0x1f SO_PEEK_OFF = 0x26 SO_PEERCRED = 0x40 @@ -473,6 +475,7 @@ const ( SO_RCVBUFFORCE = 0x100b SO_RCVLOWAT = 0x800 SO_RCVMARK = 0x54 + SO_RCVPRIORITY = 0x5b SO_RCVTIMEO = 0x2000 SO_RCVTIMEO_NEW = 0x44 SO_RCVTIMEO_OLD = 0x2000 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go index 24b346e..813c05b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go @@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s index ebd2131..fda3285 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s @@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_fstat64_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat64(SB) GLOBL ·libc_fstat64_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go index 824b9c2..e6f58f3 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go @@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func readv(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_readv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_preadv_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func writev(fd int, iovecs []Iovec) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs))) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_writev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) { + var _p0 unsafe.Pointer + if len(iovecs) > 0 { + _p0 = unsafe.Pointer(&iovecs[0]) + } else { + _p0 = unsafe.Pointer(&_zero) + } + r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pwritev_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func Fstat(fd int, stat *Stat_t) (err error) { _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s index 4f178a2..7f8998b 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s @@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) +TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_readv(SB) +GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB) + +TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_preadv(SB) +GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8 +DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB) + +TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_writev(SB) +GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB) + +TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pwritev(SB) +GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB) + TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_fstat(SB) GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go index c654541..b4609c2 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go @@ -72,7 +72,7 @@ import ( //go:cgo_import_dynamic libc_kill kill "libc.so" //go:cgo_import_dynamic libc_lchown lchown "libc.so" //go:cgo_import_dynamic libc_link link "libc.so" -//go:cgo_import_dynamic libc___xnet_llisten __xnet_llisten "libsocket.so" +//go:cgo_import_dynamic libc___xnet_listen __xnet_listen "libsocket.so" //go:cgo_import_dynamic libc_lstat lstat "libc.so" //go:cgo_import_dynamic libc_madvise madvise "libc.so" //go:cgo_import_dynamic libc_mkdir mkdir "libc.so" @@ -221,7 +221,7 @@ import ( //go:linkname procKill libc_kill //go:linkname procLchown libc_lchown //go:linkname procLink libc_link -//go:linkname proc__xnet_llisten libc___xnet_llisten +//go:linkname proc__xnet_listen libc___xnet_listen //go:linkname procLstat libc_lstat //go:linkname procMadvise libc_madvise //go:linkname procMkdir libc_mkdir @@ -371,7 +371,7 @@ var ( procKill, procLchown, procLink, - proc__xnet_llisten, + proc__xnet_listen, procLstat, procMadvise, procMkdir, @@ -1178,7 +1178,7 @@ func Link(path string, link string) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT func Listen(s int, backlog int) (err error) { - _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_llisten)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0) + _, _, e1 := sysvicall6(uintptr(unsafe.Pointer(&proc__xnet_listen)), 2, uintptr(s), uintptr(backlog), 0, 0, 0, 0) if e1 != 0 { err = errnoErr(e1) } diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go index c79aaff..aca56ee 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go @@ -462,4 +462,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go index 5eb4506..2ea1ef5 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go @@ -385,4 +385,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go index 05e5029..d22c8af 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go @@ -426,4 +426,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go index 38c53ec..5ee264a 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go @@ -329,4 +329,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go index 31d2e71..f9f03eb 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go @@ -325,4 +325,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go index f4184a3..87c2118 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go @@ -446,4 +446,5 @@ const ( SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 + SYS_OPEN_TREE_ATTR = 4467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go index 05b9962..391ad10 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go @@ -376,4 +376,5 @@ const ( SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 + SYS_OPEN_TREE_ATTR = 5467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go index 43a256e..5656157 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go @@ -376,4 +376,5 @@ const ( SYS_GETXATTRAT = 5464 SYS_LISTXATTRAT = 5465 SYS_REMOVEXATTRAT = 5466 + SYS_OPEN_TREE_ATTR = 5467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go index eea5ddf..0482b52 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go @@ -446,4 +446,5 @@ const ( SYS_GETXATTRAT = 4464 SYS_LISTXATTRAT = 4465 SYS_REMOVEXATTRAT = 4466 + SYS_OPEN_TREE_ATTR = 4467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go index 0d777bf..71806f0 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go @@ -453,4 +453,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go index b446365..e35a710 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go @@ -425,4 +425,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go index 0c7d21c..2aea476 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go @@ -425,4 +425,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go index 8405391..6c9bb4e 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go @@ -330,4 +330,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go index fcf1b79..680bc99 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go @@ -391,4 +391,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go index 52d15b5..620f271 100644 --- a/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go @@ -404,4 +404,5 @@ const ( SYS_GETXATTRAT = 464 SYS_LISTXATTRAT = 465 SYS_REMOVEXATTRAT = 466 + SYS_OPEN_TREE_ATTR = 467 ) diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index a46abe6..944e75a 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -114,8 +114,10 @@ type Statx_t struct { Atomic_write_unit_min uint32 Atomic_write_unit_max uint32 Atomic_write_segments_max uint32 + Dio_read_offset_align uint32 + Atomic_write_unit_max_opt uint32 _ [1]uint32 - _ [9]uint64 + _ [8]uint64 } type Fsid struct { @@ -199,7 +201,8 @@ type FscryptAddKeyArg struct { Key_spec FscryptKeySpecifier Raw_size uint32 Key_id uint32 - _ [8]uint32 + Flags uint32 + _ [7]uint32 } type FscryptRemoveKeyArg struct { @@ -629,6 +632,8 @@ const ( IFA_FLAGS = 0x8 IFA_RT_PRIORITY = 0x9 IFA_TARGET_NETNSID = 0xa + IFAL_LABEL = 0x2 + IFAL_ADDRESS = 0x1 RT_SCOPE_UNIVERSE = 0x0 RT_SCOPE_SITE = 0xc8 RT_SCOPE_LINK = 0xfd @@ -686,6 +691,7 @@ const ( SizeofRtAttr = 0x4 SizeofIfInfomsg = 0x10 SizeofIfAddrmsg = 0x8 + SizeofIfAddrlblmsg = 0xc SizeofIfaCacheinfo = 0x10 SizeofRtMsg = 0xc SizeofRtNexthop = 0x8 @@ -737,6 +743,15 @@ type IfAddrmsg struct { Index uint32 } +type IfAddrlblmsg struct { + Family uint8 + _ uint8 + Prefixlen uint8 + Flags uint8 + Index uint32 + Seq uint32 +} + type IfaCacheinfo struct { Prefered uint32 Valid uint32 @@ -2226,8 +2241,11 @@ const ( NFT_PAYLOAD_LL_HEADER = 0x0 NFT_PAYLOAD_NETWORK_HEADER = 0x1 NFT_PAYLOAD_TRANSPORT_HEADER = 0x2 + NFT_PAYLOAD_INNER_HEADER = 0x3 + NFT_PAYLOAD_TUN_HEADER = 0x4 NFT_PAYLOAD_CSUM_NONE = 0x0 NFT_PAYLOAD_CSUM_INET = 0x1 + NFT_PAYLOAD_CSUM_SCTP = 0x2 NFT_PAYLOAD_L4CSUM_PSEUDOHDR = 0x1 NFTA_PAYLOAD_UNSPEC = 0x0 NFTA_PAYLOAD_DREG = 0x1 @@ -2314,6 +2332,11 @@ const ( NFT_CT_AVGPKT = 0x10 NFT_CT_ZONE = 0x11 NFT_CT_EVENTMASK = 0x12 + NFT_CT_SRC_IP = 0x13 + NFT_CT_DST_IP = 0x14 + NFT_CT_SRC_IP6 = 0x15 + NFT_CT_DST_IP6 = 0x16 + NFT_CT_ID = 0x17 NFTA_CT_UNSPEC = 0x0 NFTA_CT_DREG = 0x1 NFTA_CT_KEY = 0x2 @@ -2594,8 +2617,8 @@ const ( SOF_TIMESTAMPING_BIND_PHC = 0x8000 SOF_TIMESTAMPING_OPT_ID_TCP = 0x10000 - SOF_TIMESTAMPING_LAST = 0x20000 - SOF_TIMESTAMPING_MASK = 0x3ffff + SOF_TIMESTAMPING_LAST = 0x40000 + SOF_TIMESTAMPING_MASK = 0x7ffff SCM_TSTAMP_SND = 0x0 SCM_TSTAMP_SCHED = 0x1 @@ -3041,6 +3064,23 @@ const ( ) const ( + TCA_UNSPEC = 0x0 + TCA_KIND = 0x1 + TCA_OPTIONS = 0x2 + TCA_STATS = 0x3 + TCA_XSTATS = 0x4 + TCA_RATE = 0x5 + TCA_FCNT = 0x6 + TCA_STATS2 = 0x7 + TCA_STAB = 0x8 + TCA_PAD = 0x9 + TCA_DUMP_INVISIBLE = 0xa + TCA_CHAIN = 0xb + TCA_HW_OFFLOAD = 0xc + TCA_INGRESS_BLOCK = 0xd + TCA_EGRESS_BLOCK = 0xe + TCA_DUMP_FLAGS = 0xf + TCA_EXT_WARN_MSG = 0x10 RTNLGRP_NONE = 0x0 RTNLGRP_LINK = 0x1 RTNLGRP_NOTIFY = 0x2 @@ -3075,6 +3115,18 @@ const ( RTNLGRP_IPV6_MROUTE_R = 0x1f RTNLGRP_NEXTHOP = 0x20 RTNLGRP_BRVLAN = 0x21 + RTNLGRP_MCTP_IFADDR = 0x22 + RTNLGRP_TUNNEL = 0x23 + RTNLGRP_STATS = 0x24 + RTNLGRP_IPV4_MCADDR = 0x25 + RTNLGRP_IPV6_MCADDR = 0x26 + RTNLGRP_IPV6_ACADDR = 0x27 + TCA_ROOT_UNSPEC = 0x0 + TCA_ROOT_TAB = 0x1 + TCA_ROOT_FLAGS = 0x2 + TCA_ROOT_COUNT = 0x3 + TCA_ROOT_TIME_DELTA = 0x4 + TCA_ROOT_EXT_WARN_MSG = 0x5 ) type CapUserHeader struct { @@ -3802,7 +3854,16 @@ const ( ETHTOOL_MSG_PSE_GET = 0x24 ETHTOOL_MSG_PSE_SET = 0x25 ETHTOOL_MSG_RSS_GET = 0x26 - ETHTOOL_MSG_USER_MAX = 0x2d + ETHTOOL_MSG_PLCA_GET_CFG = 0x27 + ETHTOOL_MSG_PLCA_SET_CFG = 0x28 + ETHTOOL_MSG_PLCA_GET_STATUS = 0x29 + ETHTOOL_MSG_MM_GET = 0x2a + ETHTOOL_MSG_MM_SET = 0x2b + ETHTOOL_MSG_MODULE_FW_FLASH_ACT = 0x2c + ETHTOOL_MSG_PHY_GET = 0x2d + ETHTOOL_MSG_TSCONFIG_GET = 0x2e + ETHTOOL_MSG_TSCONFIG_SET = 0x2f + ETHTOOL_MSG_USER_MAX = 0x2f ETHTOOL_MSG_KERNEL_NONE = 0x0 ETHTOOL_MSG_STRSET_GET_REPLY = 0x1 ETHTOOL_MSG_LINKINFO_GET_REPLY = 0x2 @@ -3842,7 +3903,17 @@ const ( ETHTOOL_MSG_MODULE_NTF = 0x24 ETHTOOL_MSG_PSE_GET_REPLY = 0x25 ETHTOOL_MSG_RSS_GET_REPLY = 0x26 - ETHTOOL_MSG_KERNEL_MAX = 0x2e + ETHTOOL_MSG_PLCA_GET_CFG_REPLY = 0x27 + ETHTOOL_MSG_PLCA_GET_STATUS_REPLY = 0x28 + ETHTOOL_MSG_PLCA_NTF = 0x29 + ETHTOOL_MSG_MM_GET_REPLY = 0x2a + ETHTOOL_MSG_MM_NTF = 0x2b + ETHTOOL_MSG_MODULE_FW_FLASH_NTF = 0x2c + ETHTOOL_MSG_PHY_GET_REPLY = 0x2d + ETHTOOL_MSG_PHY_NTF = 0x2e + ETHTOOL_MSG_TSCONFIG_GET_REPLY = 0x2f + ETHTOOL_MSG_TSCONFIG_SET_REPLY = 0x30 + ETHTOOL_MSG_KERNEL_MAX = 0x30 ETHTOOL_FLAG_COMPACT_BITSETS = 0x1 ETHTOOL_FLAG_OMIT_REPLY = 0x2 ETHTOOL_FLAG_STATS = 0x4 @@ -3949,7 +4020,12 @@ const ( ETHTOOL_A_RINGS_TCP_DATA_SPLIT = 0xb ETHTOOL_A_RINGS_CQE_SIZE = 0xc ETHTOOL_A_RINGS_TX_PUSH = 0xd - ETHTOOL_A_RINGS_MAX = 0x10 + ETHTOOL_A_RINGS_RX_PUSH = 0xe + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN = 0xf + ETHTOOL_A_RINGS_TX_PUSH_BUF_LEN_MAX = 0x10 + ETHTOOL_A_RINGS_HDS_THRESH = 0x11 + ETHTOOL_A_RINGS_HDS_THRESH_MAX = 0x12 + ETHTOOL_A_RINGS_MAX = 0x12 ETHTOOL_A_CHANNELS_UNSPEC = 0x0 ETHTOOL_A_CHANNELS_HEADER = 0x1 ETHTOOL_A_CHANNELS_RX_MAX = 0x2 @@ -4015,7 +4091,9 @@ const ( ETHTOOL_A_TSINFO_TX_TYPES = 0x3 ETHTOOL_A_TSINFO_RX_FILTERS = 0x4 ETHTOOL_A_TSINFO_PHC_INDEX = 0x5 - ETHTOOL_A_TSINFO_MAX = 0x6 + ETHTOOL_A_TSINFO_STATS = 0x6 + ETHTOOL_A_TSINFO_HWTSTAMP_PROVIDER = 0x7 + ETHTOOL_A_TSINFO_MAX = 0x9 ETHTOOL_A_CABLE_TEST_UNSPEC = 0x0 ETHTOOL_A_CABLE_TEST_HEADER = 0x1 ETHTOOL_A_CABLE_TEST_MAX = 0x1 @@ -4101,6 +4179,19 @@ const ( ETHTOOL_A_TUNNEL_INFO_MAX = 0x2 ) +const ( + TCP_V4_FLOW = 0x1 + UDP_V4_FLOW = 0x2 + TCP_V6_FLOW = 0x5 + UDP_V6_FLOW = 0x6 + ESP_V4_FLOW = 0xa + ESP_V6_FLOW = 0xc + IP_USER_FLOW = 0xd + IPV6_USER_FLOW = 0xe + IPV6_FLOW = 0x11 + ETHER_FLOW = 0x12 +) + const SPEED_UNKNOWN = -0x1 type EthtoolDrvinfo struct { @@ -4613,6 +4704,7 @@ const ( NL80211_ATTR_AKM_SUITES = 0x4c NL80211_ATTR_AP_ISOLATE = 0x60 NL80211_ATTR_AP_SETTINGS_FLAGS = 0x135 + NL80211_ATTR_ASSOC_SPP_AMSDU = 0x14a NL80211_ATTR_AUTH_DATA = 0x9c NL80211_ATTR_AUTH_TYPE = 0x35 NL80211_ATTR_BANDS = 0xef @@ -4623,6 +4715,7 @@ const ( NL80211_ATTR_BSS_BASIC_RATES = 0x24 NL80211_ATTR_BSS = 0x2f NL80211_ATTR_BSS_CTS_PROT = 0x1c + NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA = 0x147 NL80211_ATTR_BSS_HT_OPMODE = 0x6d NL80211_ATTR_BSSID = 0xf5 NL80211_ATTR_BSS_SELECT = 0xe3 @@ -4682,6 +4775,7 @@ const ( NL80211_ATTR_DTIM_PERIOD = 0xd NL80211_ATTR_DURATION = 0x57 NL80211_ATTR_EHT_CAPABILITY = 0x136 + NL80211_ATTR_EMA_RNR_ELEMS = 0x145 NL80211_ATTR_EML_CAPABILITY = 0x13d NL80211_ATTR_EXT_CAPA = 0xa9 NL80211_ATTR_EXT_CAPA_MASK = 0xaa @@ -4717,6 +4811,7 @@ const ( NL80211_ATTR_HIDDEN_SSID = 0x7e NL80211_ATTR_HT_CAPABILITY = 0x1f NL80211_ATTR_HT_CAPABILITY_MASK = 0x94 + NL80211_ATTR_HW_TIMESTAMP_ENABLED = 0x144 NL80211_ATTR_IE_ASSOC_RESP = 0x80 NL80211_ATTR_IE = 0x2a NL80211_ATTR_IE_PROBE_RESP = 0x7f @@ -4747,9 +4842,10 @@ const ( NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x14d + NL80211_ATTR_MAX = 0x151 NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce + NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS = 0x143 NL80211_ATTR_MAX_MATCH_SETS = 0x85 NL80211_ATTR_MAX_NUM_AKM_SUITES = 0x13c NL80211_ATTR_MAX_NUM_PMKIDS = 0x56 @@ -4774,9 +4870,12 @@ const ( NL80211_ATTR_MGMT_SUBTYPE = 0x29 NL80211_ATTR_MLD_ADDR = 0x13a NL80211_ATTR_MLD_CAPA_AND_OPS = 0x13e + NL80211_ATTR_MLO_LINK_DISABLED = 0x146 NL80211_ATTR_MLO_LINK_ID = 0x139 NL80211_ATTR_MLO_LINKS = 0x138 NL80211_ATTR_MLO_SUPPORT = 0x13b + NL80211_ATTR_MLO_TTLM_DLINK = 0x148 + NL80211_ATTR_MLO_TTLM_ULINK = 0x149 NL80211_ATTR_MNTR_FLAGS = 0x17 NL80211_ATTR_MPATH_INFO = 0x1b NL80211_ATTR_MPATH_NEXT_HOP = 0x1a @@ -4809,12 +4908,14 @@ const ( NL80211_ATTR_PORT_AUTHORIZED = 0x103 NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN = 0x5 NL80211_ATTR_POWER_RULE_MAX_EIRP = 0x6 + NL80211_ATTR_POWER_RULE_PSD = 0x8 NL80211_ATTR_PREV_BSSID = 0x4f NL80211_ATTR_PRIVACY = 0x46 NL80211_ATTR_PROBE_RESP = 0x91 NL80211_ATTR_PROBE_RESP_OFFLOAD = 0x90 NL80211_ATTR_PROTOCOL_FEATURES = 0xad NL80211_ATTR_PS_STATE = 0x5d + NL80211_ATTR_PUNCT_BITMAP = 0x142 NL80211_ATTR_QOS_MAP = 0xc7 NL80211_ATTR_RADAR_BACKGROUND = 0x134 NL80211_ATTR_RADAR_EVENT = 0xa8 @@ -4943,7 +5044,9 @@ const ( NL80211_ATTR_WIPHY_FREQ = 0x26 NL80211_ATTR_WIPHY_FREQ_HINT = 0xc9 NL80211_ATTR_WIPHY_FREQ_OFFSET = 0x122 + NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS = 0x14c NL80211_ATTR_WIPHY_NAME = 0x2 + NL80211_ATTR_WIPHY_RADIOS = 0x14b NL80211_ATTR_WIPHY_RETRY_LONG = 0x3e NL80211_ATTR_WIPHY_RETRY_SHORT = 0x3d NL80211_ATTR_WIPHY_RTS_THRESHOLD = 0x40 @@ -4978,6 +5081,8 @@ const ( NL80211_BAND_ATTR_IFTYPE_DATA = 0x9 NL80211_BAND_ATTR_MAX = 0xd NL80211_BAND_ATTR_RATES = 0x2 + NL80211_BAND_ATTR_S1G_CAPA = 0xd + NL80211_BAND_ATTR_S1G_MCS_NSS_SET = 0xc NL80211_BAND_ATTR_VHT_CAPA = 0x8 NL80211_BAND_ATTR_VHT_MCS_SET = 0x7 NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC = 0x8 @@ -5001,6 +5106,10 @@ const ( NL80211_BSS_BEACON_INTERVAL = 0x4 NL80211_BSS_BEACON_TSF = 0xd NL80211_BSS_BSSID = 0x1 + NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 0x2 + NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 0x1 + NL80211_BSS_CANNOT_USE_REASONS = 0x18 + NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH = 0x2 NL80211_BSS_CAPABILITY = 0x5 NL80211_BSS_CHAIN_SIGNAL = 0x13 NL80211_BSS_CHAN_WIDTH_10 = 0x1 @@ -5032,6 +5141,9 @@ const ( NL80211_BSS_STATUS = 0x9 NL80211_BSS_STATUS_IBSS_JOINED = 0x2 NL80211_BSS_TSF = 0x3 + NL80211_BSS_USE_FOR = 0x17 + NL80211_BSS_USE_FOR_MLD_LINK = 0x2 + NL80211_BSS_USE_FOR_NORMAL = 0x1 NL80211_CHAN_HT20 = 0x1 NL80211_CHAN_HT40MINUS = 0x2 NL80211_CHAN_HT40PLUS = 0x3 @@ -5117,7 +5229,8 @@ const ( NL80211_CMD_LEAVE_IBSS = 0x2c NL80211_CMD_LEAVE_MESH = 0x45 NL80211_CMD_LEAVE_OCB = 0x6d - NL80211_CMD_MAX = 0x9b + NL80211_CMD_LINKS_REMOVED = 0x9a + NL80211_CMD_MAX = 0x9d NL80211_CMD_MICHAEL_MIC_FAILURE = 0x29 NL80211_CMD_MODIFY_LINK_STA = 0x97 NL80211_CMD_NAN_MATCH = 0x78 @@ -5161,6 +5274,7 @@ const ( NL80211_CMD_SET_COALESCE = 0x65 NL80211_CMD_SET_CQM = 0x3f NL80211_CMD_SET_FILS_AAD = 0x92 + NL80211_CMD_SET_HW_TIMESTAMP = 0x99 NL80211_CMD_SET_INTERFACE = 0x6 NL80211_CMD_SET_KEY = 0xa NL80211_CMD_SET_MAC_ACL = 0x5d @@ -5180,6 +5294,7 @@ const ( NL80211_CMD_SET_SAR_SPECS = 0x8c NL80211_CMD_SET_STATION = 0x12 NL80211_CMD_SET_TID_CONFIG = 0x89 + NL80211_CMD_SET_TID_TO_LINK_MAPPING = 0x9b NL80211_CMD_SET_TX_BITRATE_MASK = 0x39 NL80211_CMD_SET_WDS_PEER = 0x42 NL80211_CMD_SET_WIPHY = 0x2 @@ -5247,6 +5362,7 @@ const ( NL80211_EXT_FEATURE_AIRTIME_FAIRNESS = 0x21 NL80211_EXT_FEATURE_AP_PMKSA_CACHING = 0x22 NL80211_EXT_FEATURE_AQL = 0x28 + NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA = 0x40 NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT = 0x2e NL80211_EXT_FEATURE_BEACON_PROTECTION = 0x29 NL80211_EXT_FEATURE_BEACON_RATE_HE = 0x36 @@ -5262,6 +5378,7 @@ const ( NL80211_EXT_FEATURE_CQM_RSSI_LIST = 0xd NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = 0x1b NL80211_EXT_FEATURE_DEL_IBSS_STA = 0x2c + NL80211_EXT_FEATURE_DFS_CONCURRENT = 0x43 NL80211_EXT_FEATURE_DFS_OFFLOAD = 0x19 NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER = 0x20 NL80211_EXT_FEATURE_EXT_KEY_ID = 0x24 @@ -5281,9 +5398,12 @@ const ( NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 0x14 NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE = 0x13 NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION = 0x31 + NL80211_EXT_FEATURE_OWE_OFFLOAD_AP = 0x42 + NL80211_EXT_FEATURE_OWE_OFFLOAD = 0x41 NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE = 0x3d NL80211_EXT_FEATURE_PROTECTED_TWT = 0x2b NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE = 0x39 + NL80211_EXT_FEATURE_PUNCT = 0x3e NL80211_EXT_FEATURE_RADAR_BACKGROUND = 0x3c NL80211_EXT_FEATURE_RRM = 0x1 NL80211_EXT_FEATURE_SAE_OFFLOAD_AP = 0x33 @@ -5295,8 +5415,10 @@ const ( NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD = 0x23 NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI = 0xc NL80211_EXT_FEATURE_SECURE_LTF = 0x37 + NL80211_EXT_FEATURE_SECURE_NAN = 0x3f NL80211_EXT_FEATURE_SECURE_RTT = 0x38 NL80211_EXT_FEATURE_SET_SCAN_DWELL = 0x5 + NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT = 0x44 NL80211_EXT_FEATURE_STA_TX_PWR = 0x25 NL80211_EXT_FEATURE_TXQS = 0x1c NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP = 0x35 @@ -5343,7 +5465,10 @@ const ( NL80211_FREQUENCY_ATTR_2MHZ = 0x16 NL80211_FREQUENCY_ATTR_4MHZ = 0x17 NL80211_FREQUENCY_ATTR_8MHZ = 0x18 + NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP = 0x21 + NL80211_FREQUENCY_ATTR_CAN_MONITOR = 0x20 NL80211_FREQUENCY_ATTR_DFS_CAC_TIME = 0xd + NL80211_FREQUENCY_ATTR_DFS_CONCURRENT = 0x1d NL80211_FREQUENCY_ATTR_DFS_STATE = 0x7 NL80211_FREQUENCY_ATTR_DFS_TIME = 0x8 NL80211_FREQUENCY_ATTR_DISABLED = 0x2 @@ -5351,12 +5476,14 @@ const ( NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x21 + NL80211_FREQUENCY_ATTR_MAX = 0x22 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc NL80211_FREQUENCY_ATTR_NO_20MHZ = 0x10 NL80211_FREQUENCY_ATTR_NO_320MHZ = 0x1a + NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT = 0x1f + NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_NO_80MHZ = 0xb NL80211_FREQUENCY_ATTR_NO_EHT = 0x1b NL80211_FREQUENCY_ATTR_NO_HE = 0x13 @@ -5364,8 +5491,11 @@ const ( NL80211_FREQUENCY_ATTR_NO_HT40_PLUS = 0xa NL80211_FREQUENCY_ATTR_NO_IBSS = 0x3 NL80211_FREQUENCY_ATTR_NO_IR = 0x3 + NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT = 0x1f + NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT = 0x1e NL80211_FREQUENCY_ATTR_OFFSET = 0x14 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN = 0x3 + NL80211_FREQUENCY_ATTR_PSD = 0x1c NL80211_FREQUENCY_ATTR_RADAR = 0x5 NL80211_FREQUENCY_ATTR_WMM = 0x12 NL80211_FTM_RESP_ATTR_CIVICLOC = 0x3 @@ -5430,6 +5560,7 @@ const ( NL80211_IFTYPE_STATION = 0x2 NL80211_IFTYPE_UNSPECIFIED = 0x0 NL80211_IFTYPE_WDS = 0x5 + NL80211_KCK_EXT_LEN_32 = 0x20 NL80211_KCK_EXT_LEN = 0x18 NL80211_KCK_LEN = 0x10 NL80211_KEK_EXT_LEN = 0x20 @@ -5458,9 +5589,10 @@ const ( NL80211_MAX_SUPP_HT_RATES = 0x4d NL80211_MAX_SUPP_RATES = 0x20 NL80211_MAX_SUPP_REG_RULES = 0x80 + NL80211_MAX_SUPP_SELECTORS = 0x80 NL80211_MBSSID_CONFIG_ATTR_EMA = 0x5 NL80211_MBSSID_CONFIG_ATTR_INDEX = 0x3 - NL80211_MBSSID_CONFIG_ATTR_MAX = 0x5 + NL80211_MBSSID_CONFIG_ATTR_MAX = 0x6 NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY = 0x2 NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES = 0x1 NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX = 0x4 @@ -5703,11 +5835,16 @@ const ( NL80211_RADAR_PRE_CAC_EXPIRED = 0x4 NL80211_RATE_INFO_10_MHZ_WIDTH = 0xb NL80211_RATE_INFO_160_MHZ_WIDTH = 0xa + NL80211_RATE_INFO_16_MHZ_WIDTH = 0x1d + NL80211_RATE_INFO_1_MHZ_WIDTH = 0x19 + NL80211_RATE_INFO_2_MHZ_WIDTH = 0x1a NL80211_RATE_INFO_320_MHZ_WIDTH = 0x12 NL80211_RATE_INFO_40_MHZ_WIDTH = 0x3 + NL80211_RATE_INFO_4_MHZ_WIDTH = 0x1b NL80211_RATE_INFO_5_MHZ_WIDTH = 0xc NL80211_RATE_INFO_80_MHZ_WIDTH = 0x8 NL80211_RATE_INFO_80P80_MHZ_WIDTH = 0x9 + NL80211_RATE_INFO_8_MHZ_WIDTH = 0x1c NL80211_RATE_INFO_BITRATE32 = 0x5 NL80211_RATE_INFO_BITRATE = 0x1 NL80211_RATE_INFO_EHT_GI_0_8 = 0x0 @@ -5753,6 +5890,8 @@ const ( NL80211_RATE_INFO_HE_RU_ALLOC = 0x11 NL80211_RATE_INFO_MAX = 0x1d NL80211_RATE_INFO_MCS = 0x2 + NL80211_RATE_INFO_S1G_MCS = 0x17 + NL80211_RATE_INFO_S1G_NSS = 0x18 NL80211_RATE_INFO_SHORT_GI = 0x4 NL80211_RATE_INFO_VHT_MCS = 0x6 NL80211_RATE_INFO_VHT_NSS = 0x7 @@ -5770,14 +5909,19 @@ const ( NL80211_REKEY_DATA_KEK = 0x1 NL80211_REKEY_DATA_REPLAY_CTR = 0x3 NL80211_REPLAY_CTR_LEN = 0x8 + NL80211_RRF_ALLOW_6GHZ_VLP_AP = 0x1000000 NL80211_RRF_AUTO_BW = 0x800 NL80211_RRF_DFS = 0x10 + NL80211_RRF_DFS_CONCURRENT = 0x200000 NL80211_RRF_GO_CONCURRENT = 0x1000 NL80211_RRF_IR_CONCURRENT = 0x1000 NL80211_RRF_NO_160MHZ = 0x10000 NL80211_RRF_NO_320MHZ = 0x40000 + NL80211_RRF_NO_6GHZ_AFC_CLIENT = 0x800000 + NL80211_RRF_NO_6GHZ_VLP_CLIENT = 0x400000 NL80211_RRF_NO_80MHZ = 0x8000 NL80211_RRF_NO_CCK = 0x2 + NL80211_RRF_NO_EHT = 0x80000 NL80211_RRF_NO_HE = 0x20000 NL80211_RRF_NO_HT40 = 0x6000 NL80211_RRF_NO_HT40MINUS = 0x2000 @@ -5788,7 +5932,10 @@ const ( NL80211_RRF_NO_IR = 0x80 NL80211_RRF_NO_OFDM = 0x1 NL80211_RRF_NO_OUTDOOR = 0x8 + NL80211_RRF_NO_UHB_AFC_CLIENT = 0x800000 + NL80211_RRF_NO_UHB_VLP_CLIENT = 0x400000 NL80211_RRF_PASSIVE_SCAN = 0x80 + NL80211_RRF_PSD = 0x100000 NL80211_RRF_PTMP_ONLY = 0x40 NL80211_RRF_PTP_ONLY = 0x20 NL80211_RXMGMT_FLAG_ANSWERED = 0x1 @@ -5849,6 +5996,7 @@ const ( NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 + NL80211_STA_FLAG_SPP_AMSDU = 0x8 NL80211_STA_FLAG_TDLS_PEER = 0x6 NL80211_STA_FLAG_WME = 0x3 NL80211_STA_INFO_ACK_SIGNAL_AVG = 0x23 @@ -6007,6 +6155,13 @@ const ( NL80211_VHT_CAPABILITY_LEN = 0xc NL80211_VHT_NSS_MAX = 0x8 NL80211_WIPHY_NAME_MAXLEN = 0x40 + NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE = 0x2 + NL80211_WIPHY_RADIO_ATTR_INDEX = 0x1 + NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION = 0x3 + NL80211_WIPHY_RADIO_ATTR_MAX = 0x4 + NL80211_WIPHY_RADIO_FREQ_ATTR_END = 0x2 + NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = 0x2 + NL80211_WIPHY_RADIO_FREQ_ATTR_START = 0x1 NL80211_WMMR_AIFSN = 0x3 NL80211_WMMR_CW_MAX = 0x2 NL80211_WMMR_CW_MIN = 0x1 @@ -6038,6 +6193,7 @@ const ( NL80211_WOWLAN_TRIG_PKT_PATTERN = 0x4 NL80211_WOWLAN_TRIG_RFKILL_RELEASE = 0x9 NL80211_WOWLAN_TRIG_TCP_CONNECTION = 0xe + NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC = 0x14 NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211 = 0xa NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN = 0xb NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023 = 0xc diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go index fd402da..485f2d3 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_386.go @@ -282,7 +282,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -338,6 +338,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go index eb7a5e1..ecbd1ad 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go @@ -351,6 +351,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go index d78ac10..02f0463 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go @@ -91,7 +91,7 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [4]byte + _ [6]byte Size int64 Blksize int32 _ [4]byte @@ -273,7 +273,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -329,6 +329,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go index cd06d47..6f4d400 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go @@ -330,6 +330,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go index 2f28fe2..cd532cf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go @@ -331,6 +331,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go index 71d6cac..4133620 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go @@ -278,7 +278,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -334,6 +334,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go index 8596d45..eaa37eb 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go @@ -333,6 +333,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go index cd60ea1..98ae6a1 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go @@ -333,6 +333,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go index b0ae420..cae1961 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go @@ -278,7 +278,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -334,6 +334,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go index 8359728..6ce3b4e 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go @@ -90,7 +90,7 @@ type Stat_t struct { Gid uint32 Rdev uint64 _ uint16 - _ [4]byte + _ [6]byte Size int64 Blksize int32 _ [4]byte @@ -285,7 +285,7 @@ type Taskstats struct { Ac_exitcode uint32 Ac_flag uint8 Ac_nice uint8 - _ [4]byte + _ [6]byte Cpu_count uint64 Cpu_delay_total uint64 Blkio_count uint64 @@ -341,6 +341,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint32 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go index 69eb6a5..c7429c6 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go @@ -340,6 +340,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go index 5f583cb..4bf4baf 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go @@ -340,6 +340,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go index ad05b51..e9709d7 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go @@ -358,6 +358,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go index cf3ce90..fb44268 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go @@ -353,6 +353,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go index 590b567..9c38265 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go @@ -335,6 +335,22 @@ type Taskstats struct { Wpcopy_delay_total uint64 Irq_count uint64 Irq_delay_total uint64 + Cpu_delay_max uint64 + Cpu_delay_min uint64 + Blkio_delay_max uint64 + Blkio_delay_min uint64 + Swapin_delay_max uint64 + Swapin_delay_min uint64 + Freepages_delay_max uint64 + Freepages_delay_min uint64 + Thrashing_delay_max uint64 + Thrashing_delay_min uint64 + Compact_delay_max uint64 + Compact_delay_min uint64 + Wpcopy_delay_max uint64 + Wpcopy_delay_min uint64 + Irq_delay_max uint64 + Irq_delay_min uint64 } type cpuMask uint64 diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index b6e1ab7..a8b0364 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1303,7 +1303,10 @@ func (selfRelativeSD *SECURITY_DESCRIPTOR) ToAbsolute() (absoluteSD *SECURITY_DE return nil, err } if absoluteSDSize > 0 { - absoluteSD = (*SECURITY_DESCRIPTOR)(unsafe.Pointer(&make([]byte, absoluteSDSize)[0])) + absoluteSD = new(SECURITY_DESCRIPTOR) + if unsafe.Sizeof(*absoluteSD) < uintptr(absoluteSDSize) { + panic("sizeof(SECURITY_DESCRIPTOR) too small") + } } var ( dacl *ACL @@ -1312,19 +1315,55 @@ func (selfRelativeSD *SECURITY_DESCRIPTOR) ToAbsolute() (absoluteSD *SECURITY_DE group *SID ) if daclSize > 0 { - dacl = (*ACL)(unsafe.Pointer(&make([]byte, daclSize)[0])) + dacl = (*ACL)(unsafe.Pointer(unsafe.SliceData(make([]byte, daclSize)))) } if saclSize > 0 { - sacl = (*ACL)(unsafe.Pointer(&make([]byte, saclSize)[0])) + sacl = (*ACL)(unsafe.Pointer(unsafe.SliceData(make([]byte, saclSize)))) } if ownerSize > 0 { - owner = (*SID)(unsafe.Pointer(&make([]byte, ownerSize)[0])) + owner = (*SID)(unsafe.Pointer(unsafe.SliceData(make([]byte, ownerSize)))) } if groupSize > 0 { - group = (*SID)(unsafe.Pointer(&make([]byte, groupSize)[0])) + group = (*SID)(unsafe.Pointer(unsafe.SliceData(make([]byte, groupSize)))) } + // We call into Windows via makeAbsoluteSD, which sets up + // pointers within absoluteSD that point to other chunks of memory + // we pass into makeAbsoluteSD, and that happens outside the view of the GC. + // We therefore take some care here to then verify the pointers are as we expect + // and set them explicitly in view of the GC. See https://go.dev/issue/73199. + // TODO: consider weak pointers once Go 1.24 is appropriate. See suggestion in https://go.dev/cl/663575. err = makeAbsoluteSD(selfRelativeSD, absoluteSD, &absoluteSDSize, dacl, &daclSize, sacl, &saclSize, owner, &ownerSize, group, &groupSize) + if err != nil { + // Don't return absoluteSD, which might be partially initialized. + return nil, err + } + // Before using any fields, verify absoluteSD is in the format we expect according to Windows. + // See https://learn.microsoft.com/en-us/windows/win32/secauthz/absolute-and-self-relative-security-descriptors + absControl, _, err := absoluteSD.Control() + if err != nil { + panic("absoluteSD: " + err.Error()) + } + if absControl&SE_SELF_RELATIVE != 0 { + panic("absoluteSD not in absolute format") + } + if absoluteSD.dacl != dacl { + panic("dacl pointer mismatch") + } + if absoluteSD.sacl != sacl { + panic("sacl pointer mismatch") + } + if absoluteSD.owner != owner { + panic("owner pointer mismatch") + } + if absoluteSD.group != group { + panic("group pointer mismatch") + } + absoluteSD.dacl = dacl + absoluteSD.sacl = sacl + absoluteSD.owner = owner + absoluteSD.group = group + return } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 4a32543..640f6b1 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -870,6 +870,7 @@ const socket_error = uintptr(^uint32(0)) //sys WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSARecvFrom //sys WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) [failretval==socket_error] = ws2_32.WSASendTo //sys WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) [failretval==InvalidHandle] = ws2_32.WSASocketW +//sys WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) [failretval!=0] = ws2_32.WSADuplicateSocketW //sys GetHostByName(name string) (h *Hostent, err error) [failretval==nil] = ws2_32.gethostbyname //sys GetServByName(name string, proto string) (s *Servent, err error) [failretval==nil] = ws2_32.getservbyname //sys Ntohs(netshort uint16) (u uint16) = ws2_32.ntohs @@ -1698,8 +1699,9 @@ func NewNTUnicodeString(s string) (*NTUnicodeString, error) { // Slice returns a uint16 slice that aliases the data in the NTUnicodeString. func (s *NTUnicodeString) Slice() []uint16 { - slice := unsafe.Slice(s.Buffer, s.MaximumLength) - return slice[:s.Length] + // Note: this rounds the length down, if it happens + // to (incorrectly) be odd. Probably safer than rounding up. + return unsafe.Slice(s.Buffer, s.MaximumLength/2)[:s.Length/2] } func (s *NTUnicodeString) String() string { diff --git a/vendor/golang.org/x/sys/windows/types_windows.go b/vendor/golang.org/x/sys/windows/types_windows.go index 9d138de..993a229 100644 --- a/vendor/golang.org/x/sys/windows/types_windows.go +++ b/vendor/golang.org/x/sys/windows/types_windows.go @@ -1074,6 +1074,7 @@ const ( IP_ADD_MEMBERSHIP = 0xc IP_DROP_MEMBERSHIP = 0xd IP_PKTINFO = 0x13 + IP_MTU_DISCOVER = 0x47 IPV6_V6ONLY = 0x1b IPV6_UNICAST_HOPS = 0x4 @@ -1083,6 +1084,7 @@ const ( IPV6_JOIN_GROUP = 0xc IPV6_LEAVE_GROUP = 0xd IPV6_PKTINFO = 0x13 + IPV6_MTU_DISCOVER = 0x47 MSG_OOB = 0x1 MSG_PEEK = 0x2 @@ -1132,6 +1134,15 @@ const ( WSASYS_STATUS_LEN = 128 ) +// enum PMTUD_STATE from ws2ipdef.h +const ( + IP_PMTUDISC_NOT_SET = 0 + IP_PMTUDISC_DO = 1 + IP_PMTUDISC_DONT = 2 + IP_PMTUDISC_PROBE = 3 + IP_PMTUDISC_MAX = 4 +) + type WSABuf struct { Len uint32 Buf *byte @@ -1146,6 +1157,22 @@ type WSAMsg struct { Flags uint32 } +type WSACMSGHDR struct { + Len uintptr + Level int32 + Type int32 +} + +type IN_PKTINFO struct { + Addr [4]byte + Ifindex uint32 +} + +type IN6_PKTINFO struct { + Addr [16]byte + Ifindex uint32 +} + // Flags for WSASocket const ( WSA_FLAG_OVERLAPPED = 0x01 @@ -1949,6 +1976,12 @@ const ( SYMBOLIC_LINK_FLAG_DIRECTORY = 0x1 ) +// FILE_ZERO_DATA_INFORMATION from winioctl.h +type FileZeroDataInformation struct { + FileOffset int64 + BeyondFinalZero int64 +} + const ( ComputerNameNetBIOS = 0 ComputerNameDnsHostname = 1 @@ -2673,6 +2706,8 @@ type CommTimeouts struct { // NTUnicodeString is a UTF-16 string for NT native APIs, corresponding to UNICODE_STRING. type NTUnicodeString struct { + // Note: Length and MaximumLength are in *bytes*, not uint16s. + // They should always be even. Length uint16 MaximumLength uint16 Buffer *uint16 @@ -3601,3 +3636,213 @@ const ( KLF_NOTELLSHELL = 0x00000080 KLF_SETFORPROCESS = 0x00000100 ) + +// Virtual Key codes +// https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes +const ( + VK_LBUTTON = 0x01 + VK_RBUTTON = 0x02 + VK_CANCEL = 0x03 + VK_MBUTTON = 0x04 + VK_XBUTTON1 = 0x05 + VK_XBUTTON2 = 0x06 + VK_BACK = 0x08 + VK_TAB = 0x09 + VK_CLEAR = 0x0C + VK_RETURN = 0x0D + VK_SHIFT = 0x10 + VK_CONTROL = 0x11 + VK_MENU = 0x12 + VK_PAUSE = 0x13 + VK_CAPITAL = 0x14 + VK_KANA = 0x15 + VK_HANGEUL = 0x15 + VK_HANGUL = 0x15 + VK_IME_ON = 0x16 + VK_JUNJA = 0x17 + VK_FINAL = 0x18 + VK_HANJA = 0x19 + VK_KANJI = 0x19 + VK_IME_OFF = 0x1A + VK_ESCAPE = 0x1B + VK_CONVERT = 0x1C + VK_NONCONVERT = 0x1D + VK_ACCEPT = 0x1E + VK_MODECHANGE = 0x1F + VK_SPACE = 0x20 + VK_PRIOR = 0x21 + VK_NEXT = 0x22 + VK_END = 0x23 + VK_HOME = 0x24 + VK_LEFT = 0x25 + VK_UP = 0x26 + VK_RIGHT = 0x27 + VK_DOWN = 0x28 + VK_SELECT = 0x29 + VK_PRINT = 0x2A + VK_EXECUTE = 0x2B + VK_SNAPSHOT = 0x2C + VK_INSERT = 0x2D + VK_DELETE = 0x2E + VK_HELP = 0x2F + VK_LWIN = 0x5B + VK_RWIN = 0x5C + VK_APPS = 0x5D + VK_SLEEP = 0x5F + VK_NUMPAD0 = 0x60 + VK_NUMPAD1 = 0x61 + VK_NUMPAD2 = 0x62 + VK_NUMPAD3 = 0x63 + VK_NUMPAD4 = 0x64 + VK_NUMPAD5 = 0x65 + VK_NUMPAD6 = 0x66 + VK_NUMPAD7 = 0x67 + VK_NUMPAD8 = 0x68 + VK_NUMPAD9 = 0x69 + VK_MULTIPLY = 0x6A + VK_ADD = 0x6B + VK_SEPARATOR = 0x6C + VK_SUBTRACT = 0x6D + VK_DECIMAL = 0x6E + VK_DIVIDE = 0x6F + VK_F1 = 0x70 + VK_F2 = 0x71 + VK_F3 = 0x72 + VK_F4 = 0x73 + VK_F5 = 0x74 + VK_F6 = 0x75 + VK_F7 = 0x76 + VK_F8 = 0x77 + VK_F9 = 0x78 + VK_F10 = 0x79 + VK_F11 = 0x7A + VK_F12 = 0x7B + VK_F13 = 0x7C + VK_F14 = 0x7D + VK_F15 = 0x7E + VK_F16 = 0x7F + VK_F17 = 0x80 + VK_F18 = 0x81 + VK_F19 = 0x82 + VK_F20 = 0x83 + VK_F21 = 0x84 + VK_F22 = 0x85 + VK_F23 = 0x86 + VK_F24 = 0x87 + VK_NUMLOCK = 0x90 + VK_SCROLL = 0x91 + VK_OEM_NEC_EQUAL = 0x92 + VK_OEM_FJ_JISHO = 0x92 + VK_OEM_FJ_MASSHOU = 0x93 + VK_OEM_FJ_TOUROKU = 0x94 + VK_OEM_FJ_LOYA = 0x95 + VK_OEM_FJ_ROYA = 0x96 + VK_LSHIFT = 0xA0 + VK_RSHIFT = 0xA1 + VK_LCONTROL = 0xA2 + VK_RCONTROL = 0xA3 + VK_LMENU = 0xA4 + VK_RMENU = 0xA5 + VK_BROWSER_BACK = 0xA6 + VK_BROWSER_FORWARD = 0xA7 + VK_BROWSER_REFRESH = 0xA8 + VK_BROWSER_STOP = 0xA9 + VK_BROWSER_SEARCH = 0xAA + VK_BROWSER_FAVORITES = 0xAB + VK_BROWSER_HOME = 0xAC + VK_VOLUME_MUTE = 0xAD + VK_VOLUME_DOWN = 0xAE + VK_VOLUME_UP = 0xAF + VK_MEDIA_NEXT_TRACK = 0xB0 + VK_MEDIA_PREV_TRACK = 0xB1 + VK_MEDIA_STOP = 0xB2 + VK_MEDIA_PLAY_PAUSE = 0xB3 + VK_LAUNCH_MAIL = 0xB4 + VK_LAUNCH_MEDIA_SELECT = 0xB5 + VK_LAUNCH_APP1 = 0xB6 + VK_LAUNCH_APP2 = 0xB7 + VK_OEM_1 = 0xBA + VK_OEM_PLUS = 0xBB + VK_OEM_COMMA = 0xBC + VK_OEM_MINUS = 0xBD + VK_OEM_PERIOD = 0xBE + VK_OEM_2 = 0xBF + VK_OEM_3 = 0xC0 + VK_OEM_4 = 0xDB + VK_OEM_5 = 0xDC + VK_OEM_6 = 0xDD + VK_OEM_7 = 0xDE + VK_OEM_8 = 0xDF + VK_OEM_AX = 0xE1 + VK_OEM_102 = 0xE2 + VK_ICO_HELP = 0xE3 + VK_ICO_00 = 0xE4 + VK_PROCESSKEY = 0xE5 + VK_ICO_CLEAR = 0xE6 + VK_OEM_RESET = 0xE9 + VK_OEM_JUMP = 0xEA + VK_OEM_PA1 = 0xEB + VK_OEM_PA2 = 0xEC + VK_OEM_PA3 = 0xED + VK_OEM_WSCTRL = 0xEE + VK_OEM_CUSEL = 0xEF + VK_OEM_ATTN = 0xF0 + VK_OEM_FINISH = 0xF1 + VK_OEM_COPY = 0xF2 + VK_OEM_AUTO = 0xF3 + VK_OEM_ENLW = 0xF4 + VK_OEM_BACKTAB = 0xF5 + VK_ATTN = 0xF6 + VK_CRSEL = 0xF7 + VK_EXSEL = 0xF8 + VK_EREOF = 0xF9 + VK_PLAY = 0xFA + VK_ZOOM = 0xFB + VK_NONAME = 0xFC + VK_PA1 = 0xFD + VK_OEM_CLEAR = 0xFE +) + +// Mouse button constants. +// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str +const ( + FROM_LEFT_1ST_BUTTON_PRESSED = 0x0001 + RIGHTMOST_BUTTON_PRESSED = 0x0002 + FROM_LEFT_2ND_BUTTON_PRESSED = 0x0004 + FROM_LEFT_3RD_BUTTON_PRESSED = 0x0008 + FROM_LEFT_4TH_BUTTON_PRESSED = 0x0010 +) + +// Control key state constaints. +// https://docs.microsoft.com/en-us/windows/console/key-event-record-str +// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str +const ( + CAPSLOCK_ON = 0x0080 + ENHANCED_KEY = 0x0100 + LEFT_ALT_PRESSED = 0x0002 + LEFT_CTRL_PRESSED = 0x0008 + NUMLOCK_ON = 0x0020 + RIGHT_ALT_PRESSED = 0x0001 + RIGHT_CTRL_PRESSED = 0x0004 + SCROLLLOCK_ON = 0x0040 + SHIFT_PRESSED = 0x0010 +) + +// Mouse event record event flags. +// https://docs.microsoft.com/en-us/windows/console/mouse-event-record-str +const ( + MOUSE_MOVED = 0x0001 + DOUBLE_CLICK = 0x0002 + MOUSE_WHEELED = 0x0004 + MOUSE_HWHEELED = 0x0008 +) + +// Input Record Event Types +// https://learn.microsoft.com/en-us/windows/console/input-record-str +const ( + FOCUS_EVENT = 0x0010 + KEY_EVENT = 0x0001 + MENU_EVENT = 0x0008 + MOUSE_EVENT = 0x0002 + WINDOW_BUFFER_SIZE_EVENT = 0x0004 +) diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index 01c0716..641a5f4 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -511,6 +511,7 @@ var ( procFreeAddrInfoW = modws2_32.NewProc("FreeAddrInfoW") procGetAddrInfoW = modws2_32.NewProc("GetAddrInfoW") procWSACleanup = modws2_32.NewProc("WSACleanup") + procWSADuplicateSocketW = modws2_32.NewProc("WSADuplicateSocketW") procWSAEnumProtocolsW = modws2_32.NewProc("WSAEnumProtocolsW") procWSAGetOverlappedResult = modws2_32.NewProc("WSAGetOverlappedResult") procWSAIoctl = modws2_32.NewProc("WSAIoctl") @@ -545,25 +546,25 @@ var ( ) func cm_Get_DevNode_Status(status *uint32, problemNumber *uint32, devInst DEVINST, flags uint32) (ret CONFIGRET) { - r0, _, _ := syscall.Syscall6(procCM_Get_DevNode_Status.Addr(), 4, uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags), 0, 0) + r0, _, _ := syscall.SyscallN(procCM_Get_DevNode_Status.Addr(), uintptr(unsafe.Pointer(status)), uintptr(unsafe.Pointer(problemNumber)), uintptr(devInst), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_Get_Device_Interface_List(interfaceClass *GUID, deviceID *uint16, buffer *uint16, bufferLen uint32, flags uint32) (ret CONFIGRET) { - r0, _, _ := syscall.Syscall6(procCM_Get_Device_Interface_ListW.Addr(), 5, uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags), 0) + r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_ListW.Addr(), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(unsafe.Pointer(buffer)), uintptr(bufferLen), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_Get_Device_Interface_List_Size(len *uint32, interfaceClass *GUID, deviceID *uint16, flags uint32) (ret CONFIGRET) { - r0, _, _ := syscall.Syscall6(procCM_Get_Device_Interface_List_SizeW.Addr(), 4, uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags), 0, 0) + r0, _, _ := syscall.SyscallN(procCM_Get_Device_Interface_List_SizeW.Addr(), uintptr(unsafe.Pointer(len)), uintptr(unsafe.Pointer(interfaceClass)), uintptr(unsafe.Pointer(deviceID)), uintptr(flags)) ret = CONFIGRET(r0) return } func cm_MapCrToWin32Err(configRet CONFIGRET, defaultWin32Error Errno) (ret Errno) { - r0, _, _ := syscall.Syscall(procCM_MapCrToWin32Err.Addr(), 2, uintptr(configRet), uintptr(defaultWin32Error), 0) + r0, _, _ := syscall.SyscallN(procCM_MapCrToWin32Err.Addr(), uintptr(configRet), uintptr(defaultWin32Error)) ret = Errno(r0) return } @@ -573,7 +574,7 @@ func AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups, if resetToDefault { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procAdjustTokenGroups.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) + r1, _, e1 := syscall.SyscallN(procAdjustTokenGroups.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) if r1 == 0 { err = errnoErr(e1) } @@ -585,7 +586,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok if disableAllPrivileges { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procAdjustTokenPrivileges.Addr(), 6, uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) + r1, _, e1 := syscall.SyscallN(procAdjustTokenPrivileges.Addr(), uintptr(token), uintptr(_p0), uintptr(unsafe.Pointer(newstate)), uintptr(buflen), uintptr(unsafe.Pointer(prevstate)), uintptr(unsafe.Pointer(returnlen))) if r1 == 0 { err = errnoErr(e1) } @@ -593,7 +594,7 @@ func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tok } func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **SID) (err error) { - r1, _, e1 := syscall.Syscall12(procAllocateAndInitializeSid.Addr(), 11, uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid)), 0) + r1, _, e1 := syscall.SyscallN(procAllocateAndInitializeSid.Addr(), uintptr(unsafe.Pointer(identAuth)), uintptr(subAuth), uintptr(subAuth0), uintptr(subAuth1), uintptr(subAuth2), uintptr(subAuth3), uintptr(subAuth4), uintptr(subAuth5), uintptr(subAuth6), uintptr(subAuth7), uintptr(unsafe.Pointer(sid))) if r1 == 0 { err = errnoErr(e1) } @@ -601,7 +602,7 @@ func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, s } func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries uint32, accessEntries *EXPLICIT_ACCESS, countAuditEntries uint32, auditEntries *EXPLICIT_ACCESS, oldSecurityDescriptor *SECURITY_DESCRIPTOR, sizeNewSecurityDescriptor *uint32, newSecurityDescriptor **SECURITY_DESCRIPTOR) (ret error) { - r0, _, _ := syscall.Syscall9(procBuildSecurityDescriptorW.Addr(), 9, uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor))) + r0, _, _ := syscall.SyscallN(procBuildSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(countAccessEntries), uintptr(unsafe.Pointer(accessEntries)), uintptr(countAuditEntries), uintptr(unsafe.Pointer(auditEntries)), uintptr(unsafe.Pointer(oldSecurityDescriptor)), uintptr(unsafe.Pointer(sizeNewSecurityDescriptor)), uintptr(unsafe.Pointer(newSecurityDescriptor))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -609,7 +610,7 @@ func buildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, countAccessEntries } func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err error) { - r1, _, e1 := syscall.Syscall(procChangeServiceConfig2W.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) + r1, _, e1 := syscall.SyscallN(procChangeServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -617,7 +618,7 @@ func ChangeServiceConfig2(service Handle, infoLevel uint32, info *byte) (err err } func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error) { - r1, _, e1 := syscall.Syscall12(procChangeServiceConfigW.Addr(), 11, uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName)), 0) + r1, _, e1 := syscall.SyscallN(procChangeServiceConfigW.Addr(), uintptr(service), uintptr(serviceType), uintptr(startType), uintptr(errorControl), uintptr(unsafe.Pointer(binaryPathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), uintptr(unsafe.Pointer(displayName))) if r1 == 0 { err = errnoErr(e1) } @@ -625,7 +626,7 @@ func ChangeServiceConfig(service Handle, serviceType uint32, startType uint32, e } func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) (err error) { - r1, _, e1 := syscall.Syscall(procCheckTokenMembership.Addr(), 3, uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) + r1, _, e1 := syscall.SyscallN(procCheckTokenMembership.Addr(), uintptr(tokenHandle), uintptr(unsafe.Pointer(sidToCheck)), uintptr(unsafe.Pointer(isMember))) if r1 == 0 { err = errnoErr(e1) } @@ -633,7 +634,7 @@ func checkTokenMembership(tokenHandle Token, sidToCheck *SID, isMember *int32) ( } func CloseServiceHandle(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCloseServiceHandle.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procCloseServiceHandle.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -641,7 +642,7 @@ func CloseServiceHandle(handle Handle) (err error) { } func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procControlService.Addr(), 3, uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) + r1, _, e1 := syscall.SyscallN(procControlService.Addr(), uintptr(service), uintptr(control), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } @@ -649,7 +650,7 @@ func ControlService(service Handle, control uint32, status *SERVICE_STATUS) (err } func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR, revision uint32, securityInformation SECURITY_INFORMATION, str **uint16, strLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), 5, uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen)), 0) + r1, _, e1 := syscall.SyscallN(procConvertSecurityDescriptorToStringSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(revision), uintptr(securityInformation), uintptr(unsafe.Pointer(str)), uintptr(unsafe.Pointer(strLen))) if r1 == 0 { err = errnoErr(e1) } @@ -657,7 +658,7 @@ func convertSecurityDescriptorToStringSecurityDescriptor(sd *SECURITY_DESCRIPTOR } func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0) + r1, _, e1 := syscall.SyscallN(procConvertSidToStringSidW.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid))) if r1 == 0 { err = errnoErr(e1) } @@ -674,7 +675,7 @@ func convertStringSecurityDescriptorToSecurityDescriptor(str string, revision ui } func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision uint32, sd **SECURITY_DESCRIPTOR, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), 4, uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procConvertStringSecurityDescriptorToSecurityDescriptorW.Addr(), uintptr(unsafe.Pointer(str)), uintptr(revision), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } @@ -682,7 +683,7 @@ func _convertStringSecurityDescriptorToSecurityDescriptor(str *uint16, revision } func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { - r1, _, e1 := syscall.Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0) + r1, _, e1 := syscall.SyscallN(procConvertStringSidToSidW.Addr(), uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid))) if r1 == 0 { err = errnoErr(e1) } @@ -690,7 +691,7 @@ func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) { } func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) { - r1, _, e1 := syscall.Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) + r1, _, e1 := syscall.SyscallN(procCopySid.Addr(), uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid))) if r1 == 0 { err = errnoErr(e1) } @@ -702,7 +703,7 @@ func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, proc if inheritHandles { _p0 = 1 } - r1, _, e1 := syscall.Syscall12(procCreateProcessAsUserW.Addr(), 11, uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0) + r1, _, e1 := syscall.SyscallN(procCreateProcessAsUserW.Addr(), uintptr(token), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) if r1 == 0 { err = errnoErr(e1) } @@ -710,7 +711,7 @@ func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, proc } func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall15(procCreateServiceW.Addr(), 13, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password)), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(unsafe.Pointer(displayName)), uintptr(access), uintptr(srvType), uintptr(startType), uintptr(errCtl), uintptr(unsafe.Pointer(pathName)), uintptr(unsafe.Pointer(loadOrderGroup)), uintptr(unsafe.Pointer(tagId)), uintptr(unsafe.Pointer(dependencies)), uintptr(unsafe.Pointer(serviceStartName)), uintptr(unsafe.Pointer(password))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -719,7 +720,7 @@ func CreateService(mgr Handle, serviceName *uint16, displayName *uint16, access } func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, sizeSid *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCreateWellKnownSid.Addr(), 4, uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCreateWellKnownSid.Addr(), uintptr(sidType), uintptr(unsafe.Pointer(domainSid)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sizeSid))) if r1 == 0 { err = errnoErr(e1) } @@ -727,7 +728,7 @@ func createWellKnownSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID, sid *SID, s } func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCryptAcquireContextW.Addr(), 5, uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procCryptAcquireContextW.Addr(), uintptr(unsafe.Pointer(provhandle)), uintptr(unsafe.Pointer(container)), uintptr(unsafe.Pointer(provider)), uintptr(provtype), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -735,7 +736,7 @@ func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16 } func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { - r1, _, e1 := syscall.Syscall(procCryptGenRandom.Addr(), 3, uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) + r1, _, e1 := syscall.SyscallN(procCryptGenRandom.Addr(), uintptr(provhandle), uintptr(buflen), uintptr(unsafe.Pointer(buf))) if r1 == 0 { err = errnoErr(e1) } @@ -743,7 +744,7 @@ func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error) { } func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCryptReleaseContext.Addr(), 2, uintptr(provhandle), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procCryptReleaseContext.Addr(), uintptr(provhandle), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -751,7 +752,7 @@ func CryptReleaseContext(provhandle Handle, flags uint32) (err error) { } func DeleteService(service Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteService.Addr(), 1, uintptr(service), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeleteService.Addr(), uintptr(service)) if r1 == 0 { err = errnoErr(e1) } @@ -759,7 +760,7 @@ func DeleteService(service Handle) (err error) { } func DeregisterEventSource(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDeregisterEventSource.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeregisterEventSource.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -767,7 +768,7 @@ func DeregisterEventSource(handle Handle) (err error) { } func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error) { - r1, _, e1 := syscall.Syscall6(procDuplicateTokenEx.Addr(), 6, uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken))) + r1, _, e1 := syscall.SyscallN(procDuplicateTokenEx.Addr(), uintptr(existingToken), uintptr(desiredAccess), uintptr(unsafe.Pointer(tokenAttributes)), uintptr(impersonationLevel), uintptr(tokenType), uintptr(unsafe.Pointer(newToken))) if r1 == 0 { err = errnoErr(e1) } @@ -775,7 +776,7 @@ func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes } func EnumDependentServices(service Handle, activityState uint32, services *ENUM_SERVICE_STATUS, buffSize uint32, bytesNeeded *uint32, servicesReturned *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procEnumDependentServicesW.Addr(), 6, uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) + r1, _, e1 := syscall.SyscallN(procEnumDependentServicesW.Addr(), uintptr(service), uintptr(activityState), uintptr(unsafe.Pointer(services)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned))) if r1 == 0 { err = errnoErr(e1) } @@ -783,7 +784,7 @@ func EnumDependentServices(service Handle, activityState uint32, services *ENUM_ } func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error) { - r1, _, e1 := syscall.Syscall12(procEnumServicesStatusExW.Addr(), 10, uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName)), 0, 0) + r1, _, e1 := syscall.SyscallN(procEnumServicesStatusExW.Addr(), uintptr(mgr), uintptr(infoLevel), uintptr(serviceType), uintptr(serviceState), uintptr(unsafe.Pointer(services)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), uintptr(unsafe.Pointer(servicesReturned)), uintptr(unsafe.Pointer(resumeHandle)), uintptr(unsafe.Pointer(groupName))) if r1 == 0 { err = errnoErr(e1) } @@ -791,13 +792,13 @@ func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serv } func EqualSid(sid1 *SID, sid2 *SID) (isEqual bool) { - r0, _, _ := syscall.Syscall(procEqualSid.Addr(), 2, uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2)), 0) + r0, _, _ := syscall.SyscallN(procEqualSid.Addr(), uintptr(unsafe.Pointer(sid1)), uintptr(unsafe.Pointer(sid2))) isEqual = r0 != 0 return } func FreeSid(sid *SID) (err error) { - r1, _, e1 := syscall.Syscall(procFreeSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r1, _, e1 := syscall.SyscallN(procFreeSid.Addr(), uintptr(unsafe.Pointer(sid))) if r1 != 0 { err = errnoErr(e1) } @@ -805,7 +806,7 @@ func FreeSid(sid *SID) (err error) { } func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { - r1, _, e1 := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) + r1, _, e1 := syscall.SyscallN(procGetAce.Addr(), uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) if r1 == 0 { err = errnoErr(e1) } @@ -813,7 +814,7 @@ func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (err error) { } func GetLengthSid(sid *SID) (len uint32) { - r0, _, _ := syscall.Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetLengthSid.Addr(), uintptr(unsafe.Pointer(sid))) len = uint32(r0) return } @@ -828,7 +829,7 @@ func getNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security } func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { - r0, _, _ := syscall.Syscall9(procGetNamedSecurityInfoW.Addr(), 8, uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)), 0) + r0, _, _ := syscall.SyscallN(procGetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -836,7 +837,7 @@ func _getNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securi } func getSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, control *SECURITY_DESCRIPTOR_CONTROL, revision *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorControl.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision))) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(control)), uintptr(unsafe.Pointer(revision))) if r1 == 0 { err = errnoErr(e1) } @@ -852,7 +853,7 @@ func getSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent *bool, dacl if *daclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procGetSecurityDescriptorDacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(&_p1))) *daclPresent = _p0 != 0 *daclDefaulted = _p1 != 0 if r1 == 0 { @@ -866,7 +867,7 @@ func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefau if *groupDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorGroup.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0))) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(&_p0))) *groupDefaulted = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -875,7 +876,7 @@ func getSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group **SID, groupDefau } func getSecurityDescriptorLength(sd *SECURITY_DESCRIPTOR) (len uint32) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorLength.Addr(), 1, uintptr(unsafe.Pointer(sd)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorLength.Addr(), uintptr(unsafe.Pointer(sd))) len = uint32(r0) return } @@ -885,7 +886,7 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau if *ownerDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procGetSecurityDescriptorOwner.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0))) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(&_p0))) *ownerDefaulted = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -894,7 +895,7 @@ func getSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner **SID, ownerDefau } func getSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) (ret error) { - r0, _, _ := syscall.Syscall(procGetSecurityDescriptorRMControl.Addr(), 2, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)), 0) + r0, _, _ := syscall.SyscallN(procGetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -910,7 +911,7 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl if *saclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procGetSecurityDescriptorSacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(&_p0)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(&_p1))) *saclPresent = _p0 != 0 *saclDefaulted = _p1 != 0 if r1 == 0 { @@ -920,7 +921,7 @@ func getSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent *bool, sacl } func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner **SID, group **SID, dacl **ACL, sacl **ACL, sd **SECURITY_DESCRIPTOR) (ret error) { - r0, _, _ := syscall.Syscall9(procGetSecurityInfo.Addr(), 8, uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd)), 0) + r0, _, _ := syscall.SyscallN(procGetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(sd))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -928,25 +929,25 @@ func getSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati } func getSidIdentifierAuthority(sid *SID) (authority *SidIdentifierAuthority) { - r0, _, _ := syscall.Syscall(procGetSidIdentifierAuthority.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetSidIdentifierAuthority.Addr(), uintptr(unsafe.Pointer(sid))) authority = (*SidIdentifierAuthority)(unsafe.Pointer(r0)) return } func getSidSubAuthority(sid *SID, index uint32) (subAuthority *uint32) { - r0, _, _ := syscall.Syscall(procGetSidSubAuthority.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(index), 0) + r0, _, _ := syscall.SyscallN(procGetSidSubAuthority.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(index)) subAuthority = (*uint32)(unsafe.Pointer(r0)) return } func getSidSubAuthorityCount(sid *SID) (count *uint8) { - r0, _, _ := syscall.Syscall(procGetSidSubAuthorityCount.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetSidSubAuthorityCount.Addr(), uintptr(unsafe.Pointer(sid))) count = (*uint8)(unsafe.Pointer(r0)) return } func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetTokenInformation.Addr(), 5, uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0) + r1, _, e1 := syscall.SyscallN(procGetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen))) if r1 == 0 { err = errnoErr(e1) } @@ -954,7 +955,7 @@ func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint } func ImpersonateSelf(impersonationlevel uint32) (err error) { - r1, _, e1 := syscall.Syscall(procImpersonateSelf.Addr(), 1, uintptr(impersonationlevel), 0, 0) + r1, _, e1 := syscall.SyscallN(procImpersonateSelf.Addr(), uintptr(impersonationlevel)) if r1 == 0 { err = errnoErr(e1) } @@ -962,7 +963,7 @@ func ImpersonateSelf(impersonationlevel uint32) (err error) { } func initializeSecurityDescriptor(absoluteSD *SECURITY_DESCRIPTOR, revision uint32) (err error) { - r1, _, e1 := syscall.Syscall(procInitializeSecurityDescriptor.Addr(), 2, uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision), 0) + r1, _, e1 := syscall.SyscallN(procInitializeSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(revision)) if r1 == 0 { err = errnoErr(e1) } @@ -978,7 +979,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint if rebootAfterShutdown { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procInitiateSystemShutdownExW.Addr(), 6, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason)) + r1, _, e1 := syscall.SyscallN(procInitiateSystemShutdownExW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(message)), uintptr(timeout), uintptr(_p0), uintptr(_p1), uintptr(reason)) if r1 == 0 { err = errnoErr(e1) } @@ -986,7 +987,7 @@ func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint } func isTokenRestricted(tokenHandle Token) (ret bool, err error) { - r0, _, e1 := syscall.Syscall(procIsTokenRestricted.Addr(), 1, uintptr(tokenHandle), 0, 0) + r0, _, e1 := syscall.SyscallN(procIsTokenRestricted.Addr(), uintptr(tokenHandle)) ret = r0 != 0 if !ret { err = errnoErr(e1) @@ -995,25 +996,25 @@ func isTokenRestricted(tokenHandle Token) (ret bool, err error) { } func isValidSecurityDescriptor(sd *SECURITY_DESCRIPTOR) (isValid bool) { - r0, _, _ := syscall.Syscall(procIsValidSecurityDescriptor.Addr(), 1, uintptr(unsafe.Pointer(sd)), 0, 0) + r0, _, _ := syscall.SyscallN(procIsValidSecurityDescriptor.Addr(), uintptr(unsafe.Pointer(sd))) isValid = r0 != 0 return } func isValidSid(sid *SID) (isValid bool) { - r0, _, _ := syscall.Syscall(procIsValidSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0) + r0, _, _ := syscall.SyscallN(procIsValidSid.Addr(), uintptr(unsafe.Pointer(sid))) isValid = r0 != 0 return } func isWellKnownSid(sid *SID, sidType WELL_KNOWN_SID_TYPE) (isWellKnown bool) { - r0, _, _ := syscall.Syscall(procIsWellKnownSid.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(sidType), 0) + r0, _, _ := syscall.SyscallN(procIsWellKnownSid.Addr(), uintptr(unsafe.Pointer(sid)), uintptr(sidType)) isWellKnown = r0 != 0 return } func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0) + r1, _, e1 := syscall.SyscallN(procLookupAccountNameW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) if r1 == 0 { err = errnoErr(e1) } @@ -1021,7 +1022,7 @@ func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen } func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0) + r1, _, e1 := syscall.SyscallN(procLookupAccountSidW.Addr(), uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use))) if r1 == 0 { err = errnoErr(e1) } @@ -1029,7 +1030,7 @@ func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint3 } func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error) { - r1, _, e1 := syscall.Syscall(procLookupPrivilegeValueW.Addr(), 3, uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) + r1, _, e1 := syscall.SyscallN(procLookupPrivilegeValueW.Addr(), uintptr(unsafe.Pointer(systemname)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(luid))) if r1 == 0 { err = errnoErr(e1) } @@ -1037,7 +1038,7 @@ func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err err } func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DESCRIPTOR, absoluteSDSize *uint32, dacl *ACL, daclSize *uint32, sacl *ACL, saclSize *uint32, owner *SID, ownerSize *uint32, group *SID, groupSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall12(procMakeAbsoluteSD.Addr(), 11, uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize)), 0) + r1, _, e1 := syscall.SyscallN(procMakeAbsoluteSD.Addr(), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(absoluteSDSize)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(daclSize)), uintptr(unsafe.Pointer(sacl)), uintptr(unsafe.Pointer(saclSize)), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(ownerSize)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(groupSize))) if r1 == 0 { err = errnoErr(e1) } @@ -1045,7 +1046,7 @@ func makeAbsoluteSD(selfRelativeSD *SECURITY_DESCRIPTOR, absoluteSD *SECURITY_DE } func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procMakeSelfRelativeSD.Addr(), 3, uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize))) + r1, _, e1 := syscall.SyscallN(procMakeSelfRelativeSD.Addr(), uintptr(unsafe.Pointer(absoluteSD)), uintptr(unsafe.Pointer(selfRelativeSD)), uintptr(unsafe.Pointer(selfRelativeSDSize))) if r1 == 0 { err = errnoErr(e1) } @@ -1053,7 +1054,7 @@ func makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURIT } func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error) { - r0, _, _ := syscall.Syscall(procNotifyServiceStatusChangeW.Addr(), 3, uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) + r0, _, _ := syscall.SyscallN(procNotifyServiceStatusChangeW.Addr(), uintptr(service), uintptr(notifyMask), uintptr(unsafe.Pointer(notifier))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1061,7 +1062,7 @@ func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERV } func OpenProcessToken(process Handle, access uint32, token *Token) (err error) { - r1, _, e1 := syscall.Syscall(procOpenProcessToken.Addr(), 3, uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token))) + r1, _, e1 := syscall.SyscallN(procOpenProcessToken.Addr(), uintptr(process), uintptr(access), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } @@ -1069,7 +1070,7 @@ func OpenProcessToken(process Handle, access uint32, token *Token) (err error) { } func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procOpenSCManagerW.Addr(), 3, uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) + r0, _, e1 := syscall.SyscallN(procOpenSCManagerW.Addr(), uintptr(unsafe.Pointer(machineName)), uintptr(unsafe.Pointer(databaseName)), uintptr(access)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1078,7 +1079,7 @@ func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (ha } func OpenService(mgr Handle, serviceName *uint16, access uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procOpenServiceW.Addr(), 3, uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) + r0, _, e1 := syscall.SyscallN(procOpenServiceW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(serviceName)), uintptr(access)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1091,7 +1092,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token if openAsSelf { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procOpenThreadToken.Addr(), 4, uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token)), 0, 0) + r1, _, e1 := syscall.SyscallN(procOpenThreadToken.Addr(), uintptr(thread), uintptr(access), uintptr(_p0), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } @@ -1099,7 +1100,7 @@ func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token } func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceConfig2W.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceConfig2W.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1107,7 +1108,7 @@ func QueryServiceConfig2(service Handle, infoLevel uint32, buff *byte, buffSize } func QueryServiceConfig(service Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceConfigW.Addr(), 4, uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceConfigW.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceConfig)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1119,7 +1120,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf if err != nil { return } - r1, _, e1 := syscall.Syscall(procQueryServiceDynamicInformation.Addr(), 3, uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo)) + r1, _, e1 := syscall.SyscallN(procQueryServiceDynamicInformation.Addr(), uintptr(service), uintptr(infoLevel), uintptr(dynamicInfo)) if r1 == 0 { err = errnoErr(e1) } @@ -1127,7 +1128,7 @@ func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInf } func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceLockStatusW.Addr(), 4, uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded)), 0, 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceLockStatusW.Addr(), uintptr(mgr), uintptr(unsafe.Pointer(lockStatus)), uintptr(bufSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1135,7 +1136,7 @@ func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, b } func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procQueryServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(status)), 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } @@ -1143,7 +1144,7 @@ func QueryServiceStatus(service Handle, status *SERVICE_STATUS) (err error) { } func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryServiceStatusEx.Addr(), 5, uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded)), 0) + r1, _, e1 := syscall.SyscallN(procQueryServiceStatusEx.Addr(), uintptr(service), uintptr(infoLevel), uintptr(unsafe.Pointer(buff)), uintptr(buffSize), uintptr(unsafe.Pointer(bytesNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -1151,7 +1152,7 @@ func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize } func RegCloseKey(key Handle) (regerrno error) { - r0, _, _ := syscall.Syscall(procRegCloseKey.Addr(), 1, uintptr(key), 0, 0) + r0, _, _ := syscall.SyscallN(procRegCloseKey.Addr(), uintptr(key)) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1159,7 +1160,7 @@ func RegCloseKey(key Handle) (regerrno error) { } func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error) { - r0, _, _ := syscall.Syscall9(procRegEnumKeyExW.Addr(), 8, uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime)), 0) + r0, _, _ := syscall.SyscallN(procRegEnumKeyExW.Addr(), uintptr(key), uintptr(index), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(lastWriteTime))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1175,7 +1176,7 @@ func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, if asynchronous { _p1 = 1 } - r0, _, _ := syscall.Syscall6(procRegNotifyChangeKeyValue.Addr(), 5, uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1), 0) + r0, _, _ := syscall.SyscallN(procRegNotifyChangeKeyValue.Addr(), uintptr(key), uintptr(_p0), uintptr(notifyFilter), uintptr(event), uintptr(_p1)) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1183,7 +1184,7 @@ func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, } func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error) { - r0, _, _ := syscall.Syscall6(procRegOpenKeyExW.Addr(), 5, uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result)), 0) + r0, _, _ := syscall.SyscallN(procRegOpenKeyExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(subkey)), uintptr(options), uintptr(desiredAccess), uintptr(unsafe.Pointer(result))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1191,7 +1192,7 @@ func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint } func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error) { - r0, _, _ := syscall.Syscall12(procRegQueryInfoKeyW.Addr(), 12, uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime))) + r0, _, _ := syscall.SyscallN(procRegQueryInfoKeyW.Addr(), uintptr(key), uintptr(unsafe.Pointer(class)), uintptr(unsafe.Pointer(classLen)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(subkeysLen)), uintptr(unsafe.Pointer(maxSubkeyLen)), uintptr(unsafe.Pointer(maxClassLen)), uintptr(unsafe.Pointer(valuesLen)), uintptr(unsafe.Pointer(maxValueNameLen)), uintptr(unsafe.Pointer(maxValueLen)), uintptr(unsafe.Pointer(saLen)), uintptr(unsafe.Pointer(lastWriteTime))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1199,7 +1200,7 @@ func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint } func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error) { - r0, _, _ := syscall.Syscall6(procRegQueryValueExW.Addr(), 6, uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) + r0, _, _ := syscall.SyscallN(procRegQueryValueExW.Addr(), uintptr(key), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(reserved)), uintptr(unsafe.Pointer(valtype)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(buflen))) if r0 != 0 { regerrno = syscall.Errno(r0) } @@ -1207,7 +1208,7 @@ func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32 } func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procRegisterEventSourceW.Addr(), 2, uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName)), 0) + r0, _, e1 := syscall.SyscallN(procRegisterEventSourceW.Addr(), uintptr(unsafe.Pointer(uncServerName)), uintptr(unsafe.Pointer(sourceName))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1216,7 +1217,7 @@ func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle Hand } func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, context uintptr) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procRegisterServiceCtrlHandlerExW.Addr(), 3, uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context)) + r0, _, e1 := syscall.SyscallN(procRegisterServiceCtrlHandlerExW.Addr(), uintptr(unsafe.Pointer(serviceName)), uintptr(handlerProc), uintptr(context)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1225,7 +1226,7 @@ func RegisterServiceCtrlHandlerEx(serviceName *uint16, handlerProc uintptr, cont } func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procReportEventW.Addr(), 9, uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) + r1, _, e1 := syscall.SyscallN(procReportEventW.Addr(), uintptr(log), uintptr(etype), uintptr(category), uintptr(eventId), uintptr(usrSId), uintptr(numStrings), uintptr(dataSize), uintptr(unsafe.Pointer(strings)), uintptr(unsafe.Pointer(rawData))) if r1 == 0 { err = errnoErr(e1) } @@ -1233,7 +1234,7 @@ func ReportEvent(log Handle, etype uint16, category uint16, eventId uint32, usrS } func RevertToSelf() (err error) { - r1, _, e1 := syscall.Syscall(procRevertToSelf.Addr(), 0, 0, 0, 0) + r1, _, e1 := syscall.SyscallN(procRevertToSelf.Addr()) if r1 == 0 { err = errnoErr(e1) } @@ -1241,7 +1242,7 @@ func RevertToSelf() (err error) { } func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) { - r0, _, _ := syscall.Syscall6(procSetEntriesInAclW.Addr(), 4, uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL)), 0, 0) + r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1249,7 +1250,7 @@ func setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCE } func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { - r1, _, e1 := syscall.Syscall(procSetKernelObjectSecurity.Addr(), 3, uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) + r1, _, e1 := syscall.SyscallN(procSetKernelObjectSecurity.Addr(), uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) if r1 == 0 { err = errnoErr(e1) } @@ -1266,7 +1267,7 @@ func SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, security } func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { - r0, _, _ := syscall.Syscall9(procSetNamedSecurityInfoW.Addr(), 7, uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), 0, 0) + r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1274,7 +1275,7 @@ func _SetNamedSecurityInfo(objectName *uint16, objectType SE_OBJECT_TYPE, securi } func setSecurityDescriptorControl(sd *SECURITY_DESCRIPTOR, controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) (err error) { - r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorControl.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet)) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(controlBitsOfInterest), uintptr(controlBitsToSet)) if r1 == 0 { err = errnoErr(e1) } @@ -1290,7 +1291,7 @@ func setSecurityDescriptorDacl(sd *SECURITY_DESCRIPTOR, daclPresent bool, dacl * if daclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procSetSecurityDescriptorDacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorDacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(dacl)), uintptr(_p1)) if r1 == 0 { err = errnoErr(e1) } @@ -1302,7 +1303,7 @@ func setSecurityDescriptorGroup(sd *SECURITY_DESCRIPTOR, group *SID, groupDefaul if groupDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorGroup.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0)) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorGroup.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(group)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -1314,7 +1315,7 @@ func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaul if ownerDefaulted { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procSetSecurityDescriptorOwner.Addr(), 3, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0)) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorOwner.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(owner)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -1322,7 +1323,7 @@ func setSecurityDescriptorOwner(sd *SECURITY_DESCRIPTOR, owner *SID, ownerDefaul } func setSecurityDescriptorRMControl(sd *SECURITY_DESCRIPTOR, rmControl *uint8) { - syscall.Syscall(procSetSecurityDescriptorRMControl.Addr(), 2, uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl)), 0) + syscall.SyscallN(procSetSecurityDescriptorRMControl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(unsafe.Pointer(rmControl))) return } @@ -1335,7 +1336,7 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl * if saclDefaulted { _p1 = 1 } - r1, _, e1 := syscall.Syscall6(procSetSecurityDescriptorSacl.Addr(), 4, uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetSecurityDescriptorSacl.Addr(), uintptr(unsafe.Pointer(sd)), uintptr(_p0), uintptr(unsafe.Pointer(sacl)), uintptr(_p1)) if r1 == 0 { err = errnoErr(e1) } @@ -1343,7 +1344,7 @@ func setSecurityDescriptorSacl(sd *SECURITY_DESCRIPTOR, saclPresent bool, sacl * } func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error) { - r0, _, _ := syscall.Syscall9(procSetSecurityInfo.Addr(), 7, uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)), 0, 0) + r0, _, _ := syscall.SyscallN(procSetSecurityInfo.Addr(), uintptr(handle), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1351,7 +1352,7 @@ func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati } func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) { - r1, _, e1 := syscall.Syscall(procSetServiceStatus.Addr(), 2, uintptr(service), uintptr(unsafe.Pointer(serviceStatus)), 0) + r1, _, e1 := syscall.SyscallN(procSetServiceStatus.Addr(), uintptr(service), uintptr(unsafe.Pointer(serviceStatus))) if r1 == 0 { err = errnoErr(e1) } @@ -1359,7 +1360,7 @@ func SetServiceStatus(service Handle, serviceStatus *SERVICE_STATUS) (err error) } func SetThreadToken(thread *Handle, token Token) (err error) { - r1, _, e1 := syscall.Syscall(procSetThreadToken.Addr(), 2, uintptr(unsafe.Pointer(thread)), uintptr(token), 0) + r1, _, e1 := syscall.SyscallN(procSetThreadToken.Addr(), uintptr(unsafe.Pointer(thread)), uintptr(token)) if r1 == 0 { err = errnoErr(e1) } @@ -1367,7 +1368,7 @@ func SetThreadToken(thread *Handle, token Token) (err error) { } func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetTokenInformation.Addr(), 4, uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(token), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen)) if r1 == 0 { err = errnoErr(e1) } @@ -1375,7 +1376,7 @@ func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint } func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { - r1, _, e1 := syscall.Syscall(procStartServiceCtrlDispatcherW.Addr(), 1, uintptr(unsafe.Pointer(serviceTable)), 0, 0) + r1, _, e1 := syscall.SyscallN(procStartServiceCtrlDispatcherW.Addr(), uintptr(unsafe.Pointer(serviceTable))) if r1 == 0 { err = errnoErr(e1) } @@ -1383,7 +1384,7 @@ func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error) { } func StartService(service Handle, numArgs uint32, argVectors **uint16) (err error) { - r1, _, e1 := syscall.Syscall(procStartServiceW.Addr(), 3, uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) + r1, _, e1 := syscall.SyscallN(procStartServiceW.Addr(), uintptr(service), uintptr(numArgs), uintptr(unsafe.Pointer(argVectors))) if r1 == 0 { err = errnoErr(e1) } @@ -1391,7 +1392,7 @@ func StartService(service Handle, numArgs uint32, argVectors **uint16) (err erro } func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error) { - r1, _, e1 := syscall.Syscall6(procCertAddCertificateContextToStore.Addr(), 4, uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertAddCertificateContextToStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(certContext)), uintptr(addDisposition), uintptr(unsafe.Pointer(storeContext))) if r1 == 0 { err = errnoErr(e1) } @@ -1399,7 +1400,7 @@ func CertAddCertificateContextToStore(store Handle, certContext *CertContext, ad } func CertCloseStore(store Handle, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCertCloseStore.Addr(), 2, uintptr(store), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procCertCloseStore.Addr(), uintptr(store), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -1407,7 +1408,7 @@ func CertCloseStore(store Handle, flags uint32) (err error) { } func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error) { - r0, _, e1 := syscall.Syscall(procCertCreateCertificateContext.Addr(), 3, uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen)) + r0, _, e1 := syscall.SyscallN(procCertCreateCertificateContext.Addr(), uintptr(certEncodingType), uintptr(unsafe.Pointer(certEncoded)), uintptr(encodedLen)) context = (*CertContext)(unsafe.Pointer(r0)) if context == nil { err = errnoErr(e1) @@ -1416,7 +1417,7 @@ func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, en } func CertDeleteCertificateFromStore(certContext *CertContext) (err error) { - r1, _, e1 := syscall.Syscall(procCertDeleteCertificateFromStore.Addr(), 1, uintptr(unsafe.Pointer(certContext)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertDeleteCertificateFromStore.Addr(), uintptr(unsafe.Pointer(certContext))) if r1 == 0 { err = errnoErr(e1) } @@ -1424,13 +1425,13 @@ func CertDeleteCertificateFromStore(certContext *CertContext) (err error) { } func CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext) { - r0, _, _ := syscall.Syscall(procCertDuplicateCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(certContext)), 0, 0) + r0, _, _ := syscall.SyscallN(procCertDuplicateCertificateContext.Addr(), uintptr(unsafe.Pointer(certContext))) dupContext = (*CertContext)(unsafe.Pointer(r0)) return } func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error) { - r0, _, e1 := syscall.Syscall(procCertEnumCertificatesInStore.Addr(), 2, uintptr(store), uintptr(unsafe.Pointer(prevContext)), 0) + r0, _, e1 := syscall.SyscallN(procCertEnumCertificatesInStore.Addr(), uintptr(store), uintptr(unsafe.Pointer(prevContext))) context = (*CertContext)(unsafe.Pointer(r0)) if context == nil { err = errnoErr(e1) @@ -1439,7 +1440,7 @@ func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (contex } func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error) { - r0, _, e1 := syscall.Syscall6(procCertFindCertificateInStore.Addr(), 6, uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext))) + r0, _, e1 := syscall.SyscallN(procCertFindCertificateInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevCertContext))) cert = (*CertContext)(unsafe.Pointer(r0)) if cert == nil { err = errnoErr(e1) @@ -1448,7 +1449,7 @@ func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags } func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error) { - r0, _, e1 := syscall.Syscall6(procCertFindChainInStore.Addr(), 6, uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext))) + r0, _, e1 := syscall.SyscallN(procCertFindChainInStore.Addr(), uintptr(store), uintptr(certEncodingType), uintptr(findFlags), uintptr(findType), uintptr(findPara), uintptr(unsafe.Pointer(prevChainContext))) certchain = (*CertChainContext)(unsafe.Pointer(r0)) if certchain == nil { err = errnoErr(e1) @@ -1457,18 +1458,18 @@ func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint3 } func CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension) { - r0, _, _ := syscall.Syscall(procCertFindExtension.Addr(), 3, uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions))) + r0, _, _ := syscall.SyscallN(procCertFindExtension.Addr(), uintptr(unsafe.Pointer(objId)), uintptr(countExtensions), uintptr(unsafe.Pointer(extensions))) ret = (*CertExtension)(unsafe.Pointer(r0)) return } func CertFreeCertificateChain(ctx *CertChainContext) { - syscall.Syscall(procCertFreeCertificateChain.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0) + syscall.SyscallN(procCertFreeCertificateChain.Addr(), uintptr(unsafe.Pointer(ctx))) return } func CertFreeCertificateContext(ctx *CertContext) (err error) { - r1, _, e1 := syscall.Syscall(procCertFreeCertificateContext.Addr(), 1, uintptr(unsafe.Pointer(ctx)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertFreeCertificateContext.Addr(), uintptr(unsafe.Pointer(ctx))) if r1 == 0 { err = errnoErr(e1) } @@ -1476,7 +1477,7 @@ func CertFreeCertificateContext(ctx *CertContext) (err error) { } func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error) { - r1, _, e1 := syscall.Syscall9(procCertGetCertificateChain.Addr(), 8, uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx)), 0) + r1, _, e1 := syscall.SyscallN(procCertGetCertificateChain.Addr(), uintptr(engine), uintptr(unsafe.Pointer(leaf)), uintptr(unsafe.Pointer(time)), uintptr(additionalStore), uintptr(unsafe.Pointer(para)), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(chainCtx))) if r1 == 0 { err = errnoErr(e1) } @@ -1484,13 +1485,13 @@ func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, a } func CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32) { - r0, _, _ := syscall.Syscall6(procCertGetNameStringW.Addr(), 6, uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size)) + r0, _, _ := syscall.SyscallN(procCertGetNameStringW.Addr(), uintptr(unsafe.Pointer(certContext)), uintptr(nameType), uintptr(flags), uintptr(typePara), uintptr(unsafe.Pointer(name)), uintptr(size)) chars = uint32(r0) return } func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptProv uintptr, flags uint32, para uintptr) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCertOpenStore.Addr(), 5, uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para), 0) + r0, _, e1 := syscall.SyscallN(procCertOpenStore.Addr(), uintptr(storeProvider), uintptr(msgAndCertEncodingType), uintptr(cryptProv), uintptr(flags), uintptr(para)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1499,7 +1500,7 @@ func CertOpenStore(storeProvider uintptr, msgAndCertEncodingType uint32, cryptPr } func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { - r0, _, e1 := syscall.Syscall(procCertOpenSystemStoreW.Addr(), 2, uintptr(hprov), uintptr(unsafe.Pointer(name)), 0) + r0, _, e1 := syscall.SyscallN(procCertOpenSystemStoreW.Addr(), uintptr(hprov), uintptr(unsafe.Pointer(name))) store = Handle(r0) if store == 0 { err = errnoErr(e1) @@ -1508,7 +1509,7 @@ func CertOpenSystemStore(hprov Handle, name *uint16) (store Handle, err error) { } func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error) { - r1, _, e1 := syscall.Syscall6(procCertVerifyCertificateChainPolicy.Addr(), 4, uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCertVerifyCertificateChainPolicy.Addr(), uintptr(policyOID), uintptr(unsafe.Pointer(chain)), uintptr(unsafe.Pointer(para)), uintptr(unsafe.Pointer(status))) if r1 == 0 { err = errnoErr(e1) } @@ -1520,7 +1521,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete if *callerFreeProvOrNCryptKey { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procCryptAcquireCertificatePrivateKey.Addr(), 6, uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0))) + r1, _, e1 := syscall.SyscallN(procCryptAcquireCertificatePrivateKey.Addr(), uintptr(unsafe.Pointer(cert)), uintptr(flags), uintptr(parameters), uintptr(unsafe.Pointer(cryptProvOrNCryptKey)), uintptr(unsafe.Pointer(keySpec)), uintptr(unsafe.Pointer(&_p0))) *callerFreeProvOrNCryptKey = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -1529,7 +1530,7 @@ func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, paramete } func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procCryptDecodeObject.Addr(), 7, uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCryptDecodeObject.Addr(), uintptr(encodingType), uintptr(unsafe.Pointer(structType)), uintptr(unsafe.Pointer(encodedBytes)), uintptr(lenEncodedBytes), uintptr(flags), uintptr(decoded), uintptr(unsafe.Pointer(decodedLen))) if r1 == 0 { err = errnoErr(e1) } @@ -1537,7 +1538,7 @@ func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte } func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { - r1, _, e1 := syscall.Syscall9(procCryptProtectData.Addr(), 7, uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCryptProtectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) if r1 == 0 { err = errnoErr(e1) } @@ -1545,7 +1546,7 @@ func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, } func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error) { - r1, _, e1 := syscall.Syscall12(procCryptQueryObject.Addr(), 11, uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context)), 0) + r1, _, e1 := syscall.SyscallN(procCryptQueryObject.Addr(), uintptr(objectType), uintptr(object), uintptr(expectedContentTypeFlags), uintptr(expectedFormatTypeFlags), uintptr(flags), uintptr(unsafe.Pointer(msgAndCertEncodingType)), uintptr(unsafe.Pointer(contentType)), uintptr(unsafe.Pointer(formatType)), uintptr(unsafe.Pointer(certStore)), uintptr(unsafe.Pointer(msg)), uintptr(unsafe.Pointer(context))) if r1 == 0 { err = errnoErr(e1) } @@ -1553,7 +1554,7 @@ func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentT } func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error) { - r1, _, e1 := syscall.Syscall9(procCryptUnprotectData.Addr(), 7, uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCryptUnprotectData.Addr(), uintptr(unsafe.Pointer(dataIn)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(optionalEntropy)), uintptr(reserved), uintptr(unsafe.Pointer(promptStruct)), uintptr(flags), uintptr(unsafe.Pointer(dataOut))) if r1 == 0 { err = errnoErr(e1) } @@ -1561,7 +1562,7 @@ func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBl } func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (store Handle, err error) { - r0, _, e1 := syscall.Syscall(procPFXImportCertStore.Addr(), 3, uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags)) + r0, _, e1 := syscall.SyscallN(procPFXImportCertStore.Addr(), uintptr(unsafe.Pointer(pfx)), uintptr(unsafe.Pointer(password)), uintptr(flags)) store = Handle(r0) if store == 0 { err = errnoErr(e1) @@ -1570,7 +1571,7 @@ func PFXImportCertStore(pfx *CryptDataBlob, password *uint16, flags uint32) (sto } func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool) { - r0, _, _ := syscall.Syscall(procDnsNameCompare_W.Addr(), 2, uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2)), 0) + r0, _, _ := syscall.SyscallN(procDnsNameCompare_W.Addr(), uintptr(unsafe.Pointer(name1)), uintptr(unsafe.Pointer(name2))) same = r0 != 0 return } @@ -1585,7 +1586,7 @@ func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSR } func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error) { - r0, _, _ := syscall.Syscall6(procDnsQuery_W.Addr(), 6, uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) + r0, _, _ := syscall.SyscallN(procDnsQuery_W.Addr(), uintptr(unsafe.Pointer(name)), uintptr(qtype), uintptr(options), uintptr(unsafe.Pointer(extra)), uintptr(unsafe.Pointer(qrs)), uintptr(unsafe.Pointer(pr))) if r0 != 0 { status = syscall.Errno(r0) } @@ -1593,12 +1594,12 @@ func _DnsQuery(name *uint16, qtype uint16, options uint32, extra *byte, qrs **DN } func DnsRecordListFree(rl *DNSRecord, freetype uint32) { - syscall.Syscall(procDnsRecordListFree.Addr(), 2, uintptr(unsafe.Pointer(rl)), uintptr(freetype), 0) + syscall.SyscallN(procDnsRecordListFree.Addr(), uintptr(unsafe.Pointer(rl)), uintptr(freetype)) return } func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { - r0, _, _ := syscall.Syscall6(procDwmGetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0) + r0, _, _ := syscall.SyscallN(procDwmGetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1606,7 +1607,7 @@ func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si } func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error) { - r0, _, _ := syscall.Syscall6(procDwmSetWindowAttribute.Addr(), 4, uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size), 0, 0) + r0, _, _ := syscall.SyscallN(procDwmSetWindowAttribute.Addr(), uintptr(hwnd), uintptr(attribute), uintptr(value), uintptr(size)) if r0 != 0 { ret = syscall.Errno(r0) } @@ -1614,7 +1615,7 @@ func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, si } func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { - r0, _, _ := syscall.Syscall(procCancelMibChangeNotify2.Addr(), 1, uintptr(notificationHandle), 0, 0) + r0, _, _ := syscall.SyscallN(procCancelMibChangeNotify2.Addr(), uintptr(notificationHandle)) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1622,7 +1623,7 @@ func CancelMibChangeNotify2(notificationHandle Handle) (errcode error) { } func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error) { - r0, _, _ := syscall.Syscall6(procGetAdaptersAddresses.Addr(), 5, uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer)), 0) + r0, _, _ := syscall.SyscallN(procGetAdaptersAddresses.Addr(), uintptr(family), uintptr(flags), uintptr(reserved), uintptr(unsafe.Pointer(adapterAddresses)), uintptr(unsafe.Pointer(sizePointer))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1630,7 +1631,7 @@ func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapter } func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { - r0, _, _ := syscall.Syscall(procGetAdaptersInfo.Addr(), 2, uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol)), 0) + r0, _, _ := syscall.SyscallN(procGetAdaptersInfo.Addr(), uintptr(unsafe.Pointer(ai)), uintptr(unsafe.Pointer(ol))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1638,7 +1639,7 @@ func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) { } func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcode error) { - r0, _, _ := syscall.Syscall(procGetBestInterfaceEx.Addr(), 2, uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex)), 0) + r0, _, _ := syscall.SyscallN(procGetBestInterfaceEx.Addr(), uintptr(sockaddr), uintptr(unsafe.Pointer(pdwBestIfIndex))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1646,7 +1647,7 @@ func getBestInterfaceEx(sockaddr unsafe.Pointer, pdwBestIfIndex *uint32) (errcod } func GetIfEntry(pIfRow *MibIfRow) (errcode error) { - r0, _, _ := syscall.Syscall(procGetIfEntry.Addr(), 1, uintptr(unsafe.Pointer(pIfRow)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetIfEntry.Addr(), uintptr(unsafe.Pointer(pIfRow))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1654,7 +1655,7 @@ func GetIfEntry(pIfRow *MibIfRow) (errcode error) { } func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { - r0, _, _ := syscall.Syscall(procGetIfEntry2Ex.Addr(), 2, uintptr(level), uintptr(unsafe.Pointer(row)), 0) + r0, _, _ := syscall.SyscallN(procGetIfEntry2Ex.Addr(), uintptr(level), uintptr(unsafe.Pointer(row))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1662,7 +1663,7 @@ func GetIfEntry2Ex(level uint32, row *MibIfRow2) (errcode error) { } func GetUnicastIpAddressEntry(row *MibUnicastIpAddressRow) (errcode error) { - r0, _, _ := syscall.Syscall(procGetUnicastIpAddressEntry.Addr(), 1, uintptr(unsafe.Pointer(row)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetUnicastIpAddressEntry.Addr(), uintptr(unsafe.Pointer(row))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1674,7 +1675,7 @@ func NotifyIpInterfaceChange(family uint16, callback uintptr, callerContext unsa if initialNotification { _p0 = 1 } - r0, _, _ := syscall.Syscall6(procNotifyIpInterfaceChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0) + r0, _, _ := syscall.SyscallN(procNotifyIpInterfaceChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1686,7 +1687,7 @@ func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext if initialNotification { _p0 = 1 } - r0, _, _ := syscall.Syscall6(procNotifyUnicastIpAddressChange.Addr(), 5, uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle)), 0) + r0, _, _ := syscall.SyscallN(procNotifyUnicastIpAddressChange.Addr(), uintptr(family), uintptr(callback), uintptr(callerContext), uintptr(_p0), uintptr(unsafe.Pointer(notificationHandle))) if r0 != 0 { errcode = syscall.Errno(r0) } @@ -1694,7 +1695,7 @@ func NotifyUnicastIpAddressChange(family uint16, callback uintptr, callerContext } func AddDllDirectory(path *uint16) (cookie uintptr, err error) { - r0, _, e1 := syscall.Syscall(procAddDllDirectory.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r0, _, e1 := syscall.SyscallN(procAddDllDirectory.Addr(), uintptr(unsafe.Pointer(path))) cookie = uintptr(r0) if cookie == 0 { err = errnoErr(e1) @@ -1703,7 +1704,7 @@ func AddDllDirectory(path *uint16) (cookie uintptr, err error) { } func AssignProcessToJobObject(job Handle, process Handle) (err error) { - r1, _, e1 := syscall.Syscall(procAssignProcessToJobObject.Addr(), 2, uintptr(job), uintptr(process), 0) + r1, _, e1 := syscall.SyscallN(procAssignProcessToJobObject.Addr(), uintptr(job), uintptr(process)) if r1 == 0 { err = errnoErr(e1) } @@ -1711,7 +1712,7 @@ func AssignProcessToJobObject(job Handle, process Handle) (err error) { } func CancelIo(s Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIo.Addr(), 1, uintptr(s), 0, 0) + r1, _, e1 := syscall.SyscallN(procCancelIo.Addr(), uintptr(s)) if r1 == 0 { err = errnoErr(e1) } @@ -1719,7 +1720,7 @@ func CancelIo(s Handle) (err error) { } func CancelIoEx(s Handle, o *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procCancelIoEx.Addr(), 2, uintptr(s), uintptr(unsafe.Pointer(o)), 0) + r1, _, e1 := syscall.SyscallN(procCancelIoEx.Addr(), uintptr(s), uintptr(unsafe.Pointer(o))) if r1 == 0 { err = errnoErr(e1) } @@ -1727,7 +1728,7 @@ func CancelIoEx(s Handle, o *Overlapped) (err error) { } func ClearCommBreak(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procClearCommBreak.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procClearCommBreak.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -1735,7 +1736,7 @@ func ClearCommBreak(handle Handle) (err error) { } func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error) { - r1, _, e1 := syscall.Syscall(procClearCommError.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) + r1, _, e1 := syscall.SyscallN(procClearCommError.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpErrors)), uintptr(unsafe.Pointer(lpStat))) if r1 == 0 { err = errnoErr(e1) } @@ -1743,7 +1744,7 @@ func ClearCommError(handle Handle, lpErrors *uint32, lpStat *ComStat) (err error } func CloseHandle(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procCloseHandle.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procCloseHandle.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -1751,12 +1752,12 @@ func CloseHandle(handle Handle) (err error) { } func ClosePseudoConsole(console Handle) { - syscall.Syscall(procClosePseudoConsole.Addr(), 1, uintptr(console), 0, 0) + syscall.SyscallN(procClosePseudoConsole.Addr(), uintptr(console)) return } func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procConnectNamedPipe.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procConnectNamedPipe.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -1764,7 +1765,7 @@ func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error) { } func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { - r1, _, e1 := syscall.Syscall(procCreateDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa)), 0) + r1, _, e1 := syscall.SyscallN(procCreateDirectoryW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(sa))) if r1 == 0 { err = errnoErr(e1) } @@ -1772,7 +1773,7 @@ func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error) { } func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateEventExW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateEventExW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1781,7 +1782,7 @@ func CreateEventEx(eventAttrs *SecurityAttributes, name *uint16, flags uint32, d } func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateEventW.Addr(), 4, uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateEventW.Addr(), uintptr(unsafe.Pointer(eventAttrs)), uintptr(manualReset), uintptr(initialState), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1790,7 +1791,7 @@ func CreateEvent(eventAttrs *SecurityAttributes, manualReset uint32, initialStat } func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxSizeHigh uint32, maxSizeLow uint32, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateFileMappingW.Addr(), 6, uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procCreateFileMappingW.Addr(), uintptr(fhandle), uintptr(unsafe.Pointer(sa)), uintptr(prot), uintptr(maxSizeHigh), uintptr(maxSizeLow), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1799,7 +1800,7 @@ func CreateFileMapping(fhandle Handle, sa *SecurityAttributes, prot uint32, maxS } func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes, createmode uint32, attrs uint32, templatefile Handle) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateFileW.Addr(), 7, uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(access), uintptr(mode), uintptr(unsafe.Pointer(sa)), uintptr(createmode), uintptr(attrs), uintptr(templatefile)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -1808,7 +1809,7 @@ func CreateFile(name *uint16, access uint32, mode uint32, sa *SecurityAttributes } func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procCreateHardLinkW.Addr(), 3, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procCreateHardLinkW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(existingfilename)), uintptr(reserved)) if r1&0xff == 0 { err = errnoErr(e1) } @@ -1816,7 +1817,7 @@ func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr } func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, threadcnt uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateIoCompletionPort.Addr(), 4, uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateIoCompletionPort.Addr(), uintptr(filehandle), uintptr(cphandle), uintptr(key), uintptr(threadcnt)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1825,7 +1826,7 @@ func CreateIoCompletionPort(filehandle Handle, cphandle Handle, key uintptr, thr } func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procCreateJobObjectW.Addr(), 2, uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name)), 0) + r0, _, e1 := syscall.SyscallN(procCreateJobObjectW.Addr(), uintptr(unsafe.Pointer(jobAttr)), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -1834,7 +1835,7 @@ func CreateJobObject(jobAttr *SecurityAttributes, name *uint16) (handle Handle, } func CreateMutexEx(mutexAttrs *SecurityAttributes, name *uint16, flags uint32, desiredAccess uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procCreateMutexExW.Addr(), 4, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess), 0, 0) + r0, _, e1 := syscall.SyscallN(procCreateMutexExW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(desiredAccess)) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1847,7 +1848,7 @@ func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16 if initialOwner { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procCreateMutexW.Addr(), 3, uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procCreateMutexW.Addr(), uintptr(unsafe.Pointer(mutexAttrs)), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 || e1 == ERROR_ALREADY_EXISTS { err = errnoErr(e1) @@ -1856,7 +1857,7 @@ func CreateMutex(mutexAttrs *SecurityAttributes, initialOwner bool, name *uint16 } func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances uint32, outSize uint32, inSize uint32, defaultTimeout uint32, sa *SecurityAttributes) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall9(procCreateNamedPipeW.Addr(), 8, uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa)), 0) + r0, _, e1 := syscall.SyscallN(procCreateNamedPipeW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags), uintptr(pipeMode), uintptr(maxInstances), uintptr(outSize), uintptr(inSize), uintptr(defaultTimeout), uintptr(unsafe.Pointer(sa))) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -1865,7 +1866,7 @@ func CreateNamedPipe(name *uint16, flags uint32, pipeMode uint32, maxInstances u } func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procCreatePipe.Addr(), 4, uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size), 0, 0) + r1, _, e1 := syscall.SyscallN(procCreatePipe.Addr(), uintptr(unsafe.Pointer(readhandle)), uintptr(unsafe.Pointer(writehandle)), uintptr(unsafe.Pointer(sa)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } @@ -1877,7 +1878,7 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA if inheritHandles { _p0 = 1 } - r1, _, e1 := syscall.Syscall12(procCreateProcessW.Addr(), 10, uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo)), 0, 0) + r1, _, e1 := syscall.SyscallN(procCreateProcessW.Addr(), uintptr(unsafe.Pointer(appName)), uintptr(unsafe.Pointer(commandLine)), uintptr(unsafe.Pointer(procSecurity)), uintptr(unsafe.Pointer(threadSecurity)), uintptr(_p0), uintptr(creationFlags), uintptr(unsafe.Pointer(env)), uintptr(unsafe.Pointer(currentDir)), uintptr(unsafe.Pointer(startupInfo)), uintptr(unsafe.Pointer(outProcInfo))) if r1 == 0 { err = errnoErr(e1) } @@ -1885,7 +1886,7 @@ func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityA } func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pconsole *Handle) (hr error) { - r0, _, _ := syscall.Syscall6(procCreatePseudoConsole.Addr(), 5, uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole)), 0) + r0, _, _ := syscall.SyscallN(procCreatePseudoConsole.Addr(), uintptr(size), uintptr(in), uintptr(out), uintptr(flags), uintptr(unsafe.Pointer(pconsole))) if r0 != 0 { hr = syscall.Errno(r0) } @@ -1893,7 +1894,7 @@ func createPseudoConsole(size uint32, in Handle, out Handle, flags uint32, pcons } func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procCreateSymbolicLinkW.Addr(), 3, uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags)) + r1, _, e1 := syscall.SyscallN(procCreateSymbolicLinkW.Addr(), uintptr(unsafe.Pointer(symlinkfilename)), uintptr(unsafe.Pointer(targetfilename)), uintptr(flags)) if r1&0xff == 0 { err = errnoErr(e1) } @@ -1901,7 +1902,7 @@ func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags u } func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procCreateToolhelp32Snapshot.Addr(), 2, uintptr(flags), uintptr(processId), 0) + r0, _, e1 := syscall.SyscallN(procCreateToolhelp32Snapshot.Addr(), uintptr(flags), uintptr(processId)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -1910,7 +1911,7 @@ func CreateToolhelp32Snapshot(flags uint32, processId uint32) (handle Handle, er } func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDefineDosDeviceW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) + r1, _, e1 := syscall.SyscallN(procDefineDosDeviceW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath))) if r1 == 0 { err = errnoErr(e1) } @@ -1918,7 +1919,7 @@ func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err } func DeleteFile(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteFileW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeleteFileW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -1926,12 +1927,12 @@ func DeleteFile(path *uint16) (err error) { } func deleteProcThreadAttributeList(attrlist *ProcThreadAttributeList) { - syscall.Syscall(procDeleteProcThreadAttributeList.Addr(), 1, uintptr(unsafe.Pointer(attrlist)), 0, 0) + syscall.SyscallN(procDeleteProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist))) return } func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDeleteVolumeMountPointW.Addr(), 1, uintptr(unsafe.Pointer(volumeMountPoint)), 0, 0) + r1, _, e1 := syscall.SyscallN(procDeleteVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint))) if r1 == 0 { err = errnoErr(e1) } @@ -1939,7 +1940,7 @@ func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error) { } func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(procDeviceIoControl.Addr(), 8, uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procDeviceIoControl.Addr(), uintptr(handle), uintptr(ioControlCode), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferSize), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferSize), uintptr(unsafe.Pointer(bytesReturned)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -1947,7 +1948,7 @@ func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBuff } func DisconnectNamedPipe(pipe Handle) (err error) { - r1, _, e1 := syscall.Syscall(procDisconnectNamedPipe.Addr(), 1, uintptr(pipe), 0, 0) + r1, _, e1 := syscall.SyscallN(procDisconnectNamedPipe.Addr(), uintptr(pipe)) if r1 == 0 { err = errnoErr(e1) } @@ -1959,7 +1960,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP if bInheritHandle { _p0 = 1 } - r1, _, e1 := syscall.Syscall9(procDuplicateHandle.Addr(), 7, uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions), 0, 0) + r1, _, e1 := syscall.SyscallN(procDuplicateHandle.Addr(), uintptr(hSourceProcessHandle), uintptr(hSourceHandle), uintptr(hTargetProcessHandle), uintptr(unsafe.Pointer(lpTargetHandle)), uintptr(dwDesiredAccess), uintptr(_p0), uintptr(dwOptions)) if r1 == 0 { err = errnoErr(e1) } @@ -1967,7 +1968,7 @@ func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetP } func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { - r1, _, e1 := syscall.Syscall(procEscapeCommFunction.Addr(), 2, uintptr(handle), uintptr(dwFunc), 0) + r1, _, e1 := syscall.SyscallN(procEscapeCommFunction.Addr(), uintptr(handle), uintptr(dwFunc)) if r1 == 0 { err = errnoErr(e1) } @@ -1975,12 +1976,12 @@ func EscapeCommFunction(handle Handle, dwFunc uint32) (err error) { } func ExitProcess(exitcode uint32) { - syscall.Syscall(procExitProcess.Addr(), 1, uintptr(exitcode), 0, 0) + syscall.SyscallN(procExitProcess.Addr(), uintptr(exitcode)) return } func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procExpandEnvironmentStringsW.Addr(), 3, uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size)) + r0, _, e1 := syscall.SyscallN(procExpandEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(src)), uintptr(unsafe.Pointer(dst)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -1989,7 +1990,7 @@ func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, } func FindClose(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindClose.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindClose.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -1997,7 +1998,7 @@ func FindClose(handle Handle) (err error) { } func FindCloseChangeNotification(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindCloseChangeNotification.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindCloseChangeNotification.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2018,7 +2019,7 @@ func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter if watchSubtree { _p1 = 1 } - r0, _, e1 := syscall.Syscall(procFindFirstChangeNotificationW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter)) + r0, _, e1 := syscall.SyscallN(procFindFirstChangeNotificationW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(_p1), uintptr(notifyFilter)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2027,7 +2028,7 @@ func _FindFirstChangeNotification(path *uint16, watchSubtree bool, notifyFilter } func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindFirstFileW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data)), 0) + r0, _, e1 := syscall.SyscallN(procFindFirstFileW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(data))) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2036,7 +2037,7 @@ func findFirstFile1(name *uint16, data *win32finddata1) (handle Handle, err erro } func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, bufferLength uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindFirstVolumeMountPointW.Addr(), 3, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) + r0, _, e1 := syscall.SyscallN(procFindFirstVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2045,7 +2046,7 @@ func FindFirstVolumeMountPoint(rootPathName *uint16, volumeMountPoint *uint16, b } func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindFirstVolumeW.Addr(), 2, uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength), 0) + r0, _, e1 := syscall.SyscallN(procFindFirstVolumeW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2054,7 +2055,7 @@ func FindFirstVolume(volumeName *uint16, bufferLength uint32) (handle Handle, er } func FindNextChangeNotification(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextChangeNotification.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindNextChangeNotification.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2062,7 +2063,7 @@ func FindNextChangeNotification(handle Handle) (err error) { } func findNextFile1(handle Handle, data *win32finddata1) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextFileW.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0) + r1, _, e1 := syscall.SyscallN(procFindNextFileW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) if r1 == 0 { err = errnoErr(e1) } @@ -2070,7 +2071,7 @@ func findNextFile1(handle Handle, data *win32finddata1) (err error) { } func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextVolumeMountPointW.Addr(), 3, uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) + r1, _, e1 := syscall.SyscallN(procFindNextVolumeMountPointW.Addr(), uintptr(findVolumeMountPoint), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } @@ -2078,7 +2079,7 @@ func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uin } func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procFindNextVolumeW.Addr(), 3, uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) + r1, _, e1 := syscall.SyscallN(procFindNextVolumeW.Addr(), uintptr(findVolume), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } @@ -2086,7 +2087,7 @@ func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) } func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, err error) { - r0, _, e1 := syscall.Syscall(procFindResourceW.Addr(), 3, uintptr(module), uintptr(name), uintptr(resType)) + r0, _, e1 := syscall.SyscallN(procFindResourceW.Addr(), uintptr(module), uintptr(name), uintptr(resType)) resInfo = Handle(r0) if resInfo == 0 { err = errnoErr(e1) @@ -2095,7 +2096,7 @@ func findResource(module Handle, name uintptr, resType uintptr) (resInfo Handle, } func FindVolumeClose(findVolume Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindVolumeClose.Addr(), 1, uintptr(findVolume), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindVolumeClose.Addr(), uintptr(findVolume)) if r1 == 0 { err = errnoErr(e1) } @@ -2103,7 +2104,7 @@ func FindVolumeClose(findVolume Handle) (err error) { } func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFindVolumeMountPointClose.Addr(), 1, uintptr(findVolumeMountPoint), 0, 0) + r1, _, e1 := syscall.SyscallN(procFindVolumeMountPointClose.Addr(), uintptr(findVolumeMountPoint)) if r1 == 0 { err = errnoErr(e1) } @@ -2111,7 +2112,7 @@ func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error) { } func FlushFileBuffers(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFlushFileBuffers.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFlushFileBuffers.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2119,7 +2120,7 @@ func FlushFileBuffers(handle Handle) (err error) { } func FlushViewOfFile(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procFlushViewOfFile.Addr(), 2, uintptr(addr), uintptr(length), 0) + r1, _, e1 := syscall.SyscallN(procFlushViewOfFile.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -2131,7 +2132,7 @@ func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, bu if len(buf) > 0 { _p0 = &buf[0] } - r0, _, e1 := syscall.Syscall9(procFormatMessageW.Addr(), 7, uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args)), 0, 0) + r0, _, e1 := syscall.SyscallN(procFormatMessageW.Addr(), uintptr(flags), uintptr(msgsrc), uintptr(msgid), uintptr(langid), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(args))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2140,7 +2141,7 @@ func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, bu } func FreeEnvironmentStrings(envs *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procFreeEnvironmentStringsW.Addr(), 1, uintptr(unsafe.Pointer(envs)), 0, 0) + r1, _, e1 := syscall.SyscallN(procFreeEnvironmentStringsW.Addr(), uintptr(unsafe.Pointer(envs))) if r1 == 0 { err = errnoErr(e1) } @@ -2148,7 +2149,7 @@ func FreeEnvironmentStrings(envs *uint16) (err error) { } func FreeLibrary(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procFreeLibrary.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procFreeLibrary.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -2156,7 +2157,7 @@ func FreeLibrary(handle Handle) (err error) { } func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGenerateConsoleCtrlEvent.Addr(), 2, uintptr(ctrlEvent), uintptr(processGroupID), 0) + r1, _, e1 := syscall.SyscallN(procGenerateConsoleCtrlEvent.Addr(), uintptr(ctrlEvent), uintptr(processGroupID)) if r1 == 0 { err = errnoErr(e1) } @@ -2164,19 +2165,19 @@ func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err erro } func GetACP() (acp uint32) { - r0, _, _ := syscall.Syscall(procGetACP.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetACP.Addr()) acp = uint32(r0) return } func GetActiveProcessorCount(groupNumber uint16) (ret uint32) { - r0, _, _ := syscall.Syscall(procGetActiveProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0) + r0, _, _ := syscall.SyscallN(procGetActiveProcessorCount.Addr(), uintptr(groupNumber)) ret = uint32(r0) return } func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetCommModemStatus.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpModemStat)), 0) + r1, _, e1 := syscall.SyscallN(procGetCommModemStatus.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpModemStat))) if r1 == 0 { err = errnoErr(e1) } @@ -2184,7 +2185,7 @@ func GetCommModemStatus(handle Handle, lpModemStat *uint32) (err error) { } func GetCommState(handle Handle, lpDCB *DCB) (err error) { - r1, _, e1 := syscall.Syscall(procGetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) + r1, _, e1 := syscall.SyscallN(procGetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) if r1 == 0 { err = errnoErr(e1) } @@ -2192,7 +2193,7 @@ func GetCommState(handle Handle, lpDCB *DCB) (err error) { } func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { - r1, _, e1 := syscall.Syscall(procGetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) + r1, _, e1 := syscall.SyscallN(procGetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) if r1 == 0 { err = errnoErr(e1) } @@ -2200,13 +2201,13 @@ func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { } func GetCommandLine() (cmd *uint16) { - r0, _, _ := syscall.Syscall(procGetCommandLineW.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetCommandLineW.Addr()) cmd = (*uint16)(unsafe.Pointer(r0)) return } func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetComputerNameExW.Addr(), 3, uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) + r1, _, e1 := syscall.SyscallN(procGetComputerNameExW.Addr(), uintptr(nametype), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) if r1 == 0 { err = errnoErr(e1) } @@ -2214,7 +2215,7 @@ func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error) { } func GetComputerName(buf *uint16, n *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetComputerNameW.Addr(), 2, uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n)), 0) + r1, _, e1 := syscall.SyscallN(procGetComputerNameW.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(n))) if r1 == 0 { err = errnoErr(e1) } @@ -2222,7 +2223,7 @@ func GetComputerName(buf *uint16, n *uint32) (err error) { } func GetConsoleCP() (cp uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetConsoleCP.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetConsoleCP.Addr()) cp = uint32(r0) if cp == 0 { err = errnoErr(e1) @@ -2231,7 +2232,7 @@ func GetConsoleCP() (cp uint32, err error) { } func GetConsoleMode(console Handle, mode *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetConsoleMode.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(mode)), 0) + r1, _, e1 := syscall.SyscallN(procGetConsoleMode.Addr(), uintptr(console), uintptr(unsafe.Pointer(mode))) if r1 == 0 { err = errnoErr(e1) } @@ -2239,7 +2240,7 @@ func GetConsoleMode(console Handle, mode *uint32) (err error) { } func GetConsoleOutputCP() (cp uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetConsoleOutputCP.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetConsoleOutputCP.Addr()) cp = uint32(r0) if cp == 0 { err = errnoErr(e1) @@ -2248,7 +2249,7 @@ func GetConsoleOutputCP() (cp uint32, err error) { } func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error) { - r1, _, e1 := syscall.Syscall(procGetConsoleScreenBufferInfo.Addr(), 2, uintptr(console), uintptr(unsafe.Pointer(info)), 0) + r1, _, e1 := syscall.SyscallN(procGetConsoleScreenBufferInfo.Addr(), uintptr(console), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -2256,7 +2257,7 @@ func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) ( } func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetCurrentDirectoryW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) + r0, _, e1 := syscall.SyscallN(procGetCurrentDirectoryW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2265,19 +2266,19 @@ func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error) { } func GetCurrentProcessId() (pid uint32) { - r0, _, _ := syscall.Syscall(procGetCurrentProcessId.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetCurrentProcessId.Addr()) pid = uint32(r0) return } func GetCurrentThreadId() (id uint32) { - r0, _, _ := syscall.Syscall(procGetCurrentThreadId.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetCurrentThreadId.Addr()) id = uint32(r0) return } func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error) { - r1, _, e1 := syscall.Syscall6(procGetDiskFreeSpaceExW.Addr(), 4, uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetDiskFreeSpaceExW.Addr(), uintptr(unsafe.Pointer(directoryName)), uintptr(unsafe.Pointer(freeBytesAvailableToCaller)), uintptr(unsafe.Pointer(totalNumberOfBytes)), uintptr(unsafe.Pointer(totalNumberOfFreeBytes))) if r1 == 0 { err = errnoErr(e1) } @@ -2285,13 +2286,13 @@ func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint6 } func GetDriveType(rootPathName *uint16) (driveType uint32) { - r0, _, _ := syscall.Syscall(procGetDriveTypeW.Addr(), 1, uintptr(unsafe.Pointer(rootPathName)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetDriveTypeW.Addr(), uintptr(unsafe.Pointer(rootPathName))) driveType = uint32(r0) return } func GetEnvironmentStrings() (envs *uint16, err error) { - r0, _, e1 := syscall.Syscall(procGetEnvironmentStringsW.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetEnvironmentStringsW.Addr()) envs = (*uint16)(unsafe.Pointer(r0)) if envs == nil { err = errnoErr(e1) @@ -2300,7 +2301,7 @@ func GetEnvironmentStrings() (envs *uint16, err error) { } func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetEnvironmentVariableW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size)) + r0, _, e1 := syscall.SyscallN(procGetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(buffer)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2309,7 +2310,7 @@ func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32 } func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetExitCodeProcess.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(exitcode)), 0) + r1, _, e1 := syscall.SyscallN(procGetExitCodeProcess.Addr(), uintptr(handle), uintptr(unsafe.Pointer(exitcode))) if r1 == 0 { err = errnoErr(e1) } @@ -2317,7 +2318,7 @@ func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error) { } func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { - r1, _, e1 := syscall.Syscall(procGetFileAttributesExW.Addr(), 3, uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) + r1, _, e1 := syscall.SyscallN(procGetFileAttributesExW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(level), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -2325,7 +2326,7 @@ func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error) { } func GetFileAttributes(name *uint16) (attrs uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileAttributesW.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name))) attrs = uint32(r0) if attrs == INVALID_FILE_ATTRIBUTES { err = errnoErr(e1) @@ -2334,7 +2335,7 @@ func GetFileAttributes(name *uint16) (attrs uint32, err error) { } func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error) { - r1, _, e1 := syscall.Syscall(procGetFileInformationByHandle.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(data)), 0) + r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandle.Addr(), uintptr(handle), uintptr(unsafe.Pointer(data))) if r1 == 0 { err = errnoErr(e1) } @@ -2342,7 +2343,7 @@ func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (e } func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetFileInformationByHandleEx.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetFileInformationByHandleEx.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(outBuffer)), uintptr(outBufferLen)) if r1 == 0 { err = errnoErr(e1) } @@ -2350,7 +2351,7 @@ func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, } func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procGetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) if r1 == 0 { err = errnoErr(e1) } @@ -2358,7 +2359,7 @@ func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim } func GetFileType(filehandle Handle) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFileType.Addr(), uintptr(filehandle)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2367,7 +2368,7 @@ func GetFileType(filehandle Handle) (n uint32, err error) { } func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall6(procGetFinalPathNameByHandleW.Addr(), 4, uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFinalPathNameByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(filePath)), uintptr(filePathSize), uintptr(flags)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2376,7 +2377,7 @@ func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32 } func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall6(procGetFullPathNameW.Addr(), 4, uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname)), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetFullPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(buflen), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(fname))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2385,13 +2386,13 @@ func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) ( } func GetLargePageMinimum() (size uintptr) { - r0, _, _ := syscall.Syscall(procGetLargePageMinimum.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetLargePageMinimum.Addr()) size = uintptr(r0) return } func GetLastError() (lasterr error) { - r0, _, _ := syscall.Syscall(procGetLastError.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetLastError.Addr()) if r0 != 0 { lasterr = syscall.Errno(r0) } @@ -2399,7 +2400,7 @@ func GetLastError() (lasterr error) { } func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetLogicalDriveStringsW.Addr(), 2, uintptr(bufferLength), uintptr(unsafe.Pointer(buffer)), 0) + r0, _, e1 := syscall.SyscallN(procGetLogicalDriveStringsW.Addr(), uintptr(bufferLength), uintptr(unsafe.Pointer(buffer))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2408,7 +2409,7 @@ func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err } func GetLogicalDrives() (drivesBitMask uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetLogicalDrives.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetLogicalDrives.Addr()) drivesBitMask = uint32(r0) if drivesBitMask == 0 { err = errnoErr(e1) @@ -2417,7 +2418,7 @@ func GetLogicalDrives() (drivesBitMask uint32, err error) { } func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetLongPathNameW.Addr(), 3, uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen)) + r0, _, e1 := syscall.SyscallN(procGetLongPathNameW.Addr(), uintptr(unsafe.Pointer(path)), uintptr(unsafe.Pointer(buf)), uintptr(buflen)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2426,13 +2427,13 @@ func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err er } func GetMaximumProcessorCount(groupNumber uint16) (ret uint32) { - r0, _, _ := syscall.Syscall(procGetMaximumProcessorCount.Addr(), 1, uintptr(groupNumber), 0, 0) + r0, _, _ := syscall.SyscallN(procGetMaximumProcessorCount.Addr(), uintptr(groupNumber)) ret = uint32(r0) return } func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetModuleFileNameW.Addr(), 3, uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) + r0, _, e1 := syscall.SyscallN(procGetModuleFileNameW.Addr(), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2441,7 +2442,7 @@ func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, } func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) { - r1, _, e1 := syscall.Syscall(procGetModuleHandleExW.Addr(), 3, uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module))) + r1, _, e1 := syscall.SyscallN(procGetModuleHandleExW.Addr(), uintptr(flags), uintptr(unsafe.Pointer(moduleName)), uintptr(unsafe.Pointer(module))) if r1 == 0 { err = errnoErr(e1) } @@ -2449,7 +2450,7 @@ func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err er } func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetNamedPipeClientProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID)), 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeClientProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(clientProcessID))) if r1 == 0 { err = errnoErr(e1) } @@ -2457,7 +2458,7 @@ func GetNamedPipeClientProcessId(pipe Handle, clientProcessID *uint32) (err erro } func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetNamedPipeHandleStateW.Addr(), 7, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeHandleStateW.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(curInstances)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), uintptr(unsafe.Pointer(userName)), uintptr(maxUserNameSize)) if r1 == 0 { err = errnoErr(e1) } @@ -2465,7 +2466,7 @@ func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, m } func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetNamedPipeInfo.Addr(), 5, uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances)), 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeInfo.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(outSize)), uintptr(unsafe.Pointer(inSize)), uintptr(unsafe.Pointer(maxInstances))) if r1 == 0 { err = errnoErr(e1) } @@ -2473,7 +2474,7 @@ func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint3 } func GetNamedPipeServerProcessId(pipe Handle, serverProcessID *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetNamedPipeServerProcessId.Addr(), 2, uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID)), 0) + r1, _, e1 := syscall.SyscallN(procGetNamedPipeServerProcessId.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(serverProcessID))) if r1 == 0 { err = errnoErr(e1) } @@ -2485,7 +2486,7 @@ func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wa if wait { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procGetOverlappedResult.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetOverlappedResult.Addr(), uintptr(handle), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(done)), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -2493,7 +2494,7 @@ func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wa } func GetPriorityClass(process Handle) (ret uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetPriorityClass.Addr(), 1, uintptr(process), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetPriorityClass.Addr(), uintptr(process)) ret = uint32(r0) if ret == 0 { err = errnoErr(e1) @@ -2511,7 +2512,7 @@ func GetProcAddress(module Handle, procname string) (proc uintptr, err error) { } func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) { - r0, _, e1 := syscall.Syscall(procGetProcAddress.Addr(), 2, uintptr(module), uintptr(unsafe.Pointer(procname)), 0) + r0, _, e1 := syscall.SyscallN(procGetProcAddress.Addr(), uintptr(module), uintptr(unsafe.Pointer(procname))) proc = uintptr(r0) if proc == 0 { err = errnoErr(e1) @@ -2520,7 +2521,7 @@ func _GetProcAddress(module Handle, procname *byte) (proc uintptr, err error) { } func GetProcessId(process Handle) (id uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetProcessId.Addr(), 1, uintptr(process), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetProcessId.Addr(), uintptr(process)) id = uint32(r0) if id == 0 { err = errnoErr(e1) @@ -2529,7 +2530,7 @@ func GetProcessId(process Handle) (id uint32, err error) { } func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetProcessPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetProcessPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2537,7 +2538,7 @@ func getProcessPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uin } func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetProcessShutdownParameters.Addr(), 2, uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags)), 0) + r1, _, e1 := syscall.SyscallN(procGetProcessShutdownParameters.Addr(), uintptr(unsafe.Pointer(level)), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } @@ -2545,7 +2546,7 @@ func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error) { } func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procGetProcessTimes.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime)), 0) + r1, _, e1 := syscall.SyscallN(procGetProcessTimes.Addr(), uintptr(handle), uintptr(unsafe.Pointer(creationTime)), uintptr(unsafe.Pointer(exitTime)), uintptr(unsafe.Pointer(kernelTime)), uintptr(unsafe.Pointer(userTime))) if r1 == 0 { err = errnoErr(e1) } @@ -2553,12 +2554,12 @@ func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, } func GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32) { - syscall.Syscall6(procGetProcessWorkingSetSizeEx.Addr(), 4, uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags)), 0, 0) + syscall.SyscallN(procGetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(unsafe.Pointer(lpMinimumWorkingSetSize)), uintptr(unsafe.Pointer(lpMaximumWorkingSetSize)), uintptr(unsafe.Pointer(flags))) return } func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetQueuedCompletionStatus.Addr(), 5, uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout), 0) + r1, _, e1 := syscall.SyscallN(procGetQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(unsafe.Pointer(qty)), uintptr(unsafe.Pointer(key)), uintptr(unsafe.Pointer(overlapped)), uintptr(timeout)) if r1 == 0 { err = errnoErr(e1) } @@ -2566,7 +2567,7 @@ func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overl } func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetShortPathNameW.Addr(), 3, uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen)) + r0, _, e1 := syscall.SyscallN(procGetShortPathNameW.Addr(), uintptr(unsafe.Pointer(longpath)), uintptr(unsafe.Pointer(shortpath)), uintptr(buflen)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2575,12 +2576,12 @@ func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uin } func getStartupInfo(startupInfo *StartupInfo) { - syscall.Syscall(procGetStartupInfoW.Addr(), 1, uintptr(unsafe.Pointer(startupInfo)), 0, 0) + syscall.SyscallN(procGetStartupInfoW.Addr(), uintptr(unsafe.Pointer(startupInfo))) return } func GetStdHandle(stdhandle uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procGetStdHandle.Addr(), 1, uintptr(stdhandle), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetStdHandle.Addr(), uintptr(stdhandle)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -2589,7 +2590,7 @@ func GetStdHandle(stdhandle uint32) (handle Handle, err error) { } func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetSystemDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0) + r0, _, e1 := syscall.SyscallN(procGetSystemDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) @@ -2598,7 +2599,7 @@ func getSystemDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { } func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetSystemPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetSystemPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2606,17 +2607,17 @@ func getSystemPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint } func GetSystemTimeAsFileTime(time *Filetime) { - syscall.Syscall(procGetSystemTimeAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0) + syscall.SyscallN(procGetSystemTimeAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) return } func GetSystemTimePreciseAsFileTime(time *Filetime) { - syscall.Syscall(procGetSystemTimePreciseAsFileTime.Addr(), 1, uintptr(unsafe.Pointer(time)), 0, 0) + syscall.SyscallN(procGetSystemTimePreciseAsFileTime.Addr(), uintptr(unsafe.Pointer(time))) return } func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetSystemWindowsDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0) + r0, _, e1 := syscall.SyscallN(procGetSystemWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) @@ -2625,7 +2626,7 @@ func getSystemWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err erro } func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetTempPathW.Addr(), 2, uintptr(buflen), uintptr(unsafe.Pointer(buf)), 0) + r0, _, e1 := syscall.SyscallN(procGetTempPathW.Addr(), uintptr(buflen), uintptr(unsafe.Pointer(buf))) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2634,7 +2635,7 @@ func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error) { } func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetThreadPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetThreadPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2642,13 +2643,13 @@ func getThreadPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint } func getTickCount64() (ms uint64) { - r0, _, _ := syscall.Syscall(procGetTickCount64.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetTickCount64.Addr()) ms = uint64(r0) return } func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetTimeZoneInformation.Addr(), 1, uintptr(unsafe.Pointer(tzi)), 0, 0) + r0, _, e1 := syscall.SyscallN(procGetTimeZoneInformation.Addr(), uintptr(unsafe.Pointer(tzi))) rc = uint32(r0) if rc == 0xffffffff { err = errnoErr(e1) @@ -2657,7 +2658,7 @@ func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error) { } func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetUserPreferredUILanguages.Addr(), 4, uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetUserPreferredUILanguages.Addr(), uintptr(flags), uintptr(unsafe.Pointer(numLanguages)), uintptr(unsafe.Pointer(buf)), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -2665,7 +2666,7 @@ func getUserPreferredUILanguages(flags uint32, numLanguages *uint32, buf *uint16 } func GetVersion() (ver uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetVersion.Addr(), 0, 0, 0, 0) + r0, _, e1 := syscall.SyscallN(procGetVersion.Addr()) ver = uint32(r0) if ver == 0 { err = errnoErr(e1) @@ -2674,7 +2675,7 @@ func GetVersion() (ver uint32, err error) { } func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetVolumeInformationByHandleW.Addr(), 8, uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize), 0) + r1, _, e1 := syscall.SyscallN(procGetVolumeInformationByHandleW.Addr(), uintptr(file), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) if r1 == 0 { err = errnoErr(e1) } @@ -2682,7 +2683,7 @@ func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeN } func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procGetVolumeInformationW.Addr(), 8, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize), 0) + r1, _, e1 := syscall.SyscallN(procGetVolumeInformationW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeNameBuffer)), uintptr(volumeNameSize), uintptr(unsafe.Pointer(volumeNameSerialNumber)), uintptr(unsafe.Pointer(maximumComponentLength)), uintptr(unsafe.Pointer(fileSystemFlags)), uintptr(unsafe.Pointer(fileSystemNameBuffer)), uintptr(fileSystemNameSize)) if r1 == 0 { err = errnoErr(e1) } @@ -2690,7 +2691,7 @@ func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volume } func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetVolumeNameForVolumeMountPointW.Addr(), 3, uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) + r1, _, e1 := syscall.SyscallN(procGetVolumeNameForVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), uintptr(bufferlength)) if r1 == 0 { err = errnoErr(e1) } @@ -2698,7 +2699,7 @@ func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint } func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetVolumePathNameW.Addr(), 3, uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength)) + r1, _, e1 := syscall.SyscallN(procGetVolumePathNameW.Addr(), uintptr(unsafe.Pointer(fileName)), uintptr(unsafe.Pointer(volumePathName)), uintptr(bufferLength)) if r1 == 0 { err = errnoErr(e1) } @@ -2706,7 +2707,7 @@ func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength ui } func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetVolumePathNamesForVolumeNameW.Addr(), 4, uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength)), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetVolumePathNamesForVolumeNameW.Addr(), uintptr(unsafe.Pointer(volumeName)), uintptr(unsafe.Pointer(volumePathNames)), uintptr(bufferLength), uintptr(unsafe.Pointer(returnLength))) if r1 == 0 { err = errnoErr(e1) } @@ -2714,7 +2715,7 @@ func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16 } func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetWindowsDirectoryW.Addr(), 2, uintptr(unsafe.Pointer(dir)), uintptr(dirLen), 0) + r0, _, e1 := syscall.SyscallN(procGetWindowsDirectoryW.Addr(), uintptr(unsafe.Pointer(dir)), uintptr(dirLen)) len = uint32(r0) if len == 0 { err = errnoErr(e1) @@ -2723,7 +2724,7 @@ func getWindowsDirectory(dir *uint16, dirLen uint32) (len uint32, err error) { } func initializeProcThreadAttributeList(attrlist *ProcThreadAttributeList, attrcount uint32, flags uint32, size *uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procInitializeProcThreadAttributeList.Addr(), 4, uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procInitializeProcThreadAttributeList.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(attrcount), uintptr(flags), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } @@ -2735,7 +2736,7 @@ func IsWow64Process(handle Handle, isWow64 *bool) (err error) { if *isWow64 { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procIsWow64Process.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(&_p0)), 0) + r1, _, e1 := syscall.SyscallN(procIsWow64Process.Addr(), uintptr(handle), uintptr(unsafe.Pointer(&_p0))) *isWow64 = _p0 != 0 if r1 == 0 { err = errnoErr(e1) @@ -2748,7 +2749,7 @@ func IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint1 if err != nil { return } - r1, _, e1 := syscall.Syscall(procIsWow64Process2.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine))) + r1, _, e1 := syscall.SyscallN(procIsWow64Process2.Addr(), uintptr(handle), uintptr(unsafe.Pointer(processMachine)), uintptr(unsafe.Pointer(nativeMachine))) if r1 == 0 { err = errnoErr(e1) } @@ -2765,7 +2766,7 @@ func LoadLibraryEx(libname string, zero Handle, flags uintptr) (handle Handle, e } func _LoadLibraryEx(libname *uint16, zero Handle, flags uintptr) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadLibraryExW.Addr(), 3, uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags)) + r0, _, e1 := syscall.SyscallN(procLoadLibraryExW.Addr(), uintptr(unsafe.Pointer(libname)), uintptr(zero), uintptr(flags)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2783,7 +2784,7 @@ func LoadLibrary(libname string) (handle Handle, err error) { } func _LoadLibrary(libname *uint16) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadLibraryW.Addr(), 1, uintptr(unsafe.Pointer(libname)), 0, 0) + r0, _, e1 := syscall.SyscallN(procLoadLibraryW.Addr(), uintptr(unsafe.Pointer(libname))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2792,7 +2793,7 @@ func _LoadLibrary(libname *uint16) (handle Handle, err error) { } func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) + r0, _, e1 := syscall.SyscallN(procLoadResource.Addr(), uintptr(module), uintptr(resInfo)) resData = Handle(r0) if resData == 0 { err = errnoErr(e1) @@ -2801,7 +2802,7 @@ func LoadResource(module Handle, resInfo Handle) (resData Handle, err error) { } func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { - r0, _, e1 := syscall.Syscall(procLocalAlloc.Addr(), 2, uintptr(flags), uintptr(length), 0) + r0, _, e1 := syscall.SyscallN(procLocalAlloc.Addr(), uintptr(flags), uintptr(length)) ptr = uintptr(r0) if ptr == 0 { err = errnoErr(e1) @@ -2810,7 +2811,7 @@ func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error) { } func LocalFree(hmem Handle) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procLocalFree.Addr(), 1, uintptr(hmem), 0, 0) + r0, _, e1 := syscall.SyscallN(procLocalFree.Addr(), uintptr(hmem)) handle = Handle(r0) if handle != 0 { err = errnoErr(e1) @@ -2819,7 +2820,7 @@ func LocalFree(hmem Handle) (handle Handle, err error) { } func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procLockFileEx.Addr(), 6, uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) + r1, _, e1 := syscall.SyscallN(procLockFileEx.Addr(), uintptr(file), uintptr(flags), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -2827,7 +2828,7 @@ func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, byt } func LockResource(resData Handle) (addr uintptr, err error) { - r0, _, e1 := syscall.Syscall(procLockResource.Addr(), 1, uintptr(resData), 0, 0) + r0, _, e1 := syscall.SyscallN(procLockResource.Addr(), uintptr(resData)) addr = uintptr(r0) if addr == 0 { err = errnoErr(e1) @@ -2836,7 +2837,7 @@ func LockResource(resData Handle) (addr uintptr, err error) { } func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error) { - r0, _, e1 := syscall.Syscall6(procMapViewOfFile.Addr(), 5, uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length), 0) + r0, _, e1 := syscall.SyscallN(procMapViewOfFile.Addr(), uintptr(handle), uintptr(access), uintptr(offsetHigh), uintptr(offsetLow), uintptr(length)) addr = uintptr(r0) if addr == 0 { err = errnoErr(e1) @@ -2845,7 +2846,7 @@ func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow ui } func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procModule32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0) + r1, _, e1 := syscall.SyscallN(procModule32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2853,7 +2854,7 @@ func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { } func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procModule32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry)), 0) + r1, _, e1 := syscall.SyscallN(procModule32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(moduleEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2861,7 +2862,7 @@ func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error) { } func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procMoveFileExW.Addr(), 3, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) + r1, _, e1 := syscall.SyscallN(procMoveFileExW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -2869,7 +2870,7 @@ func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error) { } func MoveFile(from *uint16, to *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procMoveFileW.Addr(), 2, uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to)), 0) + r1, _, e1 := syscall.SyscallN(procMoveFileW.Addr(), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(to))) if r1 == 0 { err = errnoErr(e1) } @@ -2877,7 +2878,7 @@ func MoveFile(from *uint16, to *uint16) (err error) { } func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error) { - r0, _, e1 := syscall.Syscall6(procMultiByteToWideChar.Addr(), 6, uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) + r0, _, e1 := syscall.SyscallN(procMultiByteToWideChar.Addr(), uintptr(codePage), uintptr(dwFlags), uintptr(unsafe.Pointer(str)), uintptr(nstr), uintptr(unsafe.Pointer(wchar)), uintptr(nwchar)) nwrite = int32(r0) if nwrite == 0 { err = errnoErr(e1) @@ -2890,7 +2891,7 @@ func OpenEvent(desiredAccess uint32, inheritHandle bool, name *uint16) (handle H if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenEventW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procOpenEventW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2903,7 +2904,7 @@ func OpenMutex(desiredAccess uint32, inheritHandle bool, name *uint16) (handle H if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenMutexW.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) + r0, _, e1 := syscall.SyscallN(procOpenMutexW.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(unsafe.Pointer(name))) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2916,7 +2917,7 @@ func OpenProcess(desiredAccess uint32, inheritHandle bool, processId uint32) (ha if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenProcess.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(processId)) + r0, _, e1 := syscall.SyscallN(procOpenProcess.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(processId)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2929,7 +2930,7 @@ func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (hand if inheritHandle { _p0 = 1 } - r0, _, e1 := syscall.Syscall(procOpenThread.Addr(), 3, uintptr(desiredAccess), uintptr(_p0), uintptr(threadId)) + r0, _, e1 := syscall.SyscallN(procOpenThread.Addr(), uintptr(desiredAccess), uintptr(_p0), uintptr(threadId)) handle = Handle(r0) if handle == 0 { err = errnoErr(e1) @@ -2938,7 +2939,7 @@ func OpenThread(desiredAccess uint32, inheritHandle bool, threadId uint32) (hand } func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procPostQueuedCompletionStatus.Addr(), 4, uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped)), 0, 0) + r1, _, e1 := syscall.SyscallN(procPostQueuedCompletionStatus.Addr(), uintptr(cphandle), uintptr(qty), uintptr(key), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -2946,7 +2947,7 @@ func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overla } func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procProcess32FirstW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0) + r1, _, e1 := syscall.SyscallN(procProcess32FirstW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2954,7 +2955,7 @@ func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error) { } func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procProcess32NextW.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(procEntry)), 0) + r1, _, e1 := syscall.SyscallN(procProcess32NextW.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(procEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -2962,7 +2963,7 @@ func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error) { } func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procProcessIdToSessionId.Addr(), 2, uintptr(pid), uintptr(unsafe.Pointer(sessionid)), 0) + r1, _, e1 := syscall.SyscallN(procProcessIdToSessionId.Addr(), uintptr(pid), uintptr(unsafe.Pointer(sessionid))) if r1 == 0 { err = errnoErr(e1) } @@ -2970,7 +2971,7 @@ func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error) { } func PulseEvent(event Handle) (err error) { - r1, _, e1 := syscall.Syscall(procPulseEvent.Addr(), 1, uintptr(event), 0, 0) + r1, _, e1 := syscall.SyscallN(procPulseEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } @@ -2978,7 +2979,7 @@ func PulseEvent(event Handle) (err error) { } func PurgeComm(handle Handle, dwFlags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procPurgeComm.Addr(), 2, uintptr(handle), uintptr(dwFlags), 0) + r1, _, e1 := syscall.SyscallN(procPurgeComm.Addr(), uintptr(handle), uintptr(dwFlags)) if r1 == 0 { err = errnoErr(e1) } @@ -2986,7 +2987,7 @@ func PurgeComm(handle Handle, dwFlags uint32) (err error) { } func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error) { - r0, _, e1 := syscall.Syscall(procQueryDosDeviceW.Addr(), 3, uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) + r0, _, e1 := syscall.SyscallN(procQueryDosDeviceW.Addr(), uintptr(unsafe.Pointer(deviceName)), uintptr(unsafe.Pointer(targetPath)), uintptr(max)) n = uint32(r0) if n == 0 { err = errnoErr(e1) @@ -2995,7 +2996,7 @@ func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint3 } func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryFullProcessImageNameW.Addr(), 4, uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size)), 0, 0) + r1, _, e1 := syscall.SyscallN(procQueryFullProcessImageNameW.Addr(), uintptr(proc), uintptr(flags), uintptr(unsafe.Pointer(exeName)), uintptr(unsafe.Pointer(size))) if r1 == 0 { err = errnoErr(e1) } @@ -3003,7 +3004,7 @@ func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size } func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procQueryInformationJobObject.Addr(), 5, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen)), 0) + r1, _, e1 := syscall.SyscallN(procQueryInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), uintptr(unsafe.Pointer(retlen))) if r1 == 0 { err = errnoErr(e1) } @@ -3011,7 +3012,7 @@ func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobO } func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error) { - r1, _, e1 := syscall.Syscall6(procReadConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl)), 0) + r1, _, e1 := syscall.SyscallN(procReadConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(toread), uintptr(unsafe.Pointer(read)), uintptr(unsafe.Pointer(inputControl))) if r1 == 0 { err = errnoErr(e1) } @@ -3023,7 +3024,7 @@ func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree if watchSubTree { _p0 = 1 } - r1, _, e1 := syscall.Syscall9(procReadDirectoryChangesW.Addr(), 8, uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine), 0) + r1, _, e1 := syscall.SyscallN(procReadDirectoryChangesW.Addr(), uintptr(handle), uintptr(unsafe.Pointer(buf)), uintptr(buflen), uintptr(_p0), uintptr(mask), uintptr(unsafe.Pointer(retlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) if r1 == 0 { err = errnoErr(e1) } @@ -3035,7 +3036,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) ( if len(buf) > 0 { _p0 = &buf[0] } - r1, _, e1 := syscall.Syscall6(procReadFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procReadFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3043,7 +3044,7 @@ func readFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) ( } func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procReadProcessMemory.Addr(), 5, uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead)), 0) + r1, _, e1 := syscall.SyscallN(procReadProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesRead))) if r1 == 0 { err = errnoErr(e1) } @@ -3051,7 +3052,7 @@ func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size u } func ReleaseMutex(mutex Handle) (err error) { - r1, _, e1 := syscall.Syscall(procReleaseMutex.Addr(), 1, uintptr(mutex), 0, 0) + r1, _, e1 := syscall.SyscallN(procReleaseMutex.Addr(), uintptr(mutex)) if r1 == 0 { err = errnoErr(e1) } @@ -3059,7 +3060,7 @@ func ReleaseMutex(mutex Handle) (err error) { } func RemoveDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procRemoveDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procRemoveDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -3067,7 +3068,7 @@ func RemoveDirectory(path *uint16) (err error) { } func RemoveDllDirectory(cookie uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procRemoveDllDirectory.Addr(), 1, uintptr(cookie), 0, 0) + r1, _, e1 := syscall.SyscallN(procRemoveDllDirectory.Addr(), uintptr(cookie)) if r1 == 0 { err = errnoErr(e1) } @@ -3075,7 +3076,7 @@ func RemoveDllDirectory(cookie uintptr) (err error) { } func ResetEvent(event Handle) (err error) { - r1, _, e1 := syscall.Syscall(procResetEvent.Addr(), 1, uintptr(event), 0, 0) + r1, _, e1 := syscall.SyscallN(procResetEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } @@ -3083,7 +3084,7 @@ func ResetEvent(event Handle) (err error) { } func resizePseudoConsole(pconsole Handle, size uint32) (hr error) { - r0, _, _ := syscall.Syscall(procResizePseudoConsole.Addr(), 2, uintptr(pconsole), uintptr(size), 0) + r0, _, _ := syscall.SyscallN(procResizePseudoConsole.Addr(), uintptr(pconsole), uintptr(size)) if r0 != 0 { hr = syscall.Errno(r0) } @@ -3091,7 +3092,7 @@ func resizePseudoConsole(pconsole Handle, size uint32) (hr error) { } func ResumeThread(thread Handle) (ret uint32, err error) { - r0, _, e1 := syscall.Syscall(procResumeThread.Addr(), 1, uintptr(thread), 0, 0) + r0, _, e1 := syscall.SyscallN(procResumeThread.Addr(), uintptr(thread)) ret = uint32(r0) if ret == 0xffffffff { err = errnoErr(e1) @@ -3100,7 +3101,7 @@ func ResumeThread(thread Handle) (ret uint32, err error) { } func SetCommBreak(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommBreak.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetCommBreak.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -3108,7 +3109,7 @@ func SetCommBreak(handle Handle) (err error) { } func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommMask.Addr(), 2, uintptr(handle), uintptr(dwEvtMask), 0) + r1, _, e1 := syscall.SyscallN(procSetCommMask.Addr(), uintptr(handle), uintptr(dwEvtMask)) if r1 == 0 { err = errnoErr(e1) } @@ -3116,7 +3117,7 @@ func SetCommMask(handle Handle, dwEvtMask uint32) (err error) { } func SetCommState(handle Handle, lpDCB *DCB) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommState.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(lpDCB)), 0) + r1, _, e1 := syscall.SyscallN(procSetCommState.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpDCB))) if r1 == 0 { err = errnoErr(e1) } @@ -3124,7 +3125,7 @@ func SetCommState(handle Handle, lpDCB *DCB) (err error) { } func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { - r1, _, e1 := syscall.Syscall(procSetCommTimeouts.Addr(), 2, uintptr(handle), uintptr(unsafe.Pointer(timeouts)), 0) + r1, _, e1 := syscall.SyscallN(procSetCommTimeouts.Addr(), uintptr(handle), uintptr(unsafe.Pointer(timeouts))) if r1 == 0 { err = errnoErr(e1) } @@ -3132,7 +3133,7 @@ func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error) { } func SetConsoleCP(cp uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleCP.Addr(), 1, uintptr(cp), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleCP.Addr(), uintptr(cp)) if r1 == 0 { err = errnoErr(e1) } @@ -3140,7 +3141,7 @@ func SetConsoleCP(cp uint32) (err error) { } func setConsoleCursorPosition(console Handle, position uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleCursorPosition.Addr(), 2, uintptr(console), uintptr(position), 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleCursorPosition.Addr(), uintptr(console), uintptr(position)) if r1 == 0 { err = errnoErr(e1) } @@ -3148,7 +3149,7 @@ func setConsoleCursorPosition(console Handle, position uint32) (err error) { } func SetConsoleMode(console Handle, mode uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleMode.Addr(), 2, uintptr(console), uintptr(mode), 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleMode.Addr(), uintptr(console), uintptr(mode)) if r1 == 0 { err = errnoErr(e1) } @@ -3156,7 +3157,7 @@ func SetConsoleMode(console Handle, mode uint32) (err error) { } func SetConsoleOutputCP(cp uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetConsoleOutputCP.Addr(), 1, uintptr(cp), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetConsoleOutputCP.Addr(), uintptr(cp)) if r1 == 0 { err = errnoErr(e1) } @@ -3164,7 +3165,7 @@ func SetConsoleOutputCP(cp uint32) (err error) { } func SetCurrentDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetCurrentDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetCurrentDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -3172,7 +3173,7 @@ func SetCurrentDirectory(path *uint16) (err error) { } func SetDefaultDllDirectories(directoryFlags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetDefaultDllDirectories.Addr(), 1, uintptr(directoryFlags), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetDefaultDllDirectories.Addr(), uintptr(directoryFlags)) if r1 == 0 { err = errnoErr(e1) } @@ -3189,7 +3190,7 @@ func SetDllDirectory(path string) (err error) { } func _SetDllDirectory(path *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetDllDirectoryW.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetDllDirectoryW.Addr(), uintptr(unsafe.Pointer(path))) if r1 == 0 { err = errnoErr(e1) } @@ -3197,7 +3198,7 @@ func _SetDllDirectory(path *uint16) (err error) { } func SetEndOfFile(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetEndOfFile.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetEndOfFile.Addr(), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -3205,7 +3206,7 @@ func SetEndOfFile(handle Handle) (err error) { } func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetEnvironmentVariableW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value)), 0) + r1, _, e1 := syscall.SyscallN(procSetEnvironmentVariableW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(value))) if r1 == 0 { err = errnoErr(e1) } @@ -3213,13 +3214,13 @@ func SetEnvironmentVariable(name *uint16, value *uint16) (err error) { } func SetErrorMode(mode uint32) (ret uint32) { - r0, _, _ := syscall.Syscall(procSetErrorMode.Addr(), 1, uintptr(mode), 0, 0) + r0, _, _ := syscall.SyscallN(procSetErrorMode.Addr(), uintptr(mode)) ret = uint32(r0) return } func SetEvent(event Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetEvent.Addr(), 1, uintptr(event), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetEvent.Addr(), uintptr(event)) if r1 == 0 { err = errnoErr(e1) } @@ -3227,7 +3228,7 @@ func SetEvent(event Handle) (err error) { } func SetFileAttributes(name *uint16, attrs uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileAttributesW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(attrs), 0) + r1, _, e1 := syscall.SyscallN(procSetFileAttributesW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(attrs)) if r1 == 0 { err = errnoErr(e1) } @@ -3235,7 +3236,7 @@ func SetFileAttributes(name *uint16, attrs uint32) (err error) { } func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileCompletionNotificationModes.Addr(), 2, uintptr(handle), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procSetFileCompletionNotificationModes.Addr(), uintptr(handle), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3243,7 +3244,7 @@ func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error) } func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetFileInformationByHandle.Addr(), 4, uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetFileInformationByHandle.Addr(), uintptr(handle), uintptr(class), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen)) if r1 == 0 { err = errnoErr(e1) } @@ -3251,7 +3252,7 @@ func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inB } func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error) { - r0, _, e1 := syscall.Syscall6(procSetFilePointer.Addr(), 4, uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetFilePointer.Addr(), uintptr(handle), uintptr(lowoffset), uintptr(unsafe.Pointer(highoffsetptr)), uintptr(whence)) newlowoffset = uint32(r0) if newlowoffset == 0xffffffff { err = errnoErr(e1) @@ -3260,7 +3261,7 @@ func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence } func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) { - r1, _, e1 := syscall.Syscall6(procSetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetFileTime.Addr(), uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime))) if r1 == 0 { err = errnoErr(e1) } @@ -3268,7 +3269,7 @@ func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetim } func SetFileValidData(handle Handle, validDataLength int64) (err error) { - r1, _, e1 := syscall.Syscall(procSetFileValidData.Addr(), 2, uintptr(handle), uintptr(validDataLength), 0) + r1, _, e1 := syscall.SyscallN(procSetFileValidData.Addr(), uintptr(handle), uintptr(validDataLength)) if r1 == 0 { err = errnoErr(e1) } @@ -3276,7 +3277,7 @@ func SetFileValidData(handle Handle, validDataLength int64) (err error) { } func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetHandleInformation.Addr(), 3, uintptr(handle), uintptr(mask), uintptr(flags)) + r1, _, e1 := syscall.SyscallN(procSetHandleInformation.Addr(), uintptr(handle), uintptr(mask), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3284,7 +3285,7 @@ func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error) } func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error) { - r0, _, e1 := syscall.Syscall6(procSetInformationJobObject.Addr(), 4, uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetInformationJobObject.Addr(), uintptr(job), uintptr(JobObjectInformationClass), uintptr(JobObjectInformation), uintptr(JobObjectInformationLength)) ret = int(r0) if ret == 0 { err = errnoErr(e1) @@ -3293,7 +3294,7 @@ func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobOb } func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetNamedPipeHandleState.Addr(), 4, uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetNamedPipeHandleState.Addr(), uintptr(pipe), uintptr(unsafe.Pointer(state)), uintptr(unsafe.Pointer(maxCollectionCount)), uintptr(unsafe.Pointer(collectDataTimeout))) if r1 == 0 { err = errnoErr(e1) } @@ -3301,7 +3302,7 @@ func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uin } func SetPriorityClass(process Handle, priorityClass uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetPriorityClass.Addr(), 2, uintptr(process), uintptr(priorityClass), 0) + r1, _, e1 := syscall.SyscallN(procSetPriorityClass.Addr(), uintptr(process), uintptr(priorityClass)) if r1 == 0 { err = errnoErr(e1) } @@ -3313,7 +3314,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) { if disable { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procSetProcessPriorityBoost.Addr(), 2, uintptr(process), uintptr(_p0), 0) + r1, _, e1 := syscall.SyscallN(procSetProcessPriorityBoost.Addr(), uintptr(process), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -3321,7 +3322,7 @@ func SetProcessPriorityBoost(process Handle, disable bool) (err error) { } func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetProcessShutdownParameters.Addr(), 2, uintptr(level), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procSetProcessShutdownParameters.Addr(), uintptr(level), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3329,7 +3330,7 @@ func SetProcessShutdownParameters(level uint32, flags uint32) (err error) { } func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetProcessWorkingSetSizeEx.Addr(), 4, uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetProcessWorkingSetSizeEx.Addr(), uintptr(hProcess), uintptr(dwMinimumWorkingSetSize), uintptr(dwMaximumWorkingSetSize), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3337,7 +3338,7 @@ func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr } func SetStdHandle(stdhandle uint32, handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procSetStdHandle.Addr(), 2, uintptr(stdhandle), uintptr(handle), 0) + r1, _, e1 := syscall.SyscallN(procSetStdHandle.Addr(), uintptr(stdhandle), uintptr(handle)) if r1 == 0 { err = errnoErr(e1) } @@ -3345,7 +3346,7 @@ func SetStdHandle(stdhandle uint32, handle Handle) (err error) { } func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetVolumeLabelW.Addr(), 2, uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName)), 0) + r1, _, e1 := syscall.SyscallN(procSetVolumeLabelW.Addr(), uintptr(unsafe.Pointer(rootPathName)), uintptr(unsafe.Pointer(volumeName))) if r1 == 0 { err = errnoErr(e1) } @@ -3353,7 +3354,7 @@ func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error) { } func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procSetVolumeMountPointW.Addr(), 2, uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName)), 0) + r1, _, e1 := syscall.SyscallN(procSetVolumeMountPointW.Addr(), uintptr(unsafe.Pointer(volumeMountPoint)), uintptr(unsafe.Pointer(volumeName))) if r1 == 0 { err = errnoErr(e1) } @@ -3361,7 +3362,7 @@ func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err erro } func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { - r1, _, e1 := syscall.Syscall(procSetupComm.Addr(), 3, uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) + r1, _, e1 := syscall.SyscallN(procSetupComm.Addr(), uintptr(handle), uintptr(dwInQueue), uintptr(dwOutQueue)) if r1 == 0 { err = errnoErr(e1) } @@ -3369,7 +3370,7 @@ func SetupComm(handle Handle, dwInQueue uint32, dwOutQueue uint32) (err error) { } func SizeofResource(module Handle, resInfo Handle) (size uint32, err error) { - r0, _, e1 := syscall.Syscall(procSizeofResource.Addr(), 2, uintptr(module), uintptr(resInfo), 0) + r0, _, e1 := syscall.SyscallN(procSizeofResource.Addr(), uintptr(module), uintptr(resInfo)) size = uint32(r0) if size == 0 { err = errnoErr(e1) @@ -3382,13 +3383,13 @@ func SleepEx(milliseconds uint32, alertable bool) (ret uint32) { if alertable { _p0 = 1 } - r0, _, _ := syscall.Syscall(procSleepEx.Addr(), 2, uintptr(milliseconds), uintptr(_p0), 0) + r0, _, _ := syscall.SyscallN(procSleepEx.Addr(), uintptr(milliseconds), uintptr(_p0)) ret = uint32(r0) return } func TerminateJobObject(job Handle, exitCode uint32) (err error) { - r1, _, e1 := syscall.Syscall(procTerminateJobObject.Addr(), 2, uintptr(job), uintptr(exitCode), 0) + r1, _, e1 := syscall.SyscallN(procTerminateJobObject.Addr(), uintptr(job), uintptr(exitCode)) if r1 == 0 { err = errnoErr(e1) } @@ -3396,7 +3397,7 @@ func TerminateJobObject(job Handle, exitCode uint32) (err error) { } func TerminateProcess(handle Handle, exitcode uint32) (err error) { - r1, _, e1 := syscall.Syscall(procTerminateProcess.Addr(), 2, uintptr(handle), uintptr(exitcode), 0) + r1, _, e1 := syscall.SyscallN(procTerminateProcess.Addr(), uintptr(handle), uintptr(exitcode)) if r1 == 0 { err = errnoErr(e1) } @@ -3404,7 +3405,7 @@ func TerminateProcess(handle Handle, exitcode uint32) (err error) { } func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procThread32First.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0) + r1, _, e1 := syscall.SyscallN(procThread32First.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -3412,7 +3413,7 @@ func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error) { } func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { - r1, _, e1 := syscall.Syscall(procThread32Next.Addr(), 2, uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry)), 0) + r1, _, e1 := syscall.SyscallN(procThread32Next.Addr(), uintptr(snapshot), uintptr(unsafe.Pointer(threadEntry))) if r1 == 0 { err = errnoErr(e1) } @@ -3420,7 +3421,7 @@ func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error) { } func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall6(procUnlockFileEx.Addr(), 5, uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procUnlockFileEx.Addr(), uintptr(file), uintptr(reserved), uintptr(bytesLow), uintptr(bytesHigh), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3428,7 +3429,7 @@ func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint3 } func UnmapViewOfFile(addr uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procUnmapViewOfFile.Addr(), 1, uintptr(addr), 0, 0) + r1, _, e1 := syscall.SyscallN(procUnmapViewOfFile.Addr(), uintptr(addr)) if r1 == 0 { err = errnoErr(e1) } @@ -3436,7 +3437,7 @@ func UnmapViewOfFile(addr uintptr) (err error) { } func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, attr uintptr, value unsafe.Pointer, size uintptr, prevvalue unsafe.Pointer, returnedsize *uintptr) (err error) { - r1, _, e1 := syscall.Syscall9(procUpdateProcThreadAttribute.Addr(), 7, uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procUpdateProcThreadAttribute.Addr(), uintptr(unsafe.Pointer(attrlist)), uintptr(flags), uintptr(attr), uintptr(value), uintptr(size), uintptr(prevvalue), uintptr(unsafe.Pointer(returnedsize))) if r1 == 0 { err = errnoErr(e1) } @@ -3444,7 +3445,7 @@ func updateProcThreadAttribute(attrlist *ProcThreadAttributeList, flags uint32, } func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error) { - r0, _, e1 := syscall.Syscall6(procVirtualAlloc.Addr(), 4, uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect), 0, 0) + r0, _, e1 := syscall.SyscallN(procVirtualAlloc.Addr(), uintptr(address), uintptr(size), uintptr(alloctype), uintptr(protect)) value = uintptr(r0) if value == 0 { err = errnoErr(e1) @@ -3453,7 +3454,7 @@ func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint3 } func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualFree.Addr(), 3, uintptr(address), uintptr(size), uintptr(freetype)) + r1, _, e1 := syscall.SyscallN(procVirtualFree.Addr(), uintptr(address), uintptr(size), uintptr(freetype)) if r1 == 0 { err = errnoErr(e1) } @@ -3461,7 +3462,7 @@ func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error) { } func VirtualLock(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualLock.Addr(), 2, uintptr(addr), uintptr(length), 0) + r1, _, e1 := syscall.SyscallN(procVirtualLock.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3469,7 +3470,7 @@ func VirtualLock(addr uintptr, length uintptr) (err error) { } func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procVirtualProtect.Addr(), 4, uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect)), 0, 0) + r1, _, e1 := syscall.SyscallN(procVirtualProtect.Addr(), uintptr(address), uintptr(size), uintptr(newprotect), uintptr(unsafe.Pointer(oldprotect))) if r1 == 0 { err = errnoErr(e1) } @@ -3477,7 +3478,7 @@ func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect } func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procVirtualProtectEx.Addr(), 5, uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect)), 0) + r1, _, e1 := syscall.SyscallN(procVirtualProtectEx.Addr(), uintptr(process), uintptr(address), uintptr(size), uintptr(newProtect), uintptr(unsafe.Pointer(oldProtect))) if r1 == 0 { err = errnoErr(e1) } @@ -3485,7 +3486,7 @@ func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect } func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualQuery.Addr(), 3, uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) + r1, _, e1 := syscall.SyscallN(procVirtualQuery.Addr(), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3493,7 +3494,7 @@ func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintpt } func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procVirtualQueryEx.Addr(), 4, uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length), 0, 0) + r1, _, e1 := syscall.SyscallN(procVirtualQueryEx.Addr(), uintptr(process), uintptr(address), uintptr(unsafe.Pointer(buffer)), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3501,7 +3502,7 @@ func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformat } func VirtualUnlock(addr uintptr, length uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procVirtualUnlock.Addr(), 2, uintptr(addr), uintptr(length), 0) + r1, _, e1 := syscall.SyscallN(procVirtualUnlock.Addr(), uintptr(addr), uintptr(length)) if r1 == 0 { err = errnoErr(e1) } @@ -3509,13 +3510,13 @@ func VirtualUnlock(addr uintptr, length uintptr) (err error) { } func WTSGetActiveConsoleSessionId() (sessionID uint32) { - r0, _, _ := syscall.Syscall(procWTSGetActiveConsoleSessionId.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procWTSGetActiveConsoleSessionId.Addr()) sessionID = uint32(r0) return } func WaitCommEvent(handle Handle, lpEvtMask *uint32, lpOverlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall(procWaitCommEvent.Addr(), 3, uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) + r1, _, e1 := syscall.SyscallN(procWaitCommEvent.Addr(), uintptr(handle), uintptr(unsafe.Pointer(lpEvtMask)), uintptr(unsafe.Pointer(lpOverlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3527,7 +3528,7 @@ func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMil if waitAll { _p0 = 1 } - r0, _, e1 := syscall.Syscall6(procWaitForMultipleObjects.Addr(), 4, uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds), 0, 0) + r0, _, e1 := syscall.SyscallN(procWaitForMultipleObjects.Addr(), uintptr(count), uintptr(handles), uintptr(_p0), uintptr(waitMilliseconds)) event = uint32(r0) if event == 0xffffffff { err = errnoErr(e1) @@ -3536,7 +3537,7 @@ func waitForMultipleObjects(count uint32, handles uintptr, waitAll bool, waitMil } func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error) { - r0, _, e1 := syscall.Syscall(procWaitForSingleObject.Addr(), 2, uintptr(handle), uintptr(waitMilliseconds), 0) + r0, _, e1 := syscall.SyscallN(procWaitForSingleObject.Addr(), uintptr(handle), uintptr(waitMilliseconds)) event = uint32(r0) if event == 0xffffffff { err = errnoErr(e1) @@ -3545,7 +3546,7 @@ func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, } func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error) { - r1, _, e1 := syscall.Syscall6(procWriteConsoleW.Addr(), 5, uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved)), 0) + r1, _, e1 := syscall.SyscallN(procWriteConsoleW.Addr(), uintptr(console), uintptr(unsafe.Pointer(buf)), uintptr(towrite), uintptr(unsafe.Pointer(written)), uintptr(unsafe.Pointer(reserved))) if r1 == 0 { err = errnoErr(e1) } @@ -3557,7 +3558,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) if len(buf) > 0 { _p0 = &buf[0] } - r1, _, e1 := syscall.Syscall6(procWriteFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procWriteFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(unsafe.Pointer(done)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3565,7 +3566,7 @@ func writeFile(handle Handle, buf []byte, done *uint32, overlapped *Overlapped) } func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procWriteProcessMemory.Addr(), 5, uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten)), 0) + r1, _, e1 := syscall.SyscallN(procWriteProcessMemory.Addr(), uintptr(process), uintptr(baseAddress), uintptr(unsafe.Pointer(buffer)), uintptr(size), uintptr(unsafe.Pointer(numberOfBytesWritten))) if r1 == 0 { err = errnoErr(e1) } @@ -3573,7 +3574,7 @@ func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size } func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error) { - r1, _, e1 := syscall.Syscall9(procAcceptEx.Addr(), 8, uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped)), 0) + r1, _, e1 := syscall.SyscallN(procAcceptEx.Addr(), uintptr(ls), uintptr(as), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(overlapped))) if r1 == 0 { err = errnoErr(e1) } @@ -3581,12 +3582,12 @@ func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32 } func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32) { - syscall.Syscall9(procGetAcceptExSockaddrs.Addr(), 8, uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen)), 0) + syscall.SyscallN(procGetAcceptExSockaddrs.Addr(), uintptr(unsafe.Pointer(buf)), uintptr(rxdatalen), uintptr(laddrlen), uintptr(raddrlen), uintptr(unsafe.Pointer(lrsa)), uintptr(unsafe.Pointer(lrsalen)), uintptr(unsafe.Pointer(rrsa)), uintptr(unsafe.Pointer(rrsalen))) return } func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procTransmitFile.Addr(), 7, uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags), 0, 0) + r1, _, e1 := syscall.SyscallN(procTransmitFile.Addr(), uintptr(s), uintptr(handle), uintptr(bytesToWrite), uintptr(bytsPerSend), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(transmitFileBuf)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -3594,7 +3595,7 @@ func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint } func NetApiBufferFree(buf *byte) (neterr error) { - r0, _, _ := syscall.Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0) + r0, _, _ := syscall.SyscallN(procNetApiBufferFree.Addr(), uintptr(unsafe.Pointer(buf))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3602,7 +3603,7 @@ func NetApiBufferFree(buf *byte) (neterr error) { } func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) { - r0, _, _ := syscall.Syscall(procNetGetJoinInformation.Addr(), 3, uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) + r0, _, _ := syscall.SyscallN(procNetGetJoinInformation.Addr(), uintptr(unsafe.Pointer(server)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bufType))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3610,7 +3611,7 @@ func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (nete } func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { - r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0) + r0, _, _ := syscall.SyscallN(procNetUserEnum.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3618,7 +3619,7 @@ func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, pr } func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) { - r0, _, _ := syscall.Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0) + r0, _, _ := syscall.SyscallN(procNetUserGetInfo.Addr(), uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf))) if r0 != 0 { neterr = syscall.Errno(r0) } @@ -3626,7 +3627,7 @@ func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **by } func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall12(procNtCreateFile.Addr(), 11, uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength), 0) + r0, _, _ := syscall.SyscallN(procNtCreateFile.Addr(), uintptr(unsafe.Pointer(handle)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(allocationSize)), uintptr(attributes), uintptr(share), uintptr(disposition), uintptr(options), uintptr(eabuffer), uintptr(ealength)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3634,7 +3635,7 @@ func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO } func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error) { - r0, _, _ := syscall.Syscall15(procNtCreateNamedPipeFile.Addr(), 14, uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout)), 0) + r0, _, _ := syscall.SyscallN(procNtCreateNamedPipeFile.Addr(), uintptr(unsafe.Pointer(pipe)), uintptr(access), uintptr(unsafe.Pointer(oa)), uintptr(unsafe.Pointer(iosb)), uintptr(share), uintptr(disposition), uintptr(options), uintptr(typ), uintptr(readMode), uintptr(completionMode), uintptr(maxInstances), uintptr(inboundQuota), uintptr(outputQuota), uintptr(unsafe.Pointer(timeout))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3642,7 +3643,7 @@ func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, i } func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtQueryInformationProcess.Addr(), 5, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen)), 0) + r0, _, _ := syscall.SyscallN(procNtQueryInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3650,7 +3651,7 @@ func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe } func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtQuerySystemInformation.Addr(), 4, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen)), 0, 0) + r0, _, _ := syscall.SyscallN(procNtQuerySystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen), uintptr(unsafe.Pointer(retLen))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3658,7 +3659,7 @@ func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInf } func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtSetInformationFile.Addr(), 5, uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class), 0) + r0, _, _ := syscall.SyscallN(procNtSetInformationFile.Addr(), uintptr(handle), uintptr(unsafe.Pointer(iosb)), uintptr(unsafe.Pointer(inBuffer)), uintptr(inBufferLen), uintptr(class)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3666,7 +3667,7 @@ func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, } func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procNtSetInformationProcess.Addr(), 4, uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen), 0, 0) + r0, _, _ := syscall.SyscallN(procNtSetInformationProcess.Addr(), uintptr(proc), uintptr(procInfoClass), uintptr(procInfo), uintptr(procInfoLen)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3674,7 +3675,7 @@ func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.P } func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error) { - r0, _, _ := syscall.Syscall(procNtSetSystemInformation.Addr(), 3, uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) + r0, _, _ := syscall.SyscallN(procNtSetSystemInformation.Addr(), uintptr(sysInfoClass), uintptr(sysInfo), uintptr(sysInfoLen)) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3682,13 +3683,13 @@ func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoL } func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool) { - r0, _, _ := syscall.Syscall(procRtlAddFunctionTable.Addr(), 3, uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) + r0, _, _ := syscall.SyscallN(procRtlAddFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable)), uintptr(entryCount), uintptr(baseAddress)) ret = r0 != 0 return } func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { - r0, _, _ := syscall.Syscall(procRtlDefaultNpAcl.Addr(), 1, uintptr(unsafe.Pointer(acl)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDefaultNpAcl.Addr(), uintptr(unsafe.Pointer(acl))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3696,13 +3697,13 @@ func RtlDefaultNpAcl(acl **ACL) (ntstatus error) { } func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool) { - r0, _, _ := syscall.Syscall(procRtlDeleteFunctionTable.Addr(), 1, uintptr(unsafe.Pointer(functionTable)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDeleteFunctionTable.Addr(), uintptr(unsafe.Pointer(functionTable))) ret = r0 != 0 return } func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDosPathNameToNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3710,7 +3711,7 @@ func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFile } func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error) { - r0, _, _ := syscall.Syscall6(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), 4, uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlDosPathNameToRelativeNtPathName_U_WithStatus.Addr(), uintptr(unsafe.Pointer(dosName)), uintptr(unsafe.Pointer(ntName)), uintptr(unsafe.Pointer(ntFileNamePart)), uintptr(unsafe.Pointer(relativeName))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3718,18 +3719,18 @@ func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString } func RtlGetCurrentPeb() (peb *PEB) { - r0, _, _ := syscall.Syscall(procRtlGetCurrentPeb.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procRtlGetCurrentPeb.Addr()) peb = (*PEB)(unsafe.Pointer(r0)) return } func rtlGetNtVersionNumbers(majorVersion *uint32, minorVersion *uint32, buildNumber *uint32) { - syscall.Syscall(procRtlGetNtVersionNumbers.Addr(), 3, uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber))) + syscall.SyscallN(procRtlGetNtVersionNumbers.Addr(), uintptr(unsafe.Pointer(majorVersion)), uintptr(unsafe.Pointer(minorVersion)), uintptr(unsafe.Pointer(buildNumber))) return } func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { - r0, _, _ := syscall.Syscall(procRtlGetVersion.Addr(), 1, uintptr(unsafe.Pointer(info)), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlGetVersion.Addr(), uintptr(unsafe.Pointer(info))) if r0 != 0 { ntstatus = NTStatus(r0) } @@ -3737,23 +3738,23 @@ func rtlGetVersion(info *OsVersionInfoEx) (ntstatus error) { } func RtlInitString(destinationString *NTString, sourceString *byte) { - syscall.Syscall(procRtlInitString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0) + syscall.SyscallN(procRtlInitString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) return } func RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16) { - syscall.Syscall(procRtlInitUnicodeString.Addr(), 2, uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString)), 0) + syscall.SyscallN(procRtlInitUnicodeString.Addr(), uintptr(unsafe.Pointer(destinationString)), uintptr(unsafe.Pointer(sourceString))) return } func rtlNtStatusToDosErrorNoTeb(ntstatus NTStatus) (ret syscall.Errno) { - r0, _, _ := syscall.Syscall(procRtlNtStatusToDosErrorNoTeb.Addr(), 1, uintptr(ntstatus), 0, 0) + r0, _, _ := syscall.SyscallN(procRtlNtStatusToDosErrorNoTeb.Addr(), uintptr(ntstatus)) ret = syscall.Errno(r0) return } func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { - r0, _, _ := syscall.Syscall(procCLSIDFromString.Addr(), 2, uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid)), 0) + r0, _, _ := syscall.SyscallN(procCLSIDFromString.Addr(), uintptr(unsafe.Pointer(lpsz)), uintptr(unsafe.Pointer(pclsid))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3761,7 +3762,7 @@ func clsidFromString(lpsz *uint16, pclsid *GUID) (ret error) { } func coCreateGuid(pguid *GUID) (ret error) { - r0, _, _ := syscall.Syscall(procCoCreateGuid.Addr(), 1, uintptr(unsafe.Pointer(pguid)), 0, 0) + r0, _, _ := syscall.SyscallN(procCoCreateGuid.Addr(), uintptr(unsafe.Pointer(pguid))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3769,7 +3770,7 @@ func coCreateGuid(pguid *GUID) (ret error) { } func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error) { - r0, _, _ := syscall.Syscall6(procCoGetObject.Addr(), 4, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable)), 0, 0) + r0, _, _ := syscall.SyscallN(procCoGetObject.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(bindOpts)), uintptr(unsafe.Pointer(guid)), uintptr(unsafe.Pointer(functionTable))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3777,7 +3778,7 @@ func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable * } func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { - r0, _, _ := syscall.Syscall(procCoInitializeEx.Addr(), 2, uintptr(reserved), uintptr(coInit), 0) + r0, _, _ := syscall.SyscallN(procCoInitializeEx.Addr(), uintptr(reserved), uintptr(coInit)) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3785,23 +3786,23 @@ func CoInitializeEx(reserved uintptr, coInit uint32) (ret error) { } func CoTaskMemFree(address unsafe.Pointer) { - syscall.Syscall(procCoTaskMemFree.Addr(), 1, uintptr(address), 0, 0) + syscall.SyscallN(procCoTaskMemFree.Addr(), uintptr(address)) return } func CoUninitialize() { - syscall.Syscall(procCoUninitialize.Addr(), 0, 0, 0, 0) + syscall.SyscallN(procCoUninitialize.Addr()) return } func stringFromGUID2(rguid *GUID, lpsz *uint16, cchMax int32) (chars int32) { - r0, _, _ := syscall.Syscall(procStringFromGUID2.Addr(), 3, uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) + r0, _, _ := syscall.SyscallN(procStringFromGUID2.Addr(), uintptr(unsafe.Pointer(rguid)), uintptr(unsafe.Pointer(lpsz)), uintptr(cchMax)) chars = int32(r0) return } func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procEnumProcessModules.Addr(), 4, uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), 0, 0) + r1, _, e1 := syscall.SyscallN(procEnumProcessModules.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded))) if r1 == 0 { err = errnoErr(e1) } @@ -3809,7 +3810,7 @@ func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uin } func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procEnumProcessModulesEx.Addr(), 5, uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag), 0) + r1, _, e1 := syscall.SyscallN(procEnumProcessModulesEx.Addr(), uintptr(process), uintptr(unsafe.Pointer(module)), uintptr(cb), uintptr(unsafe.Pointer(cbNeeded)), uintptr(filterFlag)) if r1 == 0 { err = errnoErr(e1) } @@ -3817,7 +3818,7 @@ func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *u } func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procEnumProcesses.Addr(), 3, uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) + r1, _, e1 := syscall.SyscallN(procEnumProcesses.Addr(), uintptr(unsafe.Pointer(processIds)), uintptr(nSize), uintptr(unsafe.Pointer(bytesReturned))) if r1 == 0 { err = errnoErr(e1) } @@ -3825,7 +3826,7 @@ func enumProcesses(processIds *uint32, nSize uint32, bytesReturned *uint32) (err } func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetModuleBaseNameW.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetModuleBaseNameW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(baseName)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } @@ -3833,7 +3834,7 @@ func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uin } func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetModuleFileNameExW.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetModuleFileNameExW.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(filename)), uintptr(size)) if r1 == 0 { err = errnoErr(e1) } @@ -3841,7 +3842,7 @@ func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size u } func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procGetModuleInformation.Addr(), 4, uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetModuleInformation.Addr(), uintptr(process), uintptr(module), uintptr(unsafe.Pointer(modinfo)), uintptr(cb)) if r1 == 0 { err = errnoErr(e1) } @@ -3849,7 +3850,7 @@ func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb } func QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error) { - r1, _, e1 := syscall.Syscall(procQueryWorkingSetEx.Addr(), 3, uintptr(process), uintptr(pv), uintptr(cb)) + r1, _, e1 := syscall.SyscallN(procQueryWorkingSetEx.Addr(), uintptr(process), uintptr(pv), uintptr(cb)) if r1 == 0 { err = errnoErr(e1) } @@ -3861,7 +3862,7 @@ func SubscribeServiceChangeNotifications(service Handle, eventType uint32, callb if ret != nil { return } - r0, _, _ := syscall.Syscall6(procSubscribeServiceChangeNotifications.Addr(), 5, uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription)), 0) + r0, _, _ := syscall.SyscallN(procSubscribeServiceChangeNotifications.Addr(), uintptr(service), uintptr(eventType), uintptr(callback), uintptr(callbackCtx), uintptr(unsafe.Pointer(subscription))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -3873,12 +3874,12 @@ func UnsubscribeServiceChangeNotifications(subscription uintptr) (err error) { if err != nil { return } - syscall.Syscall(procUnsubscribeServiceChangeNotifications.Addr(), 1, uintptr(subscription), 0, 0) + syscall.SyscallN(procUnsubscribeServiceChangeNotifications.Addr(), uintptr(subscription)) return } func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize))) + r1, _, e1 := syscall.SyscallN(procGetUserNameExW.Addr(), uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize))) if r1&0xff == 0 { err = errnoErr(e1) } @@ -3886,7 +3887,7 @@ func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err er } func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0) + r1, _, e1 := syscall.SyscallN(procTranslateNameW.Addr(), uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize))) if r1&0xff == 0 { err = errnoErr(e1) } @@ -3894,7 +3895,7 @@ func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint } func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiBuildDriverInfoList.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) + r1, _, e1 := syscall.SyscallN(procSetupDiBuildDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) if r1 == 0 { err = errnoErr(e1) } @@ -3902,7 +3903,7 @@ func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa } func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiCallClassInstaller.Addr(), 3, uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiCallClassInstaller.Addr(), uintptr(installFunction), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3910,7 +3911,7 @@ func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInf } func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiCancelDriverInfoSearch.Addr(), 1, uintptr(deviceInfoSet), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiCancelDriverInfoSearch.Addr(), uintptr(deviceInfoSet)) if r1 == 0 { err = errnoErr(e1) } @@ -3918,7 +3919,7 @@ func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error) { } func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGuidListSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiClassGuidsFromNameExW.Addr(), 6, uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procSetupDiClassGuidsFromNameExW.Addr(), uintptr(unsafe.Pointer(className)), uintptr(unsafe.Pointer(classGuidList)), uintptr(classGuidListSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } @@ -3926,7 +3927,7 @@ func setupDiClassGuidsFromNameEx(className *uint16, classGuidList *GUID, classGu } func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSize uint32, requiredSize *uint32, machineName *uint16, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiClassNameFromGuidExW.Addr(), 6, uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procSetupDiClassNameFromGuidExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(className)), uintptr(classNameSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } @@ -3934,7 +3935,7 @@ func setupDiClassNameFromGuidEx(classGUID *GUID, className *uint16, classNameSiz } func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { - r0, _, e1 := syscall.Syscall6(procSetupDiCreateDeviceInfoListExW.Addr(), 4, uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoListExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(hwndParent), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) handle = DevInfo(r0) if handle == DevInfo(InvalidHandle) { err = errnoErr(e1) @@ -3943,7 +3944,7 @@ func setupDiCreateDeviceInfoListEx(classGUID *GUID, hwndParent uintptr, machineN } func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUID *GUID, DeviceDescription *uint16, hwndParent uintptr, CreationFlags DICD, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall9(procSetupDiCreateDeviceInfoW.Addr(), 7, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiCreateDeviceInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(DeviceName)), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(DeviceDescription)), uintptr(hwndParent), uintptr(CreationFlags), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3951,7 +3952,7 @@ func setupDiCreateDeviceInfo(deviceInfoSet DevInfo, DeviceName *uint16, classGUI } func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiDestroyDeviceInfoList.Addr(), 1, uintptr(deviceInfoSet), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDeviceInfoList.Addr(), uintptr(deviceInfoSet)) if r1 == 0 { err = errnoErr(e1) } @@ -3959,7 +3960,7 @@ func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error) { } func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiDestroyDriverInfoList.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) + r1, _, e1 := syscall.SyscallN(procSetupDiDestroyDriverInfoList.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType)) if r1 == 0 { err = errnoErr(e1) } @@ -3967,7 +3968,7 @@ func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfo } func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiEnumDeviceInfo.Addr(), 3, uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiEnumDeviceInfo.Addr(), uintptr(deviceInfoSet), uintptr(memberIndex), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3975,7 +3976,7 @@ func setupDiEnumDeviceInfo(deviceInfoSet DevInfo, memberIndex uint32, deviceInfo } func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT, memberIndex uint32, driverInfoData *DrvInfoData) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiEnumDriverInfoW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiEnumDriverInfoW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(driverType), uintptr(memberIndex), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -3983,7 +3984,7 @@ func setupDiEnumDriverInfo(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, d } func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintptr, Flags DIGCF, deviceInfoSet DevInfo, machineName *uint16, reserved uintptr) (handle DevInfo, err error) { - r0, _, e1 := syscall.Syscall9(procSetupDiGetClassDevsExW.Addr(), 7, uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved), 0, 0) + r0, _, e1 := syscall.SyscallN(procSetupDiGetClassDevsExW.Addr(), uintptr(unsafe.Pointer(classGUID)), uintptr(unsafe.Pointer(Enumerator)), uintptr(hwndParent), uintptr(Flags), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(machineName)), uintptr(reserved)) handle = DevInfo(r0) if handle == DevInfo(InvalidHandle) { err = errnoErr(e1) @@ -3992,7 +3993,7 @@ func setupDiGetClassDevsEx(classGUID *GUID, Enumerator *uint16, hwndParent uintp } func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiGetClassInstallParamsW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4000,7 +4001,7 @@ func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo } func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailData *DevInfoListDetailData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetDeviceInfoListDetailW.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInfoListDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoSetDetailData))) if r1 == 0 { err = errnoErr(e1) } @@ -4008,7 +4009,7 @@ func setupDiGetDeviceInfoListDetail(deviceInfoSet DevInfo, deviceInfoSetDetailDa } func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetDeviceInstallParamsW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) if r1 == 0 { err = errnoErr(e1) } @@ -4016,7 +4017,7 @@ func setupDiGetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf } func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, instanceId *uint16, instanceIdSize uint32, instanceIdRequiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiGetDeviceInstanceIdW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceInstanceIdW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(instanceId)), uintptr(instanceIdSize), uintptr(unsafe.Pointer(instanceIdRequiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4024,7 +4025,7 @@ func setupDiGetDeviceInstanceId(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa } func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, propertyKey *DEVPROPKEY, propertyType *DEVPROPTYPE, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32, flags uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procSetupDiGetDevicePropertyW.Addr(), 8, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDevicePropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(propertyKey)), uintptr(unsafe.Pointer(propertyType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), uintptr(flags)) if r1 == 0 { err = errnoErr(e1) } @@ -4032,7 +4033,7 @@ func setupDiGetDeviceProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyRegDataType *uint32, propertyBuffer *byte, propertyBufferSize uint32, requiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall9(procSetupDiGetDeviceRegistryPropertyW.Addr(), 7, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyRegDataType)), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4040,7 +4041,7 @@ func setupDiGetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev } func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData, driverInfoDetailData *DrvInfoDetailData, driverInfoDetailDataSize uint32, requiredSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiGetDriverInfoDetailW.Addr(), 6, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize))) + r1, _, e1 := syscall.SyscallN(procSetupDiGetDriverInfoDetailW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData)), uintptr(unsafe.Pointer(driverInfoDetailData)), uintptr(driverInfoDetailDataSize), uintptr(unsafe.Pointer(requiredSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4048,7 +4049,7 @@ func setupDiGetDriverInfoDetail(deviceInfoSet DevInfo, deviceInfoData *DevInfoDa } func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetSelectedDevice.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4056,7 +4057,7 @@ func setupDiGetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiGetSelectedDriverW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiGetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4064,7 +4065,7 @@ func setupDiGetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Scope DICS_FLAG, HwProfile uint32, KeyType DIREG, samDesired uint32) (key Handle, err error) { - r0, _, e1 := syscall.Syscall6(procSetupDiOpenDevRegKey.Addr(), 6, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired)) + r0, _, e1 := syscall.SyscallN(procSetupDiOpenDevRegKey.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(Scope), uintptr(HwProfile), uintptr(KeyType), uintptr(samDesired)) key = Handle(r0) if key == InvalidHandle { err = errnoErr(e1) @@ -4073,7 +4074,7 @@ func SetupDiOpenDevRegKey(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, Sc } func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiSetClassInstallParamsW.Addr(), 4, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize), 0, 0) + r1, _, e1 := syscall.SyscallN(procSetupDiSetClassInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(classInstallParams)), uintptr(classInstallParamsSize)) if r1 == 0 { err = errnoErr(e1) } @@ -4081,7 +4082,7 @@ func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfo } func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiSetDeviceInstallParamsW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) + r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceInstallParamsW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(deviceInstallParams))) if r1 == 0 { err = errnoErr(e1) } @@ -4089,7 +4090,7 @@ func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInf } func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, property SPDRP, propertyBuffer *byte, propertyBufferSize uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procSetupDiSetDeviceRegistryPropertyW.Addr(), 5, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiSetDeviceRegistryPropertyW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(property), uintptr(unsafe.Pointer(propertyBuffer)), uintptr(propertyBufferSize)) if r1 == 0 { err = errnoErr(e1) } @@ -4097,7 +4098,7 @@ func setupDiSetDeviceRegistryProperty(deviceInfoSet DevInfo, deviceInfoData *Dev } func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiSetSelectedDevice.Addr(), 2, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), 0) + r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDevice.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4105,7 +4106,7 @@ func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error) { - r1, _, e1 := syscall.Syscall(procSetupDiSetSelectedDriverW.Addr(), 3, uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) + r1, _, e1 := syscall.SyscallN(procSetupDiSetSelectedDriverW.Addr(), uintptr(deviceInfoSet), uintptr(unsafe.Pointer(deviceInfoData)), uintptr(unsafe.Pointer(driverInfoData))) if r1 == 0 { err = errnoErr(e1) } @@ -4113,7 +4114,7 @@ func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData } func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (err error) { - r1, _, e1 := syscall.Syscall(procSetupUninstallOEMInfW.Addr(), 3, uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved)) + r1, _, e1 := syscall.SyscallN(procSetupUninstallOEMInfW.Addr(), uintptr(unsafe.Pointer(infFileName)), uintptr(flags), uintptr(reserved)) if r1 == 0 { err = errnoErr(e1) } @@ -4121,7 +4122,7 @@ func setupUninstallOEMInf(infFileName *uint16, flags SUOI, reserved uintptr) (er } func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) { - r0, _, e1 := syscall.Syscall(procCommandLineToArgvW.Addr(), 2, uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc)), 0) + r0, _, e1 := syscall.SyscallN(procCommandLineToArgvW.Addr(), uintptr(unsafe.Pointer(cmd)), uintptr(unsafe.Pointer(argc))) argv = (**uint16)(unsafe.Pointer(r0)) if argv == nil { err = errnoErr(e1) @@ -4130,7 +4131,7 @@ func commandLineToArgv(cmd *uint16, argc *int32) (argv **uint16, err error) { } func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **uint16) (ret error) { - r0, _, _ := syscall.Syscall6(procSHGetKnownFolderPath.Addr(), 4, uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path)), 0, 0) + r0, _, _ := syscall.SyscallN(procSHGetKnownFolderPath.Addr(), uintptr(unsafe.Pointer(id)), uintptr(flags), uintptr(token), uintptr(unsafe.Pointer(path))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -4138,7 +4139,7 @@ func shGetKnownFolderPath(id *KNOWNFOLDERID, flags uint32, token Token, path **u } func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error) { - r1, _, e1 := syscall.Syscall6(procShellExecuteW.Addr(), 6, uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd)) + r1, _, e1 := syscall.SyscallN(procShellExecuteW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(verb)), uintptr(unsafe.Pointer(file)), uintptr(unsafe.Pointer(args)), uintptr(unsafe.Pointer(cwd)), uintptr(showCmd)) if r1 <= 32 { err = errnoErr(e1) } @@ -4146,12 +4147,12 @@ func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *ui } func EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer) { - syscall.Syscall(procEnumChildWindows.Addr(), 3, uintptr(hwnd), uintptr(enumFunc), uintptr(param)) + syscall.SyscallN(procEnumChildWindows.Addr(), uintptr(hwnd), uintptr(enumFunc), uintptr(param)) return } func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { - r1, _, e1 := syscall.Syscall(procEnumWindows.Addr(), 2, uintptr(enumFunc), uintptr(param), 0) + r1, _, e1 := syscall.SyscallN(procEnumWindows.Addr(), uintptr(enumFunc), uintptr(param)) if r1 == 0 { err = errnoErr(e1) } @@ -4159,7 +4160,7 @@ func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error) { } func ExitWindowsEx(flags uint32, reason uint32) (err error) { - r1, _, e1 := syscall.Syscall(procExitWindowsEx.Addr(), 2, uintptr(flags), uintptr(reason), 0) + r1, _, e1 := syscall.SyscallN(procExitWindowsEx.Addr(), uintptr(flags), uintptr(reason)) if r1 == 0 { err = errnoErr(e1) } @@ -4167,7 +4168,7 @@ func ExitWindowsEx(flags uint32, reason uint32) (err error) { } func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, err error) { - r0, _, e1 := syscall.Syscall(procGetClassNameW.Addr(), 3, uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount)) + r0, _, e1 := syscall.SyscallN(procGetClassNameW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(className)), uintptr(maxCount)) copied = int32(r0) if copied == 0 { err = errnoErr(e1) @@ -4176,19 +4177,19 @@ func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, e } func GetDesktopWindow() (hwnd HWND) { - r0, _, _ := syscall.Syscall(procGetDesktopWindow.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetDesktopWindow.Addr()) hwnd = HWND(r0) return } func GetForegroundWindow() (hwnd HWND) { - r0, _, _ := syscall.Syscall(procGetForegroundWindow.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetForegroundWindow.Addr()) hwnd = HWND(r0) return } func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { - r1, _, e1 := syscall.Syscall(procGetGUIThreadInfo.Addr(), 2, uintptr(thread), uintptr(unsafe.Pointer(info)), 0) + r1, _, e1 := syscall.SyscallN(procGetGUIThreadInfo.Addr(), uintptr(thread), uintptr(unsafe.Pointer(info))) if r1 == 0 { err = errnoErr(e1) } @@ -4196,19 +4197,19 @@ func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error) { } func GetKeyboardLayout(tid uint32) (hkl Handle) { - r0, _, _ := syscall.Syscall(procGetKeyboardLayout.Addr(), 1, uintptr(tid), 0, 0) + r0, _, _ := syscall.SyscallN(procGetKeyboardLayout.Addr(), uintptr(tid)) hkl = Handle(r0) return } func GetShellWindow() (shellWindow HWND) { - r0, _, _ := syscall.Syscall(procGetShellWindow.Addr(), 0, 0, 0, 0) + r0, _, _ := syscall.SyscallN(procGetShellWindow.Addr()) shellWindow = HWND(r0) return } func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetWindowThreadProcessId.Addr(), 2, uintptr(hwnd), uintptr(unsafe.Pointer(pid)), 0) + r0, _, e1 := syscall.SyscallN(procGetWindowThreadProcessId.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(pid))) tid = uint32(r0) if tid == 0 { err = errnoErr(e1) @@ -4217,25 +4218,25 @@ func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error) { } func IsWindow(hwnd HWND) (isWindow bool) { - r0, _, _ := syscall.Syscall(procIsWindow.Addr(), 1, uintptr(hwnd), 0, 0) + r0, _, _ := syscall.SyscallN(procIsWindow.Addr(), uintptr(hwnd)) isWindow = r0 != 0 return } func IsWindowUnicode(hwnd HWND) (isUnicode bool) { - r0, _, _ := syscall.Syscall(procIsWindowUnicode.Addr(), 1, uintptr(hwnd), 0, 0) + r0, _, _ := syscall.SyscallN(procIsWindowUnicode.Addr(), uintptr(hwnd)) isUnicode = r0 != 0 return } func IsWindowVisible(hwnd HWND) (isVisible bool) { - r0, _, _ := syscall.Syscall(procIsWindowVisible.Addr(), 1, uintptr(hwnd), 0, 0) + r0, _, _ := syscall.SyscallN(procIsWindowVisible.Addr(), uintptr(hwnd)) isVisible = r0 != 0 return } func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { - r0, _, e1 := syscall.Syscall(procLoadKeyboardLayoutW.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(flags), 0) + r0, _, e1 := syscall.SyscallN(procLoadKeyboardLayoutW.Addr(), uintptr(unsafe.Pointer(name)), uintptr(flags)) hkl = Handle(r0) if hkl == 0 { err = errnoErr(e1) @@ -4244,7 +4245,7 @@ func LoadKeyboardLayout(name *uint16, flags uint32) (hkl Handle, err error) { } func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error) { - r0, _, e1 := syscall.Syscall6(procMessageBoxW.Addr(), 4, uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype), 0, 0) + r0, _, e1 := syscall.SyscallN(procMessageBoxW.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(text)), uintptr(unsafe.Pointer(caption)), uintptr(boxtype)) ret = int32(r0) if ret == 0 { err = errnoErr(e1) @@ -4253,13 +4254,13 @@ func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret i } func ToUnicodeEx(vkey uint32, scancode uint32, keystate *byte, pwszBuff *uint16, cchBuff int32, flags uint32, hkl Handle) (ret int32) { - r0, _, _ := syscall.Syscall9(procToUnicodeEx.Addr(), 7, uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl), 0, 0) + r0, _, _ := syscall.SyscallN(procToUnicodeEx.Addr(), uintptr(vkey), uintptr(scancode), uintptr(unsafe.Pointer(keystate)), uintptr(unsafe.Pointer(pwszBuff)), uintptr(cchBuff), uintptr(flags), uintptr(hkl)) ret = int32(r0) return } func UnloadKeyboardLayout(hkl Handle) (err error) { - r1, _, e1 := syscall.Syscall(procUnloadKeyboardLayout.Addr(), 1, uintptr(hkl), 0, 0) + r1, _, e1 := syscall.SyscallN(procUnloadKeyboardLayout.Addr(), uintptr(hkl)) if r1 == 0 { err = errnoErr(e1) } @@ -4271,7 +4272,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) ( if inheritExisting { _p0 = 1 } - r1, _, e1 := syscall.Syscall(procCreateEnvironmentBlock.Addr(), 3, uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) + r1, _, e1 := syscall.SyscallN(procCreateEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block)), uintptr(token), uintptr(_p0)) if r1 == 0 { err = errnoErr(e1) } @@ -4279,7 +4280,7 @@ func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) ( } func DestroyEnvironmentBlock(block *uint16) (err error) { - r1, _, e1 := syscall.Syscall(procDestroyEnvironmentBlock.Addr(), 1, uintptr(unsafe.Pointer(block)), 0, 0) + r1, _, e1 := syscall.SyscallN(procDestroyEnvironmentBlock.Addr(), uintptr(unsafe.Pointer(block))) if r1 == 0 { err = errnoErr(e1) } @@ -4287,7 +4288,7 @@ func DestroyEnvironmentBlock(block *uint16) (err error) { } func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) { - r1, _, e1 := syscall.Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) + r1, _, e1 := syscall.SyscallN(procGetUserProfileDirectoryW.Addr(), uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen))) if r1 == 0 { err = errnoErr(e1) } @@ -4304,7 +4305,7 @@ func GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32 } func _GetFileVersionInfoSize(filename *uint16, zeroHandle *Handle) (bufSize uint32, err error) { - r0, _, e1 := syscall.Syscall(procGetFileVersionInfoSizeW.Addr(), 2, uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle)), 0) + r0, _, e1 := syscall.SyscallN(procGetFileVersionInfoSizeW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(unsafe.Pointer(zeroHandle))) bufSize = uint32(r0) if bufSize == 0 { err = errnoErr(e1) @@ -4322,7 +4323,7 @@ func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer u } func _GetFileVersionInfo(filename *uint16, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error) { - r1, _, e1 := syscall.Syscall6(procGetFileVersionInfoW.Addr(), 4, uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer), 0, 0) + r1, _, e1 := syscall.SyscallN(procGetFileVersionInfoW.Addr(), uintptr(unsafe.Pointer(filename)), uintptr(handle), uintptr(bufSize), uintptr(buffer)) if r1 == 0 { err = errnoErr(e1) } @@ -4339,7 +4340,7 @@ func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer } func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procVerQueryValueW.Addr(), 4, uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize)), 0, 0) + r1, _, e1 := syscall.SyscallN(procVerQueryValueW.Addr(), uintptr(block), uintptr(unsafe.Pointer(subBlock)), uintptr(pointerToBufferPointer), uintptr(unsafe.Pointer(bufSize))) if r1 == 0 { err = errnoErr(e1) } @@ -4347,7 +4348,7 @@ func _VerQueryValue(block unsafe.Pointer, subBlock *uint16, pointerToBufferPoint } func TimeBeginPeriod(period uint32) (err error) { - r1, _, e1 := syscall.Syscall(proctimeBeginPeriod.Addr(), 1, uintptr(period), 0, 0) + r1, _, e1 := syscall.SyscallN(proctimeBeginPeriod.Addr(), uintptr(period)) if r1 != 0 { err = errnoErr(e1) } @@ -4355,7 +4356,7 @@ func TimeBeginPeriod(period uint32) (err error) { } func TimeEndPeriod(period uint32) (err error) { - r1, _, e1 := syscall.Syscall(proctimeEndPeriod.Addr(), 1, uintptr(period), 0, 0) + r1, _, e1 := syscall.SyscallN(proctimeEndPeriod.Addr(), uintptr(period)) if r1 != 0 { err = errnoErr(e1) } @@ -4363,7 +4364,7 @@ func TimeEndPeriod(period uint32) (err error) { } func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) { - r0, _, _ := syscall.Syscall(procWinVerifyTrustEx.Addr(), 3, uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) + r0, _, _ := syscall.SyscallN(procWinVerifyTrustEx.Addr(), uintptr(hwnd), uintptr(unsafe.Pointer(actionId)), uintptr(unsafe.Pointer(data))) if r0 != 0 { ret = syscall.Errno(r0) } @@ -4371,12 +4372,12 @@ func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error) } func FreeAddrInfoW(addrinfo *AddrinfoW) { - syscall.Syscall(procFreeAddrInfoW.Addr(), 1, uintptr(unsafe.Pointer(addrinfo)), 0, 0) + syscall.SyscallN(procFreeAddrInfoW.Addr(), uintptr(unsafe.Pointer(addrinfo))) return } func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error) { - r0, _, _ := syscall.Syscall6(procGetAddrInfoW.Addr(), 4, uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result)), 0, 0) + r0, _, _ := syscall.SyscallN(procGetAddrInfoW.Addr(), uintptr(unsafe.Pointer(nodename)), uintptr(unsafe.Pointer(servicename)), uintptr(unsafe.Pointer(hints)), uintptr(unsafe.Pointer(result))) if r0 != 0 { sockerr = syscall.Errno(r0) } @@ -4384,15 +4385,23 @@ func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, resul } func WSACleanup() (err error) { - r1, _, e1 := syscall.Syscall(procWSACleanup.Addr(), 0, 0, 0, 0) + r1, _, e1 := syscall.SyscallN(procWSACleanup.Addr()) if r1 == socket_error { err = errnoErr(e1) } return } +func WSADuplicateSocket(s Handle, processID uint32, info *WSAProtocolInfo) (err error) { + r1, _, e1 := syscall.SyscallN(procWSADuplicateSocketW.Addr(), uintptr(s), uintptr(processID), uintptr(unsafe.Pointer(info))) + if r1 != 0 { + err = errnoErr(e1) + } + return +} + func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error) { - r0, _, e1 := syscall.Syscall(procWSAEnumProtocolsW.Addr(), 3, uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength))) + r0, _, e1 := syscall.SyscallN(procWSAEnumProtocolsW.Addr(), uintptr(unsafe.Pointer(protocols)), uintptr(unsafe.Pointer(protocolBuffer)), uintptr(unsafe.Pointer(bufferLength))) n = int32(r0) if n == -1 { err = errnoErr(e1) @@ -4405,7 +4414,7 @@ func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, f if wait { _p0 = 1 } - r1, _, e1 := syscall.Syscall6(procWSAGetOverlappedResult.Addr(), 5, uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags)), 0) + r1, _, e1 := syscall.SyscallN(procWSAGetOverlappedResult.Addr(), uintptr(h), uintptr(unsafe.Pointer(o)), uintptr(unsafe.Pointer(bytes)), uintptr(_p0), uintptr(unsafe.Pointer(flags))) if r1 == 0 { err = errnoErr(e1) } @@ -4413,7 +4422,7 @@ func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, f } func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error) { - r1, _, e1 := syscall.Syscall9(procWSAIoctl.Addr(), 9, uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) + r1, _, e1 := syscall.SyscallN(procWSAIoctl.Addr(), uintptr(s), uintptr(iocc), uintptr(unsafe.Pointer(inbuf)), uintptr(cbif), uintptr(unsafe.Pointer(outbuf)), uintptr(cbob), uintptr(unsafe.Pointer(cbbr)), uintptr(unsafe.Pointer(overlapped)), uintptr(completionRoutine)) if r1 == socket_error { err = errnoErr(e1) } @@ -4421,7 +4430,7 @@ func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbo } func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) (err error) { - r1, _, e1 := syscall.Syscall(procWSALookupServiceBeginW.Addr(), 3, uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle))) + r1, _, e1 := syscall.SyscallN(procWSALookupServiceBeginW.Addr(), uintptr(unsafe.Pointer(querySet)), uintptr(flags), uintptr(unsafe.Pointer(handle))) if r1 == socket_error { err = errnoErr(e1) } @@ -4429,7 +4438,7 @@ func WSALookupServiceBegin(querySet *WSAQUERYSET, flags uint32, handle *Handle) } func WSALookupServiceEnd(handle Handle) (err error) { - r1, _, e1 := syscall.Syscall(procWSALookupServiceEnd.Addr(), 1, uintptr(handle), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSALookupServiceEnd.Addr(), uintptr(handle)) if r1 == socket_error { err = errnoErr(e1) } @@ -4437,7 +4446,7 @@ func WSALookupServiceEnd(handle Handle) (err error) { } func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WSAQUERYSET) (err error) { - r1, _, e1 := syscall.Syscall6(procWSALookupServiceNextW.Addr(), 4, uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet)), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSALookupServiceNextW.Addr(), uintptr(handle), uintptr(flags), uintptr(unsafe.Pointer(size)), uintptr(unsafe.Pointer(querySet))) if r1 == socket_error { err = errnoErr(e1) } @@ -4445,7 +4454,7 @@ func WSALookupServiceNext(handle Handle, flags uint32, size *int32, querySet *WS } func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSARecv.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSARecv.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4453,7 +4462,7 @@ func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32 } func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSARecvFrom.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) + r1, _, e1 := syscall.SyscallN(procWSARecvFrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(recvd)), uintptr(unsafe.Pointer(flags)), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4461,7 +4470,7 @@ func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *ui } func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSASend.Addr(), 7, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine)), 0, 0) + r1, _, e1 := syscall.SyscallN(procWSASend.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4469,7 +4478,7 @@ func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, } func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error) { - r1, _, e1 := syscall.Syscall9(procWSASendTo.Addr(), 9, uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) + r1, _, e1 := syscall.SyscallN(procWSASendTo.Addr(), uintptr(s), uintptr(unsafe.Pointer(bufs)), uintptr(bufcnt), uintptr(unsafe.Pointer(sent)), uintptr(flags), uintptr(unsafe.Pointer(to)), uintptr(tolen), uintptr(unsafe.Pointer(overlapped)), uintptr(unsafe.Pointer(croutine))) if r1 == socket_error { err = errnoErr(e1) } @@ -4477,7 +4486,7 @@ func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32 } func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, group uint32, flags uint32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall6(procWSASocketW.Addr(), 6, uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags)) + r0, _, e1 := syscall.SyscallN(procWSASocketW.Addr(), uintptr(af), uintptr(typ), uintptr(protocol), uintptr(unsafe.Pointer(protoInfo)), uintptr(group), uintptr(flags)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -4486,7 +4495,7 @@ func WSASocket(af int32, typ int32, protocol int32, protoInfo *WSAProtocolInfo, } func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { - r0, _, _ := syscall.Syscall(procWSAStartup.Addr(), 2, uintptr(verreq), uintptr(unsafe.Pointer(data)), 0) + r0, _, _ := syscall.SyscallN(procWSAStartup.Addr(), uintptr(verreq), uintptr(unsafe.Pointer(data))) if r0 != 0 { sockerr = syscall.Errno(r0) } @@ -4494,7 +4503,7 @@ func WSAStartup(verreq uint32, data *WSAData) (sockerr error) { } func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procbind.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) + r1, _, e1 := syscall.SyscallN(procbind.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4502,7 +4511,7 @@ func bind(s Handle, name unsafe.Pointer, namelen int32) (err error) { } func Closesocket(s Handle) (err error) { - r1, _, e1 := syscall.Syscall(procclosesocket.Addr(), 1, uintptr(s), 0, 0) + r1, _, e1 := syscall.SyscallN(procclosesocket.Addr(), uintptr(s)) if r1 == socket_error { err = errnoErr(e1) } @@ -4510,7 +4519,7 @@ func Closesocket(s Handle) (err error) { } func connect(s Handle, name unsafe.Pointer, namelen int32) (err error) { - r1, _, e1 := syscall.Syscall(procconnect.Addr(), 3, uintptr(s), uintptr(name), uintptr(namelen)) + r1, _, e1 := syscall.SyscallN(procconnect.Addr(), uintptr(s), uintptr(name), uintptr(namelen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4527,7 +4536,7 @@ func GetHostByName(name string) (h *Hostent, err error) { } func _GetHostByName(name *byte) (h *Hostent, err error) { - r0, _, e1 := syscall.Syscall(procgethostbyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procgethostbyname.Addr(), uintptr(unsafe.Pointer(name))) h = (*Hostent)(unsafe.Pointer(r0)) if h == nil { err = errnoErr(e1) @@ -4536,7 +4545,7 @@ func _GetHostByName(name *byte) (h *Hostent, err error) { } func getpeername(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetpeername.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r1, _, e1 := syscall.SyscallN(procgetpeername.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if r1 == socket_error { err = errnoErr(e1) } @@ -4553,7 +4562,7 @@ func GetProtoByName(name string) (p *Protoent, err error) { } func _GetProtoByName(name *byte) (p *Protoent, err error) { - r0, _, e1 := syscall.Syscall(procgetprotobyname.Addr(), 1, uintptr(unsafe.Pointer(name)), 0, 0) + r0, _, e1 := syscall.SyscallN(procgetprotobyname.Addr(), uintptr(unsafe.Pointer(name))) p = (*Protoent)(unsafe.Pointer(r0)) if p == nil { err = errnoErr(e1) @@ -4576,7 +4585,7 @@ func GetServByName(name string, proto string) (s *Servent, err error) { } func _GetServByName(name *byte, proto *byte) (s *Servent, err error) { - r0, _, e1 := syscall.Syscall(procgetservbyname.Addr(), 2, uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto)), 0) + r0, _, e1 := syscall.SyscallN(procgetservbyname.Addr(), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(proto))) s = (*Servent)(unsafe.Pointer(r0)) if s == nil { err = errnoErr(e1) @@ -4585,7 +4594,7 @@ func _GetServByName(name *byte, proto *byte) (s *Servent, err error) { } func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { - r1, _, e1 := syscall.Syscall(procgetsockname.Addr(), 3, uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) + r1, _, e1 := syscall.SyscallN(procgetsockname.Addr(), uintptr(s), uintptr(unsafe.Pointer(rsa)), uintptr(unsafe.Pointer(addrlen))) if r1 == socket_error { err = errnoErr(e1) } @@ -4593,7 +4602,7 @@ func getsockname(s Handle, rsa *RawSockaddrAny, addrlen *int32) (err error) { } func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error) { - r1, _, e1 := syscall.Syscall6(procgetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen)), 0) + r1, _, e1 := syscall.SyscallN(procgetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(unsafe.Pointer(optlen))) if r1 == socket_error { err = errnoErr(e1) } @@ -4601,7 +4610,7 @@ func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int3 } func listen(s Handle, backlog int32) (err error) { - r1, _, e1 := syscall.Syscall(proclisten.Addr(), 2, uintptr(s), uintptr(backlog), 0) + r1, _, e1 := syscall.SyscallN(proclisten.Addr(), uintptr(s), uintptr(backlog)) if r1 == socket_error { err = errnoErr(e1) } @@ -4609,7 +4618,7 @@ func listen(s Handle, backlog int32) (err error) { } func Ntohs(netshort uint16) (u uint16) { - r0, _, _ := syscall.Syscall(procntohs.Addr(), 1, uintptr(netshort), 0, 0) + r0, _, _ := syscall.SyscallN(procntohs.Addr(), uintptr(netshort)) u = uint16(r0) return } @@ -4619,7 +4628,7 @@ func recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen * if len(buf) > 0 { _p0 = &buf[0] } - r0, _, e1 := syscall.Syscall6(procrecvfrom.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) + r0, _, e1 := syscall.SyscallN(procrecvfrom.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen))) n = int32(r0) if n == -1 { err = errnoErr(e1) @@ -4632,7 +4641,7 @@ func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) ( if len(buf) > 0 { _p0 = &buf[0] } - r1, _, e1 := syscall.Syscall6(procsendto.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen)) + r1, _, e1 := syscall.SyscallN(procsendto.Addr(), uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4640,7 +4649,7 @@ func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) ( } func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) { - r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0) + r1, _, e1 := syscall.SyscallN(procsetsockopt.Addr(), uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen)) if r1 == socket_error { err = errnoErr(e1) } @@ -4648,7 +4657,7 @@ func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32 } func shutdown(s Handle, how int32) (err error) { - r1, _, e1 := syscall.Syscall(procshutdown.Addr(), 2, uintptr(s), uintptr(how), 0) + r1, _, e1 := syscall.SyscallN(procshutdown.Addr(), uintptr(s), uintptr(how)) if r1 == socket_error { err = errnoErr(e1) } @@ -4656,7 +4665,7 @@ func shutdown(s Handle, how int32) (err error) { } func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { - r0, _, e1 := syscall.Syscall(procsocket.Addr(), 3, uintptr(af), uintptr(typ), uintptr(protocol)) + r0, _, e1 := syscall.SyscallN(procsocket.Addr(), uintptr(af), uintptr(typ), uintptr(protocol)) handle = Handle(r0) if handle == InvalidHandle { err = errnoErr(e1) @@ -4665,7 +4674,7 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, err error) { } func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error) { - r1, _, e1 := syscall.Syscall6(procWTSEnumerateSessionsW.Addr(), 5, uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count)), 0) + r1, _, e1 := syscall.SyscallN(procWTSEnumerateSessionsW.Addr(), uintptr(handle), uintptr(reserved), uintptr(version), uintptr(unsafe.Pointer(sessions)), uintptr(unsafe.Pointer(count))) if r1 == 0 { err = errnoErr(e1) } @@ -4673,12 +4682,12 @@ func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessio } func WTSFreeMemory(ptr uintptr) { - syscall.Syscall(procWTSFreeMemory.Addr(), 1, uintptr(ptr), 0, 0) + syscall.SyscallN(procWTSFreeMemory.Addr(), uintptr(ptr)) return } func WTSQueryUserToken(session uint32, token *Token) (err error) { - r1, _, e1 := syscall.Syscall(procWTSQueryUserToken.Addr(), 2, uintptr(session), uintptr(unsafe.Pointer(token)), 0) + r1, _, e1 := syscall.SyscallN(procWTSQueryUserToken.Addr(), uintptr(session), uintptr(unsafe.Pointer(token))) if r1 == 0 { err = errnoErr(e1) } diff --git a/vendor/modernc.org/libc/AUTHORS b/vendor/modernc.org/libc/AUTHORS index 16be80a..5d443d9 100644 --- a/vendor/modernc.org/libc/AUTHORS +++ b/vendor/modernc.org/libc/AUTHORS @@ -13,6 +13,7 @@ Dan Peterson Fabrice Colliot Jan Mercl <0xjnml@gmail.com> Jason DeBettencourt +Jasper Siepkes Koichi Shiraishi Marius Orcsik Patricio Whittingslow diff --git a/vendor/modernc.org/libc/CONTRIBUTORS b/vendor/modernc.org/libc/CONTRIBUTORS index ae506d9..c25a262 100644 --- a/vendor/modernc.org/libc/CONTRIBUTORS +++ b/vendor/modernc.org/libc/CONTRIBUTORS @@ -13,9 +13,11 @@ Fabrice Colliot Jaap Aarts Jan Mercl <0xjnml@gmail.com> Jason DeBettencourt +Jasper Siepkes Koichi Shiraishi Marius Orcsik Patricio Whittingslow +Roman Khafizianov Scot C Bontrager Steffen Butzer W. Michael Petullo diff --git a/vendor/modernc.org/libc/Makefile b/vendor/modernc.org/libc/Makefile index a2ff9da..507d4ef 100644 --- a/vendor/modernc.org/libc/Makefile +++ b/vendor/modernc.org/libc/Makefile @@ -2,7 +2,7 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. -.PHONY: all build_all_targets check clean download edit editor generate dev membrk-test test work xtest short-test xlibc libc-test surface +.PHONY: all build_all_targets check clean download edit editor generate dev membrk-test test work xtest short-test xlibc libc-test surface vet SHELL=/bin/bash -o pipefail @@ -14,7 +14,7 @@ all: editor golint 2>&1 staticcheck 2>&1 -build_all_targets: +build_all_targets: vet ./build_all_targets.sh echo done @@ -32,13 +32,13 @@ download: @if [ ! -f $(TAR) ]; then wget $(URL) ; fi edit: - @if [ -f "Session.vim" ]; then novim -S & else novim -p Makefile go.mod builder.json & fi + @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile go.mod builder.json & fi editor: - gofmt -l -s -w *.go + # gofmt -l -s -w *.go go test -c -o /dev/null - go install -v - go build -o /dev/null generator*.go + go build -o /dev/null -v generator*.go + go vet 2>&1 | grep -n 'asm_' || true generate: download mkdir -p $(DIR) || true @@ -114,3 +114,6 @@ work: surface: surface > surface.new surface surface.old surface.new > log-todo-surface || true + +vet: + go vet 2>&1 | grep abi0 | grep -v 'misuse' || true diff --git a/vendor/modernc.org/libc/README.md b/vendor/modernc.org/libc/README.md index f2e9f31..9908cb4 100644 --- a/vendor/modernc.org/libc/README.md +++ b/vendor/modernc.org/libc/README.md @@ -1,20 +1,9 @@ # libc -Package libc provides C-runtime services. Work in progress. +[![LiberaPay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/jnml/donate) +[![receives](https://img.shields.io/liberapay/receives/jnml.svg?logo=liberapay)](https://liberapay.com/jnml/donate) +[![patrons](https://img.shields.io/liberapay/patrons/jnml.svg?logo=liberapay)](https://liberapay.com/jnml/donate) -This package is a continuation of the Crt package in modernc.org/crt/v3. +[![Go Reference](https://pkg.go.dev/badge/modernc.org/libc.svg)](https://pkg.go.dev/modernc.org/libc) -Installation - - $ go get [-u] modernc.org/libc - -Documentation: [godoc.org/modernc.org/libc](http://godoc.org/modernc.org/libc) - -Building with `make` requires the following Go packages - -* github.com/golang/lint/golint -* github.com/mdempsky/maligned -* github.com/mdempsky/unconvert -* honnef.co/go/tools/cmd/unused -* honnef.co/go/tools/cmd/gosimple -* github.com/client9/misspell/cmd/misspell +Package libc is a partial reimplementation of C libc in pure Go. diff --git a/vendor/modernc.org/libc/abi0_linux_amd64.go b/vendor/modernc.org/libc/abi0_linux_amd64.go new file mode 100644 index 0000000..3792248 --- /dev/null +++ b/vendor/modernc.org/libc/abi0_linux_amd64.go @@ -0,0 +1,5762 @@ +// Code generated for linux/amd64 by 'qbecc --abi0wrap .', DO NOT EDIT. + +package libc + +import "unsafe" + +var _ unsafe.Pointer + +//go:noescape +func Y_Exit(tls *TLS, ec int32) + +//go:noescape +func Y_IO_feof_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y_IO_ferror_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y_IO_getc(tls *TLS, f1 uintptr) (r int32) + +//go:noescape +func Y_IO_getc_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y_IO_putc(tls *TLS, c1 int32, f1 uintptr) (r int32) + +//go:noescape +func Y_IO_putc_unlocked(tls *TLS, c int32, f uintptr) (r int32) + +//go:noescape +func Y___errno_location(tls *TLS) (r uintptr) + +//go:noescape +func Y__aio_close(tls *TLS, fd int32) (_2 int32) + +//go:noescape +func Y__asctime_r(tls *TLS, tm uintptr, buf uintptr) (r uintptr) + +//go:noescape +func Y__assert_fail(tls *TLS, expr uintptr, file uintptr, line int32, func1 uintptr) + +//go:noescape +func Y__atomic_compare_exchangeInt16(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_compare_exchangeInt32(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_compare_exchangeInt64(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_compare_exchangeInt8(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_compare_exchangeUint16(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_compare_exchangeUint32(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_compare_exchangeUint64(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_compare_exchangeUint8(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) + +//go:noescape +func Y__atomic_exchangeInt16(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_exchangeInt32(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_exchangeInt64(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_exchangeInt8(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_exchangeUint16(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_exchangeUint32(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_exchangeUint64(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_exchangeUint8(t *TLS, ptr, val, ret uintptr, _ int32) + +//go:noescape +func Y__atomic_fetch_addInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__atomic_fetch_addInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__atomic_fetch_addInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__atomic_fetch_addInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__atomic_fetch_addUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__atomic_fetch_addUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__atomic_fetch_addUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__atomic_fetch_addUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__atomic_fetch_andInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__atomic_fetch_andInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__atomic_fetch_andInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__atomic_fetch_andInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__atomic_fetch_andUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__atomic_fetch_andUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__atomic_fetch_andUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__atomic_fetch_andUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__atomic_fetch_orInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__atomic_fetch_orInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__atomic_fetch_orInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__atomic_fetch_orInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__atomic_fetch_orUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__atomic_fetch_orUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__atomic_fetch_orUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__atomic_fetch_orUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__atomic_fetch_subInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__atomic_fetch_subInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__atomic_fetch_subInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__atomic_fetch_subInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__atomic_fetch_subUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__atomic_fetch_subUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__atomic_fetch_subUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__atomic_fetch_subUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__atomic_fetch_xorInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__atomic_fetch_xorInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__atomic_fetch_xorInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__atomic_fetch_xorInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__atomic_fetch_xorUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__atomic_fetch_xorUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__atomic_fetch_xorUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__atomic_fetch_xorUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__atomic_loadInt16(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_loadInt32(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_loadInt64(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_loadInt8(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_loadUint16(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_loadUint32(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_loadUint64(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_loadUint8(t *TLS, ptr, ret uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeInt16(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeInt32(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeInt64(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeInt8(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeUint16(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeUint32(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeUint64(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__atomic_storeUint8(t *TLS, ptr, val uintptr, memorder int32) + +//go:noescape +func Y__block_all_sigs(tls *TLS, set uintptr) + +//go:noescape +func Y__block_app_sigs(tls *TLS, set uintptr) + +//go:noescape +func Y__builtin___memcpy_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (r uintptr) + +//go:noescape +func Y__builtin___memmove_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (_3 uintptr) + +//go:noescape +func Y__builtin___memset_chk(t *TLS, s uintptr, c int32, n, os Tsize_t) (_4 uintptr) + +//go:noescape +func Y__builtin___snprintf_chk(t *TLS, str uintptr, maxlen Tsize_t, flag int32, os Tsize_t, format, args uintptr) (r int32) + +//go:noescape +func Y__builtin___sprintf_chk(t *TLS, s uintptr, flag int32, os Tsize_t, format, args uintptr) (r int32) + +//go:noescape +func Y__builtin___strcat_chk(t *TLS, dest, src uintptr, os Tsize_t) (r uintptr) + +//go:noescape +func Y__builtin___strcpy_chk(t *TLS, dest, src uintptr, os Tsize_t) (_3 uintptr) + +//go:noescape +func Y__builtin___strncpy_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (r uintptr) + +//go:noescape +func Y__builtin___vsnprintf_chk(t *TLS, str uintptr, maxlen Tsize_t, flag int32, os Tsize_t, format, args uintptr) (r int32) + +//go:noescape +func Y__builtin_abort(t *TLS) + +//go:noescape +func Y__builtin_abs(t *TLS, j int32) (_2 int32) + +//go:noescape +func Y__builtin_add_overflowInt64(t *TLS, a, b int64, res uintptr) (_3 int32) + +//go:noescape +func Y__builtin_add_overflowUint32(t *TLS, a, b uint32, res uintptr) (_3 int32) + +//go:noescape +func Y__builtin_add_overflowUint64(t *TLS, a, b uint64, res uintptr) (_3 int32) + +//go:noescape +func Y__builtin_alloca(tls *TLS, size Tsize_t) (_2 uintptr) + +//go:noescape +func Y__builtin_bswap16(t *TLS, x uint16) (_2 uint16) + +//go:noescape +func Y__builtin_bswap32(t *TLS, x uint32) (_2 uint32) + +//go:noescape +func Y__builtin_bswap64(t *TLS, x uint64) (_2 uint64) + +//go:noescape +func Y__builtin_bzero(t *TLS, s uintptr, n Tsize_t) + +//go:noescape +func Y__builtin_clz(t *TLS, n uint32) (_2 int32) + +//go:noescape +func Y__builtin_clzl(t *TLS, n ulong) (_2 int32) + +//go:noescape +func Y__builtin_clzll(t *TLS, n uint64) (_2 int32) + +//go:noescape +func Y__builtin_copysign(t *TLS, x, y float64) (_2 float64) + +//go:noescape +func Y__builtin_copysignf(t *TLS, x, y float32) (_2 float32) + +//go:noescape +func Y__builtin_copysignl(t *TLS, x, y float64) (_2 float64) + +//go:noescape +func Y__builtin_ctz(t *TLS, n uint32) (_2 int32) + +//go:noescape +func Y__builtin_ctzl(tls *TLS, x ulong) (_2 int32) + +//go:noescape +func Y__builtin_exit(t *TLS, status int32) + +//go:noescape +func Y__builtin_expect(t *TLS, exp, c long) (_2 long) + +//go:noescape +func Y__builtin_fabs(t *TLS, x float64) (_2 float64) + +//go:noescape +func Y__builtin_fabsf(t *TLS, x float32) (_2 float32) + +//go:noescape +func Y__builtin_fabsl(t *TLS, x float64) (_2 float64) + +//go:noescape +func Y__builtin_ffs(tls *TLS, i int32) (r int32) + +//go:noescape +func Y__builtin_fma(tls *TLS, x, y, z float64) (r float64) + +//go:noescape +func Y__builtin_fmax(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Y__builtin_fmin(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Y__builtin_free(t *TLS, ptr uintptr) + +//go:noescape +func Y__builtin_getentropy(t *TLS, buf uintptr, n Tsize_t) (_3 int32) + +//go:noescape +func Y__builtin_huge_val(t *TLS) (_1 float64) + +//go:noescape +func Y__builtin_huge_valf(t *TLS) (_1 float32) + +//go:noescape +func Y__builtin_hypot(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Y__builtin_inf(t *TLS) (_1 float64) + +//go:noescape +func Y__builtin_inff(tls *TLS) (_1 float32) + +//go:noescape +func Y__builtin_infl(t *TLS) (_1 float64) + +//go:noescape +func Y__builtin_isblank(tls *TLS, c int32) (r int32) + +//go:noescape +func Y__builtin_isnan(t *TLS, x float64) (_2 int32) + +//go:noescape +func Y__builtin_isnanf(t *TLS, x float32) (_2 int32) + +//go:noescape +func Y__builtin_isnanl(t *TLS, x float64) (_2 int32) + +//go:noescape +func Y__builtin_isprint(tls *TLS, c int32) (r int32) + +//go:noescape +func Y__builtin_isunordered(t *TLS, a, b float64) (_2 int32) + +//go:noescape +func Y__builtin_llabs(tls *TLS, a int64) (_2 int64) + +//go:noescape +func Y__builtin_log2(t *TLS, x float64) (_2 float64) + +//go:noescape +func Y__builtin_lrint(tls *TLS, x float64) (r long) + +//go:noescape +func Y__builtin_lrintf(tls *TLS, x float32) (r long) + +//go:noescape +func Y__builtin_lround(tls *TLS, x float64) (r long) + +//go:noescape +func Y__builtin_malloc(t *TLS, size Tsize_t) (_2 uintptr) + +//go:noescape +func Y__builtin_memcmp(t *TLS, s1, s2 uintptr, n Tsize_t) (_3 int32) + +//go:noescape +func Y__builtin_memcpy(t *TLS, dest, src uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Y__builtin_memset(t *TLS, s uintptr, c int32, n Tsize_t) (_4 uintptr) + +//go:noescape +func Y__builtin_mmap(t *TLS, addr uintptr, length Tsize_t, prot, flags, fd int32, offset Toff_t) (_5 uintptr) + +//go:noescape +func Y__builtin_mul_overflowInt64(t *TLS, a, b int64, res uintptr) (_3 int32) + +//go:noescape +func Y__builtin_mul_overflowUint128(t *TLS, a, b Uint128, res uintptr) (_3 int32) + +//go:noescape +func Y__builtin_mul_overflowUint64(t *TLS, a, b uint64, res uintptr) (_3 int32) + +//go:noescape +func Y__builtin_nan(t *TLS, s uintptr) (_2 float64) + +//go:noescape +func Y__builtin_nanf(tls *TLS, s uintptr) (_2 float32) + +//go:noescape +func Y__builtin_nanl(t *TLS, s uintptr) (_2 float64) + +//go:noescape +func Y__builtin_object_size(t *TLS, p uintptr, typ int32) (_3 Tsize_t) + +//go:noescape +func Y__builtin_popcount(t *TLS, x uint32) (_2 int32) + +//go:noescape +func Y__builtin_popcountl(t *TLS, x ulong) (_2 int32) + +//go:noescape +func Y__builtin_prefetch(t *TLS, addr, args uintptr) + +//go:noescape +func Y__builtin_printf(tls *TLS, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Y__builtin_rintf(tls *TLS, x float32) (r float32) + +//go:noescape +func Y__builtin_round(tls *TLS, x float64) (r float64) + +//go:noescape +func Y__builtin_roundf(tls *TLS, x float32) (r float32) + +//go:noescape +func Y__builtin_snprintf(t *TLS, str uintptr, size Tsize_t, format, args uintptr) (_4 int32) + +//go:noescape +func Y__builtin_sprintf(t *TLS, str, format, args uintptr) (r int32) + +//go:noescape +func Y__builtin_strchr(t *TLS, s uintptr, c int32) (_3 uintptr) + +//go:noescape +func Y__builtin_strcmp(t *TLS, s1, s2 uintptr) (_2 int32) + +//go:noescape +func Y__builtin_strcpy(t *TLS, dest, src uintptr) (_2 uintptr) + +//go:noescape +func Y__builtin_strlen(t *TLS, s uintptr) (_2 Tsize_t) + +//go:noescape +func Y__builtin_sub_overflowInt64(t *TLS, a, b int64, res uintptr) (_3 int32) + +//go:noescape +func Y__builtin_trap(t *TLS) + +//go:noescape +func Y__builtin_trunc(tls *TLS, x float64) (r float64) + +//go:noescape +func Y__builtin_unreachable(t *TLS) + +//go:noescape +func Y__builtin_vsnprintf(t *TLS, str uintptr, size Tsize_t, format, va uintptr) (_4 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongInt16(t *TLS, ptr, expected uintptr, desired int16, success, failure int32) (_4 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongInt32(t *TLS, ptr, expected uintptr, desired, success, failure int32) (_3 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongInt64(t *TLS, ptr, expected uintptr, desired int64, success, failure int32) (_4 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongInt8(t *TLS, ptr, expected uintptr, desired int8, success, failure int32) (_4 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongUint16(t *TLS, ptr, expected uintptr, desired uint16, success, failure int32) (_4 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongUint32(t *TLS, ptr, expected uintptr, desired uint32, success, failure int32) (_4 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongUint64(t *TLS, ptr, expected uintptr, desired uint64, success, failure int32) (_4 int32) + +//go:noescape +func Y__c11_atomic_compare_exchange_strongUint8(t *TLS, ptr, expected uintptr, desired uint8, success, failure int32) (_4 int32) + +//go:noescape +func Y__c11_atomic_exchangeInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__c11_atomic_exchangeInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__c11_atomic_exchangeInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__c11_atomic_exchangeInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__c11_atomic_exchangeUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__c11_atomic_exchangeUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__c11_atomic_exchangeUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__c11_atomic_exchangeUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__c11_atomic_fetch_addInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__c11_atomic_fetch_addInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__c11_atomic_fetch_addInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__c11_atomic_fetch_addInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__c11_atomic_fetch_addUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__c11_atomic_fetch_addUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__c11_atomic_fetch_addUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__c11_atomic_fetch_addUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__c11_atomic_fetch_andInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__c11_atomic_fetch_andInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__c11_atomic_fetch_andInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__c11_atomic_fetch_andInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__c11_atomic_fetch_andUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__c11_atomic_fetch_andUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__c11_atomic_fetch_andUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__c11_atomic_fetch_andUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__c11_atomic_fetch_orInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__c11_atomic_fetch_orInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__c11_atomic_fetch_orInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__c11_atomic_fetch_orInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__c11_atomic_fetch_orUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__c11_atomic_fetch_orUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__c11_atomic_fetch_orUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__c11_atomic_fetch_orUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__c11_atomic_fetch_subInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__c11_atomic_fetch_subInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__c11_atomic_fetch_subInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__c11_atomic_fetch_subInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__c11_atomic_fetch_subUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__c11_atomic_fetch_subUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__c11_atomic_fetch_subUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__c11_atomic_fetch_subUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__c11_atomic_fetch_xorInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) + +//go:noescape +func Y__c11_atomic_fetch_xorInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) + +//go:noescape +func Y__c11_atomic_fetch_xorInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) + +//go:noescape +func Y__c11_atomic_fetch_xorInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) + +//go:noescape +func Y__c11_atomic_fetch_xorUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) + +//go:noescape +func Y__c11_atomic_fetch_xorUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) + +//go:noescape +func Y__c11_atomic_fetch_xorUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) + +//go:noescape +func Y__c11_atomic_fetch_xorUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) + +//go:noescape +func Y__c11_atomic_loadInt16(t *TLS, ptr uintptr, memorder int32) (r int16) + +//go:noescape +func Y__c11_atomic_loadInt32(t *TLS, ptr uintptr, memorder int32) (r int32) + +//go:noescape +func Y__c11_atomic_loadInt64(t *TLS, ptr uintptr, memorder int32) (r int64) + +//go:noescape +func Y__c11_atomic_loadInt8(t *TLS, ptr uintptr, memorder int32) (r int8) + +//go:noescape +func Y__c11_atomic_loadUint16(t *TLS, ptr uintptr, memorder int32) (r uint16) + +//go:noescape +func Y__c11_atomic_loadUint32(t *TLS, ptr uintptr, memorder int32) (r uint32) + +//go:noescape +func Y__c11_atomic_loadUint64(t *TLS, ptr uintptr, memorder int32) (r uint64) + +//go:noescape +func Y__c11_atomic_loadUint8(t *TLS, ptr uintptr, memorder int32) (r uint8) + +//go:noescape +func Y__c11_atomic_storeInt16(t *TLS, ptr uintptr, val int16, memorder int32) + +//go:noescape +func Y__c11_atomic_storeInt32(t *TLS, ptr uintptr, val int32, memorder int32) + +//go:noescape +func Y__c11_atomic_storeInt64(t *TLS, ptr uintptr, val int64, memorder int32) + +//go:noescape +func Y__c11_atomic_storeInt8(t *TLS, ptr uintptr, val int8, memorder int32) + +//go:noescape +func Y__c11_atomic_storeUint16(t *TLS, ptr uintptr, val uint16, memorder int32) + +//go:noescape +func Y__c11_atomic_storeUint32(t *TLS, ptr uintptr, val uint32, memorder int32) + +//go:noescape +func Y__c11_atomic_storeUint64(t *TLS, ptr uintptr, val uint64, memorder int32) + +//go:noescape +func Y__c11_atomic_storeUint8(t *TLS, ptr uintptr, val uint8, memorder int32) + +//go:noescape +func Y__ccgo_dmesg(t *TLS, fmt uintptr, va uintptr) + +//go:noescape +func Y__ccgo_getMutexType(tls *TLS, m uintptr) (_2 int32) + +//go:noescape +func Y__ccgo_in6addr_anyp(t *TLS) (_1 uintptr) + +//go:noescape +func Y__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) (_2 int32) + +//go:noescape +func Y__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) (_2 int32) + +//go:noescape +func Y__ccgo_sqlite3_log(t *TLS, iErrCode int32, zFormat uintptr, args uintptr) + +//go:noescape +func Y__clock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) + +//go:noescape +func Y__clock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem uintptr) (r int32) + +//go:noescape +func Y__cmsg_nxthdr(t *TLS, msgh, cmsg uintptr) (_2 uintptr) + +//go:noescape +func Y__convert_scm_timestamps(tls *TLS, msg uintptr, csize Tsocklen_t) + +//go:noescape +func Y__cos(tls *TLS, x float64, y float64) (r1 float64) + +//go:noescape +func Y__cosdf(tls *TLS, x float64) (r1 float32) + +//go:noescape +func Y__crypt_blowfish(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) + +//go:noescape +func Y__crypt_des(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) + +//go:noescape +func Y__crypt_md5(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) + +//go:noescape +func Y__crypt_r(tls *TLS, key uintptr, salt uintptr, data uintptr) (r uintptr) + +//go:noescape +func Y__crypt_sha256(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) + +//go:noescape +func Y__crypt_sha512(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) + +//go:noescape +func Y__ctype_b_loc(tls *TLS) (r uintptr) + +//go:noescape +func Y__ctype_get_mb_cur_max(tls *TLS) (r Tsize_t) + +//go:noescape +func Y__ctype_tolower_loc(tls *TLS) (r uintptr) + +//go:noescape +func Y__ctype_toupper_loc(tls *TLS) (r uintptr) + +//go:noescape +func Y__des_setkey(tls *TLS, key uintptr, ekey uintptr) + +//go:noescape +func Y__dn_expand(tls *TLS, base uintptr, end uintptr, src uintptr, dest uintptr, space int32) (r int32) + +//go:noescape +func Y__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) + +//go:noescape +func __ccgo_abi0___dns_parse_2(_0 *TLS, _1 uintptr, _2 int32, _3 uintptr, _4 int32, _5 uintptr, _6 int32, __ccgo_fp uintptr) (_7 int32) + +func __ccgo_abiInternal___dns_parse_2(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 int32, _3 uintptr, _4 int32, _5 uintptr, _6 int32) (_7 int32) { + return __ccgo_abi0___dns_parse_2(_0, _1, _2, _3, _4, _5, _6, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Y__do_des(tls *TLS, l_in Tuint32_t, r_in Tuint32_t, l_out uintptr, r_out uintptr, count Tuint32_t, saltbits Tuint32_t, ekey uintptr) + +//go:noescape +func Y__do_orphaned_stdio_locks(tls *TLS) + +//go:noescape +func Y__dup3(tls *TLS, old int32, new1 int32, flags int32) (r1 int32) + +//go:noescape +func Y__duplocale(tls *TLS, old Tlocale_t) (r Tlocale_t) + +//go:noescape +func Y__env_rm_add(tls *TLS, old uintptr, new1 uintptr) + +//go:noescape +func Y__errno_location(tls *TLS) (r uintptr) + +//go:noescape +func Y__execvpe(tls *TLS, file uintptr, argv uintptr, envp uintptr) (r int32) + +//go:noescape +func Y__expo2(tls *TLS, x float64, sign float64) (r float64) + +//go:noescape +func Y__expo2f(tls *TLS, x float32, sign float32) (r float32) + +//go:noescape +func Y__fbufsize(tls *TLS, f uintptr) (r Tsize_t) + +//go:noescape +func Y__fclose_ca(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__fdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) + +//go:noescape +func Y__fesetround(tls *TLS, r int32) (r1 int32) + +//go:noescape +func Y__fgetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) + +//go:noescape +func Y__flbf(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__floatscan(tls *TLS, f uintptr, prec int32, pok int32) (r float64) + +//go:noescape +func Y__fmodeflags(tls *TLS, mode uintptr) (r int32) + +//go:noescape +func Y__fopen_rb_ca(tls *TLS, filename uintptr, f uintptr, buf uintptr, len1 Tsize_t) (r uintptr) + +//go:noescape +func Y__fpclassify(tls *TLS, x float64) (r int32) + +//go:noescape +func Y__fpclassifyf(tls *TLS, x float32) (r int32) + +//go:noescape +func Y__fpclassifyl(tls *TLS, x float64) (r int32) + +//go:noescape +func Y__fpending(tls *TLS, f uintptr) (r Tsize_t) + +//go:noescape +func Y__fpurge(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__fputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) + +//go:noescape +func Y__freadable(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__freadahead(tls *TLS, f uintptr) (r Tsize_t) + +//go:noescape +func Y__freading(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__freadptr(tls *TLS, f uintptr, sizep uintptr) (r uintptr) + +//go:noescape +func Y__freadptrinc(tls *TLS, f uintptr, inc Tsize_t) + +//go:noescape +func Y__freelocale(tls *TLS, l Tlocale_t) + +//go:noescape +func Y__fseeko(tls *TLS, f uintptr, off Toff_t, whence int32) (r int32) + +//go:noescape +func Y__fseeko_unlocked(tls *TLS, f uintptr, off Toff_t, whence int32) (r int32) + +//go:noescape +func Y__fseterr(tls *TLS, f uintptr) + +//go:noescape +func Y__fsetlocking(tls *TLS, f uintptr, type1 int32) (r int32) + +//go:noescape +func Y__fstat(tls *TLS, fd int32, st uintptr) (r int32) + +//go:noescape +func Y__fstatat(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r int32) + +//go:noescape +func Y__ftello(tls *TLS, f uintptr) (r Toff_t) + +//go:noescape +func Y__ftello_unlocked(tls *TLS, f uintptr) (r Toff_t) + +//go:noescape +func Y__funcs_on_quick_exit(tls *TLS) + +//go:noescape +func Y__futimesat(tls *TLS, dirfd int32, pathname uintptr, times uintptr) (r int32) + +//go:noescape +func Y__fwritable(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__fwritex(tls *TLS, s uintptr, l Tsize_t, f uintptr) (r Tsize_t) + +//go:noescape +func Y__fwriting(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__fxstat(tls *TLS, ver int32, fd int32, buf uintptr) (r int32) + +//go:noescape +func Y__fxstatat(tls *TLS, ver int32, fd int32, path uintptr, buf uintptr, flag int32) (r int32) + +//go:noescape +func Y__get_handler_set(tls *TLS, set uintptr) + +//go:noescape +func Y__get_locale(tls *TLS, cat int32, val uintptr) (r uintptr) + +//go:noescape +func Y__get_resolv_conf(tls *TLS, conf uintptr, search uintptr, search_sz Tsize_t) (r int32) + +//go:noescape +func Y__getauxval(tls *TLS, item uint64) (r uint64) + +//go:noescape +func Y__getdelim(tls *TLS, s uintptr, n uintptr, delim int32, f uintptr) (r Tssize_t) + +//go:noescape +func Y__getgr_a(tls *TLS, name uintptr, gid Tgid_t, gr uintptr, buf uintptr, size uintptr, mem uintptr, nmem uintptr, res uintptr) (r int32) + +//go:noescape +func Y__getgrent_a(tls *TLS, f uintptr, gr uintptr, line uintptr, size uintptr, mem uintptr, nmem uintptr, res uintptr) (r int32) + +//go:noescape +func Y__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) + +//go:noescape +func Y__getpw_a(tls *TLS, name uintptr, uid Tuid_t, pw uintptr, buf uintptr, size uintptr, res uintptr) (r int32) + +//go:noescape +func Y__getpwent_a(tls *TLS, f uintptr, pw uintptr, line uintptr, size uintptr, res uintptr) (r int32) + +//go:noescape +func Y__gettextdomain(tls *TLS) (r uintptr) + +//go:noescape +func Y__gmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) + +//go:noescape +func Y__h_errno_location(tls *TLS) (r uintptr) + +//go:noescape +func Y__inet_aton(tls *TLS, s0 uintptr, dest uintptr) (r int32) + +//go:noescape +func Y__init_ssp(tls *TLS, entropy uintptr) + +//go:noescape +func Y__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) (r uint64) + +//go:noescape +func Y__isalnum_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__isalpha_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__isblank_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__iscntrl_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__isdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__isfinite(tls *TLS, d float64) (_2 int32) + +//go:noescape +func Y__isfinitef(tls *TLS, f float32) (_2 int32) + +//go:noescape +func Y__isfinitel(tls *TLS, d float64) (_2 int32) + +//go:noescape +func Y__isgraph_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__islower_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__isnan(t *TLS, x float64) (_2 int32) + +//go:noescape +func Y__isnanf(t *TLS, arg float32) (_2 int32) + +//go:noescape +func Y__isnanl(t *TLS, arg float64) (_2 int32) + +//go:noescape +func Y__isoc99_fscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Y__isoc99_fwscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Y__isoc99_scanf(tls *TLS, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Y__isoc99_sscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Y__isoc99_swscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Y__isoc99_vfscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Y__isoc99_vfwscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Y__isoc99_vscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Y__isoc99_vsscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Y__isoc99_vswscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Y__isoc99_vwscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Y__isoc99_wscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Y__isprint_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__ispunct_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__isspace_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__isupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswalnum_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswalpha_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswblank_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswcntrl_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswctype_l(tls *TLS, c Twint_t, t Twctype_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswgraph_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswprint_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswpunct_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswspace_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__iswxdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Y__isxdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__lctrans(tls *TLS, msg uintptr, lm uintptr) (r uintptr) + +//go:noescape +func Y__lctrans_cur(tls *TLS, msg uintptr) (r uintptr) + +//go:noescape +func Y__lctrans_impl(tls *TLS, msg uintptr, lm uintptr) (r uintptr) + +//go:noescape +func Y__ldexp_cexp(tls *TLS, z complex128, expt int32) (r complex128) + +//go:noescape +func Y__ldexp_cexpf(tls *TLS, z complex64, expt int32) (r complex64) + +//go:noescape +func Y__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) + +//go:noescape +func Y__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) + +//go:noescape +func Y__lgammal_r(tls *TLS, x float64, sg uintptr) (r float64) + +//go:noescape +func Y__libc_current_sigrtmax(tls *TLS) (r int32) + +//go:noescape +func Y__libc_current_sigrtmin(tls *TLS) (r int32) + +//go:noescape +func Y__libc_sigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r1 int32) + +//go:noescape +func Y__loc_is_allocated(tls *TLS, loc Tlocale_t) (r int32) + +//go:noescape +func Y__localtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) + +//go:noescape +func Y__lockfile(tls *TLS, file uintptr) (_2 int32) + +//go:noescape +func Y__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) (r int32) + +//go:noescape +func Y__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) (r int32) + +//go:noescape +func Y__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) (r int32) + +//go:noescape +func Y__lseek(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) + +//go:noescape +func Y__lsysinfo(tls *TLS, info uintptr) (r int32) + +//go:noescape +func Y__lxstat(tls *TLS, ver int32, path uintptr, buf uintptr) (r int32) + +//go:noescape +func Y__madvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) + +//go:noescape +func Y__map_file(tls *TLS, pathname uintptr, size uintptr) (r uintptr) + +//go:noescape +func Y__math_divzero(tls *TLS, sign Tuint32_t) (r float64) + +//go:noescape +func Y__math_divzerof(tls *TLS, sign Tuint32_t) (r float32) + +//go:noescape +func Y__math_invalid(tls *TLS, x float64) (r float64) + +//go:noescape +func Y__math_invalidf(tls *TLS, x float32) (r float32) + +//go:noescape +func Y__math_oflow(tls *TLS, sign Tuint32_t) (r float64) + +//go:noescape +func Y__math_oflowf(tls *TLS, sign Tuint32_t) (r float32) + +//go:noescape +func Y__math_uflow(tls *TLS, sign Tuint32_t) (r float64) + +//go:noescape +func Y__math_uflowf(tls *TLS, sign Tuint32_t) (r float32) + +//go:noescape +func Y__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) + +//go:noescape +func Y__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) + +//go:noescape +func Y__memrchr(tls *TLS, m uintptr, c int32, n Tsize_t) (r uintptr) + +//go:noescape +func Y__mkostemps(tls *TLS, template uintptr, len1 int32, flags int32) (r int32) + +//go:noescape +func Y__mmap(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) + +//go:noescape +func Y__mo_lookup(tls *TLS, p uintptr, size Tsize_t, s uintptr) (r uintptr) + +//go:noescape +func Y__month_to_secs(tls *TLS, month int32, is_leap int32) (r int32) + +//go:noescape +func Y__mprotect(tls *TLS, addr uintptr, len1 Tsize_t, prot int32) (r int32) + +//go:noescape +func Y__mremap(tls *TLS, old_addr uintptr, old_len Tsize_t, new_len Tsize_t, flags int32, va uintptr) (r uintptr) + +//go:noescape +func Y__munmap(tls *TLS, start uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Y__newlocale(tls *TLS, mask int32, name uintptr, loc Tlocale_t) (r Tlocale_t) + +//go:noescape +func Y__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) + +//go:noescape +func Y__nl_langinfo_l(tls *TLS, item Tnl_item, loc Tlocale_t) (r uintptr) + +//go:noescape +func Y__nscd_query(tls *TLS, req Tint32_t, key uintptr, buf uintptr, len1 Tsize_t, swap uintptr) (r uintptr) + +//go:noescape +func Y__ofl_add(tls *TLS, f uintptr) (r uintptr) + +//go:noescape +func Y__ofl_lock(tls *TLS) (r uintptr) + +//go:noescape +func Y__ofl_unlock(tls *TLS) + +//go:noescape +func Y__overflow(tls *TLS, f uintptr, _c int32) (r int32) + +//go:noescape +func Y__pleval(tls *TLS, s uintptr, n uint64) (r uint64) + +//go:noescape +func Y__posix_getopt(tls *TLS, argc int32, argv uintptr, optstring uintptr) (r int32) + +//go:noescape +func Y__procfdname(tls *TLS, buf uintptr, fd uint32) + +//go:noescape +func Y__ptsname_r(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Y__putenv(tls *TLS, s uintptr, l Tsize_t, r uintptr) (r1 int32) + +//go:noescape +func Y__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) + +//go:noescape +func __ccgo_abi0___qsort_r_3(_0 *TLS, _1 uintptr, _2 uintptr, _3 uintptr, __ccgo_fp uintptr) (_4 int32) + +func __ccgo_abiInternal___qsort_r_3(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr, _3 uintptr) (_4 int32) { + return __ccgo_abi0___qsort_r_3(_0, _1, _2, _3, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Y__rand48_step(tls *TLS, xi uintptr, lc uintptr) (r Tuint64_t) + +//go:noescape +func Y__register_locked_file(tls *TLS, f uintptr, self Tpthread_t) + +//go:noescape +func Y__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) + +//go:noescape +func Y__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec int32) (r int32) + +//go:noescape +func Y__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) + +//go:noescape +func Y__res_mkquery(tls *TLS, op int32, dname uintptr, class int32, type1 int32, data uintptr, datalen int32, newrr uintptr, buf uintptr, buflen int32) (r int32) + +//go:noescape +func Y__res_msend(tls *TLS, nqueries int32, queries uintptr, qlens uintptr, answers uintptr, alens uintptr, asize int32) (r int32) + +//go:noescape +func Y__res_msend_rc(tls *TLS, nqueries int32, queries uintptr, qlens uintptr, answers uintptr, alens uintptr, asize int32, conf uintptr) (r1 int32) + +//go:noescape +func Y__res_send(tls *TLS, _msg uintptr, _msglen int32, _answer uintptr, _anslen int32) (r1 int32) + +//go:noescape +func Y__res_state(tls *TLS) (r uintptr) + +//go:noescape +func Y__reset_tls(tls *TLS) + +//go:noescape +func Y__restore(tls *TLS) + +//go:noescape +func Y__restore_rt(tls *TLS) + +//go:noescape +func Y__restore_sigs(tls *TLS, set uintptr) + +//go:noescape +func Y__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) + +//go:noescape +func __ccgo_abi0___rtnetlink_enumerate_2(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal___rtnetlink_enumerate_2(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0___rtnetlink_enumerate_2(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Y__secs_to_tm(tls *TLS, t int64, tm uintptr) (r int32) + +//go:noescape +func Y__secs_to_zone(tls *TLS, t int64, local int32, isdst uintptr, offset uintptr, oppoff uintptr, zonename uintptr) + +//go:noescape +func Y__setxid(tls *TLS, nr int32, id int32, eid int32, sid int32) (r int32) + +//go:noescape +func Y__shgetc(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__shlim(tls *TLS, f uintptr, lim Toff_t) + +//go:noescape +func Y__shm_mapname(tls *TLS, name uintptr, buf uintptr) (r uintptr) + +//go:noescape +func Y__sigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r1 int32) + +//go:noescape +func Y__signbit(tls *TLS, x float64) (r int32) + +//go:noescape +func Y__signbitf(tls *TLS, x float32) (r int32) + +//go:noescape +func Y__signbitl(tls *TLS, x float64) (r int32) + +//go:noescape +func Y__sigsetjmp_tail(tls *TLS, jb uintptr, ret int32) (r int32) + +//go:noescape +func Y__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) + +//go:noescape +func Y__sindf(tls *TLS, x float64) (r1 float32) + +//go:noescape +func Y__stack_chk_fail(tls *TLS) + +//go:noescape +func Y__stack_chk_fail_local(tls *TLS) + +//go:noescape +func Y__stdio_close(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__stdio_exit(tls *TLS) + +//go:noescape +func Y__stdio_exit_needed(tls *TLS) + +//go:noescape +func Y__stdio_read(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) + +//go:noescape +func Y__stdio_seek(tls *TLS, f uintptr, off Toff_t, whence int32) (r Toff_t) + +//go:noescape +func Y__stdio_write(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) + +//go:noescape +func Y__stdout_write(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) + +//go:noescape +func Y__stpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) + +//go:noescape +func Y__stpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Y__strcasecmp_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) + +//go:noescape +func Y__strchrnul(tls *TLS, s uintptr, c int32) (r uintptr) + +//go:noescape +func Y__strcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) + +//go:noescape +func Y__strerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) + +//go:noescape +func Y__strftime_fmt_1(tls *TLS, s uintptr, l uintptr, f int32, tm uintptr, loc Tlocale_t, pad int32) (r uintptr) + +//go:noescape +func Y__strftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Y__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, loc Tlocale_t) (r1 int32) + +//go:noescape +func Y__strtod_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) + +//go:noescape +func Y__strtof_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float32) + +//go:noescape +func Y__strtoimax_internal(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) + +//go:noescape +func Y__strtol_internal(tls *TLS, s uintptr, p uintptr, base int32) (r int64) + +//go:noescape +func Y__strtold_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) + +//go:noescape +func Y__strtoll_internal(tls *TLS, s uintptr, p uintptr, base int32) (r int64) + +//go:noescape +func Y__strtoul_internal(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) + +//go:noescape +func Y__strtoull_internal(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) + +//go:noescape +func Y__strtoumax_internal(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) + +//go:noescape +func Y__strxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Y__sync_synchronize(t *TLS) + +//go:noescape +func Y__sync_val_compare_and_swapInt16(t *TLS, ptr uintptr, oldval, newval int16) (r int16) + +//go:noescape +func Y__sync_val_compare_and_swapInt32(t *TLS, ptr uintptr, oldval, newval int32) (r int32) + +//go:noescape +func Y__sync_val_compare_and_swapInt64(t *TLS, ptr uintptr, oldval, newval int64) (r int64) + +//go:noescape +func Y__sync_val_compare_and_swapInt8(t *TLS, ptr uintptr, oldval, newval int8) (r int8) + +//go:noescape +func Y__sync_val_compare_and_swapUint16(t *TLS, ptr uintptr, oldval, newval uint16) (r uint16) + +//go:noescape +func Y__sync_val_compare_and_swapUint32(t *TLS, ptr uintptr, oldval, newval uint32) (r uint32) + +//go:noescape +func Y__sync_val_compare_and_swapUint64(t *TLS, ptr uintptr, oldval, newval uint64) (r uint64) + +//go:noescape +func Y__sync_val_compare_and_swapUint8(t *TLS, ptr uintptr, oldval, newval uint8) (r uint8) + +//go:noescape +func Y__syscall0(tls *TLS, n long) (_2 long) + +//go:noescape +func Y__syscall1(tls *TLS, n, a1 long) (_2 long) + +//go:noescape +func Y__syscall2(tls *TLS, n, a1, a2 long) (_2 long) + +//go:noescape +func Y__syscall3(tls *TLS, n, a1, a2, a3 long) (_2 long) + +//go:noescape +func Y__syscall4(tls *TLS, n, a1, a2, a3, a4 long) (_2 long) + +//go:noescape +func Y__syscall5(tls *TLS, n, a1, a2, a3, a4, a5 long) (_2 long) + +//go:noescape +func Y__syscall6(tls *TLS, n, a1, a2, a3, a4, a5, a6 long) (_2 long) + +//go:noescape +func Y__syscall_ret(tls *TLS, r uint64) (r1 int64) + +//go:noescape +func Y__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) + +//go:noescape +func Y__tandf(tls *TLS, x float64, odd int32) (r1 float32) + +//go:noescape +func Y__tm_to_secs(tls *TLS, tm uintptr) (r int64) + +//go:noescape +func Y__tm_to_tzname(tls *TLS, tm uintptr) (r uintptr) + +//go:noescape +func Y__tolower_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__toread(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__toread_needs_stdio_exit(tls *TLS) + +//go:noescape +func Y__toupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Y__towctrans_l(tls *TLS, c Twint_t, t Twctrans_t, l Tlocale_t) (r Twint_t) + +//go:noescape +func Y__towlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) + +//go:noescape +func Y__towrite(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__towrite_needs_stdio_exit(tls *TLS) + +//go:noescape +func Y__towupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) + +//go:noescape +func Y__tre_mem_alloc_impl(tls *TLS, mem Ttre_mem_t, provided int32, provided_block uintptr, zero int32, size Tsize_t) (r uintptr) + +//go:noescape +func Y__tre_mem_destroy(tls *TLS, mem Ttre_mem_t) + +//go:noescape +func Y__tre_mem_new_impl(tls *TLS, provided int32, provided_block uintptr) (r Ttre_mem_t) + +//go:noescape +func Y__tsearch_balance(tls *TLS, p uintptr) (r int32) + +//go:noescape +func Y__uflow(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Y__unlist_locked_file(tls *TLS, f uintptr) + +//go:noescape +func Y__unlockfile(tls *TLS, file uintptr) + +//go:noescape +func Y__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) + +//go:noescape +func Y__vm_wait(tls *TLS) + +//go:noescape +func Y__wcscoll_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) + +//go:noescape +func Y__wcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Y__wcsxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Y__wctrans_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctrans_t) + +//go:noescape +func Y__wctype_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctype_t) + +//go:noescape +func Y__xmknod(tls *TLS, ver int32, path uintptr, mode Tmode_t, dev uintptr) (r int32) + +//go:noescape +func Y__xmknodat(tls *TLS, ver int32, fd int32, path uintptr, mode Tmode_t, dev uintptr) (r int32) + +//go:noescape +func Y__xpg_basename(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Y__xpg_strerror_r(tls *TLS, err int32, buf uintptr, buflen Tsize_t) (r int32) + +//go:noescape +func Y__xstat(tls *TLS, ver int32, path uintptr, buf uintptr) (r int32) + +//go:noescape +func Y__year_to_secs(tls *TLS, year int64, is_leap uintptr) (r int64) + +//go:noescape +func Y_exit(tls *TLS, status int32) + +//go:noescape +func Y_flushlbf(tls *TLS) + +//go:noescape +func Y_longjmp(t *TLS, env uintptr, val int32) + +//go:noescape +func Y_obstack_begin(t *TLS, obstack uintptr, size, alignment int32, chunkfun, freefun uintptr) (_4 int32) + +//go:noescape +func Y_obstack_newchunk(t *TLS, obstack uintptr, length int32) (_3 int32) + +//go:noescape +func Y_pthread_cleanup_pop(tls *TLS, _ uintptr, run int32) + +//go:noescape +func Y_pthread_cleanup_push(tls *TLS, _, f, x uintptr) + +//go:noescape +func Y_setjmp(t *TLS, env uintptr) (_2 int32) + +//go:noescape +func Ya64l(tls *TLS, s uintptr) (r int64) + +//go:noescape +func Yabort(tls *TLS) + +//go:noescape +func Yabs(tls *TLS, a int32) (r int32) + +//go:noescape +func Yaccept(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) + +//go:noescape +func Yaccept4(tls *TLS, fd int32, addr uintptr, len1 uintptr, flg int32) (r1 int32) + +//go:noescape +func Yaccess(tls *TLS, filename uintptr, amode int32) (r int32) + +//go:noescape +func Yacct(tls *TLS, filename uintptr) (r int32) + +//go:noescape +func Yacos(tls *TLS, x float64) (r float64) + +//go:noescape +func Yacosf(tls *TLS, x float32) (r float32) + +//go:noescape +func Yacosh(tls *TLS, x float64) (r float64) + +//go:noescape +func Yacoshf(tls *TLS, x float32) (r float32) + +//go:noescape +func Yacoshl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yacosl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yaddmntent(tls *TLS, f uintptr, mnt uintptr) (r int32) + +//go:noescape +func Yadjtime(tls *TLS, in uintptr, out uintptr) (r int32) + +//go:noescape +func Yadjtimex(tls *TLS, tx uintptr) (r int32) + +//go:noescape +func Yalarm(tls *TLS, seconds uint32) (r uint32) + +//go:noescape +func Yalloca(tls *TLS, size Tsize_t) (_2 uintptr) + +//go:noescape +func Yalphasort(tls *TLS, a uintptr, b uintptr) (r int32) + +//go:noescape +func Yarch_prctl(tls *TLS, code int32, addr uint64) (r int32) + +//go:noescape +func Yasctime(tls *TLS, tm uintptr) (r uintptr) + +//go:noescape +func Yasctime_r(tls *TLS, tm uintptr, buf uintptr) (r uintptr) + +//go:noescape +func Yasin(tls *TLS, x float64) (r1 float64) + +//go:noescape +func Yasinf(tls *TLS, x float32) (r float32) + +//go:noescape +func Yasinh(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Yasinhf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Yasinhl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yasinl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yasprintf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Yat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) + +//go:noescape +func __ccgo_abi0_at_quick_exit_0(_0 *TLS, __ccgo_fp uintptr) + +func __ccgo_abiInternal_at_quick_exit_0(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS) { + __ccgo_abi0_at_quick_exit_0(_0, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yatan(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Yatan2(tls *TLS, y float64, x float64) (r float64) + +//go:noescape +func Yatan2f(tls *TLS, y float32, x float32) (r float32) + +//go:noescape +func Yatan2l(tls *TLS, y float64, x float64) (r float64) + +//go:noescape +func Yatanf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Yatanh(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Yatanhf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Yatanhl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yatanl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yatexit(tls *TLS, func_ uintptr) (r int32) + +//go:noescape +func Yatof(tls *TLS, s uintptr) (r float64) + +//go:noescape +func Yatoi(tls *TLS, s uintptr) (r int32) + +//go:noescape +func Yatol(tls *TLS, s uintptr) (r int64) + +//go:noescape +func Yatoll(tls *TLS, s uintptr) (r int64) + +//go:noescape +func Ybacktrace(t *TLS, buf uintptr, size int32) (_3 int32) + +//go:noescape +func Ybacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) + +//go:noescape +func Ybasename(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Ybcmp(tls *TLS, s1 uintptr, s2 uintptr, n Tsize_t) (r int32) + +//go:noescape +func Ybcopy(tls *TLS, s1 uintptr, s2 uintptr, n Tsize_t) + +//go:noescape +func Ybind(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) + +//go:noescape +func Ybind_textdomain_codeset(tls *TLS, domainname uintptr, codeset uintptr) (r uintptr) + +//go:noescape +func Ybindtextdomain(tls *TLS, domainname uintptr, dirname uintptr) (r uintptr) + +//go:noescape +func Ybrk(tls *TLS, end uintptr) (r int32) + +//go:noescape +func Ybsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) + +//go:noescape +func __ccgo_abi0_bsearch_4(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_bsearch_4(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_bsearch_4(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Ybtowc(tls *TLS, c int32) (r Twint_t) + +//go:noescape +func Ybzero(tls *TLS, s uintptr, n Tsize_t) + +//go:noescape +func Yc16rtomb(tls *TLS, s uintptr, c16 Tchar16_t, ps uintptr) (r Tsize_t) + +//go:noescape +func Yc32rtomb(tls *TLS, s uintptr, c32 Tchar32_t, ps uintptr) (r Tsize_t) + +//go:noescape +func Ycabs(tls *TLS, z complex128) (r float64) + +//go:noescape +func Ycabsf(tls *TLS, z complex64) (r float32) + +//go:noescape +func Ycabsl(tls *TLS, z complex128) (r float64) + +//go:noescape +func Ycacos(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycacosf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycacosh(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycacoshf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycacoshl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycacosl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycalloc(tls *TLS, m Tsize_t, n Tsize_t) (r uintptr) + +//go:noescape +func Ycapget(tls *TLS, a uintptr, b uintptr) (r int32) + +//go:noescape +func Ycapset(tls *TLS, a uintptr, b uintptr) (r int32) + +//go:noescape +func Ycarg(tls *TLS, z complex128) (r float64) + +//go:noescape +func Ycargf(tls *TLS, z complex64) (r float32) + +//go:noescape +func Ycargl(tls *TLS, z complex128) (r float64) + +//go:noescape +func Ycasin(tls *TLS, z complex128) (r1 complex128) + +//go:noescape +func Ycasinf(tls *TLS, z complex64) (r1 complex64) + +//go:noescape +func Ycasinh(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycasinhf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycasinhl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycasinl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycatan(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycatanf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycatanh(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycatanhf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycatanhl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycatanl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycatclose(tls *TLS, catd Tnl_catd) (r int32) + +//go:noescape +func Ycatgets(tls *TLS, catd Tnl_catd, set_id int32, msg_id int32, s uintptr) (r uintptr) + +//go:noescape +func Ycatopen(tls *TLS, name uintptr, oflag int32) (r Tnl_catd) + +//go:noescape +func Ycbrt(tls *TLS, x float64) (r1 float64) + +//go:noescape +func Ycbrtf(tls *TLS, x float32) (r1 float32) + +//go:noescape +func Ycbrtl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yccos(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yccosf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Yccosh(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yccoshf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Yccoshl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yccosl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yceil(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Yceilf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Yceill(tls *TLS, x float64) (r float64) + +//go:noescape +func Ycexp(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycexpf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycexpl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycfgetispeed(tls *TLS, tio uintptr) (r Tspeed_t) + +//go:noescape +func Ycfgetospeed(tls *TLS, tio uintptr) (r Tspeed_t) + +//go:noescape +func Ycfmakeraw(tls *TLS, t uintptr) + +//go:noescape +func Ycfsetispeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) + +//go:noescape +func Ycfsetospeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) + +//go:noescape +func Ycfsetspeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) + +//go:noescape +func Ychdir(tls *TLS, path uintptr) (r int32) + +//go:noescape +func Ychmod(tls *TLS, path uintptr, mode Tmode_t) (r int32) + +//go:noescape +func Ychown(tls *TLS, path uintptr, uid Tuid_t, gid Tgid_t) (r int32) + +//go:noescape +func Ychroot(tls *TLS, path uintptr) (r int32) + +//go:noescape +func Ycimag(tls *TLS, z complex128) (r float64) + +//go:noescape +func Ycimagf(tls *TLS, z complex64) (r float32) + +//go:noescape +func Ycimagl(tls *TLS, z complex128) (r float64) + +//go:noescape +func Yclearenv(tls *TLS) (r int32) + +//go:noescape +func Yclearerr(tls *TLS, f uintptr) + +//go:noescape +func Yclearerr_unlocked(tls *TLS, f uintptr) + +//go:noescape +func Yclock(tls *TLS) (r Tclock_t) + +//go:noescape +func Yclock_adjtime(tls *TLS, clock_id Tclockid_t, utx uintptr) (r1 int32) + +//go:noescape +func Yclock_getcpuclockid(tls *TLS, pid Tpid_t, clk uintptr) (r int32) + +//go:noescape +func Yclock_getres(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) + +//go:noescape +func Yclock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) + +//go:noescape +func Yclock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem uintptr) (r int32) + +//go:noescape +func Yclock_settime(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) + +//go:noescape +func Yclog(tls *TLS, z complex128) (r1 complex128) + +//go:noescape +func Yclogf(tls *TLS, z complex64) (r1 complex64) + +//go:noescape +func Yclogl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yclose(tls *TLS, fd int32) (r1 int32) + +//go:noescape +func Yclosedir(tls *TLS, dir uintptr) (r int32) + +//go:noescape +func Ycloselog(tls *TLS) + +//go:noescape +func Yconfstr(tls *TLS, name int32, buf uintptr, len1 Tsize_t) (r Tsize_t) + +//go:noescape +func Yconj(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yconjf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Yconjl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yconnect(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) + +//go:noescape +func Ycopy_file_range(tls *TLS, fd_in int32, off_in uintptr, fd_out int32, off_out uintptr, len1 Tsize_t, flags uint32) (r Tssize_t) + +//go:noescape +func Ycopysign(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Ycopysignf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Ycopysignl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Ycos(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Ycosf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Ycosh(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Ycoshf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Ycoshl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ycosl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ycpow(tls *TLS, z complex128, c complex128) (r complex128) + +//go:noescape +func Ycpowf(tls *TLS, z complex64, c complex64) (r complex64) + +//go:noescape +func Ycpowl(tls *TLS, z complex128, c complex128) (r complex128) + +//go:noescape +func Ycproj(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycprojf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycprojl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycreal(tls *TLS, z complex128) (r float64) + +//go:noescape +func Ycrealf(tls *TLS, z complex64) (r float32) + +//go:noescape +func Ycreall(tls *TLS, z complex128) (r float64) + +//go:noescape +func Ycreat(tls *TLS, filename uintptr, mode Tmode_t) (r int32) + +//go:noescape +func Ycrypt(tls *TLS, key uintptr, salt uintptr) (r uintptr) + +//go:noescape +func Ycrypt_r(tls *TLS, key uintptr, salt uintptr, data uintptr) (r uintptr) + +//go:noescape +func Ycsin(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycsinf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycsinh(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycsinhf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycsinhl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycsinl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycsqrt(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Ycsqrtf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Ycsqrtl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yctan(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yctanf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Yctanh(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yctanhf(tls *TLS, z complex64) (r complex64) + +//go:noescape +func Yctanhl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yctanl(tls *TLS, z complex128) (r complex128) + +//go:noescape +func Yctermid(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Yctime(tls *TLS, t uintptr) (r uintptr) + +//go:noescape +func Yctime_r(tls *TLS, t uintptr, buf uintptr) (r uintptr) + +//go:noescape +func Ycuserid(tls *TLS, buf uintptr) (r uintptr) + +//go:noescape +func Ydcgettext(tls *TLS, domainname uintptr, msgid uintptr, category int32) (r uintptr) + +//go:noescape +func Ydcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n uint64, category int32) (r1 uintptr) + +//go:noescape +func Ydelete_module(tls *TLS, a uintptr, b uint32) (r int32) + +//go:noescape +func Ydgettext(tls *TLS, domainname uintptr, msgid uintptr) (r uintptr) + +//go:noescape +func Ydifftime(tls *TLS, t1 Ttime_t, t0 Ttime_t) (r float64) + +//go:noescape +func Ydirfd(tls *TLS, d uintptr) (r int32) + +//go:noescape +func Ydirname(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Ydiv(tls *TLS, num int32, den int32) (r Tdiv_t) + +//go:noescape +func Ydlclose(t *TLS, handle uintptr) (_2 int32) + +//go:noescape +func Ydlerror(t *TLS) (_1 uintptr) + +//go:noescape +func Ydlopen(t *TLS, filename uintptr, flags int32) (_3 uintptr) + +//go:noescape +func Ydlsym(t *TLS, handle, symbol uintptr) (_2 uintptr) + +//go:noescape +func Ydn_comp(tls *TLS, src uintptr, dst uintptr, space int32, dnptrs uintptr, lastdnptr uintptr) (r int32) + +//go:noescape +func Ydn_expand(tls *TLS, base uintptr, end uintptr, src uintptr, dest uintptr, space int32) (r int32) + +//go:noescape +func Ydn_skipname(tls *TLS, s uintptr, end uintptr) (r int32) + +//go:noescape +func Ydngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n uint64) (r uintptr) + +//go:noescape +func Ydprintf(tls *TLS, fd int32, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ydrand48(tls *TLS) (r float64) + +//go:noescape +func Ydrem(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Ydremf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Ydup(tls *TLS, fd int32) (r int32) + +//go:noescape +func Ydup2(tls *TLS, old int32, new1 int32) (r1 int32) + +//go:noescape +func Ydup3(tls *TLS, old int32, new1 int32, flags int32) (r int32) + +//go:noescape +func Yduplocale(tls *TLS, old Tlocale_t) (r Tlocale_t) + +//go:noescape +func Yeaccess(tls *TLS, filename uintptr, amode int32) (r int32) + +//go:noescape +func Yecvt(tls *TLS, x float64, n int32, dp uintptr, sign uintptr) (r uintptr) + +//go:noescape +func Yencrypt(tls *TLS, block uintptr, edflag int32) + +//go:noescape +func Yendgrent(tls *TLS) + +//go:noescape +func Yendhostent(tls *TLS) + +//go:noescape +func Yendmntent(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yendnetent(tls *TLS) + +//go:noescape +func Yendprotoent(tls *TLS) + +//go:noescape +func Yendpwent(tls *TLS) + +//go:noescape +func Yendservent(tls *TLS) + +//go:noescape +func Yendspent(tls *TLS) + +//go:noescape +func Yendusershell(tls *TLS) + +//go:noescape +func Yendutent(tls *TLS) + +//go:noescape +func Yendutxent(tls *TLS) + +//go:noescape +func Yepoll_create(tls *TLS, size int32) (r int32) + +//go:noescape +func Yepoll_create1(tls *TLS, flags int32) (r1 int32) + +//go:noescape +func Yepoll_ctl(tls *TLS, fd int32, op int32, fd2 int32, ev uintptr) (r int32) + +//go:noescape +func Yepoll_pwait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32, sigs uintptr) (r1 int32) + +//go:noescape +func Yepoll_wait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32) (r int32) + +//go:noescape +func Yerand48(tls *TLS, s uintptr) (r float64) + +//go:noescape +func Yerf(tls *TLS, x float64) (r1 float64) + +//go:noescape +func Yerfc(tls *TLS, x float64) (r1 float64) + +//go:noescape +func Yerfcf(tls *TLS, x float32) (r1 float32) + +//go:noescape +func Yerfcl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yerff(tls *TLS, x float32) (r1 float32) + +//go:noescape +func Yerfl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yerr(tls *TLS, status int32, fmt uintptr, va uintptr) + +//go:noescape +func Yerrx(tls *TLS, status int32, fmt uintptr, va uintptr) + +//go:noescape +func Yether_aton(tls *TLS, x uintptr) (r uintptr) + +//go:noescape +func Yether_aton_r(tls *TLS, x uintptr, p_a uintptr) (r uintptr) + +//go:noescape +func Yether_hostton(tls *TLS, hostname uintptr, e uintptr) (r int32) + +//go:noescape +func Yether_line(tls *TLS, l uintptr, e uintptr, hostname uintptr) (r int32) + +//go:noescape +func Yether_ntoa(tls *TLS, p_a uintptr) (r uintptr) + +//go:noescape +func Yether_ntoa_r(tls *TLS, p_a uintptr, x uintptr) (r uintptr) + +//go:noescape +func Yether_ntohost(tls *TLS, hostname uintptr, e uintptr) (r int32) + +//go:noescape +func Yeuidaccess(tls *TLS, filename uintptr, amode int32) (r int32) + +//go:noescape +func Yeventfd(tls *TLS, count uint32, flags int32) (r1 int32) + +//go:noescape +func Yeventfd_read(tls *TLS, fd int32, value uintptr) (r int32) + +//go:noescape +func Yeventfd_write(tls *TLS, fd int32, _value Teventfd_t) (r int32) + +//go:noescape +func Yexecl(tls *TLS, path uintptr, argv0 uintptr, va uintptr) (r int32) + +//go:noescape +func Yexecle(tls *TLS, path uintptr, argv0 uintptr, va uintptr) (r int32) + +//go:noescape +func Yexeclp(tls *TLS, file uintptr, argv0 uintptr, va uintptr) (r int32) + +//go:noescape +func Yexecv(tls *TLS, path uintptr, argv uintptr) (r int32) + +//go:noescape +func Yexecve(tls *TLS, path uintptr, argv uintptr, envp uintptr) (r int32) + +//go:noescape +func Yexecvp(tls *TLS, file uintptr, argv uintptr) (r int32) + +//go:noescape +func Yexecvpe(tls *TLS, file uintptr, argv uintptr, envp uintptr) (r int32) + +//go:noescape +func Yexit(tls *TLS, code int32) + +//go:noescape +func Yexp(tls *TLS, x1 float64) (r1 float64) + +//go:noescape +func Yexp10(tls *TLS, x float64) (r float64) + +//go:noescape +func Yexp10f(tls *TLS, x float32) (r float32) + +//go:noescape +func Yexp10l(tls *TLS, x float64) (r float64) + +//go:noescape +func Yexp2(tls *TLS, x1 float64) (r1 float64) + +//go:noescape +func Yexp2f(tls *TLS, x2 float32) (r1 float32) + +//go:noescape +func Yexp2l(tls *TLS, x float64) (r float64) + +//go:noescape +func Yexpf(tls *TLS, x2 float32) (r1 float32) + +//go:noescape +func Yexpl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yexplicit_bzero(tls *TLS, d uintptr, n Tsize_t) + +//go:noescape +func Yexpm1(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Yexpm1f(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Yexpm1l(tls *TLS, x float64) (r float64) + +//go:noescape +func Yfabs(tls *TLS, x float64) (r float64) + +//go:noescape +func Yfabsf(tls *TLS, x float32) (r float32) + +//go:noescape +func Yfabsl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yfaccessat(tls *TLS, fd int32, filename uintptr, amode int32, flag int32) (r int32) + +//go:noescape +func Yfallocate(tls *TLS, fd int32, mode int32, base Toff_t, len1 Toff_t) (r int32) + +//go:noescape +func Yfanotify_init(tls *TLS, flags uint32, event_f_flags uint32) (r int32) + +//go:noescape +func Yfanotify_mark(tls *TLS, fanotify_fd int32, flags uint32, mask uint64, dfd int32, pathname uintptr) (r int32) + +//go:noescape +func Yfchdir(tls *TLS, fd int32) (r int32) + +//go:noescape +func Yfchmod(tls *TLS, fd int32, mode Tmode_t) (r int32) + +//go:noescape +func Yfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r int32) + +//go:noescape +func Yfchown(tls *TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) + +//go:noescape +func Yfchownat(tls *TLS, fd int32, path uintptr, uid Tuid_t, gid Tgid_t, flag int32) (r int32) + +//go:noescape +func Yfclose(tls *TLS, f uintptr) (r1 int32) + +//go:noescape +func Yfcntl(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) + +//go:noescape +func Yfcntl64(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) + +//go:noescape +func Yfcvt(tls *TLS, x float64, n int32, dp uintptr, sign uintptr) (r uintptr) + +//go:noescape +func Yfdatasync(tls *TLS, fd int32) (r int32) + +//go:noescape +func Yfdim(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfdimf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Yfdiml(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) + +//go:noescape +func Yfdopendir(tls *TLS, fd int32) (r uintptr) + +//go:noescape +func Yfeclearexcept(tls *TLS, mask int32) (r int32) + +//go:noescape +func Yfegetenv(tls *TLS, envp uintptr) (r int32) + +//go:noescape +func Yfegetround(tls *TLS) (r int32) + +//go:noescape +func Yfeof(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yfeof_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yferaiseexcept(tls *TLS, mask int32) (r int32) + +//go:noescape +func Yferror(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yferror_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yfesetenv(tls *TLS, envp uintptr) (r int32) + +//go:noescape +func Yfetestexcept(tls *TLS, mask int32) (r int32) + +//go:noescape +func Yfexecve(tls *TLS, fd int32, argv uintptr, envp uintptr) (r1 int32) + +//go:noescape +func Yfflush(tls *TLS, f uintptr) (r1 int32) + +//go:noescape +func Yfflush_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yffs(tls *TLS, i int32) (r int32) + +//go:noescape +func Yffsl(tls *TLS, i int64) (r int32) + +//go:noescape +func Yffsll(tls *TLS, i int64) (r int32) + +//go:noescape +func Yfgetc(tls *TLS, f1 uintptr) (r int32) + +//go:noescape +func Yfgetc_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yfgetgrent(tls *TLS, f uintptr) (r uintptr) + +//go:noescape +func Yfgetln(tls *TLS, f uintptr, plen uintptr) (r uintptr) + +//go:noescape +func Yfgetpos(tls *TLS, f uintptr, pos uintptr) (r int32) + +//go:noescape +func Yfgetpwent(tls *TLS, f uintptr) (r uintptr) + +//go:noescape +func Yfgets(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) + +//go:noescape +func Yfgets_unlocked(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) + +//go:noescape +func Yfgetwc(tls *TLS, f uintptr) (r Twint_t) + +//go:noescape +func Yfgetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) + +//go:noescape +func Yfgetws(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) + +//go:noescape +func Yfgetws_unlocked(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) + +//go:noescape +func Yfgetxattr(tls *TLS, filedes int32, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) + +//go:noescape +func Yfileno(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yfileno_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yfinite(tls *TLS, x float64) (r int32) + +//go:noescape +func Yfinitef(tls *TLS, x float32) (r int32) + +//go:noescape +func Yflistxattr(tls *TLS, filedes int32, list uintptr, size Tsize_t) (r Tssize_t) + +//go:noescape +func Yflock(tls *TLS, fd int32, op int32) (r int32) + +//go:noescape +func Yflockfile(tls *TLS, f uintptr) + +//go:noescape +func Yfloor(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Yfloorf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Yfloorl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) + +//go:noescape +func Yfmal(tls *TLS, x float64, y float64, z float64) (r float64) + +//go:noescape +func Yfmax(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfmaxf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Yfmaxl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfmemopen(tls *TLS, buf uintptr, size Tsize_t, mode uintptr) (r uintptr) + +//go:noescape +func Yfmin(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfminf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Yfminl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfmod(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfmodf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Yfmodl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yfmtmsg(tls *TLS, classification int64, label uintptr, severity int32, text uintptr, action uintptr, tag uintptr) (r int32) + +//go:noescape +func Yfnmatch(tls *TLS, pat uintptr, str uintptr, flags int32) (r int32) + +//go:noescape +func Yfopen(tls *TLS, filename uintptr, mode uintptr) (r uintptr) + +//go:noescape +func Yfopen64(tls *TLS, filename uintptr, mode uintptr) (r uintptr) + +//go:noescape +func Yfopencookie(tls *TLS, cookie uintptr, mode uintptr, iofuncs Tcookie_io_functions_t) (r uintptr) + +//go:noescape +func Yfork(t *TLS) (_1 int32) + +//go:noescape +func Yfpathconf(tls *TLS, fd int32, name int32) (r int64) + +//go:noescape +func Yfprintf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Yfpurge(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yfputc(tls *TLS, c1 int32, f1 uintptr) (r int32) + +//go:noescape +func Yfputc_unlocked(tls *TLS, c int32, f uintptr) (r int32) + +//go:noescape +func Yfputs(tls *TLS, s uintptr, f uintptr) (r int32) + +//go:noescape +func Yfputs_unlocked(tls *TLS, s uintptr, f uintptr) (r int32) + +//go:noescape +func Yfputwc(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) + +//go:noescape +func Yfputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) + +//go:noescape +func Yfputws(tls *TLS, _ws uintptr, f uintptr) (r int32) + +//go:noescape +func Yfputws_unlocked(tls *TLS, _ws uintptr, f uintptr) (r int32) + +//go:noescape +func Yfread(tls *TLS, destv uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) + +//go:noescape +func Yfread_unlocked(tls *TLS, destv uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) + +//go:noescape +func Yfree(tls *TLS, p uintptr) + +//go:noescape +func Yfreeaddrinfo(tls *TLS, p uintptr) + +//go:noescape +func Yfreeifaddrs(tls *TLS, ifp uintptr) + +//go:noescape +func Yfreelocale(tls *TLS, l Tlocale_t) + +//go:noescape +func Yfremovexattr(tls *TLS, fd int32, name uintptr) (r int32) + +//go:noescape +func Yfreopen(tls *TLS, filename uintptr, mode uintptr, f uintptr) (r uintptr) + +//go:noescape +func Yfrexp(tls *TLS, x float64, e uintptr) (r float64) + +//go:noescape +func Yfrexpf(tls *TLS, x float32, e uintptr) (r float32) + +//go:noescape +func Yfrexpl(tls *TLS, x float64, e uintptr) (r float64) + +//go:noescape +func Yfscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Yfseek(tls *TLS, f uintptr, off int64, whence int32) (r int32) + +//go:noescape +func Yfseeko(tls *TLS, f uintptr, off Toff_t, whence int32) (r int32) + +//go:noescape +func Yfsetpos(tls *TLS, f uintptr, pos uintptr) (r int32) + +//go:noescape +func Yfsetxattr(tls *TLS, filedes int32, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) + +//go:noescape +func Yfstat(tls *TLS, fd int32, st uintptr) (r int32) + +//go:noescape +func Yfstat64(tls *TLS, fd int32, st uintptr) (r int32) + +//go:noescape +func Yfstatat(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r int32) + +//go:noescape +func Yfstatfs(tls *TLS, fd int32, buf uintptr) (r int32) + +//go:noescape +func Yfstatvfs(tls *TLS, fd int32, buf uintptr) (r int32) + +//go:noescape +func Yfsync(tls *TLS, fd int32) (r int32) + +//go:noescape +func Yftell(tls *TLS, f uintptr) (r int64) + +//go:noescape +func Yftello(tls *TLS, f uintptr) (r Toff_t) + +//go:noescape +func Yftime(tls *TLS, tp uintptr) (r int32) + +//go:noescape +func Yftok(tls *TLS, path uintptr, id int32) (r Tkey_t) + +//go:noescape +func Yftruncate(tls *TLS, fd int32, length Toff_t) (r int32) + +//go:noescape +func Yftruncate64(tls *TLS, fd int32, length Toff_t) (r int32) + +//go:noescape +func Yftrylockfile(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Yfts64_close(t *TLS, ftsp uintptr) (_2 int32) + +//go:noescape +func Yfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) (_4 uintptr) + +//go:noescape +func Yfts64_read(t *TLS, ftsp uintptr) (_2 uintptr) + +//go:noescape +func Yfts_close(t *TLS, ftsp uintptr) (_2 int32) + +//go:noescape +func Yfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) (_4 uintptr) + +//go:noescape +func Yfts_read(t *TLS, ftsp uintptr) (_2 uintptr) + +//go:noescape +func Yftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) + +//go:noescape +func __ccgo_abi0_ftw_1(_0 *TLS, _1 uintptr, _2 uintptr, _3 int32, __ccgo_fp uintptr) (_4 int32) + +func __ccgo_abiInternal_ftw_1(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr, _3 int32) (_4 int32) { + return __ccgo_abi0_ftw_1(_0, _1, _2, _3, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yfunlockfile(tls *TLS, f uintptr) + +//go:noescape +func Yfutimens(tls *TLS, fd int32, times uintptr) (r int32) + +//go:noescape +func Yfutimes(tls *TLS, fd int32, tv uintptr) (r int32) + +//go:noescape +func Yfutimesat(tls *TLS, dirfd int32, pathname uintptr, times uintptr) (r int32) + +//go:noescape +func Yfwide(tls *TLS, f uintptr, mode int32) (r int32) + +//go:noescape +func Yfwprintf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Yfwrite(tls *TLS, src uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) + +//go:noescape +func Yfwrite_unlocked(tls *TLS, src uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) + +//go:noescape +func Yfwscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ygai_strerror(tls *TLS, ecode int32) (r uintptr) + +//go:noescape +func Ygcvt(tls *TLS, x float64, n int32, b uintptr) (r uintptr) + +//go:noescape +func Yget_avphys_pages(tls *TLS) (r int64) + +//go:noescape +func Yget_current_dir_name(tls *TLS) (r uintptr) + +//go:noescape +func Yget_nprocs(tls *TLS) (r int32) + +//go:noescape +func Yget_nprocs_conf(tls *TLS) (r int32) + +//go:noescape +func Yget_phys_pages(tls *TLS) (r int64) + +//go:noescape +func Ygetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) (r1 int32) + +//go:noescape +func Ygetauxval(tls *TLS, item uint64) (r uint64) + +//go:noescape +func Ygetc(tls *TLS, f1 uintptr) (r int32) + +//go:noescape +func Ygetc_unlocked(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Ygetchar(tls *TLS) (r int32) + +//go:noescape +func Ygetchar_unlocked(tls *TLS) (r int32) + +//go:noescape +func Ygetcwd(tls *TLS, buf uintptr, size Tsize_t) (r uintptr) + +//go:noescape +func Ygetdate(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Ygetdelim(tls *TLS, s uintptr, n uintptr, delim int32, f uintptr) (r Tssize_t) + +//go:noescape +func Ygetdents(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ygetdomainname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ygetdtablesize(tls *TLS) (r int32) + +//go:noescape +func Ygetegid(tls *TLS) (r Tgid_t) + +//go:noescape +func Ygetentropy(tls *TLS, buffer uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ygetenv(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Ygeteuid(tls *TLS) (r Tuid_t) + +//go:noescape +func Ygetgid(tls *TLS) (r Tgid_t) + +//go:noescape +func Ygetgrent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetgrgid(tls *TLS, gid Tgid_t) (r uintptr) + +//go:noescape +func Ygetgrgid_r(tls *TLS, gid Tgid_t, gr uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) + +//go:noescape +func Ygetgrnam(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Ygetgrnam_r(tls *TLS, name uintptr, gr uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) + +//go:noescape +func Ygetgrouplist(tls *TLS, user uintptr, gid Tgid_t, groups uintptr, ngroups uintptr) (r int32) + +//go:noescape +func Ygetgroups(tls *TLS, count int32, list uintptr) (r int32) + +//go:noescape +func Ygethostbyaddr(tls *TLS, a uintptr, l Tsocklen_t, af int32) (r uintptr) + +//go:noescape +func Ygethostbyaddr_r(tls *TLS, a uintptr, l Tsocklen_t, af int32, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) + +//go:noescape +func Ygethostbyname(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Ygethostbyname2(tls *TLS, name uintptr, af int32) (r uintptr) + +//go:noescape +func Ygethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) + +//go:noescape +func Ygethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) + +//go:noescape +func Ygethostent(tls *TLS) (r uintptr) + +//go:noescape +func Ygethostid(tls *TLS) (r int64) + +//go:noescape +func Ygethostname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ygetifaddrs(tls *TLS, ifap uintptr) (r1 int32) + +//go:noescape +func Ygetitimer(tls *TLS, which int32, old uintptr) (r1 int32) + +//go:noescape +func Ygetline(tls *TLS, s uintptr, n uintptr, f uintptr) (r Tssize_t) + +//go:noescape +func Ygetloadavg(tls *TLS, a uintptr, n int32) (r int32) + +//go:noescape +func Ygetlogin(tls *TLS) (r uintptr) + +//go:noescape +func Ygetlogin_r(tls *TLS, name uintptr, size Tsize_t) (r int32) + +//go:noescape +func Ygetmntent(tls *TLS, f uintptr) (r uintptr) + +//go:noescape +func Ygetmntent_r(tls *TLS, f uintptr, mnt uintptr, linebuf uintptr, buflen int32) (r uintptr) + +//go:noescape +func Ygetnameinfo(tls *TLS, sa uintptr, sl Tsocklen_t, node uintptr, nodelen Tsocklen_t, serv uintptr, servlen Tsocklen_t, flags int32) (r int32) + +//go:noescape +func Ygetnetbyaddr(tls *TLS, net Tuint32_t, type1 int32) (r uintptr) + +//go:noescape +func Ygetnetbyname(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Ygetnetent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetopt(tls *TLS, argc int32, argv uintptr, optstring uintptr) (r int32) + +//go:noescape +func Ygetopt_long(tls *TLS, argc int32, argv uintptr, optstring uintptr, longopts uintptr, idx uintptr) (r int32) + +//go:noescape +func Ygetopt_long_only(tls *TLS, argc int32, argv uintptr, optstring uintptr, longopts uintptr, idx uintptr) (r int32) + +//go:noescape +func Ygetpagesize(tls *TLS) (r int32) + +//go:noescape +func Ygetpass(tls *TLS, prompt uintptr) (r uintptr) + +//go:noescape +func Ygetpeername(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) + +//go:noescape +func Ygetpgid(tls *TLS, pid Tpid_t) (r Tpid_t) + +//go:noescape +func Ygetpgrp(tls *TLS) (r Tpid_t) + +//go:noescape +func Ygetpid(tls *TLS) (r Tpid_t) + +//go:noescape +func Ygetppid(tls *TLS) (r Tpid_t) + +//go:noescape +func Ygetpriority(tls *TLS, which int32, who Tid_t) (r int32) + +//go:noescape +func Ygetprotobyname(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Ygetprotobynumber(tls *TLS, num int32) (r uintptr) + +//go:noescape +func Ygetprotoent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetpwent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetpwnam(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Ygetpwnam_r(tls *TLS, name uintptr, pw uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) + +//go:noescape +func Ygetpwuid(tls *TLS, uid Tuid_t) (r uintptr) + +//go:noescape +func Ygetpwuid_r(tls *TLS, uid Tuid_t, pw uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) + +//go:noescape +func Ygetrandom(tls *TLS, buf uintptr, buflen Tsize_t, flags uint32) (r Tssize_t) + +//go:noescape +func Ygetresgid(tls *TLS, rgid uintptr, egid uintptr, sgid uintptr) (r int32) + +//go:noescape +func Ygetresuid(tls *TLS, ruid uintptr, euid uintptr, suid uintptr) (r int32) + +//go:noescape +func Ygetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) + +//go:noescape +func Ygetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) + +//go:noescape +func Ygetrusage(tls *TLS, who int32, ru uintptr) (r1 int32) + +//go:noescape +func Ygets(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Ygetservbyname(tls *TLS, name uintptr, prots uintptr) (r uintptr) + +//go:noescape +func Ygetservbyname_r(tls *TLS, name uintptr, prots uintptr, se uintptr, buf uintptr, buflen Tsize_t, res uintptr) (r int32) + +//go:noescape +func Ygetservent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetsid(tls *TLS, pid Tpid_t) (r Tpid_t) + +//go:noescape +func Ygetsockname(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) + +//go:noescape +func Ygetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, optlen uintptr) (r2 int32) + +//go:noescape +func Ygetspent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetsubopt(tls *TLS, opt uintptr, keys uintptr, val uintptr) (r int32) + +//go:noescape +func Ygettext(tls *TLS, msgid uintptr) (r uintptr) + +//go:noescape +func Ygettimeofday(tls *TLS, tv uintptr, tz uintptr) (r int32) + +//go:noescape +func Ygetuid(tls *TLS) (r Tuid_t) + +//go:noescape +func Ygetusershell(tls *TLS) (r uintptr) + +//go:noescape +func Ygetutent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetutid(tls *TLS, ut uintptr) (r uintptr) + +//go:noescape +func Ygetutline(tls *TLS, ut uintptr) (r uintptr) + +//go:noescape +func Ygetutxent(tls *TLS) (r uintptr) + +//go:noescape +func Ygetutxid(tls *TLS, ut uintptr) (r uintptr) + +//go:noescape +func Ygetutxline(tls *TLS, ut uintptr) (r uintptr) + +//go:noescape +func Ygetw(tls *TLS, f uintptr) (r int32) + +//go:noescape +func Ygetwc(tls *TLS, f uintptr) (r Twint_t) + +//go:noescape +func Ygetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) + +//go:noescape +func Ygetwchar(tls *TLS) (r Twint_t) + +//go:noescape +func Ygetwchar_unlocked(tls *TLS) (r Twint_t) + +//go:noescape +func Ygetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) + +//go:noescape +func Yglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g_ uintptr) (r int32) + +//go:noescape +func __ccgo_abi0_glob_2(_0 *TLS, _1 uintptr, _2 int32, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_glob_2(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 int32) (_3 int32) { + return __ccgo_abi0_glob_2(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yglobfree(tls *TLS, g_ uintptr) + +//go:noescape +func Ygmtime(tls *TLS, t uintptr) (r uintptr) + +//go:noescape +func Ygmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) + +//go:noescape +func Ygrantpt(tls *TLS, fd int32) (r int32) + +//go:noescape +func Yhasmntopt(tls *TLS, mnt uintptr, opt uintptr) (r uintptr) + +//go:noescape +func Yhcreate(tls *TLS, nel Tsize_t) (r int32) + +//go:noescape +func Yhdestroy(tls *TLS) + +//go:noescape +func Yherror(tls *TLS, msg uintptr) + +//go:noescape +func Yhsearch(tls *TLS, item TENTRY, action TACTION) (r uintptr) + +//go:noescape +func Yhstrerror(tls *TLS, ecode int32) (r uintptr) + +//go:noescape +func Yhtonl(tls *TLS, n Tuint32_t) (r Tuint32_t) + +//go:noescape +func Yhtons(tls *TLS, n Tuint16_t) (r Tuint16_t) + +//go:noescape +func Yhypot(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yhypotf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Yhypotl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb uintptr) (r Tsize_t) + +//go:noescape +func Yiconv_close(tls *TLS, cd Ticonv_t) (r int32) + +//go:noescape +func Yiconv_open(tls *TLS, to uintptr, from uintptr) (r Ticonv_t) + +//go:noescape +func Yif_freenameindex(tls *TLS, idx uintptr) + +//go:noescape +func Yif_indextoname(tls *TLS, index uint32, name uintptr) (r1 uintptr) + +//go:noescape +func Yif_nameindex(tls *TLS) (r uintptr) + +//go:noescape +func Yif_nametoindex(tls *TLS, name uintptr) (r1 uint32) + +//go:noescape +func Yilogb(tls *TLS, x3 float64) (r int32) + +//go:noescape +func Yilogbf(tls *TLS, x3 float32) (r int32) + +//go:noescape +func Yilogbl(tls *TLS, x float64) (r int32) + +//go:noescape +func Yimaxabs(tls *TLS, a Tintmax_t) (r Tintmax_t) + +//go:noescape +func Yimaxdiv(tls *TLS, num Tintmax_t, den Tintmax_t) (r Timaxdiv_t) + +//go:noescape +func Yindex(tls *TLS, s uintptr, c int32) (r uintptr) + +//go:noescape +func Yinet_addr(tls *TLS, p uintptr) (r Tin_addr_t) + +//go:noescape +func Yinet_aton(tls *TLS, s0 uintptr, dest uintptr) (r int32) + +//go:noescape +func Yinet_lnaof(tls *TLS, in Tin_addr) (r Tin_addr_t) + +//go:noescape +func Yinet_makeaddr(tls *TLS, n Tin_addr_t, h Tin_addr_t) (r Tin_addr) + +//go:noescape +func Yinet_netof(tls *TLS, in Tin_addr) (r Tin_addr_t) + +//go:noescape +func Yinet_network(tls *TLS, p uintptr) (r Tin_addr_t) + +//go:noescape +func Yinet_ntoa(tls *TLS, _in Tin_addr) (r uintptr) + +//go:noescape +func Yinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l Tsocklen_t) (r uintptr) + +//go:noescape +func Yinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) (r int32) + +//go:noescape +func Yinit_module(tls *TLS, a uintptr, b uint64, c uintptr) (r int32) + +//go:noescape +func Yinitstate(tls *TLS, seed uint32, state uintptr, size Tsize_t) (r uintptr) + +//go:noescape +func Yinitstate_r(t *TLS, seed uint32, statebuf uintptr, statelen Tsize_t, buf uintptr) (_5 int32) + +//go:noescape +func Yinotify_add_watch(tls *TLS, fd int32, pathname uintptr, mask Tuint32_t) (r int32) + +//go:noescape +func Yinotify_init(tls *TLS) (r int32) + +//go:noescape +func Yinotify_init1(tls *TLS, flags int32) (r1 int32) + +//go:noescape +func Yinotify_rm_watch(tls *TLS, fd int32, wd int32) (r int32) + +//go:noescape +func Yinsque(tls *TLS, element uintptr, pred uintptr) + +//go:noescape +func Yioctl(tls *TLS, fd int32, req int32, va uintptr) (r1 int32) + +//go:noescape +func Yioperm(tls *TLS, from uint64, num uint64, turn_on int32) (r int32) + +//go:noescape +func Yiopl(tls *TLS, level int32) (r int32) + +//go:noescape +func Yisalnum(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisalnum_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yisalpha(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisalpha_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yisascii(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisastream(tls *TLS, fd int32) (r int32) + +//go:noescape +func Yisatty(tls *TLS, fd int32) (r1 int32) + +//go:noescape +func Yisblank(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisblank_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yiscntrl(tls *TLS, c int32) (r int32) + +//go:noescape +func Yiscntrl_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yisdigit(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yisgraph(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisgraph_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yislower(tls *TLS, c int32) (r int32) + +//go:noescape +func Yislower_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yisnan(t *TLS, x float64) (_2 int32) + +//go:noescape +func Yisnanf(t *TLS, arg float32) (_2 int32) + +//go:noescape +func Yisnanl(t *TLS, arg float64) (_2 int32) + +//go:noescape +func Yisprint(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisprint_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yispunct(tls *TLS, c int32) (r int32) + +//go:noescape +func Yispunct_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yissetugid(tls *TLS) (r int32) + +//go:noescape +func Yisspace(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisspace_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yisupper(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yiswalnum(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswalnum_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswalpha(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswalpha_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswblank(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswblank_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswcntrl(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswcntrl_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswctype(tls *TLS, wc Twint_t, type1 Twctype_t) (r int32) + +//go:noescape +func Yiswctype_l(tls *TLS, c Twint_t, t Twctype_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswdigit(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswgraph(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswgraph_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswlower(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswprint(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswprint_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswpunct(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswpunct_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswspace(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswspace_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswupper(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yiswxdigit(tls *TLS, wc Twint_t) (r int32) + +//go:noescape +func Yiswxdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) + +//go:noescape +func Yisxdigit(tls *TLS, c int32) (r int32) + +//go:noescape +func Yisxdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Yj0(tls *TLS, x float64) (r1 float64) + +//go:noescape +func Yj0f(tls *TLS, x float32) (r1 float32) + +//go:noescape +func Yj1(tls *TLS, x float64) (r1 float64) + +//go:noescape +func Yj1f(tls *TLS, x float32) (r1 float32) + +//go:noescape +func Yjn(tls *TLS, n int32, x float64) (r float64) + +//go:noescape +func Yjnf(tls *TLS, n int32, x float32) (r float32) + +//go:noescape +func Yjrand48(tls *TLS, s uintptr) (r int64) + +//go:noescape +func Ykill(tls *TLS, pid Tpid_t, sig int32) (r int32) + +//go:noescape +func Ykillpg(tls *TLS, pgid Tpid_t, sig int32) (r int32) + +//go:noescape +func Yklogctl(tls *TLS, type1 int32, buf uintptr, len1 int32) (r int32) + +//go:noescape +func Yl64a(tls *TLS, x0 int64) (r uintptr) + +//go:noescape +func Ylabs(tls *TLS, a int64) (r int64) + +//go:noescape +func Ylchmod(tls *TLS, path uintptr, mode Tmode_t) (r int32) + +//go:noescape +func Ylchown(tls *TLS, path uintptr, uid Tuid_t, gid Tgid_t) (r int32) + +//go:noescape +func Ylckpwdf(tls *TLS) (r int32) + +//go:noescape +func Ylcong48(tls *TLS, p uintptr) + +//go:noescape +func Yldexp(tls *TLS, x float64, n int32) (r float64) + +//go:noescape +func Yldexpf(tls *TLS, x float32, n int32) (r float32) + +//go:noescape +func Yldexpl(tls *TLS, x float64, n int32) (r float64) + +//go:noescape +func Yldiv(tls *TLS, num int64, den int64) (r Tldiv_t) + +//go:noescape +func Ylfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) + +//go:noescape +func __ccgo_abi0_lfind_4(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_lfind_4(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_lfind_4(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Ylgamma(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylgamma_r(tls *TLS, x float64, signgamp uintptr) (r float64) + +//go:noescape +func Ylgammaf(tls *TLS, x float32) (r float32) + +//go:noescape +func Ylgammaf_r(tls *TLS, x float32, signgamp uintptr) (r float32) + +//go:noescape +func Ylgammal(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylgammal_r(tls *TLS, x float64, sg uintptr) (r float64) + +//go:noescape +func Ylgetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) + +//go:noescape +func Ylink(tls *TLS, existing uintptr, new1 uintptr) (r int32) + +//go:noescape +func Ylinkat(tls *TLS, fd1 int32, existing uintptr, fd2 int32, new1 uintptr, flag int32) (r int32) + +//go:noescape +func Ylisten(tls *TLS, fd int32, backlog int32) (r1 int32) + +//go:noescape +func Ylistxattr(tls *TLS, path uintptr, list uintptr, size Tsize_t) (r Tssize_t) + +//go:noescape +func Yllabs(tls *TLS, a int64) (r int64) + +//go:noescape +func Ylldiv(tls *TLS, num int64, den int64) (r Tlldiv_t) + +//go:noescape +func Yllistxattr(tls *TLS, path uintptr, list uintptr, size Tsize_t) (r Tssize_t) + +//go:noescape +func Yllrint(tls *TLS, x float64) (r int64) + +//go:noescape +func Yllrintf(tls *TLS, x float32) (r int64) + +//go:noescape +func Yllrintl(tls *TLS, x float64) (r int64) + +//go:noescape +func Yllround(tls *TLS, x float64) (r int64) + +//go:noescape +func Yllroundf(tls *TLS, x float32) (r int64) + +//go:noescape +func Yllroundl(tls *TLS, x float64) (r int64) + +//go:noescape +func Ylocaleconv(tls *TLS) (r uintptr) + +//go:noescape +func Ylocaltime(tls *TLS, t uintptr) (r uintptr) + +//go:noescape +func Ylocaltime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) + +//go:noescape +func Ylockf(tls *TLS, fd int32, op int32, size Toff_t) (r int32) + +//go:noescape +func Ylog(tls *TLS, x1 float64) (r1 float64) + +//go:noescape +func Ylog10(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylog10f(tls *TLS, x float32) (r float32) + +//go:noescape +func Ylog10l(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylog1p(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Ylog1pf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Ylog1pl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylog2(tls *TLS, x1 float64) (r1 float64) + +//go:noescape +func Ylog2f(tls *TLS, x1 float32) (r1 float32) + +//go:noescape +func Ylog2l(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylogb(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylogbf(tls *TLS, x float32) (r float32) + +//go:noescape +func Ylogbl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylogf(tls *TLS, x1 float32) (r1 float32) + +//go:noescape +func Ylogin_tty(tls *TLS, fd int32) (r int32) + +//go:noescape +func Ylogl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ylongjmp(t *TLS, env uintptr, val int32) + +//go:noescape +func Ylrand48(tls *TLS) (r int64) + +//go:noescape +func Ylremovexattr(tls *TLS, path uintptr, name uintptr) (r int32) + +//go:noescape +func Ylrint(tls *TLS, x float64) (r int64) + +//go:noescape +func Ylrintf(tls *TLS, x float32) (r int64) + +//go:noescape +func Ylrintl(tls *TLS, x float64) (r int64) + +//go:noescape +func Ylround(tls *TLS, x float64) (r int64) + +//go:noescape +func Ylroundf(tls *TLS, x float32) (r int64) + +//go:noescape +func Ylroundl(tls *TLS, x float64) (r int64) + +//go:noescape +func Ylsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) + +//go:noescape +func __ccgo_abi0_lsearch_4(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_lsearch_4(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_lsearch_4(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Ylseek(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) + +//go:noescape +func Ylseek64(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) + +//go:noescape +func Ylsetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) + +//go:noescape +func Ylstat(tls *TLS, path uintptr, buf uintptr) (r int32) + +//go:noescape +func Ylstat64(tls *TLS, path uintptr, buf uintptr) (r int32) + +//go:noescape +func Ylutimes(tls *TLS, filename uintptr, tv uintptr) (r int32) + +//go:noescape +func Ymadvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) + +//go:noescape +func Ymalloc(tls *TLS, n Tsize_t) (r uintptr) + +//go:noescape +func Ymalloc_usable_size(tls *TLS, p uintptr) (r Tsize_t) + +//go:noescape +func Ymblen(tls *TLS, s uintptr, n Tsize_t) (r int32) + +//go:noescape +func Ymbrlen(tls *TLS, s uintptr, n Tsize_t, st uintptr) (r Tsize_t) + +//go:noescape +func Ymbrtoc16(tls *TLS, pc16 uintptr, s uintptr, n Tsize_t, ps uintptr) (r Tsize_t) + +//go:noescape +func Ymbrtoc32(tls *TLS, pc32 uintptr, s uintptr, n Tsize_t, ps uintptr) (r Tsize_t) + +//go:noescape +func Ymbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize_t) + +//go:noescape +func Ymbsinit(tls *TLS, st uintptr) (r int32) + +//go:noescape +func Ymbsnrtowcs(tls *TLS, wcs uintptr, src uintptr, n Tsize_t, wn Tsize_t, st uintptr) (r Tsize_t) + +//go:noescape +func Ymbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Tsize_t) + +//go:noescape +func Ymbstowcs(tls *TLS, ws uintptr, _s uintptr, wn Tsize_t) (r Tsize_t) + +//go:noescape +func Ymbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) + +//go:noescape +func Ymemccpy(tls *TLS, dest uintptr, src uintptr, c int32, n Tsize_t) (r uintptr) + +//go:noescape +func Ymemchr(tls *TLS, src uintptr, c int32, n Tsize_t) (r uintptr) + +//go:noescape +func Ymemcmp(tls *TLS, vl uintptr, vr uintptr, n Tsize_t) (r1 int32) + +//go:noescape +func Ymemcpy(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ymemfd_create(tls *TLS, name uintptr, flags uint32) (r int32) + +//go:noescape +func Ymemmem(tls *TLS, h0 uintptr, k Tsize_t, n0 uintptr, l Tsize_t) (r uintptr) + +//go:noescape +func Ymemmove(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ymempcpy(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ymemrchr(tls *TLS, m uintptr, c int32, n Tsize_t) (r uintptr) + +//go:noescape +func Ymemset(tls *TLS, dest uintptr, c int32, n Tsize_t) (r uintptr) + +//go:noescape +func Ymincore(tls *TLS, addr uintptr, len1 Tsize_t, vec uintptr) (r int32) + +//go:noescape +func Ymkdir(tls *TLS, path uintptr, mode Tmode_t) (r int32) + +//go:noescape +func Ymkdirat(tls *TLS, fd int32, path uintptr, mode Tmode_t) (r int32) + +//go:noescape +func Ymkdtemp(tls *TLS, template uintptr) (r uintptr) + +//go:noescape +func Ymkfifo(tls *TLS, path uintptr, mode Tmode_t) (r int32) + +//go:noescape +func Ymkfifoat(tls *TLS, fd int32, path uintptr, mode Tmode_t) (r int32) + +//go:noescape +func Ymknod(tls *TLS, path uintptr, mode Tmode_t, dev Tdev_t) (r int32) + +//go:noescape +func Ymknodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, dev Tdev_t) (r int32) + +//go:noescape +func Ymkostemp(tls *TLS, template uintptr, flags int32) (r int32) + +//go:noescape +func Ymkostemps(tls *TLS, template uintptr, len1 int32, flags int32) (r int32) + +//go:noescape +func Ymkstemp(tls *TLS, template uintptr) (r int32) + +//go:noescape +func Ymkstemp64(tls *TLS, template uintptr) (r int32) + +//go:noescape +func Ymkstemps(tls *TLS, template uintptr, len1 int32) (r int32) + +//go:noescape +func Ymkstemps64(tls *TLS, template uintptr, len1 int32) (r int32) + +//go:noescape +func Ymktemp(tls *TLS, template uintptr) (r uintptr) + +//go:noescape +func Ymktime(tls *TLS, tm uintptr) (r Ttime_t) + +//go:noescape +func Ymlock(tls *TLS, addr uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ymlock2(tls *TLS, addr uintptr, len1 Tsize_t, flags uint32) (r int32) + +//go:noescape +func Ymlockall(tls *TLS, flags int32) (r int32) + +//go:noescape +func Ymmap(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) + +//go:noescape +func Ymmap64(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) + +//go:noescape +func Ymodf(tls *TLS, x float64, iptr uintptr) (r float64) + +//go:noescape +func Ymodff(tls *TLS, x float32, iptr uintptr) (r float32) + +//go:noescape +func Ymodfl(tls *TLS, x float64, iptr uintptr) (r1 float64) + +//go:noescape +func Ymount(tls *TLS, special uintptr, dir uintptr, fstype uintptr, flags uint64, data uintptr) (r int32) + +//go:noescape +func Ymprotect(tls *TLS, addr uintptr, len1 Tsize_t, prot int32) (r int32) + +//go:noescape +func Ymrand48(tls *TLS) (r int64) + +//go:noescape +func Ymremap(tls *TLS, old_addr uintptr, old_len Tsize_t, new_len Tsize_t, flags int32, va uintptr) (r uintptr) + +//go:noescape +func Ymsgctl(tls *TLS, q int32, cmd int32, buf uintptr) (r1 int32) + +//go:noescape +func Ymsgget(tls *TLS, k Tkey_t, flag int32) (r int32) + +//go:noescape +func Ymsgrcv(tls *TLS, q int32, m uintptr, len1 Tsize_t, type1 int64, flag int32) (r Tssize_t) + +//go:noescape +func Ymsgsnd(tls *TLS, q int32, m uintptr, len1 Tsize_t, flag int32) (r int32) + +//go:noescape +func Ymsync(tls *TLS, start uintptr, len1 Tsize_t, flags int32) (r int32) + +//go:noescape +func Ymunlock(tls *TLS, addr uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ymunlockall(tls *TLS) (r int32) + +//go:noescape +func Ymunmap(tls *TLS, start uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Yname_to_handle_at(tls *TLS, dirfd int32, pathname uintptr, handle uintptr, mount_id uintptr, flags int32) (r int32) + +//go:noescape +func Ynan(tls *TLS, s uintptr) (r float64) + +//go:noescape +func Ynanf(tls *TLS, s uintptr) (r float32) + +//go:noescape +func Ynanl(tls *TLS, s uintptr) (r float64) + +//go:noescape +func Ynanosleep(tls *TLS, req uintptr, rem uintptr) (r int32) + +//go:noescape +func Ynewlocale(tls *TLS, mask int32, name uintptr, loc Tlocale_t) (r Tlocale_t) + +//go:noescape +func Ynextafter(tls *TLS, x3 float64, y3 float64) (r float64) + +//go:noescape +func Ynextafterf(tls *TLS, x3 float32, y3 float32) (r float32) + +//go:noescape +func Ynextafterl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Ynexttoward(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Ynexttowardf(tls *TLS, x3 float32, y3 float64) (r float32) + +//go:noescape +func Ynexttowardl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Ynftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) + +//go:noescape +func __ccgo_abi0_nftw_1(_0 *TLS, _1 uintptr, _2 uintptr, _3 int32, _4 uintptr, __ccgo_fp uintptr) (_5 int32) + +func __ccgo_abiInternal_nftw_1(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr, _3 int32, _4 uintptr) (_5 int32) { + return __ccgo_abi0_nftw_1(_0, _1, _2, _3, _4, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yngettext(tls *TLS, msgid1 uintptr, msgid2 uintptr, n uint64) (r uintptr) + +//go:noescape +func Ynice(tls *TLS, inc int32) (r int32) + +//go:noescape +func Ynl_langinfo(tls *TLS, item Tnl_item) (r uintptr) + +//go:noescape +func Ynl_langinfo_l(tls *TLS, item Tnl_item, loc Tlocale_t) (r uintptr) + +//go:noescape +func Ynrand48(tls *TLS, s uintptr) (r int64) + +//go:noescape +func Yns_get16(tls *TLS, cp uintptr) (r uint32) + +//go:noescape +func Yns_get32(tls *TLS, cp uintptr) (r uint64) + +//go:noescape +func Yns_initparse(tls *TLS, msg uintptr, msglen int32, handle uintptr) (r1 int32) + +//go:noescape +func Yns_name_uncompress(tls *TLS, msg uintptr, eom uintptr, src uintptr, dst uintptr, dstsiz Tsize_t) (r1 int32) + +//go:noescape +func Yns_parserr(tls *TLS, handle uintptr, section Tns_sect, rrnum int32, rr uintptr) (r1 int32) + +//go:noescape +func Yns_put16(tls *TLS, s uint32, cp uintptr) + +//go:noescape +func Yns_put32(tls *TLS, l uint64, cp uintptr) + +//go:noescape +func Yns_skiprr(tls *TLS, ptr uintptr, eom uintptr, section Tns_sect, count int32) (r1 int32) + +//go:noescape +func Yntohl(tls *TLS, n Tuint32_t) (r Tuint32_t) + +//go:noescape +func Yntohs(tls *TLS, n Tuint16_t) (r Tuint16_t) + +//go:noescape +func Yobstack_free(t *TLS, obstack, obj uintptr) + +//go:noescape +func Yobstack_vprintf(t *TLS, obstack, template, va uintptr) (_2 int32) + +//go:noescape +func Yopen(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) + +//go:noescape +func Yopen64(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) + +//go:noescape +func Yopen_by_handle_at(tls *TLS, mount_fd int32, handle uintptr, flags int32) (r int32) + +//go:noescape +func Yopen_memstream(tls *TLS, bufp uintptr, sizep uintptr) (r uintptr) + +//go:noescape +func Yopen_wmemstream(tls *TLS, bufp uintptr, sizep uintptr) (r uintptr) + +//go:noescape +func Yopenat(tls *TLS, fd int32, filename uintptr, flags int32, va uintptr) (r int32) + +//go:noescape +func Yopendir(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Yopenlog(tls *TLS, ident uintptr, opt int32, facility int32) + +//go:noescape +func Yopenpty(tls *TLS, pm uintptr, ps uintptr, name uintptr, tio uintptr, ws uintptr) (r int32) + +//go:noescape +func Ypathconf(tls *TLS, path uintptr, name int32) (r int64) + +//go:noescape +func Ypause(tls *TLS) (r int32) + +//go:noescape +func Ypclose(tls *TLS, f uintptr) (r1 int32) + +//go:noescape +func Yperror(tls *TLS, msg uintptr) + +//go:noescape +func Ypersonality(tls *TLS, persona uint64) (r int32) + +//go:noescape +func Ypipe(tls *TLS, fd uintptr) (r int32) + +//go:noescape +func Ypipe2(tls *TLS, fd uintptr, flag int32) (r int32) + +//go:noescape +func Ypivot_root(tls *TLS, new1 uintptr, old uintptr) (r int32) + +//go:noescape +func Ypoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) + +//go:noescape +func Ypopen(t *TLS, command, type1 uintptr) (_2 uintptr) + +//go:noescape +func Yposix_close(tls *TLS, fd int32, flags int32) (r int32) + +//go:noescape +func Yposix_fadvise(tls *TLS, fd int32, base Toff_t, len1 Toff_t, advice int32) (r int32) + +//go:noescape +func Yposix_fallocate(tls *TLS, fd int32, base Toff_t, len1 Toff_t) (r int32) + +//go:noescape +func Yposix_madvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) + +//go:noescape +func Yposix_openpt(tls *TLS, flags int32) (r1 int32) + +//go:noescape +func Yposix_spawn_file_actions_addchdir_np(tls *TLS, fa uintptr, path uintptr) (r int32) + +//go:noescape +func Yposix_spawn_file_actions_addclose(tls *TLS, fa uintptr, fd int32) (r int32) + +//go:noescape +func Yposix_spawn_file_actions_adddup2(tls *TLS, fa uintptr, srcfd int32, fd int32) (r int32) + +//go:noescape +func Yposix_spawn_file_actions_addfchdir_np(tls *TLS, fa uintptr, fd int32) (r int32) + +//go:noescape +func Yposix_spawn_file_actions_addopen(tls *TLS, fa uintptr, fd int32, path uintptr, flags int32, mode Tmode_t) (r int32) + +//go:noescape +func Yposix_spawn_file_actions_destroy(tls *TLS, fa uintptr) (r int32) + +//go:noescape +func Yposix_spawn_file_actions_init(tls *TLS, fa uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_destroy(tls *TLS, attr uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_getflags(tls *TLS, attr uintptr, flags uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_getpgroup(tls *TLS, attr uintptr, pgrp uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_getschedparam(tls *TLS, attr uintptr, schedparam uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_getschedpolicy(tls *TLS, attr uintptr, policy uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_getsigdefault(tls *TLS, attr uintptr, def uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_getsigmask(tls *TLS, attr uintptr, mask uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_init(tls *TLS, attr uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_setflags(tls *TLS, attr uintptr, flags int16) (r int32) + +//go:noescape +func Yposix_spawnattr_setpgroup(tls *TLS, attr uintptr, pgrp Tpid_t) (r int32) + +//go:noescape +func Yposix_spawnattr_setschedparam(tls *TLS, attr uintptr, schedparam uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_setschedpolicy(tls *TLS, attr uintptr, policy int32) (r int32) + +//go:noescape +func Yposix_spawnattr_setsigdefault(tls *TLS, attr uintptr, def uintptr) (r int32) + +//go:noescape +func Yposix_spawnattr_setsigmask(tls *TLS, attr uintptr, mask uintptr) (r int32) + +//go:noescape +func Ypow(tls *TLS, x1 float64, y1 float64) (r float64) + +//go:noescape +func Ypow10(tls *TLS, x float64) (r float64) + +//go:noescape +func Ypow10f(tls *TLS, x float32) (r float32) + +//go:noescape +func Ypow10l(tls *TLS, x float64) (r float64) + +//go:noescape +func Ypowf(tls *TLS, x1 float32, y1 float32) (r float32) + +//go:noescape +func Ypowl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32) + +//go:noescape +func Yprctl(tls *TLS, op int32, va uintptr) (r int32) + +//go:noescape +func Ypread(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssize_t) + +//go:noescape +func Ypreadv(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) + +//go:noescape +func Ypreadv2(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t, flags int32) (r Tssize_t) + +//go:noescape +func Yprintf(tls *TLS, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Yprlimit(tls *TLS, pid Tpid_t, resource int32, new_limit uintptr, old_limit uintptr) (r1 int32) + +//go:noescape +func Yprocess_vm_readv(tls *TLS, pid Tpid_t, lvec uintptr, liovcnt uint64, rvec uintptr, riovcnt uint64, flags uint64) (r Tssize_t) + +//go:noescape +func Yprocess_vm_writev(tls *TLS, pid Tpid_t, lvec uintptr, liovcnt uint64, rvec uintptr, riovcnt uint64, flags uint64) (r Tssize_t) + +//go:noescape +func Ypselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r int32) + +//go:noescape +func Ypsiginfo(tls *TLS, si uintptr, msg uintptr) + +//go:noescape +func Ypsignal(tls *TLS, sig int32, msg uintptr) + +//go:noescape +func Ypthread_atfork(tls *TLS, prepare, parent, child uintptr) (_2 int32) + +//go:noescape +func Ypthread_attr_destroy(tls *TLS, a uintptr) (_2 int32) + +//go:noescape +func Ypthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) (_3 int32) + +//go:noescape +func Ypthread_attr_init(tls *TLS, a uintptr) (_2 int32) + +//go:noescape +func Ypthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) (r int32) + +//go:noescape +func Ypthread_attr_setscope(tls *TLS, a uintptr, scope int32) (_3 int32) + +//go:noescape +func Ypthread_attr_setstacksize(tls *TLS, a uintptr, stacksite Tsize_t) (_3 int32) + +//go:noescape +func Ypthread_cleanup_pop(tls *TLS, run int32) + +//go:noescape +func Ypthread_cleanup_push(tls *TLS, f, x uintptr) + +//go:noescape +func Ypthread_cond_broadcast(tls *TLS, c uintptr) (_2 int32) + +//go:noescape +func Ypthread_cond_destroy(tls *TLS, c uintptr) (_2 int32) + +//go:noescape +func Ypthread_cond_init(tls *TLS, c, a uintptr) (_2 int32) + +//go:noescape +func Ypthread_cond_signal(tls *TLS, c uintptr) (_2 int32) + +//go:noescape +func Ypthread_cond_timedwait(tls *TLS, c, m, ts uintptr) (r int32) + +//go:noescape +func Ypthread_cond_wait(tls *TLS, c, m uintptr) (_2 int32) + +//go:noescape +func Ypthread_create(tls *TLS, res, attrp, entry, arg uintptr) (_2 int32) + +//go:noescape +func Ypthread_detach(tls *TLS, t uintptr) (_2 int32) + +//go:noescape +func Ypthread_equal(tls *TLS, t, u uintptr) (_2 int32) + +//go:noescape +func Ypthread_exit(tls *TLS, result uintptr) + +//go:noescape +func Ypthread_getspecific(tls *TLS, k Tpthread_key_t) (_2 uintptr) + +//go:noescape +func Ypthread_join(tls *TLS, t Tpthread_t, res uintptr) (r int32) + +//go:noescape +func Ypthread_key_create(tls *TLS, k uintptr, dtor uintptr) (_3 int32) + +//go:noescape +func Ypthread_key_delete(tls *TLS, k Tpthread_key_t) (_2 int32) + +//go:noescape +func Ypthread_mutex_destroy(tls *TLS, m uintptr) (_2 int32) + +//go:noescape +func Ypthread_mutex_init(tls *TLS, m, a uintptr) (_2 int32) + +//go:noescape +func Ypthread_mutex_lock(tls *TLS, m uintptr) (_2 int32) + +//go:noescape +func Ypthread_mutex_trylock(tls *TLS, m uintptr) (_2 int32) + +//go:noescape +func Ypthread_mutex_unlock(tls *TLS, m uintptr) (_2 int32) + +//go:noescape +func Ypthread_mutexattr_destroy(tls *TLS, a uintptr) (_2 int32) + +//go:noescape +func Ypthread_mutexattr_init(tls *TLS, a uintptr) (_2 int32) + +//go:noescape +func Ypthread_mutexattr_settype(tls *TLS, a uintptr, typ int32) (_3 int32) + +//go:noescape +func Ypthread_self(tls *TLS) (_1 uintptr) + +//go:noescape +func Ypthread_setcancelstate(tls *TLS, new int32, old uintptr) (_3 int32) + +//go:noescape +func Ypthread_setspecific(tls *TLS, k Tpthread_key_t, x uintptr) (_3 int32) + +//go:noescape +func Ypthread_sigmask(tls *TLS, now int32, set, old uintptr) (_3 int32) + +//go:noescape +func Yptrace(tls *TLS, req int32, va uintptr) (r int64) + +//go:noescape +func Yptsname(tls *TLS, fd int32) (r uintptr) + +//go:noescape +func Yptsname_r(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Yputc(tls *TLS, c1 int32, f1 uintptr) (r int32) + +//go:noescape +func Yputc_unlocked(tls *TLS, c int32, f uintptr) (r int32) + +//go:noescape +func Yputchar(tls *TLS, c1 int32) (r int32) + +//go:noescape +func Yputchar_unlocked(tls *TLS, c int32) (r int32) + +//go:noescape +func Yputenv(tls *TLS, s uintptr) (r int32) + +//go:noescape +func Yputgrent(tls *TLS, gr uintptr, f uintptr) (r1 int32) + +//go:noescape +func Yputpwent(tls *TLS, pw uintptr, f uintptr) (r int32) + +//go:noescape +func Yputs(tls *TLS, s uintptr) (r1 int32) + +//go:noescape +func Yputspent(tls *TLS, sp uintptr, f uintptr) (r int32) + +//go:noescape +func Ypututline(tls *TLS, ut uintptr) (r uintptr) + +//go:noescape +func Ypututxline(tls *TLS, ut uintptr) (r uintptr) + +//go:noescape +func Yputw(tls *TLS, _x int32, f uintptr) (r int32) + +//go:noescape +func Yputwc(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) + +//go:noescape +func Yputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) + +//go:noescape +func Yputwchar(tls *TLS, c Twchar_t) (r Twint_t) + +//go:noescape +func Yputwchar_unlocked(tls *TLS, c Twchar_t) (r Twint_t) + +//go:noescape +func Ypwrite(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssize_t) + +//go:noescape +func Ypwritev(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) + +//go:noescape +func Ypwritev2(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t, flags int32) (r Tssize_t) + +//go:noescape +func Yqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) + +//go:noescape +func __ccgo_abi0_qsort_3(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_qsort_3(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_qsort_3(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) + +//go:noescape +func __ccgo_abi0_qsort_r_3(_0 *TLS, _1 uintptr, _2 uintptr, _3 uintptr, __ccgo_fp uintptr) (_4 int32) + +func __ccgo_abiInternal_qsort_r_3(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr, _3 uintptr) (_4 int32) { + return __ccgo_abi0_qsort_r_3(_0, _1, _2, _3, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yquick_exit(tls *TLS, code int32) + +//go:noescape +func Yquotactl(tls *TLS, cmd int32, special uintptr, id int32, addr uintptr) (r int32) + +//go:noescape +func Yraise(tls *TLS, sig int32) (r int32) + +//go:noescape +func Yrand(tls *TLS) (r int32) + +//go:noescape +func Yrand_r(tls *TLS, seed uintptr) (r int32) + +//go:noescape +func Yrandom(tls *TLS) (r int64) + +//go:noescape +func Yrandom_r(t *TLS, buf, result uintptr) (_2 int32) + +//go:noescape +func Yread(tls *TLS, fd int32, buf uintptr, count Tsize_t) (r Tssize_t) + +//go:noescape +func Yreadahead(tls *TLS, fd int32, pos Toff_t, len1 Tsize_t) (r Tssize_t) + +//go:noescape +func Yreaddir(tls *TLS, dir uintptr) (r uintptr) + +//go:noescape +func Yreaddir64(tls *TLS, dir uintptr) (r uintptr) + +//go:noescape +func Yreaddir_r(tls *TLS, dir uintptr, buf uintptr, result uintptr) (r int32) + +//go:noescape +func Yreadlink(tls *TLS, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_t) + +//go:noescape +func Yreadlinkat(tls *TLS, fd int32, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_t) + +//go:noescape +func Yreadv(tls *TLS, fd int32, iov uintptr, count int32) (r Tssize_t) + +//go:noescape +func Yrealloc(tls *TLS, p uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Yreallocarray(tls *TLS, ptr uintptr, m Tsize_t, n Tsize_t) (r uintptr) + +//go:noescape +func Yrealpath(tls *TLS, filename uintptr, resolved uintptr) (r uintptr) + +//go:noescape +func Yreboot(tls *TLS, type1 int32) (r int32) + +//go:noescape +func Yrecv(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32) (r Tssize_t) + +//go:noescape +func Yrecvfrom(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr uintptr, alen uintptr) (r1 Tssize_t) + +//go:noescape +func Yrecvmmsg(tls *TLS, fd int32, msgvec uintptr, vlen uint32, flags uint32, timeout uintptr) (r int32) + +//go:noescape +func Yrecvmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r2 Tssize_t) + +//go:noescape +func Yregcomp(tls *TLS, preg uintptr, regex uintptr, cflags int32) (r int32) + +//go:noescape +func Yregerror(tls *TLS, e int32, preg uintptr, buf uintptr, size Tsize_t) (r Tsize_t) + +//go:noescape +func Yregexec(tls *TLS, preg uintptr, string1 uintptr, nmatch Tsize_t, pmatch uintptr, eflags int32) (r int32) + +//go:noescape +func Yregfree(tls *TLS, preg uintptr) + +//go:noescape +func Yremainder(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yremainderf(tls *TLS, x float32, y float32) (r float32) + +//go:noescape +func Yremainderl(tls *TLS, x float64, y float64) (r float64) + +//go:noescape +func Yremap_file_pages(tls *TLS, addr uintptr, size Tsize_t, prot int32, pgoff Tsize_t, flags int32) (r int32) + +//go:noescape +func Yremove(tls *TLS, path uintptr) (r1 int32) + +//go:noescape +func Yremovexattr(tls *TLS, path uintptr, name uintptr) (r int32) + +//go:noescape +func Yremque(tls *TLS, element uintptr) + +//go:noescape +func Yremquo(tls *TLS, x float64, y float64, quo uintptr) (r float64) + +//go:noescape +func Yremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) + +//go:noescape +func Yremquol(tls *TLS, x float64, y float64, quo uintptr) (r float64) + +//go:noescape +func Yrename(tls *TLS, old uintptr, new1 uintptr) (r int32) + +//go:noescape +func Yrenameat(tls *TLS, oldfd int32, old uintptr, newfd int32, new1 uintptr) (r int32) + +//go:noescape +func Yrenameat2(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath uintptr, flags int32) (_6 int32) + +//go:noescape +func Yres_init(tls *TLS) (r int32) + +//go:noescape +func Yres_mkquery(tls *TLS, op int32, dname uintptr, class int32, type1 int32, data uintptr, datalen int32, newrr uintptr, buf uintptr, buflen int32) (r int32) + +//go:noescape +func Yres_send(tls *TLS, _msg uintptr, _msglen int32, _answer uintptr, _anslen int32) (r int32) + +//go:noescape +func Yrewind(tls *TLS, f uintptr) + +//go:noescape +func Yrewinddir(tls *TLS, dir uintptr) + +//go:noescape +func Yrindex(tls *TLS, s uintptr, c int32) (r uintptr) + +//go:noescape +func Yrint(tls *TLS, x float64) (r float64) + +//go:noescape +func Yrintf(tls *TLS, x float32) (r float32) + +//go:noescape +func Yrintl(tls *TLS, x float64) (r float64) + +//go:noescape +func Yrmdir(tls *TLS, path uintptr) (r int32) + +//go:noescape +func Yround(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Yroundf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Yroundl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ysbrk(tls *TLS, inc Tintptr_t) (r uintptr) + +//go:noescape +func Yscalb(tls *TLS, x float64, fn float64) (r float64) + +//go:noescape +func Yscalbf(tls *TLS, x float32, fn float32) (r float32) + +//go:noescape +func Yscalbln(tls *TLS, x float64, n int64) (r float64) + +//go:noescape +func Yscalblnf(tls *TLS, x float32, n int64) (r float32) + +//go:noescape +func Yscalblnl(tls *TLS, x float64, n int64) (r float64) + +//go:noescape +func Yscalbn(tls *TLS, x float64, n int32) (r float64) + +//go:noescape +func Yscalbnf(tls *TLS, x float32, n int32) (r float32) + +//go:noescape +func Yscalbnl(tls *TLS, x float64, n int32) (r float64) + +//go:noescape +func Yscandir(tls *TLS, path uintptr, res uintptr, __ccgo_fp_sel uintptr, __ccgo_fp_cmp uintptr) (r int32) + +//go:noescape +func __ccgo_abi0_scandir_2(_0 *TLS, _1 uintptr, __ccgo_fp uintptr) (_2 int32) + +func __ccgo_abiInternal_scandir_2(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr) (_2 int32) { + return __ccgo_abi0_scandir_2(_0, _1, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func __ccgo_abi0_scandir_3(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_scandir_3(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_scandir_3(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ysched_yield(tls *TLS) (_1 int32) + +//go:noescape +func Ysecure_getenv(tls *TLS, name uintptr) (r uintptr) + +//go:noescape +func Yseed48(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Yseekdir(tls *TLS, dir uintptr, off int64) + +//go:noescape +func Yselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r int32) + +//go:noescape +func Ysemctl(tls *TLS, id int32, num int32, cmd int32, va uintptr) (r1 int32) + +//go:noescape +func Ysemget(tls *TLS, key Tkey_t, n int32, fl int32) (r int32) + +//go:noescape +func Ysemop(tls *TLS, id int32, buf uintptr, n Tsize_t) (r int32) + +//go:noescape +func Ysemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r int32) + +//go:noescape +func Ysend(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32) (r Tssize_t) + +//go:noescape +func Ysendfile(tls *TLS, out_fd int32, in_fd int32, ofs uintptr, count Tsize_t) (r Tssize_t) + +//go:noescape +func Ysendmmsg(tls *TLS, fd int32, msgvec uintptr, vlen uint32, flags uint32) (r1 int32) + +//go:noescape +func Ysendmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r1 Tssize_t) + +//go:noescape +func Ysendto(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr uintptr, alen Tsocklen_t) (r1 Tssize_t) + +//go:noescape +func Ysetbuf(tls *TLS, f uintptr, buf uintptr) + +//go:noescape +func Ysetbuffer(tls *TLS, f uintptr, buf uintptr, size Tsize_t) + +//go:noescape +func Ysetdomainname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ysetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) (r int32) + +//go:noescape +func Ysetfsgid(tls *TLS, gid Tgid_t) (r int32) + +//go:noescape +func Ysetfsuid(tls *TLS, uid Tuid_t) (r int32) + +//go:noescape +func Ysetgid(tls *TLS, gid Tgid_t) (r int32) + +//go:noescape +func Ysetgrent(tls *TLS) + +//go:noescape +func Ysethostent(tls *TLS, x int32) + +//go:noescape +func Ysethostname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) + +//go:noescape +func Ysetitimer(tls *TLS, which int32, new1 uintptr, old uintptr) (r1 int32) + +//go:noescape +func Ysetjmp(t *TLS, env uintptr) (_2 int32) + +//go:noescape +func Ysetkey(tls *TLS, key uintptr) + +//go:noescape +func Ysetlinebuf(tls *TLS, f uintptr) + +//go:noescape +func Ysetlocale(tls *TLS, cat int32, name uintptr) (r uintptr) + +//go:noescape +func Ysetlogmask(tls *TLS, maskpri int32) (r int32) + +//go:noescape +func Ysetmntent(tls *TLS, name uintptr, mode uintptr) (r uintptr) + +//go:noescape +func Ysetnetent(tls *TLS, x int32) + +//go:noescape +func Ysetns(tls *TLS, fd int32, nstype int32) (r int32) + +//go:noescape +func Ysetpgid(tls *TLS, pid Tpid_t, pgid Tpid_t) (r int32) + +//go:noescape +func Ysetpgrp(tls *TLS) (r Tpid_t) + +//go:noescape +func Ysetpriority(tls *TLS, which int32, who Tid_t, prio int32) (r int32) + +//go:noescape +func Ysetprotoent(tls *TLS, stayopen int32) + +//go:noescape +func Ysetpwent(tls *TLS) + +//go:noescape +func Ysetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) + +//go:noescape +func Ysetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) + +//go:noescape +func Ysetservent(tls *TLS, stayopen int32) + +//go:noescape +func Ysetsid(tls *TLS) (r Tpid_t) + +//go:noescape +func Ysetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, optlen Tsocklen_t) (r2 int32) + +//go:noescape +func Ysetspent(tls *TLS) + +//go:noescape +func Ysetstate(tls *TLS, state uintptr) (r uintptr) + +//go:noescape +func Ysettimeofday(tls *TLS, tv uintptr, tz uintptr) (r int32) + +//go:noescape +func Ysetuid(tls *TLS, uid Tuid_t) (r int32) + +//go:noescape +func Ysetusershell(tls *TLS) + +//go:noescape +func Ysetutent(tls *TLS) + +//go:noescape +func Ysetutxent(tls *TLS) + +//go:noescape +func Ysetvbuf(tls *TLS, f uintptr, buf uintptr, type1 int32, size Tsize_t) (r int32) + +//go:noescape +func Ysetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) + +//go:noescape +func Yshm_open(tls *TLS, name uintptr, flag int32, mode Tmode_t) (r int32) + +//go:noescape +func Yshm_unlink(tls *TLS, name uintptr) (r int32) + +//go:noescape +func Yshmat(tls *TLS, id int32, addr uintptr, flag int32) (r uintptr) + +//go:noescape +func Yshmctl(tls *TLS, id int32, cmd int32, buf uintptr) (r1 int32) + +//go:noescape +func Yshmdt(tls *TLS, addr uintptr) (r int32) + +//go:noescape +func Yshmget(tls *TLS, key Tkey_t, size Tsize_t, flag int32) (r int32) + +//go:noescape +func Yshutdown(tls *TLS, fd int32, how int32) (r1 int32) + +//go:noescape +func Ysigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r int32) + +//go:noescape +func Ysigaddset(tls *TLS, set uintptr, sig int32) (r int32) + +//go:noescape +func Ysigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) + +//go:noescape +func Ysigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) + +//go:noescape +func Ysigdelset(tls *TLS, set uintptr, sig int32) (r int32) + +//go:noescape +func Ysigemptyset(tls *TLS, set uintptr) (r int32) + +//go:noescape +func Ysigfillset(tls *TLS, set uintptr) (r int32) + +//go:noescape +func Ysigisemptyset(tls *TLS, set uintptr) (r int32) + +//go:noescape +func Ysigismember(tls *TLS, set uintptr, sig int32) (r int32) + +//go:noescape +func Ysignal(tls *TLS, signum int32, handler uintptr) (r uintptr) + +//go:noescape +func Ysignalfd(tls *TLS, fd int32, sigs uintptr, flags int32) (r int32) + +//go:noescape +func Ysignificand(tls *TLS, x float64) (r float64) + +//go:noescape +func Ysignificandf(tls *TLS, x float32) (r float32) + +//go:noescape +func Ysigorset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) + +//go:noescape +func Ysigpending(tls *TLS, set uintptr) (r int32) + +//go:noescape +func Ysigprocmask(tls *TLS, how int32, set uintptr, old uintptr) (r1 int32) + +//go:noescape +func Ysigqueue(tls *TLS, pid Tpid_t, sig int32, value Tsigval) (r1 int32) + +//go:noescape +func Ysigsuspend(tls *TLS, mask uintptr) (r int32) + +//go:noescape +func Ysigtimedwait(tls *TLS, mask uintptr, si uintptr, timeout uintptr) (r int32) + +//go:noescape +func Ysigwait(tls *TLS, mask uintptr, sig uintptr) (r int32) + +//go:noescape +func Ysigwaitinfo(tls *TLS, mask uintptr, si uintptr) (r int32) + +//go:noescape +func Ysin(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Ysincos(tls *TLS, x3 float64, sin uintptr, cos uintptr) + +//go:noescape +func Ysincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) + +//go:noescape +func Ysincosl(tls *TLS, x float64, sin uintptr, cos uintptr) + +//go:noescape +func Ysinf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Ysinh(tls *TLS, x float64) (r float64) + +//go:noescape +func Ysinhf(tls *TLS, x float32) (r float32) + +//go:noescape +func Ysinhl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ysinl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ysleep(tls *TLS, seconds uint32) (r uint32) + +//go:noescape +func Ysnprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ysockatmark(tls *TLS, s int32) (r int32) + +//go:noescape +func Ysocket(tls *TLS, domain int32, type1 int32, protocol int32) (r1 int32) + +//go:noescape +func Ysocketpair(tls *TLS, domain int32, type1 int32, protocol int32, fd uintptr) (r2 int32) + +//go:noescape +func Ysplice(tls *TLS, fd_in int32, off_in uintptr, fd_out int32, off_out uintptr, len1 Tsize_t, flags uint32) (r Tssize_t) + +//go:noescape +func Ysprintf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ysqrt(tls *TLS, x1 float64) (r1 float64) + +//go:noescape +func Ysqrtf(tls *TLS, x1 float32) (r1 float32) + +//go:noescape +func Ysqrtl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ysrand(tls *TLS, s uint32) + +//go:noescape +func Ysrand48(tls *TLS, seed int64) + +//go:noescape +func Ysrandom(tls *TLS, seed uint32) + +//go:noescape +func Ysscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ystat(tls *TLS, path uintptr, buf uintptr) (r int32) + +//go:noescape +func Ystat64(tls *TLS, path uintptr, buf uintptr) (r int32) + +//go:noescape +func Ystatvfs(tls *TLS, path uintptr, buf uintptr) (r int32) + +//go:noescape +func Ystatx(tls *TLS, dirfd int32, path uintptr, flags int32, mask uint32, stx uintptr) (r int32) + +//go:noescape +func Ystime(tls *TLS, t uintptr) (r int32) + +//go:noescape +func Ystpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) + +//go:noescape +func Ystpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ystrcasecmp(tls *TLS, _l uintptr, _r uintptr) (r1 int32) + +//go:noescape +func Ystrcasecmp_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) + +//go:noescape +func Ystrcasestr(tls *TLS, h uintptr, n uintptr) (r uintptr) + +//go:noescape +func Ystrcat(tls *TLS, dest uintptr, src uintptr) (r uintptr) + +//go:noescape +func Ystrchr(tls *TLS, s uintptr, c int32) (r1 uintptr) + +//go:noescape +func Ystrchrnul(tls *TLS, s uintptr, c int32) (r uintptr) + +//go:noescape +func Ystrcmp(tls *TLS, l uintptr, r uintptr) (r1 int32) + +//go:noescape +func Ystrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) + +//go:noescape +func Ystrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) + +//go:noescape +func Ystrcpy(tls *TLS, dest uintptr, src uintptr) (r uintptr) + +//go:noescape +func Ystrcspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) + +//go:noescape +func Ystrdup(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Ystrerror(tls *TLS, e int32) (r uintptr) + +//go:noescape +func Ystrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) + +//go:noescape +func Ystrerror_r(tls *TLS, err int32, buf uintptr, buflen Tsize_t) (r int32) + +//go:noescape +func Ystrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize_t) + +//go:noescape +func Ystrfmon_l(tls *TLS, s uintptr, n Tsize_t, loc Tlocale_t, fmt uintptr, va uintptr) (r Tssize_t) + +//go:noescape +func Ystrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t) + +//go:noescape +func Ystrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Ystrlcat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r Tsize_t) + +//go:noescape +func Ystrlcpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r Tsize_t) + +//go:noescape +func Ystrlen(tls *TLS, s uintptr) (r Tsize_t) + +//go:noescape +func Ystrncasecmp(tls *TLS, _l uintptr, _r uintptr, n Tsize_t) (r1 int32) + +//go:noescape +func Ystrncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, loc Tlocale_t) (r1 int32) + +//go:noescape +func Ystrncat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ystrncmp(tls *TLS, _l uintptr, _r uintptr, n Tsize_t) (r1 int32) + +//go:noescape +func Ystrncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ystrndup(tls *TLS, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ystrnlen(tls *TLS, s uintptr, n Tsize_t) (r Tsize_t) + +//go:noescape +func Ystrpbrk(tls *TLS, s uintptr, b uintptr) (r uintptr) + +//go:noescape +func Ystrptime(tls *TLS, s uintptr, f uintptr, tm uintptr) (r uintptr) + +//go:noescape +func Ystrrchr(tls *TLS, s uintptr, c int32) (r uintptr) + +//go:noescape +func Ystrsep(tls *TLS, str uintptr, sep uintptr) (r uintptr) + +//go:noescape +func Ystrsignal(tls *TLS, signum int32) (r uintptr) + +//go:noescape +func Ystrspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) + +//go:noescape +func Ystrstr(tls *TLS, h uintptr, n uintptr) (r uintptr) + +//go:noescape +func Ystrtod(tls *TLS, s uintptr, p uintptr) (r float64) + +//go:noescape +func Ystrtod_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) + +//go:noescape +func Ystrtof(tls *TLS, s uintptr, p uintptr) (r float32) + +//go:noescape +func Ystrtof_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float32) + +//go:noescape +func Ystrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) + +//go:noescape +func Ystrtok(tls *TLS, s uintptr, sep uintptr) (r uintptr) + +//go:noescape +func Ystrtok_r(tls *TLS, s uintptr, sep uintptr, p uintptr) (r uintptr) + +//go:noescape +func Ystrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) + +//go:noescape +func Ystrtold(tls *TLS, s uintptr, p uintptr) (r float64) + +//go:noescape +func Ystrtold_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) + +//go:noescape +func Ystrtoll(tls *TLS, s uintptr, p uintptr, base int32) (r int64) + +//go:noescape +func Ystrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) + +//go:noescape +func Ystrtoull(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) + +//go:noescape +func Ystrtoumax(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) + +//go:noescape +func Ystrverscmp(tls *TLS, l0 uintptr, r0 uintptr) (r1 int32) + +//go:noescape +func Ystrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) + +//go:noescape +func Ystrxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Yswab(tls *TLS, _src uintptr, _dest uintptr, n Tssize_t) + +//go:noescape +func Yswapoff(tls *TLS, path uintptr) (r int32) + +//go:noescape +func Yswapon(tls *TLS, path uintptr, flags int32) (r int32) + +//go:noescape +func Yswprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Yswscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ysymlink(tls *TLS, existing uintptr, new1 uintptr) (r int32) + +//go:noescape +func Ysymlinkat(tls *TLS, existing uintptr, fd int32, new1 uintptr) (r int32) + +//go:noescape +func Ysync(tls *TLS) + +//go:noescape +func Ysync_file_range(tls *TLS, fd int32, pos Toff_t, len1 Toff_t, flags uint32) (r int32) + +//go:noescape +func Ysyncfs(tls *TLS, fd int32) (r int32) + +//go:noescape +func Ysyscall(tls *TLS, n int64, va uintptr) (r int64) + +//go:noescape +func Ysysconf(tls *TLS, name int32) (r int64) + +//go:noescape +func Ysysctlbyname(t *TLS, name, oldp, oldlenp, newp uintptr, newlen Tsize_t) (_3 int32) + +//go:noescape +func Ysysinfo(tls *TLS, info uintptr) (r int32) + +//go:noescape +func Ysyslog(tls *TLS, priority int32, message uintptr, va uintptr) + +//go:noescape +func Ysystem(t *TLS, command uintptr) (_2 int32) + +//go:noescape +func Ytan(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Ytanf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Ytanh(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Ytanhf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Ytanhl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ytanl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ytcdrain(tls *TLS, fd int32) (r int32) + +//go:noescape +func Ytcflow(tls *TLS, fd int32, action int32) (r int32) + +//go:noescape +func Ytcflush(tls *TLS, fd int32, queue int32) (r int32) + +//go:noescape +func Ytcgetattr(tls *TLS, fd int32, tio uintptr) (r int32) + +//go:noescape +func Ytcgetpgrp(tls *TLS, fd int32) (r Tpid_t) + +//go:noescape +func Ytcgetsid(tls *TLS, fd int32) (r Tpid_t) + +//go:noescape +func Ytcgetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) + +//go:noescape +func Ytcsendbreak(tls *TLS, fd int32, dur int32) (r int32) + +//go:noescape +func Ytcsetattr(tls *TLS, fd int32, act int32, tio uintptr) (r int32) + +//go:noescape +func Ytcsetpgrp(tls *TLS, fd int32, pgrp Tpid_t) (r int32) + +//go:noescape +func Ytcsetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) + +//go:noescape +func Ytdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) + +//go:noescape +func __ccgo_abi0_tdelete_2(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_tdelete_2(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_tdelete_2(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Ytdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) + +//go:noescape +func __ccgo_abi0_tdestroy_1(_0 *TLS, _1 uintptr, __ccgo_fp uintptr) + +func __ccgo_abiInternal_tdestroy_1(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr) { + __ccgo_abi0_tdestroy_1(_0, _1, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Ytee(tls *TLS, src int32, dest int32, len1 Tsize_t, flags uint32) (r Tssize_t) + +//go:noescape +func Ytelldir(tls *TLS, dir uintptr) (r int64) + +//go:noescape +func Ytempnam(tls *TLS, dir uintptr, pfx uintptr) (r1 uintptr) + +//go:noescape +func Ytextdomain(tls *TLS, domainname uintptr) (r uintptr) + +//go:noescape +func Ytfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) + +//go:noescape +func __ccgo_abi0_tfind_2(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_tfind_2(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_tfind_2(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Ytgamma(tls *TLS, x3 float64) (r1 float64) + +//go:noescape +func Ytgammaf(tls *TLS, x float32) (r float32) + +//go:noescape +func Ytgammal(tls *TLS, x float64) (r float64) + +//go:noescape +func Ytime(tls *TLS, t uintptr) (r Ttime_t) + +//go:noescape +func Ytimegm(tls *TLS, tm uintptr) (r Ttime_t) + +//go:noescape +func Ytimer_delete(tls *TLS, t Ttimer_t) (r int32) + +//go:noescape +func Ytimer_getoverrun(tls *TLS, t Ttimer_t) (r int32) + +//go:noescape +func Ytimer_gettime(tls *TLS, t Ttimer_t, val uintptr) (r int32) + +//go:noescape +func Ytimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) (r int32) + +//go:noescape +func Ytimerfd_create(tls *TLS, clockid int32, flags int32) (r int32) + +//go:noescape +func Ytimerfd_gettime(tls *TLS, fd int32, cur uintptr) (r int32) + +//go:noescape +func Ytimerfd_settime(tls *TLS, fd int32, flags int32, new1 uintptr, old uintptr) (r int32) + +//go:noescape +func Ytimes(tls *TLS, tms uintptr) (r Tclock_t) + +//go:noescape +func Ytimespec_get(tls *TLS, ts uintptr, base int32) (r int32) + +//go:noescape +func Ytmpfile(tls *TLS) (r uintptr) + +//go:noescape +func Ytmpnam(tls *TLS, buf uintptr) (r1 uintptr) + +//go:noescape +func Ytoascii(tls *TLS, c int32) (r int32) + +//go:noescape +func Ytolower(tls *TLS, c int32) (r int32) + +//go:noescape +func Ytolower_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Ytoupper(tls *TLS, c int32) (r int32) + +//go:noescape +func Ytoupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) + +//go:noescape +func Ytowctrans(tls *TLS, wc Twint_t, trans Twctrans_t) (r Twint_t) + +//go:noescape +func Ytowctrans_l(tls *TLS, c Twint_t, t Twctrans_t, l Tlocale_t) (r Twint_t) + +//go:noescape +func Ytowlower(tls *TLS, wc Twint_t) (r Twint_t) + +//go:noescape +func Ytowlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) + +//go:noescape +func Ytowupper(tls *TLS, wc Twint_t) (r Twint_t) + +//go:noescape +func Ytowupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) + +//go:noescape +func Ytrunc(tls *TLS, x3 float64) (r float64) + +//go:noescape +func Ytruncate(tls *TLS, path uintptr, length Toff_t) (r int32) + +//go:noescape +func Ytruncf(tls *TLS, x3 float32) (r float32) + +//go:noescape +func Ytruncl(tls *TLS, x float64) (r float64) + +//go:noescape +func Ytsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) + +//go:noescape +func __ccgo_abi0_tsearch_2(_0 *TLS, _1 uintptr, _2 uintptr, __ccgo_fp uintptr) (_3 int32) + +func __ccgo_abiInternal_tsearch_2(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 uintptr) (_3 int32) { + return __ccgo_abi0_tsearch_2(_0, _1, _2, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Yttyname(tls *TLS, fd int32) (r uintptr) + +//go:noescape +func Yttyname_r(tls *TLS, fd int32, name uintptr, size Tsize_t) (r int32) + +//go:noescape +func Ytwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) + +//go:noescape +func __ccgo_abi0_twalk_1(_0 *TLS, _1 uintptr, _2 int32, _3 int32, __ccgo_fp uintptr) + +func __ccgo_abiInternal_twalk_1(tls *TLS, dest, abi0CodePtr uintptr) { + f := func(_0 *TLS, _1 uintptr, _2 int32, _3 int32) { + __ccgo_abi0_twalk_1(_0, _1, _2, _3, abi0CodePtr) + } + *(*[2]uintptr)(unsafe.Pointer(dest)) = *(*[2]uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&f)))) +} + +//go:noescape +func Ytzset(tls *TLS) + +//go:noescape +func Yualarm(tls *TLS, value uint32, interval uint32) (r uint32) + +//go:noescape +func Yulckpwdf(tls *TLS) (r int32) + +//go:noescape +func Yulimit(tls *TLS, cmd int32, va uintptr) (r int64) + +//go:noescape +func Yumask(tls *TLS, mode Tmode_t) (r Tmode_t) + +//go:noescape +func Yumount(tls *TLS, special uintptr) (r int32) + +//go:noescape +func Yumount2(tls *TLS, special uintptr, flags int32) (r int32) + +//go:noescape +func Yuname(tls *TLS, uts uintptr) (r int32) + +//go:noescape +func Yungetc(tls *TLS, c int32, f uintptr) (r int32) + +//go:noescape +func Yungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) + +//go:noescape +func Yunlink(tls *TLS, path uintptr) (r int32) + +//go:noescape +func Yunlinkat(tls *TLS, fd int32, path uintptr, flag int32) (r int32) + +//go:noescape +func Yunlockpt(tls *TLS, fd int32) (r int32) + +//go:noescape +func Yunsetenv(tls *TLS, name uintptr) (r int32) + +//go:noescape +func Yunshare(tls *TLS, flags int32) (r int32) + +//go:noescape +func Yupdwtmp(tls *TLS, f uintptr, u uintptr) + +//go:noescape +func Yupdwtmpx(tls *TLS, f uintptr, u uintptr) + +//go:noescape +func Yuselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) + +//go:noescape +func Yusleep(tls *TLS, useconds uint32) (r int32) + +//go:noescape +func Yutime(tls *TLS, path uintptr, times uintptr) (r int32) + +//go:noescape +func Yutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r1 int32) + +//go:noescape +func Yutimes(tls *TLS, path uintptr, times uintptr) (r int32) + +//go:noescape +func Yuuid_copy(t *TLS, dst, src uintptr) + +//go:noescape +func Yuuid_generate_random(t *TLS, out uintptr) + +//go:noescape +func Yuuid_parse(t *TLS, in uintptr, uu uintptr) (_3 int32) + +//go:noescape +func Yuuid_unparse(t *TLS, uu, out uintptr) + +//go:noescape +func Yvasprintf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvdprintf(tls *TLS, fd int32, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yverr(tls *TLS, status int32, fmt uintptr, ap Tva_list) + +//go:noescape +func Yverrx(tls *TLS, status int32, fmt uintptr, ap Tva_list) + +//go:noescape +func Yversionsort(tls *TLS, a uintptr, b uintptr) (r int32) + +//go:noescape +func Yvfork(tls *TLS) (r Tpid_t) + +//go:noescape +func Yvfprintf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvfscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvfwprintf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvfwscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvhangup(tls *TLS) (r int32) + +//go:noescape +func Yvmsplice(tls *TLS, fd int32, iov uintptr, cnt Tsize_t, flags uint32) (r Tssize_t) + +//go:noescape +func Yvprintf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvsnprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvsprintf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvsscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvswprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, ap Tva_list) (r1 int32) + +//go:noescape +func Yvswscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvwarn(tls *TLS, fmt uintptr, ap Tva_list) + +//go:noescape +func Yvwarnx(tls *TLS, fmt uintptr, ap Tva_list) + +//go:noescape +func Yvwprintf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Yvwscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) + +//go:noescape +func Ywait(tls *TLS, status uintptr) (r Tpid_t) + +//go:noescape +func Ywait3(tls *TLS, status uintptr, options int32, usage uintptr) (r Tpid_t) + +//go:noescape +func Ywait4(tls *TLS, pid Tpid_t, status uintptr, options int32, ru uintptr) (r1 Tpid_t) + +//go:noescape +func Ywaitid(tls *TLS, type1 Tidtype_t, id Tid_t, info uintptr, options int32) (r int32) + +//go:noescape +func Ywaitpid(tls *TLS, pid Tpid_t, status uintptr, options int32) (r Tpid_t) + +//go:noescape +func Ywarn(tls *TLS, fmt uintptr, va uintptr) + +//go:noescape +func Ywarnx(tls *TLS, fmt uintptr, va uintptr) + +//go:noescape +func Ywcpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) + +//go:noescape +func Ywcpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ywcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) + +//go:noescape +func Ywcscasecmp(tls *TLS, l uintptr, r uintptr) (r1 int32) + +//go:noescape +func Ywcscasecmp_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) + +//go:noescape +func Ywcscat(tls *TLS, dest uintptr, src uintptr) (r uintptr) + +//go:noescape +func Ywcschr(tls *TLS, s uintptr, c Twchar_t) (r uintptr) + +//go:noescape +func Ywcscmp(tls *TLS, l uintptr, r uintptr) (r1 int32) + +//go:noescape +func Ywcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) + +//go:noescape +func Ywcscoll_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) + +//go:noescape +func Ywcscpy(tls *TLS, d uintptr, s uintptr) (r uintptr) + +//go:noescape +func Ywcscspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) + +//go:noescape +func Ywcsdup(tls *TLS, s uintptr) (r uintptr) + +//go:noescape +func Ywcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t) + +//go:noescape +func Ywcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Ywcslen(tls *TLS, s uintptr) (r Tsize_t) + +//go:noescape +func Ywcsncasecmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) + +//go:noescape +func Ywcsncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, locale Tlocale_t) (r1 int32) + +//go:noescape +func Ywcsncat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ywcsncmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) + +//go:noescape +func Ywcsncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ywcsnlen(tls *TLS, s uintptr, n Tsize_t) (r Tsize_t) + +//go:noescape +func Ywcsnrtombs(tls *TLS, dst uintptr, wcs uintptr, wn Tsize_t, n Tsize_t, st uintptr) (r Tsize_t) + +//go:noescape +func Ywcspbrk(tls *TLS, s uintptr, b uintptr) (r uintptr) + +//go:noescape +func Ywcsrchr(tls *TLS, s uintptr, c Twchar_t) (r uintptr) + +//go:noescape +func Ywcsrtombs(tls *TLS, s uintptr, ws uintptr, n Tsize_t, st uintptr) (r Tsize_t) + +//go:noescape +func Ywcsspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) + +//go:noescape +func Ywcsstr(tls *TLS, h uintptr, n uintptr) (r uintptr) + +//go:noescape +func Ywcstod(tls *TLS, s uintptr, p uintptr) (r float64) + +//go:noescape +func Ywcstof(tls *TLS, s uintptr, p uintptr) (r float32) + +//go:noescape +func Ywcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) + +//go:noescape +func Ywcstok(tls *TLS, s uintptr, sep uintptr, p uintptr) (r uintptr) + +//go:noescape +func Ywcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) + +//go:noescape +func Ywcstold(tls *TLS, s uintptr, p uintptr) (r float64) + +//go:noescape +func Ywcstoll(tls *TLS, s uintptr, p uintptr, base int32) (r int64) + +//go:noescape +func Ywcstombs(tls *TLS, s uintptr, ws uintptr, n Tsize_t) (r Tsize_t) + +//go:noescape +func Ywcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) + +//go:noescape +func Ywcstoull(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) + +//go:noescape +func Ywcstoumax(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) + +//go:noescape +func Ywcswcs(tls *TLS, haystack uintptr, needle uintptr) (r uintptr) + +//go:noescape +func Ywcswidth(tls *TLS, wcs uintptr, n Tsize_t) (r int32) + +//go:noescape +func Ywcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) + +//go:noescape +func Ywcsxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) + +//go:noescape +func Ywctob(tls *TLS, c Twint_t) (r int32) + +//go:noescape +func Ywctomb(tls *TLS, s uintptr, wc Twchar_t) (r int32) + +//go:noescape +func Ywctrans(tls *TLS, class uintptr) (r Twctrans_t) + +//go:noescape +func Ywctrans_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctrans_t) + +//go:noescape +func Ywctype(tls *TLS, s uintptr) (r Twctype_t) + +//go:noescape +func Ywctype_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctype_t) + +//go:noescape +func Ywcwidth(tls *TLS, wc Twchar_t) (r int32) + +//go:noescape +func Ywmemchr(tls *TLS, s uintptr, c Twchar_t, n Tsize_t) (r uintptr) + +//go:noescape +func Ywmemcmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) + +//go:noescape +func Ywmemcpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ywmemmove(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) + +//go:noescape +func Ywmemset(tls *TLS, d uintptr, c Twchar_t, n Tsize_t) (r uintptr) + +//go:noescape +func Ywprintf(tls *TLS, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Ywrite(tls *TLS, fd int32, buf uintptr, count Tsize_t) (r Tssize_t) + +//go:noescape +func Ywritev(tls *TLS, fd int32, iov uintptr, count int32) (r Tssize_t) + +//go:noescape +func Ywscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) + +//go:noescape +func Yy0(tls *TLS, x float64) (r float64) + +//go:noescape +func Yy0f(tls *TLS, x float32) (r float32) + +//go:noescape +func Yy1(tls *TLS, x float64) (r float64) + +//go:noescape +func Yy1f(tls *TLS, x float32) (r float32) + +//go:noescape +func Yyn(tls *TLS, n int32, x float64) (r float64) + +//go:noescape +func Yynf(tls *TLS, n int32, x float32) (r float32) diff --git a/vendor/modernc.org/libc/abi0_linux_amd64.s b/vendor/modernc.org/libc/abi0_linux_amd64.s new file mode 100644 index 0000000..0f896ff --- /dev/null +++ b/vendor/modernc.org/libc/abi0_linux_amd64.s @@ -0,0 +1,28747 @@ +// Code generated for linux/amd64 by 'qbecc --abi0wrap .', DO NOT EDIT. + +#include "funcdata.h" +#include "textflag.h" + +// func Y_Exit(tls *TLS, ec int32) +TEXT ·Y_Exit(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ec+8(FP), AX + MOVL AX, 8(SP) + CALL ·X_Exit(SB) + RET + +// func Y_IO_feof_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Y_IO_feof_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X_IO_feof_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y_IO_ferror_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Y_IO_ferror_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X_IO_ferror_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y_IO_getc(tls *TLS, f1 uintptr) (r int32) +TEXT ·Y_IO_getc(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X_IO_getc(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y_IO_getc_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Y_IO_getc_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X_IO_getc_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y_IO_putc(tls *TLS, c1 int32, f1 uintptr) (r int32) +TEXT ·Y_IO_putc(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c1+8(FP), AX + MOVL AX, 8(SP) + MOVQ f1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X_IO_putc(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y_IO_putc_unlocked(tls *TLS, c int32, f uintptr) (r int32) +TEXT ·Y_IO_putc_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X_IO_putc_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y___errno_location(tls *TLS) (r uintptr) +TEXT ·Y___errno_location(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X___errno_location(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__aio_close(tls *TLS, fd int32) (_2 int32) +TEXT ·Y__aio_close(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__aio_close(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__asctime_r(tls *TLS, tm uintptr, buf uintptr) (r uintptr) +TEXT ·Y__asctime_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tm+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__asctime_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__assert_fail(tls *TLS, expr uintptr, file uintptr, line int32, func1 uintptr) +TEXT ·Y__assert_fail(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ expr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ file+16(FP), AX + MOVQ AX, 16(SP) + MOVL line+24(FP), AX + MOVL AX, 24(SP) + MOVQ func1+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__assert_fail(SB) + RET + +// func Y__atomic_compare_exchangeInt16(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeInt16(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeInt16(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_compare_exchangeInt32(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeInt32(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeInt32(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_compare_exchangeInt64(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeInt64(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeInt64(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_compare_exchangeInt8(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeInt8(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeInt8(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_compare_exchangeUint16(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeUint16(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeUint16(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_compare_exchangeUint32(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeUint32(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeUint32(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_compare_exchangeUint64(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeUint64(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeUint64(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_compare_exchangeUint8(t *TLS, ptr, expected, desired uintptr, weak, success, failure int32) (_3 int32) +TEXT ·Y__atomic_compare_exchangeUint8(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL weak+32(FP), AX + MOVL AX, 32(SP) + MOVL success+36(FP), AX + MOVL AX, 36(SP) + MOVL failure+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__atomic_compare_exchangeUint8(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__atomic_exchangeInt16(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeInt16(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeInt16(SB) + RET + +// func Y__atomic_exchangeInt32(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeInt32(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeInt32(SB) + RET + +// func Y__atomic_exchangeInt64(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeInt64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeInt64(SB) + RET + +// func Y__atomic_exchangeInt8(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeInt8(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeInt8(SB) + RET + +// func Y__atomic_exchangeUint16(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeUint16(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeUint16(SB) + RET + +// func Y__atomic_exchangeUint32(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeUint32(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeUint32(SB) + RET + +// func Y__atomic_exchangeUint64(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeUint64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeUint64(SB) + RET + +// func Y__atomic_exchangeUint8(t *TLS, ptr, val, ret uintptr, _ int32) +TEXT ·Y__atomic_exchangeUint8(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ret+24(FP), AX + MOVQ AX, 24(SP) + MOVL _+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__atomic_exchangeUint8(SB) + RET + +// func Y__atomic_fetch_addInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__atomic_fetch_addInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_addInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_addInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__atomic_fetch_addInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_addInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_addInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__atomic_fetch_addInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_addInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_addInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__atomic_fetch_addInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_addInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_addUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__atomic_fetch_addUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_addUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_addUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__atomic_fetch_addUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_addUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_addUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__atomic_fetch_addUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_addUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_addUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__atomic_fetch_addUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_addUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_andInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__atomic_fetch_andInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_andInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_andInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__atomic_fetch_andInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_andInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_andInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__atomic_fetch_andInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_andInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_andInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__atomic_fetch_andInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_andInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_andUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__atomic_fetch_andUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_andUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_andUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__atomic_fetch_andUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_andUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_andUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__atomic_fetch_andUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_andUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_andUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__atomic_fetch_andUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_andUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_orInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__atomic_fetch_orInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_orInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_orInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__atomic_fetch_orInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_orInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_orInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__atomic_fetch_orInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_orInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_orInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__atomic_fetch_orInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_orInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_orUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__atomic_fetch_orUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_orUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_orUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__atomic_fetch_orUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_orUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_orUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__atomic_fetch_orUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_orUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_orUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__atomic_fetch_orUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_orUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_subInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__atomic_fetch_subInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_subInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_subInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__atomic_fetch_subInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_subInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_subInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__atomic_fetch_subInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_subInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_subInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__atomic_fetch_subInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_subInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_subUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__atomic_fetch_subUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_subUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_subUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__atomic_fetch_subUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_subUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_subUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__atomic_fetch_subUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_subUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_subUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__atomic_fetch_subUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_subUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_xorInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__atomic_fetch_xorInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_xorInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_xorInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__atomic_fetch_xorInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_xorInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_xorInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__atomic_fetch_xorInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_xorInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_xorInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__atomic_fetch_xorInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_xorInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_fetch_xorUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__atomic_fetch_xorUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_xorUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__atomic_fetch_xorUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__atomic_fetch_xorUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_xorUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__atomic_fetch_xorUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__atomic_fetch_xorUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_fetch_xorUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__atomic_fetch_xorUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__atomic_fetch_xorUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__atomic_fetch_xorUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__atomic_loadInt16(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadInt16(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadInt16(SB) + RET + +// func Y__atomic_loadInt32(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadInt32(SB) + RET + +// func Y__atomic_loadInt64(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadInt64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadInt64(SB) + RET + +// func Y__atomic_loadInt8(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadInt8(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadInt8(SB) + RET + +// func Y__atomic_loadUint16(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadUint16(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadUint16(SB) + RET + +// func Y__atomic_loadUint32(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadUint32(SB) + RET + +// func Y__atomic_loadUint64(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadUint64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadUint64(SB) + RET + +// func Y__atomic_loadUint8(t *TLS, ptr, ret uintptr, memorder int32) +TEXT ·Y__atomic_loadUint8(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ret+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_loadUint8(SB) + RET + +// func Y__atomic_storeInt16(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeInt16(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeInt16(SB) + RET + +// func Y__atomic_storeInt32(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeInt32(SB) + RET + +// func Y__atomic_storeInt64(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeInt64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeInt64(SB) + RET + +// func Y__atomic_storeInt8(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeInt8(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeInt8(SB) + RET + +// func Y__atomic_storeUint16(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeUint16(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeUint16(SB) + RET + +// func Y__atomic_storeUint32(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeUint32(SB) + RET + +// func Y__atomic_storeUint64(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeUint64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeUint64(SB) + RET + +// func Y__atomic_storeUint8(t *TLS, ptr, val uintptr, memorder int32) +TEXT ·Y__atomic_storeUint8(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__atomic_storeUint8(SB) + RET + +// func Y__block_all_sigs(tls *TLS, set uintptr) +TEXT ·Y__block_all_sigs(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__block_all_sigs(SB) + RET + +// func Y__block_app_sigs(tls *TLS, set uintptr) +TEXT ·Y__block_app_sigs(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__block_app_sigs(SB) + RET + +// func Y__builtin___memcpy_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (r uintptr) +TEXT ·Y__builtin___memcpy_chk(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ os+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__builtin___memcpy_chk(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Y__builtin___memmove_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (_3 uintptr) +TEXT ·Y__builtin___memmove_chk(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ os+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__builtin___memmove_chk(SB) + MOVQ 40(SP), AX + MOVQ AX, _3+40(FP) + RET + +// func Y__builtin___memset_chk(t *TLS, s uintptr, c int32, n, os Tsize_t) (_4 uintptr) +TEXT ·Y__builtin___memset_chk(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ os+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__builtin___memset_chk(SB) + MOVQ 40(SP), AX + MOVQ AX, _4+40(FP) + RET + +// func Y__builtin___snprintf_chk(t *TLS, str uintptr, maxlen Tsize_t, flag int32, os Tsize_t, format, args uintptr) (r int32) +TEXT ·Y__builtin___snprintf_chk(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ str+8(FP), AX + MOVQ AX, 8(SP) + MOVQ maxlen+16(FP), AX + MOVQ AX, 16(SP) + MOVL flag+24(FP), AX + MOVL AX, 24(SP) + MOVQ os+32(FP), AX + MOVQ AX, 32(SP) + MOVQ format+40(FP), AX + MOVQ AX, 40(SP) + MOVQ args+48(FP), AX + MOVQ AX, 48(SP) + CALL ·X__builtin___snprintf_chk(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Y__builtin___sprintf_chk(t *TLS, s uintptr, flag int32, os Tsize_t, format, args uintptr) (r int32) +TEXT ·Y__builtin___sprintf_chk(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL flag+16(FP), AX + MOVL AX, 16(SP) + MOVQ os+24(FP), AX + MOVQ AX, 24(SP) + MOVQ format+32(FP), AX + MOVQ AX, 32(SP) + MOVQ args+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__builtin___sprintf_chk(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Y__builtin___strcat_chk(t *TLS, dest, src uintptr, os Tsize_t) (r uintptr) +TEXT ·Y__builtin___strcat_chk(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ os+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin___strcat_chk(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__builtin___strcpy_chk(t *TLS, dest, src uintptr, os Tsize_t) (_3 uintptr) +TEXT ·Y__builtin___strcpy_chk(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ os+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin___strcpy_chk(SB) + MOVQ 32(SP), AX + MOVQ AX, _3+32(FP) + RET + +// func Y__builtin___strncpy_chk(t *TLS, dest, src uintptr, n, os Tsize_t) (r uintptr) +TEXT ·Y__builtin___strncpy_chk(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ os+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__builtin___strncpy_chk(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Y__builtin___vsnprintf_chk(t *TLS, str uintptr, maxlen Tsize_t, flag int32, os Tsize_t, format, args uintptr) (r int32) +TEXT ·Y__builtin___vsnprintf_chk(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ str+8(FP), AX + MOVQ AX, 8(SP) + MOVQ maxlen+16(FP), AX + MOVQ AX, 16(SP) + MOVL flag+24(FP), AX + MOVL AX, 24(SP) + MOVQ os+32(FP), AX + MOVQ AX, 32(SP) + MOVQ format+40(FP), AX + MOVQ AX, 40(SP) + MOVQ args+48(FP), AX + MOVQ AX, 48(SP) + CALL ·X__builtin___vsnprintf_chk(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Y__builtin_abort(t *TLS) +TEXT ·Y__builtin_abort(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_abort(SB) + RET + +// func Y__builtin_abs(t *TLS, j int32) (_2 int32) +TEXT ·Y__builtin_abs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL j+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_abs(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_add_overflowInt64(t *TLS, a, b int64, res uintptr) (_3 int32) +TEXT ·Y__builtin_add_overflowInt64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + MOVQ res+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_add_overflowInt64(SB) + MOVL 32(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Y__builtin_add_overflowUint32(t *TLS, a, b uint32, res uintptr) (_3 int32) +TEXT ·Y__builtin_add_overflowUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL a+8(FP), AX + MOVL AX, 8(SP) + MOVL b+12(FP), AX + MOVL AX, 12(SP) + MOVQ res+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_add_overflowUint32(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Y__builtin_add_overflowUint64(t *TLS, a, b uint64, res uintptr) (_3 int32) +TEXT ·Y__builtin_add_overflowUint64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + MOVQ res+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_add_overflowUint64(SB) + MOVL 32(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Y__builtin_alloca(tls *TLS, size Tsize_t) (_2 uintptr) +TEXT ·Y__builtin_alloca(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ size+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_alloca(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_bswap16(t *TLS, x uint16) (_2 uint16) +TEXT ·Y__builtin_bswap16(SB),$24-18 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVW x+8(FP), AX + MOVW AX, 8(SP) + CALL ·X__builtin_bswap16(SB) + MOVW 16(SP), AX + MOVW AX, _2+16(FP) + RET + +// func Y__builtin_bswap32(t *TLS, x uint32) (_2 uint32) +TEXT ·Y__builtin_bswap32(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_bswap32(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_bswap64(t *TLS, x uint64) (_2 uint64) +TEXT ·Y__builtin_bswap64(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_bswap64(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_bzero(t *TLS, s uintptr, n Tsize_t) +TEXT ·Y__builtin_bzero(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_bzero(SB) + RET + +// func Y__builtin_clz(t *TLS, n uint32) (_2 int32) +TEXT ·Y__builtin_clz(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_clz(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_clzl(t *TLS, n ulong) (_2 int32) +TEXT ·Y__builtin_clzl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_clzl(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_clzll(t *TLS, n uint64) (_2 int32) +TEXT ·Y__builtin_clzll(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_clzll(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_copysign(t *TLS, x, y float64) (_2 float64) +TEXT ·Y__builtin_copysign(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_copysign(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Y__builtin_copysignf(t *TLS, x, y float32) (_2 float32) +TEXT ·Y__builtin_copysignf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·X__builtin_copysignf(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_copysignl(t *TLS, x, y float64) (_2 float64) +TEXT ·Y__builtin_copysignl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_copysignl(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Y__builtin_ctz(t *TLS, n uint32) (_2 int32) +TEXT ·Y__builtin_ctz(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_ctz(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_ctzl(tls *TLS, x ulong) (_2 int32) +TEXT ·Y__builtin_ctzl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_ctzl(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_exit(t *TLS, status int32) +TEXT ·Y__builtin_exit(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL status+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_exit(SB) + RET + +// func Y__builtin_expect(t *TLS, exp, c long) (_2 long) +TEXT ·Y__builtin_expect(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ exp+8(FP), AX + MOVQ AX, 8(SP) + MOVQ c+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_expect(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Y__builtin_fabs(t *TLS, x float64) (_2 float64) +TEXT ·Y__builtin_fabs(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_fabs(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_fabsf(t *TLS, x float32) (_2 float32) +TEXT ·Y__builtin_fabsf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_fabsf(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_fabsl(t *TLS, x float64) (_2 float64) +TEXT ·Y__builtin_fabsl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_fabsl(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_ffs(tls *TLS, i int32) (r int32) +TEXT ·Y__builtin_ffs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL i+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_ffs(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__builtin_fma(tls *TLS, x, y, z float64) (r float64) +TEXT ·Y__builtin_fma(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVQ z+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_fma(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__builtin_fmax(tls *TLS, x float64, y float64) (r float64) +TEXT ·Y__builtin_fmax(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_fmax(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__builtin_fmin(tls *TLS, x float64, y float64) (r float64) +TEXT ·Y__builtin_fmin(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_fmin(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__builtin_free(t *TLS, ptr uintptr) +TEXT ·Y__builtin_free(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_free(SB) + RET + +// func Y__builtin_getentropy(t *TLS, buf uintptr, n Tsize_t) (_3 int32) +TEXT ·Y__builtin_getentropy(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_getentropy(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Y__builtin_huge_val(t *TLS) (_1 float64) +TEXT ·Y__builtin_huge_val(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_huge_val(SB) + MOVQ 8(SP), AX + MOVQ AX, _1+8(FP) + RET + +// func Y__builtin_huge_valf(t *TLS) (_1 float32) +TEXT ·Y__builtin_huge_valf(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_huge_valf(SB) + MOVL 8(SP), AX + MOVL AX, _1+8(FP) + RET + +// func Y__builtin_hypot(tls *TLS, x float64, y float64) (r float64) +TEXT ·Y__builtin_hypot(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_hypot(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__builtin_inf(t *TLS) (_1 float64) +TEXT ·Y__builtin_inf(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_inf(SB) + MOVQ 8(SP), AX + MOVQ AX, _1+8(FP) + RET + +// func Y__builtin_inff(tls *TLS) (_1 float32) +TEXT ·Y__builtin_inff(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_inff(SB) + MOVL 8(SP), AX + MOVL AX, _1+8(FP) + RET + +// func Y__builtin_infl(t *TLS) (_1 float64) +TEXT ·Y__builtin_infl(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_infl(SB) + MOVQ 8(SP), AX + MOVQ AX, _1+8(FP) + RET + +// func Y__builtin_isblank(tls *TLS, c int32) (r int32) +TEXT ·Y__builtin_isblank(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_isblank(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__builtin_isnan(t *TLS, x float64) (_2 int32) +TEXT ·Y__builtin_isnan(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_isnan(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_isnanf(t *TLS, x float32) (_2 int32) +TEXT ·Y__builtin_isnanf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_isnanf(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_isnanl(t *TLS, x float64) (_2 int32) +TEXT ·Y__builtin_isnanl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_isnanl(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_isprint(tls *TLS, c int32) (r int32) +TEXT ·Y__builtin_isprint(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_isprint(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__builtin_isunordered(t *TLS, a, b float64) (_2 int32) +TEXT ·Y__builtin_isunordered(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_isunordered(SB) + MOVL 24(SP), AX + MOVL AX, _2+24(FP) + RET + +// func Y__builtin_llabs(tls *TLS, a int64) (_2 int64) +TEXT ·Y__builtin_llabs(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_llabs(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_log2(t *TLS, x float64) (_2 float64) +TEXT ·Y__builtin_log2(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_log2(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_lrint(tls *TLS, x float64) (r long) +TEXT ·Y__builtin_lrint(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_lrint(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__builtin_lrintf(tls *TLS, x float32) (r long) +TEXT ·Y__builtin_lrintf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_lrintf(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__builtin_lround(tls *TLS, x float64) (r long) +TEXT ·Y__builtin_lround(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_lround(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__builtin_malloc(t *TLS, size Tsize_t) (_2 uintptr) +TEXT ·Y__builtin_malloc(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ size+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_malloc(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_memcmp(t *TLS, s1, s2 uintptr, n Tsize_t) (_3 int32) +TEXT ·Y__builtin_memcmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_memcmp(SB) + MOVL 32(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Y__builtin_memcpy(t *TLS, dest, src uintptr, n Tsize_t) (r uintptr) +TEXT ·Y__builtin_memcpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_memcpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__builtin_memset(t *TLS, s uintptr, c int32, n Tsize_t) (_4 uintptr) +TEXT ·Y__builtin_memset(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_memset(SB) + MOVQ 32(SP), AX + MOVQ AX, _4+32(FP) + RET + +// func Y__builtin_mmap(t *TLS, addr uintptr, length Tsize_t, prot, flags, fd int32, offset Toff_t) (_5 uintptr) +TEXT ·Y__builtin_mmap(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ length+16(FP), AX + MOVQ AX, 16(SP) + MOVL prot+24(FP), AX + MOVL AX, 24(SP) + MOVL flags+28(FP), AX + MOVL AX, 28(SP) + MOVL fd+32(FP), AX + MOVL AX, 32(SP) + MOVQ offset+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__builtin_mmap(SB) + MOVQ 48(SP), AX + MOVQ AX, _5+48(FP) + RET + +// func Y__builtin_mul_overflowInt64(t *TLS, a, b int64, res uintptr) (_3 int32) +TEXT ·Y__builtin_mul_overflowInt64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + MOVQ res+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_mul_overflowInt64(SB) + MOVL 32(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Y__builtin_mul_overflowUint128(t *TLS, a, b Uint128, res uintptr) (_3 int32) +TEXT ·Y__builtin_mul_overflowUint128(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a_Lo+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a_Hi+16(FP), AX + MOVQ AX, 16(SP) + MOVQ b_Lo+24(FP), AX + MOVQ AX, 24(SP) + MOVQ b_Hi+32(FP), AX + MOVQ AX, 32(SP) + MOVQ res+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__builtin_mul_overflowUint128(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Y__builtin_mul_overflowUint64(t *TLS, a, b uint64, res uintptr) (_3 int32) +TEXT ·Y__builtin_mul_overflowUint64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + MOVQ res+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_mul_overflowUint64(SB) + MOVL 32(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Y__builtin_nan(t *TLS, s uintptr) (_2 float64) +TEXT ·Y__builtin_nan(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_nan(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_nanf(tls *TLS, s uintptr) (_2 float32) +TEXT ·Y__builtin_nanf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_nanf(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_nanl(t *TLS, s uintptr) (_2 float64) +TEXT ·Y__builtin_nanl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_nanl(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_object_size(t *TLS, p uintptr, typ int32) (_3 Tsize_t) +TEXT ·Y__builtin_object_size(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + MOVL typ+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__builtin_object_size(SB) + MOVQ 24(SP), AX + MOVQ AX, _3+24(FP) + RET + +// func Y__builtin_popcount(t *TLS, x uint32) (_2 int32) +TEXT ·Y__builtin_popcount(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_popcount(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_popcountl(t *TLS, x ulong) (_2 int32) +TEXT ·Y__builtin_popcountl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_popcountl(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__builtin_prefetch(t *TLS, addr, args uintptr) +TEXT ·Y__builtin_prefetch(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ args+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_prefetch(SB) + RET + +// func Y__builtin_printf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Y__builtin_printf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_printf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__builtin_rintf(tls *TLS, x float32) (r float32) +TEXT ·Y__builtin_rintf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_rintf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__builtin_round(tls *TLS, x float64) (r float64) +TEXT ·Y__builtin_round(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_round(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__builtin_roundf(tls *TLS, x float32) (r float32) +TEXT ·Y__builtin_roundf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__builtin_roundf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__builtin_snprintf(t *TLS, str uintptr, size Tsize_t, format, args uintptr) (_4 int32) +TEXT ·Y__builtin_snprintf(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ str+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ format+24(FP), AX + MOVQ AX, 24(SP) + MOVQ args+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__builtin_snprintf(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__builtin_sprintf(t *TLS, str, format, args uintptr) (r int32) +TEXT ·Y__builtin_sprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ str+8(FP), AX + MOVQ AX, 8(SP) + MOVQ format+16(FP), AX + MOVQ AX, 16(SP) + MOVQ args+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_sprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__builtin_strchr(t *TLS, s uintptr, c int32) (_3 uintptr) +TEXT ·Y__builtin_strchr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__builtin_strchr(SB) + MOVQ 24(SP), AX + MOVQ AX, _3+24(FP) + RET + +// func Y__builtin_strcmp(t *TLS, s1, s2 uintptr) (_2 int32) +TEXT ·Y__builtin_strcmp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s2+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_strcmp(SB) + MOVL 24(SP), AX + MOVL AX, _2+24(FP) + RET + +// func Y__builtin_strcpy(t *TLS, dest, src uintptr) (_2 uintptr) +TEXT ·Y__builtin_strcpy(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__builtin_strcpy(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Y__builtin_strlen(t *TLS, s uintptr) (_2 Tsize_t) +TEXT ·Y__builtin_strlen(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_strlen(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__builtin_sub_overflowInt64(t *TLS, a, b int64, res uintptr) (_3 int32) +TEXT ·Y__builtin_sub_overflowInt64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + MOVQ res+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__builtin_sub_overflowInt64(SB) + MOVL 32(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Y__builtin_trap(t *TLS) +TEXT ·Y__builtin_trap(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_trap(SB) + RET + +// func Y__builtin_trunc(tls *TLS, x float64) (r float64) +TEXT ·Y__builtin_trunc(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__builtin_trunc(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__builtin_unreachable(t *TLS) +TEXT ·Y__builtin_unreachable(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__builtin_unreachable(SB) + RET + +// func Y__builtin_vsnprintf(t *TLS, str uintptr, size Tsize_t, format, va uintptr) (_4 int32) +TEXT ·Y__builtin_vsnprintf(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ str+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ format+24(FP), AX + MOVQ AX, 24(SP) + MOVQ va+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__builtin_vsnprintf(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongInt16(t *TLS, ptr, expected uintptr, desired int16, success, failure int32) (_4 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongInt16(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVW desired+24(FP), AX + MOVW AX, 24(SP) + MOVL success+28(FP), AX + MOVL AX, 28(SP) + MOVL failure+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__c11_atomic_compare_exchange_strongInt16(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongInt32(t *TLS, ptr, expected uintptr, desired, success, failure int32) (_3 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongInt32(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVL desired+24(FP), AX + MOVL AX, 24(SP) + MOVL success+28(FP), AX + MOVL AX, 28(SP) + MOVL failure+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__c11_atomic_compare_exchange_strongInt32(SB) + MOVL 40(SP), AX + MOVL AX, _3+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongInt64(t *TLS, ptr, expected uintptr, desired int64, success, failure int32) (_4 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongInt64(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL success+32(FP), AX + MOVL AX, 32(SP) + MOVL failure+36(FP), AX + MOVL AX, 36(SP) + CALL ·X__c11_atomic_compare_exchange_strongInt64(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongInt8(t *TLS, ptr, expected uintptr, desired int8, success, failure int32) (_4 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongInt8(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVB desired+24(FP), AX + MOVB AX, 24(SP) + MOVL success+28(FP), AX + MOVL AX, 28(SP) + MOVL failure+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__c11_atomic_compare_exchange_strongInt8(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongUint16(t *TLS, ptr, expected uintptr, desired uint16, success, failure int32) (_4 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongUint16(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVW desired+24(FP), AX + MOVW AX, 24(SP) + MOVL success+28(FP), AX + MOVL AX, 28(SP) + MOVL failure+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__c11_atomic_compare_exchange_strongUint16(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongUint32(t *TLS, ptr, expected uintptr, desired uint32, success, failure int32) (_4 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongUint32(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVL desired+24(FP), AX + MOVL AX, 24(SP) + MOVL success+28(FP), AX + MOVL AX, 28(SP) + MOVL failure+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__c11_atomic_compare_exchange_strongUint32(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongUint64(t *TLS, ptr, expected uintptr, desired uint64, success, failure int32) (_4 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongUint64(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVQ desired+24(FP), AX + MOVQ AX, 24(SP) + MOVL success+32(FP), AX + MOVL AX, 32(SP) + MOVL failure+36(FP), AX + MOVL AX, 36(SP) + CALL ·X__c11_atomic_compare_exchange_strongUint64(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_compare_exchange_strongUint8(t *TLS, ptr, expected uintptr, desired uint8, success, failure int32) (_4 int32) +TEXT ·Y__c11_atomic_compare_exchange_strongUint8(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ expected+16(FP), AX + MOVQ AX, 16(SP) + MOVB desired+24(FP), AX + MOVB AX, 24(SP) + MOVL success+28(FP), AX + MOVL AX, 28(SP) + MOVL failure+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__c11_atomic_compare_exchange_strongUint8(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__c11_atomic_exchangeInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__c11_atomic_exchangeInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_exchangeInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_exchangeInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__c11_atomic_exchangeInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_exchangeInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_exchangeInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__c11_atomic_exchangeInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_exchangeInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_exchangeInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__c11_atomic_exchangeInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_exchangeInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_exchangeUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__c11_atomic_exchangeUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_exchangeUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_exchangeUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__c11_atomic_exchangeUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_exchangeUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_exchangeUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__c11_atomic_exchangeUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_exchangeUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_exchangeUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__c11_atomic_exchangeUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_exchangeUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_addInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__c11_atomic_fetch_addInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_addInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_addInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__c11_atomic_fetch_addInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_addInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_addInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__c11_atomic_fetch_addInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_addInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_addInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__c11_atomic_fetch_addInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_addInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_addUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__c11_atomic_fetch_addUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_addUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_addUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__c11_atomic_fetch_addUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_addUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_addUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__c11_atomic_fetch_addUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_addUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_addUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__c11_atomic_fetch_addUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_addUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_andInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__c11_atomic_fetch_andInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_andInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_andInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__c11_atomic_fetch_andInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_andInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_andInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__c11_atomic_fetch_andInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_andInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_andInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__c11_atomic_fetch_andInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_andInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_andUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__c11_atomic_fetch_andUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_andUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_andUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__c11_atomic_fetch_andUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_andUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_andUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__c11_atomic_fetch_andUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_andUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_andUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__c11_atomic_fetch_andUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_andUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_orInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__c11_atomic_fetch_orInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_orInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_orInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__c11_atomic_fetch_orInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_orInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_orInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__c11_atomic_fetch_orInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_orInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_orInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__c11_atomic_fetch_orInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_orInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_orUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__c11_atomic_fetch_orUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_orUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_orUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__c11_atomic_fetch_orUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_orUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_orUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__c11_atomic_fetch_orUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_orUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_orUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__c11_atomic_fetch_orUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_orUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_subInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__c11_atomic_fetch_subInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_subInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_subInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__c11_atomic_fetch_subInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_subInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_subInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__c11_atomic_fetch_subInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_subInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_subInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__c11_atomic_fetch_subInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_subInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_subUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__c11_atomic_fetch_subUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_subUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_subUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__c11_atomic_fetch_subUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_subUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_subUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__c11_atomic_fetch_subUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_subUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_subUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__c11_atomic_fetch_subUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_subUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_xorInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) +TEXT ·Y__c11_atomic_fetch_xorInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_xorInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_xorInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) +TEXT ·Y__c11_atomic_fetch_xorInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_xorInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_xorInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) +TEXT ·Y__c11_atomic_fetch_xorInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_xorInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_xorInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) +TEXT ·Y__c11_atomic_fetch_xorInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_xorInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_xorUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) +TEXT ·Y__c11_atomic_fetch_xorUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_xorUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_xorUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) +TEXT ·Y__c11_atomic_fetch_xorUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_xorUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_fetch_xorUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) +TEXT ·Y__c11_atomic_fetch_xorUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL _+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_fetch_xorUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__c11_atomic_fetch_xorUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) +TEXT ·Y__c11_atomic_fetch_xorUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL _+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_fetch_xorUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_loadInt16(t *TLS, ptr uintptr, memorder int32) (r int16) +TEXT ·Y__c11_atomic_loadInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_loadInt32(t *TLS, ptr uintptr, memorder int32) (r int32) +TEXT ·Y__c11_atomic_loadInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_loadInt64(t *TLS, ptr uintptr, memorder int32) (r int64) +TEXT ·Y__c11_atomic_loadInt64(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadInt64(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__c11_atomic_loadInt8(t *TLS, ptr uintptr, memorder int32) (r int8) +TEXT ·Y__c11_atomic_loadInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_loadUint16(t *TLS, ptr uintptr, memorder int32) (r uint16) +TEXT ·Y__c11_atomic_loadUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__c11_atomic_loadUint32(t *TLS, ptr uintptr, memorder int32) (r uint32) +TEXT ·Y__c11_atomic_loadUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__c11_atomic_loadUint64(t *TLS, ptr uintptr, memorder int32) (r uint64) +TEXT ·Y__c11_atomic_loadUint64(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadUint64(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__c11_atomic_loadUint8(t *TLS, ptr uintptr, memorder int32) (r uint8) +TEXT ·Y__c11_atomic_loadUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL memorder+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__c11_atomic_loadUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__c11_atomic_storeInt16(t *TLS, ptr uintptr, val int16, memorder int32) +TEXT ·Y__c11_atomic_storeInt16(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL memorder+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_storeInt16(SB) + RET + +// func Y__c11_atomic_storeInt32(t *TLS, ptr uintptr, val int32, memorder int32) +TEXT ·Y__c11_atomic_storeInt32(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL memorder+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_storeInt32(SB) + RET + +// func Y__c11_atomic_storeInt64(t *TLS, ptr uintptr, val int64, memorder int32) +TEXT ·Y__c11_atomic_storeInt64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_storeInt64(SB) + RET + +// func Y__c11_atomic_storeInt8(t *TLS, ptr uintptr, val int8, memorder int32) +TEXT ·Y__c11_atomic_storeInt8(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL memorder+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_storeInt8(SB) + RET + +// func Y__c11_atomic_storeUint16(t *TLS, ptr uintptr, val uint16, memorder int32) +TEXT ·Y__c11_atomic_storeUint16(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW val+16(FP), AX + MOVW AX, 16(SP) + MOVL memorder+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_storeUint16(SB) + RET + +// func Y__c11_atomic_storeUint32(t *TLS, ptr uintptr, val uint32, memorder int32) +TEXT ·Y__c11_atomic_storeUint32(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + MOVL memorder+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_storeUint32(SB) + RET + +// func Y__c11_atomic_storeUint64(t *TLS, ptr uintptr, val uint64, memorder int32) +TEXT ·Y__c11_atomic_storeUint64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + MOVL memorder+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__c11_atomic_storeUint64(SB) + RET + +// func Y__c11_atomic_storeUint8(t *TLS, ptr uintptr, val uint8, memorder int32) +TEXT ·Y__c11_atomic_storeUint8(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB val+16(FP), AX + MOVB AX, 16(SP) + MOVL memorder+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__c11_atomic_storeUint8(SB) + RET + +// func Y__ccgo_dmesg(t *TLS, fmt uintptr, va uintptr) +TEXT ·Y__ccgo_dmesg(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__ccgo_dmesg(SB) + RET + +// func Y__ccgo_getMutexType(tls *TLS, m uintptr) (_2 int32) +TEXT ·Y__ccgo_getMutexType(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__ccgo_getMutexType(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__ccgo_in6addr_anyp(t *TLS) (_1 uintptr) +TEXT ·Y__ccgo_in6addr_anyp(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__ccgo_in6addr_anyp(SB) + MOVQ 8(SP), AX + MOVQ AX, _1+8(FP) + RET + +// func Y__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) (_2 int32) +TEXT ·Y__ccgo_pthreadAttrGetDetachState(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__ccgo_pthreadAttrGetDetachState(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) (_2 int32) +TEXT ·Y__ccgo_pthreadMutexattrGettype(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__ccgo_pthreadMutexattrGettype(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__ccgo_sqlite3_log(t *TLS, iErrCode int32, zFormat uintptr, args uintptr) +TEXT ·Y__ccgo_sqlite3_log(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL iErrCode+8(FP), AX + MOVL AX, 8(SP) + MOVQ zFormat+16(FP), AX + MOVQ AX, 16(SP) + MOVQ args+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__ccgo_sqlite3_log(SB) + RET + +// func Y__clock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) +TEXT ·Y__clock_gettime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clk+8(FP), AX + MOVL AX, 8(SP) + MOVQ ts+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__clock_gettime(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Y__clock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem uintptr) (r int32) +TEXT ·Y__clock_nanosleep(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clk+8(FP), AX + MOVL AX, 8(SP) + MOVL flags+12(FP), AX + MOVL AX, 12(SP) + MOVQ req+16(FP), AX + MOVQ AX, 16(SP) + MOVQ rem+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__clock_nanosleep(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__cmsg_nxthdr(t *TLS, msgh, cmsg uintptr) (_2 uintptr) +TEXT ·Y__cmsg_nxthdr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msgh+8(FP), AX + MOVQ AX, 8(SP) + MOVQ cmsg+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__cmsg_nxthdr(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Y__convert_scm_timestamps(tls *TLS, msg uintptr, csize Tsocklen_t) +TEXT ·Y__convert_scm_timestamps(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + MOVL csize+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__convert_scm_timestamps(SB) + RET + +// func Y__cos(tls *TLS, x float64, y float64) (r1 float64) +TEXT ·Y__cos(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__cos(SB) + MOVQ 24(SP), AX + MOVQ AX, r1+24(FP) + RET + +// func Y__cosdf(tls *TLS, x float64) (r1 float32) +TEXT ·Y__cosdf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__cosdf(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Y__crypt_blowfish(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) +TEXT ·Y__crypt_blowfish(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ setting+16(FP), AX + MOVQ AX, 16(SP) + MOVQ output+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__crypt_blowfish(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__crypt_des(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) +TEXT ·Y__crypt_des(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ setting+16(FP), AX + MOVQ AX, 16(SP) + MOVQ output+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__crypt_des(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__crypt_md5(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) +TEXT ·Y__crypt_md5(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ setting+16(FP), AX + MOVQ AX, 16(SP) + MOVQ output+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__crypt_md5(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__crypt_r(tls *TLS, key uintptr, salt uintptr, data uintptr) (r uintptr) +TEXT ·Y__crypt_r(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ salt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ data+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__crypt_r(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__crypt_sha256(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) +TEXT ·Y__crypt_sha256(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ setting+16(FP), AX + MOVQ AX, 16(SP) + MOVQ output+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__crypt_sha256(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__crypt_sha512(tls *TLS, key uintptr, setting uintptr, output uintptr) (r uintptr) +TEXT ·Y__crypt_sha512(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ setting+16(FP), AX + MOVQ AX, 16(SP) + MOVQ output+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__crypt_sha512(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__ctype_b_loc(tls *TLS) (r uintptr) +TEXT ·Y__ctype_b_loc(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__ctype_b_loc(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__ctype_get_mb_cur_max(tls *TLS) (r Tsize_t) +TEXT ·Y__ctype_get_mb_cur_max(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__ctype_get_mb_cur_max(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__ctype_tolower_loc(tls *TLS) (r uintptr) +TEXT ·Y__ctype_tolower_loc(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__ctype_tolower_loc(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__ctype_toupper_loc(tls *TLS) (r uintptr) +TEXT ·Y__ctype_toupper_loc(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__ctype_toupper_loc(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__des_setkey(tls *TLS, key uintptr, ekey uintptr) +TEXT ·Y__des_setkey(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ekey+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__des_setkey(SB) + RET + +// func Y__dn_expand(tls *TLS, base uintptr, end uintptr, src uintptr, dest uintptr, space int32) (r int32) +TEXT ·Y__dn_expand(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ base+8(FP), AX + MOVQ AX, 8(SP) + MOVQ end+16(FP), AX + MOVQ AX, 16(SP) + MOVQ src+24(FP), AX + MOVQ AX, 24(SP) + MOVQ dest+32(FP), AX + MOVQ AX, 32(SP) + MOVL space+40(FP), AX + MOVL AX, 40(SP) + CALL ·X__dn_expand(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Y__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) +TEXT ·Y__dns_parse(SB),$56-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_callback+24(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal___dns_parse_2(SB) // Create the closure for calling __ccgo_fp_callback + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ r+8(FP), AX + MOVQ AX, 8(SP) + MOVL rlen+16(FP), AX + MOVL AX, 16(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 24(SP) + MOVQ ctx+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__dns_parse(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0___dns_parse_2(SB),$72-68 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVL _2+16(FP), AX + MOVL AX, 16(SP) + MOVQ _3+24(FP), AX + MOVQ AX, 24(SP) + MOVL _4+32(FP), AX + MOVL AX, 32(SP) + MOVQ _5+40(FP), AX + MOVQ AX, 40(SP) + MOVL _6+48(FP), AX + MOVL AX, 48(SP) + MOVQ __ccgo_fp+56(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 56(SP), AX + MOVL AX, _7+64(FP) + RET + +// func Y__do_des(tls *TLS, l_in Tuint32_t, r_in Tuint32_t, l_out uintptr, r_out uintptr, count Tuint32_t, saltbits Tuint32_t, ekey uintptr) +TEXT ·Y__do_des(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL l_in+8(FP), AX + MOVL AX, 8(SP) + MOVL r_in+12(FP), AX + MOVL AX, 12(SP) + MOVQ l_out+16(FP), AX + MOVQ AX, 16(SP) + MOVQ r_out+24(FP), AX + MOVQ AX, 24(SP) + MOVL count+32(FP), AX + MOVL AX, 32(SP) + MOVL saltbits+36(FP), AX + MOVL AX, 36(SP) + MOVQ ekey+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__do_des(SB) + RET + +// func Y__do_orphaned_stdio_locks(tls *TLS) +TEXT ·Y__do_orphaned_stdio_locks(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__do_orphaned_stdio_locks(SB) + RET + +// func Y__dup3(tls *TLS, old int32, new1 int32, flags int32) (r1 int32) +TEXT ·Y__dup3(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL old+8(FP), AX + MOVL AX, 8(SP) + MOVL new1+12(FP), AX + MOVL AX, 12(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__dup3(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Y__duplocale(tls *TLS, old Tlocale_t) (r Tlocale_t) +TEXT ·Y__duplocale(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ old+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__duplocale(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__env_rm_add(tls *TLS, old uintptr, new1 uintptr) +TEXT ·Y__env_rm_add(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ old+8(FP), AX + MOVQ AX, 8(SP) + MOVQ new1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__env_rm_add(SB) + RET + +// func Y__errno_location(tls *TLS) (r uintptr) +TEXT ·Y__errno_location(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__errno_location(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__execvpe(tls *TLS, file uintptr, argv uintptr, envp uintptr) (r int32) +TEXT ·Y__execvpe(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ file+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ envp+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__execvpe(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__expo2(tls *TLS, x float64, sign float64) (r float64) +TEXT ·Y__expo2(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sign+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__expo2(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__expo2f(tls *TLS, x float32, sign float32) (r float32) +TEXT ·Y__expo2f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL sign+12(FP), AX + MOVL AX, 12(SP) + CALL ·X__expo2f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fbufsize(tls *TLS, f uintptr) (r Tsize_t) +TEXT ·Y__fbufsize(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fbufsize(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__fclose_ca(tls *TLS, f uintptr) (r int32) +TEXT ·Y__fclose_ca(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fclose_ca(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) +TEXT ·Y__fdopen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ mode+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__fdopen(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__fesetround(tls *TLS, r int32) (r1 int32) +TEXT ·Y__fesetround(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL r+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__fesetround(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Y__fgetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) +TEXT ·Y__fgetwc_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fgetwc_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__flbf(tls *TLS, f uintptr) (r int32) +TEXT ·Y__flbf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__flbf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__floatscan(tls *TLS, f uintptr, prec int32, pok int32) (r float64) +TEXT ·Y__floatscan(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVL prec+16(FP), AX + MOVL AX, 16(SP) + MOVL pok+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__floatscan(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__fmodeflags(tls *TLS, mode uintptr) (r int32) +TEXT ·Y__fmodeflags(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mode+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fmodeflags(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fopen_rb_ca(tls *TLS, filename uintptr, f uintptr, buf uintptr, len1 Tsize_t) (r uintptr) +TEXT ·Y__fopen_rb_ca(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ len1+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__fopen_rb_ca(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Y__fpclassify(tls *TLS, x float64) (r int32) +TEXT ·Y__fpclassify(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fpclassify(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fpclassifyf(tls *TLS, x float32) (r int32) +TEXT ·Y__fpclassifyf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__fpclassifyf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fpclassifyl(tls *TLS, x float64) (r int32) +TEXT ·Y__fpclassifyl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fpclassifyl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fpending(tls *TLS, f uintptr) (r Tsize_t) +TEXT ·Y__fpending(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fpending(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__fpurge(tls *TLS, f uintptr) (r int32) +TEXT ·Y__fpurge(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fpurge(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +TEXT ·Y__fputwc_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__fputwc_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__freadable(tls *TLS, f uintptr) (r int32) +TEXT ·Y__freadable(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__freadable(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__freadahead(tls *TLS, f uintptr) (r Tsize_t) +TEXT ·Y__freadahead(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__freadahead(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__freading(tls *TLS, f uintptr) (r int32) +TEXT ·Y__freading(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__freading(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__freadptr(tls *TLS, f uintptr, sizep uintptr) (r uintptr) +TEXT ·Y__freadptr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sizep+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__freadptr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__freadptrinc(tls *TLS, f uintptr, inc Tsize_t) +TEXT ·Y__freadptrinc(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ inc+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__freadptrinc(SB) + RET + +// func Y__freelocale(tls *TLS, l Tlocale_t) +TEXT ·Y__freelocale(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__freelocale(SB) + RET + +// func Y__fseeko(tls *TLS, f uintptr, off Toff_t, whence int32) (r int32) +TEXT ·Y__fseeko(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ off+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__fseeko(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__fseeko_unlocked(tls *TLS, f uintptr, off Toff_t, whence int32) (r int32) +TEXT ·Y__fseeko_unlocked(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ off+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__fseeko_unlocked(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__fseterr(tls *TLS, f uintptr) +TEXT ·Y__fseterr(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fseterr(SB) + RET + +// func Y__fsetlocking(tls *TLS, f uintptr, type1 int32) (r int32) +TEXT ·Y__fsetlocking(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVL type1+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__fsetlocking(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__fstat(tls *TLS, fd int32, st uintptr) (r int32) +TEXT ·Y__fstat(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ st+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__fstat(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__fstatat(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r int32) +TEXT ·Y__fstatat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVQ st+24(FP), AX + MOVQ AX, 24(SP) + MOVL flag+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__fstatat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Y__ftello(tls *TLS, f uintptr) (r Toff_t) +TEXT ·Y__ftello(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__ftello(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__ftello_unlocked(tls *TLS, f uintptr) (r Toff_t) +TEXT ·Y__ftello_unlocked(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__ftello_unlocked(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__funcs_on_quick_exit(tls *TLS) +TEXT ·Y__funcs_on_quick_exit(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__funcs_on_quick_exit(SB) + RET + +// func Y__futimesat(tls *TLS, dirfd int32, pathname uintptr, times uintptr) (r int32) +TEXT ·Y__futimesat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL dirfd+8(FP), AX + MOVL AX, 8(SP) + MOVQ pathname+16(FP), AX + MOVQ AX, 16(SP) + MOVQ times+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__futimesat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__fwritable(tls *TLS, f uintptr) (r int32) +TEXT ·Y__fwritable(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fwritable(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fwritex(tls *TLS, s uintptr, l Tsize_t, f uintptr) (r Tsize_t) +TEXT ·Y__fwritex(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__fwritex(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__fwriting(tls *TLS, f uintptr) (r int32) +TEXT ·Y__fwriting(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__fwriting(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__fxstat(tls *TLS, ver int32, fd int32, buf uintptr) (r int32) +TEXT ·Y__fxstat(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ver+8(FP), AX + MOVL AX, 8(SP) + MOVL fd+12(FP), AX + MOVL AX, 12(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__fxstat(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__fxstatat(tls *TLS, ver int32, fd int32, path uintptr, buf uintptr, flag int32) (r int32) +TEXT ·Y__fxstatat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ver+8(FP), AX + MOVL AX, 8(SP) + MOVL fd+12(FP), AX + MOVL AX, 12(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVL flag+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__fxstatat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Y__get_handler_set(tls *TLS, set uintptr) +TEXT ·Y__get_handler_set(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__get_handler_set(SB) + RET + +// func Y__get_locale(tls *TLS, cat int32, val uintptr) (r uintptr) +TEXT ·Y__get_locale(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL cat+8(FP), AX + MOVL AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__get_locale(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__get_resolv_conf(tls *TLS, conf uintptr, search uintptr, search_sz Tsize_t) (r int32) +TEXT ·Y__get_resolv_conf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ conf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ search+16(FP), AX + MOVQ AX, 16(SP) + MOVQ search_sz+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__get_resolv_conf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__getauxval(tls *TLS, item uint64) (r uint64) +TEXT ·Y__getauxval(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ item+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__getauxval(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__getdelim(tls *TLS, s uintptr, n uintptr, delim int32, f uintptr) (r Tssize_t) +TEXT ·Y__getdelim(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVL delim+24(FP), AX + MOVL AX, 24(SP) + MOVQ f+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__getdelim(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Y__getgr_a(tls *TLS, name uintptr, gid Tgid_t, gr uintptr, buf uintptr, size uintptr, mem uintptr, nmem uintptr, res uintptr) (r int32) +TEXT ·Y__getgr_a(SB),$80-76 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVL gid+16(FP), AX + MOVL AX, 16(SP) + MOVQ gr+24(FP), AX + MOVQ AX, 24(SP) + MOVQ buf+32(FP), AX + MOVQ AX, 32(SP) + MOVQ size+40(FP), AX + MOVQ AX, 40(SP) + MOVQ mem+48(FP), AX + MOVQ AX, 48(SP) + MOVQ nmem+56(FP), AX + MOVQ AX, 56(SP) + MOVQ res+64(FP), AX + MOVQ AX, 64(SP) + CALL ·X__getgr_a(SB) + MOVL 72(SP), AX + MOVL AX, r+72(FP) + RET + +// func Y__getgrent_a(tls *TLS, f uintptr, gr uintptr, line uintptr, size uintptr, mem uintptr, nmem uintptr, res uintptr) (r int32) +TEXT ·Y__getgrent_a(SB),$72-68 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ gr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ line+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVQ mem+40(FP), AX + MOVQ AX, 40(SP) + MOVQ nmem+48(FP), AX + MOVQ AX, 48(SP) + MOVQ res+56(FP), AX + MOVQ AX, 56(SP) + CALL ·X__getgrent_a(SB) + MOVL 64(SP), AX + MOVL AX, r+64(FP) + RET + +// func Y__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) +TEXT ·Y__getopt_msg(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + MOVQ c+24(FP), AX + MOVQ AX, 24(SP) + MOVQ l+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__getopt_msg(SB) + RET + +// func Y__getpw_a(tls *TLS, name uintptr, uid Tuid_t, pw uintptr, buf uintptr, size uintptr, res uintptr) (r int32) +TEXT ·Y__getpw_a(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVL uid+16(FP), AX + MOVL AX, 16(SP) + MOVQ pw+24(FP), AX + MOVQ AX, 24(SP) + MOVQ buf+32(FP), AX + MOVQ AX, 32(SP) + MOVQ size+40(FP), AX + MOVQ AX, 40(SP) + MOVQ res+48(FP), AX + MOVQ AX, 48(SP) + CALL ·X__getpw_a(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Y__getpwent_a(tls *TLS, f uintptr, pw uintptr, line uintptr, size uintptr, res uintptr) (r int32) +TEXT ·Y__getpwent_a(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ pw+16(FP), AX + MOVQ AX, 16(SP) + MOVQ line+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVQ res+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__getpwent_a(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Y__gettextdomain(tls *TLS) (r uintptr) +TEXT ·Y__gettextdomain(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__gettextdomain(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__gmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) +TEXT ·Y__gmtime_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tm+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__gmtime_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__h_errno_location(tls *TLS) (r uintptr) +TEXT ·Y__h_errno_location(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__h_errno_location(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__inet_aton(tls *TLS, s0 uintptr, dest uintptr) (r int32) +TEXT ·Y__inet_aton(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s0+8(FP), AX + MOVQ AX, 8(SP) + MOVQ dest+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__inet_aton(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__init_ssp(tls *TLS, entropy uintptr) +TEXT ·Y__init_ssp(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ entropy+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__init_ssp(SB) + RET + +// func Y__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) (r uint64) +TEXT ·Y__intscan(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVL base+16(FP), AX + MOVL AX, 16(SP) + MOVL pok+20(FP), AX + MOVL AX, 20(SP) + MOVQ lim+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__intscan(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__isalnum_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isalnum_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isalnum_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isalpha_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isalpha_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isalpha_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isblank_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isblank_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isblank_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iscntrl_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__iscntrl_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iscntrl_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isfinite(tls *TLS, d float64) (_2 int32) +TEXT ·Y__isfinite(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__isfinite(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__isfinitef(tls *TLS, f float32) (_2 int32) +TEXT ·Y__isfinitef(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL f+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__isfinitef(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__isfinitel(tls *TLS, d float64) (_2 int32) +TEXT ·Y__isfinitel(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__isfinitel(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__isgraph_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isgraph_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isgraph_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__islower_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__islower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__islower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isnan(t *TLS, x float64) (_2 int32) +TEXT ·Y__isnan(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__isnan(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__isnanf(t *TLS, arg float32) (_2 int32) +TEXT ·Y__isnanf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL arg+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__isnanf(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__isnanl(t *TLS, arg float64) (_2 int32) +TEXT ·Y__isnanl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ arg+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__isnanl(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__isoc99_fscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Y__isoc99_fscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_fscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_fwscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Y__isoc99_fwscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_fwscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_scanf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Y__isoc99_scanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isoc99_scanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isoc99_sscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Y__isoc99_sscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_sscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_swscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Y__isoc99_swscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_swscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_vfscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Y__isoc99_vfscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_vfscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_vfwscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Y__isoc99_vfwscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_vfwscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_vscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Y__isoc99_vscanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isoc99_vscanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isoc99_vsscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Y__isoc99_vsscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_vsscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_vswscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Y__isoc99_vswscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__isoc99_vswscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__isoc99_vwscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Y__isoc99_vwscanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isoc99_vwscanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isoc99_wscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Y__isoc99_wscanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isoc99_wscanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isprint_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isprint_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isprint_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__ispunct_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__ispunct_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__ispunct_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isspace_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isspace_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isspace_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswalnum_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswalnum_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswalnum_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswalpha_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswalpha_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswalpha_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswblank_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswblank_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswblank_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswcntrl_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswcntrl_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswcntrl_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswctype_l(tls *TLS, c Twint_t, t Twctype_t, l Tlocale_t) (r int32) +TEXT ·Y__iswctype_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ t+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__iswctype_l(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__iswdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswgraph_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswgraph_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswgraph_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswlower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswlower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswprint_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswprint_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswprint_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswpunct_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswpunct_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswpunct_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswspace_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswspace_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswspace_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__iswxdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Y__iswxdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__iswxdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__isxdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__isxdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__isxdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__lctrans(tls *TLS, msg uintptr, lm uintptr) (r uintptr) +TEXT ·Y__lctrans(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + MOVQ lm+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__lctrans(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__lctrans_cur(tls *TLS, msg uintptr) (r uintptr) +TEXT ·Y__lctrans_cur(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__lctrans_cur(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__lctrans_impl(tls *TLS, msg uintptr, lm uintptr) (r uintptr) +TEXT ·Y__lctrans_impl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + MOVQ lm+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__lctrans_impl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__ldexp_cexp(tls *TLS, z complex128, expt int32) (r complex128) +TEXT ·Y__ldexp_cexp(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + MOVL expt+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__ldexp_cexp(SB) + MOVQ 32(SP), AX + MOVQ AX, r_real+32(FP) + MOVQ 40(SP), AX + MOVQ AX, r_imag+40(FP) + RET + +// func Y__ldexp_cexpf(tls *TLS, z complex64, expt int32) (r complex64) +TEXT ·Y__ldexp_cexpf(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + MOVL expt+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__ldexp_cexpf(SB) + MOVL 24(SP), AX + MOVL AX, r_real+24(FP) + MOVL 28(SP), AX + MOVL AX, r_imag+28(FP) + RET + +// func Y__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) +TEXT ·Y__lgamma_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ signgamp+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__lgamma_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r1+24(FP) + RET + +// func Y__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) +TEXT ·Y__lgammaf_r(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVQ signgamp+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__lgammaf_r(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Y__lgammal_r(tls *TLS, x float64, sg uintptr) (r float64) +TEXT ·Y__lgammal_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sg+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__lgammal_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__libc_current_sigrtmax(tls *TLS) (r int32) +TEXT ·Y__libc_current_sigrtmax(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__libc_current_sigrtmax(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Y__libc_current_sigrtmin(tls *TLS) (r int32) +TEXT ·Y__libc_current_sigrtmin(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__libc_current_sigrtmin(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Y__libc_sigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r1 int32) +TEXT ·Y__libc_sigaction(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sig+8(FP), AX + MOVL AX, 8(SP) + MOVQ sa+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__libc_sigaction(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Y__loc_is_allocated(tls *TLS, loc Tlocale_t) (r int32) +TEXT ·Y__loc_is_allocated(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ loc+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__loc_is_allocated(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__localtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) +TEXT ·Y__localtime_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tm+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__localtime_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__lockfile(tls *TLS, file uintptr) (_2 int32) +TEXT ·Y__lockfile(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ file+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__lockfile(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Y__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) (r int32) +TEXT ·Y__lookup_ipliteral(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVL family+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__lookup_ipliteral(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) (r int32) +TEXT ·Y__lookup_name(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ canon+16(FP), AX + MOVQ AX, 16(SP) + MOVQ name+24(FP), AX + MOVQ AX, 24(SP) + MOVL family+32(FP), AX + MOVL AX, 32(SP) + MOVL flags+36(FP), AX + MOVL AX, 36(SP) + CALL ·X__lookup_name(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Y__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) (r int32) +TEXT ·Y__lookup_serv(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVL proto+24(FP), AX + MOVL AX, 24(SP) + MOVL socktype+28(FP), AX + MOVL AX, 28(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__lookup_serv(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Y__lseek(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) +TEXT ·Y__lseek(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ offset+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__lseek(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__lsysinfo(tls *TLS, info uintptr) (r int32) +TEXT ·Y__lsysinfo(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ info+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__lsysinfo(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__lxstat(tls *TLS, ver int32, path uintptr, buf uintptr) (r int32) +TEXT ·Y__lxstat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ver+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__lxstat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__madvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) +TEXT ·Y__madvise(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL advice+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__madvise(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__map_file(tls *TLS, pathname uintptr, size uintptr) (r uintptr) +TEXT ·Y__map_file(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ pathname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__map_file(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__math_divzero(tls *TLS, sign Tuint32_t) (r float64) +TEXT ·Y__math_divzero(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__math_divzero(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__math_divzerof(tls *TLS, sign Tuint32_t) (r float32) +TEXT ·Y__math_divzerof(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__math_divzerof(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__math_invalid(tls *TLS, x float64) (r float64) +TEXT ·Y__math_invalid(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__math_invalid(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__math_invalidf(tls *TLS, x float32) (r float32) +TEXT ·Y__math_invalidf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__math_invalidf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__math_oflow(tls *TLS, sign Tuint32_t) (r float64) +TEXT ·Y__math_oflow(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__math_oflow(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__math_oflowf(tls *TLS, sign Tuint32_t) (r float32) +TEXT ·Y__math_oflowf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__math_oflowf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__math_uflow(tls *TLS, sign Tuint32_t) (r float64) +TEXT ·Y__math_uflow(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__math_uflow(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__math_uflowf(tls *TLS, sign Tuint32_t) (r float32) +TEXT ·Y__math_uflowf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__math_uflowf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) +TEXT ·Y__math_xflow(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + MOVQ y2+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__math_xflow(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) +TEXT ·Y__math_xflowf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sign+8(FP), AX + MOVL AX, 8(SP) + MOVL y2+12(FP), AX + MOVL AX, 12(SP) + CALL ·X__math_xflowf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__memrchr(tls *TLS, m uintptr, c int32, n Tsize_t) (r uintptr) +TEXT ·Y__memrchr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__memrchr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__mkostemps(tls *TLS, template uintptr, len1 int32, flags int32) (r int32) +TEXT ·Y__mkostemps(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + MOVL len1+16(FP), AX + MOVL AX, 16(SP) + MOVL flags+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__mkostemps(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__mmap(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) +TEXT ·Y__mmap(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ start+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL prot+24(FP), AX + MOVL AX, 24(SP) + MOVL flags+28(FP), AX + MOVL AX, 28(SP) + MOVL fd+32(FP), AX + MOVL AX, 32(SP) + MOVQ off+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__mmap(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Y__mo_lookup(tls *TLS, p uintptr, size Tsize_t, s uintptr) (r uintptr) +TEXT ·Y__mo_lookup(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ s+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__mo_lookup(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__month_to_secs(tls *TLS, month int32, is_leap int32) (r int32) +TEXT ·Y__month_to_secs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL month+8(FP), AX + MOVL AX, 8(SP) + MOVL is_leap+12(FP), AX + MOVL AX, 12(SP) + CALL ·X__month_to_secs(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__mprotect(tls *TLS, addr uintptr, len1 Tsize_t, prot int32) (r int32) +TEXT ·Y__mprotect(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL prot+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__mprotect(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__mremap(tls *TLS, old_addr uintptr, old_len Tsize_t, new_len Tsize_t, flags int32, va uintptr) (r uintptr) +TEXT ·Y__mremap(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ old_addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ old_len+16(FP), AX + MOVQ AX, 16(SP) + MOVQ new_len+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + MOVQ va+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__mremap(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Y__munmap(tls *TLS, start uintptr, len1 Tsize_t) (r int32) +TEXT ·Y__munmap(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ start+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__munmap(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__newlocale(tls *TLS, mask int32, name uintptr, loc Tlocale_t) (r Tlocale_t) +TEXT ·Y__newlocale(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL mask+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ loc+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__newlocale(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) +TEXT ·Y__nl_langinfo(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL item+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__nl_langinfo(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__nl_langinfo_l(tls *TLS, item Tnl_item, loc Tlocale_t) (r uintptr) +TEXT ·Y__nl_langinfo_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL item+8(FP), AX + MOVL AX, 8(SP) + MOVQ loc+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__nl_langinfo_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__nscd_query(tls *TLS, req Tint32_t, key uintptr, buf uintptr, len1 Tsize_t, swap uintptr) (r uintptr) +TEXT ·Y__nscd_query(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL req+8(FP), AX + MOVL AX, 8(SP) + MOVQ key+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ len1+32(FP), AX + MOVQ AX, 32(SP) + MOVQ swap+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__nscd_query(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Y__ofl_add(tls *TLS, f uintptr) (r uintptr) +TEXT ·Y__ofl_add(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__ofl_add(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__ofl_lock(tls *TLS) (r uintptr) +TEXT ·Y__ofl_lock(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__ofl_lock(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__ofl_unlock(tls *TLS) +TEXT ·Y__ofl_unlock(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__ofl_unlock(SB) + RET + +// func Y__overflow(tls *TLS, f uintptr, _c int32) (r int32) +TEXT ·Y__overflow(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVL _c+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__overflow(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__pleval(tls *TLS, s uintptr, n uint64) (r uint64) +TEXT ·Y__pleval(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__pleval(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__posix_getopt(tls *TLS, argc int32, argv uintptr, optstring uintptr) (r int32) +TEXT ·Y__posix_getopt(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL argc+8(FP), AX + MOVL AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ optstring+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__posix_getopt(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__procfdname(tls *TLS, buf uintptr, fd uint32) +TEXT ·Y__procfdname(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVL fd+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__procfdname(SB) + RET + +// func Y__ptsname_r(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) +TEXT ·Y__ptsname_r(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__ptsname_r(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__putenv(tls *TLS, s uintptr, l Tsize_t, r uintptr) (r1 int32) +TEXT ·Y__putenv(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + MOVQ r+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__putenv(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Y__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) +TEXT ·Y__qsort_r(SB),$56-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+32(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal___qsort_r_3(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ base+8(FP), AX + MOVQ AX, 8(SP) + MOVQ nel+16(FP), AX + MOVQ AX, 16(SP) + MOVQ width+24(FP), AX + MOVQ AX, 24(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 32(SP) + MOVQ arg+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__qsort_r(SB) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0___qsort_r_3(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ _3+24(FP), AX + MOVQ AX, 24(SP) + MOVQ __ccgo_fp+32(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 32(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y__rand48_step(tls *TLS, xi uintptr, lc uintptr) (r Tuint64_t) +TEXT ·Y__rand48_step(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ xi+8(FP), AX + MOVQ AX, 8(SP) + MOVQ lc+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__rand48_step(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__register_locked_file(tls *TLS, f uintptr, self Tpthread_t) +TEXT ·Y__register_locked_file(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ self+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__register_locked_file(SB) + RET + +// func Y__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) +TEXT ·Y__rem_pio2(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__rem_pio2(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Y__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec int32) (r int32) +TEXT ·Y__rem_pio2_large(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVL e0+24(FP), AX + MOVL AX, 24(SP) + MOVL nx+28(FP), AX + MOVL AX, 28(SP) + MOVL prec+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__rem_pio2_large(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Y__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) +TEXT ·Y__rem_pio2f(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__rem_pio2f(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__res_mkquery(tls *TLS, op int32, dname uintptr, class int32, type1 int32, data uintptr, datalen int32, newrr uintptr, buf uintptr, buflen int32) (r int32) +TEXT ·Y__res_mkquery(SB),$80-76 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL op+8(FP), AX + MOVL AX, 8(SP) + MOVQ dname+16(FP), AX + MOVQ AX, 16(SP) + MOVL class+24(FP), AX + MOVL AX, 24(SP) + MOVL type1+28(FP), AX + MOVL AX, 28(SP) + MOVQ data+32(FP), AX + MOVQ AX, 32(SP) + MOVL datalen+40(FP), AX + MOVL AX, 40(SP) + MOVQ newrr+48(FP), AX + MOVQ AX, 48(SP) + MOVQ buf+56(FP), AX + MOVQ AX, 56(SP) + MOVL buflen+64(FP), AX + MOVL AX, 64(SP) + CALL ·X__res_mkquery(SB) + MOVL 72(SP), AX + MOVL AX, r+72(FP) + RET + +// func Y__res_msend(tls *TLS, nqueries int32, queries uintptr, qlens uintptr, answers uintptr, alens uintptr, asize int32) (r int32) +TEXT ·Y__res_msend(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL nqueries+8(FP), AX + MOVL AX, 8(SP) + MOVQ queries+16(FP), AX + MOVQ AX, 16(SP) + MOVQ qlens+24(FP), AX + MOVQ AX, 24(SP) + MOVQ answers+32(FP), AX + MOVQ AX, 32(SP) + MOVQ alens+40(FP), AX + MOVQ AX, 40(SP) + MOVL asize+48(FP), AX + MOVL AX, 48(SP) + CALL ·X__res_msend(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Y__res_msend_rc(tls *TLS, nqueries int32, queries uintptr, qlens uintptr, answers uintptr, alens uintptr, asize int32, conf uintptr) (r1 int32) +TEXT ·Y__res_msend_rc(SB),$72-68 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL nqueries+8(FP), AX + MOVL AX, 8(SP) + MOVQ queries+16(FP), AX + MOVQ AX, 16(SP) + MOVQ qlens+24(FP), AX + MOVQ AX, 24(SP) + MOVQ answers+32(FP), AX + MOVQ AX, 32(SP) + MOVQ alens+40(FP), AX + MOVQ AX, 40(SP) + MOVL asize+48(FP), AX + MOVL AX, 48(SP) + MOVQ conf+56(FP), AX + MOVQ AX, 56(SP) + CALL ·X__res_msend_rc(SB) + MOVL 64(SP), AX + MOVL AX, r1+64(FP) + RET + +// func Y__res_send(tls *TLS, _msg uintptr, _msglen int32, _answer uintptr, _anslen int32) (r1 int32) +TEXT ·Y__res_send(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _msg+8(FP), AX + MOVQ AX, 8(SP) + MOVL _msglen+16(FP), AX + MOVL AX, 16(SP) + MOVQ _answer+24(FP), AX + MOVQ AX, 24(SP) + MOVL _anslen+32(FP), AX + MOVL AX, 32(SP) + CALL ·X__res_send(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Y__res_state(tls *TLS) (r uintptr) +TEXT ·Y__res_state(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__res_state(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Y__reset_tls(tls *TLS) +TEXT ·Y__reset_tls(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__reset_tls(SB) + RET + +// func Y__restore(tls *TLS) +TEXT ·Y__restore(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__restore(SB) + RET + +// func Y__restore_rt(tls *TLS) +TEXT ·Y__restore_rt(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__restore_rt(SB) + RET + +// func Y__restore_sigs(tls *TLS, set uintptr) +TEXT ·Y__restore_sigs(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__restore_sigs(SB) + RET + +// func Y__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) +TEXT ·Y__rtnetlink_enumerate(SB),$48-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cb+16(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal___rtnetlink_enumerate_2(SB) // Create the closure for calling __ccgo_fp_cb + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL link_af+8(FP), AX + MOVL AX, 8(SP) + MOVL addr_af+12(FP), AX + MOVL AX, 12(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 24(SP) + MOVQ ctx+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__rtnetlink_enumerate(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0___rtnetlink_enumerate_2(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Y__secs_to_tm(tls *TLS, t int64, tm uintptr) (r int32) +TEXT ·Y__secs_to_tm(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tm+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__secs_to_tm(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__secs_to_zone(tls *TLS, t int64, local int32, isdst uintptr, offset uintptr, oppoff uintptr, zonename uintptr) +TEXT ·Y__secs_to_zone(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVL local+16(FP), AX + MOVL AX, 16(SP) + MOVQ isdst+24(FP), AX + MOVQ AX, 24(SP) + MOVQ offset+32(FP), AX + MOVQ AX, 32(SP) + MOVQ oppoff+40(FP), AX + MOVQ AX, 40(SP) + MOVQ zonename+48(FP), AX + MOVQ AX, 48(SP) + CALL ·X__secs_to_zone(SB) + RET + +// func Y__setxid(tls *TLS, nr int32, id int32, eid int32, sid int32) (r int32) +TEXT ·Y__setxid(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL nr+8(FP), AX + MOVL AX, 8(SP) + MOVL id+12(FP), AX + MOVL AX, 12(SP) + MOVL eid+16(FP), AX + MOVL AX, 16(SP) + MOVL sid+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__setxid(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__shgetc(tls *TLS, f uintptr) (r int32) +TEXT ·Y__shgetc(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__shgetc(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__shlim(tls *TLS, f uintptr, lim Toff_t) +TEXT ·Y__shlim(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ lim+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__shlim(SB) + RET + +// func Y__shm_mapname(tls *TLS, name uintptr, buf uintptr) (r uintptr) +TEXT ·Y__shm_mapname(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__shm_mapname(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__sigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r1 int32) +TEXT ·Y__sigaction(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sig+8(FP), AX + MOVL AX, 8(SP) + MOVQ sa+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__sigaction(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Y__signbit(tls *TLS, x float64) (r int32) +TEXT ·Y__signbit(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__signbit(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__signbitf(tls *TLS, x float32) (r int32) +TEXT ·Y__signbitf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·X__signbitf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__signbitl(tls *TLS, x float64) (r int32) +TEXT ·Y__signbitl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__signbitl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__sigsetjmp_tail(tls *TLS, jb uintptr, ret int32) (r int32) +TEXT ·Y__sigsetjmp_tail(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ jb+8(FP), AX + MOVQ AX, 8(SP) + MOVL ret+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__sigsetjmp_tail(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) +TEXT ·Y__sin(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVL iy+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__sin(SB) + MOVQ 32(SP), AX + MOVQ AX, r1+32(FP) + RET + +// func Y__sindf(tls *TLS, x float64) (r1 float32) +TEXT ·Y__sindf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__sindf(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Y__stack_chk_fail(tls *TLS) +TEXT ·Y__stack_chk_fail(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__stack_chk_fail(SB) + RET + +// func Y__stack_chk_fail_local(tls *TLS) +TEXT ·Y__stack_chk_fail_local(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__stack_chk_fail_local(SB) + RET + +// func Y__stdio_close(tls *TLS, f uintptr) (r int32) +TEXT ·Y__stdio_close(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__stdio_close(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__stdio_exit(tls *TLS) +TEXT ·Y__stdio_exit(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__stdio_exit(SB) + RET + +// func Y__stdio_exit_needed(tls *TLS) +TEXT ·Y__stdio_exit_needed(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__stdio_exit_needed(SB) + RET + +// func Y__stdio_read(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) +TEXT ·Y__stdio_read(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__stdio_read(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__stdio_seek(tls *TLS, f uintptr, off Toff_t, whence int32) (r Toff_t) +TEXT ·Y__stdio_seek(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ off+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__stdio_seek(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__stdio_write(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) +TEXT ·Y__stdio_write(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__stdio_write(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__stdout_write(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) +TEXT ·Y__stdout_write(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__stdout_write(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__stpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) +TEXT ·Y__stpcpy(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__stpcpy(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__stpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Y__stpncpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__stpncpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strcasecmp_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) +TEXT ·Y__strcasecmp_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ loc+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__strcasecmp_l(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Y__strchrnul(tls *TLS, s uintptr, c int32) (r uintptr) +TEXT ·Y__strchrnul(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__strchrnul(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__strcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) +TEXT ·Y__strcoll_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ loc+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__strcoll_l(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Y__strerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) +TEXT ·Y__strerror_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL e+8(FP), AX + MOVL AX, 8(SP) + MOVQ loc+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__strerror_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__strftime_fmt_1(tls *TLS, s uintptr, l uintptr, f int32, tm uintptr, loc Tlocale_t, pad int32) (r uintptr) +TEXT ·Y__strftime_fmt_1(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + MOVL f+24(FP), AX + MOVL AX, 24(SP) + MOVQ tm+32(FP), AX + MOVQ AX, 32(SP) + MOVQ loc+40(FP), AX + MOVQ AX, 40(SP) + MOVL pad+48(FP), AX + MOVL AX, 48(SP) + CALL ·X__strftime_fmt_1(SB) + MOVQ 56(SP), AX + MOVQ AX, r+56(FP) + RET + +// func Y__strftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) +TEXT ·Y__strftime_l(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + MOVQ tm+32(FP), AX + MOVQ AX, 32(SP) + MOVQ loc+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__strftime_l(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Y__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, loc Tlocale_t) (r1 int32) +TEXT ·Y__strncasecmp_l(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ loc+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__strncasecmp_l(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Y__strtod_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) +TEXT ·Y__strtod_l(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__strtod_l(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strtof_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float32) +TEXT ·Y__strtof_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__strtof_l(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__strtoimax_internal(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) +TEXT ·Y__strtoimax_internal(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__strtoimax_internal(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strtol_internal(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +TEXT ·Y__strtol_internal(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__strtol_internal(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strtold_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) +TEXT ·Y__strtold_l(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__strtold_l(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strtoll_internal(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +TEXT ·Y__strtoll_internal(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__strtoll_internal(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strtoul_internal(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +TEXT ·Y__strtoul_internal(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__strtoul_internal(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strtoull_internal(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +TEXT ·Y__strtoull_internal(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__strtoull_internal(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strtoumax_internal(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) +TEXT ·Y__strtoumax_internal(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__strtoumax_internal(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__strxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) +TEXT ·Y__strxfrm_l(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ loc+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__strxfrm_l(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Y__sync_synchronize(t *TLS) +TEXT ·Y__sync_synchronize(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__sync_synchronize(SB) + RET + +// func Y__sync_val_compare_and_swapInt16(t *TLS, ptr uintptr, oldval, newval int16) (r int16) +TEXT ·Y__sync_val_compare_and_swapInt16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW oldval+16(FP), AX + MOVW AX, 16(SP) + MOVW newval+18(FP), AX + MOVW AX, 18(SP) + CALL ·X__sync_val_compare_and_swapInt16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__sync_val_compare_and_swapInt32(t *TLS, ptr uintptr, oldval, newval int32) (r int32) +TEXT ·Y__sync_val_compare_and_swapInt32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL oldval+16(FP), AX + MOVL AX, 16(SP) + MOVL newval+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__sync_val_compare_and_swapInt32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__sync_val_compare_and_swapInt64(t *TLS, ptr uintptr, oldval, newval int64) (r int64) +TEXT ·Y__sync_val_compare_and_swapInt64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ oldval+16(FP), AX + MOVQ AX, 16(SP) + MOVQ newval+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__sync_val_compare_and_swapInt64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__sync_val_compare_and_swapInt8(t *TLS, ptr uintptr, oldval, newval int8) (r int8) +TEXT ·Y__sync_val_compare_and_swapInt8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB oldval+16(FP), AX + MOVB AX, 16(SP) + MOVB newval+17(FP), AX + MOVB AX, 17(SP) + CALL ·X__sync_val_compare_and_swapInt8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__sync_val_compare_and_swapUint16(t *TLS, ptr uintptr, oldval, newval uint16) (r uint16) +TEXT ·Y__sync_val_compare_and_swapUint16(SB),$32-26 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVW oldval+16(FP), AX + MOVW AX, 16(SP) + MOVW newval+18(FP), AX + MOVW AX, 18(SP) + CALL ·X__sync_val_compare_and_swapUint16(SB) + MOVW 24(SP), AX + MOVW AX, r+24(FP) + RET + +// func Y__sync_val_compare_and_swapUint32(t *TLS, ptr uintptr, oldval, newval uint32) (r uint32) +TEXT ·Y__sync_val_compare_and_swapUint32(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVL oldval+16(FP), AX + MOVL AX, 16(SP) + MOVL newval+20(FP), AX + MOVL AX, 20(SP) + CALL ·X__sync_val_compare_and_swapUint32(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__sync_val_compare_and_swapUint64(t *TLS, ptr uintptr, oldval, newval uint64) (r uint64) +TEXT ·Y__sync_val_compare_and_swapUint64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ oldval+16(FP), AX + MOVQ AX, 16(SP) + MOVQ newval+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__sync_val_compare_and_swapUint64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Y__sync_val_compare_and_swapUint8(t *TLS, ptr uintptr, oldval, newval uint8) (r uint8) +TEXT ·Y__sync_val_compare_and_swapUint8(SB),$32-25 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVB oldval+16(FP), AX + MOVB AX, 16(SP) + MOVB newval+17(FP), AX + MOVB AX, 17(SP) + CALL ·X__sync_val_compare_and_swapUint8(SB) + MOVB 24(SP), AX + MOVB AX, r+24(FP) + RET + +// func Y__syscall0(tls *TLS, n long) (_2 long) +TEXT ·Y__syscall0(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__syscall0(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Y__syscall1(tls *TLS, n, a1 long) (_2 long) +TEXT ·Y__syscall1(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__syscall1(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Y__syscall2(tls *TLS, n, a1, a2 long) (_2 long) +TEXT ·Y__syscall2(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ a2+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__syscall2(SB) + MOVQ 32(SP), AX + MOVQ AX, _2+32(FP) + RET + +// func Y__syscall3(tls *TLS, n, a1, a2, a3 long) (_2 long) +TEXT ·Y__syscall3(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ a2+24(FP), AX + MOVQ AX, 24(SP) + MOVQ a3+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__syscall3(SB) + MOVQ 40(SP), AX + MOVQ AX, _2+40(FP) + RET + +// func Y__syscall4(tls *TLS, n, a1, a2, a3, a4 long) (_2 long) +TEXT ·Y__syscall4(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ a2+24(FP), AX + MOVQ AX, 24(SP) + MOVQ a3+32(FP), AX + MOVQ AX, 32(SP) + MOVQ a4+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__syscall4(SB) + MOVQ 48(SP), AX + MOVQ AX, _2+48(FP) + RET + +// func Y__syscall5(tls *TLS, n, a1, a2, a3, a4, a5 long) (_2 long) +TEXT ·Y__syscall5(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ a2+24(FP), AX + MOVQ AX, 24(SP) + MOVQ a3+32(FP), AX + MOVQ AX, 32(SP) + MOVQ a4+40(FP), AX + MOVQ AX, 40(SP) + MOVQ a5+48(FP), AX + MOVQ AX, 48(SP) + CALL ·X__syscall5(SB) + MOVQ 56(SP), AX + MOVQ AX, _2+56(FP) + RET + +// func Y__syscall6(tls *TLS, n, a1, a2, a3, a4, a5, a6 long) (_2 long) +TEXT ·Y__syscall6(SB),$72-72 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ a2+24(FP), AX + MOVQ AX, 24(SP) + MOVQ a3+32(FP), AX + MOVQ AX, 32(SP) + MOVQ a4+40(FP), AX + MOVQ AX, 40(SP) + MOVQ a5+48(FP), AX + MOVQ AX, 48(SP) + MOVQ a6+56(FP), AX + MOVQ AX, 56(SP) + CALL ·X__syscall6(SB) + MOVQ 64(SP), AX + MOVQ AX, _2+64(FP) + RET + +// func Y__syscall_ret(tls *TLS, r uint64) (r1 int64) +TEXT ·Y__syscall_ret(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ r+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__syscall_ret(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Y__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) +TEXT ·Y__tan(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVL odd+24(FP), AX + MOVL AX, 24(SP) + CALL ·X__tan(SB) + MOVQ 32(SP), AX + MOVQ AX, r1+32(FP) + RET + +// func Y__tandf(tls *TLS, x float64, odd int32) (r1 float32) +TEXT ·Y__tandf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL odd+16(FP), AX + MOVL AX, 16(SP) + CALL ·X__tandf(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Y__tm_to_secs(tls *TLS, tm uintptr) (r int64) +TEXT ·Y__tm_to_secs(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tm+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__tm_to_secs(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__tm_to_tzname(tls *TLS, tm uintptr) (r uintptr) +TEXT ·Y__tm_to_tzname(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tm+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__tm_to_tzname(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__tolower_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__tolower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__tolower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__toread(tls *TLS, f uintptr) (r int32) +TEXT ·Y__toread(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__toread(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__toread_needs_stdio_exit(tls *TLS) +TEXT ·Y__toread_needs_stdio_exit(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__toread_needs_stdio_exit(SB) + RET + +// func Y__toupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Y__toupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__toupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__towctrans_l(tls *TLS, c Twint_t, t Twctrans_t, l Tlocale_t) (r Twint_t) +TEXT ·Y__towctrans_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ t+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__towctrans_l(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__towlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) +TEXT ·Y__towlower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__towlower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__towrite(tls *TLS, f uintptr) (r int32) +TEXT ·Y__towrite(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__towrite(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__towrite_needs_stdio_exit(tls *TLS) +TEXT ·Y__towrite_needs_stdio_exit(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__towrite_needs_stdio_exit(SB) + RET + +// func Y__towupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) +TEXT ·Y__towupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__towupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Y__tre_mem_alloc_impl(tls *TLS, mem Ttre_mem_t, provided int32, provided_block uintptr, zero int32, size Tsize_t) (r uintptr) +TEXT ·Y__tre_mem_alloc_impl(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mem+8(FP), AX + MOVQ AX, 8(SP) + MOVL provided+16(FP), AX + MOVL AX, 16(SP) + MOVQ provided_block+24(FP), AX + MOVQ AX, 24(SP) + MOVL zero+32(FP), AX + MOVL AX, 32(SP) + MOVQ size+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__tre_mem_alloc_impl(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Y__tre_mem_destroy(tls *TLS, mem Ttre_mem_t) +TEXT ·Y__tre_mem_destroy(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mem+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__tre_mem_destroy(SB) + RET + +// func Y__tre_mem_new_impl(tls *TLS, provided int32, provided_block uintptr) (r Ttre_mem_t) +TEXT ·Y__tre_mem_new_impl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL provided+8(FP), AX + MOVL AX, 8(SP) + MOVQ provided_block+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__tre_mem_new_impl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__tsearch_balance(tls *TLS, p uintptr) (r int32) +TEXT ·Y__tsearch_balance(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__tsearch_balance(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__uflow(tls *TLS, f uintptr) (r int32) +TEXT ·Y__uflow(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__uflow(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Y__unlist_locked_file(tls *TLS, f uintptr) +TEXT ·Y__unlist_locked_file(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__unlist_locked_file(SB) + RET + +// func Y__unlockfile(tls *TLS, file uintptr) +TEXT ·Y__unlockfile(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ file+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__unlockfile(SB) + RET + +// func Y__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) +TEXT ·Y__uselocale(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ new1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__uselocale(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__vm_wait(tls *TLS) +TEXT ·Y__vm_wait(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X__vm_wait(SB) + RET + +// func Y__wcscoll_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) +TEXT ·Y__wcscoll_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ locale+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__wcscoll_l(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Y__wcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) +TEXT ·Y__wcsftime_l(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + MOVQ tm+32(FP), AX + MOVQ AX, 32(SP) + MOVQ loc+40(FP), AX + MOVQ AX, 40(SP) + CALL ·X__wcsftime_l(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Y__wcsxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) +TEXT ·Y__wcsxfrm_l(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ loc+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__wcsxfrm_l(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Y__wctrans_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctrans_t) +TEXT ·Y__wctrans_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__wctrans_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__wctype_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctype_t) +TEXT ·Y__wctype_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__wctype_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y__xmknod(tls *TLS, ver int32, path uintptr, mode Tmode_t, dev uintptr) (r int32) +TEXT ·Y__xmknod(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ver+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL mode+24(FP), AX + MOVL AX, 24(SP) + MOVQ dev+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__xmknod(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Y__xmknodat(tls *TLS, ver int32, fd int32, path uintptr, mode Tmode_t, dev uintptr) (r int32) +TEXT ·Y__xmknodat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ver+8(FP), AX + MOVL AX, 8(SP) + MOVL fd+12(FP), AX + MOVL AX, 12(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL mode+24(FP), AX + MOVL AX, 24(SP) + MOVQ dev+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X__xmknodat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Y__xpg_basename(tls *TLS, s uintptr) (r uintptr) +TEXT ·Y__xpg_basename(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X__xpg_basename(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Y__xpg_strerror_r(tls *TLS, err int32, buf uintptr, buflen Tsize_t) (r int32) +TEXT ·Y__xpg_strerror_r(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL err+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buflen+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__xpg_strerror_r(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__xstat(tls *TLS, ver int32, path uintptr, buf uintptr) (r int32) +TEXT ·Y__xstat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ver+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X__xstat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Y__year_to_secs(tls *TLS, year int64, is_leap uintptr) (r int64) +TEXT ·Y__year_to_secs(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ year+8(FP), AX + MOVQ AX, 8(SP) + MOVQ is_leap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·X__year_to_secs(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Y_exit(tls *TLS, status int32) +TEXT ·Y_exit(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL status+8(FP), AX + MOVL AX, 8(SP) + CALL ·X_exit(SB) + RET + +// func Y_flushlbf(tls *TLS) +TEXT ·Y_flushlbf(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·X_flushlbf(SB) + RET + +// func Y_longjmp(t *TLS, env uintptr, val int32) +TEXT ·Y_longjmp(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ env+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + CALL ·X_longjmp(SB) + RET + +// func Y_obstack_begin(t *TLS, obstack uintptr, size, alignment int32, chunkfun, freefun uintptr) (_4 int32) +TEXT ·Y_obstack_begin(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ obstack+8(FP), AX + MOVQ AX, 8(SP) + MOVL size+16(FP), AX + MOVL AX, 16(SP) + MOVL alignment+20(FP), AX + MOVL AX, 20(SP) + MOVQ chunkfun+24(FP), AX + MOVQ AX, 24(SP) + MOVQ freefun+32(FP), AX + MOVQ AX, 32(SP) + CALL ·X_obstack_begin(SB) + MOVL 40(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Y_obstack_newchunk(t *TLS, obstack uintptr, length int32) (_3 int32) +TEXT ·Y_obstack_newchunk(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ obstack+8(FP), AX + MOVQ AX, 8(SP) + MOVL length+16(FP), AX + MOVL AX, 16(SP) + CALL ·X_obstack_newchunk(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Y_pthread_cleanup_pop(tls *TLS, _ uintptr, run int32) +TEXT ·Y_pthread_cleanup_pop(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _+8(FP), AX + MOVQ AX, 8(SP) + MOVL run+16(FP), AX + MOVL AX, 16(SP) + CALL ·X_pthread_cleanup_pop(SB) + RET + +// func Y_pthread_cleanup_push(tls *TLS, _, f, x uintptr) +TEXT ·Y_pthread_cleanup_push(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + MOVQ x+24(FP), AX + MOVQ AX, 24(SP) + CALL ·X_pthread_cleanup_push(SB) + RET + +// func Y_setjmp(t *TLS, env uintptr) (_2 int32) +TEXT ·Y_setjmp(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ env+8(FP), AX + MOVQ AX, 8(SP) + CALL ·X_setjmp(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ya64l(tls *TLS, s uintptr) (r int64) +TEXT ·Ya64l(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xa64l(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yabort(tls *TLS) +TEXT ·Yabort(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xabort(SB) + RET + +// func Yabs(tls *TLS, a int32) (r int32) +TEXT ·Yabs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL a+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xabs(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yaccept(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) +TEXT ·Yaccept(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xaccept(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Yaccept4(tls *TLS, fd int32, addr uintptr, len1 uintptr, flg int32) (r1 int32) +TEXT ·Yaccept4(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL flg+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xaccept4(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Yaccess(tls *TLS, filename uintptr, amode int32) (r int32) +TEXT ·Yaccess(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVL amode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xaccess(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yacct(tls *TLS, filename uintptr) (r int32) +TEXT ·Yacct(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xacct(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yacos(tls *TLS, x float64) (r float64) +TEXT ·Yacos(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xacos(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yacosf(tls *TLS, x float32) (r float32) +TEXT ·Yacosf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xacosf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yacosh(tls *TLS, x float64) (r float64) +TEXT ·Yacosh(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xacosh(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yacoshf(tls *TLS, x float32) (r float32) +TEXT ·Yacoshf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xacoshf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yacoshl(tls *TLS, x float64) (r float64) +TEXT ·Yacoshl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xacoshl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yacosl(tls *TLS, x float64) (r float64) +TEXT ·Yacosl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xacosl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yaddmntent(tls *TLS, f uintptr, mnt uintptr) (r int32) +TEXT ·Yaddmntent(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mnt+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xaddmntent(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yadjtime(tls *TLS, in uintptr, out uintptr) (r int32) +TEXT ·Yadjtime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ in+8(FP), AX + MOVQ AX, 8(SP) + MOVQ out+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xadjtime(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yadjtimex(tls *TLS, tx uintptr) (r int32) +TEXT ·Yadjtimex(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tx+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xadjtimex(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yalarm(tls *TLS, seconds uint32) (r uint32) +TEXT ·Yalarm(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL seconds+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xalarm(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yalloca(tls *TLS, size Tsize_t) (_2 uintptr) +TEXT ·Yalloca(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ size+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xalloca(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Yalphasort(tls *TLS, a uintptr, b uintptr) (r int32) +TEXT ·Yalphasort(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xalphasort(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yarch_prctl(tls *TLS, code int32, addr uint64) (r int32) +TEXT ·Yarch_prctl(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL code+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xarch_prctl(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yasctime(tls *TLS, tm uintptr) (r uintptr) +TEXT ·Yasctime(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tm+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xasctime(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yasctime_r(tls *TLS, tm uintptr, buf uintptr) (r uintptr) +TEXT ·Yasctime_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tm+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xasctime_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yasin(tls *TLS, x float64) (r1 float64) +TEXT ·Yasin(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xasin(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Yasinf(tls *TLS, x float32) (r float32) +TEXT ·Yasinf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xasinf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yasinh(tls *TLS, x3 float64) (r float64) +TEXT ·Yasinh(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xasinh(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yasinhf(tls *TLS, x3 float32) (r float32) +TEXT ·Yasinhf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xasinhf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yasinhl(tls *TLS, x float64) (r float64) +TEXT ·Yasinhl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xasinhl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yasinl(tls *TLS, x float64) (r float64) +TEXT ·Yasinl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xasinl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yasprintf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Yasprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xasprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) +TEXT ·Yat_quick_exit(SB),$32-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_func+8(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_at_quick_exit_0(SB) // Create the closure for calling __ccgo_fp_func + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + CALL ·Xat_quick_exit(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_at_quick_exit_0(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ __ccgo_fp+8(FP), AX + CALL *AX // Call the ABI0 code ptr + RET + +// func Yatan(tls *TLS, x3 float64) (r float64) +TEXT ·Yatan(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatan(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yatan2(tls *TLS, y float64, x float64) (r float64) +TEXT ·Yatan2(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ y+8(FP), AX + MOVQ AX, 8(SP) + MOVQ x+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xatan2(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yatan2f(tls *TLS, y float32, x float32) (r float32) +TEXT ·Yatan2f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL y+8(FP), AX + MOVL AX, 8(SP) + MOVL x+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xatan2f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yatan2l(tls *TLS, y float64, x float64) (r float64) +TEXT ·Yatan2l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ y+8(FP), AX + MOVQ AX, 8(SP) + MOVQ x+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xatan2l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yatanf(tls *TLS, x3 float32) (r float32) +TEXT ·Yatanf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xatanf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yatanh(tls *TLS, x3 float64) (r float64) +TEXT ·Yatanh(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatanh(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yatanhf(tls *TLS, x3 float32) (r float32) +TEXT ·Yatanhf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xatanhf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yatanhl(tls *TLS, x float64) (r float64) +TEXT ·Yatanhl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatanhl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yatanl(tls *TLS, x float64) (r float64) +TEXT ·Yatanl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatanl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yatexit(tls *TLS, func_ uintptr) (r int32) +TEXT ·Yatexit(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ func_+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatexit(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yatof(tls *TLS, s uintptr) (r float64) +TEXT ·Yatof(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatof(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yatoi(tls *TLS, s uintptr) (r int32) +TEXT ·Yatoi(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatoi(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yatol(tls *TLS, s uintptr) (r int64) +TEXT ·Yatol(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatol(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yatoll(tls *TLS, s uintptr) (r int64) +TEXT ·Yatoll(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xatoll(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ybacktrace(t *TLS, buf uintptr, size int32) (_3 int32) +TEXT ·Ybacktrace(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVL size+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xbacktrace(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ybacktrace_symbols_fd(t *TLS, buffer uintptr, size, fd int32) +TEXT ·Ybacktrace_symbols_fd(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buffer+8(FP), AX + MOVQ AX, 8(SP) + MOVL size+16(FP), AX + MOVL AX, 16(SP) + MOVL fd+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xbacktrace_symbols_fd(SB) + RET + +// func Ybasename(tls *TLS, s uintptr) (r uintptr) +TEXT ·Ybasename(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xbasename(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ybcmp(tls *TLS, s1 uintptr, s2 uintptr, n Tsize_t) (r int32) +TEXT ·Ybcmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xbcmp(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ybcopy(tls *TLS, s1 uintptr, s2 uintptr, n Tsize_t) +TEXT ·Ybcopy(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xbcopy(SB) + RET + +// func Ybind(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) +TEXT ·Ybind(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + MOVL len1+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xbind(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ybind_textdomain_codeset(tls *TLS, domainname uintptr, codeset uintptr) (r uintptr) +TEXT ·Ybind_textdomain_codeset(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ domainname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ codeset+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xbind_textdomain_codeset(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ybindtextdomain(tls *TLS, domainname uintptr, dirname uintptr) (r uintptr) +TEXT ·Ybindtextdomain(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ domainname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ dirname+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xbindtextdomain(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ybrk(tls *TLS, end uintptr) (r int32) +TEXT ·Ybrk(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ end+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xbrk(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ybsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) +TEXT ·Ybsearch(SB),$64-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+40(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_bsearch_4(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ base+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nel+24(FP), AX + MOVQ AX, 24(SP) + MOVQ width+32(FP), AX + MOVQ AX, 32(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 40(SP) + CALL ·Xbsearch(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_bsearch_4(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Ybtowc(tls *TLS, c int32) (r Twint_t) +TEXT ·Ybtowc(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xbtowc(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ybzero(tls *TLS, s uintptr, n Tsize_t) +TEXT ·Ybzero(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xbzero(SB) + RET + +// func Yc16rtomb(tls *TLS, s uintptr, c16 Tchar16_t, ps uintptr) (r Tsize_t) +TEXT ·Yc16rtomb(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVW c16+16(FP), AX + MOVW AX, 16(SP) + MOVQ ps+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xc16rtomb(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yc32rtomb(tls *TLS, s uintptr, c32 Tchar32_t, ps uintptr) (r Tsize_t) +TEXT ·Yc32rtomb(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c32+16(FP), AX + MOVL AX, 16(SP) + MOVQ ps+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xc32rtomb(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ycabs(tls *TLS, z complex128) (r float64) +TEXT ·Ycabs(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcabs(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycabsf(tls *TLS, z complex64) (r float32) +TEXT ·Ycabsf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcabsf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycabsl(tls *TLS, z complex128) (r float64) +TEXT ·Ycabsl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcabsl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycacos(tls *TLS, z complex128) (r complex128) +TEXT ·Ycacos(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcacos(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycacosf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycacosf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcacosf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycacosh(tls *TLS, z complex128) (r complex128) +TEXT ·Ycacosh(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcacosh(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycacoshf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycacoshf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcacoshf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycacoshl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycacoshl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcacoshl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycacosl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycacosl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcacosl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycalloc(tls *TLS, m Tsize_t, n Tsize_t) (r uintptr) +TEXT ·Ycalloc(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcalloc(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycapget(tls *TLS, a uintptr, b uintptr) (r int32) +TEXT ·Ycapget(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcapget(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ycapset(tls *TLS, a uintptr, b uintptr) (r int32) +TEXT ·Ycapset(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcapset(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ycarg(tls *TLS, z complex128) (r float64) +TEXT ·Ycarg(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcarg(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycargf(tls *TLS, z complex64) (r float32) +TEXT ·Ycargf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcargf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycargl(tls *TLS, z complex128) (r float64) +TEXT ·Ycargl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcargl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycasin(tls *TLS, z complex128) (r1 complex128) +TEXT ·Ycasin(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcasin(SB) + MOVQ 24(SP), AX + MOVQ AX, r1_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r1_imag+32(FP) + RET + +// func Ycasinf(tls *TLS, z complex64) (r1 complex64) +TEXT ·Ycasinf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcasinf(SB) + MOVL 16(SP), AX + MOVL AX, r1_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r1_imag+20(FP) + RET + +// func Ycasinh(tls *TLS, z complex128) (r complex128) +TEXT ·Ycasinh(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcasinh(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycasinhf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycasinhf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcasinhf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycasinhl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycasinhl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcasinhl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycasinl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycasinl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcasinl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycatan(tls *TLS, z complex128) (r complex128) +TEXT ·Ycatan(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcatan(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycatanf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycatanf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcatanf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycatanh(tls *TLS, z complex128) (r complex128) +TEXT ·Ycatanh(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcatanh(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycatanhf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycatanhf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcatanhf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycatanhl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycatanhl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcatanhl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycatanl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycatanl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcatanl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycatclose(tls *TLS, catd Tnl_catd) (r int32) +TEXT ·Ycatclose(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ catd+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcatclose(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycatgets(tls *TLS, catd Tnl_catd, set_id int32, msg_id int32, s uintptr) (r uintptr) +TEXT ·Ycatgets(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ catd+8(FP), AX + MOVQ AX, 8(SP) + MOVL set_id+16(FP), AX + MOVL AX, 16(SP) + MOVL msg_id+20(FP), AX + MOVL AX, 20(SP) + MOVQ s+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xcatgets(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ycatopen(tls *TLS, name uintptr, oflag int32) (r Tnl_catd) +TEXT ·Ycatopen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVL oflag+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xcatopen(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycbrt(tls *TLS, x float64) (r1 float64) +TEXT ·Ycbrt(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcbrt(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Ycbrtf(tls *TLS, x float32) (r1 float32) +TEXT ·Ycbrtf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xcbrtf(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ycbrtl(tls *TLS, x float64) (r float64) +TEXT ·Ycbrtl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcbrtl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yccos(tls *TLS, z complex128) (r complex128) +TEXT ·Yccos(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xccos(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yccosf(tls *TLS, z complex64) (r complex64) +TEXT ·Yccosf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xccosf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Yccosh(tls *TLS, z complex128) (r complex128) +TEXT ·Yccosh(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xccosh(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yccoshf(tls *TLS, z complex64) (r complex64) +TEXT ·Yccoshf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xccoshf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Yccoshl(tls *TLS, z complex128) (r complex128) +TEXT ·Yccoshl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xccoshl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yccosl(tls *TLS, z complex128) (r complex128) +TEXT ·Yccosl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xccosl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yceil(tls *TLS, x3 float64) (r float64) +TEXT ·Yceil(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xceil(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yceilf(tls *TLS, x3 float32) (r float32) +TEXT ·Yceilf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xceilf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yceill(tls *TLS, x float64) (r float64) +TEXT ·Yceill(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xceill(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ycexp(tls *TLS, z complex128) (r complex128) +TEXT ·Ycexp(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcexp(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycexpf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycexpf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcexpf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycexpl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycexpl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcexpl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycfgetispeed(tls *TLS, tio uintptr) (r Tspeed_t) +TEXT ·Ycfgetispeed(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tio+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcfgetispeed(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycfgetospeed(tls *TLS, tio uintptr) (r Tspeed_t) +TEXT ·Ycfgetospeed(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tio+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcfgetospeed(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycfmakeraw(tls *TLS, t uintptr) +TEXT ·Ycfmakeraw(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcfmakeraw(SB) + RET + +// func Ycfsetispeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) +TEXT ·Ycfsetispeed(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tio+8(FP), AX + MOVQ AX, 8(SP) + MOVL speed+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xcfsetispeed(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ycfsetospeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) +TEXT ·Ycfsetospeed(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tio+8(FP), AX + MOVQ AX, 8(SP) + MOVL speed+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xcfsetospeed(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ycfsetspeed(tls *TLS, tio uintptr, speed Tspeed_t) (r int32) +TEXT ·Ycfsetspeed(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tio+8(FP), AX + MOVQ AX, 8(SP) + MOVL speed+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xcfsetspeed(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ychdir(tls *TLS, path uintptr) (r int32) +TEXT ·Ychdir(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xchdir(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ychmod(tls *TLS, path uintptr, mode Tmode_t) (r int32) +TEXT ·Ychmod(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL mode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xchmod(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ychown(tls *TLS, path uintptr, uid Tuid_t, gid Tgid_t) (r int32) +TEXT ·Ychown(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL uid+16(FP), AX + MOVL AX, 16(SP) + MOVL gid+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xchown(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ychroot(tls *TLS, path uintptr) (r int32) +TEXT ·Ychroot(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xchroot(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycimag(tls *TLS, z complex128) (r float64) +TEXT ·Ycimag(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcimag(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycimagf(tls *TLS, z complex64) (r float32) +TEXT ·Ycimagf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcimagf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycimagl(tls *TLS, z complex128) (r float64) +TEXT ·Ycimagl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcimagl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yclearenv(tls *TLS) (r int32) +TEXT ·Yclearenv(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xclearenv(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yclearerr(tls *TLS, f uintptr) +TEXT ·Yclearerr(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xclearerr(SB) + RET + +// func Yclearerr_unlocked(tls *TLS, f uintptr) +TEXT ·Yclearerr_unlocked(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xclearerr_unlocked(SB) + RET + +// func Yclock(tls *TLS) (r Tclock_t) +TEXT ·Yclock(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xclock(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Yclock_adjtime(tls *TLS, clock_id Tclockid_t, utx uintptr) (r1 int32) +TEXT ·Yclock_adjtime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clock_id+8(FP), AX + MOVL AX, 8(SP) + MOVQ utx+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xclock_adjtime(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Yclock_getcpuclockid(tls *TLS, pid Tpid_t, clk uintptr) (r int32) +TEXT ·Yclock_getcpuclockid(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVQ clk+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xclock_getcpuclockid(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yclock_getres(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) +TEXT ·Yclock_getres(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clk+8(FP), AX + MOVL AX, 8(SP) + MOVQ ts+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xclock_getres(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yclock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) +TEXT ·Yclock_gettime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clk+8(FP), AX + MOVL AX, 8(SP) + MOVQ ts+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xclock_gettime(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yclock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem uintptr) (r int32) +TEXT ·Yclock_nanosleep(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clk+8(FP), AX + MOVL AX, 8(SP) + MOVL flags+12(FP), AX + MOVL AX, 12(SP) + MOVQ req+16(FP), AX + MOVQ AX, 16(SP) + MOVQ rem+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xclock_nanosleep(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yclock_settime(tls *TLS, clk Tclockid_t, ts uintptr) (r int32) +TEXT ·Yclock_settime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clk+8(FP), AX + MOVL AX, 8(SP) + MOVQ ts+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xclock_settime(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yclog(tls *TLS, z complex128) (r1 complex128) +TEXT ·Yclog(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xclog(SB) + MOVQ 24(SP), AX + MOVQ AX, r1_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r1_imag+32(FP) + RET + +// func Yclogf(tls *TLS, z complex64) (r1 complex64) +TEXT ·Yclogf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xclogf(SB) + MOVL 16(SP), AX + MOVL AX, r1_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r1_imag+20(FP) + RET + +// func Yclogl(tls *TLS, z complex128) (r complex128) +TEXT ·Yclogl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xclogl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yclose(tls *TLS, fd int32) (r1 int32) +TEXT ·Yclose(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xclose(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yclosedir(tls *TLS, dir uintptr) (r int32) +TEXT ·Yclosedir(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xclosedir(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycloselog(tls *TLS) +TEXT ·Ycloselog(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xcloselog(SB) + RET + +// func Yconfstr(tls *TLS, name int32, buf uintptr, len1 Tsize_t) (r Tsize_t) +TEXT ·Yconfstr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL name+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xconfstr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yconj(tls *TLS, z complex128) (r complex128) +TEXT ·Yconj(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xconj(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yconjf(tls *TLS, z complex64) (r complex64) +TEXT ·Yconjf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xconjf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Yconjl(tls *TLS, z complex128) (r complex128) +TEXT ·Yconjl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xconjl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yconnect(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) +TEXT ·Yconnect(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + MOVL len1+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xconnect(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ycopy_file_range(tls *TLS, fd_in int32, off_in uintptr, fd_out int32, off_out uintptr, len1 Tsize_t, flags uint32) (r Tssize_t) +TEXT ·Ycopy_file_range(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd_in+8(FP), AX + MOVL AX, 8(SP) + MOVQ off_in+16(FP), AX + MOVQ AX, 16(SP) + MOVL fd_out+24(FP), AX + MOVL AX, 24(SP) + MOVQ off_out+32(FP), AX + MOVQ AX, 32(SP) + MOVQ len1+40(FP), AX + MOVQ AX, 40(SP) + MOVL flags+48(FP), AX + MOVL AX, 48(SP) + CALL ·Xcopy_file_range(SB) + MOVQ 56(SP), AX + MOVQ AX, r+56(FP) + RET + +// func Ycopysign(tls *TLS, x float64, y float64) (r float64) +TEXT ·Ycopysign(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcopysign(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycopysignf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Ycopysignf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcopysignf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycopysignl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Ycopysignl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcopysignl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycos(tls *TLS, x3 float64) (r float64) +TEXT ·Ycos(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcos(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ycosf(tls *TLS, x3 float32) (r float32) +TEXT ·Ycosf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xcosf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycosh(tls *TLS, x3 float64) (r float64) +TEXT ·Ycosh(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcosh(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ycoshf(tls *TLS, x3 float32) (r float32) +TEXT ·Ycoshf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xcoshf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycoshl(tls *TLS, x float64) (r float64) +TEXT ·Ycoshl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcoshl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ycosl(tls *TLS, x float64) (r float64) +TEXT ·Ycosl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcosl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ycpow(tls *TLS, z complex128, c complex128) (r complex128) +TEXT ·Ycpow(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + MOVQ c_real+24(FP), AX + MOVQ AX, 24(SP) + MOVQ c_imag+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xcpow(SB) + MOVQ 40(SP), AX + MOVQ AX, r_real+40(FP) + MOVQ 48(SP), AX + MOVQ AX, r_imag+48(FP) + RET + +// func Ycpowf(tls *TLS, z complex64, c complex64) (r complex64) +TEXT ·Ycpowf(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + MOVL c_real+16(FP), AX + MOVL AX, 16(SP) + MOVL c_imag+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xcpowf(SB) + MOVL 24(SP), AX + MOVL AX, r_real+24(FP) + MOVL 28(SP), AX + MOVL AX, r_imag+28(FP) + RET + +// func Ycpowl(tls *TLS, z complex128, c complex128) (r complex128) +TEXT ·Ycpowl(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + MOVQ c_real+24(FP), AX + MOVQ AX, 24(SP) + MOVQ c_imag+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xcpowl(SB) + MOVQ 40(SP), AX + MOVQ AX, r_real+40(FP) + MOVQ 48(SP), AX + MOVQ AX, r_imag+48(FP) + RET + +// func Ycproj(tls *TLS, z complex128) (r complex128) +TEXT ·Ycproj(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcproj(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycprojf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycprojf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcprojf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycprojl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycprojl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcprojl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycreal(tls *TLS, z complex128) (r float64) +TEXT ·Ycreal(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcreal(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycrealf(tls *TLS, z complex64) (r float32) +TEXT ·Ycrealf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcrealf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ycreall(tls *TLS, z complex128) (r float64) +TEXT ·Ycreall(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcreall(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycreat(tls *TLS, filename uintptr, mode Tmode_t) (r int32) +TEXT ·Ycreat(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVL mode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xcreat(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ycrypt(tls *TLS, key uintptr, salt uintptr) (r uintptr) +TEXT ·Ycrypt(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ salt+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcrypt(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycrypt_r(tls *TLS, key uintptr, salt uintptr, data uintptr) (r uintptr) +TEXT ·Ycrypt_r(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ salt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ data+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xcrypt_r(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ycsin(tls *TLS, z complex128) (r complex128) +TEXT ·Ycsin(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcsin(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycsinf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycsinf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcsinf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycsinh(tls *TLS, z complex128) (r complex128) +TEXT ·Ycsinh(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcsinh(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycsinhf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycsinhf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcsinhf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycsinhl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycsinhl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcsinhl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycsinl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycsinl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcsinl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycsqrt(tls *TLS, z complex128) (r complex128) +TEXT ·Ycsqrt(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcsqrt(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Ycsqrtf(tls *TLS, z complex64) (r complex64) +TEXT ·Ycsqrtf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xcsqrtf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Ycsqrtl(tls *TLS, z complex128) (r complex128) +TEXT ·Ycsqrtl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xcsqrtl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yctan(tls *TLS, z complex128) (r complex128) +TEXT ·Yctan(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xctan(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yctanf(tls *TLS, z complex64) (r complex64) +TEXT ·Yctanf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xctanf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Yctanh(tls *TLS, z complex128) (r complex128) +TEXT ·Yctanh(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xctanh(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yctanhf(tls *TLS, z complex64) (r complex64) +TEXT ·Yctanhf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL z_real+8(FP), AX + MOVL AX, 8(SP) + MOVL z_imag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xctanhf(SB) + MOVL 16(SP), AX + MOVL AX, r_real+16(FP) + MOVL 20(SP), AX + MOVL AX, r_imag+20(FP) + RET + +// func Yctanhl(tls *TLS, z complex128) (r complex128) +TEXT ·Yctanhl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xctanhl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yctanl(tls *TLS, z complex128) (r complex128) +TEXT ·Yctanl(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ z_real+8(FP), AX + MOVQ AX, 8(SP) + MOVQ z_imag+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xctanl(SB) + MOVQ 24(SP), AX + MOVQ AX, r_real+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_imag+32(FP) + RET + +// func Yctermid(tls *TLS, s uintptr) (r uintptr) +TEXT ·Yctermid(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xctermid(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yctime(tls *TLS, t uintptr) (r uintptr) +TEXT ·Yctime(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xctime(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yctime_r(tls *TLS, t uintptr, buf uintptr) (r uintptr) +TEXT ·Yctime_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xctime_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ycuserid(tls *TLS, buf uintptr) (r uintptr) +TEXT ·Ycuserid(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xcuserid(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ydcgettext(tls *TLS, domainname uintptr, msgid uintptr, category int32) (r uintptr) +TEXT ·Ydcgettext(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ domainname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ msgid+16(FP), AX + MOVQ AX, 16(SP) + MOVL category+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xdcgettext(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ydcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n uint64, category int32) (r1 uintptr) +TEXT ·Ydcngettext(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ domainname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ msgid1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ msgid2+24(FP), AX + MOVQ AX, 24(SP) + MOVQ n+32(FP), AX + MOVQ AX, 32(SP) + MOVL category+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xdcngettext(SB) + MOVQ 48(SP), AX + MOVQ AX, r1+48(FP) + RET + +// func Ydelete_module(tls *TLS, a uintptr, b uint32) (r int32) +TEXT ·Ydelete_module(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVL b+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xdelete_module(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ydgettext(tls *TLS, domainname uintptr, msgid uintptr) (r uintptr) +TEXT ·Ydgettext(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ domainname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ msgid+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xdgettext(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ydifftime(tls *TLS, t1 Ttime_t, t0 Ttime_t) (r float64) +TEXT ·Ydifftime(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ t0+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xdifftime(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ydirfd(tls *TLS, d uintptr) (r int32) +TEXT ·Ydirfd(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xdirfd(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ydirname(tls *TLS, s uintptr) (r uintptr) +TEXT ·Ydirname(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xdirname(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ydiv(tls *TLS, num int32, den int32) (r Tdiv_t) +TEXT ·Ydiv(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL num+8(FP), AX + MOVL AX, 8(SP) + MOVL den+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xdiv(SB) + MOVL 16(SP), AX + MOVL AX, r_Fquot+16(FP) + MOVL 20(SP), AX + MOVL AX, r_Frem+20(FP) + RET + +// func Ydlclose(t *TLS, handle uintptr) (_2 int32) +TEXT ·Ydlclose(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ handle+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xdlclose(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ydlerror(t *TLS) (_1 uintptr) +TEXT ·Ydlerror(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xdlerror(SB) + MOVQ 8(SP), AX + MOVQ AX, _1+8(FP) + RET + +// func Ydlopen(t *TLS, filename uintptr, flags int32) (_3 uintptr) +TEXT ·Ydlopen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xdlopen(SB) + MOVQ 24(SP), AX + MOVQ AX, _3+24(FP) + RET + +// func Ydlsym(t *TLS, handle, symbol uintptr) (_2 uintptr) +TEXT ·Ydlsym(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ handle+8(FP), AX + MOVQ AX, 8(SP) + MOVQ symbol+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xdlsym(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Ydn_comp(tls *TLS, src uintptr, dst uintptr, space int32, dnptrs uintptr, lastdnptr uintptr) (r int32) +TEXT ·Ydn_comp(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ src+8(FP), AX + MOVQ AX, 8(SP) + MOVQ dst+16(FP), AX + MOVQ AX, 16(SP) + MOVL space+24(FP), AX + MOVL AX, 24(SP) + MOVQ dnptrs+32(FP), AX + MOVQ AX, 32(SP) + MOVQ lastdnptr+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xdn_comp(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ydn_expand(tls *TLS, base uintptr, end uintptr, src uintptr, dest uintptr, space int32) (r int32) +TEXT ·Ydn_expand(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ base+8(FP), AX + MOVQ AX, 8(SP) + MOVQ end+16(FP), AX + MOVQ AX, 16(SP) + MOVQ src+24(FP), AX + MOVQ AX, 24(SP) + MOVQ dest+32(FP), AX + MOVQ AX, 32(SP) + MOVL space+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xdn_expand(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ydn_skipname(tls *TLS, s uintptr, end uintptr) (r int32) +TEXT ·Ydn_skipname(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ end+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xdn_skipname(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ydngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n uint64) (r uintptr) +TEXT ·Ydngettext(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ domainname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ msgid1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ msgid2+24(FP), AX + MOVQ AX, 24(SP) + MOVQ n+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xdngettext(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ydprintf(tls *TLS, fd int32, fmt uintptr, va uintptr) (r int32) +TEXT ·Ydprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xdprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ydrand48(tls *TLS) (r float64) +TEXT ·Ydrand48(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xdrand48(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ydrem(tls *TLS, x float64, y float64) (r float64) +TEXT ·Ydrem(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xdrem(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ydremf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Ydremf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xdremf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ydup(tls *TLS, fd int32) (r int32) +TEXT ·Ydup(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xdup(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ydup2(tls *TLS, old int32, new1 int32) (r1 int32) +TEXT ·Ydup2(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL old+8(FP), AX + MOVL AX, 8(SP) + MOVL new1+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xdup2(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ydup3(tls *TLS, old int32, new1 int32, flags int32) (r int32) +TEXT ·Ydup3(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL old+8(FP), AX + MOVL AX, 8(SP) + MOVL new1+12(FP), AX + MOVL AX, 12(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xdup3(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yduplocale(tls *TLS, old Tlocale_t) (r Tlocale_t) +TEXT ·Yduplocale(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ old+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xduplocale(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yeaccess(tls *TLS, filename uintptr, amode int32) (r int32) +TEXT ·Yeaccess(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVL amode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xeaccess(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yecvt(tls *TLS, x float64, n int32, dp uintptr, sign uintptr) (r uintptr) +TEXT ·Yecvt(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + MOVQ dp+24(FP), AX + MOVQ AX, 24(SP) + MOVQ sign+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xecvt(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yencrypt(tls *TLS, block uintptr, edflag int32) +TEXT ·Yencrypt(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ block+8(FP), AX + MOVQ AX, 8(SP) + MOVL edflag+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xencrypt(SB) + RET + +// func Yendgrent(tls *TLS) +TEXT ·Yendgrent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendgrent(SB) + RET + +// func Yendhostent(tls *TLS) +TEXT ·Yendhostent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendhostent(SB) + RET + +// func Yendmntent(tls *TLS, f uintptr) (r int32) +TEXT ·Yendmntent(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xendmntent(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yendnetent(tls *TLS) +TEXT ·Yendnetent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendnetent(SB) + RET + +// func Yendprotoent(tls *TLS) +TEXT ·Yendprotoent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendprotoent(SB) + RET + +// func Yendpwent(tls *TLS) +TEXT ·Yendpwent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendpwent(SB) + RET + +// func Yendservent(tls *TLS) +TEXT ·Yendservent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendservent(SB) + RET + +// func Yendspent(tls *TLS) +TEXT ·Yendspent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendspent(SB) + RET + +// func Yendusershell(tls *TLS) +TEXT ·Yendusershell(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendusershell(SB) + RET + +// func Yendutent(tls *TLS) +TEXT ·Yendutent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendutent(SB) + RET + +// func Yendutxent(tls *TLS) +TEXT ·Yendutxent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xendutxent(SB) + RET + +// func Yepoll_create(tls *TLS, size int32) (r int32) +TEXT ·Yepoll_create(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL size+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xepoll_create(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yepoll_create1(tls *TLS, flags int32) (r1 int32) +TEXT ·Yepoll_create1(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL flags+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xepoll_create1(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yepoll_ctl(tls *TLS, fd int32, op int32, fd2 int32, ev uintptr) (r int32) +TEXT ·Yepoll_ctl(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL op+12(FP), AX + MOVL AX, 12(SP) + MOVL fd2+16(FP), AX + MOVL AX, 16(SP) + MOVQ ev+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xepoll_ctl(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yepoll_pwait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32, sigs uintptr) (r1 int32) +TEXT ·Yepoll_pwait(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ ev+16(FP), AX + MOVQ AX, 16(SP) + MOVL cnt+24(FP), AX + MOVL AX, 24(SP) + MOVL to+28(FP), AX + MOVL AX, 28(SP) + MOVQ sigs+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xepoll_pwait(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Yepoll_wait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32) (r int32) +TEXT ·Yepoll_wait(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ ev+16(FP), AX + MOVQ AX, 16(SP) + MOVL cnt+24(FP), AX + MOVL AX, 24(SP) + MOVL to+28(FP), AX + MOVL AX, 28(SP) + CALL ·Xepoll_wait(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yerand48(tls *TLS, s uintptr) (r float64) +TEXT ·Yerand48(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xerand48(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yerf(tls *TLS, x float64) (r1 float64) +TEXT ·Yerf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xerf(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Yerfc(tls *TLS, x float64) (r1 float64) +TEXT ·Yerfc(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xerfc(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Yerfcf(tls *TLS, x float32) (r1 float32) +TEXT ·Yerfcf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xerfcf(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yerfcl(tls *TLS, x float64) (r float64) +TEXT ·Yerfcl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xerfcl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yerff(tls *TLS, x float32) (r1 float32) +TEXT ·Yerff(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xerff(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yerfl(tls *TLS, x float64) (r float64) +TEXT ·Yerfl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xerfl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yerr(tls *TLS, status int32, fmt uintptr, va uintptr) +TEXT ·Yerr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL status+8(FP), AX + MOVL AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xerr(SB) + RET + +// func Yerrx(tls *TLS, status int32, fmt uintptr, va uintptr) +TEXT ·Yerrx(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL status+8(FP), AX + MOVL AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xerrx(SB) + RET + +// func Yether_aton(tls *TLS, x uintptr) (r uintptr) +TEXT ·Yether_aton(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xether_aton(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yether_aton_r(tls *TLS, x uintptr, p_a uintptr) (r uintptr) +TEXT ·Yether_aton_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p_a+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xether_aton_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yether_hostton(tls *TLS, hostname uintptr, e uintptr) (r int32) +TEXT ·Yether_hostton(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ hostname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ e+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xether_hostton(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yether_line(tls *TLS, l uintptr, e uintptr, hostname uintptr) (r int32) +TEXT ·Yether_line(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ e+16(FP), AX + MOVQ AX, 16(SP) + MOVQ hostname+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xether_line(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yether_ntoa(tls *TLS, p_a uintptr) (r uintptr) +TEXT ·Yether_ntoa(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p_a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xether_ntoa(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yether_ntoa_r(tls *TLS, p_a uintptr, x uintptr) (r uintptr) +TEXT ·Yether_ntoa_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p_a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ x+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xether_ntoa_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yether_ntohost(tls *TLS, hostname uintptr, e uintptr) (r int32) +TEXT ·Yether_ntohost(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ hostname+8(FP), AX + MOVQ AX, 8(SP) + MOVQ e+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xether_ntohost(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yeuidaccess(tls *TLS, filename uintptr, amode int32) (r int32) +TEXT ·Yeuidaccess(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVL amode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xeuidaccess(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yeventfd(tls *TLS, count uint32, flags int32) (r1 int32) +TEXT ·Yeventfd(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL count+8(FP), AX + MOVL AX, 8(SP) + MOVL flags+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xeventfd(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yeventfd_read(tls *TLS, fd int32, value uintptr) (r int32) +TEXT ·Yeventfd_read(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ value+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xeventfd_read(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yeventfd_write(tls *TLS, fd int32, _value Teventfd_t) (r int32) +TEXT ·Yeventfd_write(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ _value+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xeventfd_write(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yexecl(tls *TLS, path uintptr, argv0 uintptr, va uintptr) (r int32) +TEXT ·Yexecl(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv0+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xexecl(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yexecle(tls *TLS, path uintptr, argv0 uintptr, va uintptr) (r int32) +TEXT ·Yexecle(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv0+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xexecle(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yexeclp(tls *TLS, file uintptr, argv0 uintptr, va uintptr) (r int32) +TEXT ·Yexeclp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ file+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv0+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xexeclp(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yexecv(tls *TLS, path uintptr, argv uintptr) (r int32) +TEXT ·Yexecv(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xexecv(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yexecve(tls *TLS, path uintptr, argv uintptr, envp uintptr) (r int32) +TEXT ·Yexecve(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ envp+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xexecve(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yexecvp(tls *TLS, file uintptr, argv uintptr) (r int32) +TEXT ·Yexecvp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ file+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xexecvp(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yexecvpe(tls *TLS, file uintptr, argv uintptr, envp uintptr) (r int32) +TEXT ·Yexecvpe(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ file+8(FP), AX + MOVQ AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ envp+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xexecvpe(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yexit(tls *TLS, code int32) +TEXT ·Yexit(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL code+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xexit(SB) + RET + +// func Yexp(tls *TLS, x1 float64) (r1 float64) +TEXT ·Yexp(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexp(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Yexp10(tls *TLS, x float64) (r float64) +TEXT ·Yexp10(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexp10(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yexp10f(tls *TLS, x float32) (r float32) +TEXT ·Yexp10f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xexp10f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yexp10l(tls *TLS, x float64) (r float64) +TEXT ·Yexp10l(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexp10l(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yexp2(tls *TLS, x1 float64) (r1 float64) +TEXT ·Yexp2(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexp2(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Yexp2f(tls *TLS, x2 float32) (r1 float32) +TEXT ·Yexp2f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x2+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xexp2f(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yexp2l(tls *TLS, x float64) (r float64) +TEXT ·Yexp2l(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexp2l(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yexpf(tls *TLS, x2 float32) (r1 float32) +TEXT ·Yexpf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x2+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xexpf(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yexpl(tls *TLS, x float64) (r float64) +TEXT ·Yexpl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexpl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yexplicit_bzero(tls *TLS, d uintptr, n Tsize_t) +TEXT ·Yexplicit_bzero(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xexplicit_bzero(SB) + RET + +// func Yexpm1(tls *TLS, x3 float64) (r float64) +TEXT ·Yexpm1(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexpm1(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yexpm1f(tls *TLS, x3 float32) (r float32) +TEXT ·Yexpm1f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xexpm1f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yexpm1l(tls *TLS, x float64) (r float64) +TEXT ·Yexpm1l(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xexpm1l(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfabs(tls *TLS, x float64) (r float64) +TEXT ·Yfabs(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfabs(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfabsf(tls *TLS, x float32) (r float32) +TEXT ·Yfabsf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfabsf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfabsl(tls *TLS, x float64) (r float64) +TEXT ·Yfabsl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfabsl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfaccessat(tls *TLS, fd int32, filename uintptr, amode int32, flag int32) (r int32) +TEXT ·Yfaccessat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ filename+16(FP), AX + MOVQ AX, 16(SP) + MOVL amode+24(FP), AX + MOVL AX, 24(SP) + MOVL flag+28(FP), AX + MOVL AX, 28(SP) + CALL ·Xfaccessat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfallocate(tls *TLS, fd int32, mode int32, base Toff_t, len1 Toff_t) (r int32) +TEXT ·Yfallocate(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL mode+12(FP), AX + MOVL AX, 12(SP) + MOVQ base+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfallocate(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfanotify_init(tls *TLS, flags uint32, event_f_flags uint32) (r int32) +TEXT ·Yfanotify_init(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL flags+8(FP), AX + MOVL AX, 8(SP) + MOVL event_f_flags+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xfanotify_init(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfanotify_mark(tls *TLS, fanotify_fd int32, flags uint32, mask uint64, dfd int32, pathname uintptr) (r int32) +TEXT ·Yfanotify_mark(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fanotify_fd+8(FP), AX + MOVL AX, 8(SP) + MOVL flags+12(FP), AX + MOVL AX, 12(SP) + MOVQ mask+16(FP), AX + MOVQ AX, 16(SP) + MOVL dfd+24(FP), AX + MOVL AX, 24(SP) + MOVQ pathname+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xfanotify_mark(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yfchdir(tls *TLS, fd int32) (r int32) +TEXT ·Yfchdir(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfchdir(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfchmod(tls *TLS, fd int32, mode Tmode_t) (r int32) +TEXT ·Yfchmod(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL mode+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xfchmod(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r int32) +TEXT ·Yfchmodat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL mode+24(FP), AX + MOVL AX, 24(SP) + MOVL flag+28(FP), AX + MOVL AX, 28(SP) + CALL ·Xfchmodat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfchown(tls *TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) +TEXT ·Yfchown(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL uid+12(FP), AX + MOVL AX, 12(SP) + MOVL gid+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xfchown(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfchownat(tls *TLS, fd int32, path uintptr, uid Tuid_t, gid Tgid_t, flag int32) (r int32) +TEXT ·Yfchownat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL uid+24(FP), AX + MOVL AX, 24(SP) + MOVL gid+28(FP), AX + MOVL AX, 28(SP) + MOVL flag+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xfchownat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yfclose(tls *TLS, f uintptr) (r1 int32) +TEXT ·Yfclose(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfclose(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yfcntl(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) +TEXT ·Yfcntl(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL cmd+12(FP), AX + MOVL AX, 12(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfcntl(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfcntl64(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) +TEXT ·Yfcntl64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL cmd+12(FP), AX + MOVL AX, 12(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfcntl64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfcvt(tls *TLS, x float64, n int32, dp uintptr, sign uintptr) (r uintptr) +TEXT ·Yfcvt(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + MOVQ dp+24(FP), AX + MOVQ AX, 24(SP) + MOVQ sign+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xfcvt(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yfdatasync(tls *TLS, fd int32) (r int32) +TEXT ·Yfdatasync(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfdatasync(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfdim(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfdim(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfdim(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfdimf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Yfdimf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xfdimf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfdiml(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfdiml(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfdiml(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) +TEXT ·Yfdopen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ mode+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfdopen(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfdopendir(tls *TLS, fd int32) (r uintptr) +TEXT ·Yfdopendir(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfdopendir(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfeclearexcept(tls *TLS, mask int32) (r int32) +TEXT ·Yfeclearexcept(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL mask+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfeclearexcept(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfegetenv(tls *TLS, envp uintptr) (r int32) +TEXT ·Yfegetenv(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ envp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfegetenv(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfegetround(tls *TLS) (r int32) +TEXT ·Yfegetround(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xfegetround(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yfeof(tls *TLS, f uintptr) (r int32) +TEXT ·Yfeof(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfeof(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfeof_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Yfeof_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfeof_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yferaiseexcept(tls *TLS, mask int32) (r int32) +TEXT ·Yferaiseexcept(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL mask+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xferaiseexcept(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yferror(tls *TLS, f uintptr) (r int32) +TEXT ·Yferror(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xferror(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yferror_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Yferror_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xferror_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfesetenv(tls *TLS, envp uintptr) (r int32) +TEXT ·Yfesetenv(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ envp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfesetenv(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfetestexcept(tls *TLS, mask int32) (r int32) +TEXT ·Yfetestexcept(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL mask+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfetestexcept(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfexecve(tls *TLS, fd int32, argv uintptr, envp uintptr) (r1 int32) +TEXT ·Yfexecve(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ envp+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfexecve(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Yfflush(tls *TLS, f uintptr) (r1 int32) +TEXT ·Yfflush(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfflush(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yfflush_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Yfflush_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfflush_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yffs(tls *TLS, i int32) (r int32) +TEXT ·Yffs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL i+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xffs(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yffsl(tls *TLS, i int64) (r int32) +TEXT ·Yffsl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ i+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xffsl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yffsll(tls *TLS, i int64) (r int32) +TEXT ·Yffsll(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ i+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xffsll(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfgetc(tls *TLS, f1 uintptr) (r int32) +TEXT ·Yfgetc(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfgetc(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfgetc_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Yfgetc_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfgetc_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfgetgrent(tls *TLS, f uintptr) (r uintptr) +TEXT ·Yfgetgrent(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfgetgrent(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfgetln(tls *TLS, f uintptr, plen uintptr) (r uintptr) +TEXT ·Yfgetln(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ plen+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfgetln(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfgetpos(tls *TLS, f uintptr, pos uintptr) (r int32) +TEXT ·Yfgetpos(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ pos+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfgetpos(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfgetpwent(tls *TLS, f uintptr) (r uintptr) +TEXT ·Yfgetpwent(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfgetpwent(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfgets(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +TEXT ·Yfgets(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfgets(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yfgets_unlocked(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +TEXT ·Yfgets_unlocked(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfgets_unlocked(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yfgetwc(tls *TLS, f uintptr) (r Twint_t) +TEXT ·Yfgetwc(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfgetwc(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfgetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) +TEXT ·Yfgetwc_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfgetwc_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfgetws(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +TEXT ·Yfgetws(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfgetws(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yfgetws_unlocked(tls *TLS, s uintptr, n int32, f uintptr) (r uintptr) +TEXT ·Yfgetws_unlocked(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfgetws_unlocked(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yfgetxattr(tls *TLS, filedes int32, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) +TEXT ·Yfgetxattr(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL filedes+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ value+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xfgetxattr(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yfileno(tls *TLS, f uintptr) (r int32) +TEXT ·Yfileno(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfileno(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfileno_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Yfileno_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfileno_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfinite(tls *TLS, x float64) (r int32) +TEXT ·Yfinite(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfinite(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfinitef(tls *TLS, x float32) (r int32) +TEXT ·Yfinitef(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfinitef(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yflistxattr(tls *TLS, filedes int32, list uintptr, size Tsize_t) (r Tssize_t) +TEXT ·Yflistxattr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL filedes+8(FP), AX + MOVL AX, 8(SP) + MOVQ list+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xflistxattr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yflock(tls *TLS, fd int32, op int32) (r int32) +TEXT ·Yflock(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL op+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xflock(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yflockfile(tls *TLS, f uintptr) +TEXT ·Yflockfile(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xflockfile(SB) + RET + +// func Yfloor(tls *TLS, x3 float64) (r float64) +TEXT ·Yfloor(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfloor(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfloorf(tls *TLS, x3 float32) (r float32) +TEXT ·Yfloorf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfloorf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfloorl(tls *TLS, x float64) (r float64) +TEXT ·Yfloorl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfloorl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) +TEXT ·Yfma(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVQ z+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfma(SB) + MOVQ 32(SP), AX + MOVQ AX, r1+32(FP) + RET + +// func Yfmal(tls *TLS, x float64, y float64, z float64) (r float64) +TEXT ·Yfmal(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVQ z+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfmal(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yfmax(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfmax(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfmax(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfmaxf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Yfmaxf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xfmaxf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfmaxl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfmaxl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfmaxl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfmemopen(tls *TLS, buf uintptr, size Tsize_t, mode uintptr) (r uintptr) +TEXT ·Yfmemopen(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ mode+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfmemopen(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yfmin(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfmin(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfmin(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfminf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Yfminf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xfminf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfminl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfminl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfminl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfmod(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfmod(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfmod(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfmodf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Yfmodf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xfmodf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfmodl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yfmodl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfmodl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfmtmsg(tls *TLS, classification int64, label uintptr, severity int32, text uintptr, action uintptr, tag uintptr) (r int32) +TEXT ·Yfmtmsg(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ classification+8(FP), AX + MOVQ AX, 8(SP) + MOVQ label+16(FP), AX + MOVQ AX, 16(SP) + MOVL severity+24(FP), AX + MOVL AX, 24(SP) + MOVQ text+32(FP), AX + MOVQ AX, 32(SP) + MOVQ action+40(FP), AX + MOVQ AX, 40(SP) + MOVQ tag+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xfmtmsg(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Yfnmatch(tls *TLS, pat uintptr, str uintptr, flags int32) (r int32) +TEXT ·Yfnmatch(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ pat+8(FP), AX + MOVQ AX, 8(SP) + MOVQ str+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xfnmatch(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfopen(tls *TLS, filename uintptr, mode uintptr) (r uintptr) +TEXT ·Yfopen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mode+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfopen(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfopen64(tls *TLS, filename uintptr, mode uintptr) (r uintptr) +TEXT ·Yfopen64(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mode+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfopen64(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfopencookie(tls *TLS, cookie uintptr, mode uintptr, iofuncs Tcookie_io_functions_t) (r uintptr) +TEXT ·Yfopencookie(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ cookie+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mode+16(FP), AX + MOVQ AX, 16(SP) + MOVQ iofuncs_Fread+24(FP), AX + MOVQ AX, 24(SP) + MOVQ iofuncs_Fwrite+32(FP), AX + MOVQ AX, 32(SP) + MOVQ iofuncs_Fseek+40(FP), AX + MOVQ AX, 40(SP) + MOVQ iofuncs_Fclose1+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xfopencookie(SB) + MOVQ 56(SP), AX + MOVQ AX, r+56(FP) + RET + +// func Yfork(t *TLS) (_1 int32) +TEXT ·Yfork(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xfork(SB) + MOVL 8(SP), AX + MOVL AX, _1+8(FP) + RET + +// func Yfpathconf(tls *TLS, fd int32, name int32) (r int64) +TEXT ·Yfpathconf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL name+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xfpathconf(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yfprintf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Yfprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfpurge(tls *TLS, f uintptr) (r int32) +TEXT ·Yfpurge(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfpurge(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfputc(tls *TLS, c1 int32, f1 uintptr) (r int32) +TEXT ·Yfputc(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c1+8(FP), AX + MOVL AX, 8(SP) + MOVQ f1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputc(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfputc_unlocked(tls *TLS, c int32, f uintptr) (r int32) +TEXT ·Yfputc_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputc_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfputs(tls *TLS, s uintptr, f uintptr) (r int32) +TEXT ·Yfputs(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputs(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfputs_unlocked(tls *TLS, s uintptr, f uintptr) (r int32) +TEXT ·Yfputs_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputs_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfputwc(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +TEXT ·Yfputwc(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputwc(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +TEXT ·Yfputwc_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputwc_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfputws(tls *TLS, _ws uintptr, f uintptr) (r int32) +TEXT ·Yfputws(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _ws+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputws(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfputws_unlocked(tls *TLS, _ws uintptr, f uintptr) (r int32) +TEXT ·Yfputws_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _ws+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfputws_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfread(tls *TLS, destv uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +TEXT ·Yfread(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ destv+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nmemb+24(FP), AX + MOVQ AX, 24(SP) + MOVQ f+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xfread(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yfread_unlocked(tls *TLS, destv uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +TEXT ·Yfread_unlocked(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ destv+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nmemb+24(FP), AX + MOVQ AX, 24(SP) + MOVQ f+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xfread_unlocked(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yfree(tls *TLS, p uintptr) +TEXT ·Yfree(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfree(SB) + RET + +// func Yfreeaddrinfo(tls *TLS, p uintptr) +TEXT ·Yfreeaddrinfo(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfreeaddrinfo(SB) + RET + +// func Yfreeifaddrs(tls *TLS, ifp uintptr) +TEXT ·Yfreeifaddrs(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ifp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfreeifaddrs(SB) + RET + +// func Yfreelocale(tls *TLS, l Tlocale_t) +TEXT ·Yfreelocale(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfreelocale(SB) + RET + +// func Yfremovexattr(tls *TLS, fd int32, name uintptr) (r int32) +TEXT ·Yfremovexattr(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfremovexattr(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfreopen(tls *TLS, filename uintptr, mode uintptr, f uintptr) (r uintptr) +TEXT ·Yfreopen(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mode+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfreopen(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yfrexp(tls *TLS, x float64, e uintptr) (r float64) +TEXT ·Yfrexp(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ e+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfrexp(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfrexpf(tls *TLS, x float32, e uintptr) (r float32) +TEXT ·Yfrexpf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVQ e+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfrexpf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfrexpl(tls *TLS, x float64, e uintptr) (r float64) +TEXT ·Yfrexpl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ e+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfrexpl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yfscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Yfscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfseek(tls *TLS, f uintptr, off int64, whence int32) (r int32) +TEXT ·Yfseek(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ off+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xfseek(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfseeko(tls *TLS, f uintptr, off Toff_t, whence int32) (r int32) +TEXT ·Yfseeko(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ off+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xfseeko(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfsetpos(tls *TLS, f uintptr, pos uintptr) (r int32) +TEXT ·Yfsetpos(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ pos+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfsetpos(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfsetxattr(tls *TLS, filedes int32, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) +TEXT ·Yfsetxattr(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL filedes+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ value+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xfsetxattr(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Yfstat(tls *TLS, fd int32, st uintptr) (r int32) +TEXT ·Yfstat(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ st+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfstat(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfstat64(tls *TLS, fd int32, st uintptr) (r int32) +TEXT ·Yfstat64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ st+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfstat64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfstatat(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r int32) +TEXT ·Yfstatat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVQ st+24(FP), AX + MOVQ AX, 24(SP) + MOVL flag+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xfstatat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yfstatfs(tls *TLS, fd int32, buf uintptr) (r int32) +TEXT ·Yfstatfs(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfstatfs(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfstatvfs(tls *TLS, fd int32, buf uintptr) (r int32) +TEXT ·Yfstatvfs(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfstatvfs(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfsync(tls *TLS, fd int32) (r int32) +TEXT ·Yfsync(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xfsync(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yftell(tls *TLS, f uintptr) (r int64) +TEXT ·Yftell(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xftell(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yftello(tls *TLS, f uintptr) (r Toff_t) +TEXT ·Yftello(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xftello(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yftime(tls *TLS, tp uintptr) (r int32) +TEXT ·Yftime(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xftime(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yftok(tls *TLS, path uintptr, id int32) (r Tkey_t) +TEXT ·Yftok(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL id+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xftok(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yftruncate(tls *TLS, fd int32, length Toff_t) (r int32) +TEXT ·Yftruncate(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ length+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xftruncate(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yftruncate64(tls *TLS, fd int32, length Toff_t) (r int32) +TEXT ·Yftruncate64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ length+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xftruncate64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yftrylockfile(tls *TLS, f uintptr) (r int32) +TEXT ·Yftrylockfile(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xftrylockfile(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yfts64_close(t *TLS, ftsp uintptr) (_2 int32) +TEXT ·Yfts64_close(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ftsp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfts64_close(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Yfts64_open(t *TLS, path_argv uintptr, options int32, compar uintptr) (_4 uintptr) +TEXT ·Yfts64_open(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path_argv+8(FP), AX + MOVQ AX, 8(SP) + MOVL options+16(FP), AX + MOVL AX, 16(SP) + MOVQ compar+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfts64_open(SB) + MOVQ 32(SP), AX + MOVQ AX, _4+32(FP) + RET + +// func Yfts64_read(t *TLS, ftsp uintptr) (_2 uintptr) +TEXT ·Yfts64_read(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ftsp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfts64_read(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Yfts_close(t *TLS, ftsp uintptr) (_2 int32) +TEXT ·Yfts_close(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ftsp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfts_close(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Yfts_open(t *TLS, path_argv uintptr, options int32, compar uintptr) (_4 uintptr) +TEXT ·Yfts_open(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path_argv+8(FP), AX + MOVQ AX, 8(SP) + MOVL options+16(FP), AX + MOVL AX, 16(SP) + MOVQ compar+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfts_open(SB) + MOVQ 32(SP), AX + MOVQ AX, _4+32(FP) + RET + +// func Yfts_read(t *TLS, ftsp uintptr) (_2 uintptr) +TEXT ·Yfts_read(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ftsp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfts_read(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Yftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) +TEXT ·Yftw(SB),$48-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_fn+16(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_ftw_1(SB) // Create the closure for calling __ccgo_fp_fn + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 16(SP) + MOVL fd_limit+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xftw(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_ftw_1(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVL _3+24(FP), AX + MOVL AX, 24(SP) + MOVQ __ccgo_fp+32(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 32(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Yfunlockfile(tls *TLS, f uintptr) +TEXT ·Yfunlockfile(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xfunlockfile(SB) + RET + +// func Yfutimens(tls *TLS, fd int32, times uintptr) (r int32) +TEXT ·Yfutimens(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ times+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfutimens(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfutimes(tls *TLS, fd int32, tv uintptr) (r int32) +TEXT ·Yfutimes(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ tv+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xfutimes(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfutimesat(tls *TLS, dirfd int32, pathname uintptr, times uintptr) (r int32) +TEXT ·Yfutimesat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL dirfd+8(FP), AX + MOVL AX, 8(SP) + MOVQ pathname+16(FP), AX + MOVQ AX, 16(SP) + MOVQ times+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfutimesat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfwide(tls *TLS, f uintptr, mode int32) (r int32) +TEXT ·Yfwide(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVL mode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xfwide(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yfwprintf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Yfwprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfwprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yfwrite(tls *TLS, src uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +TEXT ·Yfwrite(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ src+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nmemb+24(FP), AX + MOVQ AX, 24(SP) + MOVQ f+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xfwrite(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yfwrite_unlocked(tls *TLS, src uintptr, size Tsize_t, nmemb Tsize_t, f uintptr) (r Tsize_t) +TEXT ·Yfwrite_unlocked(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ src+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nmemb+24(FP), AX + MOVQ AX, 24(SP) + MOVQ f+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xfwrite_unlocked(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yfwscanf(tls *TLS, f uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Yfwscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xfwscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ygai_strerror(tls *TLS, ecode int32) (r uintptr) +TEXT ·Ygai_strerror(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ecode+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xgai_strerror(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygcvt(tls *TLS, x float64, n int32, b uintptr) (r uintptr) +TEXT ·Ygcvt(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + MOVQ b+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgcvt(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yget_avphys_pages(tls *TLS) (r int64) +TEXT ·Yget_avphys_pages(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xget_avphys_pages(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Yget_current_dir_name(tls *TLS) (r uintptr) +TEXT ·Yget_current_dir_name(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xget_current_dir_name(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Yget_nprocs(tls *TLS) (r int32) +TEXT ·Yget_nprocs(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xget_nprocs(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yget_nprocs_conf(tls *TLS) (r int32) +TEXT ·Yget_nprocs_conf(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xget_nprocs_conf(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yget_phys_pages(tls *TLS) (r int64) +TEXT ·Yget_phys_pages(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xget_phys_pages(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) (r1 int32) +TEXT ·Ygetaddrinfo(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ host+8(FP), AX + MOVQ AX, 8(SP) + MOVQ serv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ hint+24(FP), AX + MOVQ AX, 24(SP) + MOVQ res+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xgetaddrinfo(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Ygetauxval(tls *TLS, item uint64) (r uint64) +TEXT ·Ygetauxval(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ item+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetauxval(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetc(tls *TLS, f1 uintptr) (r int32) +TEXT ·Ygetc(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetc(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetc_unlocked(tls *TLS, f uintptr) (r int32) +TEXT ·Ygetc_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetc_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetchar(tls *TLS) (r int32) +TEXT ·Ygetchar(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetchar(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetchar_unlocked(tls *TLS) (r int32) +TEXT ·Ygetchar_unlocked(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetchar_unlocked(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetcwd(tls *TLS, buf uintptr, size Tsize_t) (r uintptr) +TEXT ·Ygetcwd(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetcwd(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ygetdate(tls *TLS, s uintptr) (r uintptr) +TEXT ·Ygetdate(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetdate(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetdelim(tls *TLS, s uintptr, n uintptr, delim int32, f uintptr) (r Tssize_t) +TEXT ·Ygetdelim(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVL delim+24(FP), AX + MOVL AX, 24(SP) + MOVQ f+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xgetdelim(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ygetdents(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) +TEXT ·Ygetdents(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetdents(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ygetdomainname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +TEXT ·Ygetdomainname(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetdomainname(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetdtablesize(tls *TLS) (r int32) +TEXT ·Ygetdtablesize(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetdtablesize(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetegid(tls *TLS) (r Tgid_t) +TEXT ·Ygetegid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetegid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetentropy(tls *TLS, buffer uintptr, len1 Tsize_t) (r int32) +TEXT ·Ygetentropy(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buffer+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetentropy(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetenv(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ygetenv(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetenv(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygeteuid(tls *TLS) (r Tuid_t) +TEXT ·Ygeteuid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgeteuid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetgid(tls *TLS) (r Tgid_t) +TEXT ·Ygetgid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetgid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetgrent(tls *TLS) (r uintptr) +TEXT ·Ygetgrent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetgrent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetgrgid(tls *TLS, gid Tgid_t) (r uintptr) +TEXT ·Ygetgrgid(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL gid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xgetgrgid(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetgrgid_r(tls *TLS, gid Tgid_t, gr uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +TEXT ·Ygetgrgid_r(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL gid+8(FP), AX + MOVL AX, 8(SP) + MOVQ gr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVQ res+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xgetgrgid_r(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ygetgrnam(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ygetgrnam(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetgrnam(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetgrnam_r(tls *TLS, name uintptr, gr uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +TEXT ·Ygetgrnam_r(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ gr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVQ res+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xgetgrnam_r(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ygetgrouplist(tls *TLS, user uintptr, gid Tgid_t, groups uintptr, ngroups uintptr) (r int32) +TEXT ·Ygetgrouplist(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ user+8(FP), AX + MOVQ AX, 8(SP) + MOVL gid+16(FP), AX + MOVL AX, 16(SP) + MOVQ groups+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ngroups+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xgetgrouplist(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ygetgroups(tls *TLS, count int32, list uintptr) (r int32) +TEXT ·Ygetgroups(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL count+8(FP), AX + MOVL AX, 8(SP) + MOVQ list+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetgroups(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygethostbyaddr(tls *TLS, a uintptr, l Tsocklen_t, af int32) (r uintptr) +TEXT ·Ygethostbyaddr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVL l+16(FP), AX + MOVL AX, 16(SP) + MOVL af+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xgethostbyaddr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ygethostbyaddr_r(tls *TLS, a uintptr, l Tsocklen_t, af int32, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) +TEXT ·Ygethostbyaddr_r(SB),$72-68 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVL l+16(FP), AX + MOVL AX, 16(SP) + MOVL af+20(FP), AX + MOVL AX, 20(SP) + MOVQ h+24(FP), AX + MOVQ AX, 24(SP) + MOVQ buf+32(FP), AX + MOVQ AX, 32(SP) + MOVQ buflen+40(FP), AX + MOVQ AX, 40(SP) + MOVQ res+48(FP), AX + MOVQ AX, 48(SP) + MOVQ err+56(FP), AX + MOVQ AX, 56(SP) + CALL ·Xgethostbyaddr_r(SB) + MOVL 64(SP), AX + MOVL AX, r+64(FP) + RET + +// func Ygethostbyname(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ygethostbyname(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgethostbyname(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygethostbyname2(tls *TLS, name uintptr, af int32) (r uintptr) +TEXT ·Ygethostbyname2(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVL af+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xgethostbyname2(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ygethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) +TEXT ·Ygethostbyname2_r(SB),$72-68 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVL af+16(FP), AX + MOVL AX, 16(SP) + MOVQ h+24(FP), AX + MOVQ AX, 24(SP) + MOVQ buf+32(FP), AX + MOVQ AX, 32(SP) + MOVQ buflen+40(FP), AX + MOVQ AX, 40(SP) + MOVQ res+48(FP), AX + MOVQ AX, 48(SP) + MOVQ err+56(FP), AX + MOVQ AX, 56(SP) + CALL ·Xgethostbyname2_r(SB) + MOVL 64(SP), AX + MOVL AX, r+64(FP) + RET + +// func Ygethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen Tsize_t, res uintptr, err uintptr) (r int32) +TEXT ·Ygethostbyname_r(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ h+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ buflen+32(FP), AX + MOVQ AX, 32(SP) + MOVQ res+40(FP), AX + MOVQ AX, 40(SP) + MOVQ err+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xgethostbyname_r(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Ygethostent(tls *TLS) (r uintptr) +TEXT ·Ygethostent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgethostent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygethostid(tls *TLS) (r int64) +TEXT ·Ygethostid(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgethostid(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygethostname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +TEXT ·Ygethostname(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgethostname(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetifaddrs(tls *TLS, ifap uintptr) (r1 int32) +TEXT ·Ygetifaddrs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ifap+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetifaddrs(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ygetitimer(tls *TLS, which int32, old uintptr) (r1 int32) +TEXT ·Ygetitimer(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL which+8(FP), AX + MOVL AX, 8(SP) + MOVQ old+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetitimer(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ygetline(tls *TLS, s uintptr, n uintptr, f uintptr) (r Tssize_t) +TEXT ·Ygetline(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetline(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ygetloadavg(tls *TLS, a uintptr, n int32) (r int32) +TEXT ·Ygetloadavg(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xgetloadavg(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetlogin(tls *TLS) (r uintptr) +TEXT ·Ygetlogin(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetlogin(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetlogin_r(tls *TLS, name uintptr, size Tsize_t) (r int32) +TEXT ·Ygetlogin_r(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetlogin_r(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetmntent(tls *TLS, f uintptr) (r uintptr) +TEXT ·Ygetmntent(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetmntent(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetmntent_r(tls *TLS, f uintptr, mnt uintptr, linebuf uintptr, buflen int32) (r uintptr) +TEXT ·Ygetmntent_r(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mnt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ linebuf+24(FP), AX + MOVQ AX, 24(SP) + MOVL buflen+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xgetmntent_r(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ygetnameinfo(tls *TLS, sa uintptr, sl Tsocklen_t, node uintptr, nodelen Tsocklen_t, serv uintptr, servlen Tsocklen_t, flags int32) (r int32) +TEXT ·Ygetnameinfo(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ sa+8(FP), AX + MOVQ AX, 8(SP) + MOVL sl+16(FP), AX + MOVL AX, 16(SP) + MOVQ node+24(FP), AX + MOVQ AX, 24(SP) + MOVL nodelen+32(FP), AX + MOVL AX, 32(SP) + MOVQ serv+40(FP), AX + MOVQ AX, 40(SP) + MOVL servlen+48(FP), AX + MOVL AX, 48(SP) + MOVL flags+52(FP), AX + MOVL AX, 52(SP) + CALL ·Xgetnameinfo(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Ygetnetbyaddr(tls *TLS, net Tuint32_t, type1 int32) (r uintptr) +TEXT ·Ygetnetbyaddr(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL net+8(FP), AX + MOVL AX, 8(SP) + MOVL type1+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xgetnetbyaddr(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetnetbyname(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ygetnetbyname(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetnetbyname(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetnetent(tls *TLS) (r uintptr) +TEXT ·Ygetnetent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetnetent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetopt(tls *TLS, argc int32, argv uintptr, optstring uintptr) (r int32) +TEXT ·Ygetopt(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL argc+8(FP), AX + MOVL AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ optstring+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetopt(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ygetopt_long(tls *TLS, argc int32, argv uintptr, optstring uintptr, longopts uintptr, idx uintptr) (r int32) +TEXT ·Ygetopt_long(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL argc+8(FP), AX + MOVL AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ optstring+24(FP), AX + MOVQ AX, 24(SP) + MOVQ longopts+32(FP), AX + MOVQ AX, 32(SP) + MOVQ idx+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xgetopt_long(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ygetopt_long_only(tls *TLS, argc int32, argv uintptr, optstring uintptr, longopts uintptr, idx uintptr) (r int32) +TEXT ·Ygetopt_long_only(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL argc+8(FP), AX + MOVL AX, 8(SP) + MOVQ argv+16(FP), AX + MOVQ AX, 16(SP) + MOVQ optstring+24(FP), AX + MOVQ AX, 24(SP) + MOVQ longopts+32(FP), AX + MOVQ AX, 32(SP) + MOVQ idx+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xgetopt_long_only(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ygetpagesize(tls *TLS) (r int32) +TEXT ·Ygetpagesize(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetpagesize(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetpass(tls *TLS, prompt uintptr) (r uintptr) +TEXT ·Ygetpass(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ prompt+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetpass(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetpeername(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) +TEXT ·Ygetpeername(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetpeername(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ygetpgid(tls *TLS, pid Tpid_t) (r Tpid_t) +TEXT ·Ygetpgid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xgetpgid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetpgrp(tls *TLS) (r Tpid_t) +TEXT ·Ygetpgrp(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetpgrp(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetpid(tls *TLS) (r Tpid_t) +TEXT ·Ygetpid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetpid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetppid(tls *TLS) (r Tpid_t) +TEXT ·Ygetppid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetppid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetpriority(tls *TLS, which int32, who Tid_t) (r int32) +TEXT ·Ygetpriority(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL which+8(FP), AX + MOVL AX, 8(SP) + MOVL who+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xgetpriority(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetprotobyname(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ygetprotobyname(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetprotobyname(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetprotobynumber(tls *TLS, num int32) (r uintptr) +TEXT ·Ygetprotobynumber(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL num+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xgetprotobynumber(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetprotoent(tls *TLS) (r uintptr) +TEXT ·Ygetprotoent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetprotoent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetpwent(tls *TLS) (r uintptr) +TEXT ·Ygetpwent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetpwent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetpwnam(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ygetpwnam(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetpwnam(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetpwnam_r(tls *TLS, name uintptr, pw uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +TEXT ·Ygetpwnam_r(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ pw+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVQ res+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xgetpwnam_r(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ygetpwuid(tls *TLS, uid Tuid_t) (r uintptr) +TEXT ·Ygetpwuid(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL uid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xgetpwuid(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetpwuid_r(tls *TLS, uid Tuid_t, pw uintptr, buf uintptr, size Tsize_t, res uintptr) (r int32) +TEXT ·Ygetpwuid_r(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL uid+8(FP), AX + MOVL AX, 8(SP) + MOVQ pw+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVQ res+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xgetpwuid_r(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ygetrandom(tls *TLS, buf uintptr, buflen Tsize_t, flags uint32) (r Tssize_t) +TEXT ·Ygetrandom(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buflen+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xgetrandom(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ygetresgid(tls *TLS, rgid uintptr, egid uintptr, sgid uintptr) (r int32) +TEXT ·Ygetresgid(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ rgid+8(FP), AX + MOVQ AX, 8(SP) + MOVQ egid+16(FP), AX + MOVQ AX, 16(SP) + MOVQ sgid+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetresgid(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ygetresuid(tls *TLS, ruid uintptr, euid uintptr, suid uintptr) (r int32) +TEXT ·Ygetresuid(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ruid+8(FP), AX + MOVQ AX, 8(SP) + MOVQ euid+16(FP), AX + MOVQ AX, 16(SP) + MOVQ suid+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetresuid(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ygetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) +TEXT ·Ygetrlimit(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL resource+8(FP), AX + MOVL AX, 8(SP) + MOVQ rlim+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetrlimit(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) +TEXT ·Ygetrlimit64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL resource+8(FP), AX + MOVL AX, 8(SP) + MOVQ rlim+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetrlimit64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetrusage(tls *TLS, who int32, ru uintptr) (r1 int32) +TEXT ·Ygetrusage(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL who+8(FP), AX + MOVL AX, 8(SP) + MOVQ ru+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetrusage(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ygets(tls *TLS, s uintptr) (r uintptr) +TEXT ·Ygets(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgets(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetservbyname(tls *TLS, name uintptr, prots uintptr) (r uintptr) +TEXT ·Ygetservbyname(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ prots+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgetservbyname(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ygetservbyname_r(tls *TLS, name uintptr, prots uintptr, se uintptr, buf uintptr, buflen Tsize_t, res uintptr) (r int32) +TEXT ·Ygetservbyname_r(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ prots+16(FP), AX + MOVQ AX, 16(SP) + MOVQ se+24(FP), AX + MOVQ AX, 24(SP) + MOVQ buf+32(FP), AX + MOVQ AX, 32(SP) + MOVQ buflen+40(FP), AX + MOVQ AX, 40(SP) + MOVQ res+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xgetservbyname_r(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Ygetservent(tls *TLS) (r uintptr) +TEXT ·Ygetservent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetservent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetsid(tls *TLS, pid Tpid_t) (r Tpid_t) +TEXT ·Ygetsid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xgetsid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetsockname(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) +TEXT ·Ygetsockname(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetsockname(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ygetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, optlen uintptr) (r2 int32) +TEXT ·Ygetsockopt(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL level+12(FP), AX + MOVL AX, 12(SP) + MOVL optname+16(FP), AX + MOVL AX, 16(SP) + MOVQ optval+24(FP), AX + MOVQ AX, 24(SP) + MOVQ optlen+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xgetsockopt(SB) + MOVL 40(SP), AX + MOVL AX, r2+40(FP) + RET + +// func Ygetspent(tls *TLS) (r uintptr) +TEXT ·Ygetspent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetspent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetsubopt(tls *TLS, opt uintptr, keys uintptr, val uintptr) (r int32) +TEXT ·Ygetsubopt(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ opt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ keys+16(FP), AX + MOVQ AX, 16(SP) + MOVQ val+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xgetsubopt(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ygettext(tls *TLS, msgid uintptr) (r uintptr) +TEXT ·Ygettext(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msgid+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgettext(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygettimeofday(tls *TLS, tv uintptr, tz uintptr) (r int32) +TEXT ·Ygettimeofday(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tv+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tz+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgettimeofday(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ygetuid(tls *TLS) (r Tuid_t) +TEXT ·Ygetuid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetuid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetusershell(tls *TLS) (r uintptr) +TEXT ·Ygetusershell(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetusershell(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetutent(tls *TLS) (r uintptr) +TEXT ·Ygetutent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetutent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetutid(tls *TLS, ut uintptr) (r uintptr) +TEXT ·Ygetutid(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ut+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetutid(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetutline(tls *TLS, ut uintptr) (r uintptr) +TEXT ·Ygetutline(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ut+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetutline(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetutxent(tls *TLS) (r uintptr) +TEXT ·Ygetutxent(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetutxent(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ygetutxid(tls *TLS, ut uintptr) (r uintptr) +TEXT ·Ygetutxid(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ut+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetutxid(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetutxline(tls *TLS, ut uintptr) (r uintptr) +TEXT ·Ygetutxline(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ut+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetutxline(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygetw(tls *TLS, f uintptr) (r int32) +TEXT ·Ygetw(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetw(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetwc(tls *TLS, f uintptr) (r Twint_t) +TEXT ·Ygetwc(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetwc(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) +TEXT ·Ygetwc_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgetwc_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ygetwchar(tls *TLS) (r Twint_t) +TEXT ·Ygetwchar(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetwchar(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetwchar_unlocked(tls *TLS) (r Twint_t) +TEXT ·Ygetwchar_unlocked(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xgetwchar_unlocked(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ygetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) +TEXT ·Ygetxattr(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ value+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xgetxattr(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g_ uintptr) (r int32) +TEXT ·Yglob(SB),$56-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_errfunc+24(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_glob_2(SB) // Create the closure for calling __ccgo_fp_errfunc + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ pat+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 24(SP) + MOVQ g_+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xglob(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_glob_2(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVL _2+16(FP), AX + MOVL AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Yglobfree(tls *TLS, g_ uintptr) +TEXT ·Yglobfree(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ g_+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xglobfree(SB) + RET + +// func Ygmtime(tls *TLS, t uintptr) (r uintptr) +TEXT ·Ygmtime(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xgmtime(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ygmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) +TEXT ·Ygmtime_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tm+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xgmtime_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ygrantpt(tls *TLS, fd int32) (r int32) +TEXT ·Ygrantpt(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xgrantpt(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yhasmntopt(tls *TLS, mnt uintptr, opt uintptr) (r uintptr) +TEXT ·Yhasmntopt(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mnt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ opt+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xhasmntopt(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yhcreate(tls *TLS, nel Tsize_t) (r int32) +TEXT ·Yhcreate(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ nel+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xhcreate(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yhdestroy(tls *TLS) +TEXT ·Yhdestroy(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xhdestroy(SB) + RET + +// func Yherror(tls *TLS, msg uintptr) +TEXT ·Yherror(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xherror(SB) + RET + +// func Yhsearch(tls *TLS, item TENTRY, action TACTION) (r uintptr) +TEXT ·Yhsearch(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ item_Fkey+8(FP), AX + MOVQ AX, 8(SP) + MOVQ item_Fdata+16(FP), AX + MOVQ AX, 16(SP) + MOVL action+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xhsearch(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yhstrerror(tls *TLS, ecode int32) (r uintptr) +TEXT ·Yhstrerror(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL ecode+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xhstrerror(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yhtonl(tls *TLS, n Tuint32_t) (r Tuint32_t) +TEXT ·Yhtonl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xhtonl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yhtons(tls *TLS, n Tuint16_t) (r Tuint16_t) +TEXT ·Yhtons(SB),$24-18 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVW n+8(FP), AX + MOVW AX, 8(SP) + CALL ·Xhtons(SB) + MOVW 16(SP), AX + MOVW AX, r+16(FP) + RET + +// func Yhypot(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yhypot(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xhypot(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yhypotf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Yhypotf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xhypotf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yhypotl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yhypotl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xhypotl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb uintptr) (r Tsize_t) +TEXT ·Yiconv(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ cd+8(FP), AX + MOVQ AX, 8(SP) + MOVQ in+16(FP), AX + MOVQ AX, 16(SP) + MOVQ inb+24(FP), AX + MOVQ AX, 24(SP) + MOVQ out+32(FP), AX + MOVQ AX, 32(SP) + MOVQ outb+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xiconv(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Yiconv_close(tls *TLS, cd Ticonv_t) (r int32) +TEXT ·Yiconv_close(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ cd+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xiconv_close(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiconv_open(tls *TLS, to uintptr, from uintptr) (r Ticonv_t) +TEXT ·Yiconv_open(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ to+8(FP), AX + MOVQ AX, 8(SP) + MOVQ from+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiconv_open(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yif_freenameindex(tls *TLS, idx uintptr) +TEXT ·Yif_freenameindex(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ idx+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xif_freenameindex(SB) + RET + +// func Yif_indextoname(tls *TLS, index uint32, name uintptr) (r1 uintptr) +TEXT ·Yif_indextoname(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL index+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xif_indextoname(SB) + MOVQ 24(SP), AX + MOVQ AX, r1+24(FP) + RET + +// func Yif_nameindex(tls *TLS) (r uintptr) +TEXT ·Yif_nameindex(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xif_nameindex(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Yif_nametoindex(tls *TLS, name uintptr) (r1 uint32) +TEXT ·Yif_nametoindex(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xif_nametoindex(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yilogb(tls *TLS, x3 float64) (r int32) +TEXT ·Yilogb(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xilogb(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yilogbf(tls *TLS, x3 float32) (r int32) +TEXT ·Yilogbf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xilogbf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yilogbl(tls *TLS, x float64) (r int32) +TEXT ·Yilogbl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xilogbl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yimaxabs(tls *TLS, a Tintmax_t) (r Tintmax_t) +TEXT ·Yimaxabs(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Ximaxabs(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yimaxdiv(tls *TLS, num Tintmax_t, den Tintmax_t) (r Timaxdiv_t) +TEXT ·Yimaxdiv(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ num+8(FP), AX + MOVQ AX, 8(SP) + MOVQ den+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Ximaxdiv(SB) + MOVQ 24(SP), AX + MOVQ AX, r_Fquot+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_Frem+32(FP) + RET + +// func Yindex(tls *TLS, s uintptr, c int32) (r uintptr) +TEXT ·Yindex(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xindex(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yinet_addr(tls *TLS, p uintptr) (r Tin_addr_t) +TEXT ·Yinet_addr(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xinet_addr(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yinet_aton(tls *TLS, s0 uintptr, dest uintptr) (r int32) +TEXT ·Yinet_aton(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s0+8(FP), AX + MOVQ AX, 8(SP) + MOVQ dest+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xinet_aton(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yinet_lnaof(tls *TLS, in Tin_addr) (r Tin_addr_t) +TEXT ·Yinet_lnaof(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL in_Fs_addr+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xinet_lnaof(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yinet_makeaddr(tls *TLS, n Tin_addr_t, h Tin_addr_t) (r Tin_addr) +TEXT ·Yinet_makeaddr(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + MOVL h+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xinet_makeaddr(SB) + MOVL 16(SP), AX + MOVL AX, r_Fs_addr+16(FP) + RET + +// func Yinet_netof(tls *TLS, in Tin_addr) (r Tin_addr_t) +TEXT ·Yinet_netof(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL in_Fs_addr+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xinet_netof(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yinet_network(tls *TLS, p uintptr) (r Tin_addr_t) +TEXT ·Yinet_network(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xinet_network(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yinet_ntoa(tls *TLS, _in Tin_addr) (r uintptr) +TEXT ·Yinet_ntoa(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL _in_Fs_addr+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xinet_ntoa(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l Tsocklen_t) (r uintptr) +TEXT ·Yinet_ntop(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL af+8(FP), AX + MOVL AX, 8(SP) + MOVQ a0+16(FP), AX + MOVQ AX, 16(SP) + MOVQ s+24(FP), AX + MOVQ AX, 24(SP) + MOVL l+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xinet_ntop(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) (r int32) +TEXT ·Yinet_pton(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL af+8(FP), AX + MOVL AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ a0+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xinet_pton(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yinit_module(tls *TLS, a uintptr, b uint64, c uintptr) (r int32) +TEXT ·Yinit_module(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + MOVQ c+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xinit_module(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yinitstate(tls *TLS, seed uint32, state uintptr, size Tsize_t) (r uintptr) +TEXT ·Yinitstate(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL seed+8(FP), AX + MOVL AX, 8(SP) + MOVQ state+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xinitstate(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yinitstate_r(t *TLS, seed uint32, statebuf uintptr, statelen Tsize_t, buf uintptr) (_5 int32) +TEXT ·Yinitstate_r(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL seed+8(FP), AX + MOVL AX, 8(SP) + MOVQ statebuf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ statelen+24(FP), AX + MOVQ AX, 24(SP) + MOVQ buf+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xinitstate_r(SB) + MOVL 40(SP), AX + MOVL AX, _5+40(FP) + RET + +// func Yinotify_add_watch(tls *TLS, fd int32, pathname uintptr, mask Tuint32_t) (r int32) +TEXT ·Yinotify_add_watch(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ pathname+16(FP), AX + MOVQ AX, 16(SP) + MOVL mask+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xinotify_add_watch(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yinotify_init(tls *TLS) (r int32) +TEXT ·Yinotify_init(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xinotify_init(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yinotify_init1(tls *TLS, flags int32) (r1 int32) +TEXT ·Yinotify_init1(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL flags+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xinotify_init1(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yinotify_rm_watch(tls *TLS, fd int32, wd int32) (r int32) +TEXT ·Yinotify_rm_watch(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL wd+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xinotify_rm_watch(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yinsque(tls *TLS, element uintptr, pred uintptr) +TEXT ·Yinsque(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ element+8(FP), AX + MOVQ AX, 8(SP) + MOVQ pred+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xinsque(SB) + RET + +// func Yioctl(tls *TLS, fd int32, req int32, va uintptr) (r1 int32) +TEXT ·Yioctl(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL req+12(FP), AX + MOVL AX, 12(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xioctl(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Yioperm(tls *TLS, from uint64, num uint64, turn_on int32) (r int32) +TEXT ·Yioperm(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ from+8(FP), AX + MOVQ AX, 8(SP) + MOVQ num+16(FP), AX + MOVQ AX, 16(SP) + MOVL turn_on+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xioperm(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yiopl(tls *TLS, level int32) (r int32) +TEXT ·Yiopl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL level+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiopl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisalnum(tls *TLS, c int32) (r int32) +TEXT ·Yisalnum(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisalnum(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisalnum_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisalnum_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisalnum_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yisalpha(tls *TLS, c int32) (r int32) +TEXT ·Yisalpha(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisalpha(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisalpha_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisalpha_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisalpha_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yisascii(tls *TLS, c int32) (r int32) +TEXT ·Yisascii(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisascii(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisastream(tls *TLS, fd int32) (r int32) +TEXT ·Yisastream(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisastream(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisatty(tls *TLS, fd int32) (r1 int32) +TEXT ·Yisatty(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisatty(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yisblank(tls *TLS, c int32) (r int32) +TEXT ·Yisblank(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisblank(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisblank_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisblank_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisblank_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiscntrl(tls *TLS, c int32) (r int32) +TEXT ·Yiscntrl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiscntrl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiscntrl_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yiscntrl_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiscntrl_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yisdigit(tls *TLS, c int32) (r int32) +TEXT ·Yisdigit(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisdigit(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yisgraph(tls *TLS, c int32) (r int32) +TEXT ·Yisgraph(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisgraph(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisgraph_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisgraph_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisgraph_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yislower(tls *TLS, c int32) (r int32) +TEXT ·Yislower(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xislower(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yislower_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yislower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xislower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yisnan(t *TLS, x float64) (_2 int32) +TEXT ·Yisnan(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xisnan(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Yisnanf(t *TLS, arg float32) (_2 int32) +TEXT ·Yisnanf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL arg+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisnanf(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Yisnanl(t *TLS, arg float64) (_2 int32) +TEXT ·Yisnanl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ arg+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xisnanl(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Yisprint(tls *TLS, c int32) (r int32) +TEXT ·Yisprint(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisprint(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisprint_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisprint_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisprint_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yispunct(tls *TLS, c int32) (r int32) +TEXT ·Yispunct(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xispunct(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yispunct_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yispunct_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xispunct_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yissetugid(tls *TLS) (r int32) +TEXT ·Yissetugid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xissetugid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yisspace(tls *TLS, c int32) (r int32) +TEXT ·Yisspace(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisspace(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisspace_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisspace_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisspace_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yisupper(tls *TLS, c int32) (r int32) +TEXT ·Yisupper(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisupper(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswalnum(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswalnum(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswalnum(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswalnum_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswalnum_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswalnum_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswalpha(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswalpha(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswalpha(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswalpha_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswalpha_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswalpha_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswblank(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswblank(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswblank(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswblank_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswblank_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswblank_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswcntrl(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswcntrl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswcntrl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswcntrl_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswcntrl_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswcntrl_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswctype(tls *TLS, wc Twint_t, type1 Twctype_t) (r int32) +TEXT ·Yiswctype(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + MOVQ type1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswctype(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswctype_l(tls *TLS, c Twint_t, t Twctype_t, l Tlocale_t) (r int32) +TEXT ·Yiswctype_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ t+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xiswctype_l(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yiswdigit(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswdigit(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswdigit(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswgraph(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswgraph(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswgraph(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswgraph_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswgraph_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswgraph_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswlower(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswlower(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswlower(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswlower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswlower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswprint(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswprint(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswprint(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswprint_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswprint_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswprint_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswpunct(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswpunct(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswpunct(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswpunct_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswpunct_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswpunct_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswspace(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswspace(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswspace(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswspace_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswspace_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswspace_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswupper(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswupper(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswupper(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yiswxdigit(tls *TLS, wc Twint_t) (r int32) +TEXT ·Yiswxdigit(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xiswxdigit(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yiswxdigit_l(tls *TLS, c Twint_t, l Tlocale_t) (r int32) +TEXT ·Yiswxdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xiswxdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yisxdigit(tls *TLS, c int32) (r int32) +TEXT ·Yisxdigit(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xisxdigit(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yisxdigit_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Yisxdigit_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xisxdigit_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yj0(tls *TLS, x float64) (r1 float64) +TEXT ·Yj0(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xj0(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Yj0f(tls *TLS, x float32) (r1 float32) +TEXT ·Yj0f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xj0f(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yj1(tls *TLS, x float64) (r1 float64) +TEXT ·Yj1(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xj1(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Yj1f(tls *TLS, x float32) (r1 float32) +TEXT ·Yj1f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xj1f(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yjn(tls *TLS, n int32, x float64) (r float64) +TEXT ·Yjn(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + MOVQ x+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xjn(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yjnf(tls *TLS, n int32, x float32) (r float32) +TEXT ·Yjnf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + MOVL x+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xjnf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yjrand48(tls *TLS, s uintptr) (r int64) +TEXT ·Yjrand48(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xjrand48(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ykill(tls *TLS, pid Tpid_t, sig int32) (r int32) +TEXT ·Ykill(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVL sig+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xkill(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ykillpg(tls *TLS, pgid Tpid_t, sig int32) (r int32) +TEXT ·Ykillpg(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pgid+8(FP), AX + MOVL AX, 8(SP) + MOVL sig+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xkillpg(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yklogctl(tls *TLS, type1 int32, buf uintptr, len1 int32) (r int32) +TEXT ·Yklogctl(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL type1+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVL len1+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xklogctl(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yl64a(tls *TLS, x0 int64) (r uintptr) +TEXT ·Yl64a(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x0+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xl64a(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylabs(tls *TLS, a int64) (r int64) +TEXT ·Ylabs(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlabs(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylchmod(tls *TLS, path uintptr, mode Tmode_t) (r int32) +TEXT ·Ylchmod(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL mode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xlchmod(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylchown(tls *TLS, path uintptr, uid Tuid_t, gid Tgid_t) (r int32) +TEXT ·Ylchown(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL uid+16(FP), AX + MOVL AX, 16(SP) + MOVL gid+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xlchown(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylckpwdf(tls *TLS) (r int32) +TEXT ·Ylckpwdf(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xlckpwdf(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ylcong48(tls *TLS, p uintptr) +TEXT ·Ylcong48(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlcong48(SB) + RET + +// func Yldexp(tls *TLS, x float64, n int32) (r float64) +TEXT ·Yldexp(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xldexp(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yldexpf(tls *TLS, x float32, n int32) (r float32) +TEXT ·Yldexpf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL n+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xldexpf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yldexpl(tls *TLS, x float64, n int32) (r float64) +TEXT ·Yldexpl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xldexpl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yldiv(tls *TLS, num int64, den int64) (r Tldiv_t) +TEXT ·Yldiv(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ num+8(FP), AX + MOVQ AX, 8(SP) + MOVQ den+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xldiv(SB) + MOVQ 24(SP), AX + MOVQ AX, r_Fquot+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_Frem+32(FP) + RET + +// func Ylfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) +TEXT ·Ylfind(SB),$64-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_compar+40(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_lfind_4(SB) // Create the closure for calling __ccgo_fp_compar + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ base+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nelp+24(FP), AX + MOVQ AX, 24(SP) + MOVQ width+32(FP), AX + MOVQ AX, 32(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 40(SP) + CALL ·Xlfind(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_lfind_4(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Ylgamma(tls *TLS, x float64) (r float64) +TEXT ·Ylgamma(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlgamma(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylgamma_r(tls *TLS, x float64, signgamp uintptr) (r float64) +TEXT ·Ylgamma_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ signgamp+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlgamma_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ylgammaf(tls *TLS, x float32) (r float32) +TEXT ·Ylgammaf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlgammaf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ylgammaf_r(tls *TLS, x float32, signgamp uintptr) (r float32) +TEXT ·Ylgammaf_r(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVQ signgamp+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlgammaf_r(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylgammal(tls *TLS, x float64) (r float64) +TEXT ·Ylgammal(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlgammal(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylgammal_r(tls *TLS, x float64, sg uintptr) (r float64) +TEXT ·Ylgammal_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sg+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlgammal_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ylgetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t) (r Tssize_t) +TEXT ·Ylgetxattr(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ value+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xlgetxattr(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ylink(tls *TLS, existing uintptr, new1 uintptr) (r int32) +TEXT ·Ylink(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ existing+8(FP), AX + MOVQ AX, 8(SP) + MOVQ new1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlink(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylinkat(tls *TLS, fd1 int32, existing uintptr, fd2 int32, new1 uintptr, flag int32) (r int32) +TEXT ·Ylinkat(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd1+8(FP), AX + MOVL AX, 8(SP) + MOVQ existing+16(FP), AX + MOVQ AX, 16(SP) + MOVL fd2+24(FP), AX + MOVL AX, 24(SP) + MOVQ new1+32(FP), AX + MOVQ AX, 32(SP) + MOVL flag+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xlinkat(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ylisten(tls *TLS, fd int32, backlog int32) (r1 int32) +TEXT ·Ylisten(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL backlog+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xlisten(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ylistxattr(tls *TLS, path uintptr, list uintptr, size Tsize_t) (r Tssize_t) +TEXT ·Ylistxattr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ list+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xlistxattr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yllabs(tls *TLS, a int64) (r int64) +TEXT ·Yllabs(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xllabs(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylldiv(tls *TLS, num int64, den int64) (r Tlldiv_t) +TEXT ·Ylldiv(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ num+8(FP), AX + MOVQ AX, 8(SP) + MOVQ den+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlldiv(SB) + MOVQ 24(SP), AX + MOVQ AX, r_Fquot+24(FP) + MOVQ 32(SP), AX + MOVQ AX, r_Frem+32(FP) + RET + +// func Yllistxattr(tls *TLS, path uintptr, list uintptr, size Tsize_t) (r Tssize_t) +TEXT ·Yllistxattr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ list+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xllistxattr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yllrint(tls *TLS, x float64) (r int64) +TEXT ·Yllrint(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xllrint(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yllrintf(tls *TLS, x float32) (r int64) +TEXT ·Yllrintf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xllrintf(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yllrintl(tls *TLS, x float64) (r int64) +TEXT ·Yllrintl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xllrintl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yllround(tls *TLS, x float64) (r int64) +TEXT ·Yllround(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xllround(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yllroundf(tls *TLS, x float32) (r int64) +TEXT ·Yllroundf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xllroundf(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yllroundl(tls *TLS, x float64) (r int64) +TEXT ·Yllroundl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xllroundl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylocaleconv(tls *TLS) (r uintptr) +TEXT ·Ylocaleconv(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xlocaleconv(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ylocaltime(tls *TLS, t uintptr) (r uintptr) +TEXT ·Ylocaltime(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlocaltime(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylocaltime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) +TEXT ·Ylocaltime_r(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tm+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlocaltime_r(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ylockf(tls *TLS, fd int32, op int32, size Toff_t) (r int32) +TEXT ·Ylockf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL op+12(FP), AX + MOVL AX, 12(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlockf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylog(tls *TLS, x1 float64) (r1 float64) +TEXT ·Ylog(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlog(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Ylog10(tls *TLS, x float64) (r float64) +TEXT ·Ylog10(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlog10(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylog10f(tls *TLS, x float32) (r float32) +TEXT ·Ylog10f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlog10f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ylog10l(tls *TLS, x float64) (r float64) +TEXT ·Ylog10l(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlog10l(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylog1p(tls *TLS, x3 float64) (r float64) +TEXT ·Ylog1p(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlog1p(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylog1pf(tls *TLS, x3 float32) (r float32) +TEXT ·Ylog1pf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlog1pf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ylog1pl(tls *TLS, x float64) (r float64) +TEXT ·Ylog1pl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlog1pl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylog2(tls *TLS, x1 float64) (r1 float64) +TEXT ·Ylog2(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlog2(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Ylog2f(tls *TLS, x1 float32) (r1 float32) +TEXT ·Ylog2f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x1+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlog2f(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ylog2l(tls *TLS, x float64) (r float64) +TEXT ·Ylog2l(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlog2l(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylogb(tls *TLS, x float64) (r float64) +TEXT ·Ylogb(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlogb(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylogbf(tls *TLS, x float32) (r float32) +TEXT ·Ylogbf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlogbf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ylogbl(tls *TLS, x float64) (r float64) +TEXT ·Ylogbl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlogbl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylogf(tls *TLS, x1 float32) (r1 float32) +TEXT ·Ylogf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x1+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlogf(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ylogin_tty(tls *TLS, fd int32) (r int32) +TEXT ·Ylogin_tty(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlogin_tty(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ylogl(tls *TLS, x float64) (r float64) +TEXT ·Ylogl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlogl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylongjmp(t *TLS, env uintptr, val int32) +TEXT ·Ylongjmp(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ env+8(FP), AX + MOVQ AX, 8(SP) + MOVL val+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xlongjmp(SB) + RET + +// func Ylrand48(tls *TLS) (r int64) +TEXT ·Ylrand48(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xlrand48(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ylremovexattr(tls *TLS, path uintptr, name uintptr) (r int32) +TEXT ·Ylremovexattr(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlremovexattr(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylrint(tls *TLS, x float64) (r int64) +TEXT ·Ylrint(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlrint(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylrintf(tls *TLS, x float32) (r int64) +TEXT ·Ylrintf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlrintf(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylrintl(tls *TLS, x float64) (r int64) +TEXT ·Ylrintl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlrintl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylround(tls *TLS, x float64) (r int64) +TEXT ·Ylround(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlround(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylroundf(tls *TLS, x float32) (r int64) +TEXT ·Ylroundf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xlroundf(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylroundl(tls *TLS, x float64) (r int64) +TEXT ·Ylroundl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xlroundl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ylsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) +TEXT ·Ylsearch(SB),$64-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_compar+40(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_lsearch_4(SB) // Create the closure for calling __ccgo_fp_compar + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ base+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nelp+24(FP), AX + MOVQ AX, 24(SP) + MOVQ width+32(FP), AX + MOVQ AX, 32(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 40(SP) + CALL ·Xlsearch(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_lsearch_4(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Ylseek(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) +TEXT ·Ylseek(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ offset+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xlseek(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ylseek64(tls *TLS, fd int32, offset Toff_t, whence int32) (r Toff_t) +TEXT ·Ylseek64(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ offset+16(FP), AX + MOVQ AX, 16(SP) + MOVL whence+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xlseek64(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ylsetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) +TEXT ·Ylsetxattr(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ value+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xlsetxattr(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ylstat(tls *TLS, path uintptr, buf uintptr) (r int32) +TEXT ·Ylstat(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlstat(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylstat64(tls *TLS, path uintptr, buf uintptr) (r int32) +TEXT ·Ylstat64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlstat64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ylutimes(tls *TLS, filename uintptr, tv uintptr) (r int32) +TEXT ·Ylutimes(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tv+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xlutimes(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymadvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) +TEXT ·Ymadvise(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL advice+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xmadvise(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymalloc(tls *TLS, n Tsize_t) (r uintptr) +TEXT ·Ymalloc(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmalloc(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ymalloc_usable_size(tls *TLS, p uintptr) (r Tsize_t) +TEXT ·Ymalloc_usable_size(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmalloc_usable_size(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ymblen(tls *TLS, s uintptr, n Tsize_t) (r int32) +TEXT ·Ymblen(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmblen(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymbrlen(tls *TLS, s uintptr, n Tsize_t, st uintptr) (r Tsize_t) +TEXT ·Ymbrlen(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ st+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmbrlen(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymbrtoc16(tls *TLS, pc16 uintptr, s uintptr, n Tsize_t, ps uintptr) (r Tsize_t) +TEXT ·Ymbrtoc16(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ pc16+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ps+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xmbrtoc16(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ymbrtoc32(tls *TLS, pc32 uintptr, s uintptr, n Tsize_t, ps uintptr) (r Tsize_t) +TEXT ·Ymbrtoc32(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ pc32+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ps+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xmbrtoc32(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ymbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize_t) +TEXT ·Ymbrtowc(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ wc+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ st+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xmbrtowc(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ymbsinit(tls *TLS, st uintptr) (r int32) +TEXT ·Ymbsinit(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ st+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmbsinit(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ymbsnrtowcs(tls *TLS, wcs uintptr, src uintptr, n Tsize_t, wn Tsize_t, st uintptr) (r Tsize_t) +TEXT ·Ymbsnrtowcs(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ wcs+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ wn+32(FP), AX + MOVQ AX, 32(SP) + MOVQ st+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xmbsnrtowcs(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ymbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Tsize_t) +TEXT ·Ymbsrtowcs(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ws+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ wn+24(FP), AX + MOVQ AX, 24(SP) + MOVQ st+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xmbsrtowcs(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ymbstowcs(tls *TLS, ws uintptr, _s uintptr, wn Tsize_t) (r Tsize_t) +TEXT ·Ymbstowcs(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ws+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ wn+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmbstowcs(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) +TEXT ·Ymbtowc(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ wc+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmbtowc(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymemccpy(tls *TLS, dest uintptr, src uintptr, c int32, n Tsize_t) (r uintptr) +TEXT ·Ymemccpy(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVL c+24(FP), AX + MOVL AX, 24(SP) + MOVQ n+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xmemccpy(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ymemchr(tls *TLS, src uintptr, c int32, n Tsize_t) (r uintptr) +TEXT ·Ymemchr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ src+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmemchr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymemcmp(tls *TLS, vl uintptr, vr uintptr, n Tsize_t) (r1 int32) +TEXT ·Ymemcmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ vl+8(FP), AX + MOVQ AX, 8(SP) + MOVQ vr+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmemcmp(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ymemcpy(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) +TEXT ·Ymemcpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmemcpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymemfd_create(tls *TLS, name uintptr, flags uint32) (r int32) +TEXT ·Ymemfd_create(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xmemfd_create(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymemmem(tls *TLS, h0 uintptr, k Tsize_t, n0 uintptr, l Tsize_t) (r uintptr) +TEXT ·Ymemmem(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ h0+8(FP), AX + MOVQ AX, 8(SP) + MOVQ k+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n0+24(FP), AX + MOVQ AX, 24(SP) + MOVQ l+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xmemmem(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ymemmove(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) +TEXT ·Ymemmove(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmemmove(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymempcpy(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r uintptr) +TEXT ·Ymempcpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmempcpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymemrchr(tls *TLS, m uintptr, c int32, n Tsize_t) (r uintptr) +TEXT ·Ymemrchr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmemrchr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymemset(tls *TLS, dest uintptr, c int32, n Tsize_t) (r uintptr) +TEXT ·Ymemset(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmemset(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ymincore(tls *TLS, addr uintptr, len1 Tsize_t, vec uintptr) (r int32) +TEXT ·Ymincore(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ vec+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmincore(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymkdir(tls *TLS, path uintptr, mode Tmode_t) (r int32) +TEXT ·Ymkdir(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL mode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xmkdir(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymkdirat(tls *TLS, fd int32, path uintptr, mode Tmode_t) (r int32) +TEXT ·Ymkdirat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL mode+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xmkdirat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymkdtemp(tls *TLS, template uintptr) (r uintptr) +TEXT ·Ymkdtemp(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmkdtemp(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ymkfifo(tls *TLS, path uintptr, mode Tmode_t) (r int32) +TEXT ·Ymkfifo(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL mode+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xmkfifo(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymkfifoat(tls *TLS, fd int32, path uintptr, mode Tmode_t) (r int32) +TEXT ·Ymkfifoat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL mode+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xmkfifoat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymknod(tls *TLS, path uintptr, mode Tmode_t, dev Tdev_t) (r int32) +TEXT ·Ymknod(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL mode+16(FP), AX + MOVL AX, 16(SP) + MOVQ dev+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xmknod(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymknodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, dev Tdev_t) (r int32) +TEXT ·Ymknodat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL mode+24(FP), AX + MOVL AX, 24(SP) + MOVQ dev+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xmknodat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ymkostemp(tls *TLS, template uintptr, flags int32) (r int32) +TEXT ·Ymkostemp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xmkostemp(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymkostemps(tls *TLS, template uintptr, len1 int32, flags int32) (r int32) +TEXT ·Ymkostemps(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + MOVL len1+16(FP), AX + MOVL AX, 16(SP) + MOVL flags+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xmkostemps(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymkstemp(tls *TLS, template uintptr) (r int32) +TEXT ·Ymkstemp(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmkstemp(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ymkstemp64(tls *TLS, template uintptr) (r int32) +TEXT ·Ymkstemp64(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmkstemp64(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ymkstemps(tls *TLS, template uintptr, len1 int32) (r int32) +TEXT ·Ymkstemps(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + MOVL len1+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xmkstemps(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymkstemps64(tls *TLS, template uintptr, len1 int32) (r int32) +TEXT ·Ymkstemps64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + MOVL len1+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xmkstemps64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymktemp(tls *TLS, template uintptr) (r uintptr) +TEXT ·Ymktemp(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ template+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmktemp(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ymktime(tls *TLS, tm uintptr) (r Ttime_t) +TEXT ·Ymktime(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tm+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xmktime(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ymlock(tls *TLS, addr uintptr, len1 Tsize_t) (r int32) +TEXT ·Ymlock(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmlock(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymlock2(tls *TLS, addr uintptr, len1 Tsize_t, flags uint32) (r int32) +TEXT ·Ymlock2(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xmlock2(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymlockall(tls *TLS, flags int32) (r int32) +TEXT ·Ymlockall(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL flags+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xmlockall(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ymmap(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) +TEXT ·Ymmap(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ start+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL prot+24(FP), AX + MOVL AX, 24(SP) + MOVL flags+28(FP), AX + MOVL AX, 28(SP) + MOVL fd+32(FP), AX + MOVL AX, 32(SP) + MOVQ off+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xmmap(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ymmap64(tls *TLS, start uintptr, len1 Tsize_t, prot int32, flags int32, fd int32, off Toff_t) (r uintptr) +TEXT ·Ymmap64(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ start+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL prot+24(FP), AX + MOVL AX, 24(SP) + MOVL flags+28(FP), AX + MOVL AX, 28(SP) + MOVL fd+32(FP), AX + MOVL AX, 32(SP) + MOVQ off+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xmmap64(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ymodf(tls *TLS, x float64, iptr uintptr) (r float64) +TEXT ·Ymodf(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ iptr+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmodf(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ymodff(tls *TLS, x float32, iptr uintptr) (r float32) +TEXT ·Ymodff(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVQ iptr+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmodff(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymodfl(tls *TLS, x float64, iptr uintptr) (r1 float64) +TEXT ·Ymodfl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ iptr+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmodfl(SB) + MOVQ 24(SP), AX + MOVQ AX, r1+24(FP) + RET + +// func Ymount(tls *TLS, special uintptr, dir uintptr, fstype uintptr, flags uint64, data uintptr) (r int32) +TEXT ·Ymount(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ special+8(FP), AX + MOVQ AX, 8(SP) + MOVQ dir+16(FP), AX + MOVQ AX, 16(SP) + MOVQ fstype+24(FP), AX + MOVQ AX, 24(SP) + MOVQ flags+32(FP), AX + MOVQ AX, 32(SP) + MOVQ data+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xmount(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ymprotect(tls *TLS, addr uintptr, len1 Tsize_t, prot int32) (r int32) +TEXT ·Ymprotect(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL prot+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xmprotect(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymrand48(tls *TLS) (r int64) +TEXT ·Ymrand48(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xmrand48(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ymremap(tls *TLS, old_addr uintptr, old_len Tsize_t, new_len Tsize_t, flags int32, va uintptr) (r uintptr) +TEXT ·Ymremap(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ old_addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ old_len+16(FP), AX + MOVQ AX, 16(SP) + MOVQ new_len+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + MOVQ va+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xmremap(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ymsgctl(tls *TLS, q int32, cmd int32, buf uintptr) (r1 int32) +TEXT ·Ymsgctl(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL q+8(FP), AX + MOVL AX, 8(SP) + MOVL cmd+12(FP), AX + MOVL AX, 12(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmsgctl(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ymsgget(tls *TLS, k Tkey_t, flag int32) (r int32) +TEXT ·Ymsgget(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL k+8(FP), AX + MOVL AX, 8(SP) + MOVL flag+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xmsgget(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ymsgrcv(tls *TLS, q int32, m uintptr, len1 Tsize_t, type1 int64, flag int32) (r Tssize_t) +TEXT ·Ymsgrcv(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL q+8(FP), AX + MOVL AX, 8(SP) + MOVQ m+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVQ type1+32(FP), AX + MOVQ AX, 32(SP) + MOVL flag+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xmsgrcv(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ymsgsnd(tls *TLS, q int32, m uintptr, len1 Tsize_t, flag int32) (r int32) +TEXT ·Ymsgsnd(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL q+8(FP), AX + MOVL AX, 8(SP) + MOVQ m+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL flag+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xmsgsnd(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ymsync(tls *TLS, start uintptr, len1 Tsize_t, flags int32) (r int32) +TEXT ·Ymsync(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ start+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xmsync(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ymunlock(tls *TLS, addr uintptr, len1 Tsize_t) (r int32) +TEXT ·Ymunlock(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmunlock(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ymunlockall(tls *TLS) (r int32) +TEXT ·Ymunlockall(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xmunlockall(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ymunmap(tls *TLS, start uintptr, len1 Tsize_t) (r int32) +TEXT ·Ymunmap(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ start+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xmunmap(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yname_to_handle_at(tls *TLS, dirfd int32, pathname uintptr, handle uintptr, mount_id uintptr, flags int32) (r int32) +TEXT ·Yname_to_handle_at(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL dirfd+8(FP), AX + MOVL AX, 8(SP) + MOVQ pathname+16(FP), AX + MOVQ AX, 16(SP) + MOVQ handle+24(FP), AX + MOVQ AX, 24(SP) + MOVQ mount_id+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xname_to_handle_at(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ynan(tls *TLS, s uintptr) (r float64) +TEXT ·Ynan(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xnan(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ynanf(tls *TLS, s uintptr) (r float32) +TEXT ·Ynanf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xnanf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ynanl(tls *TLS, s uintptr) (r float64) +TEXT ·Ynanl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xnanl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ynanosleep(tls *TLS, req uintptr, rem uintptr) (r int32) +TEXT ·Ynanosleep(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ req+8(FP), AX + MOVQ AX, 8(SP) + MOVQ rem+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xnanosleep(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ynewlocale(tls *TLS, mask int32, name uintptr, loc Tlocale_t) (r Tlocale_t) +TEXT ·Ynewlocale(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL mask+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ loc+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xnewlocale(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ynextafter(tls *TLS, x3 float64, y3 float64) (r float64) +TEXT ·Ynextafter(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y3+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xnextafter(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ynextafterf(tls *TLS, x3 float32, y3 float32) (r float32) +TEXT ·Ynextafterf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + MOVL y3+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xnextafterf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ynextafterl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Ynextafterl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xnextafterl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ynexttoward(tls *TLS, x float64, y float64) (r float64) +TEXT ·Ynexttoward(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xnexttoward(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ynexttowardf(tls *TLS, x3 float32, y3 float64) (r float32) +TEXT ·Ynexttowardf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + MOVQ y3+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xnexttowardf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ynexttowardl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Ynexttowardl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xnexttowardl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ynftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) +TEXT ·Ynftw(SB),$48-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_fn+16(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_nftw_1(SB) // Create the closure for calling __ccgo_fp_fn + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 16(SP) + MOVL fd_limit+24(FP), AX + MOVL AX, 24(SP) + MOVL flags+28(FP), AX + MOVL AX, 28(SP) + CALL ·Xnftw(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_nftw_1(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVL _3+24(FP), AX + MOVL AX, 24(SP) + MOVQ _4+32(FP), AX + MOVQ AX, 32(SP) + MOVQ __ccgo_fp+40(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 40(SP), AX + MOVL AX, _5+48(FP) + RET + +// func Yngettext(tls *TLS, msgid1 uintptr, msgid2 uintptr, n uint64) (r uintptr) +TEXT ·Yngettext(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msgid1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ msgid2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xngettext(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ynice(tls *TLS, inc int32) (r int32) +TEXT ·Ynice(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL inc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xnice(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ynl_langinfo(tls *TLS, item Tnl_item) (r uintptr) +TEXT ·Ynl_langinfo(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL item+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xnl_langinfo(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ynl_langinfo_l(tls *TLS, item Tnl_item, loc Tlocale_t) (r uintptr) +TEXT ·Ynl_langinfo_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL item+8(FP), AX + MOVL AX, 8(SP) + MOVQ loc+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xnl_langinfo_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ynrand48(tls *TLS, s uintptr) (r int64) +TEXT ·Ynrand48(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xnrand48(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yns_get16(tls *TLS, cp uintptr) (r uint32) +TEXT ·Yns_get16(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ cp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xns_get16(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yns_get32(tls *TLS, cp uintptr) (r uint64) +TEXT ·Yns_get32(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ cp+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xns_get32(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yns_initparse(tls *TLS, msg uintptr, msglen int32, handle uintptr) (r1 int32) +TEXT ·Yns_initparse(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + MOVL msglen+16(FP), AX + MOVL AX, 16(SP) + MOVQ handle+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xns_initparse(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Yns_name_uncompress(tls *TLS, msg uintptr, eom uintptr, src uintptr, dst uintptr, dstsiz Tsize_t) (r1 int32) +TEXT ·Yns_name_uncompress(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + MOVQ eom+16(FP), AX + MOVQ AX, 16(SP) + MOVQ src+24(FP), AX + MOVQ AX, 24(SP) + MOVQ dst+32(FP), AX + MOVQ AX, 32(SP) + MOVQ dstsiz+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xns_name_uncompress(SB) + MOVL 48(SP), AX + MOVL AX, r1+48(FP) + RET + +// func Yns_parserr(tls *TLS, handle uintptr, section Tns_sect, rrnum int32, rr uintptr) (r1 int32) +TEXT ·Yns_parserr(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ handle+8(FP), AX + MOVQ AX, 8(SP) + MOVL section+16(FP), AX + MOVL AX, 16(SP) + MOVL rrnum+20(FP), AX + MOVL AX, 20(SP) + MOVQ rr+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xns_parserr(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Yns_put16(tls *TLS, s uint32, cp uintptr) +TEXT ·Yns_put16(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL s+8(FP), AX + MOVL AX, 8(SP) + MOVQ cp+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xns_put16(SB) + RET + +// func Yns_put32(tls *TLS, l uint64, cp uintptr) +TEXT ·Yns_put32(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ cp+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xns_put32(SB) + RET + +// func Yns_skiprr(tls *TLS, ptr uintptr, eom uintptr, section Tns_sect, count int32) (r1 int32) +TEXT ·Yns_skiprr(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ eom+16(FP), AX + MOVQ AX, 16(SP) + MOVL section+24(FP), AX + MOVL AX, 24(SP) + MOVL count+28(FP), AX + MOVL AX, 28(SP) + CALL ·Xns_skiprr(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Yntohl(tls *TLS, n Tuint32_t) (r Tuint32_t) +TEXT ·Yntohl(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xntohl(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yntohs(tls *TLS, n Tuint16_t) (r Tuint16_t) +TEXT ·Yntohs(SB),$24-18 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVW n+8(FP), AX + MOVW AX, 8(SP) + CALL ·Xntohs(SB) + MOVW 16(SP), AX + MOVW AX, r+16(FP) + RET + +// func Yobstack_free(t *TLS, obstack, obj uintptr) +TEXT ·Yobstack_free(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ obstack+8(FP), AX + MOVQ AX, 8(SP) + MOVQ obj+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xobstack_free(SB) + RET + +// func Yobstack_vprintf(t *TLS, obstack, template, va uintptr) (_2 int32) +TEXT ·Yobstack_vprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ obstack+8(FP), AX + MOVQ AX, 8(SP) + MOVQ template+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xobstack_vprintf(SB) + MOVL 32(SP), AX + MOVL AX, _2+32(FP) + RET + +// func Yopen(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) +TEXT ·Yopen(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xopen(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yopen64(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) +TEXT ·Yopen64(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xopen64(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yopen_by_handle_at(tls *TLS, mount_fd int32, handle uintptr, flags int32) (r int32) +TEXT ·Yopen_by_handle_at(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL mount_fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ handle+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xopen_by_handle_at(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yopen_memstream(tls *TLS, bufp uintptr, sizep uintptr) (r uintptr) +TEXT ·Yopen_memstream(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ bufp+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sizep+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xopen_memstream(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yopen_wmemstream(tls *TLS, bufp uintptr, sizep uintptr) (r uintptr) +TEXT ·Yopen_wmemstream(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ bufp+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sizep+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xopen_wmemstream(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yopenat(tls *TLS, fd int32, filename uintptr, flags int32, va uintptr) (r int32) +TEXT ·Yopenat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ filename+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + MOVQ va+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xopenat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yopendir(tls *TLS, name uintptr) (r uintptr) +TEXT ·Yopendir(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xopendir(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yopenlog(tls *TLS, ident uintptr, opt int32, facility int32) +TEXT ·Yopenlog(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ident+8(FP), AX + MOVQ AX, 8(SP) + MOVL opt+16(FP), AX + MOVL AX, 16(SP) + MOVL facility+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xopenlog(SB) + RET + +// func Yopenpty(tls *TLS, pm uintptr, ps uintptr, name uintptr, tio uintptr, ws uintptr) (r int32) +TEXT ·Yopenpty(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ pm+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ps+16(FP), AX + MOVQ AX, 16(SP) + MOVQ name+24(FP), AX + MOVQ AX, 24(SP) + MOVQ tio+32(FP), AX + MOVQ AX, 32(SP) + MOVQ ws+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xopenpty(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ypathconf(tls *TLS, path uintptr, name int32) (r int64) +TEXT ·Ypathconf(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL name+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xpathconf(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ypause(tls *TLS) (r int32) +TEXT ·Ypause(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xpause(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ypclose(tls *TLS, f uintptr) (r1 int32) +TEXT ·Ypclose(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpclose(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yperror(tls *TLS, msg uintptr) +TEXT ·Yperror(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ msg+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xperror(SB) + RET + +// func Ypersonality(tls *TLS, persona uint64) (r int32) +TEXT ·Ypersonality(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ persona+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpersonality(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ypipe(tls *TLS, fd uintptr) (r int32) +TEXT ·Ypipe(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fd+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpipe(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ypipe2(tls *TLS, fd uintptr, flag int32) (r int32) +TEXT ·Ypipe2(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fd+8(FP), AX + MOVQ AX, 8(SP) + MOVL flag+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xpipe2(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ypivot_root(tls *TLS, new1 uintptr, old uintptr) (r int32) +TEXT ·Ypivot_root(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ new1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ old+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpivot_root(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ypoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) +TEXT ·Ypoll(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fds+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVL timeout+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xpoll(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ypopen(t *TLS, command, type1 uintptr) (_2 uintptr) +TEXT ·Ypopen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ command+8(FP), AX + MOVQ AX, 8(SP) + MOVQ type1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpopen(SB) + MOVQ 24(SP), AX + MOVQ AX, _2+24(FP) + RET + +// func Yposix_close(tls *TLS, fd int32, flags int32) (r int32) +TEXT ·Yposix_close(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL flags+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xposix_close(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yposix_fadvise(tls *TLS, fd int32, base Toff_t, len1 Toff_t, advice int32) (r int32) +TEXT ·Yposix_fadvise(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ base+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL advice+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xposix_fadvise(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yposix_fallocate(tls *TLS, fd int32, base Toff_t, len1 Toff_t) (r int32) +TEXT ·Yposix_fallocate(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ base+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xposix_fallocate(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yposix_madvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32) +TEXT ·Yposix_madvise(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL advice+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xposix_madvise(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yposix_openpt(tls *TLS, flags int32) (r1 int32) +TEXT ·Yposix_openpt(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL flags+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xposix_openpt(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yposix_spawn_file_actions_addchdir_np(tls *TLS, fa uintptr, path uintptr) (r int32) +TEXT ·Yposix_spawn_file_actions_addchdir_np(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fa+8(FP), AX + MOVQ AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawn_file_actions_addchdir_np(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawn_file_actions_addclose(tls *TLS, fa uintptr, fd int32) (r int32) +TEXT ·Yposix_spawn_file_actions_addclose(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fa+8(FP), AX + MOVQ AX, 8(SP) + MOVL fd+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xposix_spawn_file_actions_addclose(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawn_file_actions_adddup2(tls *TLS, fa uintptr, srcfd int32, fd int32) (r int32) +TEXT ·Yposix_spawn_file_actions_adddup2(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fa+8(FP), AX + MOVQ AX, 8(SP) + MOVL srcfd+16(FP), AX + MOVL AX, 16(SP) + MOVL fd+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xposix_spawn_file_actions_adddup2(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawn_file_actions_addfchdir_np(tls *TLS, fa uintptr, fd int32) (r int32) +TEXT ·Yposix_spawn_file_actions_addfchdir_np(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fa+8(FP), AX + MOVQ AX, 8(SP) + MOVL fd+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xposix_spawn_file_actions_addfchdir_np(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawn_file_actions_addopen(tls *TLS, fa uintptr, fd int32, path uintptr, flags int32, mode Tmode_t) (r int32) +TEXT ·Yposix_spawn_file_actions_addopen(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fa+8(FP), AX + MOVQ AX, 8(SP) + MOVL fd+16(FP), AX + MOVL AX, 16(SP) + MOVQ path+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + MOVL mode+36(FP), AX + MOVL AX, 36(SP) + CALL ·Xposix_spawn_file_actions_addopen(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yposix_spawn_file_actions_destroy(tls *TLS, fa uintptr) (r int32) +TEXT ·Yposix_spawn_file_actions_destroy(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fa+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xposix_spawn_file_actions_destroy(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yposix_spawn_file_actions_init(tls *TLS, fa uintptr) (r int32) +TEXT ·Yposix_spawn_file_actions_init(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fa+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xposix_spawn_file_actions_init(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yposix_spawnattr_destroy(tls *TLS, attr uintptr) (r int32) +TEXT ·Yposix_spawnattr_destroy(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xposix_spawnattr_destroy(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yposix_spawnattr_getflags(tls *TLS, attr uintptr, flags uintptr) (r int32) +TEXT ·Yposix_spawnattr_getflags(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ flags+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_getflags(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_getpgroup(tls *TLS, attr uintptr, pgrp uintptr) (r int32) +TEXT ·Yposix_spawnattr_getpgroup(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ pgrp+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_getpgroup(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_getschedparam(tls *TLS, attr uintptr, schedparam uintptr) (r int32) +TEXT ·Yposix_spawnattr_getschedparam(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ schedparam+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_getschedparam(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_getschedpolicy(tls *TLS, attr uintptr, policy uintptr) (r int32) +TEXT ·Yposix_spawnattr_getschedpolicy(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ policy+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_getschedpolicy(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_getsigdefault(tls *TLS, attr uintptr, def uintptr) (r int32) +TEXT ·Yposix_spawnattr_getsigdefault(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ def+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_getsigdefault(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_getsigmask(tls *TLS, attr uintptr, mask uintptr) (r int32) +TEXT ·Yposix_spawnattr_getsigmask(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mask+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_getsigmask(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_init(tls *TLS, attr uintptr) (r int32) +TEXT ·Yposix_spawnattr_init(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xposix_spawnattr_init(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yposix_spawnattr_setflags(tls *TLS, attr uintptr, flags int16) (r int32) +TEXT ·Yposix_spawnattr_setflags(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVW flags+16(FP), AX + MOVW AX, 16(SP) + CALL ·Xposix_spawnattr_setflags(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_setpgroup(tls *TLS, attr uintptr, pgrp Tpid_t) (r int32) +TEXT ·Yposix_spawnattr_setpgroup(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVL pgrp+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xposix_spawnattr_setpgroup(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_setschedparam(tls *TLS, attr uintptr, schedparam uintptr) (r int32) +TEXT ·Yposix_spawnattr_setschedparam(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ schedparam+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_setschedparam(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_setschedpolicy(tls *TLS, attr uintptr, policy int32) (r int32) +TEXT ·Yposix_spawnattr_setschedpolicy(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVL policy+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xposix_spawnattr_setschedpolicy(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_setsigdefault(tls *TLS, attr uintptr, def uintptr) (r int32) +TEXT ·Yposix_spawnattr_setsigdefault(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ def+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_setsigdefault(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yposix_spawnattr_setsigmask(tls *TLS, attr uintptr, mask uintptr) (r int32) +TEXT ·Yposix_spawnattr_setsigmask(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ attr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mask+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xposix_spawnattr_setsigmask(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ypow(tls *TLS, x1 float64, y1 float64) (r float64) +TEXT ·Ypow(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpow(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ypow10(tls *TLS, x float64) (r float64) +TEXT ·Ypow10(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpow10(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ypow10f(tls *TLS, x float32) (r float32) +TEXT ·Ypow10f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xpow10f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ypow10l(tls *TLS, x float64) (r float64) +TEXT ·Ypow10l(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpow10l(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ypowf(tls *TLS, x1 float32, y1 float32) (r float32) +TEXT ·Ypowf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x1+8(FP), AX + MOVL AX, 8(SP) + MOVL y1+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xpowf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ypowl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Ypowl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpowl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32) +TEXT ·Yppoll(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fds+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ to+24(FP), AX + MOVQ AX, 24(SP) + MOVQ mask+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xppoll(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yprctl(tls *TLS, op int32, va uintptr) (r int32) +TEXT ·Yprctl(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL op+8(FP), AX + MOVL AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xprctl(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ypread(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssize_t) +TEXT ·Ypread(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ofs+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xpread(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ypreadv(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) +TEXT ·Ypreadv(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ iov+16(FP), AX + MOVQ AX, 16(SP) + MOVL count+24(FP), AX + MOVL AX, 24(SP) + MOVQ ofs+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xpreadv(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ypreadv2(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t, flags int32) (r Tssize_t) +TEXT ·Ypreadv2(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ iov+16(FP), AX + MOVQ AX, 16(SP) + MOVL count+24(FP), AX + MOVL AX, 24(SP) + MOVQ ofs+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xpreadv2(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Yprintf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Yprintf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xprintf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yprlimit(tls *TLS, pid Tpid_t, resource int32, new_limit uintptr, old_limit uintptr) (r1 int32) +TEXT ·Yprlimit(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVL resource+12(FP), AX + MOVL AX, 12(SP) + MOVQ new_limit+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old_limit+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xprlimit(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Yprocess_vm_readv(tls *TLS, pid Tpid_t, lvec uintptr, liovcnt uint64, rvec uintptr, riovcnt uint64, flags uint64) (r Tssize_t) +TEXT ·Yprocess_vm_readv(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVQ lvec+16(FP), AX + MOVQ AX, 16(SP) + MOVQ liovcnt+24(FP), AX + MOVQ AX, 24(SP) + MOVQ rvec+32(FP), AX + MOVQ AX, 32(SP) + MOVQ riovcnt+40(FP), AX + MOVQ AX, 40(SP) + MOVQ flags+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xprocess_vm_readv(SB) + MOVQ 56(SP), AX + MOVQ AX, r+56(FP) + RET + +// func Yprocess_vm_writev(tls *TLS, pid Tpid_t, lvec uintptr, liovcnt uint64, rvec uintptr, riovcnt uint64, flags uint64) (r Tssize_t) +TEXT ·Yprocess_vm_writev(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVQ lvec+16(FP), AX + MOVQ AX, 16(SP) + MOVQ liovcnt+24(FP), AX + MOVQ AX, 24(SP) + MOVQ rvec+32(FP), AX + MOVQ AX, 32(SP) + MOVQ riovcnt+40(FP), AX + MOVQ AX, 40(SP) + MOVQ flags+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xprocess_vm_writev(SB) + MOVQ 56(SP), AX + MOVQ AX, r+56(FP) + RET + +// func Ypselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r int32) +TEXT ·Ypselect(SB),$64-60 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + MOVQ rfds+16(FP), AX + MOVQ AX, 16(SP) + MOVQ wfds+24(FP), AX + MOVQ AX, 24(SP) + MOVQ efds+32(FP), AX + MOVQ AX, 32(SP) + MOVQ ts+40(FP), AX + MOVQ AX, 40(SP) + MOVQ mask+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xpselect(SB) + MOVL 56(SP), AX + MOVL AX, r+56(FP) + RET + +// func Ypsiginfo(tls *TLS, si uintptr, msg uintptr) +TEXT ·Ypsiginfo(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ si+8(FP), AX + MOVQ AX, 8(SP) + MOVQ msg+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpsiginfo(SB) + RET + +// func Ypsignal(tls *TLS, sig int32, msg uintptr) +TEXT ·Ypsignal(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sig+8(FP), AX + MOVL AX, 8(SP) + MOVQ msg+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpsignal(SB) + RET + +// func Ypthread_atfork(tls *TLS, prepare, parent, child uintptr) (_2 int32) +TEXT ·Ypthread_atfork(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ prepare+8(FP), AX + MOVQ AX, 8(SP) + MOVQ parent+16(FP), AX + MOVQ AX, 16(SP) + MOVQ child+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xpthread_atfork(SB) + MOVL 32(SP), AX + MOVL AX, _2+32(FP) + RET + +// func Ypthread_attr_destroy(tls *TLS, a uintptr) (_2 int32) +TEXT ·Ypthread_attr_destroy(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_attr_destroy(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) (_3 int32) +TEXT ·Ypthread_attr_getdetachstate(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ state+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_attr_getdetachstate(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ypthread_attr_init(tls *TLS, a uintptr) (_2 int32) +TEXT ·Ypthread_attr_init(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_attr_init(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) (r int32) +TEXT ·Ypthread_attr_setdetachstate(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVL state+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xpthread_attr_setdetachstate(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ypthread_attr_setscope(tls *TLS, a uintptr, scope int32) (_3 int32) +TEXT ·Ypthread_attr_setscope(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVL scope+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xpthread_attr_setscope(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ypthread_attr_setstacksize(tls *TLS, a uintptr, stacksite Tsize_t) (_3 int32) +TEXT ·Ypthread_attr_setstacksize(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ stacksite+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_attr_setstacksize(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ypthread_cleanup_pop(tls *TLS, run int32) +TEXT ·Ypthread_cleanup_pop(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL run+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xpthread_cleanup_pop(SB) + RET + +// func Ypthread_cleanup_push(tls *TLS, f, x uintptr) +TEXT ·Ypthread_cleanup_push(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ x+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_cleanup_push(SB) + RET + +// func Ypthread_cond_broadcast(tls *TLS, c uintptr) (_2 int32) +TEXT ·Ypthread_cond_broadcast(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ c+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_cond_broadcast(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_cond_destroy(tls *TLS, c uintptr) (_2 int32) +TEXT ·Ypthread_cond_destroy(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ c+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_cond_destroy(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_cond_init(tls *TLS, c, a uintptr) (_2 int32) +TEXT ·Ypthread_cond_init(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ c+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_cond_init(SB) + MOVL 24(SP), AX + MOVL AX, _2+24(FP) + RET + +// func Ypthread_cond_signal(tls *TLS, c uintptr) (_2 int32) +TEXT ·Ypthread_cond_signal(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ c+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_cond_signal(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_cond_timedwait(tls *TLS, c, m, ts uintptr) (r int32) +TEXT ·Ypthread_cond_timedwait(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ c+8(FP), AX + MOVQ AX, 8(SP) + MOVQ m+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ts+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xpthread_cond_timedwait(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ypthread_cond_wait(tls *TLS, c, m uintptr) (_2 int32) +TEXT ·Ypthread_cond_wait(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ c+8(FP), AX + MOVQ AX, 8(SP) + MOVQ m+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_cond_wait(SB) + MOVL 24(SP), AX + MOVL AX, _2+24(FP) + RET + +// func Ypthread_create(tls *TLS, res, attrp, entry, arg uintptr) (_2 int32) +TEXT ·Ypthread_create(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ res+8(FP), AX + MOVQ AX, 8(SP) + MOVQ attrp+16(FP), AX + MOVQ AX, 16(SP) + MOVQ entry+24(FP), AX + MOVQ AX, 24(SP) + MOVQ arg+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xpthread_create(SB) + MOVL 40(SP), AX + MOVL AX, _2+40(FP) + RET + +// func Ypthread_detach(tls *TLS, t uintptr) (_2 int32) +TEXT ·Ypthread_detach(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_detach(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_equal(tls *TLS, t, u uintptr) (_2 int32) +TEXT ·Ypthread_equal(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ u+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_equal(SB) + MOVL 24(SP), AX + MOVL AX, _2+24(FP) + RET + +// func Ypthread_exit(tls *TLS, result uintptr) +TEXT ·Ypthread_exit(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ result+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_exit(SB) + RET + +// func Ypthread_getspecific(tls *TLS, k Tpthread_key_t) (_2 uintptr) +TEXT ·Ypthread_getspecific(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL k+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xpthread_getspecific(SB) + MOVQ 16(SP), AX + MOVQ AX, _2+16(FP) + RET + +// func Ypthread_join(tls *TLS, t Tpthread_t, res uintptr) (r int32) +TEXT ·Ypthread_join(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ res+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_join(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ypthread_key_create(tls *TLS, k uintptr, dtor uintptr) (_3 int32) +TEXT ·Ypthread_key_create(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ k+8(FP), AX + MOVQ AX, 8(SP) + MOVQ dtor+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_key_create(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ypthread_key_delete(tls *TLS, k Tpthread_key_t) (_2 int32) +TEXT ·Ypthread_key_delete(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL k+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xpthread_key_delete(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_mutex_destroy(tls *TLS, m uintptr) (_2 int32) +TEXT ·Ypthread_mutex_destroy(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_mutex_destroy(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_mutex_init(tls *TLS, m, a uintptr) (_2 int32) +TEXT ·Ypthread_mutex_init(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + MOVQ a+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_mutex_init(SB) + MOVL 24(SP), AX + MOVL AX, _2+24(FP) + RET + +// func Ypthread_mutex_lock(tls *TLS, m uintptr) (_2 int32) +TEXT ·Ypthread_mutex_lock(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_mutex_lock(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_mutex_trylock(tls *TLS, m uintptr) (_2 int32) +TEXT ·Ypthread_mutex_trylock(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_mutex_trylock(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_mutex_unlock(tls *TLS, m uintptr) (_2 int32) +TEXT ·Ypthread_mutex_unlock(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ m+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_mutex_unlock(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_mutexattr_destroy(tls *TLS, a uintptr) (_2 int32) +TEXT ·Ypthread_mutexattr_destroy(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_mutexattr_destroy(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_mutexattr_init(tls *TLS, a uintptr) (_2 int32) +TEXT ·Ypthread_mutexattr_init(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpthread_mutexattr_init(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ypthread_mutexattr_settype(tls *TLS, a uintptr, typ int32) (_3 int32) +TEXT ·Ypthread_mutexattr_settype(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVL typ+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xpthread_mutexattr_settype(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ypthread_self(tls *TLS) (_1 uintptr) +TEXT ·Ypthread_self(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xpthread_self(SB) + MOVQ 8(SP), AX + MOVQ AX, _1+8(FP) + RET + +// func Ypthread_setcancelstate(tls *TLS, new int32, old uintptr) (_3 int32) +TEXT ·Ypthread_setcancelstate(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL new+8(FP), AX + MOVL AX, 8(SP) + MOVQ old+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_setcancelstate(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ypthread_setspecific(tls *TLS, k Tpthread_key_t, x uintptr) (_3 int32) +TEXT ·Ypthread_setspecific(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL k+8(FP), AX + MOVL AX, 8(SP) + MOVQ x+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xpthread_setspecific(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Ypthread_sigmask(tls *TLS, now int32, set, old uintptr) (_3 int32) +TEXT ·Ypthread_sigmask(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL now+8(FP), AX + MOVL AX, 8(SP) + MOVQ set+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xpthread_sigmask(SB) + MOVL 32(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Yptrace(tls *TLS, req int32, va uintptr) (r int64) +TEXT ·Yptrace(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL req+8(FP), AX + MOVL AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xptrace(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yptsname(tls *TLS, fd int32) (r uintptr) +TEXT ·Yptsname(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xptsname(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yptsname_r(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) +TEXT ·Yptsname_r(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xptsname_r(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yputc(tls *TLS, c1 int32, f1 uintptr) (r int32) +TEXT ·Yputc(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c1+8(FP), AX + MOVL AX, 8(SP) + MOVQ f1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputc(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yputc_unlocked(tls *TLS, c int32, f uintptr) (r int32) +TEXT ·Yputc_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputc_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yputchar(tls *TLS, c1 int32) (r int32) +TEXT ·Yputchar(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c1+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xputchar(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yputchar_unlocked(tls *TLS, c int32) (r int32) +TEXT ·Yputchar_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xputchar_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yputenv(tls *TLS, s uintptr) (r int32) +TEXT ·Yputenv(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xputenv(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yputgrent(tls *TLS, gr uintptr, f uintptr) (r1 int32) +TEXT ·Yputgrent(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ gr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputgrent(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Yputpwent(tls *TLS, pw uintptr, f uintptr) (r int32) +TEXT ·Yputpwent(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ pw+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputpwent(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yputs(tls *TLS, s uintptr) (r1 int32) +TEXT ·Yputs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xputs(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yputspent(tls *TLS, sp uintptr, f uintptr) (r int32) +TEXT ·Yputspent(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ sp+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputspent(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ypututline(tls *TLS, ut uintptr) (r uintptr) +TEXT ·Ypututline(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ut+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpututline(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ypututxline(tls *TLS, ut uintptr) (r uintptr) +TEXT ·Ypututxline(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ut+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xpututxline(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yputw(tls *TLS, _x int32, f uintptr) (r int32) +TEXT ·Yputw(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL _x+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputw(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yputwc(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +TEXT ·Yputwc(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputwc(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) +TEXT ·Yputwc_unlocked(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xputwc_unlocked(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yputwchar(tls *TLS, c Twchar_t) (r Twint_t) +TEXT ·Yputwchar(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xputwchar(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yputwchar_unlocked(tls *TLS, c Twchar_t) (r Twint_t) +TEXT ·Yputwchar_unlocked(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xputwchar_unlocked(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ypwrite(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssize_t) +TEXT ·Ypwrite(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ofs+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xpwrite(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ypwritev(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) +TEXT ·Ypwritev(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ iov+16(FP), AX + MOVQ AX, 16(SP) + MOVL count+24(FP), AX + MOVL AX, 24(SP) + MOVQ ofs+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xpwritev(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ypwritev2(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t, flags int32) (r Tssize_t) +TEXT ·Ypwritev2(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ iov+16(FP), AX + MOVQ AX, 16(SP) + MOVL count+24(FP), AX + MOVL AX, 24(SP) + MOVQ ofs+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xpwritev2(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Yqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) +TEXT ·Yqsort(SB),$48-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+32(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_qsort_3(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ base+8(FP), AX + MOVQ AX, 8(SP) + MOVQ nel+16(FP), AX + MOVQ AX, 16(SP) + MOVQ width+24(FP), AX + MOVQ AX, 24(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 32(SP) + CALL ·Xqsort(SB) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_qsort_3(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Yqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) +TEXT ·Yqsort_r(SB),$56-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+32(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_qsort_r_3(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ base+8(FP), AX + MOVQ AX, 8(SP) + MOVQ nel+16(FP), AX + MOVQ AX, 16(SP) + MOVQ width+24(FP), AX + MOVQ AX, 24(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 32(SP) + MOVQ arg+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xqsort_r(SB) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_qsort_r_3(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ _3+24(FP), AX + MOVQ AX, 24(SP) + MOVQ __ccgo_fp+32(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 32(SP), AX + MOVL AX, _4+40(FP) + RET + +// func Yquick_exit(tls *TLS, code int32) +TEXT ·Yquick_exit(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL code+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xquick_exit(SB) + RET + +// func Yquotactl(tls *TLS, cmd int32, special uintptr, id int32, addr uintptr) (r int32) +TEXT ·Yquotactl(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL cmd+8(FP), AX + MOVL AX, 8(SP) + MOVQ special+16(FP), AX + MOVQ AX, 16(SP) + MOVL id+24(FP), AX + MOVL AX, 24(SP) + MOVQ addr+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xquotactl(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yraise(tls *TLS, sig int32) (r int32) +TEXT ·Yraise(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sig+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xraise(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yrand(tls *TLS) (r int32) +TEXT ·Yrand(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xrand(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yrand_r(tls *TLS, seed uintptr) (r int32) +TEXT ·Yrand_r(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ seed+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xrand_r(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yrandom(tls *TLS) (r int64) +TEXT ·Yrandom(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xrandom(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Yrandom_r(t *TLS, buf, result uintptr) (_2 int32) +TEXT ·Yrandom_r(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + MOVQ result+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xrandom_r(SB) + MOVL 24(SP), AX + MOVL AX, _2+24(FP) + RET + +// func Yread(tls *TLS, fd int32, buf uintptr, count Tsize_t) (r Tssize_t) +TEXT ·Yread(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ count+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xread(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yreadahead(tls *TLS, fd int32, pos Toff_t, len1 Tsize_t) (r Tssize_t) +TEXT ·Yreadahead(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ pos+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xreadahead(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yreaddir(tls *TLS, dir uintptr) (r uintptr) +TEXT ·Yreaddir(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xreaddir(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yreaddir64(tls *TLS, dir uintptr) (r uintptr) +TEXT ·Yreaddir64(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xreaddir64(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yreaddir_r(tls *TLS, dir uintptr, buf uintptr, result uintptr) (r int32) +TEXT ·Yreaddir_r(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ result+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xreaddir_r(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yreadlink(tls *TLS, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_t) +TEXT ·Yreadlink(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ bufsize+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xreadlink(SB) + MOVQ 32(SP), AX + MOVQ AX, r1+32(FP) + RET + +// func Yreadlinkat(tls *TLS, fd int32, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_t) +TEXT ·Yreadlinkat(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ bufsize+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xreadlinkat(SB) + MOVQ 40(SP), AX + MOVQ AX, r1+40(FP) + RET + +// func Yreadv(tls *TLS, fd int32, iov uintptr, count int32) (r Tssize_t) +TEXT ·Yreadv(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ iov+16(FP), AX + MOVQ AX, 16(SP) + MOVL count+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xreadv(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yrealloc(tls *TLS, p uintptr, n Tsize_t) (r uintptr) +TEXT ·Yrealloc(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xrealloc(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yreallocarray(tls *TLS, ptr uintptr, m Tsize_t, n Tsize_t) (r uintptr) +TEXT ·Yreallocarray(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ptr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ m+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xreallocarray(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yrealpath(tls *TLS, filename uintptr, resolved uintptr) (r uintptr) +TEXT ·Yrealpath(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ filename+8(FP), AX + MOVQ AX, 8(SP) + MOVQ resolved+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xrealpath(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yreboot(tls *TLS, type1 int32) (r int32) +TEXT ·Yreboot(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL type1+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xreboot(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yrecv(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32) (r Tssize_t) +TEXT ·Yrecv(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xrecv(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yrecvfrom(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr uintptr, alen uintptr) (r1 Tssize_t) +TEXT ·Yrecvfrom(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + MOVQ addr+40(FP), AX + MOVQ AX, 40(SP) + MOVQ alen+48(FP), AX + MOVQ AX, 48(SP) + CALL ·Xrecvfrom(SB) + MOVQ 56(SP), AX + MOVQ AX, r1+56(FP) + RET + +// func Yrecvmmsg(tls *TLS, fd int32, msgvec uintptr, vlen uint32, flags uint32, timeout uintptr) (r int32) +TEXT ·Yrecvmmsg(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ msgvec+16(FP), AX + MOVQ AX, 16(SP) + MOVL vlen+24(FP), AX + MOVL AX, 24(SP) + MOVL flags+28(FP), AX + MOVL AX, 28(SP) + MOVQ timeout+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xrecvmmsg(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yrecvmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r2 Tssize_t) +TEXT ·Yrecvmsg(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ msg+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xrecvmsg(SB) + MOVQ 32(SP), AX + MOVQ AX, r2+32(FP) + RET + +// func Yregcomp(tls *TLS, preg uintptr, regex uintptr, cflags int32) (r int32) +TEXT ·Yregcomp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ preg+8(FP), AX + MOVQ AX, 8(SP) + MOVQ regex+16(FP), AX + MOVQ AX, 16(SP) + MOVL cflags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xregcomp(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yregerror(tls *TLS, e int32, preg uintptr, buf uintptr, size Tsize_t) (r Tsize_t) +TEXT ·Yregerror(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL e+8(FP), AX + MOVL AX, 8(SP) + MOVQ preg+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buf+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xregerror(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yregexec(tls *TLS, preg uintptr, string1 uintptr, nmatch Tsize_t, pmatch uintptr, eflags int32) (r int32) +TEXT ·Yregexec(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ preg+8(FP), AX + MOVQ AX, 8(SP) + MOVQ string1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ nmatch+24(FP), AX + MOVQ AX, 24(SP) + MOVQ pmatch+32(FP), AX + MOVQ AX, 32(SP) + MOVL eflags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xregexec(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Yregfree(tls *TLS, preg uintptr) +TEXT ·Yregfree(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ preg+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xregfree(SB) + RET + +// func Yremainder(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yremainder(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xremainder(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yremainderf(tls *TLS, x float32, y float32) (r float32) +TEXT ·Yremainderf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xremainderf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yremainderl(tls *TLS, x float64, y float64) (r float64) +TEXT ·Yremainderl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xremainderl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yremap_file_pages(tls *TLS, addr uintptr, size Tsize_t, prot int32, pgoff Tsize_t, flags int32) (r int32) +TEXT ·Yremap_file_pages(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVL prot+24(FP), AX + MOVL AX, 24(SP) + MOVQ pgoff+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xremap_file_pages(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Yremove(tls *TLS, path uintptr) (r1 int32) +TEXT ·Yremove(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xremove(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Yremovexattr(tls *TLS, path uintptr, name uintptr) (r int32) +TEXT ·Yremovexattr(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xremovexattr(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yremque(tls *TLS, element uintptr) +TEXT ·Yremque(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ element+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xremque(SB) + RET + +// func Yremquo(tls *TLS, x float64, y float64, quo uintptr) (r float64) +TEXT ·Yremquo(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVQ quo+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xremquo(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) +TEXT ·Yremquof(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL y+12(FP), AX + MOVL AX, 12(SP) + MOVQ quo+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xremquof(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yremquol(tls *TLS, x float64, y float64, quo uintptr) (r float64) +TEXT ·Yremquol(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ y+16(FP), AX + MOVQ AX, 16(SP) + MOVQ quo+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xremquol(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yrename(tls *TLS, old uintptr, new1 uintptr) (r int32) +TEXT ·Yrename(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ old+8(FP), AX + MOVQ AX, 8(SP) + MOVQ new1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xrename(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yrenameat(tls *TLS, oldfd int32, old uintptr, newfd int32, new1 uintptr) (r int32) +TEXT ·Yrenameat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL oldfd+8(FP), AX + MOVL AX, 8(SP) + MOVQ old+16(FP), AX + MOVQ AX, 16(SP) + MOVL newfd+24(FP), AX + MOVL AX, 24(SP) + MOVQ new1+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xrenameat(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yrenameat2(t *TLS, olddirfd int32, oldpath uintptr, newdirfd int32, newpath uintptr, flags int32) (_6 int32) +TEXT ·Yrenameat2(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVL olddirfd+8(FP), AX + MOVL AX, 8(SP) + MOVQ oldpath+16(FP), AX + MOVQ AX, 16(SP) + MOVL newdirfd+24(FP), AX + MOVL AX, 24(SP) + MOVQ newpath+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xrenameat2(SB) + MOVL 48(SP), AX + MOVL AX, _6+48(FP) + RET + +// func Yres_init(tls *TLS) (r int32) +TEXT ·Yres_init(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xres_init(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yres_mkquery(tls *TLS, op int32, dname uintptr, class int32, type1 int32, data uintptr, datalen int32, newrr uintptr, buf uintptr, buflen int32) (r int32) +TEXT ·Yres_mkquery(SB),$80-76 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL op+8(FP), AX + MOVL AX, 8(SP) + MOVQ dname+16(FP), AX + MOVQ AX, 16(SP) + MOVL class+24(FP), AX + MOVL AX, 24(SP) + MOVL type1+28(FP), AX + MOVL AX, 28(SP) + MOVQ data+32(FP), AX + MOVQ AX, 32(SP) + MOVL datalen+40(FP), AX + MOVL AX, 40(SP) + MOVQ newrr+48(FP), AX + MOVQ AX, 48(SP) + MOVQ buf+56(FP), AX + MOVQ AX, 56(SP) + MOVL buflen+64(FP), AX + MOVL AX, 64(SP) + CALL ·Xres_mkquery(SB) + MOVL 72(SP), AX + MOVL AX, r+72(FP) + RET + +// func Yres_send(tls *TLS, _msg uintptr, _msglen int32, _answer uintptr, _anslen int32) (r int32) +TEXT ·Yres_send(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _msg+8(FP), AX + MOVQ AX, 8(SP) + MOVL _msglen+16(FP), AX + MOVL AX, 16(SP) + MOVQ _answer+24(FP), AX + MOVQ AX, 24(SP) + MOVL _anslen+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xres_send(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yrewind(tls *TLS, f uintptr) +TEXT ·Yrewind(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xrewind(SB) + RET + +// func Yrewinddir(tls *TLS, dir uintptr) +TEXT ·Yrewinddir(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xrewinddir(SB) + RET + +// func Yrindex(tls *TLS, s uintptr, c int32) (r uintptr) +TEXT ·Yrindex(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xrindex(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yrint(tls *TLS, x float64) (r float64) +TEXT ·Yrint(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xrint(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yrintf(tls *TLS, x float32) (r float32) +TEXT ·Yrintf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xrintf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yrintl(tls *TLS, x float64) (r float64) +TEXT ·Yrintl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xrintl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yrmdir(tls *TLS, path uintptr) (r int32) +TEXT ·Yrmdir(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xrmdir(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yround(tls *TLS, x3 float64) (r float64) +TEXT ·Yround(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xround(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yroundf(tls *TLS, x3 float32) (r float32) +TEXT ·Yroundf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xroundf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yroundl(tls *TLS, x float64) (r float64) +TEXT ·Yroundl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xroundl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysbrk(tls *TLS, inc Tintptr_t) (r uintptr) +TEXT ·Ysbrk(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ inc+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsbrk(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yscalb(tls *TLS, x float64, fn float64) (r float64) +TEXT ·Yscalb(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fn+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xscalb(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yscalbf(tls *TLS, x float32, fn float32) (r float32) +TEXT ·Yscalbf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL fn+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xscalbf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yscalbln(tls *TLS, x float64, n int64) (r float64) +TEXT ·Yscalbln(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xscalbln(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yscalblnf(tls *TLS, x float32, n int64) (r float32) +TEXT ·Yscalblnf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xscalblnf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yscalblnl(tls *TLS, x float64, n int64) (r float64) +TEXT ·Yscalblnl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xscalblnl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yscalbn(tls *TLS, x float64, n int32) (r float64) +TEXT ·Yscalbn(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xscalbn(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yscalbnf(tls *TLS, x float32, n int32) (r float32) +TEXT ·Yscalbnf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + MOVL n+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xscalbnf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yscalbnl(tls *TLS, x float64, n int32) (r float64) +TEXT ·Yscalbnl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVL n+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xscalbnl(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yscandir(tls *TLS, path uintptr, res uintptr, __ccgo_fp_sel uintptr, __ccgo_fp_cmp uintptr) (r int32) +TEXT ·Yscandir(SB),$56-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $32, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_sel+24(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_scandir_2(SB) // Create the closure for calling __ccgo_fp_sel + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $16, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+32(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_scandir_3(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ res+16(FP), AX + MOVQ AX, 16(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 24(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $16, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 32(SP) + CALL ·Xscandir(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_scandir_2(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ __ccgo_fp+16(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 16(SP), AX + MOVL AX, _2+24(FP) + RET + +TEXT ·__ccgo_abi0_scandir_3(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Yscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Yscanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xscanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysched_yield(tls *TLS) (_1 int32) +TEXT ·Ysched_yield(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsched_yield(SB) + MOVL 8(SP), AX + MOVL AX, _1+8(FP) + RET + +// func Ysecure_getenv(tls *TLS, name uintptr) (r uintptr) +TEXT ·Ysecure_getenv(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsecure_getenv(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yseed48(tls *TLS, s uintptr) (r uintptr) +TEXT ·Yseed48(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xseed48(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yseekdir(tls *TLS, dir uintptr, off int64) +TEXT ·Yseekdir(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + MOVQ off+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xseekdir(SB) + RET + +// func Yselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r int32) +TEXT ·Yselect(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + MOVQ rfds+16(FP), AX + MOVQ AX, 16(SP) + MOVQ wfds+24(FP), AX + MOVQ AX, 24(SP) + MOVQ efds+32(FP), AX + MOVQ AX, 32(SP) + MOVQ tv+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xselect(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Ysemctl(tls *TLS, id int32, num int32, cmd int32, va uintptr) (r1 int32) +TEXT ·Ysemctl(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL id+8(FP), AX + MOVL AX, 8(SP) + MOVL num+12(FP), AX + MOVL AX, 12(SP) + MOVL cmd+16(FP), AX + MOVL AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsemctl(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ysemget(tls *TLS, key Tkey_t, n int32, fl int32) (r int32) +TEXT ·Ysemget(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL key+8(FP), AX + MOVL AX, 8(SP) + MOVL n+12(FP), AX + MOVL AX, 12(SP) + MOVL fl+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xsemget(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysemop(tls *TLS, id int32, buf uintptr, n Tsize_t) (r int32) +TEXT ·Ysemop(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL id+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsemop(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r int32) +TEXT ·Ysemtimedop(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL id+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ts+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xsemtimedop(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ysend(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32) (r Tssize_t) +TEXT ·Ysend(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xsend(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ysendfile(tls *TLS, out_fd int32, in_fd int32, ofs uintptr, count Tsize_t) (r Tssize_t) +TEXT ·Ysendfile(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL out_fd+8(FP), AX + MOVL AX, 8(SP) + MOVL in_fd+12(FP), AX + MOVL AX, 12(SP) + MOVQ ofs+16(FP), AX + MOVQ AX, 16(SP) + MOVQ count+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsendfile(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ysendmmsg(tls *TLS, fd int32, msgvec uintptr, vlen uint32, flags uint32) (r1 int32) +TEXT ·Ysendmmsg(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ msgvec+16(FP), AX + MOVQ AX, 16(SP) + MOVL vlen+24(FP), AX + MOVL AX, 24(SP) + MOVL flags+28(FP), AX + MOVL AX, 28(SP) + CALL ·Xsendmmsg(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ysendmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r1 Tssize_t) +TEXT ·Ysendmsg(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ msg+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xsendmsg(SB) + MOVQ 32(SP), AX + MOVQ AX, r1+32(FP) + RET + +// func Ysendto(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr uintptr, alen Tsocklen_t) (r1 Tssize_t) +TEXT ·Ysendto(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + MOVQ addr+40(FP), AX + MOVQ AX, 40(SP) + MOVL alen+48(FP), AX + MOVL AX, 48(SP) + CALL ·Xsendto(SB) + MOVQ 56(SP), AX + MOVQ AX, r1+56(FP) + RET + +// func Ysetbuf(tls *TLS, f uintptr, buf uintptr) +TEXT ·Ysetbuf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsetbuf(SB) + RET + +// func Ysetbuffer(tls *TLS, f uintptr, buf uintptr, size Tsize_t) +TEXT ·Ysetbuffer(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsetbuffer(SB) + RET + +// func Ysetdomainname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +TEXT ·Ysetdomainname(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsetdomainname(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) (r int32) +TEXT ·Ysetenv(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ var1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ value+16(FP), AX + MOVQ AX, 16(SP) + MOVL overwrite+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xsetenv(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysetfsgid(tls *TLS, gid Tgid_t) (r int32) +TEXT ·Ysetfsgid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL gid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetfsgid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysetfsuid(tls *TLS, uid Tuid_t) (r int32) +TEXT ·Ysetfsuid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL uid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetfsuid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysetgid(tls *TLS, gid Tgid_t) (r int32) +TEXT ·Ysetgid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL gid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetgid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysetgrent(tls *TLS) +TEXT ·Ysetgrent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetgrent(SB) + RET + +// func Ysethostent(tls *TLS, x int32) +TEXT ·Ysethostent(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsethostent(SB) + RET + +// func Ysethostname(tls *TLS, name uintptr, len1 Tsize_t) (r int32) +TEXT ·Ysethostname(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsethostname(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysetitimer(tls *TLS, which int32, new1 uintptr, old uintptr) (r1 int32) +TEXT ·Ysetitimer(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL which+8(FP), AX + MOVL AX, 8(SP) + MOVQ new1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsetitimer(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ysetjmp(t *TLS, env uintptr) (_2 int32) +TEXT ·Ysetjmp(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ env+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsetjmp(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ysetkey(tls *TLS, key uintptr) +TEXT ·Ysetkey(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsetkey(SB) + RET + +// func Ysetlinebuf(tls *TLS, f uintptr) +TEXT ·Ysetlinebuf(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsetlinebuf(SB) + RET + +// func Ysetlocale(tls *TLS, cat int32, name uintptr) (r uintptr) +TEXT ·Ysetlocale(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL cat+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsetlocale(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ysetlogmask(tls *TLS, maskpri int32) (r int32) +TEXT ·Ysetlogmask(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL maskpri+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetlogmask(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysetmntent(tls *TLS, name uintptr, mode uintptr) (r uintptr) +TEXT ·Ysetmntent(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ mode+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsetmntent(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ysetnetent(tls *TLS, x int32) +TEXT ·Ysetnetent(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetnetent(SB) + RET + +// func Ysetns(tls *TLS, fd int32, nstype int32) (r int32) +TEXT ·Ysetns(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL nstype+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xsetns(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysetpgid(tls *TLS, pid Tpid_t, pgid Tpid_t) (r int32) +TEXT ·Ysetpgid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVL pgid+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xsetpgid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysetpgrp(tls *TLS) (r Tpid_t) +TEXT ·Ysetpgrp(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetpgrp(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ysetpriority(tls *TLS, which int32, who Tid_t, prio int32) (r int32) +TEXT ·Ysetpriority(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL which+8(FP), AX + MOVL AX, 8(SP) + MOVL who+12(FP), AX + MOVL AX, 12(SP) + MOVL prio+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xsetpriority(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysetprotoent(tls *TLS, stayopen int32) +TEXT ·Ysetprotoent(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL stayopen+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetprotoent(SB) + RET + +// func Ysetpwent(tls *TLS) +TEXT ·Ysetpwent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetpwent(SB) + RET + +// func Ysetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) +TEXT ·Ysetrlimit(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL resource+8(FP), AX + MOVL AX, 8(SP) + MOVQ rlim+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsetrlimit(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysetrlimit64(tls *TLS, resource int32, rlim uintptr) (r int32) +TEXT ·Ysetrlimit64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL resource+8(FP), AX + MOVL AX, 8(SP) + MOVQ rlim+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsetrlimit64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysetservent(tls *TLS, stayopen int32) +TEXT ·Ysetservent(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL stayopen+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetservent(SB) + RET + +// func Ysetsid(tls *TLS) (r Tpid_t) +TEXT ·Ysetsid(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetsid(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Ysetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, optlen Tsocklen_t) (r2 int32) +TEXT ·Ysetsockopt(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL level+12(FP), AX + MOVL AX, 12(SP) + MOVL optname+16(FP), AX + MOVL AX, 16(SP) + MOVQ optval+24(FP), AX + MOVQ AX, 24(SP) + MOVL optlen+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xsetsockopt(SB) + MOVL 40(SP), AX + MOVL AX, r2+40(FP) + RET + +// func Ysetspent(tls *TLS) +TEXT ·Ysetspent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetspent(SB) + RET + +// func Ysetstate(tls *TLS, state uintptr) (r uintptr) +TEXT ·Ysetstate(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ state+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsetstate(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysettimeofday(tls *TLS, tv uintptr, tz uintptr) (r int32) +TEXT ·Ysettimeofday(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tv+8(FP), AX + MOVQ AX, 8(SP) + MOVQ tz+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsettimeofday(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysetuid(tls *TLS, uid Tuid_t) (r int32) +TEXT ·Ysetuid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL uid+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsetuid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysetusershell(tls *TLS) +TEXT ·Ysetusershell(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetusershell(SB) + RET + +// func Ysetutent(tls *TLS) +TEXT ·Ysetutent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetutent(SB) + RET + +// func Ysetutxent(tls *TLS) +TEXT ·Ysetutxent(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsetutxent(SB) + RET + +// func Ysetvbuf(tls *TLS, f uintptr, buf uintptr, type1 int32, size Tsize_t) (r int32) +TEXT ·Ysetvbuf(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVL type1+24(FP), AX + MOVL AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xsetvbuf(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ysetxattr(tls *TLS, path uintptr, name uintptr, value uintptr, size Tsize_t, flags int32) (r int32) +TEXT ·Ysetxattr(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ value+24(FP), AX + MOVQ AX, 24(SP) + MOVQ size+32(FP), AX + MOVQ AX, 32(SP) + MOVL flags+40(FP), AX + MOVL AX, 40(SP) + CALL ·Xsetxattr(SB) + MOVL 48(SP), AX + MOVL AX, r+48(FP) + RET + +// func Yshm_open(tls *TLS, name uintptr, flag int32, mode Tmode_t) (r int32) +TEXT ·Yshm_open(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVL flag+16(FP), AX + MOVL AX, 16(SP) + MOVL mode+20(FP), AX + MOVL AX, 20(SP) + CALL ·Xshm_open(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yshm_unlink(tls *TLS, name uintptr) (r int32) +TEXT ·Yshm_unlink(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xshm_unlink(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yshmat(tls *TLS, id int32, addr uintptr, flag int32) (r uintptr) +TEXT ·Yshmat(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL id+8(FP), AX + MOVL AX, 8(SP) + MOVQ addr+16(FP), AX + MOVQ AX, 16(SP) + MOVL flag+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xshmat(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Yshmctl(tls *TLS, id int32, cmd int32, buf uintptr) (r1 int32) +TEXT ·Yshmctl(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL id+8(FP), AX + MOVL AX, 8(SP) + MOVL cmd+12(FP), AX + MOVL AX, 12(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xshmctl(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Yshmdt(tls *TLS, addr uintptr) (r int32) +TEXT ·Yshmdt(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ addr+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xshmdt(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yshmget(tls *TLS, key Tkey_t, size Tsize_t, flag int32) (r int32) +TEXT ·Yshmget(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL key+8(FP), AX + MOVL AX, 8(SP) + MOVQ size+16(FP), AX + MOVQ AX, 16(SP) + MOVL flag+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xshmget(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yshutdown(tls *TLS, fd int32, how int32) (r1 int32) +TEXT ·Yshutdown(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL how+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xshutdown(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ysigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r int32) +TEXT ·Ysigaction(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL sig+8(FP), AX + MOVL AX, 8(SP) + MOVQ sa+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsigaction(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysigaddset(tls *TLS, set uintptr, sig int32) (r int32) +TEXT ·Ysigaddset(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + MOVL sig+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xsigaddset(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) +TEXT ·Ysigaltstack(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ss+8(FP), AX + MOVQ AX, 8(SP) + MOVQ old+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsigaltstack(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) +TEXT ·Ysigandset(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ left+16(FP), AX + MOVQ AX, 16(SP) + MOVQ right+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsigandset(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ysigdelset(tls *TLS, set uintptr, sig int32) (r int32) +TEXT ·Ysigdelset(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + MOVL sig+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xsigdelset(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysigemptyset(tls *TLS, set uintptr) (r int32) +TEXT ·Ysigemptyset(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsigemptyset(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysigfillset(tls *TLS, set uintptr) (r int32) +TEXT ·Ysigfillset(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsigfillset(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysigisemptyset(tls *TLS, set uintptr) (r int32) +TEXT ·Ysigisemptyset(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsigisemptyset(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysigismember(tls *TLS, set uintptr, sig int32) (r int32) +TEXT ·Ysigismember(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + MOVL sig+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xsigismember(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysignal(tls *TLS, signum int32, handler uintptr) (r uintptr) +TEXT ·Ysignal(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL signum+8(FP), AX + MOVL AX, 8(SP) + MOVQ handler+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsignal(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ysignalfd(tls *TLS, fd int32, sigs uintptr, flags int32) (r int32) +TEXT ·Ysignalfd(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ sigs+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xsignalfd(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysignificand(tls *TLS, x float64) (r float64) +TEXT ·Ysignificand(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsignificand(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysignificandf(tls *TLS, x float32) (r float32) +TEXT ·Ysignificandf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsignificandf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysigorset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) +TEXT ·Ysigorset(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ left+16(FP), AX + MOVQ AX, 16(SP) + MOVQ right+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsigorset(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ysigpending(tls *TLS, set uintptr) (r int32) +TEXT ·Ysigpending(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ set+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsigpending(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysigprocmask(tls *TLS, how int32, set uintptr, old uintptr) (r1 int32) +TEXT ·Ysigprocmask(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL how+8(FP), AX + MOVL AX, 8(SP) + MOVQ set+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsigprocmask(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ysigqueue(tls *TLS, pid Tpid_t, sig int32, value Tsigval) (r1 int32) +TEXT ·Ysigqueue(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVL sig+12(FP), AX + MOVL AX, 12(SP) + MOVL value_Fsival_int+16(FP), AX + MOVL AX, 16(SP) + MOVB value_F__ccgo_pad2_0+20(FP), AX + MOVB AX, 20(SP) + MOVB value_F__ccgo_pad2_1+21(FP), AX + MOVB AX, 21(SP) + MOVB value_F__ccgo_pad2_2+22(FP), AX + MOVB AX, 22(SP) + MOVB value_F__ccgo_pad2_3+23(FP), AX + MOVB AX, 23(SP) + CALL ·Xsigqueue(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ysigsuspend(tls *TLS, mask uintptr) (r int32) +TEXT ·Ysigsuspend(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mask+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsigsuspend(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysigtimedwait(tls *TLS, mask uintptr, si uintptr, timeout uintptr) (r int32) +TEXT ·Ysigtimedwait(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mask+8(FP), AX + MOVQ AX, 8(SP) + MOVQ si+16(FP), AX + MOVQ AX, 16(SP) + MOVQ timeout+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsigtimedwait(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysigwait(tls *TLS, mask uintptr, sig uintptr) (r int32) +TEXT ·Ysigwait(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mask+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sig+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsigwait(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysigwaitinfo(tls *TLS, mask uintptr, si uintptr) (r int32) +TEXT ·Ysigwaitinfo(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ mask+8(FP), AX + MOVQ AX, 8(SP) + MOVQ si+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsigwaitinfo(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysin(tls *TLS, x3 float64) (r float64) +TEXT ·Ysin(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsin(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysincos(tls *TLS, x3 float64, sin uintptr, cos uintptr) +TEXT ·Ysincos(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sin+16(FP), AX + MOVQ AX, 16(SP) + MOVQ cos+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsincos(SB) + RET + +// func Ysincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) +TEXT ·Ysincosf(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + MOVQ sin+16(FP), AX + MOVQ AX, 16(SP) + MOVQ cos+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsincosf(SB) + RET + +// func Ysincosl(tls *TLS, x float64, sin uintptr, cos uintptr) +TEXT ·Ysincosl(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sin+16(FP), AX + MOVQ AX, 16(SP) + MOVQ cos+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsincosl(SB) + RET + +// func Ysinf(tls *TLS, x3 float32) (r float32) +TEXT ·Ysinf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsinf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysinh(tls *TLS, x float64) (r float64) +TEXT ·Ysinh(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsinh(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysinhf(tls *TLS, x float32) (r float32) +TEXT ·Ysinhf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsinhf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysinhl(tls *TLS, x float64) (r float64) +TEXT ·Ysinhl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsinhl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysinl(tls *TLS, x float64) (r float64) +TEXT ·Ysinl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsinl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysleep(tls *TLS, seconds uint32) (r uint32) +TEXT ·Ysleep(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL seconds+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsleep(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysnprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r int32) +TEXT ·Ysnprintf(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ fmt+24(FP), AX + MOVQ AX, 24(SP) + MOVQ va+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xsnprintf(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ysockatmark(tls *TLS, s int32) (r int32) +TEXT ·Ysockatmark(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL s+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsockatmark(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysocket(tls *TLS, domain int32, type1 int32, protocol int32) (r1 int32) +TEXT ·Ysocket(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL domain+8(FP), AX + MOVL AX, 8(SP) + MOVL type1+12(FP), AX + MOVL AX, 12(SP) + MOVL protocol+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xsocket(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ysocketpair(tls *TLS, domain int32, type1 int32, protocol int32, fd uintptr) (r2 int32) +TEXT ·Ysocketpair(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL domain+8(FP), AX + MOVL AX, 8(SP) + MOVL type1+12(FP), AX + MOVL AX, 12(SP) + MOVL protocol+16(FP), AX + MOVL AX, 16(SP) + MOVQ fd+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsocketpair(SB) + MOVL 32(SP), AX + MOVL AX, r2+32(FP) + RET + +// func Ysplice(tls *TLS, fd_in int32, off_in uintptr, fd_out int32, off_out uintptr, len1 Tsize_t, flags uint32) (r Tssize_t) +TEXT ·Ysplice(SB),$64-64 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd_in+8(FP), AX + MOVL AX, 8(SP) + MOVQ off_in+16(FP), AX + MOVQ AX, 16(SP) + MOVL fd_out+24(FP), AX + MOVL AX, 24(SP) + MOVQ off_out+32(FP), AX + MOVQ AX, 32(SP) + MOVQ len1+40(FP), AX + MOVQ AX, 40(SP) + MOVL flags+48(FP), AX + MOVL AX, 48(SP) + CALL ·Xsplice(SB) + MOVQ 56(SP), AX + MOVQ AX, r+56(FP) + RET + +// func Ysprintf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Ysprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysqrt(tls *TLS, x1 float64) (r1 float64) +TEXT ·Ysqrt(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsqrt(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Ysqrtf(tls *TLS, x1 float32) (r1 float32) +TEXT ·Ysqrtf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x1+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsqrtf(SB) + MOVL 16(SP), AX + MOVL AX, r1+16(FP) + RET + +// func Ysqrtl(tls *TLS, x float64) (r float64) +TEXT ·Ysqrtl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsqrtl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysrand(tls *TLS, s uint32) +TEXT ·Ysrand(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL s+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsrand(SB) + RET + +// func Ysrand48(tls *TLS, seed int64) +TEXT ·Ysrand48(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ seed+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsrand48(SB) + RET + +// func Ysrandom(tls *TLS, seed uint32) +TEXT ·Ysrandom(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL seed+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsrandom(SB) + RET + +// func Ysscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Ysscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ystat(tls *TLS, path uintptr, buf uintptr) (r int32) +TEXT ·Ystat(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstat(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ystat64(tls *TLS, path uintptr, buf uintptr) (r int32) +TEXT ·Ystat64(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstat64(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ystatvfs(tls *TLS, path uintptr, buf uintptr) (r int32) +TEXT ·Ystatvfs(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstatvfs(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ystatx(tls *TLS, dirfd int32, path uintptr, flags int32, mask uint32, stx uintptr) (r int32) +TEXT ·Ystatx(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL dirfd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + MOVL mask+28(FP), AX + MOVL AX, 28(SP) + MOVQ stx+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xstatx(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ystime(tls *TLS, t uintptr) (r int32) +TEXT ·Ystime(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xstime(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ystpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) +TEXT ·Ystpcpy(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstpcpy(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ystpncpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstpncpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrcasecmp(tls *TLS, _l uintptr, _r uintptr) (r1 int32) +TEXT ·Ystrcasecmp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _r+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrcasecmp(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ystrcasecmp_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) +TEXT ·Ystrcasecmp_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ loc+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrcasecmp_l(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ystrcasestr(tls *TLS, h uintptr, n uintptr) (r uintptr) +TEXT ·Ystrcasestr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ h+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrcasestr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrcat(tls *TLS, dest uintptr, src uintptr) (r uintptr) +TEXT ·Ystrcat(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrcat(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrchr(tls *TLS, s uintptr, c int32) (r1 uintptr) +TEXT ·Ystrchr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xstrchr(SB) + MOVQ 24(SP), AX + MOVQ AX, r1+24(FP) + RET + +// func Ystrchrnul(tls *TLS, s uintptr, c int32) (r uintptr) +TEXT ·Ystrchrnul(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xstrchrnul(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrcmp(tls *TLS, l uintptr, r uintptr) (r1 int32) +TEXT ·Ystrcmp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrcmp(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ystrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) +TEXT ·Ystrcoll(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrcoll(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ystrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) +TEXT ·Ystrcoll_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ loc+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrcoll_l(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ystrcpy(tls *TLS, dest uintptr, src uintptr) (r uintptr) +TEXT ·Ystrcpy(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrcpy(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrcspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +TEXT ·Ystrcspn(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ c+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrcspn(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrdup(tls *TLS, s uintptr) (r uintptr) +TEXT ·Ystrdup(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xstrdup(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ystrerror(tls *TLS, e int32) (r uintptr) +TEXT ·Ystrerror(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL e+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xstrerror(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ystrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) +TEXT ·Ystrerror_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL e+8(FP), AX + MOVL AX, 8(SP) + MOVQ loc+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrerror_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrerror_r(tls *TLS, err int32, buf uintptr, buflen Tsize_t) (r int32) +TEXT ·Ystrerror_r(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL err+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ buflen+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrerror_r(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ystrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize_t) +TEXT ·Ystrfmon(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ fmt+24(FP), AX + MOVQ AX, 24(SP) + MOVQ va+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xstrfmon(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ystrfmon_l(tls *TLS, s uintptr, n Tsize_t, loc Tlocale_t, fmt uintptr, va uintptr) (r Tssize_t) +TEXT ·Ystrfmon_l(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ loc+24(FP), AX + MOVQ AX, 24(SP) + MOVQ fmt+32(FP), AX + MOVQ AX, 32(SP) + MOVQ va+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xstrfmon_l(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ystrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t) +TEXT ·Ystrftime(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + MOVQ tm+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xstrftime(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ystrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) +TEXT ·Ystrftime_l(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + MOVQ tm+32(FP), AX + MOVQ AX, 32(SP) + MOVQ loc+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xstrftime_l(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ystrlcat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r Tsize_t) +TEXT ·Ystrlcat(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrlcat(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrlcpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r Tsize_t) +TEXT ·Ystrlcpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrlcpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrlen(tls *TLS, s uintptr) (r Tsize_t) +TEXT ·Ystrlen(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xstrlen(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ystrncasecmp(tls *TLS, _l uintptr, _r uintptr, n Tsize_t) (r1 int32) +TEXT ·Ystrncasecmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrncasecmp(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ystrncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, loc Tlocale_t) (r1 int32) +TEXT ·Ystrncasecmp_l(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ loc+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xstrncasecmp_l(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Ystrncat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ystrncat(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrncat(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrncmp(tls *TLS, _l uintptr, _r uintptr, n Tsize_t) (r1 int32) +TEXT ·Ystrncmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrncmp(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ystrncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ystrncpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrncpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrndup(tls *TLS, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ystrndup(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrndup(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrnlen(tls *TLS, s uintptr, n Tsize_t) (r Tsize_t) +TEXT ·Ystrnlen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrnlen(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrpbrk(tls *TLS, s uintptr, b uintptr) (r uintptr) +TEXT ·Ystrpbrk(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrpbrk(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrptime(tls *TLS, s uintptr, f uintptr, tm uintptr) (r uintptr) +TEXT ·Ystrptime(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + MOVQ tm+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrptime(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrrchr(tls *TLS, s uintptr, c int32) (r uintptr) +TEXT ·Ystrrchr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xstrrchr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrsep(tls *TLS, str uintptr, sep uintptr) (r uintptr) +TEXT ·Ystrsep(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ str+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sep+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrsep(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrsignal(tls *TLS, signum int32) (r uintptr) +TEXT ·Ystrsignal(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL signum+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xstrsignal(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ystrspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +TEXT ·Ystrspn(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ c+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrspn(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrstr(tls *TLS, h uintptr, n uintptr) (r uintptr) +TEXT ·Ystrstr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ h+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrstr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrtod(tls *TLS, s uintptr, p uintptr) (r float64) +TEXT ·Ystrtod(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrtod(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrtod_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) +TEXT ·Ystrtod_l(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrtod_l(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtof(tls *TLS, s uintptr, p uintptr) (r float32) +TEXT ·Ystrtof(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrtof(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ystrtof_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float32) +TEXT ·Ystrtof_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrtof_l(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ystrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) +TEXT ·Ystrtoimax(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xstrtoimax(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtok(tls *TLS, s uintptr, sep uintptr) (r uintptr) +TEXT ·Ystrtok(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sep+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrtok(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrtok_r(tls *TLS, s uintptr, sep uintptr, p uintptr) (r uintptr) +TEXT ·Ystrtok_r(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sep+16(FP), AX + MOVQ AX, 16(SP) + MOVQ p+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrtok_r(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +TEXT ·Ystrtol(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xstrtol(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtold(tls *TLS, s uintptr, p uintptr) (r float64) +TEXT ·Ystrtold(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrtold(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ystrtold_l(tls *TLS, s uintptr, p uintptr, l Tlocale_t) (r float64) +TEXT ·Ystrtold_l(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrtold_l(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtoll(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +TEXT ·Ystrtoll(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xstrtoll(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +TEXT ·Ystrtoul(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xstrtoul(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtoull(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +TEXT ·Ystrtoull(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xstrtoull(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrtoumax(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) +TEXT ·Ystrtoumax(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xstrtoumax(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrverscmp(tls *TLS, l0 uintptr, r0 uintptr) (r1 int32) +TEXT ·Ystrverscmp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l0+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r0+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xstrverscmp(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ystrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) +TEXT ·Ystrxfrm(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xstrxfrm(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ystrxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) +TEXT ·Ystrxfrm_l(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ loc+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xstrxfrm_l(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yswab(tls *TLS, _src uintptr, _dest uintptr, n Tssize_t) +TEXT ·Yswab(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _src+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _dest+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xswab(SB) + RET + +// func Yswapoff(tls *TLS, path uintptr) (r int32) +TEXT ·Yswapoff(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xswapoff(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yswapon(tls *TLS, path uintptr, flags int32) (r int32) +TEXT ·Yswapon(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xswapon(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yswprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r int32) +TEXT ·Yswprintf(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ fmt+24(FP), AX + MOVQ AX, 24(SP) + MOVQ va+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xswprintf(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yswscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) (r int32) +TEXT ·Yswscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xswscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysymlink(tls *TLS, existing uintptr, new1 uintptr) (r int32) +TEXT ·Ysymlink(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ existing+8(FP), AX + MOVQ AX, 8(SP) + MOVQ new1+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsymlink(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ysymlinkat(tls *TLS, existing uintptr, fd int32, new1 uintptr) (r int32) +TEXT ·Ysymlinkat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ existing+8(FP), AX + MOVQ AX, 8(SP) + MOVL fd+16(FP), AX + MOVL AX, 16(SP) + MOVQ new1+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsymlinkat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ysync(tls *TLS) +TEXT ·Ysync(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xsync(SB) + RET + +// func Ysync_file_range(tls *TLS, fd int32, pos Toff_t, len1 Toff_t, flags uint32) (r int32) +TEXT ·Ysync_file_range(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ pos+16(FP), AX + MOVQ AX, 16(SP) + MOVQ len1+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xsync_file_range(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ysyncfs(tls *TLS, fd int32) (r int32) +TEXT ·Ysyncfs(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsyncfs(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysyscall(tls *TLS, n int64, va uintptr) (r int64) +TEXT ·Ysyscall(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ n+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xsyscall(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ysysconf(tls *TLS, name int32) (r int64) +TEXT ·Ysysconf(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL name+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xsysconf(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ysysctlbyname(t *TLS, name, oldp, oldlenp, newp uintptr, newlen Tsize_t) (_3 int32) +TEXT ·Ysysctlbyname(SB),$56-52 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + MOVQ oldp+16(FP), AX + MOVQ AX, 16(SP) + MOVQ oldlenp+24(FP), AX + MOVQ AX, 24(SP) + MOVQ newp+32(FP), AX + MOVQ AX, 32(SP) + MOVQ newlen+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xsysctlbyname(SB) + MOVL 48(SP), AX + MOVL AX, _3+48(FP) + RET + +// func Ysysinfo(tls *TLS, info uintptr) (r int32) +TEXT ·Ysysinfo(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ info+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsysinfo(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ysyslog(tls *TLS, priority int32, message uintptr, va uintptr) +TEXT ·Ysyslog(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL priority+8(FP), AX + MOVL AX, 8(SP) + MOVQ message+16(FP), AX + MOVQ AX, 16(SP) + MOVQ va+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xsyslog(SB) + RET + +// func Ysystem(t *TLS, command uintptr) (_2 int32) +TEXT ·Ysystem(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ command+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xsystem(SB) + MOVL 16(SP), AX + MOVL AX, _2+16(FP) + RET + +// func Ytan(tls *TLS, x3 float64) (r float64) +TEXT ·Ytan(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtan(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytanf(tls *TLS, x3 float32) (r float32) +TEXT ·Ytanf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtanf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytanh(tls *TLS, x3 float64) (r float64) +TEXT ·Ytanh(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtanh(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytanhf(tls *TLS, x3 float32) (r float32) +TEXT ·Ytanhf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtanhf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytanhl(tls *TLS, x float64) (r float64) +TEXT ·Ytanhl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtanhl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytanl(tls *TLS, x float64) (r float64) +TEXT ·Ytanl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtanl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytcdrain(tls *TLS, fd int32) (r int32) +TEXT ·Ytcdrain(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtcdrain(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytcflow(tls *TLS, fd int32, action int32) (r int32) +TEXT ·Ytcflow(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL action+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xtcflow(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytcflush(tls *TLS, fd int32, queue int32) (r int32) +TEXT ·Ytcflush(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL queue+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xtcflush(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytcgetattr(tls *TLS, fd int32, tio uintptr) (r int32) +TEXT ·Ytcgetattr(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ tio+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtcgetattr(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytcgetpgrp(tls *TLS, fd int32) (r Tpid_t) +TEXT ·Ytcgetpgrp(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtcgetpgrp(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytcgetsid(tls *TLS, fd int32) (r Tpid_t) +TEXT ·Ytcgetsid(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtcgetsid(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytcgetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) +TEXT ·Ytcgetwinsize(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ wsz+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtcgetwinsize(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytcsendbreak(tls *TLS, fd int32, dur int32) (r int32) +TEXT ·Ytcsendbreak(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL dur+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xtcsendbreak(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytcsetattr(tls *TLS, fd int32, act int32, tio uintptr) (r int32) +TEXT ·Ytcsetattr(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL act+12(FP), AX + MOVL AX, 12(SP) + MOVQ tio+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtcsetattr(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytcsetpgrp(tls *TLS, fd int32, pgrp Tpid_t) (r int32) +TEXT ·Ytcsetpgrp(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL pgrp+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xtcsetpgrp(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytcsetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) +TEXT ·Ytcsetwinsize(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ wsz+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtcsetwinsize(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) +TEXT ·Ytdelete(SB),$48-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+24(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_tdelete_2(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ rootp+16(FP), AX + MOVQ AX, 16(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 24(SP) + CALL ·Xtdelete(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_tdelete_2(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Ytdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) +TEXT ·Ytdestroy(SB),$32-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_freekey+16(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_tdestroy_1(SB) // Create the closure for calling __ccgo_fp_freekey + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ root+8(FP), AX + MOVQ AX, 8(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 16(SP) + CALL ·Xtdestroy(SB) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_tdestroy_1(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ __ccgo_fp+16(FP), AX + CALL *AX // Call the ABI0 code ptr + RET + +// func Ytee(tls *TLS, src int32, dest int32, len1 Tsize_t, flags uint32) (r Tssize_t) +TEXT ·Ytee(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL src+8(FP), AX + MOVL AX, 8(SP) + MOVL dest+12(FP), AX + MOVL AX, 12(SP) + MOVQ len1+16(FP), AX + MOVQ AX, 16(SP) + MOVL flags+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xtee(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ytelldir(tls *TLS, dir uintptr) (r int64) +TEXT ·Ytelldir(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtelldir(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytempnam(tls *TLS, dir uintptr, pfx uintptr) (r1 uintptr) +TEXT ·Ytempnam(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dir+8(FP), AX + MOVQ AX, 8(SP) + MOVQ pfx+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtempnam(SB) + MOVQ 24(SP), AX + MOVQ AX, r1+24(FP) + RET + +// func Ytextdomain(tls *TLS, domainname uintptr) (r uintptr) +TEXT ·Ytextdomain(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ domainname+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtextdomain(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) +TEXT ·Ytfind(SB),$48-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+24(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_tfind_2(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ rootp+16(FP), AX + MOVQ AX, 16(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 24(SP) + CALL ·Xtfind(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_tfind_2(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Ytgamma(tls *TLS, x3 float64) (r1 float64) +TEXT ·Ytgamma(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtgamma(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Ytgammaf(tls *TLS, x float32) (r float32) +TEXT ·Ytgammaf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtgammaf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytgammal(tls *TLS, x float64) (r float64) +TEXT ·Ytgammal(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtgammal(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytime(tls *TLS, t uintptr) (r Ttime_t) +TEXT ·Ytime(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtime(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytimegm(tls *TLS, tm uintptr) (r Ttime_t) +TEXT ·Ytimegm(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tm+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtimegm(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytimer_delete(tls *TLS, t Ttimer_t) (r int32) +TEXT ·Ytimer_delete(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtimer_delete(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytimer_getoverrun(tls *TLS, t Ttimer_t) (r int32) +TEXT ·Ytimer_getoverrun(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtimer_getoverrun(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytimer_gettime(tls *TLS, t Ttimer_t, val uintptr) (r int32) +TEXT ·Ytimer_gettime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVQ val+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtimer_gettime(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) (r int32) +TEXT ·Ytimer_settime(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ t+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + MOVQ val+24(FP), AX + MOVQ AX, 24(SP) + MOVQ old+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xtimer_settime(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Ytimerfd_create(tls *TLS, clockid int32, flags int32) (r int32) +TEXT ·Ytimerfd_create(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL clockid+8(FP), AX + MOVL AX, 8(SP) + MOVL flags+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xtimerfd_create(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytimerfd_gettime(tls *TLS, fd int32, cur uintptr) (r int32) +TEXT ·Ytimerfd_gettime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ cur+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtimerfd_gettime(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytimerfd_settime(tls *TLS, fd int32, flags int32, new1 uintptr, old uintptr) (r int32) +TEXT ·Ytimerfd_settime(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVL flags+12(FP), AX + MOVL AX, 12(SP) + MOVQ new1+16(FP), AX + MOVQ AX, 16(SP) + MOVQ old+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xtimerfd_settime(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ytimes(tls *TLS, tms uintptr) (r Tclock_t) +TEXT ·Ytimes(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ tms+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtimes(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytimespec_get(tls *TLS, ts uintptr, base int32) (r int32) +TEXT ·Ytimespec_get(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ ts+8(FP), AX + MOVQ AX, 8(SP) + MOVL base+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xtimespec_get(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytmpfile(tls *TLS) (r uintptr) +TEXT ·Ytmpfile(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xtmpfile(SB) + MOVQ 8(SP), AX + MOVQ AX, r+8(FP) + RET + +// func Ytmpnam(tls *TLS, buf uintptr) (r1 uintptr) +TEXT ·Ytmpnam(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ buf+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtmpnam(SB) + MOVQ 16(SP), AX + MOVQ AX, r1+16(FP) + RET + +// func Ytoascii(tls *TLS, c int32) (r int32) +TEXT ·Ytoascii(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtoascii(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytolower(tls *TLS, c int32) (r int32) +TEXT ·Ytolower(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtolower(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytolower_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Ytolower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtolower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytoupper(tls *TLS, c int32) (r int32) +TEXT ·Ytoupper(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtoupper(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytoupper_l(tls *TLS, c int32, l Tlocale_t) (r int32) +TEXT ·Ytoupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtoupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytowctrans(tls *TLS, wc Twint_t, trans Twctrans_t) (r Twint_t) +TEXT ·Ytowctrans(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + MOVQ trans+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtowctrans(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytowctrans_l(tls *TLS, c Twint_t, t Twctrans_t, l Tlocale_t) (r Twint_t) +TEXT ·Ytowctrans_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ t+16(FP), AX + MOVQ AX, 16(SP) + MOVQ l+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xtowctrans_l(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ytowlower(tls *TLS, wc Twint_t) (r Twint_t) +TEXT ·Ytowlower(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtowlower(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytowlower_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) +TEXT ·Ytowlower_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtowlower_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytowupper(tls *TLS, wc Twint_t) (r Twint_t) +TEXT ·Ytowupper(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtowupper(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytowupper_l(tls *TLS, c Twint_t, l Tlocale_t) (r Twint_t) +TEXT ·Ytowupper_l(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtowupper_l(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytrunc(tls *TLS, x3 float64) (r float64) +TEXT ·Ytrunc(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x3+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtrunc(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytruncate(tls *TLS, path uintptr, length Toff_t) (r int32) +TEXT ·Ytruncate(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ length+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xtruncate(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ytruncf(tls *TLS, x3 float32) (r float32) +TEXT ·Ytruncf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x3+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xtruncf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ytruncl(tls *TLS, x float64) (r float64) +TEXT ·Ytruncl(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xtruncl(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ytsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) +TEXT ·Ytsearch(SB),$48-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_cmp+24(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_tsearch_2(SB) // Create the closure for calling __ccgo_fp_cmp + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ key+8(FP), AX + MOVQ AX, 8(SP) + MOVQ rootp+16(FP), AX + MOVQ AX, 16(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 24(SP) + CALL ·Xtsearch(SB) + MOVQ 32(SP), AX + MOVQ AX, r1+32(FP) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_tsearch_2(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVQ _2+16(FP), AX + MOVQ AX, 16(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + MOVL 24(SP), AX + MOVL AX, _3+32(FP) + RET + +// func Yttyname(tls *TLS, fd int32) (r uintptr) +TEXT ·Yttyname(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xttyname(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yttyname_r(tls *TLS, fd int32, name uintptr, size Tsize_t) (r int32) +TEXT ·Yttyname_r(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ name+16(FP), AX + MOVQ AX, 16(SP) + MOVQ size+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xttyname_r(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ytwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) +TEXT ·Ytwalk(SB),$32-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX // alloc all ABI trampolines + MOVQ AX, 0(SP) + MOVQ $16, 8(SP) // 16*(number of func ptrs in signature) + CALL modernc·org∕libc·TLSAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, -8(BP) // Trampolines[0] + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ -8(BP), AX + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 8(SP) + MOVQ __ccgo_fp_action+16(FP), AX // ABI0 code ptr + MOVQ AX, 16(SP) + CALL ·__ccgo_abiInternal_twalk_1(SB) // Create the closure for calling __ccgo_fp_action + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ root+8(FP), AX + MOVQ AX, 8(SP) + MOVQ -8(BP), AX // Trampolines[0] + ADDQ $0, AX // 16*(0-based ordinal number of the func ptr in signature) + MOVQ AX, 16(SP) + CALL ·Xtwalk(SB) + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ $0, 8(SP) + CALL modernc·org∕libc·TLSFree(SB) + RET + +TEXT ·__ccgo_abi0_twalk_1(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ _0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ _1+8(FP), AX + MOVQ AX, 8(SP) + MOVL _2+16(FP), AX + MOVL AX, 16(SP) + MOVL _3+20(FP), AX + MOVL AX, 20(SP) + MOVQ __ccgo_fp+24(FP), AX + CALL *AX // Call the ABI0 code ptr + RET + +// func Ytzset(tls *TLS) +TEXT ·Ytzset(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xtzset(SB) + RET + +// func Yualarm(tls *TLS, value uint32, interval uint32) (r uint32) +TEXT ·Yualarm(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL value+8(FP), AX + MOVL AX, 8(SP) + MOVL interval+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xualarm(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yulckpwdf(tls *TLS) (r int32) +TEXT ·Yulckpwdf(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xulckpwdf(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yulimit(tls *TLS, cmd int32, va uintptr) (r int64) +TEXT ·Yulimit(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL cmd+8(FP), AX + MOVL AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xulimit(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yumask(tls *TLS, mode Tmode_t) (r Tmode_t) +TEXT ·Yumask(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL mode+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xumask(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yumount(tls *TLS, special uintptr) (r int32) +TEXT ·Yumount(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ special+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xumount(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yumount2(tls *TLS, special uintptr, flags int32) (r int32) +TEXT ·Yumount2(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ special+8(FP), AX + MOVQ AX, 8(SP) + MOVL flags+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xumount2(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yuname(tls *TLS, uts uintptr) (r int32) +TEXT ·Yuname(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ uts+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xuname(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yungetc(tls *TLS, c int32, f uintptr) (r int32) +TEXT ·Yungetc(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xungetc(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) +TEXT ·Yungetwc(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + MOVQ f+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xungetwc(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yunlink(tls *TLS, path uintptr) (r int32) +TEXT ·Yunlink(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xunlink(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yunlinkat(tls *TLS, fd int32, path uintptr, flag int32) (r int32) +TEXT ·Yunlinkat(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVL flag+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xunlinkat(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yunlockpt(tls *TLS, fd int32) (r int32) +TEXT ·Yunlockpt(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xunlockpt(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yunsetenv(tls *TLS, name uintptr) (r int32) +TEXT ·Yunsetenv(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ name+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xunsetenv(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yunshare(tls *TLS, flags int32) (r int32) +TEXT ·Yunshare(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL flags+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xunshare(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yupdwtmp(tls *TLS, f uintptr, u uintptr) +TEXT ·Yupdwtmp(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ u+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xupdwtmp(SB) + RET + +// func Yupdwtmpx(tls *TLS, f uintptr, u uintptr) +TEXT ·Yupdwtmpx(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ u+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xupdwtmpx(SB) + RET + +// func Yuselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) +TEXT ·Yuselocale(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ new1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xuselocale(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yusleep(tls *TLS, useconds uint32) (r int32) +TEXT ·Yusleep(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL useconds+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xusleep(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yutime(tls *TLS, path uintptr, times uintptr) (r int32) +TEXT ·Yutime(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ times+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xutime(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r1 int32) +TEXT ·Yutimensat(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ path+16(FP), AX + MOVQ AX, 16(SP) + MOVQ times+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xutimensat(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Yutimes(tls *TLS, path uintptr, times uintptr) (r int32) +TEXT ·Yutimes(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ path+8(FP), AX + MOVQ AX, 8(SP) + MOVQ times+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xutimes(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yuuid_copy(t *TLS, dst, src uintptr) +TEXT ·Yuuid_copy(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dst+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xuuid_copy(SB) + RET + +// func Yuuid_generate_random(t *TLS, out uintptr) +TEXT ·Yuuid_generate_random(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ out+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xuuid_generate_random(SB) + RET + +// func Yuuid_parse(t *TLS, in uintptr, uu uintptr) (_3 int32) +TEXT ·Yuuid_parse(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ in+8(FP), AX + MOVQ AX, 8(SP) + MOVQ uu+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xuuid_parse(SB) + MOVL 24(SP), AX + MOVL AX, _3+24(FP) + RET + +// func Yuuid_unparse(t *TLS, uu, out uintptr) +TEXT ·Yuuid_unparse(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ t+0(FP), AX + MOVQ AX, 0(SP) + MOVQ uu+8(FP), AX + MOVQ AX, 8(SP) + MOVQ out+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xuuid_unparse(SB) + RET + +// func Yvasprintf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvasprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvasprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvdprintf(tls *TLS, fd int32, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvdprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvdprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yverr(tls *TLS, status int32, fmt uintptr, ap Tva_list) +TEXT ·Yverr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL status+8(FP), AX + MOVL AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xverr(SB) + RET + +// func Yverrx(tls *TLS, status int32, fmt uintptr, ap Tva_list) +TEXT ·Yverrx(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL status+8(FP), AX + MOVL AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xverrx(SB) + RET + +// func Yversionsort(tls *TLS, a uintptr, b uintptr) (r int32) +TEXT ·Yversionsort(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ a+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xversionsort(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yvfork(tls *TLS) (r Tpid_t) +TEXT ·Yvfork(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xvfork(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yvfprintf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvfprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvfprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvfscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvfscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvfscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvfwprintf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvfwprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvfwprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvfwscanf(tls *TLS, f uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvfwscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ f+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvfwscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvhangup(tls *TLS) (r int32) +TEXT ·Yvhangup(SB),$16-12 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + CALL ·Xvhangup(SB) + MOVL 8(SP), AX + MOVL AX, r+8(FP) + RET + +// func Yvmsplice(tls *TLS, fd int32, iov uintptr, cnt Tsize_t, flags uint32) (r Tssize_t) +TEXT ·Yvmsplice(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ iov+16(FP), AX + MOVQ AX, 16(SP) + MOVQ cnt+24(FP), AX + MOVQ AX, 24(SP) + MOVL flags+32(FP), AX + MOVL AX, 32(SP) + CALL ·Xvmsplice(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Yvprintf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvprintf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xvprintf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yvscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvscanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xvscanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yvsnprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvsnprintf(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ fmt+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ap+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xvsnprintf(SB) + MOVL 40(SP), AX + MOVL AX, r+40(FP) + RET + +// func Yvsprintf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvsprintf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvsprintf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvsscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvsscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvsscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvswprintf(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, ap Tva_list) (r1 int32) +TEXT ·Yvswprintf(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ fmt+24(FP), AX + MOVQ AX, 24(SP) + MOVQ ap+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xvswprintf(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Yvswscanf(tls *TLS, s uintptr, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvswscanf(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ fmt+16(FP), AX + MOVQ AX, 16(SP) + MOVQ ap+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xvswscanf(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Yvwarn(tls *TLS, fmt uintptr, ap Tva_list) +TEXT ·Yvwarn(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xvwarn(SB) + RET + +// func Yvwarnx(tls *TLS, fmt uintptr, ap Tva_list) +TEXT ·Yvwarnx(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xvwarnx(SB) + RET + +// func Yvwprintf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvwprintf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xvwprintf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yvwscanf(tls *TLS, fmt uintptr, ap Tva_list) (r int32) +TEXT ·Yvwscanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ap+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xvwscanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ywait(tls *TLS, status uintptr) (r Tpid_t) +TEXT ·Ywait(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ status+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xwait(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ywait3(tls *TLS, status uintptr, options int32, usage uintptr) (r Tpid_t) +TEXT ·Ywait3(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ status+8(FP), AX + MOVQ AX, 8(SP) + MOVL options+16(FP), AX + MOVL AX, 16(SP) + MOVQ usage+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwait3(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ywait4(tls *TLS, pid Tpid_t, status uintptr, options int32, ru uintptr) (r1 Tpid_t) +TEXT ·Ywait4(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVQ status+16(FP), AX + MOVQ AX, 16(SP) + MOVL options+24(FP), AX + MOVL AX, 24(SP) + MOVQ ru+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xwait4(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Ywaitid(tls *TLS, type1 Tidtype_t, id Tid_t, info uintptr, options int32) (r int32) +TEXT ·Ywaitid(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL type1+8(FP), AX + MOVL AX, 8(SP) + MOVL id+12(FP), AX + MOVL AX, 12(SP) + MOVQ info+16(FP), AX + MOVQ AX, 16(SP) + MOVL options+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwaitid(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ywaitpid(tls *TLS, pid Tpid_t, status uintptr, options int32) (r Tpid_t) +TEXT ·Ywaitpid(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL pid+8(FP), AX + MOVL AX, 8(SP) + MOVQ status+16(FP), AX + MOVQ AX, 16(SP) + MOVL options+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwaitpid(SB) + MOVL 32(SP), AX + MOVL AX, r+32(FP) + RET + +// func Ywarn(tls *TLS, fmt uintptr, va uintptr) +TEXT ·Ywarn(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwarn(SB) + RET + +// func Ywarnx(tls *TLS, fmt uintptr, va uintptr) +TEXT ·Ywarnx(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwarnx(SB) + RET + +// func Ywcpcpy(tls *TLS, d uintptr, s uintptr) (r uintptr) +TEXT ·Ywcpcpy(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcpcpy(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcpncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ywcpncpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcpncpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) +TEXT ·Ywcrtomb(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL wc+16(FP), AX + MOVL AX, 16(SP) + MOVQ st+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcrtomb(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcscasecmp(tls *TLS, l uintptr, r uintptr) (r1 int32) +TEXT ·Ywcscasecmp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcscasecmp(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ywcscasecmp_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) +TEXT ·Ywcscasecmp_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ locale+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcscasecmp_l(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ywcscat(tls *TLS, dest uintptr, src uintptr) (r uintptr) +TEXT ·Ywcscat(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcscat(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcschr(tls *TLS, s uintptr, c Twchar_t) (r uintptr) +TEXT ·Ywcschr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xwcschr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcscmp(tls *TLS, l uintptr, r uintptr) (r1 int32) +TEXT ·Ywcscmp(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcscmp(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ywcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) +TEXT ·Ywcscoll(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcscoll(SB) + MOVL 24(SP), AX + MOVL AX, r1+24(FP) + RET + +// func Ywcscoll_l(tls *TLS, l uintptr, r uintptr, locale Tlocale_t) (r1 int32) +TEXT ·Ywcscoll_l(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ locale+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcscoll_l(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ywcscpy(tls *TLS, d uintptr, s uintptr) (r uintptr) +TEXT ·Ywcscpy(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcscpy(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcscspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +TEXT ·Ywcscspn(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ c+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcscspn(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcsdup(tls *TLS, s uintptr) (r uintptr) +TEXT ·Ywcsdup(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xwcsdup(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ywcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t) +TEXT ·Ywcsftime(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ wcs+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + MOVQ tm+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xwcsftime(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ywcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) +TEXT ·Ywcsftime_l(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + MOVQ f+24(FP), AX + MOVQ AX, 24(SP) + MOVQ tm+32(FP), AX + MOVQ AX, 32(SP) + MOVQ loc+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xwcsftime_l(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ywcslen(tls *TLS, s uintptr) (r Tsize_t) +TEXT ·Ywcslen(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xwcslen(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ywcsncasecmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) +TEXT ·Ywcsncasecmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcsncasecmp(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ywcsncasecmp_l(tls *TLS, l uintptr, r uintptr, n Tsize_t, locale Tlocale_t) (r1 int32) +TEXT ·Ywcsncasecmp_l(SB),$48-44 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ locale+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xwcsncasecmp_l(SB) + MOVL 40(SP), AX + MOVL AX, r1+40(FP) + RET + +// func Ywcsncat(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ywcsncat(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcsncat(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcsncmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) +TEXT ·Ywcsncmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcsncmp(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ywcsncpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ywcsncpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcsncpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcsnlen(tls *TLS, s uintptr, n Tsize_t) (r Tsize_t) +TEXT ·Ywcsnlen(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcsnlen(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcsnrtombs(tls *TLS, dst uintptr, wcs uintptr, wn Tsize_t, n Tsize_t, st uintptr) (r Tsize_t) +TEXT ·Ywcsnrtombs(SB),$56-56 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dst+8(FP), AX + MOVQ AX, 8(SP) + MOVQ wcs+16(FP), AX + MOVQ AX, 16(SP) + MOVQ wn+24(FP), AX + MOVQ AX, 24(SP) + MOVQ n+32(FP), AX + MOVQ AX, 32(SP) + MOVQ st+40(FP), AX + MOVQ AX, 40(SP) + CALL ·Xwcsnrtombs(SB) + MOVQ 48(SP), AX + MOVQ AX, r+48(FP) + RET + +// func Ywcspbrk(tls *TLS, s uintptr, b uintptr) (r uintptr) +TEXT ·Ywcspbrk(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ b+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcspbrk(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcsrchr(tls *TLS, s uintptr, c Twchar_t) (r uintptr) +TEXT ·Ywcsrchr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xwcsrchr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcsrtombs(tls *TLS, s uintptr, ws uintptr, n Tsize_t, st uintptr) (r Tsize_t) +TEXT ·Ywcsrtombs(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ws+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ st+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xwcsrtombs(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ywcsspn(tls *TLS, s uintptr, c uintptr) (r Tsize_t) +TEXT ·Ywcsspn(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ c+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcsspn(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcsstr(tls *TLS, h uintptr, n uintptr) (r uintptr) +TEXT ·Ywcsstr(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ h+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcsstr(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcstod(tls *TLS, s uintptr, p uintptr) (r float64) +TEXT ·Ywcstod(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcstod(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcstof(tls *TLS, s uintptr, p uintptr) (r float32) +TEXT ·Ywcstof(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcstof(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ywcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) +TEXT ·Ywcstoimax(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwcstoimax(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcstok(tls *TLS, s uintptr, sep uintptr, p uintptr) (r uintptr) +TEXT ·Ywcstok(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ sep+16(FP), AX + MOVQ AX, 16(SP) + MOVQ p+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcstok(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +TEXT ·Ywcstol(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwcstol(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcstold(tls *TLS, s uintptr, p uintptr) (r float64) +TEXT ·Ywcstold(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcstold(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcstoll(tls *TLS, s uintptr, p uintptr, base int32) (r int64) +TEXT ·Ywcstoll(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwcstoll(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcstombs(tls *TLS, s uintptr, ws uintptr, n Tsize_t) (r Tsize_t) +TEXT ·Ywcstombs(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ ws+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcstombs(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +TEXT ·Ywcstoul(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwcstoul(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcstoull(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) +TEXT ·Ywcstoull(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwcstoull(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcstoumax(tls *TLS, s uintptr, p uintptr, base int32) (r Tuintmax_t) +TEXT ·Ywcstoumax(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ p+16(FP), AX + MOVQ AX, 16(SP) + MOVL base+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwcstoumax(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcswcs(tls *TLS, haystack uintptr, needle uintptr) (r uintptr) +TEXT ·Ywcswcs(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ haystack+8(FP), AX + MOVQ AX, 8(SP) + MOVQ needle+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcswcs(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcswidth(tls *TLS, wcs uintptr, n Tsize_t) (r int32) +TEXT ·Ywcswidth(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ wcs+8(FP), AX + MOVQ AX, 8(SP) + MOVQ n+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwcswidth(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ywcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) +TEXT ·Ywcsxfrm(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwcsxfrm(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywcsxfrm_l(tls *TLS, dest uintptr, src uintptr, n Tsize_t, loc Tlocale_t) (r Tsize_t) +TEXT ·Ywcsxfrm_l(SB),$48-48 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ dest+8(FP), AX + MOVQ AX, 8(SP) + MOVQ src+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + MOVQ loc+32(FP), AX + MOVQ AX, 32(SP) + CALL ·Xwcsxfrm_l(SB) + MOVQ 40(SP), AX + MOVQ AX, r+40(FP) + RET + +// func Ywctob(tls *TLS, c Twint_t) (r int32) +TEXT ·Ywctob(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL c+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xwctob(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ywctomb(tls *TLS, s uintptr, wc Twchar_t) (r int32) +TEXT ·Ywctomb(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL wc+16(FP), AX + MOVL AX, 16(SP) + CALL ·Xwctomb(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ywctrans(tls *TLS, class uintptr) (r Twctrans_t) +TEXT ·Ywctrans(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ class+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xwctrans(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ywctrans_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctrans_t) +TEXT ·Ywctrans_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwctrans_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywctype(tls *TLS, s uintptr) (r Twctype_t) +TEXT ·Ywctype(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xwctype(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Ywctype_l(tls *TLS, s uintptr, l Tlocale_t) (r Twctype_t) +TEXT ·Ywctype_l(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVQ l+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwctype_l(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Ywcwidth(tls *TLS, wc Twchar_t) (r int32) +TEXT ·Ywcwidth(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL wc+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xwcwidth(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Ywmemchr(tls *TLS, s uintptr, c Twchar_t, n Tsize_t) (r uintptr) +TEXT ·Ywmemchr(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ s+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwmemchr(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywmemcmp(tls *TLS, l uintptr, r uintptr, n Tsize_t) (r1 int32) +TEXT ·Ywmemcmp(SB),$40-36 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ l+8(FP), AX + MOVQ AX, 8(SP) + MOVQ r+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwmemcmp(SB) + MOVL 32(SP), AX + MOVL AX, r1+32(FP) + RET + +// func Ywmemcpy(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ywmemcpy(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwmemcpy(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywmemmove(tls *TLS, d uintptr, s uintptr, n Tsize_t) (r uintptr) +TEXT ·Ywmemmove(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVQ s+16(FP), AX + MOVQ AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwmemmove(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywmemset(tls *TLS, d uintptr, c Twchar_t, n Tsize_t) (r uintptr) +TEXT ·Ywmemset(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ d+8(FP), AX + MOVQ AX, 8(SP) + MOVL c+16(FP), AX + MOVL AX, 16(SP) + MOVQ n+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwmemset(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywprintf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Ywprintf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwprintf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Ywrite(tls *TLS, fd int32, buf uintptr, count Tsize_t) (r Tssize_t) +TEXT ·Ywrite(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ buf+16(FP), AX + MOVQ AX, 16(SP) + MOVQ count+24(FP), AX + MOVQ AX, 24(SP) + CALL ·Xwrite(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywritev(tls *TLS, fd int32, iov uintptr, count int32) (r Tssize_t) +TEXT ·Ywritev(SB),$40-40 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL fd+8(FP), AX + MOVL AX, 8(SP) + MOVQ iov+16(FP), AX + MOVQ AX, 16(SP) + MOVL count+24(FP), AX + MOVL AX, 24(SP) + CALL ·Xwritev(SB) + MOVQ 32(SP), AX + MOVQ AX, r+32(FP) + RET + +// func Ywscanf(tls *TLS, fmt uintptr, va uintptr) (r int32) +TEXT ·Ywscanf(SB),$32-28 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ fmt+8(FP), AX + MOVQ AX, 8(SP) + MOVQ va+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xwscanf(SB) + MOVL 24(SP), AX + MOVL AX, r+24(FP) + RET + +// func Yy0(tls *TLS, x float64) (r float64) +TEXT ·Yy0(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xy0(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yy0f(tls *TLS, x float32) (r float32) +TEXT ·Yy0f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xy0f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yy1(tls *TLS, x float64) (r float64) +TEXT ·Yy1(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVQ x+8(FP), AX + MOVQ AX, 8(SP) + CALL ·Xy1(SB) + MOVQ 16(SP), AX + MOVQ AX, r+16(FP) + RET + +// func Yy1f(tls *TLS, x float32) (r float32) +TEXT ·Yy1f(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL x+8(FP), AX + MOVL AX, 8(SP) + CALL ·Xy1f(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET + +// func Yyn(tls *TLS, n int32, x float64) (r float64) +TEXT ·Yyn(SB),$32-32 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + MOVQ x+16(FP), AX + MOVQ AX, 16(SP) + CALL ·Xyn(SB) + MOVQ 24(SP), AX + MOVQ AX, r+24(FP) + RET + +// func Yynf(tls *TLS, n int32, x float32) (r float32) +TEXT ·Yynf(SB),$24-20 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ tls+0(FP), AX + MOVQ AX, 0(SP) + MOVL n+8(FP), AX + MOVL AX, 8(SP) + MOVL x+12(FP), AX + MOVL AX, 12(SP) + CALL ·Xynf(SB) + MOVL 16(SP), AX + MOVL AX, r+16(FP) + RET diff --git a/vendor/modernc.org/libc/build_all_targets.sh b/vendor/modernc.org/libc/build_all_targets.sh index c682fae..1b0e043 100644 --- a/vendor/modernc.org/libc/build_all_targets.sh +++ b/vendor/modernc.org/libc/build_all_targets.sh @@ -1,5 +1,5 @@ set -e -for tag in none libc.dmesg libc.membrk libc.memgrind libc.strace +for tag in none libc.dmesg libc.membrk libc.memgrind libc.strace libc.memexpvar do echo "-tags=$tag" echo "GOOS=darwin GOARCH=amd64" @@ -8,15 +8,21 @@ do echo "GOOS=darwin GOARCH=arm64" GOOS=darwin GOARCH=arm64 go build -tags=$tag -v ./... GOOS=darwin GOARCH=arm64 go test -tags=$tag -c -o /dev/null - echo "GOOS=freebsd GOARCH=386" - GOOS=freebsd GOARCH=386 go build -tags=$tag -v ./... - GOOS=freebsd GOARCH=386 go test -tags=$tag -c -o /dev/null + #TODO echo "GOOS=freebsd GOARCH=386" + #TODO GOOS=freebsd GOARCH=386 go build -tags=$tag -v ./... + #TODO GOOS=freebsd GOARCH=386 go test -tags=$tag -c -o /dev/null echo "GOOS=freebsd GOARCH=amd64" GOOS=freebsd GOARCH=amd64 go build -tags=$tag -v ./... GOOS=freebsd GOARCH=amd64 go test -tags=$tag -c -o /dev/null - echo "GOOS=freebsd GOARCH=arm" - GOOS=freebsd GOARCH=arm go build -tags=$tag -v ./... - GOOS=freebsd GOARCH=arm go test -tags=$tag -c -o /dev/null + echo "GOOS=freebsd GOARCH=arm64" + GOOS=freebsd GOARCH=arm64 go build -tags=$tag -v ./... + GOOS=freebsd GOARCH=arm64 go test -tags=$tag -c -o /dev/null + echo "GOOS=illumos GOARCH=amd64" + GOOS=illumos GOARCH=amd64 go build -tags=$tag -v ./... + GOOS=illumos GOARCH=amd64 go test -tags=$tag -c -o /dev/null + #TODO echo "GOOS=freebsd GOARCH=arm" + #TODO GOOS=freebsd GOARCH=arm go build -tags=$tag -v ./... + #TODO GOOS=freebsd GOARCH=arm go test -tags=$tag -c -o /dev/null echo "GOOS=linux GOARCH=386" GOOS=linux GOARCH=386 go build -tags=$tag -v ./... GOOS=linux GOARCH=386 go test -tags=$tag -c -o /dev/null @@ -32,9 +38,9 @@ do echo "GOOS=linux GOARCH=loong64" GOOS=linux GOARCH=loong64 go build -tags=$tag -v ./... GOOS=linux GOARCH=loong64 go test -tags=$tag -c -o /dev/null - echo "GOOS=linux GOARCH=mips64le" - GOOS=linux GOARCH=mips64le go build -tags=$tag -v ./... - GOOS=linux GOARCH=mips64le go test -tags=$tag -c -o /dev/null + # echo "GOOS=linux GOARCH=mips64le" + # GOOS=linux GOARCH=mips64le go build -tags=$tag -v ./... + # GOOS=linux GOARCH=mips64le go test -tags=$tag -c -o /dev/null echo "GOOS=linux GOARCH=ppc64le" GOOS=linux GOARCH=ppc64le go build -tags=$tag -v ./... GOOS=linux GOARCH=ppc64le go test -tags=$tag -c -o /dev/null diff --git a/vendor/modernc.org/libc/ccgo_linux_386.go b/vendor/modernc.org/libc/ccgo_linux_386.go index e7ee5d8..91ec9c9 100644 --- a/vendor/modernc.org/libc/ccgo_linux_386.go +++ b/vendor/modernc.org/libc/ccgo_linux_386.go @@ -601,8 +601,8 @@ func X__ldexp_cexp(tls *TLS, z complex128, expt int32) (r complex128) { v2 = Uint64FromInt32((Int32FromInt32(0x3ff)+half_expt)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1207,15 +1207,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1233,7 +1233,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1246,14 +1246,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1268,7 +1268,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1284,14 +1284,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1307,8 +1307,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1334,24 +1334,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1364,15 +1364,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1381,48 +1381,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1523,8 +1523,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1603,8 +1603,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1939,18 +1939,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1962,16 +1962,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1988,7 +1988,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -2023,7 +2023,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -2041,14 +2041,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2064,8 +2064,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2097,18 +2097,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2120,16 +2120,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2137,7 +2137,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2159,27 +2159,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2307,16 +2307,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2423,16 +2423,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2535,7 +2535,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2552,7 +2552,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)<>int32(8)])*int32(32)+wc&int32(255)>>int32(3)])>>(wc&int32(7))&int32(1) != 0 { + if Int32FromUint8(_table5[int32(Int32FromUint8(_table5[wc>>int32(8)])*int32(32))+wc&int32(255)>>int32(3)])>>(wc&int32(7))&int32(1) != 0 { return 0 } - if Int32FromUint8(_wtable[Int32FromUint8(_wtable[wc>>int32(8)])*int32(32)+wc&int32(255)>>int32(3)])>>(wc&int32(7))&int32(1) != 0 { + if Int32FromUint8(_wtable[int32(Int32FromUint8(_wtable[wc>>int32(8)])*int32(32))+wc&int32(255)>>int32(3)])>>(wc&int32(7))&int32(1) != 0 { return int32(2) } return int32(1) @@ -24981,7 +24981,7 @@ func Xreaddir(tls *TLS, dir uintptr) (r uintptr) { var len1 int32 _, _ = de, len1 if (*TDIR)(unsafe.Pointer(dir)).Fbuf_pos >= (*TDIR)(unsafe.Pointer(dir)).Fbuf_end { - len1 = X__syscall3(tls, int32(SYS_getdents64), (*TDIR)(unsafe.Pointer(dir)).Ffd, int32(dir+24), Int32FromUint32(Uint32FromInt64(2048))) + len1 = int32(X__syscall3(tls, int32(SYS_getdents64), (*TDIR)(unsafe.Pointer(dir)).Ffd, int32(dir+24), Int32FromUint32(Uint32FromInt64(2048)))) if len1 <= 0 { if len1 < 0 && len1 != -int32(ENOENT) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = -len1 @@ -25041,9 +25041,13 @@ func Xrewinddir(tls *TLS, dir uintptr) { ___unlock(tls, dir+20) } -func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r int32) { +type t__ccgo_fp__Xscandir_2 = func(*TLS, uintptr) int32 + +type t__ccgo_fp__Xscandir_3 = func(*TLS, uintptr, uintptr) int32 + +func Xscandir(tls *TLS, path uintptr, res uintptr, __ccgo_fp_sel uintptr, __ccgo_fp_cmp uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v res=%v sel=%v cmp=%v, (%v:)", tls, path, res, sel, cmp, origin(2)) + trc("tls=%v path=%v res=%v __ccgo_fp_sel=%v __ccgo_fp_cmp=%v, (%v:)", tls, path, res, __ccgo_fp_sel, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -25065,7 +25069,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -25103,8 +25107,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint32(4), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint32(4), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint32(cnt) @@ -25148,7 +25152,7 @@ func X__reset_tls(tls *TLS) { var mem, p uintptr var self Tpthread_t _, _, _, _, _ = i, mem, n, p, self - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) n = *(*Tuintptr_t)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(self)).Fdtv)) if n != 0 { p = X__libc.Ftls_head @@ -25178,7 +25182,7 @@ func X__init_ssp(tls *TLS, entropy uintptr) { } else { X__stack_chk_guard = Tuintptr_t(uintptr(unsafe.Pointer(&X__stack_chk_guard))) * uint32(1103515245) } - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fcanary = X__stack_chk_guard + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fcanary = X__stack_chk_guard } func X__stack_chk_fail(tls *TLS) { @@ -25787,7 +25791,7 @@ func Xstrerror(tls *TLS, e int32) (r uintptr) { trc("tls=%v e=%v, (%v:)", tls, e, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) { @@ -25844,9 +25848,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25858,7 +25864,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -25907,9 +25913,9 @@ func Xfcntl(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) { return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_fcntl64), fd, cmd, int32(uintptr(arg)), 0, 0, 0))) } if cmd == int32(F_GETOWN) { - ret = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETOWN_EX), int32(bp)) + ret = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETOWN_EX)), int32(bp))) if ret == -int32(EINVAL) { - return X__syscall3(tls, int32(SYS_fcntl64), fd, cmd, int32(uintptr(arg))) + return int32(X__syscall3(tls, int32(SYS_fcntl64), fd, cmd, int32(uintptr(arg)))) } if ret != 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) @@ -25922,23 +25928,23 @@ func Xfcntl(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) { return v1 } if cmd == int32(F_DUPFD_CLOEXEC) { - ret1 = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_DUPFD_CLOEXEC), Int32FromUint32(arg)) + ret1 = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_DUPFD_CLOEXEC)), Int32FromUint32(arg))) if ret1 != -int32(EINVAL) { if ret1 >= 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret1, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret1, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(ret1)) } - ret1 = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_DUPFD_CLOEXEC), Int32FromInt32(0)) + ret1 = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_DUPFD_CLOEXEC)), int32(Int32FromInt32(0)))) if ret1 != -int32(EINVAL) { if ret1 >= 0 { X__syscall1(tls, int32(SYS_close), ret1) } return X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(EINVAL))) } - ret1 = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_DUPFD), Int32FromUint32(arg)) + ret1 = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_DUPFD)), Int32FromUint32(arg))) if ret1 >= 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret1, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret1, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(ret1)) } @@ -25972,9 +25978,9 @@ func Xopen(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) { mode = VaUint32(&ap) _ = ap } - fd = ___syscall_cp(tls, int32(SYS_open), int32(filename), flags|Int32FromInt32(O_LARGEFILE), Int32FromUint32(mode), 0, 0, 0) + fd = int32(___syscall_cp(tls, int32(SYS_open), int32(filename), int32(flags|Int32FromInt32(O_LARGEFILE)), Int32FromUint32(mode), 0, 0, 0)) if fd >= 0 && flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(fd)) } @@ -25993,7 +25999,7 @@ func Xopenat(tls *TLS, fd int32, filename uintptr, flags int32, va uintptr) (r i mode = VaUint32(&ap) _ = ap } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_openat), fd, int32(filename), flags|Int32FromInt32(O_LARGEFILE), Int32FromUint32(mode), 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_openat), fd, int32(filename), int32(flags|Int32FromInt32(O_LARGEFILE)), Int32FromUint32(mode), 0, 0))) } func Xposix_fadvise(tls *TLS, fd int32, base Toff_t, len1 Toff_t, advice int32) (r int32) { @@ -26001,7 +26007,7 @@ func Xposix_fadvise(tls *TLS, fd int32, base Toff_t, len1 Toff_t, advice int32) trc("tls=%v fd=%v base=%v len1=%v advice=%v, (%v:)", tls, fd, base, len1, advice, origin(2)) defer func() { trc("-> %v", r) }() } - return -X__syscall6(tls, int32(SYS_fadvise64_64), fd, int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32)), advice) + return int32(-X__syscall6(tls, int32(SYS_fadvise64_64), fd, int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32)), advice)) } func Xposix_fallocate(tls *TLS, fd int32, base Toff_t, len1 Toff_t) (r int32) { @@ -26009,7 +26015,7 @@ func Xposix_fallocate(tls *TLS, fd int32, base Toff_t, len1 Toff_t) (r int32) { trc("tls=%v fd=%v base=%v len1=%v, (%v:)", tls, fd, base, len1, origin(2)) defer func() { trc("-> %v", r) }() } - return -X__syscall6(tls, int32(SYS_fallocate), fd, Int32FromInt32(0), int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32))) + return int32(-X__syscall6(tls, int32(SYS_fallocate), fd, int32(Int32FromInt32(0)), int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32)))) } const FE_ALL_EXCEPT = 63 @@ -26425,19 +26431,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26461,14 +26467,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26622,7 +26628,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26648,16 +26654,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26799,10 +26805,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26838,7 +26844,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26867,15 +26873,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26900,7 +26906,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -27901,7 +27907,7 @@ func Xmsgctl(tls *TLS, q int32, cmd int32, buf uintptr) (r1 int32) { orig = buf buf = bp } - r = X__syscall6(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_msgctl), q, cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64), Int32FromInt32(0), int32(buf), Int32FromInt32(0)) + r = int32(X__syscall6(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_msgctl)), q, int32(cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64)), int32(Int32FromInt32(0)), int32(buf), int32(Int32FromInt32(0)))) if r >= 0 && cmd&(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) != 0 { buf = orig *(*Tmsqid_ds)(unsafe.Pointer(buf)) = *(*Tmsqid_ds)(unsafe.Pointer(bp)) @@ -27917,7 +27923,7 @@ func Xmsgget(tls *TLS, k Tkey_t, flag int32) (r int32) { trc("tls=%v k=%v flag=%v, (%v:)", tls, k, flag, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_msgget), k, flag))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_msgget)), k, flag))) } func Xmsgrcv(tls *TLS, q int32, m uintptr, len1 Tsize_t, type1 int32, flag int32) (r Tssize_t) { @@ -27931,7 +27937,7 @@ func Xmsgrcv(tls *TLS, q int32, m uintptr, len1 Tsize_t, type1 int32, flag int32 0: int32(m), 1: type1, } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_msgrcv), q, Int32FromUint32(len1), flag, int32(bp), 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_msgrcv)), q, Int32FromUint32(len1), flag, int32(bp), 0))) } func Xmsgsnd(tls *TLS, q int32, m uintptr, len1 Tsize_t, flag int32) (r int32) { @@ -27939,7 +27945,7 @@ func Xmsgsnd(tls *TLS, q int32, m uintptr, len1 Tsize_t, flag int32) (r int32) { trc("tls=%v q=%v m=%v len1=%v flag=%v, (%v:)", tls, q, m, len1, flag, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_msgsnd), q, Int32FromUint32(len1), flag, int32(m), 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_msgsnd)), q, Int32FromUint32(len1), flag, int32(m), 0))) } const GETALL = 13 @@ -28036,7 +28042,7 @@ func Xsemctl(tls *TLS, id int32, num int32, cmd int32, va uintptr) (r1 int32) { orig = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = bp + 4 } - r = X__syscall5(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_semctl), id, num, cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64), int32(bp)) + r = int32(X__syscall5(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_semctl)), id, num, int32(cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64)), int32(bp))) if r >= 0 && cmd&(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = orig *(*Tsemid_ds)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) = *(*Tsemid_ds)(unsafe.Pointer(bp + 4)) @@ -28058,7 +28064,7 @@ func Xsemget(tls *TLS, key Tkey_t, n int32, fl int32) (r int32) { if n > int32(USHRT_MAX) { return X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(EINVAL))) } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_semget), key, n, fl))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_semget)), key, n, fl))) } func Xsemop(tls *TLS, id int32, buf uintptr, n Tsize_t) (r int32) { @@ -28066,7 +28072,7 @@ func Xsemop(tls *TLS, id int32, buf uintptr, n Tsize_t) (r int32) { trc("tls=%v id=%v buf=%v n=%v, (%v:)", tls, id, buf, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_semop), id, Int32FromUint32(n), Int32FromInt32(0), int32(buf)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_semop)), id, Int32FromUint32(n), int32(Int32FromInt32(0)), int32(buf)))) } const NO_TIME32 = 0 @@ -28135,7 +28141,7 @@ func Xsemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r1 int } else { v3 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_semtimedop_time64), id, int32(buf), Int32FromUint32(n), int32(v3)) + r = int32(X__syscall4(tls, int32(SYS_semtimedop_time64), id, int32(buf), Int32FromUint32(n), int32(v3))) } if Bool(NO_TIME32 != 0) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -28147,7 +28153,7 @@ func Xsemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r1 int v5 = uint64(0x7fffffff) + (0+Uint64FromInt64(s))>>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v5), + 0: int32(Int32FromUint64(v5)), 1: ns, } v4 = bp + 16 @@ -28155,7 +28161,7 @@ func Xsemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r1 int v4 = uintptr(0) } ts = v4 - return X__syscall_ret(tls, Uint32FromInt32(X__syscall6(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_semtimedop), id, Int32FromUint32(n), Int32FromInt32(0), int32(buf), int32(ts)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall6(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_semtimedop)), id, Int32FromUint32(n), int32(Int32FromInt32(0)), int32(buf), int32(ts)))) } const SHMLBA = 4096 @@ -28240,7 +28246,7 @@ func Xshmat(tls *TLS, id int32, _addr uintptr, flag int32) (r uintptr) { var ret uint32 var v1 uintptr _, _ = ret, v1 - ret = Uint32FromInt32(X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_shmat), id, flag, int32(bp), int32(*(*uintptr)(unsafe.Pointer(bp))))))) + ret = Uint32FromInt32(X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_shmat)), id, flag, int32(bp), int32(*(*uintptr)(unsafe.Pointer(bp))))))) if ret > -Uint32FromInt32(SHMLBA) { v1 = uintptr(ret) } else { @@ -28265,7 +28271,7 @@ func Xshmctl(tls *TLS, id int32, cmd int32, buf uintptr) (r1 int32) { orig = buf buf = bp } - r = X__syscall6(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_shmctl), id, cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64), Int32FromInt32(0), int32(buf), Int32FromInt32(0)) + r = int32(X__syscall6(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_shmctl)), id, int32(cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64)), int32(Int32FromInt32(0)), int32(buf), int32(Int32FromInt32(0)))) if r >= 0 && cmd&(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) != 0 { buf = orig *(*Tshmid_ds)(unsafe.Pointer(buf)) = *(*Tshmid_ds)(unsafe.Pointer(bp)) @@ -28281,7 +28287,7 @@ func Xshmdt(tls *TLS, addr uintptr) (r int32) { trc("tls=%v addr=%v, (%v:)", tls, addr, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_shmdt), Int32FromInt32(0), Int32FromInt32(0), Int32FromInt32(0), int32(addr)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_shmdt)), int32(Int32FromInt32(0)), int32(Int32FromInt32(0)), int32(Int32FromInt32(0)), int32(addr)))) } func Xshmget(tls *TLS, key Tkey_t, size Tsize_t, flag int32) (r int32) { @@ -28292,7 +28298,7 @@ func Xshmget(tls *TLS, key Tkey_t, size Tsize_t, flag int32) (r int32) { if size > Uint32FromInt32(Int32FromInt32(INT32_MAX)) { size = Uint32FromUint32(0xffffffff) } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_ipc), Int32FromInt32(IPCOP_shmget), key, Int32FromUint32(size), flag))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_ipc), int32(Int32FromInt32(IPCOP_shmget)), key, Int32FromUint32(size), flag))) } type Tpasswd = struct { @@ -28457,15 +28463,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28587,7 +28595,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)<= 0 { (*Ttimex)(unsafe.Pointer(utx)).Fmodes = (*(*Tktimex64)(unsafe.Pointer(bp))).Fmodes (*Ttimex)(unsafe.Pointer(utx)).Foffset = int32((*(*Tktimex64)(unsafe.Pointer(bp))).Foffset) @@ -29489,9 +29497,9 @@ func Xclock_adjtime(tls *TLS, clock_id Tclockid_t, utx uintptr) (r1 int32) { Ftai: (*Ttimex)(unsafe.Pointer(utx)).Ftai, } if clock_id == CLOCK_REALTIME { - r = X__syscall1(tls, int32(SYS_adjtimex), int32(bp+208)) + r = int32(X__syscall1(tls, int32(SYS_adjtimex), int32(bp+208))) } else { - r = X__syscall2(tls, int32(SYS_clock_adjtime), clock_id, int32(bp+208)) + r = int32(X__syscall2(tls, int32(SYS_clock_adjtime), clock_id, int32(bp+208))) } if r >= 0 { (*Ttimex)(unsafe.Pointer(utx)).Fmodes = (*(*Tktimex)(unsafe.Pointer(bp + 208))).Fmodes @@ -29595,9 +29603,9 @@ func Xepoll_create1(tls *TLS, flags int32) (r1 int32) { } var r int32 _ = r - r = X__syscall1(tls, int32(SYS_epoll_create1), flags) + r = int32(X__syscall1(tls, int32(SYS_epoll_create1), flags)) if r == -int32(ENOSYS) && !(flags != 0) { - r = X__syscall1(tls, int32(SYS_epoll_create), Int32FromInt32(1)) + r = int32(X__syscall1(tls, int32(SYS_epoll_create), int32(Int32FromInt32(1)))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -29617,9 +29625,9 @@ func Xepoll_pwait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32, sigs uint } var r int32 _ = r - r = ___syscall_cp(tls, int32(SYS_epoll_pwait), fd, int32(ev), cnt, to, int32(sigs), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + r = int32(___syscall_cp(tls, int32(SYS_epoll_pwait), fd, int32(ev), cnt, to, int32(sigs), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)))) if r == -int32(ENOSYS) && !(sigs != 0) { - r = ___syscall_cp(tls, int32(SYS_epoll_wait), fd, int32(ev), cnt, to, 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_epoll_wait), fd, int32(ev), cnt, to, 0, 0)) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -29645,9 +29653,9 @@ func Xeventfd(tls *TLS, count uint32, flags int32) (r1 int32) { } var r int32 _ = r - r = X__syscall2(tls, int32(SYS_eventfd2), Int32FromUint32(count), flags) + r = int32(X__syscall2(tls, int32(SYS_eventfd2), Int32FromUint32(count), flags)) if r == -int32(ENOSYS) && !(flags != 0) { - r = X__syscall1(tls, int32(SYS_eventfd), Int32FromUint32(count)) + r = int32(X__syscall1(tls, int32(SYS_eventfd), Int32FromUint32(count))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -29844,7 +29852,7 @@ func Xfanotify_mark(tls *TLS, fanotify_fd int32, flags uint32, mask uint64, dfd trc("tls=%v fanotify_fd=%v flags=%v mask=%v dfd=%v pathname=%v, (%v:)", tls, fanotify_fd, flags, mask, dfd, pathname, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall6(tls, int32(SYS_fanotify_mark), fanotify_fd, Int32FromUint32(flags), Int32FromUint64(mask), Int32FromUint64(mask>>Int32FromInt32(32)), dfd, int32(pathname)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall6(tls, int32(SYS_fanotify_mark), fanotify_fd, Int32FromUint32(flags), int32(Int32FromUint64(mask)), int32(Int32FromUint64(mask>>Int32FromInt32(32))), dfd, int32(pathname)))) } const LOCK_EX = 2 @@ -29933,9 +29941,9 @@ func Xinotify_init1(tls *TLS, flags int32) (r1 int32) { } var r int32 _ = r - r = X__syscall1(tls, int32(SYS_inotify_init1), flags) + r = int32(X__syscall1(tls, int32(SYS_inotify_init1), flags)) if r == -int32(ENOSYS) && !(flags != 0) { - r = X__syscall0(tls, int32(SYS_inotify_init)) + r = int32(X__syscall0(tls, int32(SYS_inotify_init))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -30299,7 +30307,7 @@ func Xumount(tls *TLS, special uintptr) (r int32) { trc("tls=%v special=%v, (%v:)", tls, special, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_umount2), int32(special), Int32FromInt32(0)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_umount2), int32(special), int32(Int32FromInt32(0))))) } func Xumount2(tls *TLS, special uintptr, flags int32) (r int32) { @@ -30890,7 +30898,7 @@ func Xreboot(tls *TLS, type1 int32) (r int32) { trc("tls=%v type1=%v, (%v:)", tls, type1, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_reboot), Int32FromUint32(Uint32FromUint32(0xfee1dead)), Int32FromInt32(672274793), type1))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_reboot), Int32FromUint32(Uint32FromUint32(0xfee1dead)), int32(Int32FromInt32(672274793)), type1))) } func Xremap_file_pages(tls *TLS, addr uintptr, size Tsize_t, prot int32, pgoff Tsize_t, flags int32) (r int32) { @@ -30909,7 +30917,7 @@ func Xsbrk(tls *TLS, inc Tintptr_t) (r uintptr) { if inc != 0 { return uintptr(X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(ENOMEM)))) } - return uintptr(X__syscall1(tls, int32(SYS_brk), Int32FromInt32(0))) + return uintptr(X__syscall1(tls, int32(SYS_brk), int32(Int32FromInt32(0)))) } func Xsendfile(tls *TLS, out_fd int32, in_fd int32, ofs uintptr, count Tsize_t) (r Tssize_t) { @@ -31056,17 +31064,17 @@ func Xsignalfd(tls *TLS, fd int32, sigs uintptr, flags int32) (r int32) { } var ret int32 _ = ret - ret = X__syscall4(tls, int32(SYS_signalfd4), fd, int32(sigs), Int32FromInt32(_NSIG)/Int32FromInt32(8), flags) + ret = int32(X__syscall4(tls, int32(SYS_signalfd4), fd, int32(sigs), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), flags)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } - ret = X__syscall3(tls, int32(SYS_signalfd), fd, int32(sigs), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + ret = int32(X__syscall3(tls, int32(SYS_signalfd), fd, int32(sigs), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)))) if ret >= 0 { if flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if flags&int32(O_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } } return X__syscall_ret(tls, Uint32FromInt32(ret)) @@ -31090,7 +31098,7 @@ func Xstatx(tls *TLS, dirfd int32, path uintptr, flags int32, mask uint32, stx u var ret int32 var _ /* st at bp+0 */ Tstat _ = ret - ret = X__syscall5(tls, int32(SYS_statx), dirfd, int32(path), flags, Int32FromUint32(mask), int32(stx)) + ret = int32(X__syscall5(tls, int32(SYS_statx), dirfd, int32(path), flags, Int32FromUint32(mask), int32(stx))) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -31230,7 +31238,7 @@ func Xtimerfd_settime(tls *TLS, fd int32, flags int32, new1 uintptr, old uintptr 2: vs, 3: int64(vns), } - r = X__syscall4(tls, int32(SYS_timerfd_settime64), fd, flags, int32(bp), int32(old)) + r = int32(X__syscall4(tls, int32(SYS_timerfd_settime64), fd, flags, int32(bp), int32(old))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -31244,7 +31252,7 @@ func Xtimerfd_settime(tls *TLS, fd int32, flags int32, new1 uintptr, old uintptr 2: int32(vs), 3: vns, } - r = X__syscall4(tls, int32(SYS_timerfd_settime32), fd, flags, int32(bp+32), int32(bp+48)) + r = int32(X__syscall4(tls, int32(SYS_timerfd_settime32), fd, flags, int32(bp+32), int32(bp+48))) if !(r != 0) && old != 0 { (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp + 48)))[0]) (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp + 48)))[int32(1)] @@ -31267,12 +31275,12 @@ func Xtimerfd_gettime(tls *TLS, fd int32, cur uintptr) (r1 int32) { _ = r r = -int32(ENOSYS) if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_timerfd_gettime64), fd, int32(cur)) + r = int32(X__syscall2(tls, int32(SYS_timerfd_gettime64), fd, int32(cur))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, int32(SYS_timerfd_gettime32), fd, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_timerfd_gettime32), fd, int32(bp))) if !(r != 0) { (*Titimerspec)(unsafe.Pointer(cur)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[0]) (*Titimerspec)(unsafe.Pointer(cur)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp)))[int32(1)] @@ -31441,7 +31449,7 @@ func Xwait4(tls *TLS, pid Tpid_t, status uintptr, options int32, ru uintptr) (r1 v1 = uintptr(0) } dest = v1 - r = X__syscall4(tls, int32(SYS_wait4), pid, int32(status), options, int32(dest)) + r = int32(X__syscall4(tls, int32(SYS_wait4), pid, int32(status), options, int32(dest))) if r > 0 && ru != 0 && Bool(uint32(8) > uint32(4)) { Xmemcpy(tls, bp, dest, Uint32FromInt32(4)*Uint32FromInt64(4)) (*Trusage)(unsafe.Pointer(ru)).Fru_utime = Ttimeval{ @@ -31556,15 +31564,6 @@ func Xfremovexattr(tls *TLS, fd int32, name uintptr) (r int32) { return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_fremovexattr), fd, int32(name)))) } -type Tucontext_t2 = struct { - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - F__fpregs_mem [28]uint32 -} - func _dummy4(tls *TLS, msg uintptr, lm uintptr) (r uintptr) { return msg } @@ -31582,7 +31581,7 @@ func X__lctrans_cur(tls *TLS, msg uintptr) (r uintptr) { trc("tls=%v msg=%v, (%v:)", tls, msg, origin(2)) defer func() { trc("-> %v", r) }() } - return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + 5*4))) + return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale + 5*4))) } func _swapc(tls *TLS, x Tuint32_t, c int32) (r Tuint32_t) { @@ -32148,7 +32147,7 @@ func Xdcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n var _ /* z at bp+4 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = alt_modlen, catlen, catname, csp, dirlen, dirname, domlen, l, lm, loc, loclen, locname, locp, map1, modlen, modname, name, np, old_cats, old_errno, p1, plural, q, r, rem, rule, trans, v10, v11, v12, v14, v15, v17, v20, v3, v5, v6, v8, v9 defer func() { Xrealloc(tls, name, 0) }() - loc = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + loc = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale old_errno = *(*int32)(unsafe.Pointer(X__errno_location(tls))) /* match gnu gettext behaviour */ if !(msgid1 != 0) { @@ -98794,7 +98793,7 @@ func Xiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb ui *(*Tmbstate_t)(unsafe.Pointer(bp + 16)) = Tmbstate_t{} type1 = *(*uint8)(unsafe.Pointer(map1 + uintptr(-Int32FromInt32(1)))) totype = *(*uint8)(unsafe.Pointer(tomap + uintptr(-Int32FromInt32(1)))) - ploc = ___get_tp(tls) + 96 + ploc = uintptr(___get_tp(tls)) + 96 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if !(in != 0) || !(*(*uintptr)(unsafe.Pointer(in)) != 0) || !(*(*Tsize_t)(unsafe.Pointer(inb)) != 0) { return uint32(0) @@ -99828,7 +99827,7 @@ func X__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { trc("tls=%v item=%v, (%v:)", tls, item, origin(2)) defer func() { trc("-> %v", r) }() } - return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xnl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { @@ -100546,7 +100545,7 @@ func Xstrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) { @@ -100712,7 +100711,7 @@ func Xstrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize var ret Tssize_t _, _ = ap, ret ap = va - ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale, fmt, ap) + ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale, fmt, ap) _ = ap return ret } @@ -100787,7 +100786,7 @@ func Xstrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100876,7 +100875,7 @@ func X__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) { var global, old, v1, v2 Tlocale_t var self Tpthread_t _, _, _, _, _ = global, old, self, v1, v2 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) old = (*t__pthread)(unsafe.Pointer(self)).Flocale global = uintptr(unsafe.Pointer(&X__libc)) + 32 if new1 != 0 { @@ -100919,7 +100918,7 @@ func Xwcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100960,7 +100959,7 @@ func Xwcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -101004,12 +101003,12 @@ func X__cos(tls *TLS, x float64, y float64) (r1 float64) { } var hz, r, w, z Tdouble_t _, _, _, _ = hz, r, w, z - z = x * x - w = z * z - r = z*(_C1+z*(_C2+z*_C3)) + w*w*(_C4+z*(_C5+z*_C6)) - hz = Float64FromFloat64(0.5) * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = Tdouble_t(z*(_C1+Tdouble_t(z*(float64(_C2)+Tdouble_t(z*_C3))))) + Tdouble_t(Tdouble_t(w*w)*(float64(_C4)+Tdouble_t(z*(_C5+Tdouble_t(z*float64(_C6)))))) + hz = Tdouble_t(Float64FromFloat64(0.5) * z) w = Float64FromFloat64(1) - hz - return w + (Float64FromFloat64(1) - w - hz + (z*r - x*y)) + return float64(w + (Float64FromFloat64(1) - w - hz + (Tdouble_t(z*r) - Tdouble_t(x*y)))) } // C documentation @@ -101029,10 +101028,10 @@ func X__cosdf(tls *TLS, x float64) (r1 float32) { var r, w, z Tdouble_t _, _, _ = r, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _C21 + z*_C31 - return float32(Float64FromFloat64(1) + z*_C0 + w*_C11 + w*z*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = float64(_C21) + Tdouble_t(z*_C31) + return float32(Float64FromFloat64(1) + Tdouble_t(z*float64(_C0)) + Tdouble_t(w*_C11) + Tdouble_t(Tdouble_t(w*z)*r)) } // C documentation @@ -101057,7 +101056,7 @@ func X__expo2(tls *TLS, x float64, sign float64) (r float64) { scale = *(*float64)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexp(tls, x-_kln22) * (sign * scale) * scale + return float64(float64(Xexp(tls, x-_kln22)*float64(sign*scale)) * scale) } // C documentation @@ -101082,7 +101081,7 @@ func X__expo2f(tls *TLS, x float32, sign float32) (r float32) { scale = *(*float32)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexpf(tls, x-_kln23) * (sign * scale) * scale + return float32(float32(Xexpf(tls, x-_kln23)*float32(sign*scale)) * scale) } func X__fpclassify(tls *TLS, x float64) (r int32) { @@ -101280,7 +101279,7 @@ func X__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float64(v2 * y2) v4 = y goto _5 _5: @@ -101303,7 +101302,7 @@ func X__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float32(v2 * y2) v4 = y goto _5 _5: @@ -101384,14 +101383,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { } } else { if !(sign != 0) { - z = x - Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(2)*_pio2_1t + z = x - float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(2)*_pio2_1t) return int32(2) } else { - z = x + Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(2)*_pio2_1t + z = x + float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(2)*_pio2_1t) return -int32(2) } } @@ -101402,14 +101401,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(3)*_pio2_1t + z = x - float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(3)*_pio2_1t) return int32(3) } else { - z = x + Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(3)*_pio2_1t + z = x + float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(3)*_pio2_1t) return -int32(3) } } else { @@ -101417,14 +101416,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(4)*_pio2_1t + z = x - float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(4)*_pio2_1t) return int32(4) } else { - z = x + Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(4)*_pio2_1t + z = x + float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(4)*_pio2_1t) return -int32(4) } } @@ -101436,22 +101435,22 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { medium: ; /* rint(x/(pi/2)) */ - fn = x*_invpio2 + _toint - _toint + fn = Tdouble_t(x*_invpio2) + float64(_toint) - float64(_toint) n = int32(fn) - r = x - fn*_pio2_1 - w = fn * _pio2_1t /* 1st round, good to 85 bits */ + r = x - Tdouble_t(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) /* 1st round, good to 85 bits */ /* Matters with directed rounding. */ if r-w < -_pio4 { n-- fn-- - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - Tdouble_t(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } else { if r-w > _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - Tdouble_t(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -101460,17 +101459,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -101498,7 +101497,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * Float64FromFloat64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * Float64FromFloat64(1.6777216e+07)) goto _3 _3: ; @@ -101678,7 +101677,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101702,8 +101701,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101712,8 +101711,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101806,7 +101805,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101833,8 +101832,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101849,7 +101848,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101868,7 +101867,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -102059,19 +102058,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + float64(_toint1) - float64(_toint1) n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -102168,14 +102167,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + Tdouble_t(z*(float64(_S3)+Tdouble_t(z*_S4))) + Tdouble_t(Tdouble_t(z*w)*(float64(_S5)+Tdouble_t(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + Tdouble_t(v*(float64(_S1)+Tdouble_t(z*r))) } else { - return x - (z*(float64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(Tdouble_t(float64(0.5)*y)-Tdouble_t(v*r))) - y - Tdouble_t(v*float64(_S1))) } return r1 } @@ -102197,11 +102196,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = float64(_S31) + Tdouble_t(z*_S41) + s = Tdouble_t(z * x) + return float32(x + Tdouble_t(s*(float64(_S11)+Tdouble_t(z*_S21))) + Tdouble_t(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -102244,21 +102243,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + Tdouble_t(w*(_T[int32(3)]+Tdouble_t(w*(_T[int32(5)]+Tdouble_t(w*(_T[int32(7)]+Tdouble_t(w*(_T[int32(9)]+Tdouble_t(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + Tdouble_t(w*(_T[int32(4)]+Tdouble_t(w*(_T[int32(6)]+Tdouble_t(w*(_T[int32(8)]+Tdouble_t(w*(_T[int32(10)]+Tdouble_t(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + Tdouble_t(z*(Tdouble_t(s*(r+v))+y)) + Tdouble_t(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - Float64FromFloat64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(Float64FromFloat64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -102274,12 +102273,12 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { v2 = *(*Tuint64_t)(unsafe.Pointer(&w0))>>Int32FromInt32(32)<>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -102379,24 +102378,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -102439,24 +102438,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -102487,11 +102486,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102525,11 +102524,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102568,8 +102567,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102589,7 +102588,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102599,21 +102598,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102632,8 +102631,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = float64(z * (_pS03 + z*(_pS13+z*_pS23))) - q = float64(Float32FromFloat32(1) + z*_qS13) + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = float64(Float32FromFloat32(1) + float32(z*_qS13)) return float32(p / q) } @@ -102650,7 +102649,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102659,12 +102658,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102708,11 +102707,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint32(8) == uint32(4) { @@ -102721,7 +102720,7 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } } @@ -102773,11 +102772,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint32(4) == uint32(4) { @@ -102873,7 +102872,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -103513,8 +103512,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + Tdouble_t(r*(float64(_P1)+Tdouble_t(r*_P2))) + Tdouble_t(Tdouble_t(Tdouble_t(r*r)*r)*(float64(_P3)+Tdouble_t(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103529,11 +103528,11 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = (*(*Tuint64_t)(unsafe.Pointer(bp)) + uint64(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103571,7 +103570,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103585,14 +103584,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103607,7 +103606,7 @@ func Xcbrtl(tls *TLS, x float64) (r float64) { const DBL_EPSILON5 = 2.220446049250313e-16 -var _toint2 = Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16) +var _toint2 = float64(Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16)) func Xceil(tls *TLS, x3 float64) (r float64) { if __ccgo_strace { @@ -103662,7 +103661,7 @@ func Xceil(tls *TLS, x3 float64) (r float64) { return v1 } if y3 < Float64FromInt32(0) { - return x3 + y3 + Float64FromInt32(1) + return float64(x3 + y3 + Float64FromInt32(1)) } return x3 + y3 } @@ -103849,7 +103848,7 @@ func Xcos(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } return float64(1) @@ -103881,10 +103880,10 @@ const M_PI_23 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _c1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _c2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _c3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _c4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _c1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _c2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _c3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _c4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xcosf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -104014,19 +104013,19 @@ func Xcosh(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } return Float64FromInt32(1) } t = Xexpm1(tls, x3) - return Float64FromInt32(1) + t*t/(Float64FromInt32(2)*(Float64FromInt32(1)+t)) + return Float64FromInt32(1) + float64(t*t)/float64(Float64FromInt32(2)*(Float64FromInt32(1)+t)) } /* |x| < log(DBL_MAX) */ if w < uint32(0x40862e42) { t = Xexp(tls, x3) /* note: if x>log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -104076,12 +104075,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -104175,10 +104174,10 @@ var _sb7 = -Float64FromFloat64(22.44095244658582) /* 0xC03670E2, 0x42712D62 */ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s - s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) - return Float64FromInt32(1) - _erx - P/Q + s = float64(Xfabs(tls, x) - Float64FromInt32(1)) + P = float64(_pa0) + Tdouble_t(s*(_pa1+Tdouble_t(s*(float64(_pa2)+Tdouble_t(s*(_pa3+Tdouble_t(s*(float64(_pa4)+Tdouble_t(s*(_pa5+Tdouble_t(s*float64(_pa6)))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+Tdouble_t(s*(_qa2+Tdouble_t(s*(_qa3+Tdouble_t(s*(_qa4+Tdouble_t(s*(_qa5+Tdouble_t(s*_qa6))))))))))) + return float64(Float64FromInt32(1)-_erx) - P/Q } func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { @@ -104190,18 +104189,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = float64(Float64FromInt32(1) / float64(x*x)) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = Float64FromFloat64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = float64(_ra0) + Tdouble_t(s*(float64(_ra1)+Tdouble_t(s*(float64(_ra2)+Tdouble_t(s*(float64(_ra3)+Tdouble_t(s*(float64(_ra4)+Tdouble_t(s*(float64(_ra5)+Tdouble_t(s*(float64(_ra6)+Tdouble_t(s*float64(_ra7)))))))))))))) + S = Float64FromFloat64(1) + Tdouble_t(s*(_sa1+Tdouble_t(s*(_sa2+Tdouble_t(s*(_sa3+Tdouble_t(s*(_sa4+Tdouble_t(s*(_sa5+Tdouble_t(s*(_sa6+Tdouble_t(s*(_sa7+Tdouble_t(s*float64(_sa8)))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = Float64FromFloat64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = float64(_rb0) + Tdouble_t(s*(float64(_rb1)+Tdouble_t(s*(float64(_rb2)+Tdouble_t(s*(float64(_rb3)+Tdouble_t(s*(float64(_rb4)+Tdouble_t(s*(float64(_rb5)+Tdouble_t(s*float64(_rb6)))))))))))) + S = Float64FromFloat64(1) + Tdouble_t(s*(_sb1+Tdouble_t(s*(_sb2+Tdouble_t(s*(_sb3+Tdouble_t(s*(_sb4+Tdouble_t(s*(_sb5+Tdouble_t(s*(_sb6+Tdouble_t(s*float64(_sb7)))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = float64(_rb01) + s*(float64(_rb11)+s*(float64(_rb21)+s*(float64(_rb31)+s*(float64(_rb41)+s*(float64(_rb51)+s*float64(_rb61)))))) - S = Float64FromFloat32(1) + s*(float64(_sb11)+s*(float64(_sb21)+s*(float64(_sb31)+s*(float64(_sb41)+s*(float64(_sb51)+s*(float64(_sb61)+s*float64(_sb71))))))) + R = float64(_rb01) + Tfloat_t(s*(float64(_rb11)+Tfloat_t(s*(float64(_rb21)+Tfloat_t(s*(float64(_rb31)+Tfloat_t(s*(float64(_rb41)+Tfloat_t(s*(float64(_rb51)+Tfloat_t(s*float64(_rb61)))))))))))) + S = Float64FromFloat32(1) + Tfloat_t(s*(float64(_sb11)+Tfloat_t(s*(float64(_sb21)+Tfloat_t(s*(float64(_sb31)+Tfloat_t(s*(float64(_sb41)+Tfloat_t(s*(float64(_sb51)+Tfloat_t(s*(float64(_sb61)+Tfloat_t(s*float64(_sb71)))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, float32(float64((z-x)*(z+x))+R/S)) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32(Tfloat_t((z-x)*(z+x))+R/S))) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -104408,13 +104407,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -104449,14 +104448,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -104469,7 +104468,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -104513,7 +104512,7 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo /* k > 0, the exponent of scale might have overflowed by <= 460. */ sbits -= Uint64FromUint64(1009) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = Float64FromFloat64(5.486124068793689e+303) * (scale + scale*tmp) + y3 = Tdouble_t(Float64FromFloat64(5.486124068793689e+303) * (scale + Tdouble_t(scale*tmp))) y = y3 v1 = y goto _2 @@ -104523,9 +104522,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo /* k < 0, need special care in the subnormal range. */ sbits += Uint64FromUint64(1022) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = scale + scale*tmp + y3 = scale + Tdouble_t(scale*tmp) if y3 < Float64FromFloat64(1) { - lo = scale - y3 + scale*tmp + lo = scale - y3 + Tdouble_t(scale*tmp) hi = Float64FromFloat64(1) + y3 lo = Float64FromFloat64(1) - hi + y3 + lo y = hi + lo @@ -104542,9 +104541,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo v5 = y1 goto _6 _6: - y2 = v5 * float64(2.2250738585072014e-308) + y2 = float64(v5 * float64(2.2250738585072014e-308)) } - y3 = Float64FromFloat64(2.2250738585072014e-308) * y3 + y3 = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * y3) y = y3 v7 = y goto _8 @@ -104595,7 +104594,7 @@ func Xexp(tls *TLS, x1 float64) (r1 float64) { } /* exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]. */ /* x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]. */ - z = X__exp_data.Finvln2N * x1 + z = Tdouble_t(X__exp_data.Finvln2N * x1) /* z - kd is in [-1, 1] in non-nearest rounding modes. */ y = z + X__exp_data.Fshift v2 = y @@ -104605,7 +104604,7 @@ _3: v4 = kd ki = *(*Tuint64_t)(unsafe.Pointer(&v4)) kd -= X__exp_data.Fshift - r = x1 + kd*X__exp_data.Fnegln2hiN + kd*X__exp_data.Fnegln2loN + r = x1 + Tdouble_t(kd*X__exp_data.Fnegln2hiN) + Tdouble_t(kd*X__exp_data.Fnegln2loN) /* 2^(k/N) ~= scale * (1 + tail). */ idx = uint64(2) * (ki % Uint64FromInt32(Int32FromInt32(1)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104662,8 +104661,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104738,10 +104737,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104803,7 +104802,7 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl /* k > 0, the exponent of scale might have overflowed by 1. */ sbits -= Uint64FromUint64(1) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = Float64FromInt32(2) * (scale + scale*tmp) + y3 = Tdouble_t(Float64FromInt32(2) * (scale + Tdouble_t(scale*tmp))) y = y3 v1 = y goto _2 @@ -104813,9 +104812,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl /* k < 0, need special care in the subnormal range. */ sbits += Uint64FromUint64(1022) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = scale + scale*tmp + y3 = scale + Tdouble_t(scale*tmp) if y3 < Float64FromFloat64(1) { - lo = scale - y3 + scale*tmp + lo = scale - y3 + Tdouble_t(scale*tmp) hi = Float64FromFloat64(1) + y3 lo = Float64FromFloat64(1) - hi + y3 + lo y = hi + lo @@ -104832,9 +104831,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl v5 = y1 goto _6 _6: - y2 = v5 * float64(2.2250738585072014e-308) + y2 = float64(v5 * float64(2.2250738585072014e-308)) } - y3 = Float64FromFloat64(2.2250738585072014e-308) * y3 + y3 = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * y3) y = y3 v7 = y goto _8 @@ -104909,17 +104908,17 @@ _5: sbits = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 112 + uintptr(idx+uint64(1))*8)) + top /* exp2(x) = 2^(k/N) * 2^r ~= scale + scale * (tail + 2^r - 1). */ /* Evaluation is optimized assuming superscalar pipelined execution. */ - r2 = r * r + r2 = Tdouble_t(r * r) /* Without fma the worst case error is 0.5/N ulp larger. */ /* Worst case error is less than 0.5+0.86/N+(abs poly error * 2^53) ulp. */ - tmp = tail + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 2*8))) + r2*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 4*8))) + tmp = tail + Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72))) + Tdouble_t(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 1*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 2*8))))) + Tdouble_t(Tdouble_t(r2*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 3*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 4*8))))) if abstop == uint32(0) { return _specialcase1(tls, tmp, sbits, ki) } scale = *(*float64)(unsafe.Pointer(&sbits)) /* Note: tmp == 0 or |tmp| > 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -104987,11 +104986,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + Float64FromFloat64(1) if k == int32(1024) { - y3 = y3 * Float64FromFloat64(2) * Float64FromFloat64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*Float64FromFloat64(2)) * Float64FromFloat64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } - return y3 - Float64FromFloat64(1) + return float64(y3 - Float64FromFloat64(1)) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + float64(Float64FromInt32(1)-*(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -105325,10 +105324,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float64(k) - hi = float64(x3) - t*float64(_ln2_hi1) /* t*ln2_hi is exact here */ - lo = t * float64(_ln2_lo1) + hi = float64(x3) - Tfloat_t(t*float64(_ln2_hi1)) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * float64(_ln2_lo1)) } x3 = float32(hi - lo) c = hi - float64(x3) - lo @@ -105336,7 +105335,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint32(4) == uint32(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint32(4) == uint32(8) { y1 = float64(x3 * x3) @@ -105351,42 +105350,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = float64(Float32FromFloat32(0.5) * x3) - hxs = float64(x3) * hfx - r1 = Float64FromFloat32(1) + hxs*(float64(_Q11)+hxs*float64(_Q21)) - t = Float64FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float64FromFloat32(6) - float64(x3)*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(float64(x3) * hfx) + r1 = Float64FromFloat32(1) + Tfloat_t(hxs*(float64(_Q11)+Tfloat_t(hxs*float64(_Q21)))) + t = Float64FromFloat32(3) - Tfloat_t(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float64FromFloat32(6) - Tfloat_t(float64(x3)*t)))) if k == 0 { /* c is 0 */ - return float32(float64(x3) - (float64(x3)*e - hxs)) + return float32(float64(x3) - (Tfloat_t(float64(x3)*e) - hxs)) } - e = float64(x3)*(e-c) - c + e = Tfloat_t(float64(x3)*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return float32(Float64FromFloat32(0.5)*(float64(x3)-e) - Float64FromFloat32(0.5)) + return float32(Tfloat_t(Float64FromFloat32(0.5)*(float64(x3)-e)) - Float64FromFloat32(0.5)) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { return float32(float64(-Float32FromFloat32(2)) * (e - float64(x3+Float32FromFloat32(0.5)))) } - return float32(Float64FromFloat32(1) + Float64FromFloat32(2)*(float64(x3)-e)) + return float32(Float64FromFloat32(1) + Tfloat_t(Float64FromFloat32(2)*(float64(x3)-e))) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = float64(*(*float32)(unsafe.Pointer(bp))) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = float64(x3) - e + Float64FromFloat32(1) if k == int32(128) { - y3 = y3 * Float64FromFloat32(2) * Float64FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float64FromFloat32(2)) * Float64FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return float32(y3 - Float64FromFloat32(1)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (float64(x3) - e + float64(Float32FromInt32(1)-*(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((float64(x3) - e + float64(Float32FromInt32(1)-*(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (float64(x3) - (e + float64(*(*float32)(unsafe.Pointer(bp)))) + Float64FromInt32(1)) * twopk + y3 = Tfloat_t((float64(x3) - (e + float64(*(*float32)(unsafe.Pointer(bp)))) + Float64FromInt32(1)) * twopk) } return float32(y3) } @@ -105575,7 +105574,7 @@ _2: const DBL_EPSILON7 = 2.220446049250313e-16 -var _toint3 = Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16) +var _toint3 = float64(Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16)) func Xfloor(tls *TLS, x3 float64) (r float64) { if __ccgo_strace { @@ -105630,7 +105629,7 @@ func Xfloor(tls *TLS, x3 float64) (r float64) { return float64(v1) } if y3 > Float64FromInt32(0) { - return x3 + y3 - Float64FromInt32(1) + return float64(x3 + y3 - Float64FromInt32(1)) } return x3 + y3 } @@ -105732,7 +105731,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105788,11 +105787,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { ny = _normalize(tls, y) nz = _normalize(tls, z) if nx.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y + z + return float64(x1*y) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y + z + return float64(x1*y) + z } return z } @@ -105887,7 +105886,7 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { } } else { /* exact +-0 */ - return x1*y + z + return float64(x1*y) + z } } e -= d @@ -105908,8 +105907,8 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105919,11 +105918,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { i = -i } r = float64(i) - r = Float64FromInt32(2)*r - c /* remove top bit */ + r = float64(Float64FromInt32(2)*r) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r - r += tiny * tiny * (r - r) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r) + r += float64(Tdouble_t(tiny*tiny) * (r - r)) } } else { /* only round once when scaled */ @@ -106246,11 +106245,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -106310,7 +106309,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -106387,11 +106386,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106451,7 +106450,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106509,7 +106508,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106564,9 +106563,9 @@ func Xfrexpf(tls *TLS, x float32, e uintptr) (r float32) { } *(*int32)(unsafe.Pointer(e)) = ee - int32(0x7e) p1 = bp - *(*Tuint32_t)(unsafe.Pointer(p1)) = *(*Tuint32_t)(unsafe.Pointer(p1)) & Uint32FromUint32(0x807fffff) + *(*Tuint32_t)(unsafe.Pointer(p1)) = Tuint32_t(*(*Tuint32_t)(unsafe.Pointer(p1)) & Uint32FromUint32(0x807fffff)) p2 = bp - *(*Tuint32_t)(unsafe.Pointer(p2)) = *(*Tuint32_t)(unsafe.Pointer(p2)) | Uint32FromUint32(0x3f000000) + *(*Tuint32_t)(unsafe.Pointer(p2)) = Tuint32_t(*(*Tuint32_t)(unsafe.Pointer(p2)) | Uint32FromUint32(0x3f000000)) return *(*float32)(unsafe.Pointer(bp)) } @@ -106583,11 +106582,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * float64(Float64FromFloat64(1.34217728e+08)+Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106685,7 +106684,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106764,7 +106763,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return float32(z * float64(Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))))) + return float32(z * float64(Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y)))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -106957,8 +106956,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106967,10 +106966,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -106998,7 +106997,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -107008,16 +107007,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -107063,12 +107062,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -107169,10 +107168,10 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = Float64FromFloat64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) - return Float64FromFloat64(1) + r/s + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 3*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 4*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = Float64FromFloat64(1) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(q))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 3*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) + return float64(Float64FromFloat64(1) + r/s) } // C documentation @@ -107277,10 +107276,10 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = Float64FromFloat64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) - return (-Float64FromFloat64(0.125) + r/s) / x + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 3*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 4*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = Float64FromFloat64(1) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(q))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 3*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 4*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) + return (float64(-Float64FromFloat64(0.125)) + r/s) / x } var _invsqrtpi1 = float32(0.56418961287) /* 0x3f106ebb */ @@ -107301,8 +107300,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107311,10 +107310,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -107341,7 +107340,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -107350,13 +107349,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -107397,12 +107396,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107502,9 +107501,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 4*4))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 4*4)))))))))))) return float32(Float64FromFloat32(1) + r/s) } @@ -107610,9 +107609,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))))))))) return float32((float64(-Float32FromFloat32(0.125)) + r/s) / float64(x)) } @@ -107639,8 +107638,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107649,13 +107648,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107685,21 +107684,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107745,10 +107744,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107848,10 +107847,10 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = Float64FromFloat64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) - return Float64FromFloat64(1) + r/s + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 3*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 4*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = Float64FromFloat64(1) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(q))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 3*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) + return float64(Float64FromFloat64(1) + r/s) } /* For x >= 8, the asymptotic expansions of qone is @@ -107955,10 +107954,10 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = Float64FromFloat64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) - return (Float64FromFloat64(0.375) + r/s) / x + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 3*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(p + 4*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = Float64FromFloat64(1) + Tdouble_t(z*(*(*float64)(unsafe.Pointer(q))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 1*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 2*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 3*8))+Tdouble_t(z*(*(*float64)(unsafe.Pointer(q + 4*8))+Tdouble_t(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) + return float64((Float64FromFloat64(0.375) + r/s) / x) } var _invsqrtpi3 = float32(0.56418961287) /* 0x3f106ebb */ @@ -107975,8 +107974,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107985,13 +107984,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -108021,20 +108020,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -108076,10 +108075,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -108179,9 +108178,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 4*4))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 4*4)))))))))))) return float32(Float64FromFloat32(1) + r/s) } @@ -108286,9 +108285,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))))))))) return float32((Float64FromFloat32(0.375) + r/s) / float64(x)) } @@ -108363,7 +108362,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -108374,7 +108373,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -108388,7 +108387,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -108407,16 +108406,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108426,7 +108425,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -108442,7 +108441,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -108450,7 +108449,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108464,7 +108463,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108481,9 +108480,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108565,7 +108564,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108578,7 +108577,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108638,7 +108637,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108651,7 +108650,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108669,16 +108668,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108688,7 +108687,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108704,7 +108703,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108712,7 +108711,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108726,7 +108725,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108743,9 +108742,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108808,7 +108807,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -108925,8 +108924,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -108973,7 +108972,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<= uint32(0x3FCDA661) { - y = x - (_tc - Float64FromFloat64(1)) + y = float64(x - (_tc - Float64FromFloat64(1))) i = int32(1) } else { y = x @@ -109031,31 +109030,31 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { } switch i { case 0: - z = y * y - p1 = _a0 + z*(_a2+z*(_a4+z*(_a6+z*(_a8+z*_a10)))) - p2 = z * (_a1 + z*(_a3+z*(_a5+z*(_a7+z*(_a9+z*_a11))))) - p = y*p1 + p2 - r += p - Float64FromFloat64(0.5)*y + z = Tdouble_t(y * y) + p1 = _a0 + Tdouble_t(z*(_a2+Tdouble_t(z*(_a4+Tdouble_t(z*(_a6+Tdouble_t(z*(_a8+Tdouble_t(z*_a10))))))))) + p2 = Tdouble_t(z * (_a1 + Tdouble_t(z*(_a3+Tdouble_t(z*(_a5+Tdouble_t(z*(_a7+Tdouble_t(z*(_a9+Tdouble_t(z*_a11))))))))))) + p = Tdouble_t(y*p1) + p2 + r += p - Tdouble_t(Float64FromFloat64(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t0 + w*(_t3+w*(_t6+w*(_t9+w*_t12))) /* parallel comp */ - p2 = _t1 + w*(_t4+w*(_t7+w*(_t10+w*_t13))) - p3 = _t2 + w*(_t5+w*(_t8+w*(_t11+w*_t14))) - p = z*p1 - (_tt - w*(p2+y*p3)) - r += _tf + p + z = Tdouble_t(y * y) + w = Tdouble_t(z * y) + p1 = _t0 + Tdouble_t(w*(float64(_t3)+Tdouble_t(w*(_t6+Tdouble_t(w*(float64(_t9)+Tdouble_t(w*_t12))))))) /* parallel comp */ + p2 = float64(_t1) + Tdouble_t(w*(_t4+Tdouble_t(w*(float64(_t7)+Tdouble_t(w*(_t10+Tdouble_t(w*float64(_t13)))))))) + p3 = _t2 + Tdouble_t(w*(float64(_t5)+Tdouble_t(w*(_t8+Tdouble_t(w*(float64(_t11)+Tdouble_t(w*_t14))))))) + p = Tdouble_t(z*p1) - (float64(_tt) - Tdouble_t(w*(p2+Tdouble_t(y*p3)))) + r += float64(_tf) + p case int32(2): - p1 = y * (_u0 + y*(_u1+y*(_u2+y*(_u3+y*(_u4+y*_u5))))) - p2 = Float64FromFloat64(1) + y*(_v1+y*(_v2+y*(_v3+y*(_v4+y*_v5)))) - r += -Float64FromFloat64(0.5)*y + p1/p2 + p1 = Tdouble_t(y * (float64(_u0) + Tdouble_t(y*(_u1+Tdouble_t(y*(_u2+Tdouble_t(y*(_u3+Tdouble_t(y*(_u4+Tdouble_t(y*_u5))))))))))) + p2 = Float64FromFloat64(1) + Tdouble_t(y*(_v1+Tdouble_t(y*(_v2+Tdouble_t(y*(_v3+Tdouble_t(y*(_v4+Tdouble_t(y*_v5))))))))) + r += Tdouble_t(float64(-Float64FromFloat64(0.5))*y) + p1/p2 } } else { if ix < uint32(0x40200000) { /* x < 8.0 */ i = int32(x) y = x - float64(i) - p = y * (_s0 + y*(_s1+y*(_s2+y*(_s3+y*(_s4+y*(_s5+y*_s6)))))) - q = Float64FromFloat64(1) + y*(_r1+y*(_r2+y*(_r3+y*(_r4+y*(_r5+y*_r6))))) - r = Float64FromFloat64(0.5)*y + p/q + p = Tdouble_t(y * (float64(_s0) + Tdouble_t(y*(_s1+Tdouble_t(y*(_s2+Tdouble_t(y*(_s3+Tdouble_t(y*(_s4+Tdouble_t(y*(_s5+Tdouble_t(y*_s6))))))))))))) + q = Float64FromFloat64(1) + Tdouble_t(y*(_r1+Tdouble_t(y*(_r2+Tdouble_t(y*(_r3+Tdouble_t(y*(_r4+Tdouble_t(y*(_r5+Tdouble_t(y*_r6))))))))))) + r = Tdouble_t(Float64FromFloat64(0.5)*y) + p/q z = Float64FromFloat64(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -109079,11 +109078,11 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { if ix < uint32(0x43900000) { /* 8.0 <= x < 2**58 */ t = Xlog(tls, x) z = float64(1) / x - y = z * z - w = _w0 + z*(_w1+y*(_w2+y*(_w3+y*(_w4+y*(_w5+y*_w6))))) - r = (x-Float64FromFloat64(0.5))*(t-Float64FromFloat64(1)) + w + y = Tdouble_t(z * z) + w = _w0 + Tdouble_t(z*(_w1+Tdouble_t(y*(float64(_w2)+Tdouble_t(y*(_w3+Tdouble_t(y*(float64(_w4)+Tdouble_t(y*(_w5+Tdouble_t(y*float64(_w6)))))))))))) + r = Tdouble_t(float64(x-Float64FromFloat64(0.5))*(t-Float64FromFloat64(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlog(tls, x) - float64(1)) + r = Tdouble_t(x * (Xlog(tls, x) - float64(1))) } } } @@ -109182,10 +109181,10 @@ func _sin_pi1(tls *TLS, x float32) (r float32) { var y Tdouble_t _, _ = n, y /* spurious inexact if odd int */ - x = Float32FromInt32(2) * (x*Float32FromFloat32(0.5) - Xfloorf(tls, x*Float32FromFloat32(0.5))) /* x mod 2.0 */ - n = int32(x * Float32FromInt32(4)) + x = float32(Float32FromInt32(2) * (float32(x*Float32FromFloat32(0.5)) - Xfloorf(tls, float32(x*Float32FromFloat32(0.5))))) /* x mod 2.0 */ + n = int32(float32(x * Float32FromInt32(4))) n = (n + int32(1)) / int32(2) - y = float64(x - float32(n)*Float32FromFloat32(0.5)) + y = float64(x - float32(float32(n)*Float32FromFloat32(0.5))) y *= Float64FromFloat64(3.141592653589793) switch n { default: /* case 4: */ @@ -109230,7 +109229,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { sign = Int32FromUint32(*(*Tuint32_t)(unsafe.Pointer(bp)) >> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -109250,7 +109249,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -109288,31 +109287,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -109336,11 +109335,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109475,17 +109474,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + Tdouble_t(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+Tdouble_t(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+Tdouble_t(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * Float64FromFloat64(1.34217728e+08) + w = Tdouble_t(r * Float64FromFloat64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109507,7 +109506,7 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) ix -= Uint64FromUint64(52) << Int32FromInt32(52) } @@ -109530,25 +109529,25 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { /* log(x) = log1p(z/c-1) + log(c) + k*Ln2. */ /* r ~= z/c - 1, |r| < 1/(2*N). */ /* rounding error: 0x1p-55/N + 0x1p-66. */ - r = (z - (*(*struct { + r = Tdouble_t((z - (*(*struct { Fchi float64 Fclo float64 })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 2192 + uintptr(i)*16))).Fchi - (*(*struct { Fchi float64 Fclo float64 - })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 2192 + uintptr(i)*16))).Fclo) * invc + })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 2192 + uintptr(i)*16))).Fclo) * invc) kd = float64(k) /* hi + lo = r + log(c) + k*Ln2. */ - w = kd*X__log_data.Fln2hi + logc + w = Tdouble_t(kd*X__log_data.Fln2hi) + logc hi = w + r - lo = w - hi + r + kd*X__log_data.Fln2lo + lo = w - hi + r + Tdouble_t(kd*X__log_data.Fln2lo) /* log(x) = lo + (log1p(r) - r) + hi. */ - r2 = r * r /* rounding error: 0x1p-54/N^2. */ + r2 = Tdouble_t(r * r) /* rounding error: 0x1p-54/N^2. */ /* Worst case error if |y| > 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+Tdouble_t(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109595,7 +109594,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109621,12 +109620,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109716,19 +109715,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = float64(x - Float32FromFloat32(1)) s = f / (Float64FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (float64(_Lg21) + w*float64(_Lg41)) - t2 = z * (float64(_Lg11) + w*float64(_Lg31)) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (float64(_Lg21) + Tfloat_t(w*float64(_Lg41)))) + t2 = Tfloat_t(z * (float64(_Lg11) + Tfloat_t(w*float64(_Lg31)))) R = t2 + t1 - hfsq = Float64FromFloat32(0.5) * f * f + hfsq = Tfloat_t(Tfloat_t(Float64FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = float32(hi) *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = float64(*(*float32)(unsafe.Pointer(bp))) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float64(k) - return float32(dk*float64(_log10_2lo1) + (lo+hi)*float64(_ivln10lo1) + lo*float64(_ivln10hi1) + hi*float64(_ivln10hi1) + dk*float64(_log10_2hi1)) + return float32(Tfloat_t(dk*float64(_log10_2lo1)) + Tfloat_t((lo+hi)*float64(_ivln10lo1)) + Tfloat_t(lo*float64(_ivln10hi1)) + Tfloat_t(hi*float64(_ivln10hi1)) + Tfloat_t(dk*float64(_log10_2hi1))) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109828,17 +109827,17 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { /* reduce u into [sqrt(2)/2, sqrt(2)] */ hu = hu&uint32(0x000fffff) + uint32(0x3fe6a09e) *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + Tdouble_t(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + Tdouble_t(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v14 = y goto _15 @@ -110130,7 +110129,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -110152,14 +110151,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -110225,10 +110224,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< 0, the exponent of scale might have overflowed by <= 460. */ sbits -= Uint64FromUint64(1009) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = Float64FromFloat64(5.486124068793689e+303) * (scale + scale*tmp) + y3 = Tdouble_t(Float64FromFloat64(5.486124068793689e+303) * (scale + Tdouble_t(scale*tmp))) y = y3 v1 = y goto _2 @@ -111072,13 +111071,13 @@ func _specialcase2(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl sbits += Uint64FromUint64(1022) << Int32FromInt32(52) /* Note: sbits is signed scale. */ scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = scale + scale*tmp + y3 = scale + Tdouble_t(scale*tmp) if Xfabs(tls, y3) < float64(1) { one = Float64FromFloat64(1) if y3 < Float64FromFloat64(0) { - one = -Float64FromFloat64(1) + one = float64(-Float64FromFloat64(1)) } - lo = scale - y3 + scale*tmp + lo = scale - y3 + Tdouble_t(scale*tmp) hi = one + y3 lo = one - hi + y3 + lo y = hi + lo @@ -111096,9 +111095,9 @@ func _specialcase2(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl v6 = y1 goto _7 _7: - y2 = v6 * float64(2.2250738585072014e-308) + y2 = float64(v6 * float64(2.2250738585072014e-308)) } - y3 = Float64FromFloat64(2.2250738585072014e-308) * y3 + y3 = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * y3) y = y3 v8 = y goto _9 @@ -111143,7 +111142,7 @@ func _exp_inline(tls *TLS, x1 Tdouble_t, xtail Tdouble_t, sign_bias Tuint32_t) ( } /* exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]. */ /* x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]. */ - z = X__exp_data.Finvln2N * x1 + z = Tdouble_t(X__exp_data.Finvln2N * x1) /* z - kd is in [-1, 1] in non-nearest rounding modes. */ y = z + X__exp_data.Fshift v3 = y @@ -111153,7 +111152,7 @@ _4: v5 = kd ki = *(*Tuint64_t)(unsafe.Pointer(&v5)) kd -= X__exp_data.Fshift - r = x1 + kd*X__exp_data.Fnegln2hiN + kd*X__exp_data.Fnegln2loN + r = x1 + Tdouble_t(kd*X__exp_data.Fnegln2hiN) + Tdouble_t(kd*X__exp_data.Fnegln2loN) /* The code assumes 2^-200 < |xtail| < 2^-8/N. */ r += xtail /* 2^(k/N) ~= scale * (1 + tail). */ @@ -111165,17 +111164,17 @@ _4: sbits = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 112 + uintptr(idx+uint64(1))*8)) + top /* exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1). */ /* Evaluation is optimized assuming superscalar pipelined execution. */ - r2 = r * r + r2 = Tdouble_t(r * r) /* Without fma the worst case error is 0.25/N ulp larger. */ /* Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp. */ - tmp = tail + r + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(5)-Int32FromInt32(EXP_POLY_ORDER))*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(6)-Int32FromInt32(EXP_POLY_ORDER))*8))) + r2*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(7)-Int32FromInt32(EXP_POLY_ORDER))*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(8)-Int32FromInt32(EXP_POLY_ORDER))*8))) + tmp = tail + r + Tdouble_t(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(5)-Int32FromInt32(EXP_POLY_ORDER))*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(6)-Int32FromInt32(EXP_POLY_ORDER))*8))))) + Tdouble_t(Tdouble_t(r2*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(7)-Int32FromInt32(EXP_POLY_ORDER))*8))+Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(8)-Int32FromInt32(EXP_POLY_ORDER))*8))))) if abstop == uint32(0) { return _specialcase2(tls, tmp, sbits, ki) } scale = *(*float64)(unsafe.Pointer(&sbits)) /* Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -111263,17 +111262,17 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } /* Without the barrier some versions of clang hoist the 1/x2 and thus division by zero exception can be signaled spuriously. */ if iy>>int32(63) != 0 { - y = Float64FromInt32(1) / x2 + y = float64(Float64FromInt32(1) / x2) v8 = y goto _9 _9: @@ -111326,7 +111325,7 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) ix -= Uint64FromUint64(52) << Int32FromInt32(52) @@ -111340,8 +111339,8 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { v17 = *(*Tuint64_t)(unsafe.Pointer(&v18)) & (-Uint64FromUint64(1) << Int32FromInt32(27)) lhi = *(*float64)(unsafe.Pointer(&v17)) llo = hi - lhi + *(*Tdouble_t)(unsafe.Pointer(bp)) - ehi = yhi * lhi - elo = ylo*lhi + y1*llo /* |elo| < |ehi| * 2^-25. */ + ehi = Tdouble_t(yhi * lhi) + elo = Tdouble_t(ylo*lhi) + Tdouble_t(y1*llo) /* |elo| < |ehi| * 2^-25. */ return _exp_inline(tls, ehi, elo, sign_bias) } @@ -111402,16 +111401,16 @@ func _log2_inline(tls *TLS, ix Tuint32_t) (r1 Tdouble_t) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 1*8)) - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 2*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 3*8)) - r4 = r2 * r2 - q = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 4*8))*r + y0 - q = p*r2 + q - y = y*r4 + q + r2 = Tdouble_t(r * r) + y = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 1*8)) + p = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 2*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 3*8)) + r4 = Tdouble_t(r2 * r2) + q = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 4*8))*r) + y0 + q = Tdouble_t(p*r2) + q + y = Tdouble_t(y*r4) + q return y } @@ -111441,11 +111440,11 @@ _2: ski = ki + uint64(sign_bias) t += ski << (Int32FromInt32(52) - Int32FromInt32(EXP2F_TABLE_BITS)) s = *(*float64)(unsafe.Pointer(&t)) - z = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 1*8)) - r2 = r * r - y2 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 2*8))*r + Float64FromInt32(1) - y2 = z*r2 + y2 - y2 = y2 * s + z = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 1*8)) + r2 = Tdouble_t(r * r) + y2 = Tdouble_t(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 2*8))*r) + Float64FromInt32(1) + y2 = Tdouble_t(z*r2) + y2 + y2 = Tdouble_t(y2 * s) y = float32(y2) v4 = y goto _5 @@ -111513,10 +111512,10 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { if BoolInt32(uint32(2)*ix < Uint32FromInt32(Int32FromInt32(2)*Int32FromInt32(0x3f800000))) == BoolInt32(!(iy&Uint32FromUint32(0x80000000) != 0)) { return Float32FromFloat32(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = float64(x1 * x1) + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111547,22 +111546,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)< y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111857,7 +111856,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111984,7 +111983,7 @@ func Xremquol(tls *TLS, x float64, y float64, quo uintptr) (r float64) { const DBL_EPSILON11 = 2.220446049250313e-16 -var _toint4 = Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16) +var _toint4 = float64(Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16)) func Xrint(tls *TLS, x float64) (r float64) { if __ccgo_strace { @@ -112091,7 +112090,7 @@ func Xrintl(tls *TLS, x float64) (r float64) { const DBL_EPSILON13 = 2.220446049250313e-16 -var _toint6 = Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16) +var _toint6 = float64(Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16)) func Xround(tls *TLS, x3 float64) (r float64) { if __ccgo_strace { @@ -112135,13 +112134,13 @@ func Xround(tls *TLS, x3 float64) (r float64) { y2 = x3 + _toint6 } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > Float64FromFloat64(0.5) { y3 = y3 + x3 - Float64FromInt32(1) } else { - if y3 <= -Float64FromFloat64(0.5) { + if y3 <= float64(-Float64FromFloat64(0.5)) { y3 = y3 + x3 + Float64FromInt32(1) } else { y3 = y3 + x3 @@ -112199,7 +112198,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3) + _toint7 } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = float64(x3) + _toint7 - _toint7 - float64(x3) if y3 > Float64FromFloat32(0.5) { @@ -112253,7 +112252,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -112304,7 +112303,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -112312,7 +112311,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -112337,8 +112336,8 @@ func Xscalbln(tls *TLS, x float64, n int32) (r float64) { if n > int32(INT_MAX) { n = int32(INT_MAX) } else { - if n < -Int32FromInt32(1)-Int32FromInt32(0x7fffffff) { - n = -Int32FromInt32(1) - Int32FromInt32(0x7fffffff) + if n < int32(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff)) { + n = int32(-Int32FromInt32(1) - Int32FromInt32(0x7fffffff)) } } return Xscalbn(tls, x, n) @@ -112352,8 +112351,8 @@ func Xscalblnf(tls *TLS, x float32, n int32) (r float32) { if n > int32(INT_MAX) { n = int32(INT_MAX) } else { - if n < -Int32FromInt32(1)-Int32FromInt32(0x7fffffff) { - n = -Int32FromInt32(1) - Int32FromInt32(0x7fffffff) + if n < int32(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff)) { + n = int32(-Int32FromInt32(1) - Int32FromInt32(0x7fffffff)) } } return Xscalbnf(tls, x, n) @@ -112395,10 +112394,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -112407,7 +112406,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -112437,10 +112436,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= float64(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= float64(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -112631,10 +112630,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112793,10 +112792,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112941,14 +112940,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -112989,12 +112988,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -113061,7 +113060,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -113211,7 +113210,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -113344,10 +113343,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -113482,20 +113481,20 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { if w > uint32(0x40340000) { /* |x| > 20 or nan */ /* note: this branch avoids raising overflow */ - t = Float64FromInt32(1) - Float64FromInt32(0)/x3 + t = float64(Float64FromInt32(1) - Float64FromInt32(0)/x3) } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113556,23 +113555,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint32(4) == uint32(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint32(4) == uint32(8) { y1 = float64(x3 * x3) @@ -113620,12 +113619,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113721,8 +113720,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113804,7 +113803,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113828,17 +113827,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / Tdouble_t(Tdouble_t(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, Float64FromFloat64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*float64(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(Float64FromFloat64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -113899,7 +113898,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^m @@ -113990,7 +113989,7 @@ func Xa64l(tls *TLS, s uintptr) (r int32) { e += int32(6) s++ } - return Int32FromUint32(x) + return int32(Int32FromUint32(x)) } func Xl64a(tls *TLS, x0 int32) (r uintptr) { @@ -114504,16 +114503,7 @@ func Xgethostid(tls *TLS) (r int32) { const optpos = 0 -type Tucontext_t3 = struct { - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - F__fpregs_mem [28]uint32 -} - -type t__ucontext1 = Tucontext_t3 +type t__ucontext1 = Tucontext_t1 func X__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) { if __ccgo_strace { @@ -114900,7 +114890,7 @@ func Xgetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) { var v1, v2 uint64 var _ /* k_rlim at bp+0 */ [2]uint32 _, _, _ = ret, v1, v2 - ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_prlimit64), Int32FromInt32(0), resource, Int32FromInt32(0), int32(rlim)))) + ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_prlimit64), int32(Int32FromInt32(0)), resource, int32(Int32FromInt32(0)), int32(rlim)))) if !(ret != 0) { if (*Trlimit)(unsafe.Pointer(rlim)).Frlim_cur >= ^Uint64FromUint64(0) { (*Trlimit)(unsafe.Pointer(rlim)).Frlim_cur = ^Uint64FromUint64(0) @@ -114948,7 +114938,7 @@ func Xgetrusage(tls *TLS, who int32, ru uintptr) (r1 int32) { var _ /* kru at bp+0 */ [4]int32 _, _ = dest, r dest = ru + 32 - uintptr(Uint32FromInt32(4)*Uint32FromInt64(4)) - r = X__syscall2(tls, int32(SYS_getrusage), who, int32(dest)) + r = int32(X__syscall2(tls, int32(SYS_getrusage), who, int32(dest))) if !(r != 0) && Bool(uint32(8) > uint32(4)) { Xmemcpy(tls, bp, dest, Uint32FromInt32(4)*Uint32FromInt64(4)) (*Trusage)(unsafe.Pointer(ru)).Fru_utime = Ttimeval{ @@ -115342,7 +115332,7 @@ func Xioctl(tls *TLS, fd int32, req int32, va uintptr) (r1 int32) { ap = va arg = VaUintptr(&ap) _ = ap - r = X__syscall3(tls, int32(SYS_ioctl), fd, req, int32(arg)) + r = int32(X__syscall3(tls, int32(SYS_ioctl), fd, req, int32(arg))) if Bool(Uint32FromUint32(2)< %v", r1) }() } bp := tls.Alloc(4112) @@ -115854,7 +115846,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } Xmemcpy(tls, bp+4, path, l+uint32(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -115973,7 +115965,7 @@ func X__ptsname_r(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) { if !(buf != 0) { len1 = uint32(0) } - v1 = X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromUint32(Uint32FromUint32(TIOCGPTN)), int32(bp)) + v1 = int32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromUint32(Uint32FromUint32(TIOCGPTN)), int32(bp))) err = v1 if v1 != 0 { return -err @@ -116247,7 +116239,7 @@ func _do_setrlimit(tls *TLS, p uintptr) { if (*Tctx)(unsafe.Pointer(c)).Ferr > 0 { return } - (*Tctx)(unsafe.Pointer(c)).Ferr = -X__syscall2(tls, int32(SYS_setrlimit), (*Tctx)(unsafe.Pointer(c)).Fres, int32(c)) + (*Tctx)(unsafe.Pointer(c)).Ferr = int32(-X__syscall2(tls, int32(SYS_setrlimit), (*Tctx)(unsafe.Pointer(c)).Fres, int32(c))) } func Xsetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) { @@ -116272,7 +116264,7 @@ func Xsetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) { } rlim = bp } - ret = X__syscall4(tls, int32(SYS_prlimit64), Int32FromInt32(0), resource, int32(rlim), Int32FromInt32(0)) + ret = int32(X__syscall4(tls, int32(SYS_prlimit64), int32(Int32FromInt32(0)), resource, int32(rlim), int32(Int32FromInt32(0)))) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -116631,8 +116623,6 @@ type Tsockaddr_storage = struct { F__ss_align uint32 } -type t__ucontext2 = Tucontext_t2 - var _lock2 [1]int32 var _log_ident [32]int8 var _log_opt int32 @@ -116997,7 +116987,7 @@ func Xposix_madvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32 if advice == int32(MADV_DONTNEED) { return 0 } - return -X__syscall3(tls, int32(SYS_madvise), int32(addr), Int32FromUint32(len1), advice) + return int32(-X__syscall3(tls, int32(SYS_madvise), int32(addr), Int32FromUint32(len1), advice)) } func X__shm_mapname(tls *TLS, name uintptr, buf uintptr) (r uintptr) { @@ -117070,15 +117060,6 @@ const SA = 194 const SB = 244 const bittab = 0 -type Tucontext_t4 = struct { - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - F__fpregs_mem [28]uint32 -} - func Xbtowc(tls *TLS, c int32) (r Twint_t) { if __ccgo_strace { trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) @@ -117091,7 +117072,7 @@ func Xbtowc(tls *TLS, c int32) (r Twint_t) { if Uint32FromInt32(b) < uint32(128) { v1 = Uint32FromInt32(b) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117292,13 +117273,13 @@ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolUint32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) } if v2 == int32(1) { - *(*Twchar_t)(unsafe.Pointer(wc)) = Int32FromInt32(0xdfff) & int32(Int8FromUint8(*(*uint8)(unsafe.Pointer(s)))) + *(*Twchar_t)(unsafe.Pointer(wc)) = int32(Int32FromInt32(0xdfff) & int32(Int8FromUint8(*(*uint8)(unsafe.Pointer(s))))) return Uint32FromInt32(1) } if uint32(*(*uint8)(unsafe.Pointer(s)))-uint32(0xc2) > Uint32FromUint32(0xf4)-Uint32FromUint32(0xc2) { @@ -117463,7 +117444,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts goto resume0 } } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117485,7 +117466,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts c = uint32(*(*uint8)(unsafe.Pointer(v5))) v6 = ws ws += 4 - *(*Twchar_t)(unsafe.Pointer(v6)) = Int32FromInt32(0xdfff) & int32(Int8FromUint32(c)) + *(*Twchar_t)(unsafe.Pointer(v6)) = int32(Int32FromInt32(0xdfff) & int32(Int8FromUint32(c))) wn-- goto _4 _4: @@ -117691,13 +117672,13 @@ func Xmbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) { *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolInt32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) } if v2 == int32(1) { - *(*Twchar_t)(unsafe.Pointer(wc)) = Int32FromInt32(0xdfff) & int32(Int8FromUint8(*(*uint8)(unsafe.Pointer(s)))) + *(*Twchar_t)(unsafe.Pointer(wc)) = int32(Int32FromInt32(0xdfff) & int32(Int8FromUint8(*(*uint8)(unsafe.Pointer(s))))) return Int32FromInt32(1) } if uint32(*(*uint8)(unsafe.Pointer(s)))-uint32(0xc2) > Uint32FromUint32(0xf4)-Uint32FromUint32(0xc2) { @@ -117761,7 +117742,7 @@ func Xwcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) { *(*int8)(unsafe.Pointer(s)) = int8(wc) return uint32(1) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -117968,7 +117949,7 @@ func Xwctob(tls *TLS, c Twint_t) (r int32) { if c < uint32(128) { return Int32FromUint32(c) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118006,15 +117987,15 @@ func Xaccept(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) { v4 = fd v5 = int32(addr) v6 = int32(len1) - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -118076,14 +118057,14 @@ func Xaccept4(tls *TLS, fd int32, addr uintptr, len1 uintptr, flg int32) (r1 int v5 = int32(addr) v6 = int32(len1) v7 = flg - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -118124,10 +118105,10 @@ _11: return ret } if flg&int32(SOCK_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if flg&int32(SOCK_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } return ret } @@ -118148,15 +118129,15 @@ func Xbind(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) { v4 = fd v5 = int32(addr) v6 = Int32FromUint32(len1) - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -118203,15 +118184,15 @@ func Xconnect(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) { v4 = fd v5 = int32(addr) v6 = Int32FromUint32(len1) - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -118890,13 +118871,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]int8 - Falg [1025]int8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]int8 Falg [1025]int8 @@ -118904,14 +118878,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -119560,9 +119526,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -119608,7 +119576,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if len1+int32(10) > int32(r+uintptr(rlen))-int32(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -121423,15 +121391,15 @@ func Xgetpeername(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) { v4 = fd v5 = int32(addr) v6 = int32(len1) - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -121562,15 +121530,15 @@ func Xgetsockname(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) { v4 = fd v5 = int32(addr) v6 = int32(len1) - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -121621,13 +121589,13 @@ func Xgetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, v6 = optname v7 = int32(optval) v8 = int32(optlen) - v9 = Int32FromInt32(0) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -121686,13 +121654,13 @@ _11: v17 = optname v18 = int32(bp + 152) v19 = int32(bp + 48) - v20 = Int32FromInt32(0) + v20 = int32(Int32FromInt32(0)) if v14 != 0 { r = ___syscall_cp(tls, v12, v15, v16, v17, v18, v19, v20) } else { r = X__syscall6(tls, v12, v15, v16, v17, v18, v19, v20) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v21 = r goto _22 } @@ -121748,13 +121716,13 @@ _11: v28 = optname v29 = int32(optval) v30 = int32(optlen) - v31 = Int32FromInt32(0) + v31 = int32(Int32FromInt32(0)) if v25 != 0 { r = ___syscall_cp(tls, v23, v26, v27, v28, v29, v30, v31) } else { r = X__syscall6(tls, v23, v26, v27, v28, v29, v30, v31) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v32 = r goto _33 } @@ -121795,10 +121763,10 @@ func X__h_errno_location(tls *TLS) (r uintptr) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - if !((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstack != 0) { + if !((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstack != 0) { return uintptr(unsafe.Pointer(&Xh_errno)) } - return ___get_tp(tls) + 88 + return uintptr(___get_tp(tls)) + 88 } func Xherror(tls *TLS, msg uintptr) { @@ -121822,19 +121790,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+987, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [32]uint32 -} - -type Tucontext_t5 = struct { - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - F__fpregs_mem [28]uint32 -} - var _msgs1 = [84]int8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -122544,16 +122499,16 @@ func Xlisten(tls *TLS, fd int32, backlog int32) (r1 int32) { v3 = 0 v4 = fd v5 = backlog - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -123645,7 +123600,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -123735,7 +123690,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -123748,9 +123703,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -123759,9 +123716,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int32(SYS_close), fd) return r @@ -123796,7 +123753,7 @@ func Xns_get32(tls *TLS, cp uintptr) (r uint32) { trc("tls=%v cp=%v, (%v:)", tls, cp, origin(2)) defer func() { trc("-> %v", r) }() } - return uint32(*(*uint8)(unsafe.Pointer(cp)))<>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v7), + 0: int32(Int32FromUint64(v7)), 1: ns, } v6 = bp + 16 } else { v6 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_recvmmsg), fd, int32(msgvec), Int32FromUint32(vlen), Int32FromUint32(flags), int32(v6), 0) + r = int32(___syscall_cp(tls, int32(SYS_recvmmsg), fd, int32(msgvec), Int32FromUint32(vlen), Int32FromUint32(flags), int32(v6), 0)) i1 = 0 for { if !(i1 < r) { @@ -124375,10 +124332,10 @@ func X__convert_scm_timestamps(tls *TLS, msg uintptr, csize Tsocklen_t) { goto _1 _1: ; - if (*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len < uint32(12) || ((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(cmsg)) { + if (*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len < uint32(12) || uint32((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(cmsg)) { v6 = uintptr(0) } else { - v6 = cmsg + uintptr(((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) + v6 = cmsg + uintptr(uint32((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) } cmsg = v6 } @@ -124390,10 +124347,10 @@ func X__convert_scm_timestamps(tls *TLS, msg uintptr, csize Tsocklen_t) { return } *(*Tsocklen_t)(unsafe.Pointer(msg + 20)) += (Uint32FromInt64(16)+Uint32FromInt64(4)-Uint32FromInt32(1)) & ^(Uint32FromInt64(4)-Uint32FromInt32(1)) + (Uint32FromInt64(12)+Uint32FromInt64(4)-Uint32FromInt32(1)) & ^(Uint32FromInt64(4)-Uint32FromInt32(1)) - if (*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len < uint32(12) || ((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(last)) { + if (*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len < uint32(12) || uint32((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(last)) { v7 = uintptr(0) } else { - v7 = last + uintptr(((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) + v7 = last + uintptr(uint32((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) } cmsg = v7 (*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_level = int32(SOL_SOCKET) @@ -124421,15 +124378,15 @@ func Xrecvmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r2 Tssize_t) { v4 = fd v5 = int32(msg) v6 = flags - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -125483,15 +125440,15 @@ func Xsendmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r1 Tssize_t) { v4 = fd v5 = int32(msg) v6 = flags - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -125546,7 +125503,7 @@ func Xsendto(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr ui } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -125619,13 +125576,13 @@ func Xsetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, v6 = optname v7 = int32(optval) v8 = Int32FromUint32(optlen) - v9 = Int32FromInt32(0) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -125686,7 +125643,7 @@ _11: } *(*[2]int32)(unsafe.Pointer(bp + 48)) = [2]int32{ 0: int32(s), - 1: Int32FromUint64(v12), + 1: int32(Int32FromUint64(v12)), } v13 = int32(SYS_setsockopt) v14 = int32(__SC_setsockopt) @@ -125696,13 +125653,13 @@ _11: v18 = optname v19 = int32(bp + 48) v20 = Int32FromUint32(Uint32FromInt32(2) * Uint32FromInt64(4)) - v21 = Int32FromInt32(0) + v21 = int32(Int32FromInt32(0)) if v15 != 0 { r = ___syscall_cp(tls, v13, v16, v17, v18, v19, v20, v21) } else { r = X__syscall6(tls, v13, v16, v17, v18, v19, v20, v21) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v22 = r goto _23 } @@ -125751,13 +125708,13 @@ _11: v29 = optname v30 = int32(optval) v31 = Int32FromUint32(optlen) - v32 = Int32FromInt32(0) + v32 = int32(Int32FromInt32(0)) if v26 != 0 { r = ___syscall_cp(tls, v24, v27, v28, v29, v30, v31, v32) } else { r = X__syscall6(tls, v24, v27, v28, v29, v30, v31, v32) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v33 = r goto _34 } @@ -125808,16 +125765,16 @@ func Xshutdown(tls *TLS, fd int32, how int32) (r1 int32) { v3 = 0 v4 = fd v5 = how - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -125878,15 +125835,15 @@ func Xsocket(tls *TLS, domain int32, type1 int32, protocol int32) (r1 int32) { v4 = domain v5 = type1 v6 = protocol - v7 = Int32FromInt32(0) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -125920,17 +125877,17 @@ _11: v13 = int32(__SC_socket) v14 = 0 v15 = domain - v16 = type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK)) + v16 = int32(type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK))) v17 = protocol - v18 = Int32FromInt32(0) - v19 = Int32FromInt32(0) - v20 = Int32FromInt32(0) + v18 = int32(Int32FromInt32(0)) + v19 = int32(Int32FromInt32(0)) + v20 = int32(Int32FromInt32(0)) if v14 != 0 { r = ___syscall_cp(tls, v12, v15, v16, v17, v18, v19, v20) } else { r = X__syscall6(tls, v12, v15, v16, v17, v18, v19, v20) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v21 = r goto _22 } @@ -125963,10 +125920,10 @@ _11: return X__syscall_ret(tls, Uint32FromInt32(s)) } if type1&int32(SOCK_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), s, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), s, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if type1&int32(SOCK_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), s, Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), s, int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } } return X__syscall_ret(tls, Uint32FromInt32(s)) @@ -125989,14 +125946,14 @@ func Xsocketpair(tls *TLS, domain int32, type1 int32, protocol int32, fd uintptr v5 = type1 v6 = protocol v7 = int32(fd) - v8 = Int32FromInt32(0) - v9 = Int32FromInt32(0) + v8 = int32(Int32FromInt32(0)) + v9 = int32(Int32FromInt32(0)) if v3 != 0 { r = ___syscall_cp(tls, v1, v4, v5, v6, v7, v8, v9) } else { r = X__syscall6(tls, v1, v4, v5, v6, v7, v8, v9) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v10 = r goto _11 } @@ -126030,17 +125987,17 @@ _11: v13 = int32(__SC_socketpair) v14 = 0 v15 = domain - v16 = type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK)) + v16 = int32(type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK))) v17 = protocol v18 = int32(fd) - v19 = Int32FromInt32(0) - v20 = Int32FromInt32(0) + v19 = int32(Int32FromInt32(0)) + v20 = int32(Int32FromInt32(0)) if v14 != 0 { r = ___syscall_cp(tls, v12, v15, v16, v17, v18, v19, v20) } else { r = X__syscall6(tls, v12, v15, v16, v17, v18, v19, v20) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v21 = r goto _22 } @@ -126073,12 +126030,12 @@ _11: return r1 } if type1&int32(SOCK_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if type1&int32(SOCK_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } } return r1 @@ -127641,7 +127598,7 @@ func Xjrand48(tls *TLS, s uintptr) (r int32) { trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) defer func() { trc("-> %v", r) }() } - return Int32FromUint64(X__rand48_step(tls, s, uintptr(unsafe.Pointer(&X__seed48))+uintptr(3)*2) >> Int32FromInt32(16)) + return int32(Int32FromUint64(X__rand48_step(tls, s, uintptr(unsafe.Pointer(&X__seed48))+uintptr(3)*2) >> Int32FromInt32(16))) } func Xmrand48(tls *TLS) (r int32) { @@ -128154,7 +128111,7 @@ func Xfexecve(tls *TLS, fd int32, argv uintptr, envp uintptr) (r1 int32) { var r int32 var _ /* buf at bp+0 */ [27]int8 _ = r - r = X__syscall5(tls, int32(SYS_execveat), fd, int32(__ccgo_ts), int32(argv), int32(envp), Int32FromInt32(AT_EMPTY_PATH)) + r = int32(X__syscall5(tls, int32(SYS_execveat), fd, int32(__ccgo_ts), int32(argv), int32(envp), int32(Int32FromInt32(AT_EMPTY_PATH)))) if r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -128534,7 +128491,7 @@ func Xwaitid(tls *TLS, type1 Tidtype_t, id Tid_t, info uintptr, options int32) ( trc("tls=%v type1=%v id=%v info=%v options=%v, (%v:)", tls, type1, id, info, options, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_waitid), type1, Int32FromUint32(id), int32(info), options, Int32FromInt32(0), 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_waitid), type1, Int32FromUint32(id), int32(info), options, int32(Int32FromInt32(0)), 0))) } func Xwaitpid(tls *TLS, pid Tpid_t, status uintptr, options int32) (r Tpid_t) { @@ -128542,7 +128499,7 @@ func Xwaitpid(tls *TLS, pid Tpid_t, status uintptr, options int32) (r Tpid_t) { trc("tls=%v pid=%v status=%v options=%v, (%v:)", tls, pid, status, options, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_wait4), pid, int32(status), options, Int32FromInt32(0), 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_wait4), pid, int32(status), options, int32(Int32FromInt32(0)), 0, 0))) } const BRACKET = -3 @@ -128715,7 +128672,7 @@ func _match_bracket(tls *TLS, p uintptr, k int32, kfold int32) (r int32) { return 0 } if *(*Twchar_t)(unsafe.Pointer(bp)) <= *(*Twchar_t)(unsafe.Pointer(bp + 4)) { - if Uint32FromInt32(k)-Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp))) <= Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp + 4))-*(*Twchar_t)(unsafe.Pointer(bp))) || Uint32FromInt32(kfold)-Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp))) <= Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp + 4))-*(*Twchar_t)(unsafe.Pointer(bp))) { + if uint32(Uint32FromInt32(k))-Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp))) <= Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp + 4))-*(*Twchar_t)(unsafe.Pointer(bp))) || uint32(Uint32FromInt32(kfold))-Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp))) <= Uint32FromInt32(*(*Twchar_t)(unsafe.Pointer(bp + 4))-*(*Twchar_t)(unsafe.Pointer(bp))) { return BoolInt32(!(inv != 0)) } } @@ -128861,7 +128818,7 @@ func _fnmatch_internal(tls *TLS, pat uintptr, m Tsize_t, str uintptr, n Tsize_t, break } if v9 = Uint32FromInt8(*(*int8)(unsafe.Pointer(s + uintptr(-Int32FromInt32(1))))) < uint32(128); !v9 { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v8 = int32(4) } else { v8 = int32(1) @@ -129099,7 +129056,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(144) defer tls.Free(144) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -129208,7 +129165,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -129245,7 +129202,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -129297,7 +129254,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -129308,7 +129265,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*int8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -129420,9 +129377,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4112) @@ -129448,8 +129407,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -129468,7 +129427,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4108, bp+8, bp+4104) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+8, *(*Tsize_t)(unsafe.Pointer(bp + 4104)), 0, *(*uintptr)(unsafe.Pointer(bp + 4108)), flags, errfunc, bp+4) + error1 = _do_glob(tls, bp+8, *(*Tsize_t)(unsafe.Pointer(bp + 4104)), 0, *(*uintptr)(unsafe.Pointer(bp + 4108)), flags, __ccgo_fp_errfunc, bp+4) } Xfree(tls, p) } @@ -130409,8 +130368,8 @@ func _parse_bracket(tls *TLS, ctx uintptr, s uintptr) (r Treg_errcode_t) { err = int32(REG_ESPACE) goto parse_bracket_done } - (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_min = Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1) - (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_max = Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1) + (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_min = int32(Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1)) + (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_max = int32(Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1)) (*Ttre_literal_t)(unsafe.Pointer(lit)).Fposition = -int32(1) /* negated classes */ if (*(*Tneg)(unsafe.Pointer(bp + 16))).Flen1 != 0 { @@ -134693,9 +134652,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134711,7 +134672,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134723,9 +134684,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return Xmemcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134741,7 +134704,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134760,9 +134723,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [49]uintptr @@ -134786,7 +134751,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134831,9 +134796,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -134841,17 +134808,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -134865,7 +134834,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134953,9 +134922,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [48]uintptr @@ -134975,7 +134946,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -135011,26 +134982,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -135041,8 +135014,6 @@ func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_poll), int32(fds), Int32FromUint32(n), timeout, 0, 0, 0))) } -type t__ucontext3 = Tucontext_t5 - func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v fds=%v n=%v to=%v mask=%v, (%v:)", tls, fds, n, to, mask, origin(2)) @@ -135079,7 +135050,7 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r1 int3 } else { v3 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_ppoll_time64), int32(fds), Int32FromUint32(n), int32(v3), int32(mask), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0) + r = int32(___syscall_cp(tls, int32(SYS_ppoll_time64), int32(fds), Int32FromUint32(n), int32(v3), int32(mask), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0)) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -135099,11 +135070,9 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r1 int3 } else { v5 = uintptr(0) } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ppoll), int32(fds), Int32FromUint32(n), int32(v5), int32(mask), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ppoll), int32(fds), Int32FromUint32(n), int32(v5), int32(mask), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0))) } -type t__ucontext4 = Tucontext_t4 - func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v ts=%v mask=%v, (%v:)", tls, n, rfds, wfds, efds, ts, mask, origin(2)) @@ -135120,7 +135089,7 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui _, _, _, _, _, _, _, _ = ns, r, s, v1, v2, v3, v4, v5 *(*[2]Tsyscall_arg_t)(unsafe.Pointer(bp + 24)) = [2]Tsyscall_arg_t{ 0: Int32FromUint32(uint32(mask)), - 1: Int32FromInt32(_NSIG) / Int32FromInt32(8), + 1: int32(Int32FromInt32(_NSIG) / Int32FromInt32(8)), } if ts != 0 { v1 = (*Ttimespec)(unsafe.Pointer(ts)).Ftv_sec @@ -135145,7 +135114,7 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui } else { v3 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+24)) + r = int32(___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+24))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -135168,15 +135137,6 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_pselect6), n, int32(rfds), int32(wfds), int32(efds), int32(v5), int32(bp+24)))) } -type Tucontext_t6 = struct { - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - F__fpregs_mem [28]uint32 -} - func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v tv=%v, (%v:)", tls, n, rfds, wfds, efds, tv, origin(2)) @@ -135228,9 +135188,9 @@ func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uin v3 = uintptr(0) } *(*[2]Tsyscall_arg_t)(unsafe.Pointer(bp + 16)) = [2]Tsyscall_arg_t{ - 1: Int32FromInt32(_NSIG) / Int32FromInt32(8), + 1: int32(Int32FromInt32(_NSIG) / Int32FromInt32(8)), } - r = ___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+16)) + r = int32(___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+16))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -135267,21 +135227,21 @@ func X__block_all_sigs(tls *TLS, set uintptr) { if __ccgo_strace { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_BLOCK), int32(uintptr(unsafe.Pointer(&_all_mask))), int32(set), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_BLOCK)), int32(uintptr(unsafe.Pointer(&_all_mask))), int32(set), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) } func X__block_app_sigs(tls *TLS, set uintptr) { if __ccgo_strace { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_BLOCK), int32(uintptr(unsafe.Pointer(&_app_mask))), int32(set), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_BLOCK)), int32(uintptr(unsafe.Pointer(&_app_mask))), int32(set), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) } func X__restore_sigs(tls *TLS, set uintptr) { if __ccgo_strace { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_SETMASK), int32(set), Int32FromInt32(0), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_SETMASK)), int32(set), int32(Int32FromInt32(0)), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) } func Xgetitimer(tls *TLS, which int32, old uintptr) (r1 int32) { @@ -135295,7 +135255,7 @@ func Xgetitimer(tls *TLS, which int32, old uintptr) (r1 int32) { var _ /* old32 at bp+0 */ [4]int32 _ = r if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_getitimer), which, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_getitimer), which, int32(bp))) if !(r != 0) { (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[0]) (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_usec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[int32(1)]) @@ -135389,7 +135349,7 @@ func Xraise(tls *TLS, sig int32) (r int32) { var _ /* set at bp+0 */ Tsigset_t _ = ret X__block_app_sigs(tls, bp) - ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid, sig))) + ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid, sig))) X__restore_sigs(tls, bp) return ret } @@ -135433,7 +135393,7 @@ func Xsetitimer(tls *TLS, which int32, new1 uintptr, old uintptr) (r1 int32) { 2: int32(vs), 3: vus, } - r = X__syscall3(tls, int32(SYS_setitimer), which, int32(bp), int32(bp+16)) + r = int32(X__syscall3(tls, int32(SYS_setitimer), which, int32(bp), int32(bp+16))) if !(r != 0) && old != 0 { (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp + 16)))[0]) (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_usec = int64((*(*[4]int32)(unsafe.Pointer(bp + 16)))[int32(1)]) @@ -135513,7 +135473,7 @@ func X__libc_sigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r1 int32) *(*[2]uint32)(unsafe.Pointer(bp)) = [2]uint32{ 1: Uint32FromUint32(3) << (Int32FromInt32(32) * BoolInt32(Uint32FromInt64(4) > Uint32FromInt32(4))), } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_UNBLOCK), int32(bp), Int32FromInt32(0), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_UNBLOCK)), int32(bp), int32(Int32FromInt32(0)), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) _unmask_done = int32(1) } if !((*Tsigaction)(unsafe.Pointer(sa)).Fsa_flags&Int32FromInt32(SA_RESTART) != 0) { @@ -135541,7 +135501,7 @@ func X__libc_sigaction(tls *TLS, sig int32, sa uintptr, old uintptr) (r1 int32) } else { v6 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_rt_sigaction), sig, int32(v5), int32(v6), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + r = int32(X__syscall4(tls, int32(SYS_rt_sigaction), sig, int32(v5), int32(v6), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)))) if old != 0 && !(r != 0) { *(*uintptr)(unsafe.Pointer(old)) = (*(*Tk_sigaction)(unsafe.Pointer(bp + 36))).Fhandler (*Tsigaction)(unsafe.Pointer(old)).Fsa_flags = Int32FromUint32((*(*Tk_sigaction)(unsafe.Pointer(bp + 36))).Fflags) @@ -135623,15 +135583,6 @@ func Xsigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) { const SST_SIZE = 8 -type Tucontext_t7 = struct { - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - F__fpregs_mem [28]uint32 -} - func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v dest=%v left=%v right=%v, (%v:)", tls, dest, left, right, origin(2)) @@ -135645,7 +135596,7 @@ func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) l = left r = right for { - if !(i < Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4)) { + if !(i < uint32(Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4))) { break } *(*uint32)(unsafe.Pointer(d + uintptr(i)*4)) = *(*uint32)(unsafe.Pointer(l + uintptr(i)*4)) & *(*uint32)(unsafe.Pointer(r + uintptr(i)*4)) @@ -135762,7 +135713,7 @@ func Xsigorset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { l = left r = right for { - if !(i < Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4)) { + if !(i < uint32(Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4))) { break } *(*uint32)(unsafe.Pointer(d + uintptr(i)*4)) = *(*uint32)(unsafe.Pointer(l + uintptr(i)*4)) | *(*uint32)(unsafe.Pointer(r + uintptr(i)*4)) @@ -135779,7 +135730,7 @@ func Xsigpending(tls *TLS, set uintptr) (r int32) { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_rt_sigpending), int32(set), Int32FromInt32(_NSIG)/Int32FromInt32(8)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_rt_sigpending), int32(set), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))))) } func Xsigprocmask(tls *TLS, how int32, set uintptr, old uintptr) (r1 int32) { @@ -135866,7 +135817,7 @@ func X__sigsetjmp_tail(tls *TLS, jb uintptr, ret int32) (r int32) { } else { v2 = p } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_SETMASK), int32(v1), int32(v2), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_SETMASK)), int32(v1), int32(v2), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) return ret } @@ -135875,7 +135826,7 @@ func Xsigsuspend(tls *TLS, mask uintptr) (r int32) { trc("tls=%v mask=%v, (%v:)", tls, mask, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_rt_sigsuspend), int32(mask), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0, 0, 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_rt_sigsuspend), int32(mask), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0, 0, 0, 0))) } func _do_sigtimedwait(tls *TLS, mask uintptr, si uintptr, ts uintptr) (r1 int32) { @@ -135910,7 +135861,7 @@ func _do_sigtimedwait(tls *TLS, mask uintptr, si uintptr, ts uintptr) (r1 int32) } else { v3 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_rt_sigtimedwait_time64), int32(mask), int32(si), int32(v3), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_rt_sigtimedwait_time64), int32(mask), int32(si), int32(v3), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0, 0)) } if Bool(false) || r != -int32(ENOSYS) { return r @@ -135922,14 +135873,14 @@ func _do_sigtimedwait(tls *TLS, mask uintptr, si uintptr, ts uintptr) (r1 int32) v5 = uint64(0x7fffffff) + (0+Uint64FromInt64(s))>>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v5), + 0: int32(Int32FromUint64(v5)), 1: ns, } v4 = bp + 16 } else { v4 = uintptr(0) } - return ___syscall_cp(tls, int32(SYS_rt_sigtimedwait), int32(mask), int32(si), int32(v4), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0, 0) + return int32(___syscall_cp(tls, int32(SYS_rt_sigtimedwait), int32(mask), int32(si), int32(v4), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0, 0)) return r1 } @@ -136003,8 +135954,8 @@ func Xfchmod(tls *TLS, fd int32, mode Tmode_t) (r int32) { var ret int32 var _ /* buf at bp+0 */ [27]int8 _ = ret - ret = X__syscall2(tls, int32(SYS_fchmod), fd, Int32FromUint32(mode)) - if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) < 0 { + ret = int32(X__syscall2(tls, int32(SYS_fchmod), fd, Int32FromUint32(mode))) + if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) < 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) } X__procfdname(tls, bp, Uint32FromInt32(fd)) @@ -136025,7 +135976,7 @@ func Xfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r in if !(flag != 0) { return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fchmodat), fd, int32(path), Int32FromUint32(mode)))) } - ret = X__syscall4(tls, int32(SYS_fchmodat2), fd, int32(path), Int32FromUint32(mode), flag) + ret = int32(X__syscall4(tls, int32(SYS_fchmodat2), fd, int32(path), Int32FromUint32(mode), flag)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -136038,7 +135989,7 @@ func Xfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r in if (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFLNK) { return X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(EOPNOTSUPP))) } - v1 = X__syscall3(tls, int32(SYS_openat), fd, int32(path), Int32FromInt32(O_RDONLY)|Int32FromInt32(O_PATH)|Int32FromInt32(O_NOFOLLOW)|Int32FromInt32(O_NOCTTY)|Int32FromInt32(O_CLOEXEC)) + v1 = int32(X__syscall3(tls, int32(SYS_openat), fd, int32(path), int32(Int32FromInt32(O_RDONLY)|Int32FromInt32(O_PATH)|Int32FromInt32(O_NOFOLLOW)|Int32FromInt32(O_NOCTTY)|Int32FromInt32(O_CLOEXEC)))) fd2 = v1 if v1 < 0 { if fd2 == -int32(ELOOP) { @@ -136052,7 +136003,7 @@ func Xfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r in if (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFLNK) { ret = X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(EOPNOTSUPP))) } else { - ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fchmodat), -Int32FromInt32(100), int32(bp+144), Int32FromUint32(mode)))) + ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fchmodat), int32(-Int32FromInt32(100)), int32(bp+144), Int32FromUint32(mode)))) } } X__syscall1(tls, int32(SYS_close), fd2) @@ -136125,7 +136076,7 @@ func _fstatat_statx(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r var _ /* stx at bp+0 */ Tstatx1 _ = ret flag |= int32(AT_NO_AUTOMOUNT) - ret = X__syscall5(tls, int32(SYS_statx), fd, int32(path), flag, Int32FromInt32(0x7ff), int32(bp)) + ret = int32(X__syscall5(tls, int32(SYS_statx), fd, int32(path), flag, int32(Int32FromInt32(0x7ff)), int32(bp))) if ret != 0 { return ret } @@ -136207,22 +136158,22 @@ func _fstatat_kstat(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r var _ /* kst at bp+0 */ Tkstat _ = ret if flag == int32(AT_EMPTY_PATH) && fd >= 0 && !(*(*int8)(unsafe.Pointer(path)) != 0) { - ret = X__syscall2(tls, int32(SYS_fstat64), fd, int32(bp)) - if ret == -int32(EBADF) && X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) >= 0 { - ret = X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag) + ret = int32(X__syscall2(tls, int32(SYS_fstat64), fd, int32(bp))) + if ret == -int32(EBADF) && X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) >= 0 { + ret = int32(X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag)) if ret == -int32(EINVAL) { X__procfdname(tls, bp+96, Uint32FromInt32(fd)) - ret = X__syscall2(tls, int32(SYS_stat64), int32(bp+96), int32(bp)) + ret = int32(X__syscall2(tls, int32(SYS_stat64), int32(bp+96), int32(bp))) } } } else { if (fd == -int32(100) || int32(*(*int8)(unsafe.Pointer(path))) == int32('/')) && flag == int32(AT_SYMLINK_NOFOLLOW) { - ret = X__syscall2(tls, int32(SYS_lstat64), int32(path), int32(bp)) + ret = int32(X__syscall2(tls, int32(SYS_lstat64), int32(path), int32(bp))) } else { if (fd == -int32(100) || int32(*(*int8)(unsafe.Pointer(path))) == int32('/')) && !(flag != 0) { - ret = X__syscall2(tls, int32(SYS_stat64), int32(path), int32(bp)) + ret = int32(X__syscall2(tls, int32(SYS_stat64), int32(path), int32(bp))) } else { - ret = X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag) + ret = int32(X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag)) } } } @@ -136543,7 +136494,7 @@ func Xutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r } else { v1 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_utimensat_time64), fd, int32(path), int32(v1), flags) + r = int32(X__syscall4(tls, int32(SYS_utimensat_time64), fd, int32(path), int32(v1), flags)) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -136562,7 +136513,7 @@ func Xutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r } else { v2 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_utimensat), fd, int32(path), int32(v2), flags) + r = int32(X__syscall4(tls, int32(SYS_utimensat), fd, int32(path), int32(v2), flags)) if r != -int32(ENOSYS) || flags != 0 { return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -136588,11 +136539,11 @@ func Xutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r i++ } } - r = X__syscall3(tls, int32(SYS_futimesat), fd, int32(path), int32(tv)) + r = int32(X__syscall3(tls, int32(SYS_futimesat), fd, int32(path), int32(tv))) if r != -int32(ENOSYS) || fd != -int32(100) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, int32(SYS_utimes), int32(path), int32(tv)) + r = int32(X__syscall2(tls, int32(SYS_utimes), int32(path), int32(tv))) return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -136639,13 +136590,13 @@ func X__fdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) { } /* Apply close-on-exec flag */ if Xstrchr(tls, mode, int32('e')) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } /* Set append mode on fd if opened for append */ if int32(*(*int8)(unsafe.Pointer(mode))) == int32('a') { - flags = X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFL)) + flags = int32(X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFL)))) if !(flags&Int32FromInt32(O_APPEND) != 0) { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFL), flags|Int32FromInt32(O_APPEND)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFL)), int32(flags|Int32FromInt32(O_APPEND))) } *(*uint32)(unsafe.Pointer(f)) |= uint32(F_APP) } @@ -136654,7 +136605,7 @@ func X__fdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) { (*TFILE)(unsafe.Pointer(f)).Fbuf_size = uint32(BUFSIZ) /* Activate line buffered mode for terminals */ (*TFILE)(unsafe.Pointer(f)).Flbf = -int32(1) - if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_NOWR) != 0) && !(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCGWINSZ), int32(bp)) != 0) { + if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_NOWR) != 0) && !(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCGWINSZ)), int32(bp)) != 0) { (*TFILE)(unsafe.Pointer(f)).Flbf = int32('\n') } /* Initialize op ptrs. No problem if some are unneeded. */ @@ -136717,11 +136668,11 @@ func X__fopen_rb_ca(tls *TLS, filename uintptr, f uintptr, buf uintptr, len1 Tsi defer func() { trc("-> %v", r) }() } Xmemset(tls, f, 0, uint32(136)) - (*TFILE)(unsafe.Pointer(f)).Ffd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(filename), Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_LARGEFILE)))) + (*TFILE)(unsafe.Pointer(f)).Ffd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(filename), int32(Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_LARGEFILE))))) if (*TFILE)(unsafe.Pointer(f)).Ffd < 0 { return uintptr(0) } - X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) (*TFILE)(unsafe.Pointer(f)).Fflags = Uint32FromInt32(Int32FromInt32(F_NOWR) | Int32FromInt32(F_PERM)) (*TFILE)(unsafe.Pointer(f)).Fbuf = buf + uintptr(UNGET) (*TFILE)(unsafe.Pointer(f)).Fbuf_size = len1 - uint32(UNGET) @@ -136842,7 +136793,7 @@ func X__stdio_read(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) { }, } if (*(*[2]Tiovec)(unsafe.Pointer(bp)))[0].Fiov_len != 0 { - v1 = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_readv), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(bp), Int32FromInt32(2)))) + v1 = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_readv), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(bp), int32(Int32FromInt32(2))))) } else { v1 = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_read), (*TFILE)(unsafe.Pointer(f)).Ffd, int32((*(*[2]Tiovec)(unsafe.Pointer(bp)))[int32(1)].Fiov_base), Int32FromUint32((*(*[2]Tiovec)(unsafe.Pointer(bp)))[int32(1)].Fiov_len)))) } @@ -136952,7 +136903,7 @@ func X__stdout_write(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) defer tls.Free(16) var _ /* wsz at bp+0 */ Twinsize (*TFILE)(unsafe.Pointer(f)).Fwrite = __ccgo_fp(X__stdio_write) - if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_SVB) != 0) && X__syscall3(tls, int32(SYS_ioctl), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(TIOCGWINSZ), int32(bp)) != 0 { + if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_SVB) != 0) && X__syscall3(tls, int32(SYS_ioctl), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(TIOCGWINSZ)), int32(bp)) != 0 { (*TFILE)(unsafe.Pointer(f)).Flbf = -int32(1) } return X__stdio_write(tls, f, buf, len1) @@ -137486,7 +137437,7 @@ func _locking_getc(tls *TLS, f uintptr) (r int32) { if v5 < Int32FromInt32(0) { v5 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v4), Int32FromInt32(FUTEX_WAKE)|v6, v5) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v4), Int32FromInt32(FUTEX_WAKE), v5) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v4), int32(Int32FromInt32(FUTEX_WAKE)|v6), v5) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v4), int32(Int32FromInt32(FUTEX_WAKE)), v5) != 0 } return c } @@ -137501,7 +137452,7 @@ func Xfgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 4 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -137744,7 +137695,7 @@ func X__fgetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) { var ploc uintptr var wc Twchar_t _, _, _ = loc, ploc, wc - ploc = ___get_tp(tls) + 96 + ploc = uintptr(___get_tp(tls)) + 96 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if (*TFILE)(unsafe.Pointer(f)).Fmode <= 0 { Xfwide(tls, f, int32(1)) @@ -137895,7 +137846,7 @@ func Xflockfile(tls *TLS, f uintptr) { return } ___lockfile(tls, f) - X__register_locked_file(tls, f, ___get_tp(tls)) + X__register_locked_file(tls, f, uintptr(___get_tp(tls))) } type Tcookie = struct { @@ -138094,12 +138045,12 @@ func Xfopen(tls *TLS, filename uintptr, mode uintptr) (r uintptr) { } /* Compute the flags to pass to open() */ flags = X__fmodeflags(tls, mode) - fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(filename), flags|Int32FromInt32(O_LARGEFILE), Int32FromInt32(0666)))) + fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(filename), int32(flags|Int32FromInt32(O_LARGEFILE)), int32(Int32FromInt32(0666))))) if fd < 0 { return uintptr(0) } if flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } f = X__fdopen(tls, fd, mode) if f != 0 { @@ -138325,7 +138276,7 @@ func _locking_putc(tls *TLS, c int32, f uintptr) (r int32) { if v6 < Int32FromInt32(0) { v6 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v5), Int32FromInt32(FUTEX_WAKE)|v7, v6) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v5), Int32FromInt32(FUTEX_WAKE), v6) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v5), int32(Int32FromInt32(FUTEX_WAKE)|v7), v6) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v5), int32(Int32FromInt32(FUTEX_WAKE)), v6) != 0 } return c } @@ -138342,7 +138293,7 @@ func Xfputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 20 @@ -138394,7 +138345,7 @@ func X__fputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) { var v2 uint8 var _ /* mbc at bp+0 */ [4]int8 _, _, _, _, _, _, _ = l, loc, ploc, v1, v2, v3, v4 - ploc = ___get_tp(tls) + 96 + ploc = uintptr(___get_tp(tls)) + 96 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if (*TFILE)(unsafe.Pointer(f)).Fmode <= 0 { Xfwide(tls, f, int32(1)) @@ -138486,7 +138437,7 @@ func Xfputws(tls *TLS, _ws uintptr, f uintptr) (r int32) { var _ /* buf at bp+4 */ [1024]uint8 _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3 l = uint32(0) - ploc = ___get_tp(tls) + 96 + ploc = uintptr(___get_tp(tls)) + 96 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+76) >= 0 { v1 = ___lockfile(tls, f) @@ -138626,10 +138577,10 @@ func Xfreopen(tls *TLS, filename uintptr, mode uintptr, f uintptr) (r uintptr) { Xfflush(tls, f) if !(filename != 0) { if fl&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } fl &= ^(Int32FromInt32(O_CREAT) | Int32FromInt32(O_EXCL) | Int32FromInt32(O_CLOEXEC)) - if X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(F_SETFL), fl))) < 0 { + if X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(F_SETFL)), fl))) < 0 { goto fail } } else { @@ -138862,7 +138813,7 @@ func X__do_orphaned_stdio_locks(tls *TLS) { } var f uintptr _ = f - f = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks + f = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks for { if !(f != 0) { break @@ -138886,7 +138837,7 @@ func X__unlist_locked_file(tls *TLS, f uintptr) { if (*TFILE)(unsafe.Pointer(f)).Fprev_locked != 0 { (*TFILE)(unsafe.Pointer((*TFILE)(unsafe.Pointer(f)).Fprev_locked)).Fnext_locked = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } else { - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } } } @@ -138912,7 +138863,7 @@ func Xftrylockfile(tls *TLS, f uintptr) (r int32) { var owner, tid, v1 int32 var self Tpthread_t _, _, _, _ = owner, self, tid, v1 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) tid = (*t__pthread)(unsafe.Pointer(self)).Ftid owner = AtomicLoadPInt32(f + 76) if owner & ^Int32FromInt32(MAYBE_WAITERS) == tid { @@ -138963,7 +138914,7 @@ func Xfwide(tls *TLS, f uintptr, mode int32) (r int32) { __need_unlock = v1 if mode != 0 { if !((*TFILE)(unsafe.Pointer(f)).Flocale != 0) { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -139132,7 +139083,7 @@ func _locking_getc1(tls *TLS, f uintptr) (r int32) { if v5 < Int32FromInt32(0) { v5 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v4), Int32FromInt32(FUTEX_WAKE)|v6, v5) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v4), Int32FromInt32(FUTEX_WAKE), v5) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v4), int32(Int32FromInt32(FUTEX_WAKE)|v6), v5) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v4), int32(Int32FromInt32(FUTEX_WAKE)), v5) != 0 } return c } @@ -139147,7 +139098,7 @@ func Xgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 4 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139234,7 +139185,7 @@ func _locking_getc2(tls *TLS, f uintptr) (r int32) { if v5 < Int32FromInt32(0) { v5 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v4), Int32FromInt32(FUTEX_WAKE)|v6, v5) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v4), Int32FromInt32(FUTEX_WAKE), v5) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v4), int32(Int32FromInt32(FUTEX_WAKE)|v6), v5) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v4), int32(Int32FromInt32(FUTEX_WAKE)), v5) != 0 } return c } @@ -139249,7 +139200,7 @@ func Xgetchar(tls *TLS) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = uintptr(unsafe.Pointer(&X__stdin_FILE)) l = AtomicLoadPInt32(v1 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 4 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139837,7 +139788,7 @@ func Xpclose(tls *TLS, f uintptr) (r1 int32) { pid = (*TFILE)(unsafe.Pointer(f)).Fpipe_pid Xfclose(tls, f) for { - v1 = X__syscall4(tls, int32(SYS_wait4), pid, int32(bp), Int32FromInt32(0), Int32FromInt32(0)) + v1 = int32(X__syscall4(tls, int32(SYS_wait4), pid, int32(bp), int32(Int32FromInt32(0)), int32(Int32FromInt32(0)))) r = v1 if !(v1 == -int32(EINTR)) { break @@ -139925,7 +139876,7 @@ func _locking_putc1(tls *TLS, c int32, f uintptr) (r int32) { if v6 < Int32FromInt32(0) { v6 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v5), Int32FromInt32(FUTEX_WAKE)|v7, v6) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v5), Int32FromInt32(FUTEX_WAKE), v6) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v5), int32(Int32FromInt32(FUTEX_WAKE)|v7), v6) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v5), int32(Int32FromInt32(FUTEX_WAKE)), v6) != 0 } return c } @@ -139942,7 +139893,7 @@ func Xputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 20 @@ -140037,7 +139988,7 @@ func _locking_putc2(tls *TLS, c int32, f uintptr) (r int32) { if v6 < Int32FromInt32(0) { v6 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v5), Int32FromInt32(FUTEX_WAKE)|v7, v6) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v5), Int32FromInt32(FUTEX_WAKE), v6) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v5), int32(Int32FromInt32(FUTEX_WAKE)|v7), v6) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v5), int32(Int32FromInt32(FUTEX_WAKE)), v6) != 0 } return c } @@ -140054,7 +140005,7 @@ func Xputchar(tls *TLS, c1 int32) (r int32) { v1 = c1 v2 = uintptr(unsafe.Pointer(&X__stdout_FILE)) l = AtomicLoadPInt32(v2 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 20 @@ -140173,9 +140124,9 @@ func Xremove(tls *TLS, path uintptr) (r1 int32) { } var r int32 _ = r - r = X__syscall1(tls, int32(SYS_unlink), int32(path)) + r = int32(X__syscall1(tls, int32(SYS_unlink), int32(path))) if r == -int32(EISDIR) { - r = X__syscall1(tls, int32(SYS_rmdir), int32(path)) + r = int32(X__syscall1(tls, int32(SYS_rmdir), int32(path))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -140446,7 +140397,7 @@ func Xtempnam(tls *TLS, dir uintptr, pfx uintptr) (r1 uintptr) { } ___randname(tls, bp+1+uintptr(l)-uintptr(6)) *(*[1]int8)(unsafe.Pointer(bp)) = [1]int8{} - r = X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), Int32FromInt32(1)) + r = int32(X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), int32(Int32FromInt32(1)))) if r == -int32(ENOENT) { return Xstrdup(tls, bp+1) } @@ -140476,7 +140427,7 @@ func Xtmpfile(tls *TLS) (r uintptr) { break } ___randname(tls, bp+uintptr(13)) - fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(bp), Int32FromInt32(O_RDWR)|Int32FromInt32(O_CREAT)|Int32FromInt32(O_EXCL)|Int32FromInt32(O_LARGEFILE), Int32FromInt32(0600)))) + fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(bp), int32(Int32FromInt32(O_RDWR)|Int32FromInt32(O_CREAT)|Int32FromInt32(O_EXCL)|Int32FromInt32(O_LARGEFILE)), int32(Int32FromInt32(0600))))) if fd >= 0 { X__syscall1(tls, int32(SYS_unlink), int32(bp)) f = X__fdopen(tls, fd, __ccgo_ts+1416) @@ -140512,7 +140463,7 @@ func Xtmpnam(tls *TLS, buf uintptr) (r1 uintptr) { } ___randname(tls, bp+1+uintptr(12)) *(*[1]int8)(unsafe.Pointer(bp)) = [1]int8{} - r = X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), Int32FromInt32(1)) + r = int32(X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), int32(Int32FromInt32(1)))) if r == -int32(ENOENT) { if buf != 0 { v2 = buf @@ -140581,7 +140532,7 @@ func Xungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) { var v3 bool var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3, v4, v5, p6 - ploc = ___get_tp(tls) + 96 + ploc = uintptr(___get_tp(tls)) + 96 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+76) >= 0 { v1 = ___lockfile(tls, f) @@ -140855,7 +140806,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(uint32(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -141043,7 +140994,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -141106,7 +141057,7 @@ _4: v14 = s s++ *(*int8)(unsafe.Pointer(v14)) = int8(int32(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int32(s)-t__predefined_ptrdiff_t(bp+516) == int32(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -141159,7 +141110,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -143029,7 +142980,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(uint32(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -144606,7 +144557,7 @@ func Xatol(tls *TLS, s uintptr) (r int32) { for BoolInt32(Uint32FromInt8(*(*int8)(unsafe.Pointer(s)))-uint32('0') < uint32(10)) != 0 { v4 = s s++ - n = int32(10)*n - (int32(*(*int8)(unsafe.Pointer(v4))) - Int32FromUint8('0')) + n = int32(10)*n - int32(int32(*(*int8)(unsafe.Pointer(v4)))-Int32FromUint8('0')) } if neg != 0 { v5 = n @@ -144658,9 +144609,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -144668,7 +144621,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint32(0) { try = base + uintptr(width*(nel/uint32(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint32(2) } else { @@ -144858,7 +144811,7 @@ func _pntz(tls *TLS, p uintptr) (r1 int32) { var v1, v5 uint32 var v8 bool _, _, _, _, _, _, _ = r, v1, v2, v4, v5, v6, v8 - v1 = *(*Tsize_t)(unsafe.Pointer(p)) - Uint32FromInt32(1) + v1 = uint32(*(*Tsize_t)(unsafe.Pointer(p)) - Uint32FromInt32(1)) v2 = _a_ctz_32(tls, v1) goto _3 _3: @@ -144938,7 +144891,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*4)) >>= Uint32FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(240) defer tls.Free(240) var i, v1, v2 int32 @@ -144950,10 +144903,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*4))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[57]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -144970,7 +144923,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(240) defer tls.Free(240) var i, trail, v1 int32 @@ -144984,13 +144937,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[57]uintptr)(unsafe.Pointer(bp + 8)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint32(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*4))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[57]uintptr)(unsafe.Pointer(bp + 8)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[57]uintptr)(unsafe.Pointer(bp + 8)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*4))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -145005,13 +144958,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+8, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(208) defer tls.Free(208) @@ -145049,14 +145004,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 192)))[0]&uint32(3) == uint32(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+192, int32(2)) pshift += int32(2) } else { if (*(*[48]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint32FromInt32(int32(high)-int32(head)) { - _trinkle(tls, head, width, cmp, arg, bp+192, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+192, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+192, int32(1)) @@ -145069,7 +145024,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 192)) |= uint32(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+192, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+192, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 192)))[0] != uint32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 192)))[int32(1)] != uint32(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+192) @@ -145080,31 +145035,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 192)) ^= uint32(7) _shr(tls, bp+192, int32(1)) - _trinkle(tls, head-uintptr((*(*[48]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+192, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[48]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+192, pshift+int32(1), int32(1), bp) _shl(tls, bp+192, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 192)) |= uint32(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+192, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+192, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -148879,7 +148838,7 @@ func Xtcdrain(tls *TLS, fd int32) (r int32) { trc("tls=%v fd=%v, (%v:)", tls, fd, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ioctl), fd, Int32FromInt32(TCSBRK), Int32FromInt32(1), 0, 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TCSBRK)), int32(Int32FromInt32(1)), 0, 0, 0))) } func Xtcflow(tls *TLS, fd int32, action int32) (r int32) { @@ -148934,7 +148893,7 @@ func Xtcgetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) { trc("tls=%v fd=%v wsz=%v, (%v:)", tls, fd, wsz, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCGWINSZ), int32(wsz)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCGWINSZ)), int32(wsz)))) } func Xtcsendbreak(tls *TLS, fd int32, dur int32) (r int32) { @@ -148967,7 +148926,7 @@ func Xtcsetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) { trc("tls=%v fd=%v wsz=%v, (%v:)", tls, fd, wsz, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCSWINSZ), int32(wsz)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCSWINSZ)), int32(wsz)))) } func X__map_file(tls *TLS, pathname uintptr, size uintptr) (r uintptr) { @@ -148982,7 +148941,7 @@ func X__map_file(tls *TLS, pathname uintptr, size uintptr) (r uintptr) { var _ /* st at bp+0 */ Tstat _, _, _ = fd, map1, v1 map1 = uintptr(-Int32FromInt32(1)) - fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(pathname), Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_NONBLOCK)|Int32FromInt32(O_LARGEFILE)))) + fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(pathname), int32(Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_NONBLOCK)|Int32FromInt32(O_LARGEFILE))))) if fd < 0 { return uintptr(0) } @@ -149707,10 +149666,10 @@ func X__secs_to_zone(tls *TLS, t int64, local int32, isdst uintptr, offset uintp i = _scan_trans(tls, t, local, bp) if i != Uint32FromInt32(-Int32FromInt32(1)) { *(*int32)(unsafe.Pointer(isdst)) = Int32FromUint8(*(*uint8)(unsafe.Pointer(_types + uintptr(uint32(6)*i+uint32(4))))) - *(*int32)(unsafe.Pointer(offset)) = Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)*i))) + *(*int32)(unsafe.Pointer(offset)) = int32(Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)*i)))) *(*uintptr)(unsafe.Pointer(zonename)) = _abbrevs + uintptr(*(*uint8)(unsafe.Pointer(_types + uintptr(uint32(6)*i+uint32(5))))) if oppoff != 0 { - *(*int32)(unsafe.Pointer(oppoff)) = Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)**(*Tsize_t)(unsafe.Pointer(bp))))) + *(*int32)(unsafe.Pointer(oppoff)) = int32(Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)**(*Tsize_t)(unsafe.Pointer(bp)))))) } ___unlock(tls, uintptr(unsafe.Pointer(&_lock4))) return @@ -149935,7 +149894,7 @@ func Xclock_getcpuclockid(tls *TLS, pid Tpid_t, clk uintptr) (r int32) { var _ /* ts at bp+0 */ Ttimespec _, _ = id, ret id = Int32FromUint32(Uint32FromInt32(-pid-Int32FromInt32(1))*uint32(8) + uint32(2)) - ret = X__syscall2(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(7), id, int32(bp)) + ret = int32(X__syscall2(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(7)), id, int32(bp))) if ret == -int32(EINVAL) { ret = -int32(ESRCH) } @@ -149958,7 +149917,7 @@ func Xclock_getres(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { _ = r /* On a 32-bit arch, use the old syscall if it exists. */ if Int32FromInt32(__NR_timer_create)+Int32FromInt32(7) != int32(SYS_clock_getres_time64) { - r = X__syscall2(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(7), clk, int32(bp)) + r = int32(X__syscall2(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(7)), clk, int32(bp))) if !(r != 0) && ts != 0 { (*Ttimespec)(unsafe.Pointer(ts)).Ftv_sec = int64((*(*[2]int32)(unsafe.Pointer(bp)))[0]) (*Ttimespec)(unsafe.Pointer(ts)).Ftv_nsec = (*(*[2]int32)(unsafe.Pointer(bp)))[int32(1)] @@ -149967,7 +149926,7 @@ func Xclock_getres(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { } /* If reaching this point, it's a 64-bit arch or time64-only * 32-bit arch and we can get result directly into timespec. */ - return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(7), clk, int32(ts)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(7)), clk, int32(ts)))) } func X__clock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { @@ -149982,14 +149941,14 @@ func X__clock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { _ = r r = -int32(ENOSYS) if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_clock_gettime64), clk, int32(ts)) + r = int32(X__syscall2(tls, int32(SYS_clock_gettime64), clk, int32(ts))) } if Bool(Int32FromInt32(__NR_timer_create)+Int32FromInt32(6) == int32(SYS_clock_gettime64)) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(6), clk, int32(bp)) + r = int32(X__syscall2(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(6)), clk, int32(bp))) if r == -int32(ENOSYS) && clk == CLOCK_REALTIME { - r = X__syscall2(tls, int32(SYS_gettimeofday_time32), int32(bp), Int32FromInt32(0)) + r = int32(X__syscall2(tls, int32(SYS_gettimeofday_time32), int32(bp), int32(Int32FromInt32(0)))) *(*int32)(unsafe.Pointer(bp + 1*4)) *= int32(1000) } if !(r != 0) { @@ -150032,7 +149991,7 @@ func X__clock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem 0: s, 1: int64(ns), } - r = ___syscall_cp(tls, int32(SYS_clock_nanosleep_time64), clk, flags, int32(bp), int32(rem), 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_clock_nanosleep_time64), clk, flags, int32(bp), int32(rem), 0, 0)) } if Bool(Int32FromInt32(__NR_timer_create)+Int32FromInt32(8) == int32(SYS_clock_nanosleep_time64)) || r != -int32(ENOSYS) { return -r @@ -150049,13 +150008,13 @@ func X__clock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem v2 = uint64(0x7fffffff) + (0+Uint64FromInt64(s))>>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v2), + 0: int32(Int32FromUint64(v2)), 1: ns, } if clk == CLOCK_REALTIME && !(flags != 0) { - r = ___syscall_cp(tls, int32(SYS_nanosleep), int32(bp+16), int32(bp+16), 0, 0, 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_nanosleep), int32(bp+16), int32(bp+16), 0, 0, 0, 0)) } else { - r = ___syscall_cp(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(8), clk, flags, int32(bp+16), int32(bp+16), 0, 0) + r = int32(___syscall_cp(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(8)), clk, flags, int32(bp+16), int32(bp+16), 0, 0)) } if r == -int32(EINTR) && rem != 0 && !(flags&Int32FromInt32(TIMER_ABSTIME) != 0) { (*Ttimespec)(unsafe.Pointer(rem)).Ftv_sec = int64((*(*[2]int32)(unsafe.Pointer(bp + 16)))[0]) + extra @@ -150090,7 +150049,7 @@ func Xclock_settime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { 0: s, 1: int64(ns), } - r = X__syscall2(tls, int32(SYS_clock_settime64), clk, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_clock_settime64), clk, int32(bp))) } if Bool(Int32FromInt32(__NR_timer_create)+Int32FromInt32(5) == int32(SYS_clock_settime64)) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -150102,7 +150061,7 @@ func Xclock_settime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { 0: int32(s), 1: ns, } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(5), clk, int32(bp+16)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(5)), clk, int32(bp+16)))) } func Xctime(tls *TLS, t uintptr) (r uintptr) { @@ -150830,7 +150789,7 @@ func Xstrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t trc("tls=%v s=%v n=%v f=%v tm=%v, (%v:)", tls, s, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151328,10 +151287,10 @@ func Xtimer_delete(tls *TLS, t Ttimer_t) (r int32) { if int32(t) < 0 { td = uintptr(uint32(t) << Int32FromInt32(1)) _a_store(tls, td+92, AtomicLoadPInt32(td+92)|(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff))) - X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(td)).Ftid, Int32FromInt32(SIGTIMER)) + X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(td)).Ftid, int32(Int32FromInt32(SIGTIMER))) return 0 } - return X__syscall1(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(4), int32(t)) + return int32(X__syscall1(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(4)), int32(t))) } func Xtimer_getoverrun(tls *TLS, t Ttimer_t) (r int32) { @@ -151345,7 +151304,7 @@ func Xtimer_getoverrun(tls *TLS, t Ttimer_t) (r int32) { td = uintptr(uint32(t) << Int32FromInt32(1)) t = uintptr(Uint32FromInt32(AtomicLoadPInt32(td+92) & Int32FromInt32(INT_MAX))) } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall1(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(3), int32(t)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall1(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(3)), int32(t)))) } func Xtimer_gettime(tls *TLS, t Ttimer_t, val uintptr) (r1 int32) { @@ -151365,12 +151324,12 @@ func Xtimer_gettime(tls *TLS, t Ttimer_t, val uintptr) (r1 int32) { } r = -int32(ENOSYS) if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_timer_gettime64), int32(t), int32(val)) + r = int32(X__syscall2(tls, int32(SYS_timer_gettime64), int32(t), int32(val))) } if Bool(Int32FromInt32(__NR_timer_create)+Int32FromInt32(2) == int32(SYS_timer_gettime64)) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(2), int32(t), int32(bp)) + r = int32(X__syscall2(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(2)), int32(t), int32(bp))) if !(r != 0) { (*Titimerspec)(unsafe.Pointer(val)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[0]) (*Titimerspec)(unsafe.Pointer(val)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp)))[int32(1)] @@ -151378,7 +151337,7 @@ func Xtimer_gettime(tls *TLS, t Ttimer_t, val uintptr) (r1 int32) { (*Titimerspec)(unsafe.Pointer(val)).Fit_value.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp)))[int32(3)] } return X__syscall_ret(tls, Uint32FromInt32(r)) - return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(2), int32(t), int32(val)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(2)), int32(t), int32(val)))) } func Xtimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) (r1 int32) { @@ -151409,7 +151368,7 @@ func Xtimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) 2: vs, 3: int64(vns), } - r = X__syscall4(tls, int32(SYS_timer_settime64), int32(t), flags, int32(bp), int32(old)) + r = int32(X__syscall4(tls, int32(SYS_timer_settime64), int32(t), flags, int32(bp), int32(old))) } if Bool(Int32FromInt32(__NR_timer_create)+Int32FromInt32(1) == int32(SYS_timer_settime64)) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -151423,7 +151382,7 @@ func Xtimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) 2: int32(vs), 3: vns, } - r = X__syscall4(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(1), int32(t), flags, int32(bp+32), int32(bp+48)) + r = int32(X__syscall4(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(1)), int32(t), flags, int32(bp+32), int32(bp+48))) if !(r != 0) && old != 0 { (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp + 48)))[0]) (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp + 48)))[int32(1)] @@ -151431,7 +151390,7 @@ func Xtimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) (*Titimerspec)(unsafe.Pointer(old)).Fit_value.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp + 48)))[int32(3)] } return X__syscall_ret(tls, Uint32FromInt32(r)) - return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, Int32FromInt32(__NR_timer_create)+Int32FromInt32(1), int32(t), flags, int32(val), int32(old)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(Int32FromInt32(__NR_timer_create)+Int32FromInt32(1)), int32(t), flags, int32(val), int32(old)))) } type Ttms = struct { @@ -151628,7 +151587,7 @@ func Xwcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize trc("tls=%v wcs=%v n=%v f=%v tm=%v, (%v:)", tls, wcs, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xwcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151709,7 +151668,7 @@ func Xclose(tls *TLS, fd int32) (r1 int32) { var r int32 _ = r fd = _dummy12(tls, fd) - r = ___syscall_cp(tls, int32(SYS_close), fd, 0, 0, 0, 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_close), fd, 0, 0, 0, 0, 0)) if r == -int32(EINTR) { r = 0 } @@ -151747,7 +151706,7 @@ func Xdup2(tls *TLS, old int32, new1 int32) (r1 int32) { var r, v1 int32 _, _ = r, v1 for { - v1 = X__syscall2(tls, int32(SYS_dup2), old, new1) + v1 = int32(X__syscall2(tls, int32(SYS_dup2), old, new1)) r = v1 if !(v1 == -int32(EBUSY)) { break @@ -151768,7 +151727,7 @@ func X__dup3(tls *TLS, old int32, new1 int32, flags int32) (r1 int32) { } if flags != 0 { for { - v1 = X__syscall3(tls, int32(SYS_dup3), old, new1, flags) + v1 = int32(X__syscall3(tls, int32(SYS_dup3), old, new1, flags)) r = v1 if !(v1 == -int32(EBUSY)) { break @@ -151782,14 +151741,14 @@ func X__dup3(tls *TLS, old int32, new1 int32, flags int32) (r1 int32) { } } for { - v2 = X__syscall2(tls, int32(SYS_dup2), old, new1) + v2 = int32(X__syscall2(tls, int32(SYS_dup2), old, new1)) r = v2 if !(v2 == -int32(EBUSY)) { break } } if r >= 0 && flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), new1, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), new1, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -151816,10 +151775,10 @@ func _checker(tls *TLS, p uintptr) (r int32) { var _ /* ret at bp+0 */ int32 _ = c c = p - if X__syscall2(tls, int32(SYS_setregid32), X__syscall0(tls, int32(SYS_getegid32)), -Int32FromInt32(1)) != 0 || X__syscall2(tls, int32(SYS_setreuid32), X__syscall0(tls, int32(SYS_geteuid32)), -Int32FromInt32(1)) != 0 { - X__syscall1(tls, int32(SYS_exit), Int32FromInt32(1)) + if X__syscall2(tls, int32(SYS_setregid32), X__syscall0(tls, int32(SYS_getegid32)), int32(-Int32FromInt32(1))) != 0 || X__syscall2(tls, int32(SYS_setreuid32), X__syscall0(tls, int32(SYS_geteuid32)), int32(-Int32FromInt32(1))) != 0 { + X__syscall1(tls, int32(SYS_exit), int32(Int32FromInt32(1))) } - *(*int32)(unsafe.Pointer(bp)) = X__syscall4(tls, int32(SYS_faccessat), (*Tctx1)(unsafe.Pointer(c)).Ffd, int32((*Tctx1)(unsafe.Pointer(c)).Ffilename), (*Tctx1)(unsafe.Pointer(c)).Famode, Int32FromInt32(0)) + *(*int32)(unsafe.Pointer(bp)) = int32(X__syscall4(tls, int32(SYS_faccessat), (*Tctx1)(unsafe.Pointer(c)).Ffd, int32((*Tctx1)(unsafe.Pointer(c)).Ffilename), (*Tctx1)(unsafe.Pointer(c)).Famode, int32(Int32FromInt32(0)))) X__syscall3(tls, int32(SYS_write), (*Tctx1)(unsafe.Pointer(c)).Fp, int32(bp), Int32FromUint32(Uint32FromInt64(4))) return 0 } @@ -151832,7 +151791,7 @@ func Xfaccessat(tls *TLS, fd int32, filename uintptr, amode int32, flag int32) ( var ret int32 _ = ret if flag != 0 { - ret = X__syscall4(tls, int32(SYS_faccessat2), fd, int32(filename), amode, flag) + ret = int32(X__syscall4(tls, int32(SYS_faccessat2), fd, int32(filename), amode, flag)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -151853,8 +151812,8 @@ func Xfchdir(tls *TLS, fd int32) (r int32) { var ret int32 var _ /* buf at bp+0 */ [27]int8 _ = ret - ret = X__syscall1(tls, int32(SYS_fchdir), fd) - if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) < 0 { + ret = int32(X__syscall1(tls, int32(SYS_fchdir), fd)) + if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) < 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) } X__procfdname(tls, bp, Uint32FromInt32(fd)) @@ -151871,8 +151830,8 @@ func Xfchown(tls *TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { var ret int32 var _ /* buf at bp+0 */ [27]int8 _ = ret - ret = X__syscall3(tls, int32(SYS_fchown32), fd, Int32FromUint32(uid), Int32FromUint32(gid)) - if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) < 0 { + ret = int32(X__syscall3(tls, int32(SYS_fchown32), fd, Int32FromUint32(uid), Int32FromUint32(gid))) + if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) < 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) } X__procfdname(tls, bp, Uint32FromInt32(fd)) @@ -152062,7 +152021,7 @@ func Xgetpgrp(tls *TLS) (r Tpid_t) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall1(tls, int32(SYS_getpgid), Int32FromInt32(0)) + return int32(X__syscall1(tls, int32(SYS_getpgid), int32(Int32FromInt32(0)))) } func Xgetpid(tls *TLS) (r Tpid_t) { @@ -152070,7 +152029,7 @@ func Xgetpid(tls *TLS) (r Tpid_t) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall0(tls, int32(SYS_getpid)) + return int32(X__syscall0(tls, int32(SYS_getpid))) } func Xgetppid(tls *TLS) (r Tpid_t) { @@ -152078,7 +152037,7 @@ func Xgetppid(tls *TLS) (r Tpid_t) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall0(tls, int32(SYS_getppid)) + return int32(X__syscall0(tls, int32(SYS_getppid))) } func Xgetsid(tls *TLS, pid Tpid_t) (r Tpid_t) { @@ -152107,7 +152066,7 @@ func Xisatty(tls *TLS, fd int32) (r1 int32) { var r uint32 var _ /* wsz at bp+0 */ Twinsize _ = r - r = Uint32FromInt32(X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCGWINSZ), int32(bp))))) + r = Uint32FromInt32(X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCGWINSZ)), int32(bp))))) if r == uint32(0) { return int32(1) } @@ -152223,7 +152182,7 @@ func Xpipe2(tls *TLS, fd uintptr, flag int32) (r int32) { if !(flag != 0) { return Xpipe(tls, fd) } - ret = X__syscall2(tls, int32(SYS_pipe2), int32(fd), flag) + ret = int32(X__syscall2(tls, int32(SYS_pipe2), int32(fd), flag)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -152235,12 +152194,12 @@ func Xpipe2(tls *TLS, fd uintptr, flag int32) (r int32) { return ret } if flag&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if flag&int32(O_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } return 0 } @@ -152307,7 +152266,7 @@ func Xreadlink(tls *TLS, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_ buf = bp bufsize = uint32(1) } - r = X__syscall3(tls, int32(SYS_readlink), int32(path), int32(buf), Int32FromUint32(bufsize)) + r = int32(X__syscall3(tls, int32(SYS_readlink), int32(path), int32(buf), Int32FromUint32(bufsize))) if buf == bp && r > 0 { r = 0 } @@ -152328,7 +152287,7 @@ func Xreadlinkat(tls *TLS, fd int32, path uintptr, buf uintptr, bufsize Tsize_t) buf = bp bufsize = uint32(1) } - r = X__syscall4(tls, int32(SYS_readlinkat), fd, int32(path), int32(buf), Int32FromUint32(bufsize)) + r = int32(X__syscall4(tls, int32(SYS_readlinkat), fd, int32(path), int32(buf), Int32FromUint32(bufsize))) if buf == bp && r > 0 { r = 0 } @@ -152415,14 +152374,14 @@ func _do_setxid(tls *TLS, p uintptr) { if (*Tctx2)(unsafe.Pointer(c)).Fret < 0 { return } - ret = X__syscall3(tls, (*Tctx2)(unsafe.Pointer(c)).Fnr, (*Tctx2)(unsafe.Pointer(c)).Fid, (*Tctx2)(unsafe.Pointer(c)).Feid, (*Tctx2)(unsafe.Pointer(c)).Fsid) + ret = int32(X__syscall3(tls, (*Tctx2)(unsafe.Pointer(c)).Fnr, (*Tctx2)(unsafe.Pointer(c)).Fid, (*Tctx2)(unsafe.Pointer(c)).Feid, (*Tctx2)(unsafe.Pointer(c)).Fsid)) if ret != 0 && !((*Tctx2)(unsafe.Pointer(c)).Fret != 0) { /* If one thread fails to set ids after another has already * succeeded, forcibly killing the process is the only safe * thing to do. State is inconsistent and dangerous. Use * SIGKILL because it is uncatchable. */ X__block_all_sigs(tls, uintptr(0)) - X__syscall2(tls, int32(SYS_kill), X__syscall0(tls, int32(SYS_getpid)), Int32FromInt32(SIGKILL)) + X__syscall2(tls, int32(SYS_kill), X__syscall0(tls, int32(SYS_getpid)), int32(Int32FromInt32(SIGKILL))) } (*Tctx2)(unsafe.Pointer(c)).Fret = ret } @@ -153810,8 +153769,6 @@ func X__utimes_time32(tls *TLS, path uintptr, times32 uintptr) (r int32) { return Xutimes(tls, path, v1) } -type t__ucontext5 = Tucontext_t7 - func X__wait3_time32(tls *TLS, status uintptr, options int32, usage uintptr) (r1 Tpid_t) { if __ccgo_strace { trc("tls=%v status=%v options=%v usage=%v, (%v:)", tls, status, options, usage, origin(2)) @@ -153937,7 +153894,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1225,15 +1225,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1251,7 +1251,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1264,14 +1264,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1286,7 +1286,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1302,14 +1302,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1325,8 +1325,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1352,24 +1352,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1382,15 +1382,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1399,48 +1399,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1541,8 +1541,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1621,8 +1621,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1957,18 +1957,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1980,16 +1980,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -2006,7 +2006,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -2041,7 +2041,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -2059,14 +2059,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2082,8 +2082,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2115,18 +2115,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2138,16 +2138,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2155,7 +2155,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2177,27 +2177,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2325,16 +2325,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2441,16 +2441,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2553,7 +2553,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2570,7 +2570,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)< %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -24937,7 +24941,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -24975,8 +24979,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint64(8), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint64(8), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint64(cnt) @@ -25723,9 +25727,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25737,7 +25743,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -26305,19 +26311,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26341,14 +26347,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26502,7 +26508,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26528,16 +26534,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26679,10 +26685,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26718,7 +26724,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26747,15 +26753,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26780,7 +26786,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -28206,15 +28212,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28336,7 +28344,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)< _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -101123,17 +101122,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -101161,7 +101160,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07)) goto _3 _3: ; @@ -101341,7 +101340,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101365,8 +101364,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101375,8 +101374,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101469,7 +101468,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101496,8 +101495,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101512,7 +101511,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101531,7 +101530,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -101722,19 +101721,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + _toint1 - _toint1 n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -101831,14 +101830,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + float64(z*(_S3+float64(z*_S4))) + float64(Tdouble_t(z*w)*(_S5+float64(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + float64(v*(_S1+float64(z*r))) } else { - return x - (z*(Float64FromFloat64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(float64(Float64FromFloat64(0.5)*y)-float64(v*r))) - y - Tdouble_t(v*_S1)) } return r1 } @@ -101860,11 +101859,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S31 + float64(z*_S41) + s = Tdouble_t(z * x) + return float32(x + float64(s*(_S11+float64(z*_S21))) + float64(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -101907,21 +101906,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + float64(w*(_T[int32(3)]+float64(w*(_T[int32(5)]+float64(w*(_T[int32(7)]+float64(w*(_T[int32(9)]+float64(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + float64(w*(_T[int32(4)]+float64(w*(_T[int32(6)]+float64(w*(_T[int32(8)]+float64(w*(_T[int32(10)]+float64(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + float64(z*(Tdouble_t(s*(r+v))+y)) + float64(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - float64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(float64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -101942,7 +101941,7 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { a0 = v3 v4 = *(*Tuint64_t)(unsafe.Pointer(&a0))>>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -102043,24 +102042,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -102103,24 +102102,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -102151,11 +102150,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102189,11 +102188,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102232,8 +102231,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102253,7 +102252,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102263,21 +102262,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102296,8 +102295,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = z * (_pS03 + z*(_pS13+z*_pS23)) - q = Float32FromFloat32(1) + z*_qS13 + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = Float32FromFloat32(1) + float32(z*_qS13) return p / q } @@ -102314,7 +102313,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102323,12 +102322,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102372,11 +102371,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint64(8) == uint64(4) { @@ -102437,11 +102436,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint64(4) == uint64(4) { @@ -102567,7 +102566,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if ix < uint32(0x3ff30000) { /* |x| < 1.1875 */ if ix < uint32(0x3fe60000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (float64(2)*x3 - float64(1)) / (float64(2) + x3) + x3 = (float64(float64(2)*x3) - float64(1)) / (float64(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - float64(1)) / (x3 + float64(1)) @@ -102575,7 +102574,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } else { if ix < uint32(0x40038000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - float64(1.5)) / (float64(1) + float64(1.5)*x3) + x3 = (x3 - float64(1.5)) / (float64(1) + float64(float64(1.5)*x3)) } else { /* 2.4375 <= |x| < 2^66 */ id = int32(3) x3 = -Float64FromFloat64(1) / x3 @@ -102583,15 +102582,15 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tdouble_t(x3 * x3) + w = Tdouble_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT[0] + w*(_aT[int32(2)]+w*(_aT[int32(4)]+w*(_aT[int32(6)]+w*(_aT[int32(8)]+w*_aT[int32(10)]))))) - s2 = w * (_aT[int32(1)] + w*(_aT[int32(3)]+w*(_aT[int32(5)]+w*(_aT[int32(7)]+w*_aT[int32(9)])))) + s1 = Tdouble_t(z * (_aT[0] + float64(w*(_aT[int32(2)]+float64(w*(_aT[int32(4)]+float64(w*(_aT[int32(6)]+float64(w*(_aT[int32(8)]+float64(w*_aT[int32(10)]))))))))))) + s2 = Tdouble_t(w * (_aT[int32(1)] + float64(w*(_aT[int32(3)]+float64(w*(_aT[int32(5)]+float64(w*(_aT[int32(7)]+float64(w*_aT[int32(9)]))))))))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float64(x3*(s1+s2)) } - z = _atanhi[id] - (x3*(s1+s2) - _atanlo[id] - x3) + z = _atanhi[id] - (float64(x3*(s1+s2)) - _atanlo[id] - x3) if sign != 0 { v4 = -z } else { @@ -102677,9 +102676,9 @@ _2: case uint32(1): return -_pi / Float64FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float64FromInt32(3) * _pi / Float64FromInt32(4) /* atan(+INF,-INF) */ + return float64(Float64FromInt32(3)*_pi) / Float64FromInt32(4) /* atan(+INF,-INF) */ case uint32(3): - return float64(-Int32FromInt32(3)) * _pi / Float64FromInt32(4) /* atan(-INF,-INF) */ + return float64(float64(-Int32FromInt32(3))*_pi) / Float64FromInt32(4) /* atan(-INF,-INF) */ } } else { switch m { @@ -102794,9 +102793,9 @@ _2: case uint32(1): return -_pi1 / Float32FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float32FromInt32(3) * _pi1 / Float32FromInt32(4) /*atan(+INF,-INF)*/ + return float32(Float32FromInt32(3)*_pi1) / Float32FromInt32(4) /*atan(+INF,-INF)*/ case uint32(3): - return float32(-Int32FromInt32(3)) * _pi1 / Float32FromInt32(4) /*atan(-INF,-INF)*/ + return float32(float32(-Int32FromInt32(3))*_pi1) / Float32FromInt32(4) /*atan(-INF,-INF)*/ } } else { switch m { @@ -102911,7 +102910,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x00800000) { /* raise underflow for subnormal x */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -102928,7 +102927,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x3f980000) { /* |x| < 1.1875 */ if ix < uint32(0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (Float32FromFloat32(2)*x3 - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) + x3 = (float32(Float32FromFloat32(2)*x3) - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - Float32FromFloat32(1)) / (x3 + Float32FromFloat32(1)) @@ -102936,7 +102935,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } else { if ix < uint32(0x401c0000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + Float32FromFloat32(1.5)*x3) + x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + float32(Float32FromFloat32(1.5)*x3)) } else { /* 2.4375 <= |x| < 2**26 */ id = int32(3) x3 = -Float32FromFloat32(1) / x3 @@ -102944,15 +102943,15 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tfloat_t(x3 * x3) + w = Tfloat_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT1[0] + w*(_aT1[int32(2)]+w*_aT1[int32(4)])) - s2 = w * (_aT1[int32(1)] + w*_aT1[int32(3)]) + s1 = Tfloat_t(z * (_aT1[0] + float32(w*(_aT1[int32(2)]+float32(w*_aT1[int32(4)]))))) + s2 = Tfloat_t(w * (_aT1[int32(1)] + float32(w*_aT1[int32(3)]))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float32(x3*(s1+s2)) } - z = _atanhi1[id] - (x3*(s1+s2) - _atanlo1[id] - x3) + z = _atanhi1[id] - (float32(x3*(s1+s2)) - _atanlo1[id] - x3) if sign != 0 { v4 = -z } else { @@ -103009,11 +103008,11 @@ func Xatanh(tls *TLS, x3 float64) (r float64) { } } else { /* |x| < 0.5, up to 1.7ulp error */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*y3+Float64FromInt32(2)*y3*y3/(Float64FromInt32(1)-y3)) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, Tdouble_t(Float64FromInt32(2)*y3)+Tdouble_t(Tdouble_t(Float64FromInt32(2)*y3)*y3)/(Float64FromInt32(1)-y3))) } } else { /* avoid overflow */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, float64(Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))))) } if s != 0 { v1 = -y3 @@ -103059,22 +103058,22 @@ func Xatanhf(tls *TLS, x3 float32) (r float32) { /* handle underflow */ if *(*Tuint32_t)(unsafe.Pointer(bp)) < Uint32FromInt32(Int32FromInt32(1)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -103179,8 +103178,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103195,11 +103194,11 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(*(*Tuint64_t)(unsafe.Pointer(bp))+Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103237,7 +103236,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103251,14 +103250,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103551,10 +103550,10 @@ const M_PI_23 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _c1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _c2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _c3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _c4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _c1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _c2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _c3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _c4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xcosf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -103690,13 +103689,13 @@ func Xcosh(tls *TLS, x3 float64) (r float64) { return Float64FromInt32(1) } t = Xexpm1(tls, x3) - return Float64FromInt32(1) + t*t/(Float64FromInt32(2)*(Float64FromInt32(1)+t)) + return Float64FromInt32(1) + float64(t*t)/float64(Float64FromInt32(2)*(Float64FromInt32(1)+t)) } /* |x| < log(DBL_MAX) */ if w < uint32(0x40862e42) { t = Xexp(tls, x3) /* note: if x>log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -103746,12 +103745,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -103846,8 +103845,8 @@ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) + P = _pa0 + float64(s*(_pa1+float64(s*(_pa2+float64(s*(_pa3+float64(s*(_pa4+float64(s*(_pa5+float64(s*_pa6))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+float64(s*(_qa2+float64(s*(_qa3+float64(s*(_qa4+float64(s*(_qa5+float64(s*_qa6))))))))))) return Float64FromInt32(1) - _erx - P/Q } @@ -103860,18 +103859,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = Float64FromInt32(1) / float64(x*x) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = float64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = _ra0 + float64(s*(_ra1+float64(s*(_ra2+float64(s*(_ra3+float64(s*(_ra4+float64(s*(_ra5+float64(s*(_ra6+float64(s*_ra7))))))))))))) + S = float64(1) + float64(s*(_sa1+float64(s*(_sa2+float64(s*(_sa3+float64(s*(_sa4+float64(s*(_sa5+float64(s*(_sa6+float64(s*(_sa7+float64(s*_sa8))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = float64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = _rb0 + float64(s*(_rb1+float64(s*(_rb2+float64(s*(_rb3+float64(s*(_rb4+float64(s*(_rb5+float64(s*_rb6))))))))))) + S = float64(1) + float64(s*(_sb1+float64(s*(_sb2+float64(s*(_sb3+float64(s*(_sb4+float64(s*(_sb5+float64(s*(_sb6+float64(s*_sb7))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = _rb01 + s*(_rb11+s*(_rb21+s*(_rb31+s*(_rb41+s*(_rb51+s*_rb61))))) - S = Float32FromFloat32(1) + s*(_sb11+s*(_sb21+s*(_sb31+s*(_sb41+s*(_sb51+s*(_sb61+s*_sb71)))))) + R = _rb01 + float32(s*(_rb11+float32(s*(_rb21+float32(s*(_rb31+float32(s*(_rb41+float32(s*(_rb51+float32(s*_rb61))))))))))) + S = Float32FromFloat32(1) + float32(s*(_sb11+float32(s*(_sb21+float32(s*(_sb31+float32(s*(_sb41+float32(s*(_sb51+float32(s*(_sb61+float32(s*_sb71))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, (z-x)*(z+x)+R/S) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32((z-x)*(z+x))+R/S)) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -104078,13 +104077,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -104119,14 +104118,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -104139,7 +104138,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -104183,7 +104182,7 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo /* k > 0, the exponent of scale might have overflowed by <= 460. */ sbits = Tuint64_t(sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104332,8 +104331,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104408,10 +104407,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104473,7 +104472,7 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl /* k > 0, the exponent of scale might have overflowed by 1. */ sbits = Tuint64_t(sbits - Uint64FromUint64(1)< 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -104657,11 +104656,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + float64(1) if k == int32(1024) { - y3 = y3 * float64(2) * float64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } return y3 - float64(1) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -104995,10 +104994,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float32(k) - hi = x3 - t*_ln2_hi1 /* t*ln2_hi is exact here */ - lo = t * _ln2_lo1 + hi = x3 - float32(t*_ln2_hi1) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * _ln2_lo1) } x3 = hi - lo c = hi - x3 - lo @@ -105006,7 +105005,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -105021,42 +105020,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = Float32FromFloat32(0.5) * x3 - hxs = x3 * hfx - r1 = Float32FromFloat32(1) + hxs*(_Q11+hxs*_Q21) - t = Float32FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float32FromFloat32(6) - x3*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(x3 * hfx) + r1 = Float32FromFloat32(1) + float32(hxs*(_Q11+float32(hxs*_Q21))) + t = Float32FromFloat32(3) - float32(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float32FromFloat32(6) - float32(x3*t)))) if k == 0 { /* c is 0 */ - return x3 - (x3*e - hxs) + return x3 - (float32(x3*e) - hxs) } - e = x3*(e-c) - c + e = float32(x3*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return Float32FromFloat32(0.5)*(x3-e) - Float32FromFloat32(0.5) + return float32(Float32FromFloat32(0.5)*(x3-e)) - Float32FromFloat32(0.5) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { - return -Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5))) + return float32(-Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5)))) } - return Float32FromFloat32(1) + Float32FromFloat32(2)*(x3-e) + return Float32FromFloat32(1) + float32(Float32FromFloat32(2)*(x3-e)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = *(*float32)(unsafe.Pointer(bp)) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + Float32FromFloat32(1) if k == int32(128) { - y3 = y3 * Float32FromFloat32(2) * Float32FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float32FromFloat32(2)) * Float32FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return y3 - Float32FromFloat32(1) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk + y3 = Tfloat_t((x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk) } return y3 } @@ -105405,7 +105404,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105461,11 +105460,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { ny = _normalize(tls, y) nz = _normalize(tls, z) if nx.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y + z + return float64(x1*y) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y + z + return float64(x1*y) + z } return z } @@ -105556,7 +105555,7 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { } } else { /* exact +-0 */ - return x1*y + z + return float64(x1*y) + z } } e -= d @@ -105577,8 +105576,8 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105588,11 +105587,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { i = -i } r = float64(i) - r = Float64FromInt32(2)*r - c /* remove top bit */ + r = float64(Float64FromInt32(2)*r) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r - r += tiny * tiny * (r - r) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r) + r += float64(Tdouble_t(tiny*tiny) * (r - r)) } } else { /* only round once when scaled */ @@ -105916,11 +105915,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105982,7 +105981,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -106059,11 +106058,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106123,7 +106122,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106182,7 +106181,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106258,11 +106257,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106363,7 +106362,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106442,7 +106441,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return z * Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))) + return float32(z * Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -106635,8 +106634,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106645,10 +106644,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -106676,7 +106675,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106686,16 +106685,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -106741,12 +106740,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -106847,9 +106846,9 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -106955,9 +106954,9 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (-Float64FromFloat64(0.125) + r/s) / x } @@ -106979,8 +106978,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106989,10 +106988,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -107019,7 +107018,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -107028,13 +107027,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -107075,12 +107074,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107180,9 +107179,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107288,9 +107287,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (-Float32FromFloat32(0.125) + r/s) / x } @@ -107317,8 +107316,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107327,13 +107326,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107363,21 +107362,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107423,10 +107422,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107526,9 +107525,9 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107633,9 +107632,9 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (float64(0.375) + r/s) / x } @@ -107653,8 +107652,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107663,13 +107662,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -107699,20 +107698,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -107754,10 +107753,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107857,9 +107856,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107964,9 +107963,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (Float32FromFloat32(0.375) + r/s) / x } @@ -108041,7 +108040,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -108052,7 +108051,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -108066,7 +108065,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -108085,16 +108084,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108104,7 +108103,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -108120,7 +108119,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -108128,7 +108127,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108142,7 +108141,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108159,9 +108158,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108243,7 +108242,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108256,7 +108255,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108316,7 +108315,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108329,7 +108328,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108347,16 +108346,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108366,7 +108365,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108382,7 +108381,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108390,7 +108389,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108404,7 +108403,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108421,9 +108420,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108486,7 +108485,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -108603,8 +108602,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -108651,7 +108650,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -108928,7 +108927,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -108966,31 +108965,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -109014,11 +109013,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109153,17 +109152,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+float64(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * float64(1.34217728e+08) + w = Tdouble_t(r * float64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109185,7 +109184,7 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) ix = Tuint64_t(ix - Uint64FromUint64(52)< 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109273,7 +109272,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109299,12 +109298,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109394,19 +109393,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = x - Float32FromFloat32(1) s = f / (Float32FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (_Lg21 + w*_Lg41) - t2 = z * (_Lg11 + w*_Lg31) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (_Lg21 + float32(w*_Lg41))) + t2 = Tfloat_t(z * (_Lg11 + float32(w*_Lg31))) R = t2 + t1 - hfsq = Float32FromFloat32(0.5) * f * f + hfsq = Tfloat_t(float32(Float32FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = hi *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = *(*float32)(unsafe.Pointer(bp)) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float32(k) - return dk*_log10_2lo1 + (lo+hi)*_ivln10lo1 + lo*_ivln10hi1 + hi*_ivln10hi1 + dk*_log10_2hi1 + return Tfloat_t(dk*_log10_2lo1) + Tfloat_t((lo+hi)*_ivln10lo1) + Tfloat_t(lo*_ivln10hi1) + Tfloat_t(hi*_ivln10hi1) + Tfloat_t(dk*_log10_2hi1) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109508,15 +109507,15 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + float64(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v14 = y goto _15 @@ -109808,7 +109807,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -109830,14 +109829,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -109903,10 +109902,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< 0, the exponent of scale might have overflowed by <= 460. */ sbits = Tuint64_t(sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -110911,10 +110910,10 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } @@ -110974,7 +110973,7 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) ix = Tuint64_t(ix - Uint64FromUint64(52)<1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111195,22 +111194,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)< y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111508,7 +111507,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111786,7 +111785,7 @@ func Xround(tls *TLS, x3 float64) (r float64) { y2 = float64(x3 + _toint6) } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > float64(0.5) { @@ -111850,7 +111849,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3 + _toint7) } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = x3 + _toint7 - _toint7 - x3 if y3 > Float32FromFloat32(0.5) { @@ -111904,7 +111903,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -111955,7 +111954,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -111963,7 +111962,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -112046,10 +112045,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -112058,7 +112057,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -112088,10 +112087,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -112100,7 +112099,7 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32(Int32FromInt32(0x7f)+n) << int32(23) - x = y * *(*float32)(unsafe.Pointer(bp)) + x = float32(y * *(*float32)(unsafe.Pointer(bp))) return x } @@ -112282,10 +112281,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112444,10 +112443,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112592,14 +112591,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -112640,12 +112639,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -112712,7 +112711,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -112862,7 +112861,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -112995,10 +112994,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -113135,18 +113134,18 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { /* note: this branch avoids raising overflow */ t = Float64FromInt32(1) - Float64FromInt32(0)/x3 } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113207,23 +113206,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -113271,12 +113270,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113372,8 +113371,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113455,7 +113454,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113479,17 +113478,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / float64(float64(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, float64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(float64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -114152,16 +114151,7 @@ func Xgethostid(tls *TLS) (r int64) { const optpos = 0 -type Tucontext_t3 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - F__fpregs_mem [64]uint64 -} - -type t__ucontext1 = Tucontext_t3 +type t__ucontext1 = Tucontext_t1 func X__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) { if __ccgo_strace { @@ -115309,7 +115299,7 @@ type Thistory = struct { Fbase int32 } -func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { +func _do_nftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { bp := tls.Alloc(192) defer tls.Free(192) var d, de, v10 uintptr @@ -115415,7 +115405,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } } if v8 = !(flags&Int32FromInt32(FTW_DEPTH) != 0); v8 { - v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+176) + v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+176) r = v7 } if v8 && v7 != 0 { @@ -115456,7 +115446,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*int8)(unsafe.Pointer(path + uintptr(j))) = int8('/') Xstrcpy(tls, path+uintptr(j)+uintptr(1), de+19) - v11 = _do_nftw(tls, path, fn, fd_limit-int32(1), flags, bp+144) + v11 = _do_nftw(tls, path, __ccgo_fp_fn, fd_limit-int32(1), flags, bp+144) r = v11 if v11 != 0 { Xclosedir(tls, d) @@ -115471,7 +115461,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*int8)(unsafe.Pointer(path + uintptr(l))) = 0 if v13 = flags&int32(FTW_DEPTH) != 0; v13 { - v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+176) + v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+176) r = v12 } if v13 && v12 != 0 { @@ -115480,9 +115470,11 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h return 0 } -func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 int32) { +type t__ccgo_fp__Xnftw_1 = func(*TLS, uintptr, uintptr, int32, uintptr) int32 + +func Xnftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, fn, fd_limit, flags, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, flags, origin(2)) defer func() { trc("-> %v", r1) }() } bp := tls.Alloc(4112) @@ -115502,7 +115494,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } Xmemcpy(tls, bp+4, path, l+uint64(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -116282,8 +116274,6 @@ type Tsockaddr_storage = struct { F__ss_align uint64 } -type t__ucontext2 = Tucontext_t2 - var _lock2 [1]int32 var _log_ident [32]int8 var _log_opt int32 @@ -116721,15 +116711,6 @@ const SA = 194 const SB = 244 const bittab = 0 -type Tucontext_t4 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - F__fpregs_mem [64]uint64 -} - func Xbtowc(tls *TLS, c int32) (r Twint_t) { if __ccgo_strace { trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) @@ -118449,13 +118430,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]int8 - Falg [1025]int8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]int8 Falg [1025]int8 @@ -118463,14 +118437,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -119120,9 +119086,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -119168,7 +119136,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if int64(len1+int32(10)) > int64(r+uintptr(rlen))-int64(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -121272,19 +121240,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+1089, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - -type Tucontext_t5 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - F__fpregs_mem [64]uint64 -} - var _msgs1 = [84]int8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -123072,7 +123027,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -123162,7 +123117,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -123175,9 +123130,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -123186,9 +123143,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int64(SYS_close), int64(fd)) return r @@ -128295,7 +128252,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(144) defer tls.Free(144) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -128404,7 +128361,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -128441,7 +128398,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -128493,7 +128450,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -128504,7 +128461,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*int8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -128616,9 +128573,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4128) @@ -128644,8 +128603,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -128664,7 +128623,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4120, bp+16, bp+4112) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, errfunc, bp+8) + error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, __ccgo_fp_errfunc, bp+8) } Xfree(tls, p) } @@ -133888,9 +133847,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133906,7 +133867,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133918,9 +133879,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return Xmemcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133936,7 +133899,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133955,9 +133918,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [97]uintptr @@ -133981,7 +133946,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134026,9 +133991,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -134036,17 +134003,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -134060,7 +134029,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134148,9 +134117,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [96]uintptr @@ -134170,7 +134141,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -134206,26 +134177,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -134236,8 +134209,6 @@ func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_poll), int64(fds), Int64FromUint64(n), int64(timeout), 0, 0, 0)))) } -type t__ucontext3 = Tucontext_t5 - func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v fds=%v n=%v to=%v mask=%v, (%v:)", tls, fds, n, to, mask, origin(2)) @@ -134273,8 +134244,6 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32 return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_ppoll), int64(fds), Int64FromUint64(n), int64(v3), int64(mask), int64(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0)))) } -type t__ucontext4 = Tucontext_t4 - func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v ts=%v mask=%v, (%v:)", tls, n, rfds, wfds, efds, ts, mask, origin(2)) @@ -134315,15 +134284,6 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_pselect6), int64(n), int64(rfds), int64(wfds), int64(efds), int64(v3), int64(bp+16))))) } -type Tucontext_t6 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - F__fpregs_mem [64]uint64 -} - func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v tv=%v, (%v:)", tls, n, rfds, wfds, efds, tv, origin(2)) @@ -134739,15 +134699,6 @@ func Xsigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) { const SST_SIZE = 8 -type Tucontext_t7 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - F__fpregs_mem [64]uint64 -} - func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v dest=%v left=%v right=%v, (%v:)", tls, dest, left, right, origin(2)) @@ -140176,7 +140127,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -140239,7 +140190,7 @@ _4: v14 = s s++ *(*int8)(unsafe.Pointer(v14)) = int8(int32(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int64(s)-t__predefined_ptrdiff_t(bp+516) == int64(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -140292,7 +140243,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -143794,9 +143745,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -143804,7 +143757,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint64(0) { try = base + uintptr(width*(nel/uint64(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint64(2) } else { @@ -144065,7 +144018,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*8)) >>= Uint64FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(912) defer tls.Free(912) var i, v1, v2 int32 @@ -144077,10 +144030,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[113]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -144097,7 +144050,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(928) defer tls.Free(928) var i, trail, v1 int32 @@ -144111,13 +144064,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint64(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -144132,13 +144085,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+16, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(784) defer tls.Free(784) @@ -144176,14 +144131,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0]&uint64(3) == uint64(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+768, int32(2)) pshift += int32(2) } else { if (*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint64FromInt64(int64(high)-int64(head)) { - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+768, int32(1)) @@ -144196,7 +144151,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[int32(1)] != uint64(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+768) @@ -144207,31 +144162,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 768)) ^= uint64(7) _shr(tls, bp+768, int32(1)) - _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+768, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift+int32(1), int32(1), bp) _shl(tls, bp+768, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+768, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -151703,7 +151662,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1270,15 +1270,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1296,7 +1296,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1309,14 +1309,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1331,7 +1331,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1347,14 +1347,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1370,8 +1370,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1397,24 +1397,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1427,15 +1427,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1444,48 +1444,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1586,8 +1586,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1666,8 +1666,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2003,18 +2003,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -2026,16 +2026,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -2052,7 +2052,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -2087,7 +2087,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -2105,14 +2105,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2128,8 +2128,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2161,18 +2161,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2184,16 +2184,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2201,7 +2201,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2223,27 +2223,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2372,16 +2372,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2488,16 +2488,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2601,7 +2601,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2618,7 +2618,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)<= (*TDIR)(unsafe.Pointer(dir)).Fbuf_end { - len1 = X__syscall3(tls, int32(SYS_getdents64), (*TDIR)(unsafe.Pointer(dir)).Ffd, int32(dir+24), Int32FromUint32(Uint32FromInt64(2048))) + len1 = int32(X__syscall3(tls, int32(SYS_getdents64), (*TDIR)(unsafe.Pointer(dir)).Ffd, int32(dir+24), Int32FromUint32(Uint32FromInt64(2048)))) if len1 <= 0 { if len1 < 0 && len1 != -int32(ENOENT) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = -len1 @@ -25135,9 +25135,13 @@ func Xrewinddir(tls *TLS, dir uintptr) { ___unlock(tls, dir+20) } -func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r int32) { +type t__ccgo_fp__Xscandir_2 = func(*TLS, uintptr) int32 + +type t__ccgo_fp__Xscandir_3 = func(*TLS, uintptr, uintptr) int32 + +func Xscandir(tls *TLS, path uintptr, res uintptr, __ccgo_fp_sel uintptr, __ccgo_fp_cmp uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v res=%v sel=%v cmp=%v, (%v:)", tls, path, res, sel, cmp, origin(2)) + trc("tls=%v path=%v res=%v __ccgo_fp_sel=%v __ccgo_fp_cmp=%v, (%v:)", tls, path, res, __ccgo_fp_sel, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -25159,7 +25163,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -25197,8 +25201,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint32(4), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint32(4), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint32(cnt) @@ -25242,7 +25246,7 @@ func X__reset_tls(tls *TLS) { var mem, p uintptr var self Tpthread_t _, _, _, _, _ = i, mem, n, p, self - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) n = *(*Tuintptr_t)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(self)).Fdtv)) if n != 0 { p = X__libc.Ftls_head @@ -25272,7 +25276,7 @@ func X__init_ssp(tls *TLS, entropy uintptr) { } else { X__stack_chk_guard = Tuintptr_t(uintptr(unsafe.Pointer(&X__stack_chk_guard))) * uint32(1103515245) } - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fcanary = X__stack_chk_guard + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fcanary = X__stack_chk_guard } func X__stack_chk_fail(tls *TLS) { @@ -25881,7 +25885,7 @@ func Xstrerror(tls *TLS, e int32) (r uintptr) { trc("tls=%v e=%v, (%v:)", tls, e, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) { @@ -25938,9 +25942,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25952,7 +25958,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -26001,9 +26007,9 @@ func Xfcntl(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) { return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_fcntl64), fd, cmd, int32(uintptr(arg)), 0, 0, 0))) } if cmd == int32(F_GETOWN) { - ret = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETOWN_EX), int32(bp)) + ret = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETOWN_EX)), int32(bp))) if ret == -int32(EINVAL) { - return X__syscall3(tls, int32(SYS_fcntl64), fd, cmd, int32(uintptr(arg))) + return int32(X__syscall3(tls, int32(SYS_fcntl64), fd, cmd, int32(uintptr(arg)))) } if ret != 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) @@ -26016,23 +26022,23 @@ func Xfcntl(tls *TLS, fd int32, cmd int32, va uintptr) (r int32) { return v1 } if cmd == int32(F_DUPFD_CLOEXEC) { - ret1 = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_DUPFD_CLOEXEC), Int32FromUint32(arg)) + ret1 = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_DUPFD_CLOEXEC)), Int32FromUint32(arg))) if ret1 != -int32(EINVAL) { if ret1 >= 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret1, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret1, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(ret1)) } - ret1 = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_DUPFD_CLOEXEC), Int32FromInt32(0)) + ret1 = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_DUPFD_CLOEXEC)), int32(Int32FromInt32(0)))) if ret1 != -int32(EINVAL) { if ret1 >= 0 { X__syscall1(tls, int32(SYS_close), ret1) } return X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(EINVAL))) } - ret1 = X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_DUPFD), Int32FromUint32(arg)) + ret1 = int32(X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_DUPFD)), Int32FromUint32(arg))) if ret1 >= 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret1, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret1, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(ret1)) } @@ -26066,9 +26072,9 @@ func Xopen(tls *TLS, filename uintptr, flags int32, va uintptr) (r int32) { mode = VaUint32(&ap) _ = ap } - fd = ___syscall_cp(tls, int32(SYS_open), int32(filename), flags|Int32FromInt32(O_LARGEFILE), Int32FromUint32(mode), 0, 0, 0) + fd = int32(___syscall_cp(tls, int32(SYS_open), int32(filename), int32(flags|Int32FromInt32(O_LARGEFILE)), Int32FromUint32(mode), 0, 0, 0)) if fd >= 0 && flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(fd)) } @@ -26087,7 +26093,7 @@ func Xopenat(tls *TLS, fd int32, filename uintptr, flags int32, va uintptr) (r i mode = VaUint32(&ap) _ = ap } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_openat), fd, int32(filename), flags|Int32FromInt32(O_LARGEFILE), Int32FromUint32(mode), 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_openat), fd, int32(filename), int32(flags|Int32FromInt32(O_LARGEFILE)), Int32FromUint32(mode), 0, 0))) } func Xposix_fadvise(tls *TLS, fd int32, base Toff_t, len1 Toff_t, advice int32) (r int32) { @@ -26098,7 +26104,7 @@ func Xposix_fadvise(tls *TLS, fd int32, base Toff_t, len1 Toff_t, advice int32) /* Some archs, at least arm and powerpc, have the syscall * arguments reordered to avoid needing 7 argument registers * due to 64-bit argument alignment. */ - return -X__syscall6(tls, int32(SYS_fadvise64_64), fd, advice, int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32))) + return int32(-X__syscall6(tls, int32(SYS_fadvise64_64), fd, advice, int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32)))) } func Xposix_fallocate(tls *TLS, fd int32, base Toff_t, len1 Toff_t) (r int32) { @@ -26106,7 +26112,7 @@ func Xposix_fallocate(tls *TLS, fd int32, base Toff_t, len1 Toff_t) (r int32) { trc("tls=%v fd=%v base=%v len1=%v, (%v:)", tls, fd, base, len1, origin(2)) defer func() { trc("-> %v", r) }() } - return -X__syscall6(tls, int32(SYS_fallocate), fd, Int32FromInt32(0), int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32))) + return int32(-X__syscall6(tls, int32(SYS_fallocate), fd, int32(Int32FromInt32(0)), int32(base), int32(base>>Int32FromInt32(32)), int32(len1), int32(len1>>Int32FromInt32(32)))) } const WCONTINUED = 8 @@ -26437,19 +26443,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26473,14 +26479,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26634,7 +26640,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26660,16 +26666,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26811,10 +26817,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26850,7 +26856,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26879,15 +26885,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26912,7 +26918,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -27916,7 +27922,7 @@ func Xmsgctl(tls *TLS, q int32, cmd int32, buf uintptr) (r1 int32) { orig = buf buf = bp } - r = X__syscall3(tls, int32(SYS_msgctl), q, cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64), int32(buf)) + r = int32(X__syscall3(tls, int32(SYS_msgctl), q, int32(cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64)), int32(buf))) if r >= 0 && cmd&(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) != 0 { buf = orig *(*Tmsqid_ds)(unsafe.Pointer(buf)) = *(*Tmsqid_ds)(unsafe.Pointer(bp)) @@ -28046,7 +28052,7 @@ func Xsemctl(tls *TLS, id int32, num int32, cmd int32, va uintptr) (r1 int32) { orig = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp)) = bp + 8 } - r = X__syscall4(tls, int32(SYS_semctl), id, num, cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64), int32(*(*uintptr)(unsafe.Pointer(bp)))) + r = int32(X__syscall4(tls, int32(SYS_semctl), id, num, int32(cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64)), int32(*(*uintptr)(unsafe.Pointer(bp))))) if r >= 0 && cmd&(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = orig *(*Tsemid_ds)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))) = *(*Tsemid_ds)(unsafe.Pointer(bp + 8)) @@ -28146,7 +28152,7 @@ func Xsemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r1 int } else { v3 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_semtimedop_time64), id, int32(buf), Int32FromUint32(n), int32(v3)) + r = int32(X__syscall4(tls, int32(SYS_semtimedop_time64), id, int32(buf), Int32FromUint32(n), int32(v3))) } if Bool(NO_TIME32 != 0) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -28158,7 +28164,7 @@ func Xsemtimedop(tls *TLS, id int32, buf uintptr, n Tsize_t, ts uintptr) (r1 int v5 = uint64(0x7fffffff) + (0+Uint64FromInt64(s))>>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v5), + 0: int32(Int32FromUint64(v5)), 1: ns, } v4 = bp + 16 @@ -28265,7 +28271,7 @@ func Xshmctl(tls *TLS, id int32, cmd int32, buf uintptr) (r1 int32) { orig = buf buf = bp } - r = X__syscall3(tls, int32(SYS_shmctl), id, cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64), int32(buf)) + r = int32(X__syscall3(tls, int32(SYS_shmctl), id, int32(cmd & ^(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) | Int32FromInt32(IPC_64)), int32(buf))) if r >= 0 && cmd&(Int32FromInt32(IPC_STAT)&Int32FromInt32(0x100)) != 0 { buf = orig *(*Tshmid_ds)(unsafe.Pointer(buf)) = *(*Tshmid_ds)(unsafe.Pointer(bp)) @@ -28457,15 +28463,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28589,7 +28597,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)<= 0 { (*Ttimex)(unsafe.Pointer(utx)).Fmodes = (*(*Tktimex64)(unsafe.Pointer(bp))).Fmodes (*Ttimex)(unsafe.Pointer(utx)).Foffset = int32((*(*Tktimex64)(unsafe.Pointer(bp))).Foffset) @@ -29490,9 +29498,9 @@ func Xclock_adjtime(tls *TLS, clock_id Tclockid_t, utx uintptr) (r1 int32) { Ftai: (*Ttimex)(unsafe.Pointer(utx)).Ftai, } if clock_id == CLOCK_REALTIME { - r = X__syscall1(tls, int32(SYS_adjtimex), int32(bp+208)) + r = int32(X__syscall1(tls, int32(SYS_adjtimex), int32(bp+208))) } else { - r = X__syscall2(tls, int32(SYS_clock_adjtime), clock_id, int32(bp+208)) + r = int32(X__syscall2(tls, int32(SYS_clock_adjtime), clock_id, int32(bp+208))) } if r >= 0 { (*Ttimex)(unsafe.Pointer(utx)).Fmodes = (*(*Tktimex)(unsafe.Pointer(bp + 208))).Fmodes @@ -29599,9 +29607,9 @@ func Xepoll_create1(tls *TLS, flags int32) (r1 int32) { } var r int32 _ = r - r = X__syscall1(tls, int32(SYS_epoll_create1), flags) + r = int32(X__syscall1(tls, int32(SYS_epoll_create1), flags)) if r == -int32(ENOSYS) && !(flags != 0) { - r = X__syscall1(tls, int32(SYS_epoll_create), Int32FromInt32(1)) + r = int32(X__syscall1(tls, int32(SYS_epoll_create), int32(Int32FromInt32(1)))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -29621,9 +29629,9 @@ func Xepoll_pwait(tls *TLS, fd int32, ev uintptr, cnt int32, to int32, sigs uint } var r int32 _ = r - r = ___syscall_cp(tls, int32(SYS_epoll_pwait), fd, int32(ev), cnt, to, int32(sigs), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + r = int32(___syscall_cp(tls, int32(SYS_epoll_pwait), fd, int32(ev), cnt, to, int32(sigs), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)))) if r == -int32(ENOSYS) && !(sigs != 0) { - r = ___syscall_cp(tls, int32(SYS_epoll_wait), fd, int32(ev), cnt, to, 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_epoll_wait), fd, int32(ev), cnt, to, 0, 0)) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -29649,9 +29657,9 @@ func Xeventfd(tls *TLS, count uint32, flags int32) (r1 int32) { } var r int32 _ = r - r = X__syscall2(tls, int32(SYS_eventfd2), Int32FromUint32(count), flags) + r = int32(X__syscall2(tls, int32(SYS_eventfd2), Int32FromUint32(count), flags)) if r == -int32(ENOSYS) && !(flags != 0) { - r = X__syscall1(tls, int32(SYS_eventfd), Int32FromUint32(count)) + r = int32(X__syscall1(tls, int32(SYS_eventfd), Int32FromUint32(count))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -29852,7 +29860,7 @@ func Xfanotify_mark(tls *TLS, fanotify_fd int32, flags uint32, mask uint64, dfd trc("tls=%v fanotify_fd=%v flags=%v mask=%v dfd=%v pathname=%v, (%v:)", tls, fanotify_fd, flags, mask, dfd, pathname, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall6(tls, int32(SYS_fanotify_mark), fanotify_fd, Int32FromUint32(flags), Int32FromUint64(mask), Int32FromUint64(mask>>Int32FromInt32(32)), dfd, int32(pathname)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall6(tls, int32(SYS_fanotify_mark), fanotify_fd, Int32FromUint32(flags), int32(Int32FromUint64(mask)), int32(Int32FromUint64(mask>>Int32FromInt32(32))), dfd, int32(pathname)))) } const LOCK_EX = 2 @@ -29941,9 +29949,9 @@ func Xinotify_init1(tls *TLS, flags int32) (r1 int32) { } var r int32 _ = r - r = X__syscall1(tls, int32(SYS_inotify_init1), flags) + r = int32(X__syscall1(tls, int32(SYS_inotify_init1), flags)) if r == -int32(ENOSYS) && !(flags != 0) { - r = X__syscall0(tls, int32(SYS_inotify_init)) + r = int32(X__syscall0(tls, int32(SYS_inotify_init))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -30290,7 +30298,7 @@ func Xumount(tls *TLS, special uintptr) (r int32) { trc("tls=%v special=%v, (%v:)", tls, special, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_umount2), int32(special), Int32FromInt32(0)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_umount2), int32(special), int32(Int32FromInt32(0))))) } func Xumount2(tls *TLS, special uintptr, flags int32) (r int32) { @@ -30894,7 +30902,7 @@ func Xreadahead(tls *TLS, fd int32, pos Toff_t, len1 Tsize_t) (r Tssize_t) { trc("tls=%v fd=%v pos=%v len1=%v, (%v:)", tls, fd, pos, len1, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_readahead), fd, Int32FromInt32(0), int32(pos), int32(pos>>Int32FromInt32(32)), Int32FromUint32(len1)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall5(tls, int32(SYS_readahead), fd, int32(Int32FromInt32(0)), int32(pos), int32(pos>>Int32FromInt32(32)), Int32FromUint32(len1)))) } const RB_AUTOBOOT = 19088743 @@ -30910,7 +30918,7 @@ func Xreboot(tls *TLS, type1 int32) (r int32) { trc("tls=%v type1=%v, (%v:)", tls, type1, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_reboot), Int32FromUint32(Uint32FromUint32(0xfee1dead)), Int32FromInt32(672274793), type1))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_reboot), Int32FromUint32(Uint32FromUint32(0xfee1dead)), int32(Int32FromInt32(672274793)), type1))) } func Xremap_file_pages(tls *TLS, addr uintptr, size Tsize_t, prot int32, pgoff Tsize_t, flags int32) (r int32) { @@ -30929,7 +30937,7 @@ func Xsbrk(tls *TLS, inc Tintptr_t) (r uintptr) { if inc != 0 { return uintptr(X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(ENOMEM)))) } - return uintptr(X__syscall1(tls, int32(SYS_brk), Int32FromInt32(0))) + return uintptr(X__syscall1(tls, int32(SYS_brk), int32(Int32FromInt32(0)))) } func Xsendfile(tls *TLS, out_fd int32, in_fd int32, ofs uintptr, count Tsize_t) (r Tssize_t) { @@ -31077,17 +31085,17 @@ func Xsignalfd(tls *TLS, fd int32, sigs uintptr, flags int32) (r int32) { } var ret int32 _ = ret - ret = X__syscall4(tls, int32(SYS_signalfd4), fd, int32(sigs), Int32FromInt32(_NSIG)/Int32FromInt32(8), flags) + ret = int32(X__syscall4(tls, int32(SYS_signalfd4), fd, int32(sigs), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), flags)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } - ret = X__syscall3(tls, int32(SYS_signalfd), fd, int32(sigs), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + ret = int32(X__syscall3(tls, int32(SYS_signalfd), fd, int32(sigs), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)))) if ret >= 0 { if flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if flags&int32(O_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } } return X__syscall_ret(tls, Uint32FromInt32(ret)) @@ -31111,7 +31119,7 @@ func Xstatx(tls *TLS, dirfd int32, path uintptr, flags int32, mask uint32, stx u var ret int32 var _ /* st at bp+0 */ Tstat _ = ret - ret = X__syscall5(tls, int32(SYS_statx), dirfd, int32(path), flags, Int32FromUint32(mask), int32(stx)) + ret = int32(X__syscall5(tls, int32(SYS_statx), dirfd, int32(path), flags, Int32FromUint32(mask), int32(stx))) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -31251,7 +31259,7 @@ func Xtimerfd_settime(tls *TLS, fd int32, flags int32, new1 uintptr, old uintptr 2: vs, 3: int64(vns), } - r = X__syscall4(tls, int32(SYS_timerfd_settime64), fd, flags, int32(bp), int32(old)) + r = int32(X__syscall4(tls, int32(SYS_timerfd_settime64), fd, flags, int32(bp), int32(old))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -31265,7 +31273,7 @@ func Xtimerfd_settime(tls *TLS, fd int32, flags int32, new1 uintptr, old uintptr 2: int32(vs), 3: vns, } - r = X__syscall4(tls, int32(SYS_timerfd_settime32), fd, flags, int32(bp+32), int32(bp+48)) + r = int32(X__syscall4(tls, int32(SYS_timerfd_settime32), fd, flags, int32(bp+32), int32(bp+48))) if !(r != 0) && old != 0 { (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp + 48)))[0]) (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp + 48)))[int32(1)] @@ -31288,12 +31296,12 @@ func Xtimerfd_gettime(tls *TLS, fd int32, cur uintptr) (r1 int32) { _ = r r = -int32(ENOSYS) if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_timerfd_gettime64), fd, int32(cur)) + r = int32(X__syscall2(tls, int32(SYS_timerfd_gettime64), fd, int32(cur))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, int32(SYS_timerfd_gettime32), fd, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_timerfd_gettime32), fd, int32(bp))) if !(r != 0) { (*Titimerspec)(unsafe.Pointer(cur)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[0]) (*Titimerspec)(unsafe.Pointer(cur)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp)))[int32(1)] @@ -31414,7 +31422,7 @@ func Xwait4(tls *TLS, pid Tpid_t, status uintptr, options int32, ru uintptr) (r1 v1 = uintptr(0) } dest = v1 - r = X__syscall4(tls, int32(SYS_wait4), pid, int32(status), options, int32(dest)) + r = int32(X__syscall4(tls, int32(SYS_wait4), pid, int32(status), options, int32(dest))) if r > 0 && ru != 0 && Bool(uint32(8) > uint32(4)) { _memcpy(tls, bp, dest, Uint32FromInt32(4)*Uint32FromInt64(4)) (*Trusage)(unsafe.Pointer(ru)).Fru_utime = Ttimeval{ @@ -31529,16 +31537,6 @@ func Xfremovexattr(tls *TLS, fd int32, name uintptr) (r int32) { return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_fremovexattr), fd, int32(name)))) } -type Tucontext_t2 = struct { - F__ccgo_align [0]uint32 - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - Fuc_regspace [64]uint64 -} - func _dummy4(tls *TLS, msg uintptr, lm uintptr) (r uintptr) { return msg } @@ -31556,7 +31554,7 @@ func X__lctrans_cur(tls *TLS, msg uintptr) (r uintptr) { trc("tls=%v msg=%v, (%v:)", tls, msg, origin(2)) defer func() { trc("-> %v", r) }() } - return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + 5*4))) + return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale + 5*4))) } func _swapc(tls *TLS, x Tuint32_t, c int32) (r Tuint32_t) { @@ -32136,7 +32134,7 @@ func Xdcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n var _ /* z at bp+4 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = alt_modlen, catlen, catname, csp, dirlen, dirname, domlen, l, lm, loc, loclen, locname, locp, map1, modlen, modname, name, np, old, old_cats, old_errno, p2, plural, q, r, rem, rule, trans, v10, v11, v12, v14, v15, v17, v19, v20, v23, v3, v5, v6, v8, v9 defer func() { Xrealloc(tls, name, 0) }() - loc = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + loc = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale old_errno = *(*int32)(unsafe.Pointer(X__errno_location(tls))) /* match gnu gettext behaviour */ if !(msgid1 != 0) { @@ -98791,7 +98789,7 @@ func Xiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb ui *(*Tmbstate_t)(unsafe.Pointer(bp + 16)) = Tmbstate_t{} type1 = *(*uint8)(unsafe.Pointer(map1 + uintptr(-Int32FromInt32(1)))) totype = *(*uint8)(unsafe.Pointer(tomap + uintptr(-Int32FromInt32(1)))) - ploc = ___get_tp(tls) + 88 + ploc = uintptr(___get_tp(tls)) + 88 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if !(in != 0) || !(*(*uintptr)(unsafe.Pointer(in)) != 0) || !(*(*Tsize_t)(unsafe.Pointer(inb)) != 0) { return uint32(0) @@ -99825,7 +99823,7 @@ func X__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { trc("tls=%v item=%v, (%v:)", tls, item, origin(2)) defer func() { trc("-> %v", r) }() } - return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xnl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { @@ -100543,7 +100541,7 @@ func Xstrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) { @@ -100709,7 +100707,7 @@ func Xstrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize var ret Tssize_t _, _ = ap, ret ap = va - ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale, fmt, ap) + ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale, fmt, ap) _ = ap return ret } @@ -100784,7 +100782,7 @@ func Xstrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100873,7 +100871,7 @@ func X__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) { var global, old, v1, v2 Tlocale_t var self Tpthread_t _, _, _, _, _ = global, old, self, v1, v2 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) old = (*t__pthread)(unsafe.Pointer(self)).Flocale global = uintptr(unsafe.Pointer(&X__libc)) + 32 if new1 != 0 { @@ -100916,7 +100914,7 @@ func Xwcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100957,7 +100955,7 @@ func Xwcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -101001,12 +100999,12 @@ func X__cos(tls *TLS, x float64, y float64) (r1 float64) { } var hz, r, w, z Tdouble_t _, _, _, _ = hz, r, w, z - z = x * x - w = z * z - r = z*(_C1+z*(_C2+z*_C3)) + w*w*(_C4+z*(_C5+z*_C6)) - hz = float64(0.5) * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = Tdouble_t(z*(_C1+float64(z*(_C2+float64(z*_C3))))) + Tdouble_t(Tdouble_t(w*w)*(_C4+float64(z*(_C5+float64(z*_C6))))) + hz = Tdouble_t(float64(0.5) * z) w = float64(1) - hz - return w + (Float64FromFloat64(1) - w - hz + (z*r - x*y)) + return w + (Float64FromFloat64(1) - w - hz + (Tdouble_t(z*r) - Tdouble_t(x*y))) } // C documentation @@ -101026,10 +101024,10 @@ func X__cosdf(tls *TLS, x float64) (r1 float32) { var r, w, z Tdouble_t _, _, _ = r, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _C21 + z*_C31 - return float32(float64(1) + z*_C0 + w*_C11 + w*z*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _C21 + float64(z*_C31) + return float32(float64(1) + float64(z*_C0) + float64(w*_C11) + float64(Tdouble_t(w*z)*r)) } // C documentation @@ -101054,7 +101052,7 @@ func X__expo2(tls *TLS, x float64, sign float64) (r float64) { scale = *(*float64)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexp(tls, x-_kln22) * (sign * scale) * scale + return float64(float64(Xexp(tls, x-_kln22)*float64(sign*scale)) * scale) } // C documentation @@ -101079,7 +101077,7 @@ func X__expo2f(tls *TLS, x float32, sign float32) (r float32) { scale = *(*float32)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexpf(tls, x-_kln23) * (sign * scale) * scale + return float32(float32(Xexpf(tls, x-_kln23)*float32(sign*scale)) * scale) } func X__fpclassify(tls *TLS, x float64) (r int32) { @@ -101280,7 +101278,7 @@ func X__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float64(v2 * y2) v4 = y goto _5 _5: @@ -101303,7 +101301,7 @@ func X__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float32(v2 * y2) v4 = y goto _5 _5: @@ -101387,14 +101385,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { } } else { if !(sign != 0) { - z = x - Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(2)*_pio2_1t + z = x - float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(2)*_pio2_1t) return int32(2) } else { - z = x + Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(2)*_pio2_1t + z = x + float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(2)*_pio2_1t) return -int32(2) } } @@ -101405,14 +101403,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(3)*_pio2_1t + z = x - float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(3)*_pio2_1t) return int32(3) } else { - z = x + Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(3)*_pio2_1t + z = x + float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(3)*_pio2_1t) return -int32(3) } } else { @@ -101420,14 +101418,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(4)*_pio2_1t + z = x - float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(4)*_pio2_1t) return int32(4) } else { - z = x + Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(4)*_pio2_1t + z = x + float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(4)*_pio2_1t) return -int32(4) } } @@ -101439,22 +101437,22 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { medium: ; /* rint(x/(pi/2)) */ - fn = x*_invpio2 + _toint - _toint + fn = Tdouble_t(x*_invpio2) + _toint - _toint n = int32(fn) - r = x - fn*_pio2_1 - w = fn * _pio2_1t /* 1st round, good to 85 bits */ + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) /* 1st round, good to 85 bits */ /* Matters with directed rounding. */ if r-w < -_pio4 { n-- fn-- - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } else { if r-w > _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -101463,17 +101461,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -101501,7 +101499,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07)) goto _3 _3: ; @@ -101681,7 +101679,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101705,8 +101703,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101715,8 +101713,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101809,7 +101807,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101836,8 +101834,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101852,7 +101850,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101871,7 +101869,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -102062,19 +102060,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + _toint1 - _toint1 n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -102174,14 +102172,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + float64(z*(_S3+float64(z*_S4))) + float64(Tdouble_t(z*w)*(_S5+float64(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + float64(v*(_S1+float64(z*r))) } else { - return x - (z*(Float64FromFloat64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(float64(Float64FromFloat64(0.5)*y)-float64(v*r))) - y - Tdouble_t(v*_S1)) } return r1 } @@ -102203,11 +102201,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S31 + float64(z*_S41) + s = Tdouble_t(z * x) + return float32(x + float64(s*(_S11+float64(z*_S21))) + float64(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -102250,21 +102248,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + float64(w*(_T[int32(3)]+float64(w*(_T[int32(5)]+float64(w*(_T[int32(7)]+float64(w*(_T[int32(9)]+float64(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + float64(w*(_T[int32(4)]+float64(w*(_T[int32(6)]+float64(w*(_T[int32(8)]+float64(w*(_T[int32(10)]+float64(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + float64(z*(Tdouble_t(s*(r+v))+y)) + float64(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - float64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(float64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -102285,7 +102283,7 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { a0 = v3 v4 = *(*Tuint64_t)(unsafe.Pointer(&a0))>>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -102386,24 +102384,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -102446,24 +102444,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -102497,11 +102495,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102535,11 +102533,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102578,8 +102576,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102599,7 +102597,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102609,21 +102607,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102642,8 +102640,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = z * (_pS03 + z*(_pS13+z*_pS23)) - q = Float32FromFloat32(1) + z*_qS13 + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = Float32FromFloat32(1) + float32(z*_qS13) return p / q } @@ -102660,7 +102658,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102669,12 +102667,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102721,11 +102719,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint32(8) == uint32(4) { @@ -102734,7 +102732,7 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } } @@ -102786,11 +102784,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint32(4) == uint32(4) { @@ -102917,7 +102915,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if ix < uint32(0x3ff30000) { /* |x| < 1.1875 */ if ix < uint32(0x3fe60000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (float64(2)*x3 - float64(1)) / (float64(2) + x3) + x3 = (float64(float64(2)*x3) - float64(1)) / (float64(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - float64(1)) / (x3 + float64(1)) @@ -102925,7 +102923,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } else { if ix < uint32(0x40038000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - float64(1.5)) / (float64(1) + float64(1.5)*x3) + x3 = (x3 - float64(1.5)) / (float64(1) + float64(float64(1.5)*x3)) } else { /* 2.4375 <= |x| < 2^66 */ id = int32(3) x3 = -Float64FromFloat64(1) / x3 @@ -102933,15 +102931,15 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tdouble_t(x3 * x3) + w = Tdouble_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT[0] + w*(_aT[int32(2)]+w*(_aT[int32(4)]+w*(_aT[int32(6)]+w*(_aT[int32(8)]+w*_aT[int32(10)]))))) - s2 = w * (_aT[int32(1)] + w*(_aT[int32(3)]+w*(_aT[int32(5)]+w*(_aT[int32(7)]+w*_aT[int32(9)])))) + s1 = Tdouble_t(z * (_aT[0] + float64(w*(_aT[int32(2)]+float64(w*(_aT[int32(4)]+float64(w*(_aT[int32(6)]+float64(w*(_aT[int32(8)]+float64(w*_aT[int32(10)]))))))))))) + s2 = Tdouble_t(w * (_aT[int32(1)] + float64(w*(_aT[int32(3)]+float64(w*(_aT[int32(5)]+float64(w*(_aT[int32(7)]+float64(w*_aT[int32(9)]))))))))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float64(x3*(s1+s2)) } - z = _atanhi[id] - (x3*(s1+s2) - _atanlo[id] - x3) + z = _atanhi[id] - (float64(x3*(s1+s2)) - _atanlo[id] - x3) if sign != 0 { v4 = -z } else { @@ -103028,9 +103026,9 @@ _2: case uint32(1): return -_pi / Float64FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float64FromInt32(3) * _pi / Float64FromInt32(4) /* atan(+INF,-INF) */ + return float64(Float64FromInt32(3)*_pi) / Float64FromInt32(4) /* atan(+INF,-INF) */ case uint32(3): - return float64(-Int32FromInt32(3)) * _pi / Float64FromInt32(4) /* atan(-INF,-INF) */ + return float64(float64(-Int32FromInt32(3))*_pi) / Float64FromInt32(4) /* atan(-INF,-INF) */ } } else { switch m { @@ -103145,9 +103143,9 @@ _2: case uint32(1): return -_pi1 / Float32FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float32FromInt32(3) * _pi1 / Float32FromInt32(4) /*atan(+INF,-INF)*/ + return float32(Float32FromInt32(3)*_pi1) / Float32FromInt32(4) /*atan(+INF,-INF)*/ case uint32(3): - return float32(-Int32FromInt32(3)) * _pi1 / Float32FromInt32(4) /*atan(-INF,-INF)*/ + return float32(float32(-Int32FromInt32(3))*_pi1) / Float32FromInt32(4) /*atan(-INF,-INF)*/ } } else { switch m { @@ -103262,7 +103260,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x00800000) { /* raise underflow for subnormal x */ if uint32(4) == uint32(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint32(4) == uint32(8) { y1 = float64(x3 * x3) @@ -103279,7 +103277,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x3f980000) { /* |x| < 1.1875 */ if ix < uint32(0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (Float32FromFloat32(2)*x3 - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) + x3 = (float32(Float32FromFloat32(2)*x3) - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - Float32FromFloat32(1)) / (x3 + Float32FromFloat32(1)) @@ -103287,7 +103285,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } else { if ix < uint32(0x401c0000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + Float32FromFloat32(1.5)*x3) + x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + float32(Float32FromFloat32(1.5)*x3)) } else { /* 2.4375 <= |x| < 2**26 */ id = int32(3) x3 = -Float32FromFloat32(1) / x3 @@ -103295,15 +103293,15 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tfloat_t(x3 * x3) + w = Tfloat_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT1[0] + w*(_aT1[int32(2)]+w*_aT1[int32(4)])) - s2 = w * (_aT1[int32(1)] + w*_aT1[int32(3)]) + s1 = Tfloat_t(z * (_aT1[0] + float32(w*(_aT1[int32(2)]+float32(w*_aT1[int32(4)]))))) + s2 = Tfloat_t(w * (_aT1[int32(1)] + float32(w*_aT1[int32(3)]))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float32(x3*(s1+s2)) } - z = _atanhi1[id] - (x3*(s1+s2) - _atanlo1[id] - x3) + z = _atanhi1[id] - (float32(x3*(s1+s2)) - _atanlo1[id] - x3) if sign != 0 { v4 = -z } else { @@ -103363,11 +103361,11 @@ func Xatanh(tls *TLS, x3 float64) (r float64) { } } else { /* |x| < 0.5, up to 1.7ulp error */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*y3+Float64FromInt32(2)*y3*y3/(Float64FromInt32(1)-y3)) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, Tdouble_t(Float64FromInt32(2)*y3)+Tdouble_t(Tdouble_t(Float64FromInt32(2)*y3)*y3)/(Float64FromInt32(1)-y3))) } } else { /* avoid overflow */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, float64(Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))))) } if s != 0 { v1 = -y3 @@ -103413,22 +103411,22 @@ func Xatanhf(tls *TLS, x3 float32) (r float32) { /* handle underflow */ if *(*Tuint32_t)(unsafe.Pointer(bp)) < Uint32FromInt32(Int32FromInt32(1)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -103534,8 +103532,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103550,11 +103548,11 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = (*(*Tuint64_t)(unsafe.Pointer(bp)) + uint64(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103592,7 +103590,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103606,14 +103604,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103879,7 +103877,7 @@ func Xcos(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } return float64(1) @@ -103911,10 +103909,10 @@ const M_PI_23 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _c1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _c2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _c3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _c4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _c1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _c2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _c3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _c4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xcosf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -104047,19 +104045,19 @@ func Xcosh(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } return Float64FromInt32(1) } t = Xexpm1(tls, x3) - return Float64FromInt32(1) + t*t/(Float64FromInt32(2)*(Float64FromInt32(1)+t)) + return Float64FromInt32(1) + float64(t*t)/float64(Float64FromInt32(2)*(Float64FromInt32(1)+t)) } /* |x| < log(DBL_MAX) */ if w < uint32(0x40862e42) { t = Xexp(tls, x3) /* note: if x>log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -104109,12 +104107,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -104209,8 +104207,8 @@ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) + P = _pa0 + float64(s*(_pa1+float64(s*(_pa2+float64(s*(_pa3+float64(s*(_pa4+float64(s*(_pa5+float64(s*_pa6))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+float64(s*(_qa2+float64(s*(_qa3+float64(s*(_qa4+float64(s*(_qa5+float64(s*_qa6))))))))))) return Float64FromInt32(1) - _erx - P/Q } @@ -104223,18 +104221,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = Float64FromInt32(1) / float64(x*x) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = float64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = _ra0 + float64(s*(_ra1+float64(s*(_ra2+float64(s*(_ra3+float64(s*(_ra4+float64(s*(_ra5+float64(s*(_ra6+float64(s*_ra7))))))))))))) + S = float64(1) + float64(s*(_sa1+float64(s*(_sa2+float64(s*(_sa3+float64(s*(_sa4+float64(s*(_sa5+float64(s*(_sa6+float64(s*(_sa7+float64(s*_sa8))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = float64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = _rb0 + float64(s*(_rb1+float64(s*(_rb2+float64(s*(_rb3+float64(s*(_rb4+float64(s*(_rb5+float64(s*_rb6))))))))))) + S = float64(1) + float64(s*(_sb1+float64(s*(_sb2+float64(s*(_sb3+float64(s*(_sb4+float64(s*(_sb5+float64(s*(_sb6+float64(s*_sb7))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = _rb01 + s*(_rb11+s*(_rb21+s*(_rb31+s*(_rb41+s*(_rb51+s*_rb61))))) - S = Float32FromFloat32(1) + s*(_sb11+s*(_sb21+s*(_sb31+s*(_sb41+s*(_sb51+s*(_sb61+s*_sb71)))))) + R = _rb01 + float32(s*(_rb11+float32(s*(_rb21+float32(s*(_rb31+float32(s*(_rb41+float32(s*(_rb51+float32(s*_rb61))))))))))) + S = Float32FromFloat32(1) + float32(s*(_sb11+float32(s*(_sb21+float32(s*(_sb31+float32(s*(_sb41+float32(s*(_sb51+float32(s*(_sb61+float32(s*_sb71))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, (z-x)*(z+x)+R/S) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32((z-x)*(z+x))+R/S)) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -104441,13 +104439,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -104482,14 +104480,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -104502,7 +104500,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -104546,7 +104544,7 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo /* k > 0, the exponent of scale might have overflowed by <= 460. */ sbits -= Uint64FromUint64(1009) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = float64(5.486124068793689e+303) * (scale + scale*tmp) + y3 = Tdouble_t(float64(5.486124068793689e+303) * (scale + Tdouble_t(scale*tmp))) y = y3 v1 = y goto _2 @@ -104556,9 +104554,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo /* k < 0, need special care in the subnormal range. */ sbits += Uint64FromUint64(1022) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = scale + scale*tmp + y3 = scale + Tdouble_t(scale*tmp) if y3 < float64(1) { - lo = scale - y3 + scale*tmp + lo = scale - y3 + Tdouble_t(scale*tmp) hi = float64(1) + y3 lo = float64(1) - hi + y3 + lo y = hi + lo @@ -104575,9 +104573,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo v5 = y1 goto _6 _6: - y2 = v5 * float64(2.2250738585072014e-308) + y2 = float64(v5 * float64(2.2250738585072014e-308)) } - y3 = float64(2.2250738585072014e-308) * y3 + y3 = Tdouble_t(float64(2.2250738585072014e-308) * y3) y = y3 v7 = y goto _8 @@ -104628,7 +104626,7 @@ func Xexp(tls *TLS, x1 float64) (r1 float64) { } /* exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]. */ /* x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]. */ - z = X__exp_data.Finvln2N * x1 + z = Tdouble_t(X__exp_data.Finvln2N * x1) /* z - kd is in [-1, 1] in non-nearest rounding modes. */ y = z + X__exp_data.Fshift v2 = y @@ -104638,7 +104636,7 @@ _3: v4 = kd ki = *(*Tuint64_t)(unsafe.Pointer(&v4)) kd -= X__exp_data.Fshift - r = x1 + kd*X__exp_data.Fnegln2hiN + kd*X__exp_data.Fnegln2loN + r = x1 + float64(kd*X__exp_data.Fnegln2hiN) + float64(kd*X__exp_data.Fnegln2loN) /* 2^(k/N) ~= scale * (1 + tail). */ idx = uint64(2) * (ki % Uint64FromInt32(Int32FromInt32(1)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104698,8 +104696,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104774,10 +104772,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104839,7 +104837,7 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl /* k > 0, the exponent of scale might have overflowed by 1. */ sbits -= Uint64FromUint64(1) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = Float64FromInt32(2) * (scale + scale*tmp) + y3 = Tdouble_t(Float64FromInt32(2) * (scale + Tdouble_t(scale*tmp))) y = y3 v1 = y goto _2 @@ -104849,9 +104847,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl /* k < 0, need special care in the subnormal range. */ sbits += Uint64FromUint64(1022) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = scale + scale*tmp + y3 = scale + Tdouble_t(scale*tmp) if y3 < float64(1) { - lo = scale - y3 + scale*tmp + lo = scale - y3 + Tdouble_t(scale*tmp) hi = float64(1) + y3 lo = float64(1) - hi + y3 + lo y = hi + lo @@ -104868,9 +104866,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl v5 = y1 goto _6 _6: - y2 = v5 * float64(2.2250738585072014e-308) + y2 = float64(v5 * float64(2.2250738585072014e-308)) } - y3 = float64(2.2250738585072014e-308) * y3 + y3 = Tdouble_t(float64(2.2250738585072014e-308) * y3) y = y3 v7 = y goto _8 @@ -104945,17 +104943,17 @@ _5: sbits = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 112 + uintptr(idx+uint64(1))*8)) + top /* exp2(x) = 2^(k/N) * 2^r ~= scale + scale * (tail + 2^r - 1). */ /* Evaluation is optimized assuming superscalar pipelined execution. */ - r2 = r * r + r2 = Tdouble_t(r * r) /* Without fma the worst case error is 0.5/N ulp larger. */ /* Worst case error is less than 0.5+0.86/N+(abs poly error * 2^53) ulp. */ - tmp = tail + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 2*8))) + r2*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 4*8))) + tmp = tail + Tdouble_t(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72))) + Tdouble_t(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 2*8))))) + Tdouble_t(Tdouble_t(r2*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 72 + 4*8))))) if abstop == uint32(0) { return _specialcase1(tls, tmp, sbits, ki) } scale = *(*float64)(unsafe.Pointer(&sbits)) /* Note: tmp == 0 or |tmp| > 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -105023,11 +105021,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + float64(1) if k == int32(1024) { - y3 = y3 * float64(2) * float64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } return y3 - float64(1) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -105367,10 +105365,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float32(k) - hi = x3 - t*_ln2_hi1 /* t*ln2_hi is exact here */ - lo = t * _ln2_lo1 + hi = x3 - float32(t*_ln2_hi1) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * _ln2_lo1) } x3 = hi - lo c = hi - x3 - lo @@ -105378,7 +105376,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint32(4) == uint32(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint32(4) == uint32(8) { y1 = float64(x3 * x3) @@ -105393,42 +105391,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = Float32FromFloat32(0.5) * x3 - hxs = x3 * hfx - r1 = Float32FromFloat32(1) + hxs*(_Q11+hxs*_Q21) - t = Float32FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float32FromFloat32(6) - x3*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(x3 * hfx) + r1 = Float32FromFloat32(1) + float32(hxs*(_Q11+float32(hxs*_Q21))) + t = Float32FromFloat32(3) - float32(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float32FromFloat32(6) - float32(x3*t)))) if k == 0 { /* c is 0 */ - return x3 - (x3*e - hxs) + return x3 - (float32(x3*e) - hxs) } - e = x3*(e-c) - c + e = float32(x3*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return Float32FromFloat32(0.5)*(x3-e) - Float32FromFloat32(0.5) + return float32(Float32FromFloat32(0.5)*(x3-e)) - Float32FromFloat32(0.5) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { - return -Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5))) + return float32(-Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5)))) } - return Float32FromFloat32(1) + Float32FromFloat32(2)*(x3-e) + return Float32FromFloat32(1) + float32(Float32FromFloat32(2)*(x3-e)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = *(*float32)(unsafe.Pointer(bp)) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + Float32FromFloat32(1) if k == int32(128) { - y3 = y3 * Float32FromFloat32(2) * Float32FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float32FromFloat32(2)) * Float32FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return y3 - Float32FromFloat32(1) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk + y3 = Tfloat_t((x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk) } return y3 } @@ -105783,7 +105781,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105839,11 +105837,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { ny = _normalize(tls, y) nz = _normalize(tls, z) if nx.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y + z + return float64(x1*y) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y + z + return float64(x1*y) + z } return z } @@ -105938,7 +105936,7 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { } } else { /* exact +-0 */ - return x1*y + z + return float64(x1*y) + z } } e -= d @@ -105959,8 +105957,8 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105970,11 +105968,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { i = -i } r = float64(i) - r = Float64FromInt32(2)*r - c /* remove top bit */ + r = float64(Float64FromInt32(2)*r) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r - r += tiny * tiny * (r - r) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r) + r += float64(Tdouble_t(tiny*tiny) * (r - r)) } } else { /* only round once when scaled */ @@ -106306,11 +106304,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -106370,7 +106368,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -106447,11 +106445,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106511,7 +106509,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106572,7 +106570,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106627,9 +106625,9 @@ func Xfrexpf(tls *TLS, x float32, e uintptr) (r float32) { } *(*int32)(unsafe.Pointer(e)) = ee - int32(0x7e) p1 = bp - *(*Tuint32_t)(unsafe.Pointer(p1)) = *(*Tuint32_t)(unsafe.Pointer(p1)) & Uint32FromUint32(0x807fffff) + *(*Tuint32_t)(unsafe.Pointer(p1)) = Tuint32_t(*(*Tuint32_t)(unsafe.Pointer(p1)) & Uint32FromUint32(0x807fffff)) p2 = bp - *(*Tuint32_t)(unsafe.Pointer(p2)) = *(*Tuint32_t)(unsafe.Pointer(p2)) | Uint32FromUint32(0x3f000000) + *(*Tuint32_t)(unsafe.Pointer(p2)) = Tuint32_t(*(*Tuint32_t)(unsafe.Pointer(p2)) | Uint32FromUint32(0x3f000000)) return *(*float32)(unsafe.Pointer(bp)) } @@ -106646,11 +106644,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106759,7 +106757,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106838,7 +106836,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return z * Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))) + return float32(z * Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -107034,8 +107032,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107044,10 +107042,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -107075,7 +107073,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -107085,16 +107083,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -107140,12 +107138,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -107246,9 +107244,9 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107354,9 +107352,9 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (-Float64FromFloat64(0.125) + r/s) / x } @@ -107378,8 +107376,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107388,10 +107386,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -107418,7 +107416,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -107427,13 +107425,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -107474,12 +107472,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107579,9 +107577,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107687,9 +107685,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (-Float32FromFloat32(0.125) + r/s) / x } @@ -107716,8 +107714,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107726,13 +107724,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107762,21 +107760,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107822,10 +107820,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107925,9 +107923,9 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -108032,9 +108030,9 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (float64(0.375) + r/s) / x } @@ -108052,8 +108050,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -108062,13 +108060,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -108098,20 +108096,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -108153,10 +108151,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -108256,9 +108254,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -108363,9 +108361,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (Float32FromFloat32(0.375) + r/s) / x } @@ -108440,7 +108438,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -108451,7 +108449,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -108465,7 +108463,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -108484,16 +108482,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108503,7 +108501,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -108519,7 +108517,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -108527,7 +108525,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108541,7 +108539,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108558,9 +108556,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108642,7 +108640,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108655,7 +108653,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108715,7 +108713,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108728,7 +108726,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108746,16 +108744,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108765,7 +108763,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108781,7 +108779,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108789,7 +108787,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108803,7 +108801,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108820,9 +108818,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108885,7 +108883,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -109002,8 +109000,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -109053,7 +109051,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -109330,7 +109328,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -109368,31 +109366,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -109416,11 +109414,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109572,17 +109570,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+float64(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * float64(1.34217728e+08) + w = Tdouble_t(r * float64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109604,7 +109602,7 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) ix -= Uint64FromUint64(52) << Int32FromInt32(52) } @@ -109629,7 +109627,7 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { /* log(x) = log1p(z/c-1) + log(c) + k*Ln2. */ /* r ~= z/c - 1, |r| < 1/(2*N). */ /* rounding error: 0x1p-55/N + 0x1p-66. */ - r = (z - (*(*struct { + r = Tdouble_t((z - (*(*struct { F__ccgo_align [0]uint32 Fchi float64 Fclo float64 @@ -109637,19 +109635,19 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { F__ccgo_align [0]uint32 Fchi float64 Fclo float64 - })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 2192 + uintptr(i)*16))).Fclo) * invc + })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 2192 + uintptr(i)*16))).Fclo) * invc) kd = float64(k) /* hi + lo = r + log(c) + k*Ln2. */ - w = kd*X__log_data.Fln2hi + logc + w = Tdouble_t(kd*X__log_data.Fln2hi) + logc hi = w + r - lo = w - hi + r + kd*X__log_data.Fln2lo + lo = w - hi + r + Tdouble_t(kd*X__log_data.Fln2lo) /* log(x) = lo + (log1p(r) - r) + hi. */ - r2 = r * r /* rounding error: 0x1p-54/N^2. */ + r2 = Tdouble_t(r * r) /* rounding error: 0x1p-54/N^2. */ /* Worst case error if |y| > 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109699,7 +109697,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109725,12 +109723,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109820,19 +109818,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = x - Float32FromFloat32(1) s = f / (Float32FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (_Lg21 + w*_Lg41) - t2 = z * (_Lg11 + w*_Lg31) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (_Lg21 + float32(w*_Lg41))) + t2 = Tfloat_t(z * (_Lg11 + float32(w*_Lg31))) R = t2 + t1 - hfsq = Float32FromFloat32(0.5) * f * f + hfsq = Tfloat_t(float32(Float32FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = hi *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = *(*float32)(unsafe.Pointer(bp)) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float32(k) - return dk*_log10_2lo1 + (lo+hi)*_ivln10lo1 + lo*_ivln10hi1 + hi*_ivln10hi1 + dk*_log10_2hi1 + return Tfloat_t(dk*_log10_2lo1) + Tfloat_t((lo+hi)*_ivln10lo1) + Tfloat_t(lo*_ivln10hi1) + Tfloat_t(hi*_ivln10hi1) + Tfloat_t(dk*_log10_2hi1) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109937,15 +109935,15 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + float64(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v14 = y goto _15 @@ -110244,7 +110242,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -110268,14 +110266,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -110347,10 +110345,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< 0, the exponent of scale might have overflowed by <= 460. */ sbits -= Uint64FromUint64(1009) << Int32FromInt32(52) scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = float64(5.486124068793689e+303) * (scale + scale*tmp) + y3 = Tdouble_t(float64(5.486124068793689e+303) * (scale + Tdouble_t(scale*tmp))) y = y3 v1 = y goto _2 @@ -111213,13 +111211,13 @@ func _specialcase2(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl sbits += Uint64FromUint64(1022) << Int32FromInt32(52) /* Note: sbits is signed scale. */ scale = *(*float64)(unsafe.Pointer(&sbits)) - y3 = scale + scale*tmp + y3 = scale + Tdouble_t(scale*tmp) if Xfabs(tls, y3) < float64(1) { one = float64(1) if y3 < float64(0) { one = -Float64FromFloat64(1) } - lo = scale - y3 + scale*tmp + lo = scale - y3 + Tdouble_t(scale*tmp) hi = one + y3 lo = one - hi + y3 + lo y = hi + lo @@ -111237,9 +111235,9 @@ func _specialcase2(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl v6 = y1 goto _7 _7: - y2 = v6 * float64(2.2250738585072014e-308) + y2 = float64(v6 * float64(2.2250738585072014e-308)) } - y3 = float64(2.2250738585072014e-308) * y3 + y3 = Tdouble_t(float64(2.2250738585072014e-308) * y3) y = y3 v8 = y goto _9 @@ -111284,7 +111282,7 @@ func _exp_inline(tls *TLS, x1 Tdouble_t, xtail Tdouble_t, sign_bias Tuint32_t) ( } /* exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]. */ /* x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]. */ - z = X__exp_data.Finvln2N * x1 + z = Tdouble_t(X__exp_data.Finvln2N * x1) /* z - kd is in [-1, 1] in non-nearest rounding modes. */ y = z + X__exp_data.Fshift v3 = y @@ -111294,7 +111292,7 @@ _4: v5 = kd ki = *(*Tuint64_t)(unsafe.Pointer(&v5)) kd -= X__exp_data.Fshift - r = x1 + kd*X__exp_data.Fnegln2hiN + kd*X__exp_data.Fnegln2loN + r = x1 + Tdouble_t(kd*X__exp_data.Fnegln2hiN) + Tdouble_t(kd*X__exp_data.Fnegln2loN) /* The code assumes 2^-200 < |xtail| < 2^-8/N. */ r += xtail /* 2^(k/N) ~= scale * (1 + tail). */ @@ -111306,17 +111304,17 @@ _4: sbits = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 112 + uintptr(idx+uint64(1))*8)) + top /* exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1). */ /* Evaluation is optimized assuming superscalar pipelined execution. */ - r2 = r * r + r2 = Tdouble_t(r * r) /* Without fma the worst case error is 0.25/N ulp larger. */ /* Worst case error is less than 0.5+1.11/N+(abs poly error * 2^53) ulp. */ - tmp = tail + r + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(5)-Int32FromInt32(EXP_POLY_ORDER))*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(6)-Int32FromInt32(EXP_POLY_ORDER))*8))) + r2*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(7)-Int32FromInt32(EXP_POLY_ORDER))*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(8)-Int32FromInt32(EXP_POLY_ORDER))*8))) + tmp = tail + r + Tdouble_t(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(5)-Int32FromInt32(EXP_POLY_ORDER))*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(6)-Int32FromInt32(EXP_POLY_ORDER))*8))))) + Tdouble_t(Tdouble_t(r2*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(7)-Int32FromInt32(EXP_POLY_ORDER))*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp_data)) + 32 + uintptr(Int32FromInt32(8)-Int32FromInt32(EXP_POLY_ORDER))*8))))) if abstop == uint32(0) { return _specialcase2(tls, tmp, sbits, ki) } scale = *(*float64)(unsafe.Pointer(&sbits)) /* Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -111404,10 +111402,10 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } @@ -111467,7 +111465,7 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) ix -= Uint64FromUint64(52) << Int32FromInt32(52) @@ -111481,8 +111479,8 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { v17 = *(*Tuint64_t)(unsafe.Pointer(&v18)) & (-Uint64FromUint64(1) << Int32FromInt32(27)) lhi = *(*float64)(unsafe.Pointer(&v17)) llo = hi - lhi + *(*Tdouble_t)(unsafe.Pointer(bp)) - ehi = yhi * lhi - elo = ylo*lhi + y1*llo /* |elo| < |ehi| * 2^-25. */ + ehi = Tdouble_t(yhi * lhi) + elo = Tdouble_t(ylo*lhi) + Tdouble_t(y1*llo) /* |elo| < |ehi| * 2^-25. */ return _exp_inline(tls, ehi, elo, sign_bias) } @@ -111547,16 +111545,16 @@ func _log2_inline(tls *TLS, ix Tuint32_t) (r1 Tdouble_t) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 1*8)) - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 2*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 3*8)) - r4 = r2 * r2 - q = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 4*8))*r + y0 - q = p*r2 + q - y = y*r4 + q + r2 = Tdouble_t(r * r) + y = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 1*8)) + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 2*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 3*8)) + r4 = Tdouble_t(r2 * r2) + q = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__powf_log2_data)) + 256 + 4*8))*r) + y0 + q = Tdouble_t(p*r2) + q + y = Tdouble_t(y*r4) + q return y } @@ -111586,11 +111584,11 @@ _2: ski = ki + uint64(sign_bias) t += ski << (Int32FromInt32(52) - Int32FromInt32(EXP2F_TABLE_BITS)) s = *(*float64)(unsafe.Pointer(&t)) - z = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 1*8)) - r2 = r * r - y2 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 2*8))*r + Float64FromInt32(1) - y2 = z*r2 + y2 - y2 = y2 * s + z = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 1*8)) + r2 = Tdouble_t(r * r) + y2 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + 264 + 2*8))*r) + Float64FromInt32(1) + y2 = Tdouble_t(z*r2) + y2 + y2 = Tdouble_t(y2 * s) y = float32(y2) v4 = y goto _5 @@ -111658,10 +111656,10 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { if BoolInt32(uint32(2)*ix < Uint32FromInt32(Int32FromInt32(2)*Int32FromInt32(0x3f800000))) == BoolInt32(!(iy&Uint32FromUint32(0x80000000) != 0)) { return Float32FromFloat32(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111692,22 +111690,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)< y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -112011,7 +112009,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -112292,10 +112290,10 @@ func Xround(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + _toint6 } else { - y2 = x3 + _toint6 + y2 = float64(x3 + _toint6) } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > float64(0.5) { @@ -112359,7 +112357,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3 + _toint7) } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = x3 + _toint7 - _toint7 - x3 if y3 > Float32FromFloat32(0.5) { @@ -112414,7 +112412,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -112465,7 +112463,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -112473,7 +112471,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -112498,8 +112496,8 @@ func Xscalbln(tls *TLS, x float64, n int32) (r float64) { if n > int32(INT_MAX) { n = int32(INT_MAX) } else { - if n < -Int32FromInt32(1)-Int32FromInt32(0x7fffffff) { - n = -Int32FromInt32(1) - Int32FromInt32(0x7fffffff) + if n < int32(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff)) { + n = int32(-Int32FromInt32(1) - Int32FromInt32(0x7fffffff)) } } return Xscalbn(tls, x, n) @@ -112513,8 +112511,8 @@ func Xscalblnf(tls *TLS, x float32, n int32) (r float32) { if n > int32(INT_MAX) { n = int32(INT_MAX) } else { - if n < -Int32FromInt32(1)-Int32FromInt32(0x7fffffff) { - n = -Int32FromInt32(1) - Int32FromInt32(0x7fffffff) + if n < int32(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff)) { + n = int32(-Int32FromInt32(1) - Int32FromInt32(0x7fffffff)) } } return Xscalbnf(tls, x, n) @@ -112557,10 +112555,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -112569,7 +112567,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -112599,10 +112597,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -112611,7 +112609,7 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32(Int32FromInt32(0x7f)+n) << int32(23) - x = y * *(*float32)(unsafe.Pointer(bp)) + x = float32(y * *(*float32)(unsafe.Pointer(bp))) return x } @@ -112793,10 +112791,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112955,10 +112953,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -113106,14 +113104,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -113154,12 +113152,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -113226,7 +113224,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -113376,7 +113374,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -113509,10 +113507,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -113652,18 +113650,18 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { /* note: this branch avoids raising overflow */ t = Float64FromInt32(1) - Float64FromInt32(0)/x3 } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113724,23 +113722,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint32(4) == uint32(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint32(4) == uint32(8) { y1 = float64(x3 * x3) @@ -113788,12 +113786,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113889,8 +113887,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113975,7 +113973,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113999,17 +113997,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / float64(float64(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, float64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(float64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -114073,7 +114071,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if uint32(8) == uint32(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^m @@ -114164,7 +114162,7 @@ func Xa64l(tls *TLS, s uintptr) (r int32) { e += int32(6) s++ } - return Int32FromUint32(x) + return int32(Int32FromUint32(x)) } func Xl64a(tls *TLS, x0 int32) (r uintptr) { @@ -114778,17 +114776,7 @@ func Xgethostid(tls *TLS) (r int32) { const optpos = 0 -type Tucontext_t3 = struct { - F__ccgo_align [0]uint32 - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - Fuc_regspace [64]uint64 -} - -type t__ucontext1 = Tucontext_t3 +type t__ucontext1 = Tucontext_t1 func X__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) { if __ccgo_strace { @@ -115175,7 +115163,7 @@ func Xgetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) { var v1, v2 uint64 var _ /* k_rlim at bp+0 */ [2]uint32 _, _, _ = ret, v1, v2 - ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_prlimit64), Int32FromInt32(0), resource, Int32FromInt32(0), int32(rlim)))) + ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_prlimit64), int32(Int32FromInt32(0)), resource, int32(Int32FromInt32(0)), int32(rlim)))) if !(ret != 0) { if (*Trlimit)(unsafe.Pointer(rlim)).Frlim_cur >= ^Uint64FromUint64(0) { (*Trlimit)(unsafe.Pointer(rlim)).Frlim_cur = ^Uint64FromUint64(0) @@ -115223,7 +115211,7 @@ func Xgetrusage(tls *TLS, who int32, ru uintptr) (r1 int32) { var _ /* kru at bp+0 */ [4]int32 _, _ = dest, r dest = ru + 32 - uintptr(Uint32FromInt32(4)*Uint32FromInt64(4)) - r = X__syscall2(tls, int32(SYS_getrusage), who, int32(dest)) + r = int32(X__syscall2(tls, int32(SYS_getrusage), who, int32(dest))) if !(r != 0) && Bool(uint32(8) > uint32(4)) { _memcpy(tls, bp, dest, Uint32FromInt32(4)*Uint32FromInt64(4)) (*Trusage)(unsafe.Pointer(ru)).Fru_utime = Ttimeval{ @@ -115621,7 +115609,7 @@ func Xioctl(tls *TLS, fd int32, req int32, va uintptr) (r1 int32) { ap = va arg = VaUintptr(&ap) _ = ap - r = X__syscall3(tls, int32(SYS_ioctl), fd, req, int32(arg)) + r = int32(X__syscall3(tls, int32(SYS_ioctl), fd, req, int32(arg))) if Bool(Uint32FromUint32(2)< %v", r1) }() } bp := tls.Alloc(4112) @@ -116136,7 +116126,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } _memcpy(tls, bp+4, path, l+uint32(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -116255,7 +116245,7 @@ func X__ptsname_r(tls *TLS, fd int32, buf uintptr, len1 Tsize_t) (r int32) { if !(buf != 0) { len1 = uint32(0) } - v1 = X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromUint32(Uint32FromUint32(TIOCGPTN)), int32(bp)) + v1 = int32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromUint32(Uint32FromUint32(TIOCGPTN)), int32(bp))) err = v1 if v1 != 0 { return -err @@ -116529,7 +116519,7 @@ func _do_setrlimit(tls *TLS, p uintptr) { if (*Tctx)(unsafe.Pointer(c)).Ferr > 0 { return } - (*Tctx)(unsafe.Pointer(c)).Ferr = -X__syscall2(tls, int32(SYS_setrlimit), (*Tctx)(unsafe.Pointer(c)).Fres, int32(c)) + (*Tctx)(unsafe.Pointer(c)).Ferr = int32(-X__syscall2(tls, int32(SYS_setrlimit), (*Tctx)(unsafe.Pointer(c)).Fres, int32(c))) } func Xsetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) { @@ -116554,7 +116544,7 @@ func Xsetrlimit(tls *TLS, resource int32, rlim uintptr) (r int32) { } rlim = bp } - ret = X__syscall4(tls, int32(SYS_prlimit64), Int32FromInt32(0), resource, int32(rlim), Int32FromInt32(0)) + ret = int32(X__syscall4(tls, int32(SYS_prlimit64), int32(Int32FromInt32(0)), resource, int32(rlim), int32(Int32FromInt32(0)))) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -116913,8 +116903,6 @@ type Tsockaddr_storage = struct { F__ss_align uint32 } -type t__ucontext2 = Tucontext_t2 - var _lock2 [1]int32 var _log_ident [32]uint8 var _log_opt int32 @@ -117279,7 +117267,7 @@ func Xposix_madvise(tls *TLS, addr uintptr, len1 Tsize_t, advice int32) (r int32 if advice == int32(MADV_DONTNEED) { return 0 } - return -X__syscall3(tls, int32(SYS_madvise), int32(addr), Int32FromUint32(len1), advice) + return int32(-X__syscall3(tls, int32(SYS_madvise), int32(addr), Int32FromUint32(len1), advice)) } func X__shm_mapname(tls *TLS, name uintptr, buf uintptr) (r uintptr) { @@ -117352,16 +117340,6 @@ const SA = 194 const SB = 244 const bittab = 0 -type Tucontext_t4 = struct { - F__ccgo_align [0]uint32 - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - Fuc_regspace [64]uint64 -} - func Xbtowc(tls *TLS, c int32) (r Twint_t) { if __ccgo_strace { trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) @@ -117374,7 +117352,7 @@ func Xbtowc(tls *TLS, c int32) (r Twint_t) { if Uint32FromInt32(b) < uint32(128) { v1 = Uint32FromInt32(b) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117575,7 +117553,7 @@ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolUint32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117746,7 +117724,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts goto resume0 } } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117974,7 +117952,7 @@ func Xmbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) { *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolInt32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -118044,7 +118022,7 @@ func Xwcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) { *(*uint8)(unsafe.Pointer(s)) = uint8(wc) return uint32(1) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118251,7 +118229,7 @@ func Xwctob(tls *TLS, c Twint_t) (r int32) { if c < uint32(128) { return Int32FromUint32(c) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118286,15 +118264,15 @@ func Xaccept(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) { v2 = fd v3 = int32(addr) v4 = int32(len1) - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if int32(1) != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -118332,14 +118310,14 @@ func Xaccept4(tls *TLS, fd int32, addr uintptr, len1 uintptr, flg int32) (r1 int v3 = int32(addr) v4 = int32(len1) v5 = flg - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if int32(1) != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -118359,10 +118337,10 @@ _9: return ret } if flg&int32(SOCK_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if flg&int32(SOCK_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), ret, Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), ret, int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } return ret } @@ -118380,15 +118358,15 @@ func Xbind(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) { v2 = fd v3 = int32(addr) v4 = Int32FromUint32(len1) - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -118411,15 +118389,15 @@ func Xconnect(tls *TLS, fd int32, addr uintptr, len1 Tsocklen_t) (r1 int32) { v2 = fd v3 = int32(addr) v4 = Int32FromUint32(len1) - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if int32(1) != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -119077,13 +119055,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]uint8 - Falg [1025]uint8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]uint8 Falg [1025]uint8 @@ -119091,14 +119062,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -119748,9 +119711,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -119796,7 +119761,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if len1+int32(10) > int32(r+uintptr(rlen))-int32(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -121608,15 +121573,15 @@ func Xgetpeername(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) { v2 = fd v3 = int32(addr) v4 = int32(len1) - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -121723,15 +121688,15 @@ func Xgetsockname(tls *TLS, fd int32, addr uintptr, len1 uintptr) (r1 int32) { v2 = fd v3 = int32(addr) v4 = int32(len1) - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -121760,13 +121725,13 @@ func Xgetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, v4 = optname v5 = int32(optval) v6 = int32(optlen) - v7 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -121803,13 +121768,13 @@ _9: v13 = optname v14 = int32(bp + 8) v15 = int32(bp) - v16 = Int32FromInt32(0) + v16 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v10, v11, v12, v13, v14, v15, v16) } else { r = X__syscall6(tls, v10, v11, v12, v13, v14, v15, v16) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v17 = r goto _18 } @@ -121843,13 +121808,13 @@ _9: v22 = optname v23 = int32(optval) v24 = int32(optlen) - v25 = Int32FromInt32(0) + v25 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v19, v20, v21, v22, v23, v24, v25) } else { r = X__syscall6(tls, v19, v20, v21, v22, v23, v24, v25) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v26 = r goto _27 } @@ -121869,10 +121834,10 @@ func X__h_errno_location(tls *TLS) (r uintptr) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - if !((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstack != 0) { + if !((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstack != 0) { return uintptr(unsafe.Pointer(&Xh_errno)) } - return ___get_tp(tls) + 80 + return uintptr(___get_tp(tls)) + 80 } func Xherror(tls *TLS, msg uintptr) { @@ -121896,20 +121861,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+987, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [32]uint32 -} - -type Tucontext_t5 = struct { - F__ccgo_align [0]uint32 - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - Fuc_regspace [64]uint64 -} - var _msgs1 = [84]uint8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -122616,16 +122567,16 @@ func Xlisten(tls *TLS, fd int32, backlog int32) (r1 int32) { _ = int32(__SC_listen) v2 = fd v3 = backlog - v4 = Int32FromInt32(0) - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v4 = int32(Int32FromInt32(0)) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -123696,7 +123647,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -123786,7 +123737,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -123799,9 +123750,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -123810,9 +123763,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int32(SYS_close), fd) return r @@ -123847,7 +123800,7 @@ func Xns_get32(tls *TLS, cp uintptr) (r uint32) { trc("tls=%v cp=%v, (%v:)", tls, cp, origin(2)) defer func() { trc("-> %v", r) }() } - return uint32(*(*uint8)(unsafe.Pointer(cp)))<>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v7), + 0: int32(Int32FromUint64(v7)), 1: ns, } v6 = bp + 16 } else { v6 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_recvmmsg), fd, int32(msgvec), Int32FromUint32(vlen), Int32FromUint32(flags), int32(v6), 0) + r = int32(___syscall_cp(tls, int32(SYS_recvmmsg), fd, int32(msgvec), Int32FromUint32(vlen), Int32FromUint32(flags), int32(v6), 0)) i1 = 0 for { if !(i1 < r) { @@ -124402,10 +124355,10 @@ func X__convert_scm_timestamps(tls *TLS, msg uintptr, csize Tsocklen_t) { goto _1 _1: ; - if (*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len < uint32(12) || ((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(cmsg)) { + if (*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len < uint32(12) || uint32((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(cmsg)) { v6 = uintptr(0) } else { - v6 = cmsg + uintptr(((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) + v6 = cmsg + uintptr(uint32((*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) } cmsg = v6 } @@ -124417,10 +124370,10 @@ func X__convert_scm_timestamps(tls *TLS, msg uintptr, csize Tsocklen_t) { return } *(*Tsocklen_t)(unsafe.Pointer(msg + 20)) += (Uint32FromInt64(16)+Uint32FromInt64(4)-Uint32FromInt32(1)) & ^(Uint32FromInt64(4)-Uint32FromInt32(1)) + (Uint32FromInt64(12)+Uint32FromInt64(4)-Uint32FromInt32(1)) & ^(Uint32FromInt64(4)-Uint32FromInt32(1)) - if (*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len < uint32(12) || ((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(last)) { + if (*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len < uint32(12) || uint32((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))+uint32(12) >= Uint32FromInt32(int32((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_control+uintptr((*Tmsghdr)(unsafe.Pointer(msg)).Fmsg_controllen))-int32(last)) { v7 = uintptr(0) } else { - v7 = last + uintptr(((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) + v7 = last + uintptr(uint32((*Tcmsghdr)(unsafe.Pointer(last)).Fcmsg_len+Uint32FromInt64(4)-Uint32FromInt32(1))&Uint32FromInt32(^Int32FromUint32(Uint32FromInt64(4)-Uint32FromInt32(1)))) } cmsg = v7 (*Tcmsghdr)(unsafe.Pointer(cmsg)).Fcmsg_level = int32(SOL_SOCKET) @@ -124445,15 +124398,15 @@ func Xrecvmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r2 Tssize_t) { v2 = fd v3 = int32(msg) v4 = flags - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if int32(1) != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -125483,15 +125436,15 @@ func Xsendmsg(tls *TLS, fd int32, msg uintptr, flags int32) (r1 Tssize_t) { v2 = fd v3 = int32(msg) v4 = flags - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if int32(1) != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -125522,7 +125475,7 @@ func Xsendto(tls *TLS, fd int32, buf uintptr, len1 Tsize_t, flags int32, addr ui } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -125573,13 +125526,13 @@ func Xsetsockopt(tls *TLS, fd int32, level int32, optname int32, optval uintptr, v4 = optname v5 = int32(optval) v6 = Int32FromUint32(optlen) - v7 = Int32FromInt32(0) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -125619,7 +125572,7 @@ _9: } *(*[2]int32)(unsafe.Pointer(bp)) = [2]int32{ 0: int32(s), - 1: Int32FromUint64(v10), + 1: int32(Int32FromUint64(v10)), } v11 = int32(SYS_setsockopt) _ = int32(__SC_setsockopt) @@ -125628,13 +125581,13 @@ _9: v14 = optname v15 = int32(bp) v16 = Int32FromUint32(Uint32FromInt32(2) * Uint32FromInt64(4)) - v17 = Int32FromInt32(0) + v17 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v11, v12, v13, v14, v15, v16, v17) } else { r = X__syscall6(tls, v11, v12, v13, v14, v15, v16, v17) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v18 = r goto _19 } @@ -125661,13 +125614,13 @@ _9: v23 = optname v24 = int32(optval) v25 = Int32FromUint32(optlen) - v26 = Int32FromInt32(0) + v26 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v20, v21, v22, v23, v24, v25, v26) } else { r = X__syscall6(tls, v20, v21, v22, v23, v24, v25, v26) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v27 = r goto _28 } @@ -125694,16 +125647,16 @@ func Xshutdown(tls *TLS, fd int32, how int32) (r1 int32) { _ = int32(__SC_shutdown) v2 = fd v3 = how - v4 = Int32FromInt32(0) - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v4 = int32(Int32FromInt32(0)) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -125740,15 +125693,15 @@ func Xsocket(tls *TLS, domain int32, type1 int32, protocol int32) (r1 int32) { v2 = domain v3 = type1 v4 = protocol - v5 = Int32FromInt32(0) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v5 = int32(Int32FromInt32(0)) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -125760,17 +125713,17 @@ _9: v10 = int32(SYS_socket) _ = int32(__SC_socket) v11 = domain - v12 = type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK)) + v12 = int32(type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK))) v13 = protocol - v14 = Int32FromInt32(0) - v15 = Int32FromInt32(0) - v16 = Int32FromInt32(0) + v14 = int32(Int32FromInt32(0)) + v15 = int32(Int32FromInt32(0)) + v16 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v10, v11, v12, v13, v14, v15, v16) } else { r = X__syscall6(tls, v10, v11, v12, v13, v14, v15, v16) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v17 = r goto _18 } @@ -125782,10 +125735,10 @@ _9: return X__syscall_ret(tls, Uint32FromInt32(s)) } if type1&int32(SOCK_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), s, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), s, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if type1&int32(SOCK_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), s, Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), s, int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } } return X__syscall_ret(tls, Uint32FromInt32(s)) @@ -125805,14 +125758,14 @@ func Xsocketpair(tls *TLS, domain int32, type1 int32, protocol int32, fd uintptr v3 = type1 v4 = protocol v5 = int32(fd) - v6 = Int32FromInt32(0) - v7 = Int32FromInt32(0) + v6 = int32(Int32FromInt32(0)) + v7 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v1, v2, v3, v4, v5, v6, v7) } else { r = X__syscall6(tls, v1, v2, v3, v4, v5, v6, v7) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v8 = r goto _9 } @@ -125824,17 +125777,17 @@ _9: v10 = int32(SYS_socketpair) _ = int32(__SC_socketpair) v11 = domain - v12 = type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK)) + v12 = int32(type1 & ^(Int32FromInt32(SOCK_CLOEXEC) | Int32FromInt32(SOCK_NONBLOCK))) v13 = protocol v14 = int32(fd) - v15 = Int32FromInt32(0) - v16 = Int32FromInt32(0) + v15 = int32(Int32FromInt32(0)) + v16 = int32(Int32FromInt32(0)) if 0 != 0 { r = ___syscall_cp(tls, v10, v11, v12, v13, v14, v15, v16) } else { r = X__syscall6(tls, v10, v11, v12, v13, v14, v15, v16) } - if r != -Int32FromInt32(ENOSYS) { + if r != int32(-Int32FromInt32(ENOSYS)) { v17 = r goto _18 } @@ -125846,12 +125799,12 @@ _9: return r1 } if type1&int32(SOCK_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if type1&int32(SOCK_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } } return r1 @@ -127417,7 +127370,7 @@ func Xjrand48(tls *TLS, s uintptr) (r int32) { trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) defer func() { trc("-> %v", r) }() } - return Int32FromUint64(X__rand48_step(tls, s, uintptr(unsafe.Pointer(&X__seed48))+uintptr(3)*2) >> Int32FromInt32(16)) + return int32(Int32FromUint64(X__rand48_step(tls, s, uintptr(unsafe.Pointer(&X__seed48))+uintptr(3)*2) >> Int32FromInt32(16))) } func Xmrand48(tls *TLS) (r int32) { @@ -127930,7 +127883,7 @@ func Xfexecve(tls *TLS, fd int32, argv uintptr, envp uintptr) (r1 int32) { var r int32 var _ /* buf at bp+0 */ [27]uint8 _ = r - r = X__syscall5(tls, int32(SYS_execveat), fd, int32(__ccgo_ts), int32(argv), int32(envp), Int32FromInt32(AT_EMPTY_PATH)) + r = int32(X__syscall5(tls, int32(SYS_execveat), fd, int32(__ccgo_ts), int32(argv), int32(envp), int32(Int32FromInt32(AT_EMPTY_PATH)))) if r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -128310,7 +128263,7 @@ func Xwaitid(tls *TLS, type1 Tidtype_t, id Tid_t, info uintptr, options int32) ( trc("tls=%v type1=%v id=%v info=%v options=%v, (%v:)", tls, type1, id, info, options, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_waitid), type1, Int32FromUint32(id), int32(info), options, Int32FromInt32(0), 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_waitid), type1, Int32FromUint32(id), int32(info), options, int32(Int32FromInt32(0)), 0))) } func Xwaitpid(tls *TLS, pid Tpid_t, status uintptr, options int32) (r Tpid_t) { @@ -128318,7 +128271,7 @@ func Xwaitpid(tls *TLS, pid Tpid_t, status uintptr, options int32) (r Tpid_t) { trc("tls=%v pid=%v status=%v options=%v, (%v:)", tls, pid, status, options, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_wait4), pid, int32(status), options, Int32FromInt32(0), 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_wait4), pid, int32(status), options, int32(Int32FromInt32(0)), 0, 0))) } const BRACKET = -3 @@ -128637,7 +128590,7 @@ func _fnmatch_internal(tls *TLS, pat uintptr, m Tsize_t, str uintptr, n Tsize_t, break } if v9 = uint32(*(*uint8)(unsafe.Pointer(s + uintptr(-Int32FromInt32(1))))) < uint32(128); !v9 { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v8 = int32(4) } else { v8 = int32(1) @@ -128875,7 +128828,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(160) defer tls.Free(160) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -128984,7 +128937,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -129021,7 +128974,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -129073,7 +129026,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -129084,7 +129037,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*uint8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -129196,9 +129149,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4112) @@ -129224,8 +129179,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -129244,7 +129199,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4108, bp+8, bp+4104) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+8, *(*Tsize_t)(unsafe.Pointer(bp + 4104)), 0, *(*uintptr)(unsafe.Pointer(bp + 4108)), flags, errfunc, bp+4) + error1 = _do_glob(tls, bp+8, *(*Tsize_t)(unsafe.Pointer(bp + 4104)), 0, *(*uintptr)(unsafe.Pointer(bp + 4108)), flags, __ccgo_fp_errfunc, bp+4) } Xfree(tls, p) } @@ -130185,8 +130140,8 @@ func _parse_bracket(tls *TLS, ctx uintptr, s uintptr) (r Treg_errcode_t) { err = int32(REG_ESPACE) goto parse_bracket_done } - (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_min = Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1) - (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_max = Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1) + (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_min = int32(Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1)) + (*Ttre_literal_t)(unsafe.Pointer(lit)).Fcode_max = int32(Int32FromInt32(TRE_CHAR_MAX) + Int32FromInt32(1)) (*Ttre_literal_t)(unsafe.Pointer(lit)).Fposition = -int32(1) /* negated classes */ if (*(*Tneg)(unsafe.Pointer(bp + 16))).Flen1 != 0 { @@ -134469,9 +134424,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134487,7 +134444,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134499,9 +134456,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return _memcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134517,7 +134476,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134536,9 +134495,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [49]uintptr @@ -134562,7 +134523,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134607,9 +134568,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -134617,17 +134580,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -134641,7 +134606,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134729,9 +134694,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [48]uintptr @@ -134751,7 +134718,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -134787,26 +134754,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 4 + 1*4)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -134817,8 +134786,6 @@ func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_poll), int32(fds), Int32FromUint32(n), timeout, 0, 0, 0))) } -type t__ucontext3 = Tucontext_t5 - func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v fds=%v n=%v to=%v mask=%v, (%v:)", tls, fds, n, to, mask, origin(2)) @@ -134855,7 +134822,7 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r1 int3 } else { v3 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_ppoll_time64), int32(fds), Int32FromUint32(n), int32(v3), int32(mask), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0) + r = int32(___syscall_cp(tls, int32(SYS_ppoll_time64), int32(fds), Int32FromUint32(n), int32(v3), int32(mask), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0)) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -134875,11 +134842,9 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r1 int3 } else { v5 = uintptr(0) } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ppoll), int32(fds), Int32FromUint32(n), int32(v5), int32(mask), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ppoll), int32(fds), Int32FromUint32(n), int32(v5), int32(mask), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0))) } -type t__ucontext4 = Tucontext_t4 - func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v ts=%v mask=%v, (%v:)", tls, n, rfds, wfds, efds, ts, mask, origin(2)) @@ -134896,7 +134861,7 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui _, _, _, _, _, _, _, _ = ns, r, s, v1, v2, v3, v4, v5 *(*[2]Tsyscall_arg_t)(unsafe.Pointer(bp + 24)) = [2]Tsyscall_arg_t{ 0: Int32FromUint32(uint32(mask)), - 1: Int32FromInt32(_NSIG) / Int32FromInt32(8), + 1: int32(Int32FromInt32(_NSIG) / Int32FromInt32(8)), } if ts != 0 { v1 = (*Ttimespec)(unsafe.Pointer(ts)).Ftv_sec @@ -134921,7 +134886,7 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui } else { v3 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+24)) + r = int32(___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+24))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -134944,16 +134909,6 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_pselect6), n, int32(rfds), int32(wfds), int32(efds), int32(v5), int32(bp+24)))) } -type Tucontext_t6 = struct { - F__ccgo_align [0]uint32 - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t - Fuc_regspace [64]uint64 -} - func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v tv=%v, (%v:)", tls, n, rfds, wfds, efds, tv, origin(2)) @@ -135005,9 +134960,9 @@ func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uin v3 = uintptr(0) } *(*[2]Tsyscall_arg_t)(unsafe.Pointer(bp + 16)) = [2]Tsyscall_arg_t{ - 1: Int32FromInt32(_NSIG) / Int32FromInt32(8), + 1: int32(Int32FromInt32(_NSIG) / Int32FromInt32(8)), } - r = ___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+16)) + r = int32(___syscall_cp(tls, int32(SYS_pselect6_time64), n, int32(rfds), int32(wfds), int32(efds), int32(v3), int32(bp+16))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -135044,21 +134999,21 @@ func X__block_all_sigs(tls *TLS, set uintptr) { if __ccgo_strace { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_BLOCK), int32(uintptr(unsafe.Pointer(&_all_mask))), int32(set), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_BLOCK)), int32(uintptr(unsafe.Pointer(&_all_mask))), int32(set), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) } func X__block_app_sigs(tls *TLS, set uintptr) { if __ccgo_strace { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_BLOCK), int32(uintptr(unsafe.Pointer(&_app_mask))), int32(set), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_BLOCK)), int32(uintptr(unsafe.Pointer(&_app_mask))), int32(set), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) } func X__restore_sigs(tls *TLS, set uintptr) { if __ccgo_strace { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_SETMASK), int32(set), Int32FromInt32(0), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_SETMASK)), int32(set), int32(Int32FromInt32(0)), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) } func Xgetitimer(tls *TLS, which int32, old uintptr) (r1 int32) { @@ -135072,7 +135027,7 @@ func Xgetitimer(tls *TLS, which int32, old uintptr) (r1 int32) { var _ /* old32 at bp+0 */ [4]int32 _ = r if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_getitimer), which, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_getitimer), which, int32(bp))) if !(r != 0) { (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[0]) (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_usec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[int32(1)]) @@ -135166,7 +135121,7 @@ func Xraise(tls *TLS, sig int32) (r int32) { var _ /* set at bp+0 */ Tsigset_t _ = ret X__block_app_sigs(tls, bp) - ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid, sig))) + ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid, sig))) X__restore_sigs(tls, bp) return ret } @@ -135210,7 +135165,7 @@ func Xsetitimer(tls *TLS, which int32, new1 uintptr, old uintptr) (r1 int32) { 2: int32(vs), 3: vus, } - r = X__syscall3(tls, int32(SYS_setitimer), which, int32(bp), int32(bp+16)) + r = int32(X__syscall3(tls, int32(SYS_setitimer), which, int32(bp), int32(bp+16))) if !(r != 0) && old != 0 { (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp + 16)))[0]) (*Titimerval)(unsafe.Pointer(old)).Fit_interval.Ftv_usec = int64((*(*[4]int32)(unsafe.Pointer(bp + 16)))[int32(1)]) @@ -135317,7 +135272,7 @@ func X__libc_sigaction(tls *TLS, sig int32, sa uintptr, old1 uintptr) (r1 int32) *(*[2]uint32)(unsafe.Pointer(bp)) = [2]uint32{ 1: Uint32FromUint32(3) << (Int32FromInt32(32) * BoolInt32(Uint32FromInt64(4) > Uint32FromInt32(4))), } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_UNBLOCK), int32(bp), Int32FromInt32(0), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_UNBLOCK)), int32(bp), int32(Int32FromInt32(0)), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) _unmask_done = int32(1) } if !((*Tsigaction)(unsafe.Pointer(sa)).Fsa_flags&Int32FromInt32(SA_RESTART) != 0) { @@ -135347,7 +135302,7 @@ func X__libc_sigaction(tls *TLS, sig int32, sa uintptr, old1 uintptr) (r1 int32) } else { v12 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_rt_sigaction), sig, int32(v11), int32(v12), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + r = int32(X__syscall4(tls, int32(SYS_rt_sigaction), sig, int32(v11), int32(v12), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)))) if old1 != 0 && !(r != 0) { *(*uintptr)(unsafe.Pointer(old1)) = (*(*Tk_sigaction)(unsafe.Pointer(bp + 36))).Fhandler (*Tsigaction)(unsafe.Pointer(old1)).Fsa_flags = Int32FromUint32((*(*Tk_sigaction)(unsafe.Pointer(bp + 36))).Fflags) @@ -135429,16 +135384,6 @@ func Xsigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) { const SST_SIZE = 8 -type Tucontext_t7 = struct { - F__ccgo_align [0]uint32 - Fuc_flags uint32 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t - Fuc_regspace [64]uint64 -} - func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v dest=%v left=%v right=%v, (%v:)", tls, dest, left, right, origin(2)) @@ -135452,7 +135397,7 @@ func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) l = left r = right for { - if !(i < Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4)) { + if !(i < uint32(Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4))) { break } *(*uint32)(unsafe.Pointer(d + uintptr(i)*4)) = *(*uint32)(unsafe.Pointer(l + uintptr(i)*4)) & *(*uint32)(unsafe.Pointer(r + uintptr(i)*4)) @@ -135569,7 +135514,7 @@ func Xsigorset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { l = left r = right for { - if !(i < Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4)) { + if !(i < uint32(Uint32FromInt32(Int32FromInt32(_NSIG)/Int32FromInt32(8))/Uint32FromInt64(4))) { break } *(*uint32)(unsafe.Pointer(d + uintptr(i)*4)) = *(*uint32)(unsafe.Pointer(l + uintptr(i)*4)) | *(*uint32)(unsafe.Pointer(r + uintptr(i)*4)) @@ -135586,7 +135531,7 @@ func Xsigpending(tls *TLS, set uintptr) (r int32) { trc("tls=%v set=%v, (%v:)", tls, set, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_rt_sigpending), int32(set), Int32FromInt32(_NSIG)/Int32FromInt32(8)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_rt_sigpending), int32(set), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))))) } func Xsigprocmask(tls *TLS, how int32, set uintptr, old uintptr) (r1 int32) { @@ -135675,7 +135620,7 @@ func X__sigsetjmp_tail(tls *TLS, jb uintptr, ret int32) (r int32) { } else { v2 = p } - X__syscall4(tls, int32(SYS_rt_sigprocmask), Int32FromInt32(SIG_SETMASK), int32(v1), int32(v2), Int32FromInt32(_NSIG)/Int32FromInt32(8)) + X__syscall4(tls, int32(SYS_rt_sigprocmask), int32(Int32FromInt32(SIG_SETMASK)), int32(v1), int32(v2), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8))) return ret } @@ -135684,7 +135629,7 @@ func Xsigsuspend(tls *TLS, mask uintptr) (r int32) { trc("tls=%v mask=%v, (%v:)", tls, mask, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_rt_sigsuspend), int32(mask), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0, 0, 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_rt_sigsuspend), int32(mask), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0, 0, 0, 0))) } func _do_sigtimedwait(tls *TLS, mask uintptr, si uintptr, ts uintptr) (r1 int32) { @@ -135719,7 +135664,7 @@ func _do_sigtimedwait(tls *TLS, mask uintptr, si uintptr, ts uintptr) (r1 int32) } else { v3 = uintptr(0) } - r = ___syscall_cp(tls, int32(SYS_rt_sigtimedwait_time64), int32(mask), int32(si), int32(v3), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_rt_sigtimedwait_time64), int32(mask), int32(si), int32(v3), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0, 0)) } if Bool(false) || r != -int32(ENOSYS) { return r @@ -135731,14 +135676,14 @@ func _do_sigtimedwait(tls *TLS, mask uintptr, si uintptr, ts uintptr) (r1 int32) v5 = uint64(0x7fffffff) + (0+Uint64FromInt64(s))>>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v5), + 0: int32(Int32FromUint64(v5)), 1: ns, } v4 = bp + 16 } else { v4 = uintptr(0) } - return ___syscall_cp(tls, int32(SYS_rt_sigtimedwait), int32(mask), int32(si), int32(v4), Int32FromInt32(_NSIG)/Int32FromInt32(8), 0, 0) + return int32(___syscall_cp(tls, int32(SYS_rt_sigtimedwait), int32(mask), int32(si), int32(v4), int32(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0, 0)) return r1 } @@ -135812,8 +135757,8 @@ func Xfchmod(tls *TLS, fd int32, mode Tmode_t) (r int32) { var ret int32 var _ /* buf at bp+0 */ [27]uint8 _ = ret - ret = X__syscall2(tls, int32(SYS_fchmod), fd, Int32FromUint32(mode)) - if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) < 0 { + ret = int32(X__syscall2(tls, int32(SYS_fchmod), fd, Int32FromUint32(mode))) + if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) < 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) } X__procfdname(tls, bp, Uint32FromInt32(fd)) @@ -135834,7 +135779,7 @@ func Xfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r in if !(flag != 0) { return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fchmodat), fd, int32(path), Int32FromUint32(mode)))) } - ret = X__syscall4(tls, int32(SYS_fchmodat2), fd, int32(path), Int32FromUint32(mode), flag) + ret = int32(X__syscall4(tls, int32(SYS_fchmodat2), fd, int32(path), Int32FromUint32(mode), flag)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -135847,7 +135792,7 @@ func Xfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r in if (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFLNK) { return X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(EOPNOTSUPP))) } - v1 = X__syscall3(tls, int32(SYS_openat), fd, int32(path), Int32FromInt32(O_RDONLY)|Int32FromInt32(O_PATH)|Int32FromInt32(O_NOFOLLOW)|Int32FromInt32(O_NOCTTY)|Int32FromInt32(O_CLOEXEC)) + v1 = int32(X__syscall3(tls, int32(SYS_openat), fd, int32(path), int32(Int32FromInt32(O_RDONLY)|Int32FromInt32(O_PATH)|Int32FromInt32(O_NOFOLLOW)|Int32FromInt32(O_NOCTTY)|Int32FromInt32(O_CLOEXEC)))) fd2 = v1 if v1 < 0 { if fd2 == -int32(ELOOP) { @@ -135861,7 +135806,7 @@ func Xfchmodat(tls *TLS, fd int32, path uintptr, mode Tmode_t, flag int32) (r in if (*(*Tstat)(unsafe.Pointer(bp))).Fst_mode&uint32(S_IFMT) == uint32(S_IFLNK) { ret = X__syscall_ret(tls, Uint32FromInt32(-Int32FromInt32(EOPNOTSUPP))) } else { - ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fchmodat), -Int32FromInt32(100), int32(bp+152), Int32FromUint32(mode)))) + ret = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fchmodat), int32(-Int32FromInt32(100)), int32(bp+152), Int32FromUint32(mode)))) } } X__syscall1(tls, int32(SYS_close), fd2) @@ -135939,7 +135884,7 @@ func _fstatat_statx(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r var _ /* stx at bp+0 */ Tstatx1 _ = ret flag |= int32(AT_NO_AUTOMOUNT) - ret = X__syscall5(tls, int32(SYS_statx), fd, int32(path), flag, Int32FromInt32(0x7ff), int32(bp)) + ret = int32(X__syscall5(tls, int32(SYS_statx), fd, int32(path), flag, int32(Int32FromInt32(0x7ff)), int32(bp))) if ret != 0 { return ret } @@ -136024,22 +135969,22 @@ func _fstatat_kstat(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r var _ /* kst at bp+0 */ Tkstat _ = ret if flag == int32(AT_EMPTY_PATH) && fd >= 0 && !(*(*uint8)(unsafe.Pointer(path)) != 0) { - ret = X__syscall2(tls, int32(SYS_fstat64), fd, int32(bp)) - if ret == -int32(EBADF) && X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) >= 0 { - ret = X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag) + ret = int32(X__syscall2(tls, int32(SYS_fstat64), fd, int32(bp))) + if ret == -int32(EBADF) && X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) >= 0 { + ret = int32(X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag)) if ret == -int32(EINVAL) { X__procfdname(tls, bp+104, Uint32FromInt32(fd)) - ret = X__syscall2(tls, int32(SYS_stat64), int32(bp+104), int32(bp)) + ret = int32(X__syscall2(tls, int32(SYS_stat64), int32(bp+104), int32(bp))) } } } else { if (fd == -int32(100) || Int32FromUint8(*(*uint8)(unsafe.Pointer(path))) == int32('/')) && flag == int32(AT_SYMLINK_NOFOLLOW) { - ret = X__syscall2(tls, int32(SYS_lstat64), int32(path), int32(bp)) + ret = int32(X__syscall2(tls, int32(SYS_lstat64), int32(path), int32(bp))) } else { if (fd == -int32(100) || Int32FromUint8(*(*uint8)(unsafe.Pointer(path))) == int32('/')) && !(flag != 0) { - ret = X__syscall2(tls, int32(SYS_stat64), int32(path), int32(bp)) + ret = int32(X__syscall2(tls, int32(SYS_stat64), int32(path), int32(bp))) } else { - ret = X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag) + ret = int32(X__syscall4(tls, int32(SYS_fstatat64), fd, int32(path), int32(bp), flag)) } } } @@ -136360,7 +136305,7 @@ func Xutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r } else { v1 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_utimensat_time64), fd, int32(path), int32(v1), flags) + r = int32(X__syscall4(tls, int32(SYS_utimensat_time64), fd, int32(path), int32(v1), flags)) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -136379,7 +136324,7 @@ func Xutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r } else { v2 = uintptr(0) } - r = X__syscall4(tls, int32(SYS_utimensat), fd, int32(path), int32(v2), flags) + r = int32(X__syscall4(tls, int32(SYS_utimensat), fd, int32(path), int32(v2), flags)) if r != -int32(ENOSYS) || flags != 0 { return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -136405,11 +136350,11 @@ func Xutimensat(tls *TLS, fd int32, path uintptr, times uintptr, flags int32) (r i++ } } - r = X__syscall3(tls, int32(SYS_futimesat), fd, int32(path), int32(tv)) + r = int32(X__syscall3(tls, int32(SYS_futimesat), fd, int32(path), int32(tv))) if r != -int32(ENOSYS) || fd != -int32(100) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, int32(SYS_utimes), int32(path), int32(tv)) + r = int32(X__syscall2(tls, int32(SYS_utimes), int32(path), int32(tv))) return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -136456,13 +136401,13 @@ func X__fdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) { } /* Apply close-on-exec flag */ if Xstrchr(tls, mode, int32('e')) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } /* Set append mode on fd if opened for append */ if Int32FromUint8(*(*uint8)(unsafe.Pointer(mode))) == int32('a') { - flags = X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFL)) + flags = int32(X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFL)))) if !(flags&Int32FromInt32(O_APPEND) != 0) { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFL), flags|Int32FromInt32(O_APPEND)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFL)), int32(flags|Int32FromInt32(O_APPEND))) } *(*uint32)(unsafe.Pointer(f)) |= uint32(F_APP) } @@ -136471,7 +136416,7 @@ func X__fdopen(tls *TLS, fd int32, mode uintptr) (r uintptr) { (*TFILE)(unsafe.Pointer(f)).Fbuf_size = uint32(BUFSIZ) /* Activate line buffered mode for terminals */ (*TFILE)(unsafe.Pointer(f)).Flbf = -int32(1) - if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_NOWR) != 0) && !(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCGWINSZ), int32(bp)) != 0) { + if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_NOWR) != 0) && !(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCGWINSZ)), int32(bp)) != 0) { (*TFILE)(unsafe.Pointer(f)).Flbf = int32('\n') } /* Initialize op ptrs. No problem if some are unneeded. */ @@ -136534,11 +136479,11 @@ func X__fopen_rb_ca(tls *TLS, filename uintptr, f uintptr, buf uintptr, len1 Tsi defer func() { trc("-> %v", r) }() } Xmemset(tls, f, 0, uint32(144)) - (*TFILE)(unsafe.Pointer(f)).Ffd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(filename), Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_LARGEFILE)))) + (*TFILE)(unsafe.Pointer(f)).Ffd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(filename), int32(Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_LARGEFILE))))) if (*TFILE)(unsafe.Pointer(f)).Ffd < 0 { return uintptr(0) } - X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) (*TFILE)(unsafe.Pointer(f)).Fflags = Uint32FromInt32(Int32FromInt32(F_NOWR) | Int32FromInt32(F_PERM)) (*TFILE)(unsafe.Pointer(f)).Fbuf = buf + uintptr(UNGET) (*TFILE)(unsafe.Pointer(f)).Fbuf_size = len1 - uint32(UNGET) @@ -136659,7 +136604,7 @@ func X__stdio_read(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) { }, } if (*(*[2]Tiovec)(unsafe.Pointer(bp)))[0].Fiov_len != 0 { - v1 = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_readv), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(bp), Int32FromInt32(2)))) + v1 = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_readv), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(bp), int32(Int32FromInt32(2))))) } else { v1 = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_read), (*TFILE)(unsafe.Pointer(f)).Ffd, int32((*(*[2]Tiovec)(unsafe.Pointer(bp)))[int32(1)].Fiov_base), Int32FromUint32((*(*[2]Tiovec)(unsafe.Pointer(bp)))[int32(1)].Fiov_len)))) } @@ -136769,7 +136714,7 @@ func X__stdout_write(tls *TLS, f uintptr, buf uintptr, len1 Tsize_t) (r Tsize_t) defer tls.Free(16) var _ /* wsz at bp+0 */ Twinsize (*TFILE)(unsafe.Pointer(f)).Fwrite = __ccgo_fp(X__stdio_write) - if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_SVB) != 0) && X__syscall3(tls, int32(SYS_ioctl), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(TIOCGWINSZ), int32(bp)) != 0 { + if !((*TFILE)(unsafe.Pointer(f)).Fflags&Uint32FromInt32(F_SVB) != 0) && X__syscall3(tls, int32(SYS_ioctl), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(TIOCGWINSZ)), int32(bp)) != 0 { (*TFILE)(unsafe.Pointer(f)).Flbf = -int32(1) } return X__stdio_write(tls, f, buf, len1) @@ -137321,7 +137266,7 @@ _9: if v11 < Int32FromInt32(0) { v11 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v10), Int32FromInt32(FUTEX_WAKE)|v12, v11) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v10), Int32FromInt32(FUTEX_WAKE), v11) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v10), int32(Int32FromInt32(FUTEX_WAKE)|v12), v11) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v10), int32(Int32FromInt32(FUTEX_WAKE)), v11) != 0 } return c } @@ -137336,7 +137281,7 @@ func Xfgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 4 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -137579,7 +137524,7 @@ func X__fgetwc_unlocked(tls *TLS, f uintptr) (r Twint_t) { var ploc uintptr var wc Twchar_t _, _, _ = loc, ploc, wc - ploc = ___get_tp(tls) + 88 + ploc = uintptr(___get_tp(tls)) + 88 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if (*TFILE)(unsafe.Pointer(f)).Fmode <= 0 { Xfwide(tls, f, int32(1)) @@ -137730,7 +137675,7 @@ func Xflockfile(tls *TLS, f uintptr) { return } ___lockfile(tls, f) - X__register_locked_file(tls, f, ___get_tp(tls)) + X__register_locked_file(tls, f, uintptr(___get_tp(tls))) } type Tcookie = struct { @@ -137931,12 +137876,12 @@ func Xfopen(tls *TLS, filename uintptr, mode uintptr) (r uintptr) { } /* Compute the flags to pass to open() */ flags = X__fmodeflags(tls, mode) - fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(filename), flags|Int32FromInt32(O_LARGEFILE), Int32FromInt32(0666)))) + fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(filename), int32(flags|Int32FromInt32(O_LARGEFILE)), int32(Int32FromInt32(0666))))) if fd < 0 { return uintptr(0) } if flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } f = X__fdopen(tls, fd, mode) if f != 0 { @@ -138182,7 +138127,7 @@ _10: if v12 < Int32FromInt32(0) { v12 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v11), Int32FromInt32(FUTEX_WAKE)|v13, v12) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v11), Int32FromInt32(FUTEX_WAKE), v12) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v11), int32(Int32FromInt32(FUTEX_WAKE)|v13), v12) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v11), int32(Int32FromInt32(FUTEX_WAKE)), v12) != 0 } return c } @@ -138199,7 +138144,7 @@ func Xfputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 20 @@ -138251,7 +138196,7 @@ func X__fputwc_unlocked(tls *TLS, c Twchar_t, f uintptr) (r Twint_t) { var v2 uint8 var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _ = l, loc, ploc, v1, v2, v3, v4 - ploc = ___get_tp(tls) + 88 + ploc = uintptr(___get_tp(tls)) + 88 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if (*TFILE)(unsafe.Pointer(f)).Fmode <= 0 { Xfwide(tls, f, int32(1)) @@ -138343,7 +138288,7 @@ func Xfputws(tls *TLS, _ws uintptr, f uintptr) (r int32) { var _ /* buf at bp+4 */ [1024]uint8 _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3 l = uint32(0) - ploc = ___get_tp(tls) + 88 + ploc = uintptr(___get_tp(tls)) + 88 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+76) >= 0 { v1 = ___lockfile(tls, f) @@ -138483,10 +138428,10 @@ func Xfreopen(tls *TLS, filename uintptr, mode uintptr, f uintptr) (r uintptr) { Xfflush(tls, f) if !(filename != 0) { if fl&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } fl &= ^(Int32FromInt32(O_CREAT) | Int32FromInt32(O_EXCL) | Int32FromInt32(O_CLOEXEC)) - if X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, Int32FromInt32(F_SETFL), fl))) < 0 { + if X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_fcntl64), (*TFILE)(unsafe.Pointer(f)).Ffd, int32(Int32FromInt32(F_SETFL)), fl))) < 0 { goto fail } } else { @@ -138719,7 +138664,7 @@ func X__do_orphaned_stdio_locks(tls *TLS) { } var f uintptr _ = f - f = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks + f = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks for { if !(f != 0) { break @@ -138745,7 +138690,7 @@ func X__unlist_locked_file(tls *TLS, f uintptr) { if (*TFILE)(unsafe.Pointer(f)).Fprev_locked != 0 { (*TFILE)(unsafe.Pointer((*TFILE)(unsafe.Pointer(f)).Fprev_locked)).Fnext_locked = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } else { - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } } } @@ -138773,7 +138718,7 @@ func Xftrylockfile(tls *TLS, f uintptr) (r int32) { var v2 uintptr var v5 bool _, _, _, _, _, _, _, _ = old, owner, self, tid, v1, v2, v3, v5 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) tid = (*t__pthread)(unsafe.Pointer(self)).Ftid owner = AtomicLoadPInt32(f + 76) if owner & ^Int32FromInt32(MAYBE_WAITERS) == tid { @@ -138835,7 +138780,7 @@ func Xfwide(tls *TLS, f uintptr, mode int32) (r int32) { __need_unlock = v1 if mode != 0 { if !((*TFILE)(unsafe.Pointer(f)).Flocale != 0) { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -139022,7 +138967,7 @@ _9: if v11 < Int32FromInt32(0) { v11 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v10), Int32FromInt32(FUTEX_WAKE)|v12, v11) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v10), Int32FromInt32(FUTEX_WAKE), v11) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v10), int32(Int32FromInt32(FUTEX_WAKE)|v12), v11) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v10), int32(Int32FromInt32(FUTEX_WAKE)), v11) != 0 } return c } @@ -139037,7 +138982,7 @@ func Xgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 4 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139142,7 +139087,7 @@ _9: if v11 < Int32FromInt32(0) { v11 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v10), Int32FromInt32(FUTEX_WAKE)|v12, v11) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v10), Int32FromInt32(FUTEX_WAKE), v11) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v10), int32(Int32FromInt32(FUTEX_WAKE)|v12), v11) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v10), int32(Int32FromInt32(FUTEX_WAKE)), v11) != 0 } return c } @@ -139157,7 +139102,7 @@ func Xgetchar(tls *TLS) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = uintptr(unsafe.Pointer(&X__stdin_FILE)) l = AtomicLoadPInt32(v1 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 4 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139748,7 +139693,7 @@ func Xpclose(tls *TLS, f uintptr) (r1 int32) { pid = (*TFILE)(unsafe.Pointer(f)).Fpipe_pid Xfclose(tls, f) for { - v1 = X__syscall4(tls, int32(SYS_wait4), pid, int32(bp), Int32FromInt32(0), Int32FromInt32(0)) + v1 = int32(X__syscall4(tls, int32(SYS_wait4), pid, int32(bp), int32(Int32FromInt32(0)), int32(Int32FromInt32(0)))) r = v1 if !(v1 == -int32(EINTR)) { break @@ -139854,7 +139799,7 @@ _10: if v12 < Int32FromInt32(0) { v12 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v11), Int32FromInt32(FUTEX_WAKE)|v13, v12) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v11), Int32FromInt32(FUTEX_WAKE), v12) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v11), int32(Int32FromInt32(FUTEX_WAKE)|v13), v12) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v11), int32(Int32FromInt32(FUTEX_WAKE)), v12) != 0 } return c } @@ -139871,7 +139816,7 @@ func Xputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 20 @@ -139984,7 +139929,7 @@ _10: if v12 < Int32FromInt32(0) { v12 = int32(INT_MAX) } - _ = X__syscall3(tls, int32(SYS_futex), int32(v11), Int32FromInt32(FUTEX_WAKE)|v13, v12) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v11), Int32FromInt32(FUTEX_WAKE), v12) != 0 + _ = X__syscall3(tls, int32(SYS_futex), int32(v11), int32(Int32FromInt32(FUTEX_WAKE)|v13), v12) != -int32(ENOSYS) || X__syscall3(tls, int32(SYS_futex), int32(v11), int32(Int32FromInt32(FUTEX_WAKE)), v12) != 0 } return c } @@ -140001,7 +139946,7 @@ func Xputchar(tls *TLS, c1 int32) (r int32) { v1 = c1 v2 = uintptr(unsafe.Pointer(&X__stdout_FILE)) l = AtomicLoadPInt32(v2 + 76) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 20 @@ -140120,9 +140065,9 @@ func Xremove(tls *TLS, path uintptr) (r1 int32) { } var r int32 _ = r - r = X__syscall1(tls, int32(SYS_unlink), int32(path)) + r = int32(X__syscall1(tls, int32(SYS_unlink), int32(path))) if r == -int32(EISDIR) { - r = X__syscall1(tls, int32(SYS_rmdir), int32(path)) + r = int32(X__syscall1(tls, int32(SYS_rmdir), int32(path))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -140393,7 +140338,7 @@ func Xtempnam(tls *TLS, dir uintptr, pfx uintptr) (r1 uintptr) { } ___randname(tls, bp+1+uintptr(l)-uintptr(6)) *(*[1]uint8)(unsafe.Pointer(bp)) = [1]uint8{} - r = X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), Int32FromInt32(1)) + r = int32(X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), int32(Int32FromInt32(1)))) if r == -int32(ENOENT) { return Xstrdup(tls, bp+1) } @@ -140423,7 +140368,7 @@ func Xtmpfile(tls *TLS) (r uintptr) { break } ___randname(tls, bp+uintptr(13)) - fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(bp), Int32FromInt32(O_RDWR)|Int32FromInt32(O_CREAT)|Int32FromInt32(O_EXCL)|Int32FromInt32(O_LARGEFILE), Int32FromInt32(0600)))) + fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_open), int32(bp), int32(Int32FromInt32(O_RDWR)|Int32FromInt32(O_CREAT)|Int32FromInt32(O_EXCL)|Int32FromInt32(O_LARGEFILE)), int32(Int32FromInt32(0600))))) if fd >= 0 { X__syscall1(tls, int32(SYS_unlink), int32(bp)) f = X__fdopen(tls, fd, __ccgo_ts+1416) @@ -140459,7 +140404,7 @@ func Xtmpnam(tls *TLS, buf uintptr) (r1 uintptr) { } ___randname(tls, bp+1+uintptr(12)) *(*[1]uint8)(unsafe.Pointer(bp)) = [1]uint8{} - r = X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), Int32FromInt32(1)) + r = int32(X__syscall3(tls, int32(SYS_readlink), int32(bp+1), int32(bp), int32(Int32FromInt32(1)))) if r == -int32(ENOENT) { if buf != 0 { v2 = buf @@ -140528,7 +140473,7 @@ func Xungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) { var v3 bool var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3, v4, v5, p6 - ploc = ___get_tp(tls) + 88 + ploc = uintptr(___get_tp(tls)) + 88 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+76) >= 0 { v1 = ___lockfile(tls, f) @@ -140803,7 +140748,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(uint32(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -140992,7 +140937,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -141055,7 +141000,7 @@ _4: v14 = s s++ *(*uint8)(unsafe.Pointer(v14)) = Uint8FromInt32(Int32FromUint8(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int32(s)-t__predefined_ptrdiff_t(bp+516) == int32(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -141108,7 +141053,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -142978,7 +142923,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(uint32(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -144555,7 +144500,7 @@ func Xatol(tls *TLS, s uintptr) (r int32) { for BoolInt32(uint32(*(*uint8)(unsafe.Pointer(s)))-uint32('0') < uint32(10)) != 0 { v4 = s s++ - n = int32(10)*n - (Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) - Int32FromUint8('0')) + n = int32(10)*n - int32(Int32FromUint8(*(*uint8)(unsafe.Pointer(v4)))-Int32FromUint8('0')) } if neg != 0 { v5 = n @@ -144607,9 +144552,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -144617,7 +144564,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint32(0) { try = base + uintptr(width*(nel/uint32(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint32(2) } else { @@ -144808,7 +144755,7 @@ func _pntz(tls *TLS, p uintptr) (r1 int32) { var v11, v4 Tuint32_t var v14 bool _, _, _, _, _, _, _, _, _, _, _ = r, v1, v11, v12, v14, v2, v4, v5, v7, v8, v9 - v1 = *(*Tsize_t)(unsafe.Pointer(p)) - Uint32FromInt32(1) + v1 = uint32(*(*Tsize_t)(unsafe.Pointer(p)) - Uint32FromInt32(1)) v4 = v1 v5 = int32(31) - _a_clz_32(tls, v4&-v4) goto _6 @@ -144896,7 +144843,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*4)) >>= Uint32FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(240) defer tls.Free(240) var i, v1, v2 int32 @@ -144908,10 +144855,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*4))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[57]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[57]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -144928,7 +144875,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(240) defer tls.Free(240) var i, trail, v1 int32 @@ -144942,13 +144889,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[57]uintptr)(unsafe.Pointer(bp + 8)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint32(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*4))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[57]uintptr)(unsafe.Pointer(bp + 8)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[57]uintptr)(unsafe.Pointer(bp + 8)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*4))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -144963,13 +144910,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+8, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(208) defer tls.Free(208) @@ -145007,14 +144956,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 192)))[0]&uint32(3) == uint32(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+192, int32(2)) pshift += int32(2) } else { if (*(*[48]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint32FromInt32(int32(high)-int32(head)) { - _trinkle(tls, head, width, cmp, arg, bp+192, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+192, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+192, int32(1)) @@ -145027,7 +144976,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 192)) |= uint32(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+192, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+192, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 192)))[0] != uint32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 192)))[int32(1)] != uint32(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+192) @@ -145038,31 +144987,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 192)) ^= uint32(7) _shr(tls, bp+192, int32(1)) - _trinkle(tls, head-uintptr((*(*[48]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+192, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[48]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+192, pshift+int32(1), int32(1), bp) _shl(tls, bp+192, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 192)) |= uint32(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+192, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+192, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -148486,7 +148439,7 @@ func Xtcdrain(tls *TLS, fd int32) (r int32) { trc("tls=%v fd=%v, (%v:)", tls, fd, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ioctl), fd, Int32FromInt32(TCSBRK), Int32FromInt32(1), 0, 0, 0))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TCSBRK)), int32(Int32FromInt32(1)), 0, 0, 0))) } func Xtcflow(tls *TLS, fd int32, action int32) (r int32) { @@ -148541,7 +148494,7 @@ func Xtcgetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) { trc("tls=%v fd=%v wsz=%v, (%v:)", tls, fd, wsz, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCGWINSZ), int32(wsz)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCGWINSZ)), int32(wsz)))) } func Xtcsendbreak(tls *TLS, fd int32, dur int32) (r int32) { @@ -148574,7 +148527,7 @@ func Xtcsetwinsize(tls *TLS, fd int32, wsz uintptr) (r int32) { trc("tls=%v fd=%v wsz=%v, (%v:)", tls, fd, wsz, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCSWINSZ), int32(wsz)))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCSWINSZ)), int32(wsz)))) } func X__map_file(tls *TLS, pathname uintptr, size uintptr) (r uintptr) { @@ -148589,7 +148542,7 @@ func X__map_file(tls *TLS, pathname uintptr, size uintptr) (r uintptr) { var _ /* st at bp+0 */ Tstat _, _, _ = fd, map1, v1 map1 = uintptr(-Int32FromInt32(1)) - fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(pathname), Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_NONBLOCK)|Int32FromInt32(O_LARGEFILE)))) + fd = X__syscall_ret(tls, Uint32FromInt32(X__syscall2(tls, int32(SYS_open), int32(pathname), int32(Int32FromInt32(O_RDONLY)|Int32FromInt32(O_CLOEXEC)|Int32FromInt32(O_NONBLOCK)|Int32FromInt32(O_LARGEFILE))))) if fd < 0 { return uintptr(0) } @@ -149314,10 +149267,10 @@ func X__secs_to_zone(tls *TLS, t int64, local int32, isdst uintptr, offset uintp i = _scan_trans(tls, t, local, bp) if i != Uint32FromInt32(-Int32FromInt32(1)) { *(*int32)(unsafe.Pointer(isdst)) = Int32FromUint8(*(*uint8)(unsafe.Pointer(_types + uintptr(uint32(6)*i+uint32(4))))) - *(*int32)(unsafe.Pointer(offset)) = Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)*i))) + *(*int32)(unsafe.Pointer(offset)) = int32(Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)*i)))) *(*uintptr)(unsafe.Pointer(zonename)) = _abbrevs + uintptr(*(*uint8)(unsafe.Pointer(_types + uintptr(uint32(6)*i+uint32(5))))) if oppoff != 0 { - *(*int32)(unsafe.Pointer(oppoff)) = Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)**(*Tsize_t)(unsafe.Pointer(bp))))) + *(*int32)(unsafe.Pointer(oppoff)) = int32(Int32FromUint32(_zi_read32(tls, _types+uintptr(uint32(6)**(*Tsize_t)(unsafe.Pointer(bp)))))) } ___unlock(tls, uintptr(unsafe.Pointer(&_lock4))) return @@ -149542,7 +149495,7 @@ func Xclock_getcpuclockid(tls *TLS, pid Tpid_t, clk uintptr) (r int32) { var _ /* ts at bp+0 */ Ttimespec _, _ = id, ret id = Int32FromUint32(Uint32FromInt32(-pid-Int32FromInt32(1))*uint32(8) + uint32(2)) - ret = X__syscall2(tls, int32(SYS_clock_getres_time32), id, int32(bp)) + ret = int32(X__syscall2(tls, int32(SYS_clock_getres_time32), id, int32(bp))) if ret == -int32(EINVAL) { ret = -int32(ESRCH) } @@ -149565,7 +149518,7 @@ func Xclock_getres(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { _ = r /* On a 32-bit arch, use the old syscall if it exists. */ if int32(SYS_clock_getres_time32) != int32(SYS_clock_getres_time64) { - r = X__syscall2(tls, int32(SYS_clock_getres_time32), clk, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_clock_getres_time32), clk, int32(bp))) if !(r != 0) && ts != 0 { (*Ttimespec)(unsafe.Pointer(ts)).Ftv_sec = int64((*(*[2]int32)(unsafe.Pointer(bp)))[0]) (*Ttimespec)(unsafe.Pointer(ts)).Ftv_nsec = (*(*[2]int32)(unsafe.Pointer(bp)))[int32(1)] @@ -149589,14 +149542,14 @@ func X__clock_gettime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { _ = r r = -int32(ENOSYS) if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_clock_gettime64), clk, int32(ts)) + r = int32(X__syscall2(tls, int32(SYS_clock_gettime64), clk, int32(ts))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, int32(SYS_clock_gettime32), clk, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_clock_gettime32), clk, int32(bp))) if r == -int32(ENOSYS) && clk == CLOCK_REALTIME { - r = X__syscall2(tls, int32(SYS_gettimeofday_time32), int32(bp), Int32FromInt32(0)) + r = int32(X__syscall2(tls, int32(SYS_gettimeofday_time32), int32(bp), int32(Int32FromInt32(0)))) *(*int32)(unsafe.Pointer(bp + 1*4)) *= int32(1000) } if !(r != 0) { @@ -149639,7 +149592,7 @@ func X__clock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem 0: s, 1: int64(ns), } - r = ___syscall_cp(tls, int32(SYS_clock_nanosleep_time64), clk, flags, int32(bp), int32(rem), 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_clock_nanosleep_time64), clk, flags, int32(bp), int32(rem), 0, 0)) } if Bool(false) || r != -int32(ENOSYS) { return -r @@ -149656,13 +149609,13 @@ func X__clock_nanosleep(tls *TLS, clk Tclockid_t, flags int32, req uintptr, rem v2 = uint64(0x7fffffff) + (0+Uint64FromInt64(s))>>int32(63) } *(*[2]int32)(unsafe.Pointer(bp + 16)) = [2]int32{ - 0: Int32FromUint64(v2), + 0: int32(Int32FromUint64(v2)), 1: ns, } if clk == CLOCK_REALTIME && !(flags != 0) { - r = ___syscall_cp(tls, int32(SYS_nanosleep), int32(bp+16), int32(bp+16), 0, 0, 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_nanosleep), int32(bp+16), int32(bp+16), 0, 0, 0, 0)) } else { - r = ___syscall_cp(tls, int32(SYS_clock_nanosleep_time32), clk, flags, int32(bp+16), int32(bp+16), 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_clock_nanosleep_time32), clk, flags, int32(bp+16), int32(bp+16), 0, 0)) } if r == -int32(EINTR) && rem != 0 && !(flags&Int32FromInt32(TIMER_ABSTIME) != 0) { (*Ttimespec)(unsafe.Pointer(rem)).Ftv_sec = int64((*(*[2]int32)(unsafe.Pointer(bp + 16)))[0]) + extra @@ -149697,7 +149650,7 @@ func Xclock_settime(tls *TLS, clk Tclockid_t, ts uintptr) (r1 int32) { 0: s, 1: int64(ns), } - r = X__syscall2(tls, int32(SYS_clock_settime64), clk, int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_clock_settime64), clk, int32(bp))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -150439,7 +150392,7 @@ func Xstrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t trc("tls=%v s=%v n=%v f=%v tm=%v, (%v:)", tls, s, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -150939,10 +150892,10 @@ func Xtimer_delete(tls *TLS, t Ttimer_t) (r int32) { _a_barrier(tls) AtomicStorePInt32(td+84, AtomicLoadPInt32(td+84)|(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff))) _a_barrier(tls) - X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(td)).Ftid, Int32FromInt32(SIGTIMER)) + X__syscall2(tls, int32(SYS_tkill), (*t__pthread)(unsafe.Pointer(td)).Ftid, int32(Int32FromInt32(SIGTIMER))) return 0 } - return X__syscall1(tls, int32(SYS_timer_delete), int32(t)) + return int32(X__syscall1(tls, int32(SYS_timer_delete), int32(t))) } func Xtimer_getoverrun(tls *TLS, t Ttimer_t) (r int32) { @@ -150976,12 +150929,12 @@ func Xtimer_gettime(tls *TLS, t Ttimer_t, val uintptr) (r1 int32) { } r = -int32(ENOSYS) if uint32(8) > uint32(4) { - r = X__syscall2(tls, int32(SYS_timer_gettime64), int32(t), int32(val)) + r = int32(X__syscall2(tls, int32(SYS_timer_gettime64), int32(t), int32(val))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) } - r = X__syscall2(tls, int32(SYS_timer_gettime32), int32(t), int32(bp)) + r = int32(X__syscall2(tls, int32(SYS_timer_gettime32), int32(t), int32(bp))) if !(r != 0) { (*Titimerspec)(unsafe.Pointer(val)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp)))[0]) (*Titimerspec)(unsafe.Pointer(val)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp)))[int32(1)] @@ -151020,7 +150973,7 @@ func Xtimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) 2: vs, 3: int64(vns), } - r = X__syscall4(tls, int32(SYS_timer_settime64), int32(t), flags, int32(bp), int32(old)) + r = int32(X__syscall4(tls, int32(SYS_timer_settime64), int32(t), flags, int32(bp), int32(old))) } if Bool(false) || r != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(r)) @@ -151034,7 +150987,7 @@ func Xtimer_settime(tls *TLS, t Ttimer_t, flags int32, val uintptr, old uintptr) 2: int32(vs), 3: vns, } - r = X__syscall4(tls, int32(SYS_timer_settime32), int32(t), flags, int32(bp+32), int32(bp+48)) + r = int32(X__syscall4(tls, int32(SYS_timer_settime32), int32(t), flags, int32(bp+32), int32(bp+48))) if !(r != 0) && old != 0 { (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_sec = int64((*(*[4]int32)(unsafe.Pointer(bp + 48)))[0]) (*Titimerspec)(unsafe.Pointer(old)).Fit_interval.Ftv_nsec = (*(*[4]int32)(unsafe.Pointer(bp + 48)))[int32(1)] @@ -151240,7 +151193,7 @@ func Xwcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize trc("tls=%v wcs=%v n=%v f=%v tm=%v, (%v:)", tls, wcs, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xwcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151321,7 +151274,7 @@ func Xclose(tls *TLS, fd int32) (r1 int32) { var r int32 _ = r fd = _dummy12(tls, fd) - r = ___syscall_cp(tls, int32(SYS_close), fd, 0, 0, 0, 0, 0) + r = int32(___syscall_cp(tls, int32(SYS_close), fd, 0, 0, 0, 0, 0)) if r == -int32(EINTR) { r = 0 } @@ -151359,7 +151312,7 @@ func Xdup2(tls *TLS, old int32, new1 int32) (r1 int32) { var r, v1 int32 _, _ = r, v1 for { - v1 = X__syscall2(tls, int32(SYS_dup2), old, new1) + v1 = int32(X__syscall2(tls, int32(SYS_dup2), old, new1)) r = v1 if !(v1 == -int32(EBUSY)) { break @@ -151380,7 +151333,7 @@ func X__dup3(tls *TLS, old int32, new1 int32, flags int32) (r1 int32) { } if flags != 0 { for { - v1 = X__syscall3(tls, int32(SYS_dup3), old, new1, flags) + v1 = int32(X__syscall3(tls, int32(SYS_dup3), old, new1, flags)) r = v1 if !(v1 == -int32(EBUSY)) { break @@ -151394,14 +151347,14 @@ func X__dup3(tls *TLS, old int32, new1 int32, flags int32) (r1 int32) { } } for { - v2 = X__syscall2(tls, int32(SYS_dup2), old, new1) + v2 = int32(X__syscall2(tls, int32(SYS_dup2), old, new1)) r = v2 if !(v2 == -int32(EBUSY)) { break } } if r >= 0 && flags&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), new1, Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), new1, int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } return X__syscall_ret(tls, Uint32FromInt32(r)) } @@ -151428,10 +151381,10 @@ func _checker(tls *TLS, p uintptr) (r int32) { var _ /* ret at bp+0 */ int32 _ = c c = p - if X__syscall2(tls, int32(SYS_setregid32), X__syscall0(tls, int32(SYS_getegid32)), -Int32FromInt32(1)) != 0 || X__syscall2(tls, int32(SYS_setreuid32), X__syscall0(tls, int32(SYS_geteuid32)), -Int32FromInt32(1)) != 0 { - X__syscall1(tls, int32(SYS_exit), Int32FromInt32(1)) + if X__syscall2(tls, int32(SYS_setregid32), X__syscall0(tls, int32(SYS_getegid32)), int32(-Int32FromInt32(1))) != 0 || X__syscall2(tls, int32(SYS_setreuid32), X__syscall0(tls, int32(SYS_geteuid32)), int32(-Int32FromInt32(1))) != 0 { + X__syscall1(tls, int32(SYS_exit), int32(Int32FromInt32(1))) } - *(*int32)(unsafe.Pointer(bp)) = X__syscall4(tls, int32(SYS_faccessat), (*Tctx1)(unsafe.Pointer(c)).Ffd, int32((*Tctx1)(unsafe.Pointer(c)).Ffilename), (*Tctx1)(unsafe.Pointer(c)).Famode, Int32FromInt32(0)) + *(*int32)(unsafe.Pointer(bp)) = int32(X__syscall4(tls, int32(SYS_faccessat), (*Tctx1)(unsafe.Pointer(c)).Ffd, int32((*Tctx1)(unsafe.Pointer(c)).Ffilename), (*Tctx1)(unsafe.Pointer(c)).Famode, int32(Int32FromInt32(0)))) X__syscall3(tls, int32(SYS_write), (*Tctx1)(unsafe.Pointer(c)).Fp, int32(bp), Int32FromUint32(Uint32FromInt64(4))) return 0 } @@ -151444,7 +151397,7 @@ func Xfaccessat(tls *TLS, fd int32, filename uintptr, amode int32, flag int32) ( var ret int32 _ = ret if flag != 0 { - ret = X__syscall4(tls, int32(SYS_faccessat2), fd, int32(filename), amode, flag) + ret = int32(X__syscall4(tls, int32(SYS_faccessat2), fd, int32(filename), amode, flag)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -151465,8 +151418,8 @@ func Xfchdir(tls *TLS, fd int32) (r int32) { var ret int32 var _ /* buf at bp+0 */ [27]uint8 _ = ret - ret = X__syscall1(tls, int32(SYS_fchdir), fd) - if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) < 0 { + ret = int32(X__syscall1(tls, int32(SYS_fchdir), fd)) + if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) < 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) } X__procfdname(tls, bp, Uint32FromInt32(fd)) @@ -151483,8 +151436,8 @@ func Xfchown(tls *TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { var ret int32 var _ /* buf at bp+0 */ [27]uint8 _ = ret - ret = X__syscall3(tls, int32(SYS_fchown32), fd, Int32FromUint32(uid), Int32FromUint32(gid)) - if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, Int32FromInt32(F_GETFD)) < 0 { + ret = int32(X__syscall3(tls, int32(SYS_fchown32), fd, Int32FromUint32(uid), Int32FromUint32(gid))) + if ret != -int32(EBADF) || X__syscall2(tls, int32(SYS_fcntl64), fd, int32(Int32FromInt32(F_GETFD))) < 0 { return X__syscall_ret(tls, Uint32FromInt32(ret)) } X__procfdname(tls, bp, Uint32FromInt32(fd)) @@ -151520,7 +151473,7 @@ func Xftruncate(tls *TLS, fd int32, length Toff_t) (r int32) { trc("tls=%v fd=%v length=%v, (%v:)", tls, fd, length, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_ftruncate64), fd, Int32FromInt32(0), int32(length), int32(length>>Int32FromInt32(32))))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_ftruncate64), fd, int32(Int32FromInt32(0)), int32(length), int32(length>>Int32FromInt32(32))))) } func Xgetcwd(tls *TLS, buf uintptr, size Tsize_t) (r uintptr) { @@ -151674,7 +151627,7 @@ func Xgetpgrp(tls *TLS) (r Tpid_t) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall1(tls, int32(SYS_getpgid), Int32FromInt32(0)) + return int32(X__syscall1(tls, int32(SYS_getpgid), int32(Int32FromInt32(0)))) } func Xgetpid(tls *TLS) (r Tpid_t) { @@ -151682,7 +151635,7 @@ func Xgetpid(tls *TLS) (r Tpid_t) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall0(tls, int32(SYS_getpid)) + return int32(X__syscall0(tls, int32(SYS_getpid))) } func Xgetppid(tls *TLS) (r Tpid_t) { @@ -151690,7 +151643,7 @@ func Xgetppid(tls *TLS) (r Tpid_t) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall0(tls, int32(SYS_getppid)) + return int32(X__syscall0(tls, int32(SYS_getppid))) } func Xgetsid(tls *TLS, pid Tpid_t) (r Tpid_t) { @@ -151719,7 +151672,7 @@ func Xisatty(tls *TLS, fd int32) (r1 int32) { var r uint32 var _ /* wsz at bp+0 */ Twinsize _ = r - r = Uint32FromInt32(X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, Int32FromInt32(TIOCGWINSZ), int32(bp))))) + r = Uint32FromInt32(X__syscall_ret(tls, Uint32FromInt32(X__syscall3(tls, int32(SYS_ioctl), fd, int32(Int32FromInt32(TIOCGWINSZ)), int32(bp))))) if r == uint32(0) { return int32(1) } @@ -151835,7 +151788,7 @@ func Xpipe2(tls *TLS, fd uintptr, flag int32) (r int32) { if !(flag != 0) { return Xpipe(tls, fd) } - ret = X__syscall2(tls, int32(SYS_pipe2), int32(fd), flag) + ret = int32(X__syscall2(tls, int32(SYS_pipe2), int32(fd), flag)) if ret != -int32(ENOSYS) { return X__syscall_ret(tls, Uint32FromInt32(ret)) } @@ -151847,12 +151800,12 @@ func Xpipe2(tls *TLS, fd uintptr, flag int32) (r int32) { return ret } if flag&int32(O_CLOEXEC) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFD), Int32FromInt32(FD_CLOEXEC)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFD)), int32(Int32FromInt32(FD_CLOEXEC))) } if flag&int32(O_NONBLOCK) != 0 { - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) - X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), Int32FromInt32(F_SETFL), Int32FromInt32(O_NONBLOCK)) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) + X__syscall3(tls, int32(SYS_fcntl64), *(*int32)(unsafe.Pointer(fd + 1*4)), int32(Int32FromInt32(F_SETFL)), int32(Int32FromInt32(O_NONBLOCK))) } return 0 } @@ -151870,7 +151823,7 @@ func Xpread(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssize trc("tls=%v fd=%v buf=%v size=%v ofs=%v, (%v:)", tls, fd, buf, size, ofs, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_pread64), fd, int32(buf), Int32FromUint32(size), Int32FromInt32(0), int32(ofs), int32(ofs>>Int32FromInt32(32))))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_pread64), fd, int32(buf), Int32FromUint32(size), int32(Int32FromInt32(0)), int32(ofs), int32(ofs>>Int32FromInt32(32))))) } func Xpreadv(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) { @@ -151886,7 +151839,7 @@ func Xpwrite(tls *TLS, fd int32, buf uintptr, size Tsize_t, ofs Toff_t) (r Tssiz trc("tls=%v fd=%v buf=%v size=%v ofs=%v, (%v:)", tls, fd, buf, size, ofs, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_pwrite64), fd, int32(buf), Int32FromUint32(size), Int32FromInt32(0), int32(ofs), int32(ofs>>Int32FromInt32(32))))) + return X__syscall_ret(tls, Uint32FromInt32(___syscall_cp(tls, int32(SYS_pwrite64), fd, int32(buf), Int32FromUint32(size), int32(Int32FromInt32(0)), int32(ofs), int32(ofs>>Int32FromInt32(32))))) } func Xpwritev(tls *TLS, fd int32, iov uintptr, count int32, ofs Toff_t) (r Tssize_t) { @@ -151919,7 +151872,7 @@ func Xreadlink(tls *TLS, path uintptr, buf uintptr, bufsize Tsize_t) (r1 Tssize_ buf = bp bufsize = uint32(1) } - r = X__syscall3(tls, int32(SYS_readlink), int32(path), int32(buf), Int32FromUint32(bufsize)) + r = int32(X__syscall3(tls, int32(SYS_readlink), int32(path), int32(buf), Int32FromUint32(bufsize))) if buf == bp && r > 0 { r = 0 } @@ -151940,7 +151893,7 @@ func Xreadlinkat(tls *TLS, fd int32, path uintptr, buf uintptr, bufsize Tsize_t) buf = bp bufsize = uint32(1) } - r = X__syscall4(tls, int32(SYS_readlinkat), fd, int32(path), int32(buf), Int32FromUint32(bufsize)) + r = int32(X__syscall4(tls, int32(SYS_readlinkat), fd, int32(path), int32(buf), Int32FromUint32(bufsize))) if buf == bp && r > 0 { r = 0 } @@ -152027,14 +151980,14 @@ func _do_setxid(tls *TLS, p uintptr) { if (*Tctx2)(unsafe.Pointer(c)).Fret < 0 { return } - ret = X__syscall3(tls, (*Tctx2)(unsafe.Pointer(c)).Fnr, (*Tctx2)(unsafe.Pointer(c)).Fid, (*Tctx2)(unsafe.Pointer(c)).Feid, (*Tctx2)(unsafe.Pointer(c)).Fsid) + ret = int32(X__syscall3(tls, (*Tctx2)(unsafe.Pointer(c)).Fnr, (*Tctx2)(unsafe.Pointer(c)).Fid, (*Tctx2)(unsafe.Pointer(c)).Feid, (*Tctx2)(unsafe.Pointer(c)).Fsid)) if ret != 0 && !((*Tctx2)(unsafe.Pointer(c)).Fret != 0) { /* If one thread fails to set ids after another has already * succeeded, forcibly killing the process is the only safe * thing to do. State is inconsistent and dangerous. Use * SIGKILL because it is uncatchable. */ X__block_all_sigs(tls, uintptr(0)) - X__syscall2(tls, int32(SYS_kill), X__syscall0(tls, int32(SYS_getpid)), Int32FromInt32(SIGKILL)) + X__syscall2(tls, int32(SYS_kill), X__syscall0(tls, int32(SYS_getpid)), int32(Int32FromInt32(SIGKILL))) } (*Tctx2)(unsafe.Pointer(c)).Fret = ret } @@ -152138,7 +152091,7 @@ func Xtruncate(tls *TLS, path uintptr, length Toff_t) (r int32) { trc("tls=%v path=%v length=%v, (%v:)", tls, path, length, origin(2)) defer func() { trc("-> %v", r) }() } - return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_truncate64), int32(path), Int32FromInt32(0), int32(length), int32(length>>Int32FromInt32(32))))) + return X__syscall_ret(tls, Uint32FromInt32(X__syscall4(tls, int32(SYS_truncate64), int32(path), int32(Int32FromInt32(0)), int32(length), int32(length>>Int32FromInt32(32))))) } /* Support signed or unsigned plain-char */ @@ -153422,8 +153375,6 @@ func X__utimes_time32(tls *TLS, path uintptr, times32 uintptr) (r int32) { return Xutimes(tls, path, v1) } -type t__ucontext5 = Tucontext_t7 - func X__wait3_time32(tls *TLS, status uintptr, options int32, usage uintptr) (r1 Tpid_t) { if __ccgo_strace { trc("tls=%v status=%v options=%v usage=%v, (%v:)", tls, status, options, usage, origin(2)) @@ -153549,7 +153500,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1213,15 +1213,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1239,7 +1239,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1252,14 +1252,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1274,7 +1274,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1290,14 +1290,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1313,8 +1313,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1340,24 +1340,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1370,15 +1370,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1387,48 +1387,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1529,8 +1529,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1609,8 +1609,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1945,18 +1945,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1968,16 +1968,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1994,7 +1994,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -2029,7 +2029,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -2047,14 +2047,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2070,8 +2070,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2103,18 +2103,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2126,16 +2126,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2143,7 +2143,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2165,27 +2165,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2313,16 +2313,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2429,16 +2429,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2541,7 +2541,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2558,7 +2558,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)< %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -24865,7 +24869,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -24903,8 +24907,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint64(8), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint64(8), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint64(cnt) @@ -24948,7 +24952,7 @@ func X__reset_tls(tls *TLS) { var mem, p uintptr var self Tpthread_t _, _, _, _, _ = i, mem, n, p, self - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) n = *(*Tuintptr_t)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(self)).Fdtv)) if n != 0 { p = X__libc.Ftls_head @@ -24984,7 +24988,7 @@ func X__init_ssp(tls *TLS, entropy uintptr) { * still be detected. Endianness is taken care of * automatically. */ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__stack_chk_guard)) + 1)) = uint8(0) - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fcanary = X__stack_chk_guard + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fcanary = X__stack_chk_guard } func X__stack_chk_fail(tls *TLS) { @@ -25593,7 +25597,7 @@ func Xstrerror(tls *TLS, e int32) (r uintptr) { trc("tls=%v e=%v, (%v:)", tls, e, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) { @@ -25650,9 +25654,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25664,7 +25670,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -26219,19 +26225,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26255,14 +26261,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26416,7 +26422,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26442,16 +26448,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26593,10 +26599,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26632,7 +26638,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26661,15 +26667,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26694,7 +26700,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -28116,15 +28122,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28246,7 +28254,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)< %v", r) }() } - return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + 5*8))) + return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale + 5*8))) } func _swapc(tls *TLS, x Tuint32_t, c int32) (r Tuint32_t) { @@ -31654,7 +31654,7 @@ func Xdcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n var _ /* z at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = alt_modlen, catlen, catname, csp, dirlen, dirname, domlen, l, lm, loc, loclen, locname, locp, map1, modlen, modname, name, np, old, old_cats, old_errno, p3, plural, q, r, r1, rem, rule, trans, v, v10, v11, v12, v14, v15, v17, v18, v21, v23, v26, v3, v5, v6, v8, v9 defer func() { Xrealloc(tls, name, 0) }() - loc = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + loc = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale old_errno = *(*int32)(unsafe.Pointer(X__errno_location(tls))) /* match gnu gettext behaviour */ if !(msgid1 != 0) { @@ -98326,7 +98326,7 @@ func Xiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb ui *(*Tmbstate_t)(unsafe.Pointer(bp + 24)) = Tmbstate_t{} type1 = *(*uint8)(unsafe.Pointer(map1 + uintptr(-Int32FromInt32(1)))) totype = *(*uint8)(unsafe.Pointer(tomap + uintptr(-Int32FromInt32(1)))) - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if !(in != 0) || !(*(*uintptr)(unsafe.Pointer(in)) != 0) || !(*(*Tsize_t)(unsafe.Pointer(inb)) != 0) { return uint64(0) @@ -99360,7 +99360,7 @@ func X__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { trc("tls=%v item=%v, (%v:)", tls, item, origin(2)) defer func() { trc("-> %v", r) }() } - return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xnl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { @@ -100078,7 +100078,7 @@ func Xstrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) { @@ -100244,7 +100244,7 @@ func Xstrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize var ret Tssize_t _, _ = ap, ret ap = va - ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale, fmt, ap) + ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale, fmt, ap) _ = ap return ret } @@ -100319,7 +100319,7 @@ func Xstrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100408,7 +100408,7 @@ func X__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) { var global, old, v1, v2 Tlocale_t var self Tpthread_t _, _, _, _, _ = global, old, self, v1, v2 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) old = (*t__pthread)(unsafe.Pointer(self)).Flocale global = uintptr(unsafe.Pointer(&X__libc)) + 56 if new1 != 0 { @@ -100451,7 +100451,7 @@ func Xwcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100492,7 +100492,7 @@ func Xwcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100536,12 +100536,12 @@ func X__cos(tls *TLS, x float64, y float64) (r1 float64) { } var hz, r, w, z Tdouble_t _, _, _, _ = hz, r, w, z - z = x * x - w = z * z - r = z*(_C1+z*(_C2+z*_C3)) + w*w*(_C4+z*(_C5+z*_C6)) - hz = float64(0.5) * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = Tdouble_t(z*(_C1+float64(z*(_C2+float64(z*_C3))))) + Tdouble_t(Tdouble_t(w*w)*(_C4+float64(z*(_C5+float64(z*_C6))))) + hz = Tdouble_t(float64(0.5) * z) w = float64(1) - hz - return w + (Float64FromFloat64(1) - w - hz + (z*r - x*y)) + return w + (Float64FromFloat64(1) - w - hz + (Tdouble_t(z*r) - Tdouble_t(x*y))) } // C documentation @@ -100561,10 +100561,10 @@ func X__cosdf(tls *TLS, x float64) (r1 float32) { var r, w, z Tdouble_t _, _, _ = r, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _C21 + z*_C31 - return float32(float64(1) + z*_C0 + w*_C11 + w*z*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _C21 + float64(z*_C31) + return float32(float64(1) + float64(z*_C0) + float64(w*_C11) + float64(Tdouble_t(w*z)*r)) } // C documentation @@ -100589,7 +100589,7 @@ func X__expo2(tls *TLS, x float64, sign float64) (r float64) { scale = *(*float64)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexp(tls, x-_kln22) * (sign * scale) * scale + return float64(float64(Xexp(tls, x-_kln22)*float64(sign*scale)) * scale) } // C documentation @@ -100614,7 +100614,7 @@ func X__expo2f(tls *TLS, x float32, sign float32) (r float32) { scale = *(*float32)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexpf(tls, x-_kln23) * (sign * scale) * scale + return float32(float32(Xexpf(tls, x-_kln23)*float32(sign*scale)) * scale) } func X__fpclassify(tls *TLS, x float64) (r int32) { @@ -100812,7 +100812,7 @@ func X__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float64(v2 * y2) v4 = y goto _5 _5: @@ -100835,7 +100835,7 @@ func X__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float32(v2 * y2) v4 = y goto _5 _5: @@ -100916,14 +100916,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { } } else { if !(sign != 0) { - z = x - Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(2)*_pio2_1t + z = x - float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(2)*_pio2_1t) return int32(2) } else { - z = x + Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(2)*_pio2_1t + z = x + float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(2)*_pio2_1t) return -int32(2) } } @@ -100934,14 +100934,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(3)*_pio2_1t + z = x - float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(3)*_pio2_1t) return int32(3) } else { - z = x + Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(3)*_pio2_1t + z = x + float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(3)*_pio2_1t) return -int32(3) } } else { @@ -100949,14 +100949,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(4)*_pio2_1t + z = x - float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(4)*_pio2_1t) return int32(4) } else { - z = x + Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(4)*_pio2_1t + z = x + float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(4)*_pio2_1t) return -int32(4) } } @@ -100968,22 +100968,22 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { medium: ; /* rint(x/(pi/2)) */ - fn = x*_invpio2 + _toint - _toint + fn = Tdouble_t(x*_invpio2) + _toint - _toint n = int32(fn) - r = x - fn*_pio2_1 - w = fn * _pio2_1t /* 1st round, good to 85 bits */ + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) /* 1st round, good to 85 bits */ /* Matters with directed rounding. */ if r-w < -_pio4 { n-- fn-- - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } else { if r-w > _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -100992,17 +100992,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -101030,7 +101030,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07)) goto _3 _3: ; @@ -101210,7 +101210,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101234,8 +101234,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101244,8 +101244,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101338,7 +101338,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101365,8 +101365,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101381,7 +101381,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101400,7 +101400,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -101591,19 +101591,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + _toint1 - _toint1 n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -101700,14 +101700,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + float64(z*(_S3+float64(z*_S4))) + float64(Tdouble_t(z*w)*(_S5+float64(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + float64(v*(_S1+float64(z*r))) } else { - return x - (z*(Float64FromFloat64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(float64(Float64FromFloat64(0.5)*y)-float64(v*r))) - y - Tdouble_t(v*_S1)) } return r1 } @@ -101729,11 +101729,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S31 + float64(z*_S41) + s = Tdouble_t(z * x) + return float32(x + float64(s*(_S11+float64(z*_S21))) + float64(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -101776,21 +101776,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + float64(w*(_T[int32(3)]+float64(w*(_T[int32(5)]+float64(w*(_T[int32(7)]+float64(w*(_T[int32(9)]+float64(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + float64(w*(_T[int32(4)]+float64(w*(_T[int32(6)]+float64(w*(_T[int32(8)]+float64(w*(_T[int32(10)]+float64(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + float64(z*(Tdouble_t(s*(r+v))+y)) + float64(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - float64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(float64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -101811,7 +101811,7 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { a0 = v3 v4 = *(*Tuint64_t)(unsafe.Pointer(&a0))>>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -101912,24 +101912,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -101972,24 +101972,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -102020,11 +102020,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102058,11 +102058,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102101,8 +102101,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102122,7 +102122,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102132,21 +102132,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102165,8 +102165,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = z * (_pS03 + z*(_pS13+z*_pS23)) - q = Float32FromFloat32(1) + z*_qS13 + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = Float32FromFloat32(1) + float32(z*_qS13) return p / q } @@ -102183,7 +102183,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102192,12 +102192,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102241,11 +102241,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint64(8) == uint64(4) { @@ -102254,7 +102254,7 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } } @@ -102306,11 +102306,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint64(4) == uint64(4) { @@ -102436,7 +102436,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if ix < uint32(0x3ff30000) { /* |x| < 1.1875 */ if ix < uint32(0x3fe60000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (float64(2)*x3 - float64(1)) / (float64(2) + x3) + x3 = (float64(float64(2)*x3) - float64(1)) / (float64(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - float64(1)) / (x3 + float64(1)) @@ -102444,7 +102444,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } else { if ix < uint32(0x40038000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - float64(1.5)) / (float64(1) + float64(1.5)*x3) + x3 = (x3 - float64(1.5)) / (float64(1) + float64(float64(1.5)*x3)) } else { /* 2.4375 <= |x| < 2^66 */ id = int32(3) x3 = -Float64FromFloat64(1) / x3 @@ -102452,15 +102452,15 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tdouble_t(x3 * x3) + w = Tdouble_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT[0] + w*(_aT[int32(2)]+w*(_aT[int32(4)]+w*(_aT[int32(6)]+w*(_aT[int32(8)]+w*_aT[int32(10)]))))) - s2 = w * (_aT[int32(1)] + w*(_aT[int32(3)]+w*(_aT[int32(5)]+w*(_aT[int32(7)]+w*_aT[int32(9)])))) + s1 = Tdouble_t(z * (_aT[0] + float64(w*(_aT[int32(2)]+float64(w*(_aT[int32(4)]+float64(w*(_aT[int32(6)]+float64(w*(_aT[int32(8)]+float64(w*_aT[int32(10)]))))))))))) + s2 = Tdouble_t(w * (_aT[int32(1)] + float64(w*(_aT[int32(3)]+float64(w*(_aT[int32(5)]+float64(w*(_aT[int32(7)]+float64(w*_aT[int32(9)]))))))))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float64(x3*(s1+s2)) } - z = _atanhi[id] - (x3*(s1+s2) - _atanlo[id] - x3) + z = _atanhi[id] - (float64(x3*(s1+s2)) - _atanlo[id] - x3) if sign != 0 { v4 = -z } else { @@ -102546,9 +102546,9 @@ _2: case uint32(1): return -_pi / Float64FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float64FromInt32(3) * _pi / Float64FromInt32(4) /* atan(+INF,-INF) */ + return float64(Float64FromInt32(3)*_pi) / Float64FromInt32(4) /* atan(+INF,-INF) */ case uint32(3): - return float64(-Int32FromInt32(3)) * _pi / Float64FromInt32(4) /* atan(-INF,-INF) */ + return float64(float64(-Int32FromInt32(3))*_pi) / Float64FromInt32(4) /* atan(-INF,-INF) */ } } else { switch m { @@ -102663,9 +102663,9 @@ _2: case uint32(1): return -_pi1 / Float32FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float32FromInt32(3) * _pi1 / Float32FromInt32(4) /*atan(+INF,-INF)*/ + return float32(Float32FromInt32(3)*_pi1) / Float32FromInt32(4) /*atan(+INF,-INF)*/ case uint32(3): - return float32(-Int32FromInt32(3)) * _pi1 / Float32FromInt32(4) /*atan(-INF,-INF)*/ + return float32(float32(-Int32FromInt32(3))*_pi1) / Float32FromInt32(4) /*atan(-INF,-INF)*/ } } else { switch m { @@ -102780,7 +102780,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x00800000) { /* raise underflow for subnormal x */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -102797,7 +102797,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x3f980000) { /* |x| < 1.1875 */ if ix < uint32(0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (Float32FromFloat32(2)*x3 - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) + x3 = (float32(Float32FromFloat32(2)*x3) - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - Float32FromFloat32(1)) / (x3 + Float32FromFloat32(1)) @@ -102805,7 +102805,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } else { if ix < uint32(0x401c0000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + Float32FromFloat32(1.5)*x3) + x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + float32(Float32FromFloat32(1.5)*x3)) } else { /* 2.4375 <= |x| < 2**26 */ id = int32(3) x3 = -Float32FromFloat32(1) / x3 @@ -102813,15 +102813,15 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tfloat_t(x3 * x3) + w = Tfloat_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT1[0] + w*(_aT1[int32(2)]+w*_aT1[int32(4)])) - s2 = w * (_aT1[int32(1)] + w*_aT1[int32(3)]) + s1 = Tfloat_t(z * (_aT1[0] + float32(w*(_aT1[int32(2)]+float32(w*_aT1[int32(4)]))))) + s2 = Tfloat_t(w * (_aT1[int32(1)] + float32(w*_aT1[int32(3)]))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float32(x3*(s1+s2)) } - z = _atanhi1[id] - (x3*(s1+s2) - _atanlo1[id] - x3) + z = _atanhi1[id] - (float32(x3*(s1+s2)) - _atanlo1[id] - x3) if sign != 0 { v4 = -z } else { @@ -102878,11 +102878,11 @@ func Xatanh(tls *TLS, x3 float64) (r float64) { } } else { /* |x| < 0.5, up to 1.7ulp error */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*y3+Float64FromInt32(2)*y3*y3/(Float64FromInt32(1)-y3)) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, Tdouble_t(Float64FromInt32(2)*y3)+Tdouble_t(Tdouble_t(Float64FromInt32(2)*y3)*y3)/(Float64FromInt32(1)-y3))) } } else { /* avoid overflow */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, float64(Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))))) } if s != 0 { v1 = -y3 @@ -102928,22 +102928,22 @@ func Xatanhf(tls *TLS, x3 float32) (r float32) { /* handle underflow */ if *(*Tuint32_t)(unsafe.Pointer(bp)) < Uint32FromInt32(Int32FromInt32(1)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -103035,7 +103035,7 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { hx = hx/uint32(3) + _B1 } p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63))) *(*Tuint64_t)(unsafe.Pointer(bp)) |= uint64(hx) << int32(32) t = *(*float64)(unsafe.Pointer(bp)) /* @@ -103048,8 +103048,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103061,14 +103061,14 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * before the final error is larger than 0.667 ulps. */ *(*float64)(unsafe.Pointer(bp)) = t - *(*Tuint64_t)(unsafe.Pointer(bp)) = (*(*Tuint64_t)(unsafe.Pointer(bp)) + Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) + *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(*(*Tuint64_t)(unsafe.Pointer(bp))+Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103106,7 +103106,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103120,14 +103120,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103313,9 +103313,9 @@ func Xcopysign(tls *TLS, x float64, y float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp + 8)) = y p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | *(*Tuint64_t)(unsafe.Pointer(bp + 8))&(Uint64FromUint64(1)<log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -103615,12 +103615,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -103715,8 +103715,8 @@ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) + P = _pa0 + float64(s*(_pa1+float64(s*(_pa2+float64(s*(_pa3+float64(s*(_pa4+float64(s*(_pa5+float64(s*_pa6))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+float64(s*(_qa2+float64(s*(_qa3+float64(s*(_qa4+float64(s*(_qa5+float64(s*_qa6))))))))))) return Float64FromInt32(1) - _erx - P/Q } @@ -103729,18 +103729,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = Float64FromInt32(1) / float64(x*x) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = float64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = _ra0 + float64(s*(_ra1+float64(s*(_ra2+float64(s*(_ra3+float64(s*(_ra4+float64(s*(_ra5+float64(s*(_ra6+float64(s*_ra7))))))))))))) + S = float64(1) + float64(s*(_sa1+float64(s*(_sa2+float64(s*(_sa3+float64(s*(_sa4+float64(s*(_sa5+float64(s*(_sa6+float64(s*(_sa7+float64(s*_sa8))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = float64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = _rb0 + float64(s*(_rb1+float64(s*(_rb2+float64(s*(_rb3+float64(s*(_rb4+float64(s*(_rb5+float64(s*_rb6))))))))))) + S = float64(1) + float64(s*(_sb1+float64(s*(_sb2+float64(s*(_sb3+float64(s*(_sb4+float64(s*(_sb5+float64(s*(_sb6+float64(s*_sb7))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = _rb01 + s*(_rb11+s*(_rb21+s*(_rb31+s*(_rb41+s*(_rb51+s*_rb61))))) - S = Float32FromFloat32(1) + s*(_sb11+s*(_sb21+s*(_sb31+s*(_sb41+s*(_sb51+s*(_sb61+s*_sb71)))))) + R = _rb01 + float32(s*(_rb11+float32(s*(_rb21+float32(s*(_rb31+float32(s*(_rb41+float32(s*(_rb51+float32(s*_rb61))))))))))) + S = Float32FromFloat32(1) + float32(s*(_sb11+float32(s*(_sb21+float32(s*(_sb31+float32(s*(_sb41+float32(s*(_sb51+float32(s*(_sb61+float32(s*_sb71))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, (z-x)*(z+x)+R/S) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32((z-x)*(z+x))+R/S)) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -103947,13 +103947,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -103988,14 +103988,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -104008,7 +104008,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -104050,9 +104050,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104201,8 +104201,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104277,10 +104277,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104340,9 +104340,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by 1. */ - sbits = sbits - Uint64FromUint64(1)< 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -104526,11 +104526,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + float64(1) if k == int32(1024) { - y3 = y3 * float64(2) * float64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } return y3 - float64(1) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -104864,10 +104864,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float32(k) - hi = x3 - t*_ln2_hi1 /* t*ln2_hi is exact here */ - lo = t * _ln2_lo1 + hi = x3 - float32(t*_ln2_hi1) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * _ln2_lo1) } x3 = hi - lo c = hi - x3 - lo @@ -104875,7 +104875,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -104890,42 +104890,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = Float32FromFloat32(0.5) * x3 - hxs = x3 * hfx - r1 = Float32FromFloat32(1) + hxs*(_Q11+hxs*_Q21) - t = Float32FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float32FromFloat32(6) - x3*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(x3 * hfx) + r1 = Float32FromFloat32(1) + float32(hxs*(_Q11+float32(hxs*_Q21))) + t = Float32FromFloat32(3) - float32(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float32FromFloat32(6) - float32(x3*t)))) if k == 0 { /* c is 0 */ - return x3 - (x3*e - hxs) + return x3 - (float32(x3*e) - hxs) } - e = x3*(e-c) - c + e = float32(x3*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return Float32FromFloat32(0.5)*(x3-e) - Float32FromFloat32(0.5) + return float32(Float32FromFloat32(0.5)*(x3-e)) - Float32FromFloat32(0.5) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { - return -Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5))) + return float32(-Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5)))) } - return Float32FromFloat32(1) + Float32FromFloat32(2)*(x3-e) + return Float32FromFloat32(1) + float32(Float32FromFloat32(2)*(x3-e)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = *(*float32)(unsafe.Pointer(bp)) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + Float32FromFloat32(1) if k == int32(128) { - y3 = y3 * Float32FromFloat32(2) * Float32FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float32FromFloat32(2)) * Float32FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return y3 - Float32FromFloat32(1) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk + y3 = Tfloat_t((x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk) } return y3 } @@ -104960,7 +104960,7 @@ func Xfabs(tls *TLS, x float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp)) = x p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) return *(*float64)(unsafe.Pointer(bp)) } @@ -105274,7 +105274,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105284,8 +105284,8 @@ func _normalize(tls *TLS, x float64) (r Tnum) { } e = v2 } - ix = ix & (Uint64FromUint64(1)<= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y + z + return float64(x1*y) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y + z + return float64(x1*y) + z } return z } @@ -105425,7 +105425,7 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { } } else { /* exact +-0 */ - return x1*y + z + return float64(x1*y) + z } } e -= d @@ -105446,8 +105446,8 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105457,11 +105457,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { i = -i } r = float64(i) - r = Float64FromInt32(2)*r - c /* remove top bit */ + r = float64(Float64FromInt32(2)*r) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r - r += tiny * tiny * (r - r) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r) + r += float64(Tdouble_t(tiny*tiny) * (r - r)) } } else { /* only round once when scaled */ @@ -105785,11 +105785,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105851,7 +105851,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105867,7 +105867,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { } /* scale result */ if ex > 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -105928,11 +105928,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -105992,7 +105992,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106051,7 +106051,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106064,9 +106064,9 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { } *(*int32)(unsafe.Pointer(e)) = ee - int32(0x3fe) p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff)) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000)) return *(*float64)(unsafe.Pointer(bp)) } @@ -106127,11 +106127,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106179,9 +106179,9 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { *(*float64)(unsafe.Pointer(bp + 8)) = y /* arrange |x| >= |y| */ p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) p2 = bp + 8 - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) if *(*Tuint64_t)(unsafe.Pointer(bp)) < *(*Tuint64_t)(unsafe.Pointer(bp + 8)) { ut = *(*struct { Fi [0]Tuint64_t @@ -106232,7 +106232,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106311,7 +106311,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return z * Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))) + return float32(z * Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -106504,8 +106504,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106514,10 +106514,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -106545,7 +106545,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106555,16 +106555,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -106610,12 +106610,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -106716,9 +106716,9 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -106824,9 +106824,9 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (-Float64FromFloat64(0.125) + r/s) / x } @@ -106848,8 +106848,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106858,10 +106858,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -106888,7 +106888,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106897,13 +106897,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -106944,12 +106944,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107049,9 +107049,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107157,9 +107157,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (-Float32FromFloat32(0.125) + r/s) / x } @@ -107186,8 +107186,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107196,13 +107196,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107232,21 +107232,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107292,10 +107292,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107395,9 +107395,9 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107502,9 +107502,9 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (float64(0.375) + r/s) / x } @@ -107522,8 +107522,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107532,13 +107532,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -107568,20 +107568,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -107623,10 +107623,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107726,9 +107726,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107833,9 +107833,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (Float32FromFloat32(0.375) + r/s) / x } @@ -107910,7 +107910,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -107921,7 +107921,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -107935,7 +107935,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -107954,16 +107954,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -107973,7 +107973,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -107989,7 +107989,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -107997,7 +107997,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108011,7 +108011,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108028,9 +108028,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108112,7 +108112,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108125,7 +108125,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108185,7 +108185,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108198,7 +108198,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108216,16 +108216,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108235,7 +108235,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108251,7 +108251,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108259,7 +108259,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108273,7 +108273,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108290,9 +108290,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108355,7 +108355,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -108472,8 +108472,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -108520,7 +108520,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -108797,7 +108797,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -108835,31 +108835,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -108883,11 +108883,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109022,17 +109022,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+float64(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * float64(1.34217728e+08) + w = Tdouble_t(r * float64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109054,9 +109054,9 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) - ix = ix - Uint64FromUint64(52)<> (Int32FromInt32(52) - Int32FromInt32(LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109136,7 +109136,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109162,12 +109162,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109257,19 +109257,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = x - Float32FromFloat32(1) s = f / (Float32FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (_Lg21 + w*_Lg41) - t2 = z * (_Lg11 + w*_Lg31) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (_Lg21 + float32(w*_Lg41))) + t2 = Tfloat_t(z * (_Lg11 + float32(w*_Lg31))) R = t2 + t1 - hfsq = Float32FromFloat32(0.5) * f * f + hfsq = Tfloat_t(float32(Float32FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = hi *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = *(*float32)(unsafe.Pointer(bp)) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float32(k) - return dk*_log10_2lo1 + (lo+hi)*_ivln10lo1 + lo*_ivln10hi1 + hi*_ivln10hi1 + dk*_log10_2hi1 + return Tfloat_t(dk*_log10_2lo1) + Tfloat_t((lo+hi)*_ivln10lo1) + Tfloat_t(lo*_ivln10hi1) + Tfloat_t(hi*_ivln10hi1) + Tfloat_t(dk*_log10_2hi1) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109371,15 +109371,15 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)<> (Int32FromInt32(52) - Int32FromInt32(LOG2_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + float64(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v10 = y goto _11 @@ -109655,7 +109655,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -109677,14 +109677,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -109746,10 +109746,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<> Int32FromInt32(12) >> e + mask = uint64(-Uint64FromUint64(1) >> Int32FromInt32(12) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&mask == uint64(0) { *(*float64)(unsafe.Pointer(iptr)) = x p3 = bp - *(*Tuint64_t)(unsafe.Pointer(p3)) = *(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p3)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63))) return *(*float64)(unsafe.Pointer(bp)) } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^mask @@ -110170,13 +110170,13 @@ _2: if *(*Tuint64_t)(unsafe.Pointer(bp + 8)) == *(*Tuint64_t)(unsafe.Pointer(bp + 16)) { return y3 } - ax = *(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) - ay = *(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + ax = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) + ay = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) if ax == uint64(0) { if ay == uint64(0) { return y3 } - *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = *(*Tuint64_t)(unsafe.Pointer(bp + 16))&(Uint64FromUint64(1)< ay || (*(*Tuint64_t)(unsafe.Pointer(bp + 8))^*(*Tuint64_t)(unsafe.Pointer(bp + 16)))&(Uint64FromUint64(1)<> (Int32FromInt32(52) - Int32FromInt32(POW_LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -110746,10 +110746,10 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } @@ -110809,15 +110809,15 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) - ix = ix - Uint64FromUint64(52)<1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111023,22 +111023,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)< 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -111263,7 +111263,7 @@ end: if sy != 0 { y = -y } - if ex == ey || ex+int32(1) == ey && (Float64FromInt32(2)*x > y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111336,7 +111336,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111611,10 +111611,10 @@ func Xround(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + _toint6 } else { - y2 = x3 + _toint6 + y2 = float64(x3 + _toint6) } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > float64(0.5) { @@ -111678,7 +111678,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3 + _toint7) } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = x3 + _toint7 - _toint7 - x3 if y3 > Float32FromFloat32(0.5) { @@ -111732,7 +111732,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -111783,7 +111783,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -111791,7 +111791,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -111874,10 +111874,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -111886,7 +111886,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -111916,10 +111916,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -111928,7 +111928,7 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32(Int32FromInt32(0x7f)+n) << int32(23) - x = y * *(*float32)(unsafe.Pointer(bp)) + x = float32(y * *(*float32)(unsafe.Pointer(bp))) return x } @@ -112110,10 +112110,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112272,10 +112272,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112420,14 +112420,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -112468,12 +112468,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -112540,7 +112540,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -112690,7 +112690,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -112823,10 +112823,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112963,18 +112963,18 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { /* note: this branch avoids raising overflow */ t = Float64FromInt32(1) - Float64FromInt32(0)/x3 } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113035,23 +113035,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -113099,12 +113099,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113200,8 +113200,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113283,7 +113283,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113307,17 +113307,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / float64(float64(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, float64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(float64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -113368,7 +113368,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if e < int32(12) { e = int32(1) } - m = -Uint64FromUint64(1) >> e + m = uint64(-Uint64FromUint64(1) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&m == uint64(0) { return x3 } @@ -113378,7 +113378,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^m @@ -113983,15 +113983,7 @@ func Xgethostid(tls *TLS) (r int64) { const optpos = 0 -type Tucontext_t3 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t1 -} - -type t__ucontext1 = Tucontext_t3 +type t__ucontext1 = Tucontext_t1 func X__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) { if __ccgo_strace { @@ -115139,7 +115131,7 @@ type Thistory = struct { Fbase int32 } -func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { +func _do_nftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { bp := tls.Alloc(176) defer tls.Free(176) var d, de, v10 uintptr @@ -115245,7 +115237,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } } if v8 = !(flags&Int32FromInt32(FTW_DEPTH) != 0); v8 { - v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+160) + v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+160) r = v7 } if v8 && v7 != 0 { @@ -115286,7 +115278,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(j))) = uint8('/') Xstrcpy(tls, path+uintptr(j)+uintptr(1), de+19) - v11 = _do_nftw(tls, path, fn, fd_limit-int32(1), flags, bp+128) + v11 = _do_nftw(tls, path, __ccgo_fp_fn, fd_limit-int32(1), flags, bp+128) r = v11 if v11 != 0 { Xclosedir(tls, d) @@ -115301,7 +115293,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(l))) = uint8(0) if v13 = flags&int32(FTW_DEPTH) != 0; v13 { - v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+160) + v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+160) r = v12 } if v13 && v12 != 0 { @@ -115310,9 +115302,11 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h return 0 } -func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 int32) { +type t__ccgo_fp__Xnftw_1 = func(*TLS, uintptr, uintptr, int32, uintptr) int32 + +func Xnftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, fn, fd_limit, flags, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, flags, origin(2)) defer func() { trc("-> %v", r1) }() } bp := tls.Alloc(4112) @@ -115332,7 +115326,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } Xmemcpy(tls, bp+4, path, l+uint64(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -116112,8 +116106,6 @@ type Tsockaddr_storage = struct { F__ss_align uint64 } -type t__ucontext2 = Tucontext_t2 - var _lock2 [1]int32 var _log_ident [32]uint8 var _log_opt int32 @@ -116551,14 +116543,6 @@ const SA = 194 const SB = 244 const bittab = 0 -type Tucontext_t4 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t -} - func Xbtowc(tls *TLS, c int32) (r Twint_t) { if __ccgo_strace { trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) @@ -116571,7 +116555,7 @@ func Xbtowc(tls *TLS, c int32) (r Twint_t) { if Uint32FromInt32(b) < uint32(128) { v1 = Uint32FromInt32(b) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -116772,7 +116756,7 @@ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolUint64(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -116943,7 +116927,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts goto resume0 } } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117171,7 +117155,7 @@ func Xmbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) { *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolInt32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117241,7 +117225,7 @@ func Xwcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) { *(*uint8)(unsafe.Pointer(s)) = uint8(wc) return uint64(1) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -117448,7 +117432,7 @@ func Xwctob(tls *TLS, c Twint_t) (r int32) { if c < uint32(128) { return Int32FromUint32(c) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118278,13 +118262,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]uint8 - Falg [1025]uint8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]uint8 Falg [1025]uint8 @@ -118292,14 +118269,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -118949,9 +118918,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -118997,7 +118968,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if int64(len1+int32(10)) > int64(r+uintptr(rlen))-int64(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -121074,10 +121045,10 @@ func X__h_errno_location(tls *TLS) (r uintptr) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - if !((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstack != 0) { + if !((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstack != 0) { return uintptr(unsafe.Pointer(&Xh_errno)) } - return ___get_tp(tls) + 144 + return uintptr(___get_tp(tls)) + 144 } func Xherror(tls *TLS, msg uintptr) { @@ -121101,18 +121072,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+1072, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - -type Tucontext_t5 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t1 -} - var _msgs1 = [84]uint8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -122900,7 +122859,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -122990,7 +122949,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -123003,9 +122962,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -123014,9 +122975,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int64(SYS_close), int64(fd)) return r @@ -127885,7 +127846,7 @@ func _fnmatch_internal(tls *TLS, pat uintptr, m Tsize_t, str uintptr, n Tsize_t, break } if v9 = uint32(*(*uint8)(unsafe.Pointer(s + uintptr(-Int32FromInt32(1))))) < uint32(128); !v9 { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v8 = int32(4) } else { v8 = int32(1) @@ -128123,7 +128084,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(128) defer tls.Free(128) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -128232,7 +128193,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -128269,7 +128230,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -128321,7 +128282,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -128332,7 +128293,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*uint8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -128444,9 +128405,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4128) @@ -128472,8 +128435,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -128492,7 +128455,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4120, bp+16, bp+4112) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, errfunc, bp+8) + error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, __ccgo_fp_errfunc, bp+8) } Xfree(tls, p) } @@ -133716,9 +133679,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133734,7 +133699,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133746,9 +133711,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return Xmemcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133764,7 +133731,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133783,9 +133750,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [97]uintptr @@ -133809,7 +133778,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -133854,9 +133823,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -133864,17 +133835,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -133888,7 +133861,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -133976,9 +133949,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [96]uintptr @@ -133998,7 +133973,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -134034,26 +134009,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -134077,8 +134054,6 @@ func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_ppoll), int64(fds), Int64FromUint64(n), int64(v1), int64(Int32FromInt32(0)), int64(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0)))) } -type t__ucontext3 = Tucontext_t5 - func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v fds=%v n=%v to=%v mask=%v, (%v:)", tls, fds, n, to, mask, origin(2)) @@ -134114,8 +134089,6 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32 return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_ppoll), int64(fds), Int64FromUint64(n), int64(v3), int64(mask), int64(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0)))) } -type t__ucontext4 = Tucontext_t4 - func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v ts=%v mask=%v, (%v:)", tls, n, rfds, wfds, efds, ts, mask, origin(2)) @@ -134156,14 +134129,6 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_pselect6), int64(n), int64(rfds), int64(wfds), int64(efds), int64(v3), int64(bp+16))))) } -type Tucontext_t6 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t -} - func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v tv=%v, (%v:)", tls, n, rfds, wfds, efds, tv, origin(2)) @@ -134350,7 +134315,7 @@ func Xraise(tls *TLS, sig int32) (r int32) { var _ /* set at bp+0 */ Tsigset_t _ = ret X__block_app_sigs(tls, bp) - ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid), int64(sig))))) + ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid), int64(sig))))) X__restore_sigs(tls, bp) return ret } @@ -134659,14 +134624,6 @@ func Xsigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) { const SST_SIZE = 8 -type Tucontext_t7 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t1 -} - func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v dest=%v left=%v right=%v, (%v:)", tls, dest, left, right, origin(2)) @@ -135144,13 +135101,13 @@ func _fstatat_statx(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r return ret } *(*Tstat)(unsafe.Pointer(st)) = Tstat{ - Fst_dev: uint64((*(*Tstatx1)(unsafe.Pointer(bp))).Fstx_dev_major)&Uint64FromUint64(0xfffff000)<= 0 { v1 = ___lockfile(tls, f) @@ -137853,7 +137810,7 @@ func X__do_orphaned_stdio_locks(tls *TLS) { } var f uintptr _ = f - f = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks + f = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks for { if !(f != 0) { break @@ -137881,7 +137838,7 @@ func X__unlist_locked_file(tls *TLS, f uintptr) { if (*TFILE)(unsafe.Pointer(f)).Fprev_locked != 0 { (*TFILE)(unsafe.Pointer((*TFILE)(unsafe.Pointer(f)).Fprev_locked)).Fnext_locked = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } else { - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } } } @@ -137909,7 +137866,7 @@ func Xftrylockfile(tls *TLS, f uintptr) (r1 int32) { var v10 bool var v2 uintptr _, _, _, _, _, _, _, _, _, _, _, _ = old, owner, r, self, tid, v, v1, v10, v2, v3, v6, v8 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) tid = (*t__pthread)(unsafe.Pointer(self)).Ftid owner = AtomicLoadPInt32(f + 140) if owner & ^Int32FromInt32(MAYBE_WAITERS) == tid { @@ -137991,7 +137948,7 @@ func Xfwide(tls *TLS, f uintptr, mode int32) (r int32) { __need_unlock = v1 if mode != 0 { if !((*TFILE)(unsafe.Pointer(f)).Flocale != 0) { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -138228,7 +138185,7 @@ func Xgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -138383,7 +138340,7 @@ func Xgetchar(tls *TLS) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = uintptr(unsafe.Pointer(&X__stdin_FILE)) l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139130,7 +139087,7 @@ func Xputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -139295,7 +139252,7 @@ func Xputchar(tls *TLS, c1 int32) (r int32) { v1 = c1 v2 = uintptr(unsafe.Pointer(&X__stdout_FILE)) l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -139822,7 +139779,7 @@ func Xungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) { var v3 bool var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3, v4, v5, p6 - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+140) >= 0 { v1 = ___lockfile(tls, f) @@ -140074,7 +140031,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -140096,7 +140053,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -140285,7 +140242,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -140348,7 +140305,7 @@ _4: v14 = s s++ *(*uint8)(unsafe.Pointer(v14)) = Uint8FromInt32(Int32FromUint8(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int64(s)-t__predefined_ptrdiff_t(bp+516) == int64(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -140401,7 +140358,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -142251,7 +142208,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -142273,7 +142230,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -143903,9 +143860,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -143913,7 +143872,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint64(0) { try = base + uintptr(width*(nel/uint64(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint64(2) } else { @@ -144174,7 +144133,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*8)) >>= Uint64FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(912) defer tls.Free(912) var i, v1, v2 int32 @@ -144186,10 +144145,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[113]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -144206,7 +144165,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(928) defer tls.Free(928) var i, trail, v1 int32 @@ -144220,13 +144179,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint64(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -144241,13 +144200,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+16, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(784) defer tls.Free(784) @@ -144285,14 +144246,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0]&uint64(3) == uint64(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+768, int32(2)) pshift += int32(2) } else { if (*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint64FromInt64(int64(high)-int64(head)) { - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+768, int32(1)) @@ -144305,7 +144266,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[int32(1)] != uint64(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+768) @@ -144316,31 +144277,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 768)) ^= uint64(7) _shr(tls, bp+768, int32(1)) - _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+768, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift+int32(1), int32(1), bp) _shl(tls, bp+768, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+768, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -144435,7 +144400,7 @@ func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _strtox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _strtox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -144443,7 +144408,7 @@ func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_strtox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_strtox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -144715,7 +144680,7 @@ func Xwcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _wcstox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _wcstox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -144723,7 +144688,7 @@ func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_wcstox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_wcstox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xwcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -148815,7 +148780,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { if local != 0 { off = Int32FromUint32(_zi_read32(tls, _types+uintptr(int32(6)*Int32FromUint8(*(*uint8)(unsafe.Pointer(_index + uintptr(m-uint64(1)))))))) } - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { n /= uint64(2) } else { a = m @@ -148855,7 +148820,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { } /* If t is before first transition, use the above-found type * and the index-zero (after transition) type as the alt. */ - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { if alt != 0 { *(*Tsize_t)(unsafe.Pointer(alt)) = uint64(*(*uint8)(unsafe.Pointer(_index))) } @@ -149975,7 +149940,7 @@ func Xstrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t trc("tls=%v s=%v n=%v f=%v tm=%v, (%v:)", tls, s, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -150719,7 +150684,7 @@ func Xwcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize trc("tls=%v wcs=%v n=%v f=%v tm=%v, (%v:)", tls, wcs, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xwcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151797,7 +151762,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1313,15 +1314,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1339,7 +1340,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1352,14 +1353,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1374,7 +1375,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1390,14 +1391,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1413,8 +1414,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1440,24 +1441,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1470,15 +1471,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1487,48 +1488,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1629,8 +1630,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1709,8 +1710,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2045,18 +2046,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -2068,16 +2069,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -2094,7 +2095,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -2129,7 +2130,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -2147,14 +2148,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2170,8 +2171,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2203,18 +2204,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2226,16 +2227,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2243,7 +2244,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2265,27 +2266,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2413,16 +2414,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2529,16 +2530,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2641,7 +2642,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2658,7 +2659,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)< %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -24928,7 +24933,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -24966,8 +24971,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint64(8), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint64(8), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint64(cnt) @@ -25011,7 +25016,7 @@ func X__reset_tls(tls *TLS) { var mem, p uintptr var self Tpthread_t _, _, _, _, _ = i, mem, n, p, self - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) n = *(*Tuintptr_t)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(self)).Fdtv)) if n != 0 { p = X__libc.Ftls_head @@ -25047,7 +25052,7 @@ func X__init_ssp(tls *TLS, entropy uintptr) { * still be detected. Endianness is taken care of * automatically. */ *(*int8)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__stack_chk_guard)) + 1)) = 0 - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fcanary = X__stack_chk_guard + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fcanary = X__stack_chk_guard } func X__stack_chk_fail(tls *TLS) { @@ -25656,7 +25661,7 @@ func Xstrerror(tls *TLS, e int32) (r uintptr) { trc("tls=%v e=%v, (%v:)", tls, e, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) { @@ -25713,9 +25718,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25727,7 +25734,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -26206,19 +26213,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26242,14 +26249,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26403,7 +26410,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26429,16 +26436,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26580,10 +26587,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26619,7 +26626,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26648,15 +26655,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26681,7 +26688,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -28103,15 +28110,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28233,7 +28242,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)< %v", r) }() } - return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + 5*8))) + return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale + 5*8))) } func _swapc(tls *TLS, x Tuint32_t, c int32) (r Tuint32_t) { @@ -31590,7 +31599,7 @@ func Xdcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n var _ /* z at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = alt_modlen, catlen, catname, csp, dirlen, dirname, domlen, l, lm, loc, loclen, locname, locp, map1, modlen, modname, name, np, old, old_cats, old_errno, p3, plural, q, r, r1, rem, rule, trans, v, v10, v11, v12, v14, v15, v17, v18, v20, v22, v24, v27, v3, v5, v6, v8, v9 defer func() { Xrealloc(tls, name, 0) }() - loc = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + loc = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale old_errno = *(*int32)(unsafe.Pointer(X__errno_location(tls))) /* match gnu gettext behaviour */ if !(msgid1 != 0) { @@ -98271,7 +98280,7 @@ func Xiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb ui *(*Tmbstate_t)(unsafe.Pointer(bp + 24)) = Tmbstate_t{} type1 = *(*uint8)(unsafe.Pointer(map1 + uintptr(-Int32FromInt32(1)))) totype = *(*uint8)(unsafe.Pointer(tomap + uintptr(-Int32FromInt32(1)))) - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if !(in != 0) || !(*(*uintptr)(unsafe.Pointer(in)) != 0) || !(*(*Tsize_t)(unsafe.Pointer(inb)) != 0) { return uint64(0) @@ -99305,7 +99314,7 @@ func X__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { trc("tls=%v item=%v, (%v:)", tls, item, origin(2)) defer func() { trc("-> %v", r) }() } - return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xnl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { @@ -100023,7 +100032,7 @@ func Xstrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) { @@ -100189,7 +100198,7 @@ func Xstrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize var ret Tssize_t _, _ = ap, ret ap = va - ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale, fmt, ap) + ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale, fmt, ap) _ = ap return ret } @@ -100264,7 +100273,7 @@ func Xstrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100353,7 +100362,7 @@ func X__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) { var global, old, v1, v2 Tlocale_t var self Tpthread_t _, _, _, _, _ = global, old, self, v1, v2 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) old = (*t__pthread)(unsafe.Pointer(self)).Flocale global = uintptr(unsafe.Pointer(&X__libc)) + 56 if new1 != 0 { @@ -100396,7 +100405,7 @@ func Xwcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100437,7 +100446,7 @@ func Xwcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100481,12 +100490,12 @@ func X__cos(tls *TLS, x float64, y float64) (r1 float64) { } var hz, r, w, z Tdouble_t _, _, _, _ = hz, r, w, z - z = x * x - w = z * z - r = z*(_C1+z*(_C2+z*_C3)) + w*w*(_C4+z*(_C5+z*_C6)) - hz = float64(0.5) * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = Tdouble_t(z*(_C1+float64(z*(_C2+float64(z*_C3))))) + Tdouble_t(Tdouble_t(w*w)*(_C4+float64(z*(_C5+float64(z*_C6))))) + hz = Tdouble_t(float64(0.5) * z) w = float64(1) - hz - return w + (Float64FromFloat64(1) - w - hz + (z*r - x*y)) + return w + (Float64FromFloat64(1) - w - hz + (Tdouble_t(z*r) - Tdouble_t(x*y))) } // C documentation @@ -100506,10 +100515,10 @@ func X__cosdf(tls *TLS, x float64) (r1 float32) { var r, w, z Tdouble_t _, _, _ = r, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _C21 + z*_C31 - return float32(float64(1) + z*_C0 + w*_C11 + w*z*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _C21 + float64(z*_C31) + return float32(float64(1) + float64(z*_C0) + float64(w*_C11) + float64(Tdouble_t(w*z)*r)) } // C documentation @@ -100534,7 +100543,7 @@ func X__expo2(tls *TLS, x float64, sign float64) (r float64) { scale = *(*float64)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexp(tls, x-_kln22) * (sign * scale) * scale + return float64(float64(Xexp(tls, x-_kln22)*float64(sign*scale)) * scale) } // C documentation @@ -100559,7 +100568,7 @@ func X__expo2f(tls *TLS, x float32, sign float32) (r float32) { scale = *(*float32)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexpf(tls, x-_kln23) * (sign * scale) * scale + return float32(float32(Xexpf(tls, x-_kln23)*float32(sign*scale)) * scale) } func X__fpclassify(tls *TLS, x float64) (r int32) { @@ -100757,7 +100766,7 @@ func X__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float64(v2 * y2) v4 = y goto _5 _5: @@ -100780,7 +100789,7 @@ func X__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float32(v2 * y2) v4 = y goto _5 _5: @@ -100861,14 +100870,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { } } else { if !(sign != 0) { - z = x - Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(2)*_pio2_1t + z = x - float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(2)*_pio2_1t) return int32(2) } else { - z = x + Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(2)*_pio2_1t + z = x + float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(2)*_pio2_1t) return -int32(2) } } @@ -100879,14 +100888,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(3)*_pio2_1t + z = x - float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(3)*_pio2_1t) return int32(3) } else { - z = x + Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(3)*_pio2_1t + z = x + float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(3)*_pio2_1t) return -int32(3) } } else { @@ -100894,14 +100903,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(4)*_pio2_1t + z = x - float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(4)*_pio2_1t) return int32(4) } else { - z = x + Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(4)*_pio2_1t + z = x + float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(4)*_pio2_1t) return -int32(4) } } @@ -100913,22 +100922,22 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { medium: ; /* rint(x/(pi/2)) */ - fn = x*_invpio2 + _toint - _toint + fn = Tdouble_t(x*_invpio2) + _toint - _toint n = int32(fn) - r = x - fn*_pio2_1 - w = fn * _pio2_1t /* 1st round, good to 85 bits */ + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) /* 1st round, good to 85 bits */ /* Matters with directed rounding. */ if r-w < -_pio4 { n-- fn-- - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } else { if r-w > _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -100937,17 +100946,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -100975,7 +100984,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07)) goto _3 _3: ; @@ -101155,7 +101164,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101179,8 +101188,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101189,8 +101198,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101283,7 +101292,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101310,8 +101319,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101326,7 +101335,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101345,7 +101354,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -101536,19 +101545,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + _toint1 - _toint1 n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -101645,14 +101654,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + float64(z*(_S3+float64(z*_S4))) + float64(Tdouble_t(z*w)*(_S5+float64(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + float64(v*(_S1+float64(z*r))) } else { - return x - (z*(Float64FromFloat64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(float64(Float64FromFloat64(0.5)*y)-float64(v*r))) - y - Tdouble_t(v*_S1)) } return r1 } @@ -101674,11 +101683,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S31 + float64(z*_S41) + s = Tdouble_t(z * x) + return float32(x + float64(s*(_S11+float64(z*_S21))) + float64(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -101721,21 +101730,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + float64(w*(_T[int32(3)]+float64(w*(_T[int32(5)]+float64(w*(_T[int32(7)]+float64(w*(_T[int32(9)]+float64(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + float64(w*(_T[int32(4)]+float64(w*(_T[int32(6)]+float64(w*(_T[int32(8)]+float64(w*(_T[int32(10)]+float64(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + float64(z*(Tdouble_t(s*(r+v))+y)) + float64(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - float64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(float64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -101756,7 +101765,7 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { a0 = v3 v4 = *(*Tuint64_t)(unsafe.Pointer(&a0))>>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -101857,24 +101866,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -101917,24 +101926,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -101965,11 +101974,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102003,11 +102012,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102046,8 +102055,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102067,7 +102076,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102077,21 +102086,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102110,8 +102119,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = z * (_pS03 + z*(_pS13+z*_pS23)) - q = Float32FromFloat32(1) + z*_qS13 + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = Float32FromFloat32(1) + float32(z*_qS13) return p / q } @@ -102128,7 +102137,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102137,12 +102146,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102186,11 +102195,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint64(8) == uint64(4) { @@ -102199,7 +102208,7 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } } @@ -102251,11 +102260,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint64(4) == uint64(4) { @@ -102381,7 +102390,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if ix < uint32(0x3ff30000) { /* |x| < 1.1875 */ if ix < uint32(0x3fe60000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (float64(2)*x3 - float64(1)) / (float64(2) + x3) + x3 = (float64(float64(2)*x3) - float64(1)) / (float64(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - float64(1)) / (x3 + float64(1)) @@ -102389,7 +102398,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } else { if ix < uint32(0x40038000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - float64(1.5)) / (float64(1) + float64(1.5)*x3) + x3 = (x3 - float64(1.5)) / (float64(1) + float64(float64(1.5)*x3)) } else { /* 2.4375 <= |x| < 2^66 */ id = int32(3) x3 = -Float64FromFloat64(1) / x3 @@ -102397,15 +102406,15 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tdouble_t(x3 * x3) + w = Tdouble_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT[0] + w*(_aT[int32(2)]+w*(_aT[int32(4)]+w*(_aT[int32(6)]+w*(_aT[int32(8)]+w*_aT[int32(10)]))))) - s2 = w * (_aT[int32(1)] + w*(_aT[int32(3)]+w*(_aT[int32(5)]+w*(_aT[int32(7)]+w*_aT[int32(9)])))) + s1 = Tdouble_t(z * (_aT[0] + float64(w*(_aT[int32(2)]+float64(w*(_aT[int32(4)]+float64(w*(_aT[int32(6)]+float64(w*(_aT[int32(8)]+float64(w*_aT[int32(10)]))))))))))) + s2 = Tdouble_t(w * (_aT[int32(1)] + float64(w*(_aT[int32(3)]+float64(w*(_aT[int32(5)]+float64(w*(_aT[int32(7)]+float64(w*_aT[int32(9)]))))))))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float64(x3*(s1+s2)) } - z = _atanhi[id] - (x3*(s1+s2) - _atanlo[id] - x3) + z = _atanhi[id] - (float64(x3*(s1+s2)) - _atanlo[id] - x3) if sign != 0 { v4 = -z } else { @@ -102491,9 +102500,9 @@ _2: case uint32(1): return -_pi / Float64FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float64FromInt32(3) * _pi / Float64FromInt32(4) /* atan(+INF,-INF) */ + return float64(Float64FromInt32(3)*_pi) / Float64FromInt32(4) /* atan(+INF,-INF) */ case uint32(3): - return float64(-Int32FromInt32(3)) * _pi / Float64FromInt32(4) /* atan(-INF,-INF) */ + return float64(float64(-Int32FromInt32(3))*_pi) / Float64FromInt32(4) /* atan(-INF,-INF) */ } } else { switch m { @@ -102608,9 +102617,9 @@ _2: case uint32(1): return -_pi1 / Float32FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float32FromInt32(3) * _pi1 / Float32FromInt32(4) /*atan(+INF,-INF)*/ + return float32(Float32FromInt32(3)*_pi1) / Float32FromInt32(4) /*atan(+INF,-INF)*/ case uint32(3): - return float32(-Int32FromInt32(3)) * _pi1 / Float32FromInt32(4) /*atan(-INF,-INF)*/ + return float32(float32(-Int32FromInt32(3))*_pi1) / Float32FromInt32(4) /*atan(-INF,-INF)*/ } } else { switch m { @@ -102725,7 +102734,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x00800000) { /* raise underflow for subnormal x */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -102742,7 +102751,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x3f980000) { /* |x| < 1.1875 */ if ix < uint32(0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (Float32FromFloat32(2)*x3 - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) + x3 = (float32(Float32FromFloat32(2)*x3) - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - Float32FromFloat32(1)) / (x3 + Float32FromFloat32(1)) @@ -102750,7 +102759,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } else { if ix < uint32(0x401c0000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + Float32FromFloat32(1.5)*x3) + x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + float32(Float32FromFloat32(1.5)*x3)) } else { /* 2.4375 <= |x| < 2**26 */ id = int32(3) x3 = -Float32FromFloat32(1) / x3 @@ -102758,15 +102767,15 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tfloat_t(x3 * x3) + w = Tfloat_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT1[0] + w*(_aT1[int32(2)]+w*_aT1[int32(4)])) - s2 = w * (_aT1[int32(1)] + w*_aT1[int32(3)]) + s1 = Tfloat_t(z * (_aT1[0] + float32(w*(_aT1[int32(2)]+float32(w*_aT1[int32(4)]))))) + s2 = Tfloat_t(w * (_aT1[int32(1)] + float32(w*_aT1[int32(3)]))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float32(x3*(s1+s2)) } - z = _atanhi1[id] - (x3*(s1+s2) - _atanlo1[id] - x3) + z = _atanhi1[id] - (float32(x3*(s1+s2)) - _atanlo1[id] - x3) if sign != 0 { v4 = -z } else { @@ -102823,11 +102832,11 @@ func Xatanh(tls *TLS, x3 float64) (r float64) { } } else { /* |x| < 0.5, up to 1.7ulp error */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*y3+Float64FromInt32(2)*y3*y3/(Float64FromInt32(1)-y3)) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, Tdouble_t(Float64FromInt32(2)*y3)+Tdouble_t(Tdouble_t(Float64FromInt32(2)*y3)*y3)/(Float64FromInt32(1)-y3))) } } else { /* avoid overflow */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, float64(Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))))) } if s != 0 { v1 = -y3 @@ -102873,22 +102882,22 @@ func Xatanhf(tls *TLS, x3 float32) (r float32) { /* handle underflow */ if *(*Tuint32_t)(unsafe.Pointer(bp)) < Uint32FromInt32(Int32FromInt32(1)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -102980,7 +102989,7 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { hx = hx/uint32(3) + _B1 } p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63))) *(*Tuint64_t)(unsafe.Pointer(bp)) |= uint64(hx) << int32(32) t = *(*float64)(unsafe.Pointer(bp)) /* @@ -102993,8 +103002,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103006,14 +103015,14 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * before the final error is larger than 0.667 ulps. */ *(*float64)(unsafe.Pointer(bp)) = t - *(*Tuint64_t)(unsafe.Pointer(bp)) = (*(*Tuint64_t)(unsafe.Pointer(bp)) + Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) + *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(*(*Tuint64_t)(unsafe.Pointer(bp))+Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103051,7 +103060,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103065,14 +103074,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103258,9 +103267,9 @@ func Xcopysign(tls *TLS, x float64, y float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp + 8)) = y p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | *(*Tuint64_t)(unsafe.Pointer(bp + 8))&(Uint64FromUint64(1)<log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -103560,12 +103569,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -103660,8 +103669,8 @@ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) + P = _pa0 + float64(s*(_pa1+float64(s*(_pa2+float64(s*(_pa3+float64(s*(_pa4+float64(s*(_pa5+float64(s*_pa6))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+float64(s*(_qa2+float64(s*(_qa3+float64(s*(_qa4+float64(s*(_qa5+float64(s*_qa6))))))))))) return Float64FromInt32(1) - _erx - P/Q } @@ -103674,18 +103683,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = Float64FromInt32(1) / float64(x*x) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = float64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = _ra0 + float64(s*(_ra1+float64(s*(_ra2+float64(s*(_ra3+float64(s*(_ra4+float64(s*(_ra5+float64(s*(_ra6+float64(s*_ra7))))))))))))) + S = float64(1) + float64(s*(_sa1+float64(s*(_sa2+float64(s*(_sa3+float64(s*(_sa4+float64(s*(_sa5+float64(s*(_sa6+float64(s*(_sa7+float64(s*_sa8))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = float64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = _rb0 + float64(s*(_rb1+float64(s*(_rb2+float64(s*(_rb3+float64(s*(_rb4+float64(s*(_rb5+float64(s*_rb6))))))))))) + S = float64(1) + float64(s*(_sb1+float64(s*(_sb2+float64(s*(_sb3+float64(s*(_sb4+float64(s*(_sb5+float64(s*(_sb6+float64(s*_sb7))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = _rb01 + s*(_rb11+s*(_rb21+s*(_rb31+s*(_rb41+s*(_rb51+s*_rb61))))) - S = Float32FromFloat32(1) + s*(_sb11+s*(_sb21+s*(_sb31+s*(_sb41+s*(_sb51+s*(_sb61+s*_sb71)))))) + R = _rb01 + float32(s*(_rb11+float32(s*(_rb21+float32(s*(_rb31+float32(s*(_rb41+float32(s*(_rb51+float32(s*_rb61))))))))))) + S = Float32FromFloat32(1) + float32(s*(_sb11+float32(s*(_sb21+float32(s*(_sb31+float32(s*(_sb41+float32(s*(_sb51+float32(s*(_sb61+float32(s*_sb71))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, (z-x)*(z+x)+R/S) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32((z-x)*(z+x))+R/S)) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -103892,13 +103901,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -103933,14 +103942,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -103953,7 +103962,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -103995,9 +104004,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104146,8 +104155,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104222,10 +104231,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104285,9 +104294,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by 1. */ - sbits = sbits - Uint64FromUint64(1)< 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -104471,11 +104480,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + float64(1) if k == int32(1024) { - y3 = y3 * float64(2) * float64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } return y3 - float64(1) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -104809,10 +104818,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float32(k) - hi = x3 - t*_ln2_hi1 /* t*ln2_hi is exact here */ - lo = t * _ln2_lo1 + hi = x3 - float32(t*_ln2_hi1) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * _ln2_lo1) } x3 = hi - lo c = hi - x3 - lo @@ -104820,7 +104829,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -104835,42 +104844,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = Float32FromFloat32(0.5) * x3 - hxs = x3 * hfx - r1 = Float32FromFloat32(1) + hxs*(_Q11+hxs*_Q21) - t = Float32FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float32FromFloat32(6) - x3*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(x3 * hfx) + r1 = Float32FromFloat32(1) + float32(hxs*(_Q11+float32(hxs*_Q21))) + t = Float32FromFloat32(3) - float32(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float32FromFloat32(6) - float32(x3*t)))) if k == 0 { /* c is 0 */ - return x3 - (x3*e - hxs) + return x3 - (float32(x3*e) - hxs) } - e = x3*(e-c) - c + e = float32(x3*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return Float32FromFloat32(0.5)*(x3-e) - Float32FromFloat32(0.5) + return float32(Float32FromFloat32(0.5)*(x3-e)) - Float32FromFloat32(0.5) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { - return -Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5))) + return float32(-Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5)))) } - return Float32FromFloat32(1) + Float32FromFloat32(2)*(x3-e) + return Float32FromFloat32(1) + float32(Float32FromFloat32(2)*(x3-e)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = *(*float32)(unsafe.Pointer(bp)) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + Float32FromFloat32(1) if k == int32(128) { - y3 = y3 * Float32FromFloat32(2) * Float32FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float32FromFloat32(2)) * Float32FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return y3 - Float32FromFloat32(1) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk + y3 = Tfloat_t((x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk) } return y3 } @@ -104905,7 +104914,7 @@ func Xfabs(tls *TLS, x float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp)) = x p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) return *(*float64)(unsafe.Pointer(bp)) } @@ -105219,7 +105228,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105229,8 +105238,8 @@ func _normalize(tls *TLS, x float64) (r Tnum) { } e = v2 } - ix = ix & (Uint64FromUint64(1)<= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y1 + z + return float64(x1*y1) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y1 + z + return float64(x1*y1) + z } return z } @@ -105421,7 +105430,7 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { } } else { /* exact +-0 */ - return x1*y1 + z + return float64(x1*y1) + z } } e -= d @@ -105442,8 +105451,8 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r1) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r1) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105453,11 +105462,11 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { i = -i } r1 = float64(i) - r1 = Float64FromInt32(2)*r1 - c /* remove top bit */ + r1 = float64(Float64FromInt32(2)*r1) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r1 - r1 += tiny * tiny * (r1 - r1) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r1) + r1 += float64(Tdouble_t(tiny*tiny) * (r1 - r1)) } } else { /* only round once when scaled */ @@ -105781,11 +105790,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105847,7 +105856,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105863,7 +105872,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { } /* scale result */ if ex > 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -105924,11 +105933,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -105988,7 +105997,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106047,7 +106056,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106060,9 +106069,9 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { } *(*int32)(unsafe.Pointer(e)) = ee - int32(0x3fe) p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff)) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000)) return *(*float64)(unsafe.Pointer(bp)) } @@ -106123,11 +106132,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106175,9 +106184,9 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { *(*float64)(unsafe.Pointer(bp + 8)) = y /* arrange |x| >= |y| */ p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) p2 = bp + 8 - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) if *(*Tuint64_t)(unsafe.Pointer(bp)) < *(*Tuint64_t)(unsafe.Pointer(bp + 8)) { ut = *(*struct { Fi [0]Tuint64_t @@ -106228,7 +106237,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106307,7 +106316,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return z * Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))) + return float32(z * Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -106500,8 +106509,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106510,10 +106519,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -106541,7 +106550,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106551,16 +106560,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -106606,12 +106615,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -106712,9 +106721,9 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -106820,9 +106829,9 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (-Float64FromFloat64(0.125) + r/s) / x } @@ -106844,8 +106853,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106854,10 +106863,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -106884,7 +106893,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106893,13 +106902,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -106940,12 +106949,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107045,9 +107054,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107153,9 +107162,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (-Float32FromFloat32(0.125) + r/s) / x } @@ -107182,8 +107191,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107192,13 +107201,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107228,21 +107237,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107288,10 +107297,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107391,9 +107400,9 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107498,9 +107507,9 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (float64(0.375) + r/s) / x } @@ -107518,8 +107527,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107528,13 +107537,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -107564,20 +107573,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -107619,10 +107628,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107722,9 +107731,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107829,9 +107838,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (Float32FromFloat32(0.375) + r/s) / x } @@ -107906,7 +107915,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -107917,7 +107926,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -107931,7 +107940,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -107950,16 +107959,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -107969,7 +107978,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -107985,7 +107994,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -107993,7 +108002,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108007,7 +108016,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108024,9 +108033,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108108,7 +108117,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108121,7 +108130,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108181,7 +108190,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108194,7 +108203,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108212,16 +108221,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108231,7 +108240,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108247,7 +108256,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108255,7 +108264,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108269,7 +108278,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108286,9 +108295,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108351,7 +108360,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -108468,8 +108477,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -108516,7 +108525,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -108793,7 +108802,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -108831,31 +108840,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -108879,11 +108888,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109035,17 +109044,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+float64(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * float64(1.34217728e+08) + w = Tdouble_t(r * float64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109067,9 +109076,9 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) - ix = ix - Uint64FromUint64(52)<> (Int32FromInt32(52) - Int32FromInt32(LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109149,7 +109158,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109175,12 +109184,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109270,19 +109279,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = x - Float32FromFloat32(1) s = f / (Float32FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (_Lg21 + w*_Lg41) - t2 = z * (_Lg11 + w*_Lg31) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (_Lg21 + float32(w*_Lg41))) + t2 = Tfloat_t(z * (_Lg11 + float32(w*_Lg31))) R = t2 + t1 - hfsq = Float32FromFloat32(0.5) * f * f + hfsq = Tfloat_t(float32(Float32FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = hi *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = *(*float32)(unsafe.Pointer(bp)) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float32(k) - return dk*_log10_2lo1 + (lo+hi)*_ivln10lo1 + lo*_ivln10hi1 + hi*_ivln10hi1 + dk*_log10_2hi1 + return Tfloat_t(dk*_log10_2lo1) + Tfloat_t((lo+hi)*_ivln10lo1) + Tfloat_t(lo*_ivln10hi1) + Tfloat_t(hi*_ivln10hi1) + Tfloat_t(dk*_log10_2hi1) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109384,15 +109393,15 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)<> (Int32FromInt32(52) - Int32FromInt32(LOG2_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + float64(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v10 = y goto _11 @@ -109668,7 +109677,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -109690,14 +109699,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -109759,10 +109768,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<> Int32FromInt32(12) >> e + mask = uint64(-Uint64FromUint64(1) >> Int32FromInt32(12) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&mask == uint64(0) { *(*float64)(unsafe.Pointer(iptr)) = x p3 = bp - *(*Tuint64_t)(unsafe.Pointer(p3)) = *(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p3)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63))) return *(*float64)(unsafe.Pointer(bp)) } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^mask @@ -110183,13 +110192,13 @@ _2: if *(*Tuint64_t)(unsafe.Pointer(bp + 8)) == *(*Tuint64_t)(unsafe.Pointer(bp + 16)) { return y3 } - ax = *(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) - ay = *(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + ax = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) + ay = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) if ax == uint64(0) { if ay == uint64(0) { return y3 } - *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = *(*Tuint64_t)(unsafe.Pointer(bp + 16))&(Uint64FromUint64(1)< ay || (*(*Tuint64_t)(unsafe.Pointer(bp + 8))^*(*Tuint64_t)(unsafe.Pointer(bp + 16)))&(Uint64FromUint64(1)<> (Int32FromInt32(52) - Int32FromInt32(POW_LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -110759,10 +110768,10 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } @@ -110822,15 +110831,15 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) - ix = ix - Uint64FromUint64(52)<1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111036,22 +111045,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)< 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -111276,7 +111285,7 @@ end: if sy != 0 { y = -y } - if ex == ey || ex+int32(1) == ey && (Float64FromInt32(2)*x > y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111349,7 +111358,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111624,10 +111633,10 @@ func Xround(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + _toint6 } else { - y2 = x3 + _toint6 + y2 = float64(x3 + _toint6) } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > float64(0.5) { @@ -111691,7 +111700,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3 + _toint7) } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = x3 + _toint7 - _toint7 - x3 if y3 > Float32FromFloat32(0.5) { @@ -111745,7 +111754,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -111796,7 +111805,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -111804,7 +111813,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -111887,10 +111896,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -111899,7 +111908,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -111929,10 +111938,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -111941,7 +111950,7 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32(Int32FromInt32(0x7f)+n) << int32(23) - x = y * *(*float32)(unsafe.Pointer(bp)) + x = float32(y * *(*float32)(unsafe.Pointer(bp))) return x } @@ -112123,10 +112132,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112285,10 +112294,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112433,14 +112442,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -112481,12 +112490,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -112553,7 +112562,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -112703,7 +112712,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -112836,10 +112845,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112976,18 +112985,18 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { /* note: this branch avoids raising overflow */ t = Float64FromInt32(1) - Float64FromInt32(0)/x3 } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113048,23 +113057,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -113112,12 +113121,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113213,8 +113222,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113296,7 +113305,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113320,17 +113329,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / float64(float64(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, float64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(float64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -113381,7 +113390,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if e < int32(12) { e = int32(1) } - m = -Uint64FromUint64(1) >> e + m = uint64(-Uint64FromUint64(1) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&m == uint64(0) { return x3 } @@ -113391,7 +113400,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^m @@ -115114,7 +115123,7 @@ type Thistory = struct { Fbase int32 } -func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { +func _do_nftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { bp := tls.Alloc(176) defer tls.Free(176) var d, de, v10 uintptr @@ -115220,7 +115229,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } } if v8 = !(flags&Int32FromInt32(FTW_DEPTH) != 0); v8 { - v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+160) + v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+160) r = v7 } if v8 && v7 != 0 { @@ -115261,7 +115270,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*int8)(unsafe.Pointer(path + uintptr(j))) = int8('/') Xstrcpy(tls, path+uintptr(j)+uintptr(1), de+19) - v11 = _do_nftw(tls, path, fn, fd_limit-int32(1), flags, bp+128) + v11 = _do_nftw(tls, path, __ccgo_fp_fn, fd_limit-int32(1), flags, bp+128) r = v11 if v11 != 0 { Xclosedir(tls, d) @@ -115276,7 +115285,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*int8)(unsafe.Pointer(path + uintptr(l))) = 0 if v13 = flags&int32(FTW_DEPTH) != 0; v13 { - v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+160) + v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+160) r = v12 } if v13 && v12 != 0 { @@ -115285,9 +115294,11 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h return 0 } -func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 int32) { +type t__ccgo_fp__Xnftw_1 = func(*TLS, uintptr, uintptr, int32, uintptr) int32 + +func Xnftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, fn, fd_limit, flags, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, flags, origin(2)) defer func() { trc("-> %v", r1) }() } bp := tls.Alloc(4112) @@ -115307,7 +115318,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } Xmemcpy(tls, bp+4, path, l+uint64(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -116496,7 +116507,7 @@ func Xbtowc(tls *TLS, c int32) (r Twint_t) { if Uint32FromInt32(b) < uint32(128) { v1 = Uint32FromInt32(b) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -116697,7 +116708,7 @@ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolUint64(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -116868,7 +116879,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts goto resume0 } } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117096,7 +117107,7 @@ func Xmbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) { *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolInt32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117166,7 +117177,7 @@ func Xwcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) { *(*int8)(unsafe.Pointer(s)) = int8(wc) return uint64(1) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -117373,7 +117384,7 @@ func Xwctob(tls *TLS, c Twint_t) (r int32) { if c < uint32(128) { return Int32FromUint32(c) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118203,13 +118214,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]int8 - Falg [1025]int8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]int8 Falg [1025]int8 @@ -118217,14 +118221,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -118874,9 +118870,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -118922,7 +118920,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if int64(len1+int32(10)) > int64(r+uintptr(rlen))-int64(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -120999,10 +120997,10 @@ func X__h_errno_location(tls *TLS) (r uintptr) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - if !((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstack != 0) { + if !((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstack != 0) { return uintptr(unsafe.Pointer(&Xh_errno)) } - return ___get_tp(tls) + 144 + return uintptr(___get_tp(tls)) + 144 } func Xherror(tls *TLS, msg uintptr) { @@ -121026,10 +121024,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+1062, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - var _msgs1 = [84]int8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -122817,7 +122811,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -122907,7 +122901,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -122920,9 +122914,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -122931,9 +122927,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int64(SYS_close), int64(fd)) return r @@ -127802,7 +127798,7 @@ func _fnmatch_internal(tls *TLS, pat uintptr, m Tsize_t, str uintptr, n Tsize_t, break } if v9 = Uint32FromInt8(*(*int8)(unsafe.Pointer(s + uintptr(-Int32FromInt32(1))))) < uint32(128); !v9 { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v8 = int32(4) } else { v8 = int32(1) @@ -128040,7 +128036,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(128) defer tls.Free(128) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -128149,7 +128145,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -128186,7 +128182,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -128238,7 +128234,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -128249,7 +128245,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*int8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -128361,9 +128357,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4128) @@ -128389,8 +128387,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -128409,7 +128407,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4120, bp+16, bp+4112) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, errfunc, bp+8) + error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, __ccgo_fp_errfunc, bp+8) } Xfree(tls, p) } @@ -133633,9 +133631,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133651,7 +133651,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133663,9 +133663,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return Xmemcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133681,7 +133683,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133700,9 +133702,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [97]uintptr @@ -133726,7 +133730,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -133771,9 +133775,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -133781,17 +133787,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -133805,7 +133813,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -133893,9 +133901,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [96]uintptr @@ -133915,7 +133925,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -133951,26 +133961,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -134255,7 +134267,7 @@ func Xraise(tls *TLS, sig int32) (r int32) { var _ /* set at bp+0 */ Tsigset_t _ = ret X__block_app_sigs(tls, bp) - ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid), int64(sig))))) + ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid), int64(sig))))) X__restore_sigs(tls, bp) return ret } @@ -135070,13 +135082,13 @@ func _fstatat_statx(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r return ret } *(*Tstat)(unsafe.Pointer(st)) = Tstat{ - Fst_dev: uint64((*(*Tstatx1)(unsafe.Pointer(bp))).Fstx_dev_major)&Uint64FromUint64(0xfffff000)<= 0 { v1 = ___lockfile(tls, f) @@ -137744,7 +137756,7 @@ func X__do_orphaned_stdio_locks(tls *TLS) { } var f uintptr _ = f - f = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks + f = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks for { if !(f != 0) { break @@ -137772,7 +137784,7 @@ func X__unlist_locked_file(tls *TLS, f uintptr) { if (*TFILE)(unsafe.Pointer(f)).Fprev_locked != 0 { (*TFILE)(unsafe.Pointer((*TFILE)(unsafe.Pointer(f)).Fprev_locked)).Fnext_locked = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } else { - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } } } @@ -137800,7 +137812,7 @@ func Xftrylockfile(tls *TLS, f uintptr) (r1 int32) { var v11, v5 bool var v2 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _ = old, owner, r, self, tid, v, v1, v11, v2, v3, v5, v7, v9 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) tid = (*t__pthread)(unsafe.Pointer(self)).Ftid owner = AtomicLoadPInt32(f + 140) if owner & ^Int32FromInt32(MAYBE_WAITERS) == tid { @@ -137890,7 +137902,7 @@ func Xfwide(tls *TLS, f uintptr, mode int32) (r int32) { __need_unlock = v1 if mode != 0 { if !((*TFILE)(unsafe.Pointer(f)).Flocale != 0) { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -138148,7 +138160,7 @@ func Xgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -138324,7 +138336,7 @@ func Xgetchar(tls *TLS) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = uintptr(unsafe.Pointer(&X__stdin_FILE)) l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139092,7 +139104,7 @@ func Xputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -139278,7 +139290,7 @@ func Xputchar(tls *TLS, c1 int32) (r int32) { v1 = c1 v2 = uintptr(unsafe.Pointer(&X__stdout_FILE)) l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -139805,7 +139817,7 @@ func Xungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) { var v3 bool var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3, v4, v5, p6 - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+140) >= 0 { v1 = ___lockfile(tls, f) @@ -140057,7 +140069,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -140079,7 +140091,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -140268,7 +140280,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -140331,7 +140343,7 @@ _4: v14 = s s++ *(*int8)(unsafe.Pointer(v14)) = int8(int32(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int64(s)-t__predefined_ptrdiff_t(bp+516) == int64(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -140384,7 +140396,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -142234,7 +142246,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -142256,7 +142268,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -143886,9 +143898,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -143896,7 +143910,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint64(0) { try = base + uintptr(width*(nel/uint64(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint64(2) } else { @@ -144166,7 +144180,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*8)) >>= Uint64FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(912) defer tls.Free(912) var i, v1, v2 int32 @@ -144178,10 +144192,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[113]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -144198,7 +144212,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(928) defer tls.Free(928) var i, trail, v1 int32 @@ -144212,13 +144226,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint64(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -144233,13 +144247,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+16, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(784) defer tls.Free(784) @@ -144277,14 +144293,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0]&uint64(3) == uint64(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+768, int32(2)) pshift += int32(2) } else { if (*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint64FromInt64(int64(high)-int64(head)) { - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+768, int32(1)) @@ -144297,7 +144313,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[int32(1)] != uint64(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+768) @@ -144308,31 +144324,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 768)) ^= uint64(7) _shr(tls, bp+768, int32(1)) - _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+768, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift+int32(1), int32(1), bp) _shl(tls, bp+768, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+768, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -144427,7 +144447,7 @@ func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _strtox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _strtox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -144435,7 +144455,7 @@ func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_strtox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_strtox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -144707,7 +144727,7 @@ func Xwcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _wcstox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _wcstox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -144715,7 +144735,7 @@ func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_wcstox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_wcstox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xwcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -148807,7 +148827,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { if local != 0 { off = Int32FromUint32(_zi_read32(tls, _types+uintptr(int32(6)*Int32FromUint8(*(*uint8)(unsafe.Pointer(_index + uintptr(m-uint64(1)))))))) } - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { n /= uint64(2) } else { a = m @@ -148847,7 +148867,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { } /* If t is before first transition, use the above-found type * and the index-zero (after transition) type as the alt. */ - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { if alt != 0 { *(*Tsize_t)(unsafe.Pointer(alt)) = uint64(*(*uint8)(unsafe.Pointer(_index))) } @@ -149967,7 +149987,7 @@ func Xstrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t trc("tls=%v s=%v n=%v f=%v tm=%v, (%v:)", tls, s, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -150711,7 +150731,7 @@ func Xwcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize trc("tls=%v wcs=%v n=%v f=%v tm=%v, (%v:)", tls, wcs, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xwcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151789,7 +151809,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1253,15 +1264,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1279,7 +1290,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1292,14 +1303,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1314,7 +1325,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1330,14 +1341,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1353,8 +1364,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1380,24 +1391,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1410,15 +1421,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1427,48 +1438,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1569,8 +1580,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1649,8 +1660,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1985,18 +1996,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -2008,16 +2019,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -2034,7 +2045,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -2069,7 +2080,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -2087,14 +2098,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2110,8 +2121,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2143,18 +2154,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2166,16 +2177,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2183,7 +2194,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2205,27 +2216,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2353,16 +2364,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2469,16 +2480,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2581,7 +2592,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2598,7 +2609,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)< %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -25077,7 +25092,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -25115,8 +25130,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint64(8), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint64(8), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint64(cnt) @@ -25160,7 +25175,7 @@ func X__reset_tls(tls *TLS) { var mem, p uintptr var self Tpthread_t _, _, _, _, _ = i, mem, n, p, self - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) n = *(*Tuintptr_t)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(self)).Fdtv)) if n != 0 { p = X__libc.Ftls_head @@ -25196,7 +25211,7 @@ func X__init_ssp(tls *TLS, entropy uintptr) { * still be detected. Endianness is taken care of * automatically. */ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__stack_chk_guard)) + 1)) = uint8(0) - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fcanary = X__stack_chk_guard + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fcanary = X__stack_chk_guard } func X__stack_chk_fail(tls *TLS) { @@ -25806,7 +25821,7 @@ func Xstrerror(tls *TLS, e int32) (r uintptr) { trc("tls=%v e=%v, (%v:)", tls, e, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) { @@ -25863,9 +25878,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25877,7 +25894,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -26481,19 +26498,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26517,14 +26534,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26678,7 +26695,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26704,16 +26721,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26855,10 +26872,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26894,7 +26911,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26923,15 +26940,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26956,7 +26973,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -28398,15 +28415,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28528,7 +28547,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)< %v", r) }() } - return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + 5*8))) + return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale + 5*8))) } func _swapc(tls *TLS, x Tuint32_t, c int32) (r Tuint32_t) { @@ -31976,7 +31987,7 @@ func Xdcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n var _ /* z at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = alt_modlen, catlen, catname, csp, dirlen, dirname, domlen, l, lm, loc, loclen, locname, locp, map1, modlen, modname, name, np, old, old_cats, old_errno, p3, plural, q, r, r1, rem, rule, trans, v, v10, v11, v12, v14, v15, v17, v18, v19, v21, v23, v24, v26, v29, v3, v5, v6, v8, v9 defer func() { Xrealloc(tls, name, 0) }() - loc = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + loc = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale old_errno = *(*int32)(unsafe.Pointer(X__errno_location(tls))) /* match gnu gettext behaviour */ if !(msgid1 != 0) { @@ -98653,7 +98664,7 @@ func Xiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb ui *(*Tmbstate_t)(unsafe.Pointer(bp + 24)) = Tmbstate_t{} type1 = *(*uint8)(unsafe.Pointer(map1 + uintptr(-Int32FromInt32(1)))) totype = *(*uint8)(unsafe.Pointer(tomap + uintptr(-Int32FromInt32(1)))) - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if !(in != 0) || !(*(*uintptr)(unsafe.Pointer(in)) != 0) || !(*(*Tsize_t)(unsafe.Pointer(inb)) != 0) { return uint64(0) @@ -99687,7 +99698,7 @@ func X__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { trc("tls=%v item=%v, (%v:)", tls, item, origin(2)) defer func() { trc("-> %v", r) }() } - return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xnl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { @@ -100405,7 +100416,7 @@ func Xstrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) { @@ -100571,7 +100582,7 @@ func Xstrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize var ret Tssize_t _, _ = ap, ret ap = va - ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale, fmt, ap) + ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale, fmt, ap) _ = ap return ret } @@ -100646,7 +100657,7 @@ func Xstrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100735,7 +100746,7 @@ func X__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) { var global, old, v1, v2 Tlocale_t var self Tpthread_t _, _, _, _, _ = global, old, self, v1, v2 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) old = (*t__pthread)(unsafe.Pointer(self)).Flocale global = uintptr(unsafe.Pointer(&X__libc)) + 56 if new1 != 0 { @@ -100778,7 +100789,7 @@ func Xwcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100819,7 +100830,7 @@ func Xwcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100863,12 +100874,12 @@ func X__cos(tls *TLS, x float64, y float64) (r1 float64) { } var hz, r, w, z Tdouble_t _, _, _, _ = hz, r, w, z - z = x * x - w = z * z - r = z*(_C1+z*(_C2+z*_C3)) + w*w*(_C4+z*(_C5+z*_C6)) - hz = float64(0.5) * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = Tdouble_t(z*(_C1+float64(z*(_C2+float64(z*_C3))))) + Tdouble_t(Tdouble_t(w*w)*(_C4+float64(z*(_C5+float64(z*_C6))))) + hz = Tdouble_t(float64(0.5) * z) w = float64(1) - hz - return w + (Float64FromFloat64(1) - w - hz + (z*r - x*y)) + return w + (Float64FromFloat64(1) - w - hz + (Tdouble_t(z*r) - Tdouble_t(x*y))) } // C documentation @@ -100888,10 +100899,10 @@ func X__cosdf(tls *TLS, x float64) (r1 float32) { var r, w, z Tdouble_t _, _, _ = r, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _C21 + z*_C31 - return float32(float64(1) + z*_C0 + w*_C11 + w*z*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _C21 + float64(z*_C31) + return float32(float64(1) + float64(z*_C0) + float64(w*_C11) + float64(Tdouble_t(w*z)*r)) } // C documentation @@ -100916,7 +100927,7 @@ func X__expo2(tls *TLS, x float64, sign float64) (r float64) { scale = *(*float64)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexp(tls, x-_kln22) * (sign * scale) * scale + return float64(float64(Xexp(tls, x-_kln22)*float64(sign*scale)) * scale) } // C documentation @@ -100941,7 +100952,7 @@ func X__expo2f(tls *TLS, x float32, sign float32) (r float32) { scale = *(*float32)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexpf(tls, x-_kln23) * (sign * scale) * scale + return float32(float32(Xexpf(tls, x-_kln23)*float32(sign*scale)) * scale) } func X__fpclassify(tls *TLS, x float64) (r int32) { @@ -101139,7 +101150,7 @@ func X__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float64(v2 * y2) v4 = y goto _5 _5: @@ -101162,7 +101173,7 @@ func X__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float32(v2 * y2) v4 = y goto _5 _5: @@ -101243,14 +101254,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { } } else { if !(sign != 0) { - z = x - Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(2)*_pio2_1t + z = x - float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(2)*_pio2_1t) return int32(2) } else { - z = x + Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(2)*_pio2_1t + z = x + float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(2)*_pio2_1t) return -int32(2) } } @@ -101261,14 +101272,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(3)*_pio2_1t + z = x - float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(3)*_pio2_1t) return int32(3) } else { - z = x + Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(3)*_pio2_1t + z = x + float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(3)*_pio2_1t) return -int32(3) } } else { @@ -101276,14 +101287,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(4)*_pio2_1t + z = x - float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(4)*_pio2_1t) return int32(4) } else { - z = x + Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(4)*_pio2_1t + z = x + float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(4)*_pio2_1t) return -int32(4) } } @@ -101295,22 +101306,22 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { medium: ; /* rint(x/(pi/2)) */ - fn = x*_invpio2 + _toint - _toint + fn = Tdouble_t(x*_invpio2) + _toint - _toint n = int32(fn) - r = x - fn*_pio2_1 - w = fn * _pio2_1t /* 1st round, good to 85 bits */ + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) /* 1st round, good to 85 bits */ /* Matters with directed rounding. */ if r-w < -_pio4 { n-- fn-- - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } else { if r-w > _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -101319,17 +101330,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -101357,7 +101368,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07)) goto _3 _3: ; @@ -101537,7 +101548,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101561,8 +101572,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101571,8 +101582,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101665,7 +101676,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101692,8 +101703,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101708,7 +101719,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101727,7 +101738,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -101918,19 +101929,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + _toint1 - _toint1 n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -102027,14 +102038,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + float64(z*(_S3+float64(z*_S4))) + float64(Tdouble_t(z*w)*(_S5+float64(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + float64(v*(_S1+float64(z*r))) } else { - return x - (z*(Float64FromFloat64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(float64(Float64FromFloat64(0.5)*y)-float64(v*r))) - y - Tdouble_t(v*_S1)) } return r1 } @@ -102056,11 +102067,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S31 + float64(z*_S41) + s = Tdouble_t(z * x) + return float32(x + float64(s*(_S11+float64(z*_S21))) + float64(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -102103,21 +102114,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + float64(w*(_T[int32(3)]+float64(w*(_T[int32(5)]+float64(w*(_T[int32(7)]+float64(w*(_T[int32(9)]+float64(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + float64(w*(_T[int32(4)]+float64(w*(_T[int32(6)]+float64(w*(_T[int32(8)]+float64(w*(_T[int32(10)]+float64(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + float64(z*(Tdouble_t(s*(r+v))+y)) + float64(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - float64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(float64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -102138,7 +102149,7 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { a0 = v3 v4 = *(*Tuint64_t)(unsafe.Pointer(&a0))>>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -102239,24 +102250,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -102299,24 +102310,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -102347,11 +102358,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102385,11 +102396,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102428,8 +102439,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102449,7 +102460,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102459,21 +102470,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102492,8 +102503,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = z * (_pS03 + z*(_pS13+z*_pS23)) - q = Float32FromFloat32(1) + z*_qS13 + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = Float32FromFloat32(1) + float32(z*_qS13) return p / q } @@ -102510,7 +102521,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102519,12 +102530,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102568,11 +102579,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint64(8) == uint64(4) { @@ -102581,7 +102592,7 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } } @@ -102633,11 +102644,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint64(4) == uint64(4) { @@ -102763,7 +102774,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if ix < uint32(0x3ff30000) { /* |x| < 1.1875 */ if ix < uint32(0x3fe60000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (float64(2)*x3 - float64(1)) / (float64(2) + x3) + x3 = (float64(float64(2)*x3) - float64(1)) / (float64(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - float64(1)) / (x3 + float64(1)) @@ -102771,7 +102782,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } else { if ix < uint32(0x40038000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - float64(1.5)) / (float64(1) + float64(1.5)*x3) + x3 = (x3 - float64(1.5)) / (float64(1) + float64(float64(1.5)*x3)) } else { /* 2.4375 <= |x| < 2^66 */ id = int32(3) x3 = -Float64FromFloat64(1) / x3 @@ -102779,15 +102790,15 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tdouble_t(x3 * x3) + w = Tdouble_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT[0] + w*(_aT[int32(2)]+w*(_aT[int32(4)]+w*(_aT[int32(6)]+w*(_aT[int32(8)]+w*_aT[int32(10)]))))) - s2 = w * (_aT[int32(1)] + w*(_aT[int32(3)]+w*(_aT[int32(5)]+w*(_aT[int32(7)]+w*_aT[int32(9)])))) + s1 = Tdouble_t(z * (_aT[0] + float64(w*(_aT[int32(2)]+float64(w*(_aT[int32(4)]+float64(w*(_aT[int32(6)]+float64(w*(_aT[int32(8)]+float64(w*_aT[int32(10)]))))))))))) + s2 = Tdouble_t(w * (_aT[int32(1)] + float64(w*(_aT[int32(3)]+float64(w*(_aT[int32(5)]+float64(w*(_aT[int32(7)]+float64(w*_aT[int32(9)]))))))))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float64(x3*(s1+s2)) } - z = _atanhi[id] - (x3*(s1+s2) - _atanlo[id] - x3) + z = _atanhi[id] - (float64(x3*(s1+s2)) - _atanlo[id] - x3) if sign != 0 { v4 = -z } else { @@ -102873,9 +102884,9 @@ _2: case uint32(1): return -_pi / Float64FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float64FromInt32(3) * _pi / Float64FromInt32(4) /* atan(+INF,-INF) */ + return float64(Float64FromInt32(3)*_pi) / Float64FromInt32(4) /* atan(+INF,-INF) */ case uint32(3): - return float64(-Int32FromInt32(3)) * _pi / Float64FromInt32(4) /* atan(-INF,-INF) */ + return float64(float64(-Int32FromInt32(3))*_pi) / Float64FromInt32(4) /* atan(-INF,-INF) */ } } else { switch m { @@ -102990,9 +103001,9 @@ _2: case uint32(1): return -_pi1 / Float32FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float32FromInt32(3) * _pi1 / Float32FromInt32(4) /*atan(+INF,-INF)*/ + return float32(Float32FromInt32(3)*_pi1) / Float32FromInt32(4) /*atan(+INF,-INF)*/ case uint32(3): - return float32(-Int32FromInt32(3)) * _pi1 / Float32FromInt32(4) /*atan(-INF,-INF)*/ + return float32(float32(-Int32FromInt32(3))*_pi1) / Float32FromInt32(4) /*atan(-INF,-INF)*/ } } else { switch m { @@ -103107,7 +103118,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x00800000) { /* raise underflow for subnormal x */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -103124,7 +103135,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x3f980000) { /* |x| < 1.1875 */ if ix < uint32(0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (Float32FromFloat32(2)*x3 - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) + x3 = (float32(Float32FromFloat32(2)*x3) - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - Float32FromFloat32(1)) / (x3 + Float32FromFloat32(1)) @@ -103132,7 +103143,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } else { if ix < uint32(0x401c0000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + Float32FromFloat32(1.5)*x3) + x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + float32(Float32FromFloat32(1.5)*x3)) } else { /* 2.4375 <= |x| < 2**26 */ id = int32(3) x3 = -Float32FromFloat32(1) / x3 @@ -103140,15 +103151,15 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tfloat_t(x3 * x3) + w = Tfloat_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT1[0] + w*(_aT1[int32(2)]+w*_aT1[int32(4)])) - s2 = w * (_aT1[int32(1)] + w*_aT1[int32(3)]) + s1 = Tfloat_t(z * (_aT1[0] + float32(w*(_aT1[int32(2)]+float32(w*_aT1[int32(4)]))))) + s2 = Tfloat_t(w * (_aT1[int32(1)] + float32(w*_aT1[int32(3)]))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float32(x3*(s1+s2)) } - z = _atanhi1[id] - (x3*(s1+s2) - _atanlo1[id] - x3) + z = _atanhi1[id] - (float32(x3*(s1+s2)) - _atanlo1[id] - x3) if sign != 0 { v4 = -z } else { @@ -103205,11 +103216,11 @@ func Xatanh(tls *TLS, x3 float64) (r float64) { } } else { /* |x| < 0.5, up to 1.7ulp error */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*y3+Float64FromInt32(2)*y3*y3/(Float64FromInt32(1)-y3)) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, Tdouble_t(Float64FromInt32(2)*y3)+Tdouble_t(Tdouble_t(Float64FromInt32(2)*y3)*y3)/(Float64FromInt32(1)-y3))) } } else { /* avoid overflow */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, float64(Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))))) } if s != 0 { v1 = -y3 @@ -103255,22 +103266,22 @@ func Xatanhf(tls *TLS, x3 float32) (r float32) { /* handle underflow */ if *(*Tuint32_t)(unsafe.Pointer(bp)) < Uint32FromInt32(Int32FromInt32(1)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -103362,7 +103373,7 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { hx = hx/uint32(3) + _B1 } p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63))) *(*Tuint64_t)(unsafe.Pointer(bp)) |= uint64(hx) << int32(32) t = *(*float64)(unsafe.Pointer(bp)) /* @@ -103375,8 +103386,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103388,14 +103399,14 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * before the final error is larger than 0.667 ulps. */ *(*float64)(unsafe.Pointer(bp)) = t - *(*Tuint64_t)(unsafe.Pointer(bp)) = (*(*Tuint64_t)(unsafe.Pointer(bp)) + Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) + *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(*(*Tuint64_t)(unsafe.Pointer(bp))+Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103433,7 +103444,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103447,14 +103458,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103640,9 +103651,9 @@ func Xcopysign(tls *TLS, x float64, y float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp + 8)) = y p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | *(*Tuint64_t)(unsafe.Pointer(bp + 8))&(Uint64FromUint64(1)<log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -103942,12 +103953,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -104042,8 +104053,8 @@ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) + P = _pa0 + float64(s*(_pa1+float64(s*(_pa2+float64(s*(_pa3+float64(s*(_pa4+float64(s*(_pa5+float64(s*_pa6))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+float64(s*(_qa2+float64(s*(_qa3+float64(s*(_qa4+float64(s*(_qa5+float64(s*_qa6))))))))))) return Float64FromInt32(1) - _erx - P/Q } @@ -104056,18 +104067,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = Float64FromInt32(1) / float64(x*x) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = float64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = _ra0 + float64(s*(_ra1+float64(s*(_ra2+float64(s*(_ra3+float64(s*(_ra4+float64(s*(_ra5+float64(s*(_ra6+float64(s*_ra7))))))))))))) + S = float64(1) + float64(s*(_sa1+float64(s*(_sa2+float64(s*(_sa3+float64(s*(_sa4+float64(s*(_sa5+float64(s*(_sa6+float64(s*(_sa7+float64(s*_sa8))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = float64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = _rb0 + float64(s*(_rb1+float64(s*(_rb2+float64(s*(_rb3+float64(s*(_rb4+float64(s*(_rb5+float64(s*_rb6))))))))))) + S = float64(1) + float64(s*(_sb1+float64(s*(_sb2+float64(s*(_sb3+float64(s*(_sb4+float64(s*(_sb5+float64(s*(_sb6+float64(s*_sb7))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = _rb01 + s*(_rb11+s*(_rb21+s*(_rb31+s*(_rb41+s*(_rb51+s*_rb61))))) - S = Float32FromFloat32(1) + s*(_sb11+s*(_sb21+s*(_sb31+s*(_sb41+s*(_sb51+s*(_sb61+s*_sb71)))))) + R = _rb01 + float32(s*(_rb11+float32(s*(_rb21+float32(s*(_rb31+float32(s*(_rb41+float32(s*(_rb51+float32(s*_rb61))))))))))) + S = Float32FromFloat32(1) + float32(s*(_sb11+float32(s*(_sb21+float32(s*(_sb31+float32(s*(_sb41+float32(s*(_sb51+float32(s*(_sb61+float32(s*_sb71))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, (z-x)*(z+x)+R/S) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32((z-x)*(z+x))+R/S)) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -104274,13 +104285,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -104315,14 +104326,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -104335,7 +104346,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -104377,9 +104388,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104528,8 +104539,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104604,10 +104615,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104667,9 +104678,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by 1. */ - sbits = sbits - Uint64FromUint64(1)< 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -104853,11 +104864,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + float64(1) if k == int32(1024) { - y3 = y3 * float64(2) * float64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } return y3 - float64(1) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -105191,10 +105202,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float32(k) - hi = x3 - t*_ln2_hi1 /* t*ln2_hi is exact here */ - lo = t * _ln2_lo1 + hi = x3 - float32(t*_ln2_hi1) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * _ln2_lo1) } x3 = hi - lo c = hi - x3 - lo @@ -105202,7 +105213,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -105217,42 +105228,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = Float32FromFloat32(0.5) * x3 - hxs = x3 * hfx - r1 = Float32FromFloat32(1) + hxs*(_Q11+hxs*_Q21) - t = Float32FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float32FromFloat32(6) - x3*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(x3 * hfx) + r1 = Float32FromFloat32(1) + float32(hxs*(_Q11+float32(hxs*_Q21))) + t = Float32FromFloat32(3) - float32(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float32FromFloat32(6) - float32(x3*t)))) if k == 0 { /* c is 0 */ - return x3 - (x3*e - hxs) + return x3 - (float32(x3*e) - hxs) } - e = x3*(e-c) - c + e = float32(x3*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return Float32FromFloat32(0.5)*(x3-e) - Float32FromFloat32(0.5) + return float32(Float32FromFloat32(0.5)*(x3-e)) - Float32FromFloat32(0.5) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { - return -Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5))) + return float32(-Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5)))) } - return Float32FromFloat32(1) + Float32FromFloat32(2)*(x3-e) + return Float32FromFloat32(1) + float32(Float32FromFloat32(2)*(x3-e)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = *(*float32)(unsafe.Pointer(bp)) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + Float32FromFloat32(1) if k == int32(128) { - y3 = y3 * Float32FromFloat32(2) * Float32FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float32FromFloat32(2)) * Float32FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return y3 - Float32FromFloat32(1) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk + y3 = Tfloat_t((x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk) } return y3 } @@ -105287,7 +105298,7 @@ func Xfabs(tls *TLS, x float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp)) = x p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) return *(*float64)(unsafe.Pointer(bp)) } @@ -105601,7 +105612,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105611,8 +105622,8 @@ func _normalize(tls *TLS, x float64) (r Tnum) { } e = v2 } - ix = ix & (Uint64FromUint64(1)<= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y + z + return float64(x1*y) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y + z + return float64(x1*y) + z } return z } @@ -105752,7 +105763,7 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { } } else { /* exact +-0 */ - return x1*y + z + return float64(x1*y) + z } } e -= d @@ -105773,8 +105784,8 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105784,11 +105795,11 @@ func Xfma(tls *TLS, x1 float64, y float64, z float64) (r1 float64) { i = -i } r = float64(i) - r = Float64FromInt32(2)*r - c /* remove top bit */ + r = float64(Float64FromInt32(2)*r) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r - r += tiny * tiny * (r - r) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r) + r += float64(Tdouble_t(tiny*tiny) * (r - r)) } } else { /* only round once when scaled */ @@ -106112,11 +106123,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -106178,7 +106189,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -106194,7 +106205,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { } /* scale result */ if ex > 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -106255,11 +106266,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106319,7 +106330,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106378,7 +106389,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106391,9 +106402,9 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { } *(*int32)(unsafe.Pointer(e)) = ee - int32(0x3fe) p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff)) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000)) return *(*float64)(unsafe.Pointer(bp)) } @@ -106454,11 +106465,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106506,9 +106517,9 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { *(*float64)(unsafe.Pointer(bp + 8)) = y /* arrange |x| >= |y| */ p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) p2 = bp + 8 - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) if *(*Tuint64_t)(unsafe.Pointer(bp)) < *(*Tuint64_t)(unsafe.Pointer(bp + 8)) { ut = *(*struct { Fi [0]Tuint64_t @@ -106559,7 +106570,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106638,7 +106649,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return z * Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))) + return float32(z * Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -106831,8 +106842,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106841,10 +106852,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -106872,7 +106883,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106882,16 +106893,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -106937,12 +106948,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -107043,9 +107054,9 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107151,9 +107162,9 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (-Float64FromFloat64(0.125) + r/s) / x } @@ -107175,8 +107186,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107185,10 +107196,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -107215,7 +107226,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -107224,13 +107235,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -107271,12 +107282,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107376,9 +107387,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107484,9 +107495,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (-Float32FromFloat32(0.125) + r/s) / x } @@ -107513,8 +107524,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107523,13 +107534,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107559,21 +107570,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107619,10 +107630,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107722,9 +107733,9 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107829,9 +107840,9 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (float64(0.375) + r/s) / x } @@ -107849,8 +107860,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107859,13 +107870,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -107895,20 +107906,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -107950,10 +107961,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -108053,9 +108064,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -108160,9 +108171,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (Float32FromFloat32(0.375) + r/s) / x } @@ -108237,7 +108248,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -108248,7 +108259,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -108262,7 +108273,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -108281,16 +108292,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108300,7 +108311,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -108316,7 +108327,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -108324,7 +108335,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108338,7 +108349,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108355,9 +108366,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108439,7 +108450,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108452,7 +108463,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108512,7 +108523,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108525,7 +108536,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108543,16 +108554,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108562,7 +108573,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108578,7 +108589,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108586,7 +108597,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108600,7 +108611,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108617,9 +108628,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108682,7 +108693,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -108799,8 +108810,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -108847,7 +108858,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -109124,7 +109135,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -109162,31 +109173,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -109210,11 +109221,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109349,17 +109360,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+float64(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * float64(1.34217728e+08) + w = Tdouble_t(r * float64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109381,9 +109392,9 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) - ix = ix - Uint64FromUint64(52)<> (Int32FromInt32(52) - Int32FromInt32(LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109463,7 +109474,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109489,12 +109500,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109584,19 +109595,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = x - Float32FromFloat32(1) s = f / (Float32FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (_Lg21 + w*_Lg41) - t2 = z * (_Lg11 + w*_Lg31) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (_Lg21 + float32(w*_Lg41))) + t2 = Tfloat_t(z * (_Lg11 + float32(w*_Lg31))) R = t2 + t1 - hfsq = Float32FromFloat32(0.5) * f * f + hfsq = Tfloat_t(float32(Float32FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = hi *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = *(*float32)(unsafe.Pointer(bp)) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float32(k) - return dk*_log10_2lo1 + (lo+hi)*_ivln10lo1 + lo*_ivln10hi1 + hi*_ivln10hi1 + dk*_log10_2hi1 + return Tfloat_t(dk*_log10_2lo1) + Tfloat_t((lo+hi)*_ivln10lo1) + Tfloat_t(lo*_ivln10hi1) + Tfloat_t(hi*_ivln10hi1) + Tfloat_t(dk*_log10_2hi1) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109698,15 +109709,15 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)<> (Int32FromInt32(52) - Int32FromInt32(LOG2_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + float64(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v10 = y goto _11 @@ -109982,7 +109993,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -110004,14 +110015,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -110073,10 +110084,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<> Int32FromInt32(12) >> e + mask = uint64(-Uint64FromUint64(1) >> Int32FromInt32(12) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&mask == uint64(0) { *(*float64)(unsafe.Pointer(iptr)) = x p3 = bp - *(*Tuint64_t)(unsafe.Pointer(p3)) = *(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p3)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63))) return *(*float64)(unsafe.Pointer(bp)) } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^mask @@ -110497,13 +110508,13 @@ _2: if *(*Tuint64_t)(unsafe.Pointer(bp + 8)) == *(*Tuint64_t)(unsafe.Pointer(bp + 16)) { return y3 } - ax = *(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) - ay = *(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + ax = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) + ay = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) if ax == uint64(0) { if ay == uint64(0) { return y3 } - *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = *(*Tuint64_t)(unsafe.Pointer(bp + 16))&(Uint64FromUint64(1)< ay || (*(*Tuint64_t)(unsafe.Pointer(bp + 8))^*(*Tuint64_t)(unsafe.Pointer(bp + 16)))&(Uint64FromUint64(1)<> (Int32FromInt32(52) - Int32FromInt32(POW_LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -111073,10 +111084,10 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } @@ -111136,15 +111147,15 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) - ix = ix - Uint64FromUint64(52)<1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111350,22 +111361,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)< 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -111590,7 +111601,7 @@ end: if sy != 0 { y = -y } - if ex == ey || ex+int32(1) == ey && (Float64FromInt32(2)*x > y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111663,7 +111674,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111938,10 +111949,10 @@ func Xround(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + _toint6 } else { - y2 = x3 + _toint6 + y2 = float64(x3 + _toint6) } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > float64(0.5) { @@ -112005,7 +112016,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3 + _toint7) } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = x3 + _toint7 - _toint7 - x3 if y3 > Float32FromFloat32(0.5) { @@ -112059,7 +112070,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -112110,7 +112121,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -112118,7 +112129,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -112201,10 +112212,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -112213,7 +112224,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -112243,10 +112254,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -112255,7 +112266,7 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32(Int32FromInt32(0x7f)+n) << int32(23) - x = y * *(*float32)(unsafe.Pointer(bp)) + x = float32(y * *(*float32)(unsafe.Pointer(bp))) return x } @@ -112437,10 +112448,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112599,10 +112610,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112747,14 +112758,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -112795,12 +112806,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -112867,7 +112878,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -113017,7 +113028,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -113150,10 +113161,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -113290,18 +113301,18 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { /* note: this branch avoids raising overflow */ t = Float64FromInt32(1) - Float64FromInt32(0)/x3 } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113362,23 +113373,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -113426,12 +113437,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113527,8 +113538,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113610,7 +113621,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113634,17 +113645,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / float64(float64(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, float64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(float64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -113695,7 +113706,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if e < int32(12) { e = int32(1) } - m = -Uint64FromUint64(1) >> e + m = uint64(-Uint64FromUint64(1) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&m == uint64(0) { return x3 } @@ -113705,7 +113716,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^m @@ -114310,15 +114321,7 @@ func Xgethostid(tls *TLS) (r int64) { const optpos = 0 -type Tucontext_t3 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t1 -} - -type t__ucontext1 = Tucontext_t3 +type t__ucontext1 = Tucontext_t1 func X__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) { if __ccgo_strace { @@ -115466,7 +115469,7 @@ type Thistory = struct { Fbase int32 } -func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { +func _do_nftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { bp := tls.Alloc(192) defer tls.Free(192) var d, de, v10 uintptr @@ -115572,7 +115575,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } } if v8 = !(flags&Int32FromInt32(FTW_DEPTH) != 0); v8 { - v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+176) + v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+176) r = v7 } if v8 && v7 != 0 { @@ -115613,7 +115616,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(j))) = uint8('/') Xstrcpy(tls, path+uintptr(j)+uintptr(1), de+19) - v11 = _do_nftw(tls, path, fn, fd_limit-int32(1), flags, bp+144) + v11 = _do_nftw(tls, path, __ccgo_fp_fn, fd_limit-int32(1), flags, bp+144) r = v11 if v11 != 0 { Xclosedir(tls, d) @@ -115628,7 +115631,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(l))) = uint8(0) if v13 = flags&int32(FTW_DEPTH) != 0; v13 { - v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+176) + v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+176) r = v12 } if v13 && v12 != 0 { @@ -115637,9 +115640,11 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h return 0 } -func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 int32) { +type t__ccgo_fp__Xnftw_1 = func(*TLS, uintptr, uintptr, int32, uintptr) int32 + +func Xnftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, fn, fd_limit, flags, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, flags, origin(2)) defer func() { trc("-> %v", r1) }() } bp := tls.Alloc(4112) @@ -115659,7 +115664,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } Xmemcpy(tls, bp+4, path, l+uint64(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -116439,8 +116444,6 @@ type Tsockaddr_storage = struct { F__ss_align uint64 } -type t__ucontext2 = Tucontext_t2 - var _lock2 [1]int32 var _log_ident [32]uint8 var _log_opt int32 @@ -116878,14 +116881,6 @@ const SA = 194 const SB = 244 const bittab = 0 -type Tucontext_t4 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t -} - func Xbtowc(tls *TLS, c int32) (r Twint_t) { if __ccgo_strace { trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) @@ -116898,7 +116893,7 @@ func Xbtowc(tls *TLS, c int32) (r Twint_t) { if Uint32FromInt32(b) < uint32(128) { v1 = Uint32FromInt32(b) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117099,7 +117094,7 @@ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolUint64(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117270,7 +117265,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts goto resume0 } } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117498,7 +117493,7 @@ func Xmbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) { *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolInt32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117568,7 +117563,7 @@ func Xwcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) { *(*uint8)(unsafe.Pointer(s)) = Uint8FromInt32(wc) return uint64(1) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -117775,7 +117770,7 @@ func Xwctob(tls *TLS, c Twint_t) (r int32) { if c < uint32(128) { return Int32FromUint32(c) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118701,13 +118696,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]uint8 - Falg [1025]uint8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]uint8 Falg [1025]uint8 @@ -118715,14 +118703,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -119372,9 +119352,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -119420,7 +119402,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if int64(len1+int32(10)) > int64(r+uintptr(rlen))-int64(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -121611,10 +121593,10 @@ func X__h_errno_location(tls *TLS) (r uintptr) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - if !((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstack != 0) { + if !((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstack != 0) { return uintptr(unsafe.Pointer(&Xh_errno)) } - return ___get_tp(tls) + 144 + return uintptr(___get_tp(tls)) + 144 } func Xherror(tls *TLS, msg uintptr) { @@ -121638,18 +121620,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+1114, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - -type Tucontext_t5 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t1 -} - var _msgs1 = [84]uint8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -123461,7 +123431,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -123551,7 +123521,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -123564,9 +123534,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -123575,9 +123547,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int64(SYS_close), int64(fd)) return r @@ -128720,7 +128692,7 @@ func _fnmatch_internal(tls *TLS, pat uintptr, m Tsize_t, str uintptr, n Tsize_t, break } if v9 = uint32(*(*uint8)(unsafe.Pointer(s + uintptr(-Int32FromInt32(1))))) < uint32(128); !v9 { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v8 = int32(4) } else { v8 = int32(1) @@ -128958,7 +128930,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(144) defer tls.Free(144) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -129067,7 +129039,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -129104,7 +129076,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -129156,7 +129128,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -129167,7 +129139,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*uint8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -129279,9 +129251,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4128) @@ -129307,8 +129281,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -129327,7 +129301,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4120, bp+16, bp+4112) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, errfunc, bp+8) + error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, __ccgo_fp_errfunc, bp+8) } Xfree(tls, p) } @@ -134551,9 +134525,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134569,7 +134545,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134581,9 +134557,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return Xmemcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134599,7 +134577,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134618,9 +134596,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [97]uintptr @@ -134644,7 +134624,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134689,9 +134669,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -134699,17 +134681,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -134723,7 +134707,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134811,9 +134795,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [96]uintptr @@ -134833,7 +134819,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -134869,26 +134855,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -134899,8 +134887,6 @@ func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_poll), int64(fds), Int64FromUint64(n), int64(timeout), 0, 0, 0)))) } -type t__ucontext3 = Tucontext_t5 - func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v fds=%v n=%v to=%v mask=%v, (%v:)", tls, fds, n, to, mask, origin(2)) @@ -134936,8 +134922,6 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32 return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_ppoll), int64(fds), Int64FromUint64(n), int64(v3), int64(mask), int64(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0)))) } -type t__ucontext4 = Tucontext_t4 - func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v ts=%v mask=%v, (%v:)", tls, n, rfds, wfds, efds, ts, mask, origin(2)) @@ -134978,14 +134962,6 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_pselect6), int64(n), int64(rfds), int64(wfds), int64(efds), int64(v3), int64(bp+16))))) } -type Tucontext_t6 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t -} - func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v tv=%v, (%v:)", tls, n, rfds, wfds, efds, tv, origin(2)) @@ -135169,7 +135145,7 @@ func Xraise(tls *TLS, sig int32) (r int32) { var _ /* set at bp+0 */ Tsigset_t _ = ret X__block_app_sigs(tls, bp) - ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid), int64(sig))))) + ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid), int64(sig))))) X__restore_sigs(tls, bp) return ret } @@ -135505,14 +135481,6 @@ func Xsigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) { const SST_SIZE = 8 -type Tucontext_t7 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_sigmask Tsigset_t - Fuc_mcontext Tmcontext_t1 -} - func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v dest=%v left=%v right=%v, (%v:)", tls, dest, left, right, origin(2)) @@ -135992,13 +135960,13 @@ func _fstatat_statx(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r return ret } *(*Tstat)(unsafe.Pointer(st)) = Tstat{ - Fst_dev: uint64((*(*Tstatx1)(unsafe.Pointer(bp))).Fstx_dev_major)&Uint64FromUint64(0xfffff000)<= 0 { v1 = ___lockfile(tls, f) @@ -138771,7 +138739,7 @@ func X__do_orphaned_stdio_locks(tls *TLS) { } var f uintptr _ = f - f = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks + f = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks for { if !(f != 0) { break @@ -138799,7 +138767,7 @@ func X__unlist_locked_file(tls *TLS, f uintptr) { if (*TFILE)(unsafe.Pointer(f)).Fprev_locked != 0 { (*TFILE)(unsafe.Pointer((*TFILE)(unsafe.Pointer(f)).Fprev_locked)).Fnext_locked = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } else { - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } } } @@ -138827,7 +138795,7 @@ func Xftrylockfile(tls *TLS, f uintptr) (r1 int32) { var v13, v6 bool var v2, v3, v8 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = old, owner, r, self, tid, v, v1, v11, v13, v2, v3, v4, v6, v8, v9 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) tid = (*t__pthread)(unsafe.Pointer(self)).Ftid owner = AtomicLoadPInt32(f + 140) if owner & ^Int32FromInt32(MAYBE_WAITERS) == tid { @@ -138914,7 +138882,7 @@ func Xfwide(tls *TLS, f uintptr, mode int32) (r int32) { __need_unlock = v1 if mode != 0 { if !((*TFILE)(unsafe.Pointer(f)).Flocale != 0) { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -139166,7 +139134,7 @@ func Xgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139336,7 +139304,7 @@ func Xgetchar(tls *TLS) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = uintptr(unsafe.Pointer(&X__stdin_FILE)) l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -140098,7 +140066,7 @@ func Xputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -140278,7 +140246,7 @@ func Xputchar(tls *TLS, c1 int32) (r int32) { v1 = c1 v2 = uintptr(unsafe.Pointer(&X__stdout_FILE)) l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -140805,7 +140773,7 @@ func Xungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) { var v3 bool var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3, v4, v5, p6 - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+140) >= 0 { v1 = ___lockfile(tls, f) @@ -141057,7 +141025,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -141079,7 +141047,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -141268,7 +141236,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -141331,7 +141299,7 @@ _4: v14 = s s++ *(*uint8)(unsafe.Pointer(v14)) = Uint8FromInt32(Int32FromUint8(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int64(s)-t__predefined_ptrdiff_t(bp+516) == int64(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -141384,7 +141352,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -143234,7 +143202,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -143256,7 +143224,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -144886,9 +144854,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -144896,7 +144866,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint64(0) { try = base + uintptr(width*(nel/uint64(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint64(2) } else { @@ -145166,7 +145136,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*8)) >>= Uint64FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(912) defer tls.Free(912) var i, v1, v2 int32 @@ -145178,10 +145148,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[113]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -145198,7 +145168,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(928) defer tls.Free(928) var i, trail, v1 int32 @@ -145212,13 +145182,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint64(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -145233,13 +145203,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+16, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(784) defer tls.Free(784) @@ -145277,14 +145249,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0]&uint64(3) == uint64(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+768, int32(2)) pshift += int32(2) } else { if (*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint64FromInt64(int64(high)-int64(head)) { - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+768, int32(1)) @@ -145297,7 +145269,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[int32(1)] != uint64(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+768) @@ -145308,31 +145280,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 768)) ^= uint64(7) _shr(tls, bp+768, int32(1)) - _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+768, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift+int32(1), int32(1), bp) _shl(tls, bp+768, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+768, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -145427,7 +145403,7 @@ func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _strtox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _strtox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -145435,7 +145411,7 @@ func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_strtox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_strtox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -145707,7 +145683,7 @@ func Xwcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _wcstox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _wcstox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -145715,7 +145691,7 @@ func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_wcstox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_wcstox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xwcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -149807,7 +149783,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { if local != 0 { off = Int32FromUint32(_zi_read32(tls, _types+uintptr(int32(6)*Int32FromUint8(*(*uint8)(unsafe.Pointer(_index + uintptr(m-uint64(1)))))))) } - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { n /= uint64(2) } else { a = m @@ -149847,7 +149823,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { } /* If t is before first transition, use the above-found type * and the index-zero (after transition) type as the alt. */ - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { if alt != 0 { *(*Tsize_t)(unsafe.Pointer(alt)) = uint64(*(*uint8)(unsafe.Pointer(_index))) } @@ -150968,7 +150944,7 @@ func Xstrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t trc("tls=%v s=%v n=%v f=%v tm=%v, (%v:)", tls, s, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151712,7 +151688,7 @@ func Xwcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize trc("tls=%v wcs=%v n=%v f=%v tm=%v, (%v:)", tls, wcs, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xwcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -152814,7 +152790,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1208,15 +1208,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1234,7 +1234,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1247,14 +1247,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1269,7 +1269,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1285,14 +1285,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1308,8 +1308,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1335,24 +1335,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1365,15 +1365,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1382,48 +1382,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1524,8 +1524,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1604,8 +1604,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1940,18 +1940,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1963,16 +1963,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1989,7 +1989,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -2024,7 +2024,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -2042,14 +2042,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2065,8 +2065,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2098,18 +2098,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2121,16 +2121,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2138,7 +2138,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2160,27 +2160,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2308,16 +2308,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2424,16 +2424,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2536,7 +2536,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2553,7 +2553,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)< %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -24835,7 +24839,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -24873,8 +24877,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint64(8), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint64(8), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint64(cnt) @@ -24918,7 +24922,7 @@ func X__reset_tls(tls *TLS) { var mem, p uintptr var self Tpthread_t _, _, _, _, _ = i, mem, n, p, self - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) n = *(*Tuintptr_t)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(self)).Fdtv)) if n != 0 { p = X__libc.Ftls_head @@ -24954,7 +24958,7 @@ func X__init_ssp(tls *TLS, entropy uintptr) { * still be detected. Endianness is taken care of * automatically. */ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__stack_chk_guard)) + 1)) = uint8(0) - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fcanary = X__stack_chk_guard + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fcanary = X__stack_chk_guard } func X__stack_chk_fail(tls *TLS) { @@ -25563,7 +25567,7 @@ func Xstrerror(tls *TLS, e int32) (r uintptr) { trc("tls=%v e=%v, (%v:)", tls, e, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) { @@ -25620,9 +25624,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25634,7 +25640,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -26113,19 +26119,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26149,14 +26155,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26310,7 +26316,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26336,16 +26342,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26487,10 +26493,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26526,7 +26532,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26555,15 +26561,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26588,7 +26594,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -28198,15 +28204,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28328,7 +28336,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)< %v", r) }() } - return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + 5*8))) + return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale + 5*8))) } func _swapc(tls *TLS, x Tuint32_t, c int32) (r Tuint32_t) { @@ -31722,7 +31730,7 @@ func Xdcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n var _ /* z at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = alt_modlen, catlen, catname, csp, dirlen, dirname, domlen, l, lm, loc, loclen, locname, locp, map1, modlen, modname, name, np, old, old_cats, old_errno, p1, plural, q, r, rem, rule, tmp, trans, v10, v11, v12, v14, v15, v17, v20, v3, v5, v6, v8, v9 defer func() { Xrealloc(tls, name, 0) }() - loc = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + loc = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale old_errno = *(*int32)(unsafe.Pointer(X__errno_location(tls))) /* match gnu gettext behaviour */ if !(msgid1 != 0) { @@ -98375,7 +98383,7 @@ func Xiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb ui *(*Tmbstate_t)(unsafe.Pointer(bp + 24)) = Tmbstate_t{} type1 = *(*uint8)(unsafe.Pointer(map1 + uintptr(-Int32FromInt32(1)))) totype = *(*uint8)(unsafe.Pointer(tomap + uintptr(-Int32FromInt32(1)))) - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if !(in != 0) || !(*(*uintptr)(unsafe.Pointer(in)) != 0) || !(*(*Tsize_t)(unsafe.Pointer(inb)) != 0) { return uint64(0) @@ -99409,7 +99417,7 @@ func X__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { trc("tls=%v item=%v, (%v:)", tls, item, origin(2)) defer func() { trc("-> %v", r) }() } - return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xnl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { @@ -100127,7 +100135,7 @@ func Xstrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) { @@ -100293,7 +100301,7 @@ func Xstrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize var ret Tssize_t _, _ = ap, ret ap = va - ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale, fmt, ap) + ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale, fmt, ap) _ = ap return ret } @@ -100368,7 +100376,7 @@ func Xstrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100457,7 +100465,7 @@ func X__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) { var global, old, v1, v2 Tlocale_t var self Tpthread_t _, _, _, _, _ = global, old, self, v1, v2 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) old = (*t__pthread)(unsafe.Pointer(self)).Flocale global = uintptr(unsafe.Pointer(&X__libc)) + 56 if new1 != 0 { @@ -100500,7 +100508,7 @@ func Xwcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100541,7 +100549,7 @@ func Xwcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100585,12 +100593,12 @@ func X__cos(tls *TLS, x float64, y float64) (r1 float64) { } var hz, r, w, z Tdouble_t _, _, _, _ = hz, r, w, z - z = x * x - w = z * z - r = z*(_C1+z*(_C2+z*_C3)) + w*w*(_C4+z*(_C5+z*_C6)) - hz = float64(0.5) * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = Tdouble_t(z*(_C1+float64(z*(_C2+float64(z*_C3))))) + Tdouble_t(Tdouble_t(w*w)*(_C4+float64(z*(_C5+float64(z*_C6))))) + hz = Tdouble_t(float64(0.5) * z) w = float64(1) - hz - return w + (Float64FromFloat64(1) - w - hz + (z*r - x*y)) + return w + (Float64FromFloat64(1) - w - hz + (Tdouble_t(z*r) - Tdouble_t(x*y))) } // C documentation @@ -100610,10 +100618,10 @@ func X__cosdf(tls *TLS, x float64) (r1 float32) { var r, w, z Tdouble_t _, _, _ = r, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _C21 + z*_C31 - return float32(float64(1) + z*_C0 + w*_C11 + w*z*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _C21 + float64(z*_C31) + return float32(float64(1) + float64(z*_C0) + float64(w*_C11) + float64(Tdouble_t(w*z)*r)) } // C documentation @@ -100638,7 +100646,7 @@ func X__expo2(tls *TLS, x float64, sign float64) (r float64) { scale = *(*float64)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexp(tls, x-_kln22) * (sign * scale) * scale + return float64(float64(Xexp(tls, x-_kln22)*float64(sign*scale)) * scale) } // C documentation @@ -100663,7 +100671,7 @@ func X__expo2f(tls *TLS, x float32, sign float32) (r float32) { scale = *(*float32)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexpf(tls, x-_kln23) * (sign * scale) * scale + return float32(float32(Xexpf(tls, x-_kln23)*float32(sign*scale)) * scale) } func X__fpclassify(tls *TLS, x float64) (r int32) { @@ -100861,7 +100869,7 @@ func X__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float64(v2 * y2) v4 = y goto _5 _5: @@ -100884,7 +100892,7 @@ func X__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float32(v2 * y2) v4 = y goto _5 _5: @@ -100965,14 +100973,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { } } else { if !(sign != 0) { - z = x - Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(2)*_pio2_1t + z = x - float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(2)*_pio2_1t) return int32(2) } else { - z = x + Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(2)*_pio2_1t + z = x + float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(2)*_pio2_1t) return -int32(2) } } @@ -100983,14 +100991,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(3)*_pio2_1t + z = x - float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(3)*_pio2_1t) return int32(3) } else { - z = x + Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(3)*_pio2_1t + z = x + float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(3)*_pio2_1t) return -int32(3) } } else { @@ -100998,14 +101006,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(4)*_pio2_1t + z = x - float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(4)*_pio2_1t) return int32(4) } else { - z = x + Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(4)*_pio2_1t + z = x + float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(4)*_pio2_1t) return -int32(4) } } @@ -101017,22 +101025,22 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { medium: ; /* rint(x/(pi/2)) */ - fn = x*_invpio2 + _toint - _toint + fn = Tdouble_t(x*_invpio2) + _toint - _toint n = int32(fn) - r = x - fn*_pio2_1 - w = fn * _pio2_1t /* 1st round, good to 85 bits */ + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) /* 1st round, good to 85 bits */ /* Matters with directed rounding. */ if r-w < -_pio4 { n-- fn-- - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } else { if r-w > _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -101041,17 +101049,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -101079,7 +101087,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07)) goto _3 _3: ; @@ -101259,7 +101267,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101283,8 +101291,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101293,8 +101301,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101387,7 +101395,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101414,8 +101422,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101430,7 +101438,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101449,7 +101457,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -101640,19 +101648,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + _toint1 - _toint1 n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -101749,14 +101757,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + float64(z*(_S3+float64(z*_S4))) + float64(Tdouble_t(z*w)*(_S5+float64(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + float64(v*(_S1+float64(z*r))) } else { - return x - (z*(Float64FromFloat64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(float64(Float64FromFloat64(0.5)*y)-float64(v*r))) - y - Tdouble_t(v*_S1)) } return r1 } @@ -101778,11 +101786,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S31 + float64(z*_S41) + s = Tdouble_t(z * x) + return float32(x + float64(s*(_S11+float64(z*_S21))) + float64(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -101825,21 +101833,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + float64(w*(_T[int32(3)]+float64(w*(_T[int32(5)]+float64(w*(_T[int32(7)]+float64(w*(_T[int32(9)]+float64(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + float64(w*(_T[int32(4)]+float64(w*(_T[int32(6)]+float64(w*(_T[int32(8)]+float64(w*(_T[int32(10)]+float64(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + float64(z*(Tdouble_t(s*(r+v))+y)) + float64(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - float64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(float64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -101860,7 +101868,7 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { a0 = v3 v4 = *(*Tuint64_t)(unsafe.Pointer(&a0))>>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -101961,24 +101969,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -102021,24 +102029,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -102069,11 +102077,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102107,11 +102115,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102150,8 +102158,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102171,7 +102179,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102181,21 +102189,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102214,8 +102222,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = z * (_pS03 + z*(_pS13+z*_pS23)) - q = Float32FromFloat32(1) + z*_qS13 + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = Float32FromFloat32(1) + float32(z*_qS13) return p / q } @@ -102232,7 +102240,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102241,12 +102249,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102290,11 +102298,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint64(8) == uint64(4) { @@ -102303,7 +102311,7 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } } @@ -102355,11 +102363,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint64(4) == uint64(4) { @@ -102485,7 +102493,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if ix < uint32(0x3ff30000) { /* |x| < 1.1875 */ if ix < uint32(0x3fe60000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (float64(2)*x3 - float64(1)) / (float64(2) + x3) + x3 = (float64(float64(2)*x3) - float64(1)) / (float64(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - float64(1)) / (x3 + float64(1)) @@ -102493,7 +102501,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } else { if ix < uint32(0x40038000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - float64(1.5)) / (float64(1) + float64(1.5)*x3) + x3 = (x3 - float64(1.5)) / (float64(1) + float64(float64(1.5)*x3)) } else { /* 2.4375 <= |x| < 2^66 */ id = int32(3) x3 = -Float64FromFloat64(1) / x3 @@ -102501,15 +102509,15 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tdouble_t(x3 * x3) + w = Tdouble_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT[0] + w*(_aT[int32(2)]+w*(_aT[int32(4)]+w*(_aT[int32(6)]+w*(_aT[int32(8)]+w*_aT[int32(10)]))))) - s2 = w * (_aT[int32(1)] + w*(_aT[int32(3)]+w*(_aT[int32(5)]+w*(_aT[int32(7)]+w*_aT[int32(9)])))) + s1 = Tdouble_t(z * (_aT[0] + float64(w*(_aT[int32(2)]+float64(w*(_aT[int32(4)]+float64(w*(_aT[int32(6)]+float64(w*(_aT[int32(8)]+float64(w*_aT[int32(10)]))))))))))) + s2 = Tdouble_t(w * (_aT[int32(1)] + float64(w*(_aT[int32(3)]+float64(w*(_aT[int32(5)]+float64(w*(_aT[int32(7)]+float64(w*_aT[int32(9)]))))))))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float64(x3*(s1+s2)) } - z = _atanhi[id] - (x3*(s1+s2) - _atanlo[id] - x3) + z = _atanhi[id] - (float64(x3*(s1+s2)) - _atanlo[id] - x3) if sign != 0 { v4 = -z } else { @@ -102595,9 +102603,9 @@ _2: case uint32(1): return -_pi / Float64FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float64FromInt32(3) * _pi / Float64FromInt32(4) /* atan(+INF,-INF) */ + return float64(Float64FromInt32(3)*_pi) / Float64FromInt32(4) /* atan(+INF,-INF) */ case uint32(3): - return float64(-Int32FromInt32(3)) * _pi / Float64FromInt32(4) /* atan(-INF,-INF) */ + return float64(float64(-Int32FromInt32(3))*_pi) / Float64FromInt32(4) /* atan(-INF,-INF) */ } } else { switch m { @@ -102712,9 +102720,9 @@ _2: case uint32(1): return -_pi1 / Float32FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float32FromInt32(3) * _pi1 / Float32FromInt32(4) /*atan(+INF,-INF)*/ + return float32(Float32FromInt32(3)*_pi1) / Float32FromInt32(4) /*atan(+INF,-INF)*/ case uint32(3): - return float32(-Int32FromInt32(3)) * _pi1 / Float32FromInt32(4) /*atan(-INF,-INF)*/ + return float32(float32(-Int32FromInt32(3))*_pi1) / Float32FromInt32(4) /*atan(-INF,-INF)*/ } } else { switch m { @@ -102829,7 +102837,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x00800000) { /* raise underflow for subnormal x */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -102846,7 +102854,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x3f980000) { /* |x| < 1.1875 */ if ix < uint32(0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (Float32FromFloat32(2)*x3 - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) + x3 = (float32(Float32FromFloat32(2)*x3) - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - Float32FromFloat32(1)) / (x3 + Float32FromFloat32(1)) @@ -102854,7 +102862,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } else { if ix < uint32(0x401c0000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + Float32FromFloat32(1.5)*x3) + x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + float32(Float32FromFloat32(1.5)*x3)) } else { /* 2.4375 <= |x| < 2**26 */ id = int32(3) x3 = -Float32FromFloat32(1) / x3 @@ -102862,15 +102870,15 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tfloat_t(x3 * x3) + w = Tfloat_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT1[0] + w*(_aT1[int32(2)]+w*_aT1[int32(4)])) - s2 = w * (_aT1[int32(1)] + w*_aT1[int32(3)]) + s1 = Tfloat_t(z * (_aT1[0] + float32(w*(_aT1[int32(2)]+float32(w*_aT1[int32(4)]))))) + s2 = Tfloat_t(w * (_aT1[int32(1)] + float32(w*_aT1[int32(3)]))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float32(x3*(s1+s2)) } - z = _atanhi1[id] - (x3*(s1+s2) - _atanlo1[id] - x3) + z = _atanhi1[id] - (float32(x3*(s1+s2)) - _atanlo1[id] - x3) if sign != 0 { v4 = -z } else { @@ -102927,11 +102935,11 @@ func Xatanh(tls *TLS, x3 float64) (r float64) { } } else { /* |x| < 0.5, up to 1.7ulp error */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*y3+Float64FromInt32(2)*y3*y3/(Float64FromInt32(1)-y3)) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, Tdouble_t(Float64FromInt32(2)*y3)+Tdouble_t(Tdouble_t(Float64FromInt32(2)*y3)*y3)/(Float64FromInt32(1)-y3))) } } else { /* avoid overflow */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, float64(Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))))) } if s != 0 { v1 = -y3 @@ -102977,22 +102985,22 @@ func Xatanhf(tls *TLS, x3 float32) (r float32) { /* handle underflow */ if *(*Tuint32_t)(unsafe.Pointer(bp)) < Uint32FromInt32(Int32FromInt32(1)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -103084,7 +103092,7 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { hx = hx/uint32(3) + _B1 } p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63))) *(*Tuint64_t)(unsafe.Pointer(bp)) |= uint64(hx) << int32(32) t = *(*float64)(unsafe.Pointer(bp)) /* @@ -103097,8 +103105,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103110,14 +103118,14 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * before the final error is larger than 0.667 ulps. */ *(*float64)(unsafe.Pointer(bp)) = t - *(*Tuint64_t)(unsafe.Pointer(bp)) = (*(*Tuint64_t)(unsafe.Pointer(bp)) + Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) + *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(*(*Tuint64_t)(unsafe.Pointer(bp))+Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103155,7 +103163,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103169,14 +103177,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103362,9 +103370,9 @@ func Xcopysign(tls *TLS, x float64, y float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp + 8)) = y p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | *(*Tuint64_t)(unsafe.Pointer(bp + 8))&(Uint64FromUint64(1)<log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -103664,12 +103672,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -103764,8 +103772,8 @@ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) + P = _pa0 + float64(s*(_pa1+float64(s*(_pa2+float64(s*(_pa3+float64(s*(_pa4+float64(s*(_pa5+float64(s*_pa6))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+float64(s*(_qa2+float64(s*(_qa3+float64(s*(_qa4+float64(s*(_qa5+float64(s*_qa6))))))))))) return Float64FromInt32(1) - _erx - P/Q } @@ -103778,18 +103786,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = Float64FromInt32(1) / float64(x*x) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = float64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = _ra0 + float64(s*(_ra1+float64(s*(_ra2+float64(s*(_ra3+float64(s*(_ra4+float64(s*(_ra5+float64(s*(_ra6+float64(s*_ra7))))))))))))) + S = float64(1) + float64(s*(_sa1+float64(s*(_sa2+float64(s*(_sa3+float64(s*(_sa4+float64(s*(_sa5+float64(s*(_sa6+float64(s*(_sa7+float64(s*_sa8))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = float64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = _rb0 + float64(s*(_rb1+float64(s*(_rb2+float64(s*(_rb3+float64(s*(_rb4+float64(s*(_rb5+float64(s*_rb6))))))))))) + S = float64(1) + float64(s*(_sb1+float64(s*(_sb2+float64(s*(_sb3+float64(s*(_sb4+float64(s*(_sb5+float64(s*(_sb6+float64(s*_sb7))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = _rb01 + s*(_rb11+s*(_rb21+s*(_rb31+s*(_rb41+s*(_rb51+s*_rb61))))) - S = Float32FromFloat32(1) + s*(_sb11+s*(_sb21+s*(_sb31+s*(_sb41+s*(_sb51+s*(_sb61+s*_sb71)))))) + R = _rb01 + float32(s*(_rb11+float32(s*(_rb21+float32(s*(_rb31+float32(s*(_rb41+float32(s*(_rb51+float32(s*_rb61))))))))))) + S = Float32FromFloat32(1) + float32(s*(_sb11+float32(s*(_sb21+float32(s*(_sb31+float32(s*(_sb41+float32(s*(_sb51+float32(s*(_sb61+float32(s*_sb71))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, (z-x)*(z+x)+R/S) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32((z-x)*(z+x))+R/S)) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -103996,13 +104004,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -104037,14 +104045,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -104057,7 +104065,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -104099,9 +104107,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104250,8 +104258,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104326,10 +104334,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104389,9 +104397,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by 1. */ - sbits = sbits - Uint64FromUint64(1)< 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -104575,11 +104583,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + float64(1) if k == int32(1024) { - y3 = y3 * float64(2) * float64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } return y3 - float64(1) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -104913,10 +104921,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float32(k) - hi = x3 - t*_ln2_hi1 /* t*ln2_hi is exact here */ - lo = t * _ln2_lo1 + hi = x3 - float32(t*_ln2_hi1) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * _ln2_lo1) } x3 = hi - lo c = hi - x3 - lo @@ -104924,7 +104932,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -104939,42 +104947,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = Float32FromFloat32(0.5) * x3 - hxs = x3 * hfx - r1 = Float32FromFloat32(1) + hxs*(_Q11+hxs*_Q21) - t = Float32FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float32FromFloat32(6) - x3*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(x3 * hfx) + r1 = Float32FromFloat32(1) + float32(hxs*(_Q11+float32(hxs*_Q21))) + t = Float32FromFloat32(3) - float32(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float32FromFloat32(6) - float32(x3*t)))) if k == 0 { /* c is 0 */ - return x3 - (x3*e - hxs) + return x3 - (float32(x3*e) - hxs) } - e = x3*(e-c) - c + e = float32(x3*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return Float32FromFloat32(0.5)*(x3-e) - Float32FromFloat32(0.5) + return float32(Float32FromFloat32(0.5)*(x3-e)) - Float32FromFloat32(0.5) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { - return -Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5))) + return float32(-Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5)))) } - return Float32FromFloat32(1) + Float32FromFloat32(2)*(x3-e) + return Float32FromFloat32(1) + float32(Float32FromFloat32(2)*(x3-e)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = *(*float32)(unsafe.Pointer(bp)) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + Float32FromFloat32(1) if k == int32(128) { - y3 = y3 * Float32FromFloat32(2) * Float32FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float32FromFloat32(2)) * Float32FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return y3 - Float32FromFloat32(1) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk + y3 = Tfloat_t((x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk) } return y3 } @@ -105009,7 +105017,7 @@ func Xfabs(tls *TLS, x float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp)) = x p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) return *(*float64)(unsafe.Pointer(bp)) } @@ -105323,7 +105331,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105333,8 +105341,8 @@ func _normalize(tls *TLS, x float64) (r Tnum) { } e = v2 } - ix = ix & (Uint64FromUint64(1)<= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y1 + z + return float64(x1*y1) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y1 + z + return float64(x1*y1) + z } return z } @@ -105525,7 +105533,7 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { } } else { /* exact +-0 */ - return x1*y1 + z + return float64(x1*y1) + z } } e -= d @@ -105546,8 +105554,8 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r1) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r1) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105557,11 +105565,11 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { i = -i } r1 = float64(i) - r1 = Float64FromInt32(2)*r1 - c /* remove top bit */ + r1 = float64(Float64FromInt32(2)*r1) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r1 - r1 += tiny * tiny * (r1 - r1) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r1) + r1 += float64(Tdouble_t(tiny*tiny) * (r1 - r1)) } } else { /* only round once when scaled */ @@ -105885,11 +105893,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105951,7 +105959,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105967,7 +105975,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { } /* scale result */ if ex > 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -106028,11 +106036,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106092,7 +106100,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106151,7 +106159,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106164,9 +106172,9 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { } *(*int32)(unsafe.Pointer(e)) = ee - int32(0x3fe) p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff)) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000)) return *(*float64)(unsafe.Pointer(bp)) } @@ -106227,11 +106235,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106279,9 +106287,9 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { *(*float64)(unsafe.Pointer(bp + 8)) = y /* arrange |x| >= |y| */ p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) p2 = bp + 8 - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) if *(*Tuint64_t)(unsafe.Pointer(bp)) < *(*Tuint64_t)(unsafe.Pointer(bp + 8)) { ut = *(*struct { Fi [0]Tuint64_t @@ -106332,7 +106340,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106411,7 +106419,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return z * Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))) + return float32(z * Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -106604,8 +106612,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106614,10 +106622,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -106645,7 +106653,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106655,16 +106663,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -106710,12 +106718,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -106816,9 +106824,9 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -106924,9 +106932,9 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (-Float64FromFloat64(0.125) + r/s) / x } @@ -106948,8 +106956,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106958,10 +106966,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -106988,7 +106996,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106997,13 +107005,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -107044,12 +107052,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107149,9 +107157,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107257,9 +107265,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (-Float32FromFloat32(0.125) + r/s) / x } @@ -107286,8 +107294,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107296,13 +107304,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107332,21 +107340,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107392,10 +107400,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107495,9 +107503,9 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107602,9 +107610,9 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (float64(0.375) + r/s) / x } @@ -107622,8 +107630,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107632,13 +107640,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -107668,20 +107676,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -107723,10 +107731,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107826,9 +107834,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z**(*float32)(unsafe.Pointer(q + 4*4)))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z**(*float32)(unsafe.Pointer(q + 4*4))))))))))) return Float32FromFloat32(1) + r/s } @@ -107933,9 +107941,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = Float32FromFloat32(1) / (x * x) - r = *(*float32)(unsafe.Pointer(p)) + z*(*(*float32)(unsafe.Pointer(p + 1*4))+z*(*(*float32)(unsafe.Pointer(p + 2*4))+z*(*(*float32)(unsafe.Pointer(p + 3*4))+z*(*(*float32)(unsafe.Pointer(p + 4*4))+z**(*float32)(unsafe.Pointer(p + 5*4)))))) - s = Float32FromFloat32(1) + z*(*(*float32)(unsafe.Pointer(q))+z*(*(*float32)(unsafe.Pointer(q + 1*4))+z*(*(*float32)(unsafe.Pointer(q + 2*4))+z*(*(*float32)(unsafe.Pointer(q + 3*4))+z*(*(*float32)(unsafe.Pointer(q + 4*4))+z**(*float32)(unsafe.Pointer(q + 5*4))))))) + z = Float32FromFloat32(1) / float32(x*x) + r = *(*float32)(unsafe.Pointer(p)) + float32(z*(*(*float32)(unsafe.Pointer(p + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(p + 4*4))+float32(z**(*float32)(unsafe.Pointer(p + 5*4))))))))))) + s = Float32FromFloat32(1) + float32(z*(*(*float32)(unsafe.Pointer(q))+float32(z*(*(*float32)(unsafe.Pointer(q + 1*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 2*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 3*4))+float32(z*(*(*float32)(unsafe.Pointer(q + 4*4))+float32(z**(*float32)(unsafe.Pointer(q + 5*4))))))))))))) return (Float32FromFloat32(0.375) + r/s) / x } @@ -108010,7 +108018,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -108021,7 +108029,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -108035,7 +108043,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -108054,16 +108062,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108073,7 +108081,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -108089,7 +108097,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -108097,7 +108105,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108111,7 +108119,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108128,9 +108136,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108212,7 +108220,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108225,7 +108233,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108285,7 +108293,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108298,7 +108306,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108316,16 +108324,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108335,7 +108343,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108351,7 +108359,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108359,7 +108367,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108373,7 +108381,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108390,9 +108398,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108455,7 +108463,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -108572,8 +108580,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -108620,7 +108628,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -108897,7 +108905,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -108935,31 +108943,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -108983,11 +108991,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109137,17 +109145,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+float64(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * float64(1.34217728e+08) + w = Tdouble_t(r * float64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109169,9 +109177,9 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) - ix = ix - Uint64FromUint64(52)<> (Int32FromInt32(52) - Int32FromInt32(LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109251,7 +109259,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109277,12 +109285,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109372,19 +109380,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = x - Float32FromFloat32(1) s = f / (Float32FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (_Lg21 + w*_Lg41) - t2 = z * (_Lg11 + w*_Lg31) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (_Lg21 + float32(w*_Lg41))) + t2 = Tfloat_t(z * (_Lg11 + float32(w*_Lg31))) R = t2 + t1 - hfsq = Float32FromFloat32(0.5) * f * f + hfsq = Tfloat_t(float32(Float32FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = hi *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = *(*float32)(unsafe.Pointer(bp)) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float32(k) - return dk*_log10_2lo1 + (lo+hi)*_ivln10lo1 + lo*_ivln10hi1 + hi*_ivln10hi1 + dk*_log10_2hi1 + return Tfloat_t(dk*_log10_2lo1) + Tfloat_t((lo+hi)*_ivln10lo1) + Tfloat_t(lo*_ivln10hi1) + Tfloat_t(hi*_ivln10hi1) + Tfloat_t(dk*_log10_2hi1) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109486,15 +109494,15 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)<> (Int32FromInt32(52) - Int32FromInt32(LOG2_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + float64(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v10 = y goto _11 @@ -109770,7 +109778,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -109792,14 +109800,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -109861,10 +109869,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<> Int32FromInt32(12) >> e + mask = uint64(-Uint64FromUint64(1) >> Int32FromInt32(12) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&mask == uint64(0) { *(*float64)(unsafe.Pointer(iptr)) = x p3 = bp - *(*Tuint64_t)(unsafe.Pointer(p3)) = *(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p3)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63))) return *(*float64)(unsafe.Pointer(bp)) } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^mask @@ -110285,13 +110293,13 @@ _2: if *(*Tuint64_t)(unsafe.Pointer(bp + 8)) == *(*Tuint64_t)(unsafe.Pointer(bp + 16)) { return y3 } - ax = *(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) - ay = *(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + ax = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) + ay = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) if ax == uint64(0) { if ay == uint64(0) { return y3 } - *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = *(*Tuint64_t)(unsafe.Pointer(bp + 16))&(Uint64FromUint64(1)< ay || (*(*Tuint64_t)(unsafe.Pointer(bp + 8))^*(*Tuint64_t)(unsafe.Pointer(bp + 16)))&(Uint64FromUint64(1)<> (Int32FromInt32(52) - Int32FromInt32(POW_LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -110861,10 +110869,10 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } @@ -110924,15 +110932,15 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) - ix = ix - Uint64FromUint64(52)<1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111138,22 +111146,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)< 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -111378,7 +111386,7 @@ end: if sy != 0 { y = -y } - if ex == ey || ex+int32(1) == ey && (Float64FromInt32(2)*x > y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111451,7 +111459,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111726,10 +111734,10 @@ func Xround(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + _toint6 } else { - y2 = x3 + _toint6 + y2 = float64(x3 + _toint6) } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > float64(0.5) { @@ -111793,7 +111801,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3 + _toint7) } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = x3 + _toint7 - _toint7 - x3 if y3 > Float32FromFloat32(0.5) { @@ -111847,7 +111855,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -111898,7 +111906,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -111906,7 +111914,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -111989,10 +111997,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -112001,7 +112009,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -112031,10 +112039,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -112043,7 +112051,7 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32(Int32FromInt32(0x7f)+n) << int32(23) - x = y * *(*float32)(unsafe.Pointer(bp)) + x = float32(y * *(*float32)(unsafe.Pointer(bp))) return x } @@ -112225,10 +112233,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112387,10 +112395,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112535,14 +112543,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -112583,12 +112591,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -112655,7 +112663,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -112805,7 +112813,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -112938,10 +112946,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -113078,18 +113086,18 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { /* note: this branch avoids raising overflow */ t = Float64FromInt32(1) - Float64FromInt32(0)/x3 } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113150,23 +113158,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -113214,12 +113222,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113315,8 +113323,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113398,7 +113406,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113422,17 +113430,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / float64(float64(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, float64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(float64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -113483,7 +113491,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if e < int32(12) { e = int32(1) } - m = -Uint64FromUint64(1) >> e + m = uint64(-Uint64FromUint64(1) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&m == uint64(0) { return x3 } @@ -113493,7 +113501,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^m @@ -115234,7 +115242,7 @@ type Thistory = struct { Fbase int32 } -func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { +func _do_nftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { bp := tls.Alloc(176) defer tls.Free(176) var d, de, v10 uintptr @@ -115340,7 +115348,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } } if v8 = !(flags&Int32FromInt32(FTW_DEPTH) != 0); v8 { - v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+160) + v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+160) r = v7 } if v8 && v7 != 0 { @@ -115381,7 +115389,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(j))) = uint8('/') Xstrcpy(tls, path+uintptr(j)+uintptr(1), de+19) - v11 = _do_nftw(tls, path, fn, fd_limit-int32(1), flags, bp+128) + v11 = _do_nftw(tls, path, __ccgo_fp_fn, fd_limit-int32(1), flags, bp+128) r = v11 if v11 != 0 { Xclosedir(tls, d) @@ -115396,7 +115404,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(l))) = uint8(0) if v13 = flags&int32(FTW_DEPTH) != 0; v13 { - v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+160) + v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+160) r = v12 } if v13 && v12 != 0 { @@ -115405,9 +115413,11 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h return 0 } -func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 int32) { +type t__ccgo_fp__Xnftw_1 = func(*TLS, uintptr, uintptr, int32, uintptr) int32 + +func Xnftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, fn, fd_limit, flags, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, flags, origin(2)) defer func() { trc("-> %v", r1) }() } bp := tls.Alloc(4112) @@ -115427,7 +115437,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } Xmemcpy(tls, bp+4, path, l+uint64(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -116656,7 +116666,7 @@ func Xbtowc(tls *TLS, c int32) (r Twint_t) { if Uint32FromInt32(b) < uint32(128) { v1 = Uint32FromInt32(b) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -116857,7 +116867,7 @@ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolUint64(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117028,7 +117038,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts goto resume0 } } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117256,7 +117266,7 @@ func Xmbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) { *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolInt32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117326,7 +117336,7 @@ func Xwcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) { *(*uint8)(unsafe.Pointer(s)) = Uint8FromInt32(wc) return uint64(1) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -117533,7 +117543,7 @@ func Xwctob(tls *TLS, c Twint_t) (r int32) { if c < uint32(128) { return Int32FromUint32(c) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118363,13 +118373,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]uint8 - Falg [1025]uint8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]uint8 Falg [1025]uint8 @@ -118377,14 +118380,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -119034,9 +119029,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -119082,7 +119079,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if int64(len1+int32(10)) > int64(r+uintptr(rlen))-int64(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -121159,10 +121156,10 @@ func X__h_errno_location(tls *TLS) (r uintptr) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - if !((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstack != 0) { + if !((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstack != 0) { return uintptr(unsafe.Pointer(&Xh_errno)) } - return ___get_tp(tls) + 144 + return uintptr(___get_tp(tls)) + 144 } func Xherror(tls *TLS, msg uintptr) { @@ -121186,10 +121183,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+1111, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - var _msgs1 = [84]uint8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -122977,7 +122970,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -123067,7 +123060,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -123080,9 +123073,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -123091,9 +123086,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int64(SYS_close), int64(fd)) return r @@ -127962,7 +127957,7 @@ func _fnmatch_internal(tls *TLS, pat uintptr, m Tsize_t, str uintptr, n Tsize_t, break } if v9 = uint32(*(*uint8)(unsafe.Pointer(s + uintptr(-Int32FromInt32(1))))) < uint32(128); !v9 { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v8 = int32(4) } else { v8 = int32(1) @@ -128200,7 +128195,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(128) defer tls.Free(128) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -128309,7 +128304,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -128346,7 +128341,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -128398,7 +128393,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -128409,7 +128404,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*uint8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -128521,9 +128516,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4128) @@ -128549,8 +128546,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -128569,7 +128566,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4120, bp+16, bp+4112) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, errfunc, bp+8) + error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, __ccgo_fp_errfunc, bp+8) } Xfree(tls, p) } @@ -133793,9 +133790,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133811,7 +133810,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133823,9 +133822,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return Xmemcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -133841,7 +133842,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -133860,9 +133861,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [97]uintptr @@ -133886,7 +133889,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -133931,9 +133934,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -133941,17 +133946,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -133965,7 +133972,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134053,9 +134060,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [96]uintptr @@ -134075,7 +134084,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -134111,26 +134120,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -134415,7 +134426,7 @@ func Xraise(tls *TLS, sig int32) (r int32) { var _ /* set at bp+0 */ Tsigset_t _ = ret X__block_app_sigs(tls, bp) - ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid), int64(sig))))) + ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid), int64(sig))))) X__restore_sigs(tls, bp) return ret } @@ -135194,13 +135205,13 @@ func _fstatat_statx(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r return ret } *(*Tstat)(unsafe.Pointer(st)) = Tstat{ - Fst_dev: uint64((*(*Tstatx1)(unsafe.Pointer(bp))).Fstx_dev_major)&Uint64FromUint64(0xfffff000)<= 0 { v1 = ___lockfile(tls, f) @@ -137865,7 +137876,7 @@ func X__do_orphaned_stdio_locks(tls *TLS) { } var f uintptr _ = f - f = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks + f = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks for { if !(f != 0) { break @@ -137893,7 +137904,7 @@ func X__unlist_locked_file(tls *TLS, f uintptr) { if (*TFILE)(unsafe.Pointer(f)).Fprev_locked != 0 { (*TFILE)(unsafe.Pointer((*TFILE)(unsafe.Pointer(f)).Fprev_locked)).Fnext_locked = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } else { - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } } } @@ -137920,7 +137931,7 @@ func Xftrylockfile(tls *TLS, f uintptr) (r int32) { var self Tpthread_t var v4 bool _, _, _, _, _, _, _, _ = old, owner, self, tid, tmp, v1, v2, v4 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) tid = (*t__pthread)(unsafe.Pointer(self)).Ftid owner = AtomicLoadPInt32(f + 140) if owner & ^Int32FromInt32(MAYBE_WAITERS) == tid { @@ -137983,7 +137994,7 @@ func Xfwide(tls *TLS, f uintptr, mode int32) (r int32) { __need_unlock = v1 if mode != 0 { if !((*TFILE)(unsafe.Pointer(f)).Flocale != 0) { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -138201,7 +138212,7 @@ func Xgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -138337,7 +138348,7 @@ func Xgetchar(tls *TLS) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = uintptr(unsafe.Pointer(&X__stdin_FILE)) l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139065,7 +139076,7 @@ func Xputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -139211,7 +139222,7 @@ func Xputchar(tls *TLS, c1 int32) (r int32) { v1 = c1 v2 = uintptr(unsafe.Pointer(&X__stdout_FILE)) l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -139738,7 +139749,7 @@ func Xungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) { var v3 bool var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3, v4, v5, p6 - ploc = ___get_tp(tls) + 152 + ploc = uintptr(___get_tp(tls)) + 152 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+140) >= 0 { v1 = ___lockfile(tls, f) @@ -139990,7 +140001,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -140012,7 +140023,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -140201,7 +140212,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -140264,7 +140275,7 @@ _4: v14 = s s++ *(*uint8)(unsafe.Pointer(v14)) = Uint8FromInt32(Int32FromUint8(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int64(s)-t__predefined_ptrdiff_t(bp+516) == int64(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -140317,7 +140328,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -142167,7 +142178,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -142189,7 +142200,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -143819,9 +143830,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -143829,7 +143842,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint64(0) { try = base + uintptr(width*(nel/uint64(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint64(2) } else { @@ -144090,7 +144103,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*8)) >>= Uint64FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(912) defer tls.Free(912) var i, v1, v2 int32 @@ -144102,10 +144115,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[113]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -144122,7 +144135,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(928) defer tls.Free(928) var i, trail, v1 int32 @@ -144136,13 +144149,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint64(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -144157,13 +144170,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+16, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(784) defer tls.Free(784) @@ -144201,14 +144216,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0]&uint64(3) == uint64(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+768, int32(2)) pshift += int32(2) } else { if (*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint64FromInt64(int64(high)-int64(head)) { - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+768, int32(1)) @@ -144221,7 +144236,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[int32(1)] != uint64(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+768) @@ -144232,31 +144247,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 768)) ^= uint64(7) _shr(tls, bp+768, int32(1)) - _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+768, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift+int32(1), int32(1), bp) _shl(tls, bp+768, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+768, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -144351,7 +144370,7 @@ func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _strtox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _strtox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -144359,7 +144378,7 @@ func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_strtox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_strtox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -144631,7 +144650,7 @@ func Xwcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _wcstox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _wcstox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -144639,7 +144658,7 @@ func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_wcstox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_wcstox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xwcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -148731,7 +148750,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { if local != 0 { off = Int32FromUint32(_zi_read32(tls, _types+uintptr(int32(6)*Int32FromUint8(*(*uint8)(unsafe.Pointer(_index + uintptr(m-uint64(1)))))))) } - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { n /= uint64(2) } else { a = m @@ -148771,7 +148790,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { } /* If t is before first transition, use the above-found type * and the index-zero (after transition) type as the alt. */ - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { if alt != 0 { *(*Tsize_t)(unsafe.Pointer(alt)) = uint64(*(*uint8)(unsafe.Pointer(_index))) } @@ -149891,7 +149910,7 @@ func Xstrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t trc("tls=%v s=%v n=%v f=%v tm=%v, (%v:)", tls, s, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -150635,7 +150654,7 @@ func Xwcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize trc("tls=%v wcs=%v n=%v f=%v tm=%v, (%v:)", tls, wcs, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xwcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151713,7 +151732,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)<= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: h * Xcos(tls, y), - 1: Xcopysign(tls, h, x) * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(Xcopysign(tls, h, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1159,15 +1167,15 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ 0: Float64FromComplex128(z), - 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x), + 1: float64(+(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)] * Xcopysign(tls, Float64FromInt32(1), x)), } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge * x + h = float64(_huge * x) v6 = [2]float64{ - 0: h * h * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(float64(h*h) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1185,7 +1193,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ 0: y - y, - 1: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 1: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), } return *(*complex128)(unsafe.Pointer(&v7)) } @@ -1198,14 +1206,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if iy|ly == 0 && ix >= int32(0x7ff00000) { if hx&int32(0xfffff)|lx == 0 { v8 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), x) * y, + 0: float64(x * x), + 1: float64(Xcopysign(tls, Float64FromInt32(0), x) * y), } return *(*complex128)(unsafe.Pointer(&v8)) } v9 = [2]float64{ - 0: x * x, - 1: Xcopysign(tls, Float64FromInt32(0), (x+x)*y), + 0: float64(x * x), + 1: Xcopysign(tls, Float64FromInt32(0), float64((x+x)*y)), } return *(*complex128)(unsafe.Pointer(&v9)) } @@ -1220,7 +1228,7 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1236,14 +1244,14 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * x * Xcos(tls, y), - 1: x * Xsin(tls, y), + 0: float64(float64(x*x) * Xcos(tls, y)), + 1: float64(x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -1259,8 +1267,8 @@ func Xccosh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -1286,24 +1294,24 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if iy == 0 { v1 = [2]float32{ 0: Xcoshf(tls, x), - 1: x * y, + 1: float32(x * y), } return *(*complex64)(unsafe.Pointer(&v1)) } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xcoshf(tls, x) * Xcosf(tls, y), - 1: Xsinhf(tls, x) * Xsinf(tls, y), + 0: float32(Xcoshf(tls, x) * Xcosf(tls, y)), + 1: float32(Xsinhf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: Xcopysignf(tls, h, x) * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(Xcopysignf(tls, h, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -1316,15 +1324,15 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ 0: Float32FromComplex64(z), - 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x), + 1: float32(+(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)] * Xcopysignf(tls, Float32FromInt32(1), x)), } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge1 * x + h = float32(_huge1 * x) v6 = [2]float32{ - 0: h * h * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(float32(h*h) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1333,48 +1341,48 @@ func Xccoshf(tls *TLS, z complex64) (r complex64) { if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ 0: y - y, - 1: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 1: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), } return *(*complex64)(unsafe.Pointer(&v7)) } if iy == 0 && ix >= int32(0x7f800000) { if hx&int32(0x7fffff) == 0 { v8 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), x) * y, + 0: float32(x * x), + 1: float32(Xcopysignf(tls, Float32FromInt32(0), x) * y), } return *(*complex64)(unsafe.Pointer(&v8)) } v9 = [2]float32{ - 0: x * x, - 1: Xcopysignf(tls, Float32FromInt32(0), (x+x)*y), + 0: float32(x * x), + 1: Xcopysignf(tls, Float32FromInt32(0), float32((x+x)*y)), } return *(*complex64)(unsafe.Pointer(&v9)) } if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * x * Xcosf(tls, y), - 1: x * Xsinf(tls, y), + 0: float32(float32(x*x) * Xcosf(tls, y)), + 1: float32(x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -1475,8 +1483,8 @@ func Xcexp(tls *TLS, z complex128) (r complex128) { */ exp_x = Xexp(tls, x) v6 = [2]float64{ - 0: exp_x * Xcos(tls, y), - 1: exp_x * Xsin(tls, y), + 0: float64(exp_x * Xcos(tls, y)), + 1: float64(exp_x * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1555,8 +1563,8 @@ func Xcexpf(tls *TLS, z complex64) (r complex64) { */ exp_x = Xexpf(tls, x) v6 = [2]float32{ - 0: exp_x * Xcosf(tls, y), - 1: exp_x * Xsinf(tls, y), + 0: float32(exp_x * Xcosf(tls, y)), + 1: float32(exp_x * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -1891,18 +1899,18 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } if ix < int32(0x40360000) { /* small x: normal case */ v2 = [2]float64{ - 0: Xsinh(tls, x) * Xcos(tls, y), - 1: Xcosh(tls, x) * Xsin(tls, y), + 0: float64(Xsinh(tls, x) * Xcos(tls, y)), + 1: float64(Xcosh(tls, x) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v2)) } /* |x| >= 22, so cosh(x) ~= exp(|x|) */ if ix < int32(0x40862e42) { /* x < 710: exp(|x|) won't overflow */ - h = Xexp(tls, Xfabs(tls, x)) * float64(0.5) + h = float64(Xexp(tls, Xfabs(tls, x)) * float64(0.5)) v3 = [2]float64{ - 0: Xcopysign(tls, h, x) * Xcos(tls, y), - 1: h * Xsin(tls, y), + 0: float64(Xcopysign(tls, h, x) * Xcos(tls, y)), + 1: float64(h * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v3)) } else { @@ -1914,16 +1922,16 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { } z = X__ldexp_cexp(tls, *(*complex128)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float64{ - 0: Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x), + 0: float64(Float64FromComplex128(z) * Xcopysign(tls, Float64FromInt32(1), x)), 1: +(*(*[2]float64)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex128)(unsafe.Pointer(&v5)) } else { /* x >= 1455: the result always overflows */ - h = _huge2 * x + h = float64(_huge2 * x) v6 = [2]float64{ - 0: h * Xcos(tls, y), - 1: h * h * Xsin(tls, y), + 0: float64(h * Xcos(tls, y)), + 1: float64(float64(h*h) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v6)) } @@ -1940,7 +1948,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { */ if ix|lx == 0 && iy >= int32(0x7ff00000) { v7 = [2]float64{ - 0: Xcopysign(tls, Float64FromInt32(0), x*(y-y)), + 0: Xcopysign(tls, Float64FromInt32(0), float64(x*(y-y))), 1: y - y, } return *(*complex128)(unsafe.Pointer(&v7)) @@ -1975,7 +1983,7 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix < int32(0x7ff00000) && iy >= int32(0x7ff00000) { v10 = [2]float64{ 0: y - y, - 1: x * (y - y), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v10)) } @@ -1993,14 +2001,14 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { if ix >= int32(0x7ff00000) && hx&int32(0xfffff)|lx == 0 { if iy >= int32(0x7ff00000) { v11 = [2]float64{ - 0: x * x, - 1: x * (y - y), + 0: float64(x * x), + 1: float64(x * (y - y)), } return *(*complex128)(unsafe.Pointer(&v11)) } v12 = [2]float64{ - 0: x * Xcos(tls, y), - 1: float64(X__builtin_inff(tls)) * Xsin(tls, y), + 0: float64(x * Xcos(tls, y)), + 1: float64(float64(X__builtin_inff(tls)) * Xsin(tls, y)), } return *(*complex128)(unsafe.Pointer(&v12)) } @@ -2016,8 +2024,8 @@ func Xcsinh(tls *TLS, z complex128) (r complex128) { * nonzero y. Choice = don't raise (except for signaling NaNs). */ v13 = [2]float64{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float64(float64(x*x) * (y - y)), + 1: float64((x + x) * (y - y)), } return *(*complex128)(unsafe.Pointer(&v13)) } @@ -2049,18 +2057,18 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix < int32(0x41100000) { /* small x: normal case */ v2 = [2]float32{ - 0: Xsinhf(tls, x) * Xcosf(tls, y), - 1: Xcoshf(tls, x) * Xsinf(tls, y), + 0: float32(Xsinhf(tls, x) * Xcosf(tls, y)), + 1: float32(Xcoshf(tls, x) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v2)) } /* |x| >= 9, so cosh(x) ~= exp(|x|) */ if ix < int32(0x42b17218) { /* x < 88.7: expf(|x|) won't overflow */ - h = Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5) + h = float32(Xexpf(tls, Xfabsf(tls, x)) * Float32FromFloat32(0.5)) v3 = [2]float32{ - 0: Xcopysignf(tls, h, x) * Xcosf(tls, y), - 1: h * Xsinf(tls, y), + 0: float32(Xcopysignf(tls, h, x) * Xcosf(tls, y)), + 1: float32(h * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v3)) } else { @@ -2072,16 +2080,16 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } z = X__ldexp_cexpf(tls, *(*complex64)(unsafe.Pointer(&v4)), -int32(1)) v5 = [2]float32{ - 0: Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x), + 0: float32(Float32FromComplex64(z) * Xcopysignf(tls, Float32FromInt32(1), x)), 1: +(*(*[2]float32)(unsafe.Pointer(&z)))[int32(1)], } return *(*complex64)(unsafe.Pointer(&v5)) } else { /* x >= 192.7: the result always overflows */ - h = _huge3 * x + h = float32(_huge3 * x) v6 = [2]float32{ - 0: h * Xcosf(tls, y), - 1: h * h * Xsinf(tls, y), + 0: float32(h * Xcosf(tls, y)), + 1: float32(float32(h*h) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v6)) } @@ -2089,7 +2097,7 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { } if ix == 0 && iy >= int32(0x7f800000) { v7 = [2]float32{ - 0: Xcopysignf(tls, Float32FromInt32(0), x*(y-y)), + 0: Xcopysignf(tls, Float32FromInt32(0), float32(x*(y-y))), 1: y - y, } return *(*complex64)(unsafe.Pointer(&v7)) @@ -2111,27 +2119,27 @@ func Xcsinhf(tls *TLS, z complex64) (r complex64) { if ix < int32(0x7f800000) && iy >= int32(0x7f800000) { v10 = [2]float32{ 0: y - y, - 1: x * (y - y), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v10)) } if ix >= int32(0x7f800000) && hx&int32(0x7fffff) == 0 { if iy >= int32(0x7f800000) { v11 = [2]float32{ - 0: x * x, - 1: x * (y - y), + 0: float32(x * x), + 1: float32(x * (y - y)), } return *(*complex64)(unsafe.Pointer(&v11)) } v12 = [2]float32{ - 0: x * Xcosf(tls, y), - 1: X__builtin_inff(tls) * Xsinf(tls, y), + 0: float32(x * Xcosf(tls, y)), + 1: float32(X__builtin_inff(tls) * Xsinf(tls, y)), } return *(*complex64)(unsafe.Pointer(&v12)) } v13 = [2]float32{ - 0: x * x * (y - y), - 1: (x + x) * (y - y), + 0: float32(float32(x*x) * (y - y)), + 1: float32((x + x) * (y - y)), } return *(*complex64)(unsafe.Pointer(&v13)) } @@ -2259,16 +2267,16 @@ _9: } /* Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float64FromInt32(0) { - t = Xsqrt(tls, (a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((a+Xhypot(tls, a, b))*float64(0.5))) v14 = [2]float64{ 0: t, - 1: b / (Float64FromInt32(2) * t), + 1: b / float64(Float64FromInt32(2)*t), } result = *(*complex128)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (-a+Xhypot(tls, a, b))*float64(0.5)) + t = Xsqrt(tls, float64((-a+Xhypot(tls, a, b))*float64(0.5))) v15 = [2]float64{ - 0: Xfabs(tls, b) / (Float64FromInt32(2) * t), + 0: Xfabs(tls, b) / float64(Float64FromInt32(2)*t), 1: Xcopysign(tls, t, b), } result = *(*complex128)(unsafe.Pointer(&v15)) @@ -2375,16 +2383,16 @@ _9: * This is Algorithm 312, CACM vol 10, Oct 1967. */ if a >= Float32FromInt32(0) { - t = Xsqrt(tls, (float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v14 = [2]float32{ 0: float32(t), - 1: float32(float64(b) / (Float64FromFloat64(2) * t)), + 1: float32(float64(b) / float64(Float64FromFloat64(2)*t)), } return *(*complex64)(unsafe.Pointer(&v14)) } else { - t = Xsqrt(tls, (float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5)) + t = Xsqrt(tls, float64((float64(-a)+Xhypot(tls, float64(a), float64(b)))*float64(0.5))) v15 = [2]float32{ - 0: float32(float64(Xfabsf(tls, b)) / (Float64FromFloat64(2) * t)), + 0: float32(float64(Xfabsf(tls, b)) / float64(Float64FromFloat64(2)*t)), 1: Xcopysignf(tls, float32(t), b), } return *(*complex64)(unsafe.Pointer(&v15)) @@ -2487,7 +2495,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if y == Float64FromInt32(0) { v2 = y } else { - v2 = x * y + v2 = float64(x * y) } v1 = [2]float64{ 0: x, @@ -2504,7 +2512,7 @@ func Xctanh(tls *TLS, z complex128) (r complex128) { if BoolInt32(v6&(-Uint64FromUint64(1)>>Int32FromInt32(1)) == Uint64FromUint64(0x7ff)< %v", r) }() } var cnt, len1, v2, v3 Tsize_t @@ -24898,7 +24910,7 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r if !(v1 != 0) { break } - if sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{sel})))(tls, de) != 0) { + if __ccgo_fp_sel != 0 && !((*(*func(*TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_sel})))(tls, de) != 0) { continue } if cnt >= len1 { @@ -24936,8 +24948,8 @@ func Xscandir(tls *TLS, path uintptr, res uintptr, sel uintptr, cmp uintptr) (r return -int32(1) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno - if cmp != 0 { - Xqsort(tls, names, cnt, uint64(8), cmp) + if __ccgo_fp_cmp != 0 { + Xqsort(tls, names, cnt, uint64(8), __ccgo_fp_cmp) } *(*uintptr)(unsafe.Pointer(res)) = names return Int32FromUint64(cnt) @@ -24981,7 +24993,7 @@ func X__reset_tls(tls *TLS) { var mem, p uintptr var self Tpthread_t _, _, _, _, _ = i, mem, n, p, self - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) n = *(*Tuintptr_t)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(self)).Fdtv)) if n != 0 { p = X__libc.Ftls_head @@ -25017,7 +25029,7 @@ func X__init_ssp(tls *TLS, entropy uintptr) { * still be detected. Endianness is taken care of * automatically. */ *(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__stack_chk_guard)) + 1)) = uint8(0) - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fcanary = X__stack_chk_guard + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fcanary = X__stack_chk_guard } func X__stack_chk_fail(tls *TLS) { @@ -25627,7 +25639,7 @@ func Xstrerror(tls *TLS, e int32) (r uintptr) { trc("tls=%v e=%v, (%v:)", tls, e, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strerror_l(tls, e, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrerror_l(tls *TLS, e int32, loc Tlocale_t) (r uintptr) { @@ -25684,9 +25696,11 @@ func X__funcs_on_quick_exit(tls *TLS) { } } -func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { +type t__ccgo_fp__Xat_quick_exit_0 = func(*TLS) + +func Xat_quick_exit(tls *TLS, __ccgo_fp_func uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v func1=%v, (%v:)", tls, func1, origin(2)) + trc("tls=%v __ccgo_fp_func=%v, (%v:)", tls, __ccgo_fp_func, origin(2)) defer func() { trc("-> %v", r1) }() } var r, v1 int32 @@ -25698,7 +25712,7 @@ func Xat_quick_exit(tls *TLS, func1 uintptr) (r1 int32) { } else { v1 = _count _count++ - _funcs[v1] = func1 + _funcs[v1] = __ccgo_fp_func } ___unlock(tls, uintptr(unsafe.Pointer(&_lock))) return r @@ -26275,19 +26289,19 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, } /* Handle zero specially to avoid nasty special cases later */ if !((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0] != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } /* Optimize small integers (w/no exponent) and over/under-flow */ if lrp == dc && dc < int64(10) && (bits > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bits == uint32(0)) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if lrp > int64(-emin/int32(2)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if lrp < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } /* Align incomplete final B1B digit */ if j != 0 { @@ -26311,14 +26325,14 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, /* Optimize small to mid-size integers (even in exp. notation) */ if lnz < int32(9) && lnz <= rp && rp < int32(18) { if rp == int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) + return float64(float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) } if rp < int32(9) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) / float64(_p10s[int32(8)-rp]) + return float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) / float64(_p10s[int32(8)-rp]) } bitlim = bits - int32(3)*(rp-Int32FromInt32(9)) if bitlim > int32(30) || (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]>>bitlim == uint32(0) { - return float64(sign) * float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0]) * float64(_p10s[rp-int32(10)]) + return float64(float64(float64(sign)*float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[0])) * float64(_p10s[rp-int32(10)])) } } /* Drop trailing zeros */ @@ -26472,7 +26486,7 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, z = v30 (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[v30-int32(1)] = uint32(0) } - y = Float64FromFloat64(1e+09)*y + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) + y = float64(Float64FromFloat64(1e+09)*y) + float64((*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))]) goto _28 _28: ; @@ -26498,16 +26512,16 @@ func _decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, if (a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z { t = (*(*[128]Tuint32_t)(unsafe.Pointer(bp)))[(a+i)&(Int32FromInt32(KMAX)-Int32FromInt32(1))] if t < uint32(500000000) && (t != 0 || (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) != z) { - frac += float64(0.25) * float64(sign) + frac += float64(float64(0.25) * float64(sign)) } else { if t > uint32(500000000) { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } else { if t == uint32(500000000) { if (a+i+int32(1))&(Int32FromInt32(KMAX)-Int32FromInt32(1)) == z { - frac += float64(0.5) * float64(sign) + frac += float64(float64(0.5) * float64(sign)) } else { - frac += float64(0.75) * float64(sign) + frac += float64(float64(0.75) * float64(sign)) } } } @@ -26649,10 +26663,10 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { if dc < int64(Int32FromInt32(LDBL_MANT_DIG)/Int32FromInt32(4)+Int32FromInt32(1)) { scale /= Float64FromInt32(16) - y += float64(d) * scale + y += float64(float64(d) * scale) } else { if d != 0 && !(gottail != 0) { - y += Float64FromFloat64(0.5) * scale + y += float64(Float64FromFloat64(0.5) * scale) gottail = int32(1) } } @@ -26688,7 +26702,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } else { X__shlim(tls, f, int64(Int32FromInt32(0))) } - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if !(gotrad != 0) { rp = dc @@ -26717,15 +26731,15 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 } e2 += int64(4)*rp - int64(32) if !(x != 0) { - return float64(sign) * float64(0) + return float64(float64(sign) * float64(0)) } if e2 > int64(-emin) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(1.79769313486231570815e+308) * Float64FromFloat64(1.79769313486231570815e+308) + return float64(float64(float64(sign)*Float64FromFloat64(1.79769313486231570815e+308)) * Float64FromFloat64(1.79769313486231570815e+308)) } if e2 < int64(emin-Int32FromInt32(2)*Int32FromInt32(LDBL_MANT_DIG)) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) - return float64(sign) * Float64FromFloat64(2.22507385850720138309e-308) * Float64FromFloat64(2.22507385850720138309e-308) + return float64(float64(float64(sign)*Float64FromFloat64(2.22507385850720138309e-308)) * Float64FromFloat64(2.22507385850720138309e-308)) } for x < uint32(0x80000000) { if y >= Float64FromFloat64(0.5) { @@ -26750,7 +26764,7 @@ func _hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int3 x++ y = Float64FromInt32(0) } - y = bias + float64(sign)*float64(x) + float64(sign)*y + y = bias + float64(float64(sign)*float64(x)) + float64(float64(sign)*y) y -= bias if !(y != 0) { *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(ERANGE) @@ -28191,15 +28205,17 @@ type TFTW = struct { Flevel int32 } -func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { +type t__ccgo_fp__Xftw_1 = func(*TLS, uintptr, uintptr, int32) int32 + +func Xftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32) (r int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v, (%v:)", tls, path, fn, fd_limit, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, origin(2)) defer func() { trc("-> %v", r) }() } /* The following cast assumes that calling a function with one * argument more than it needs behaves as expected. This is * actually undefined, but works on all real-world machines. */ - return Xnftw(tls, path, fn, fd_limit, int32(FTW_PHYS)) + return Xnftw(tls, path, __ccgo_fp_fn, fd_limit, int32(FTW_PHYS)) } const STATX_ALL = 4095 @@ -28321,7 +28337,7 @@ func Xgetloadavg(tls *TLS, a uintptr, n int32) (r int32) { if !(i < n) { break } - *(*float64)(unsafe.Pointer(a + uintptr(i)*8)) = Float64FromFloat64(1) / float64(Int32FromInt32(1)< %v", r) }() } - return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + 5*8))) + return X__lctrans_impl(tls, msg, *(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale + 5*8))) } func _swapc(tls *TLS, x Tuint32_t, c int32) (r Tuint32_t) { @@ -31648,7 +31656,7 @@ func Xdcngettext(tls *TLS, domainname uintptr, msgid1 uintptr, msgid2 uintptr, n var _ /* z at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = alt_modlen, catlen, catname, csp, dirlen, dirname, domlen, l, lm, loc, loclen, locname, locp, map1, modlen, modname, name, np, old_cats, old_errno, p1, plural, q, r, rem, rule, trans, v10, v11, v12, v14, v15, v17, v18, v21, v3, v5, v6, v8, v9 defer func() { Xrealloc(tls, name, 0) }() - loc = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale + loc = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale old_errno = *(*int32)(unsafe.Pointer(X__errno_location(tls))) /* match gnu gettext behaviour */ if !(msgid1 != 0) { @@ -98301,7 +98309,7 @@ func Xiconv(tls *TLS, cd Ticonv_t, in uintptr, inb uintptr, out uintptr, outb ui *(*Tmbstate_t)(unsafe.Pointer(bp + 24)) = Tmbstate_t{} type1 = *(*uint8)(unsafe.Pointer(map1 + uintptr(-Int32FromInt32(1)))) totype = *(*uint8)(unsafe.Pointer(tomap + uintptr(-Int32FromInt32(1)))) - ploc = ___get_tp(tls) + 168 + ploc = uintptr(___get_tp(tls)) + 168 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if !(in != 0) || !(*(*uintptr)(unsafe.Pointer(in)) != 0) || !(*(*Tsize_t)(unsafe.Pointer(inb)) != 0) { return uint64(0) @@ -99335,7 +99343,7 @@ func X__nl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { trc("tls=%v item=%v, (%v:)", tls, item, origin(2)) defer func() { trc("-> %v", r) }() } - return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__nl_langinfo_l(tls, item, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xnl_langinfo(tls *TLS, item Tnl_item) (r uintptr) { @@ -100053,7 +100061,7 @@ func Xstrcoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strcoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrcoll_l(tls *TLS, l uintptr, r uintptr, loc Tlocale_t) (r1 int32) { @@ -100219,7 +100227,7 @@ func Xstrfmon(tls *TLS, s uintptr, n Tsize_t, fmt uintptr, va uintptr) (r Tssize var ret Tssize_t _, _ = ap, ret ap = va - ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale, fmt, ap) + ret = _vstrfmon_l(tls, s, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale, fmt, ap) _ = ap return ret } @@ -100294,7 +100302,7 @@ func Xstrxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100383,7 +100391,7 @@ func X__uselocale(tls *TLS, new1 Tlocale_t) (r Tlocale_t) { var global, old, v1, v2 Tlocale_t var self Tpthread_t _, _, _, _, _ = global, old, self, v1, v2 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) old = (*t__pthread)(unsafe.Pointer(self)).Flocale global = uintptr(unsafe.Pointer(&X__libc)) + 56 if new1 != 0 { @@ -100426,7 +100434,7 @@ func Xwcscoll(tls *TLS, l uintptr, r uintptr) (r1 int32) { trc("tls=%v l=%v r=%v, (%v:)", tls, l, r, origin(2)) defer func() { trc("-> %v", r1) }() } - return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcscoll_l(tls, l, r, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100467,7 +100475,7 @@ func Xwcsxfrm(tls *TLS, dest uintptr, src uintptr, n Tsize_t) (r Tsize_t) { trc("tls=%v dest=%v src=%v n=%v, (%v:)", tls, dest, src, n, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsxfrm_l(tls, dest, src, n, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } // C documentation @@ -100511,12 +100519,12 @@ func X__cos(tls *TLS, x float64, y float64) (r1 float64) { } var hz, r, w, z Tdouble_t _, _, _, _ = hz, r, w, z - z = x * x - w = z * z - r = z*(_C1+z*(_C2+z*_C3)) + w*w*(_C4+z*(_C5+z*_C6)) - hz = float64(0.5) * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = Tdouble_t(z*(_C1+float64(z*(_C2+float64(z*_C3))))) + Tdouble_t(Tdouble_t(w*w)*(_C4+float64(z*(_C5+float64(z*_C6))))) + hz = Tdouble_t(float64(0.5) * z) w = float64(1) - hz - return w + (Float64FromFloat64(1) - w - hz + (z*r - x*y)) + return w + (Float64FromFloat64(1) - w - hz + (Tdouble_t(z*r) - Tdouble_t(x*y))) } // C documentation @@ -100536,10 +100544,10 @@ func X__cosdf(tls *TLS, x float64) (r1 float32) { var r, w, z Tdouble_t _, _, _ = r, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _C21 + z*_C31 - return float32(float64(1) + z*_C0 + w*_C11 + w*z*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _C21 + float64(z*_C31) + return float32(float64(1) + float64(z*_C0) + float64(w*_C11) + float64(Tdouble_t(w*z)*r)) } // C documentation @@ -100564,7 +100572,7 @@ func X__expo2(tls *TLS, x float64, sign float64) (r float64) { scale = *(*float64)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexp(tls, x-_kln22) * (sign * scale) * scale + return float64(float64(Xexp(tls, x-_kln22)*float64(sign*scale)) * scale) } // C documentation @@ -100589,7 +100597,7 @@ func X__expo2f(tls *TLS, x float32, sign float32) (r float32) { scale = *(*float32)(unsafe.Pointer(&v1)) /* exp(x - k ln2) * 2**(k-1) */ /* in directed rounding correct sign before rounding or overflow is important */ - return Xexpf(tls, x-_kln23) * (sign * scale) * scale + return float32(float32(Xexpf(tls, x-_kln23)*float32(sign*scale)) * scale) } func X__fpclassify(tls *TLS, x float64) (r int32) { @@ -100787,7 +100795,7 @@ func X__math_xflow(tls *TLS, sign Tuint32_t, y2 float64) (r float64) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float64(v2 * y2) v4 = y goto _5 _5: @@ -100810,7 +100818,7 @@ func X__math_xflowf(tls *TLS, sign Tuint32_t, y2 float32) (r float32) { v2 = y1 goto _3 _3: - y = v2 * y2 + y = float32(v2 * y2) v4 = y goto _5 _5: @@ -100891,14 +100899,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { } } else { if !(sign != 0) { - z = x - Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(2)*_pio2_1t + z = x - float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(2)*_pio2_1t) return int32(2) } else { - z = x + Float64FromInt32(2)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(2)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(2)*_pio2_1t + z = x + float64(Float64FromInt32(2)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(2)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(2)*_pio2_1t) return -int32(2) } } @@ -100909,14 +100917,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(3)*_pio2_1t + z = x - float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(3)*_pio2_1t) return int32(3) } else { - z = x + Float64FromInt32(3)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(3)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(3)*_pio2_1t + z = x + float64(Float64FromInt32(3)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(3)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(3)*_pio2_1t) return -int32(3) } } else { @@ -100924,14 +100932,14 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { goto medium } if !(sign != 0) { - z = x - Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z - Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Float64FromInt32(4)*_pio2_1t + z = x - float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z - Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) - Tdouble_t(Float64FromInt32(4)*_pio2_1t) return int32(4) } else { - z = x + Float64FromInt32(4)*_pio2_1 - *(*float64)(unsafe.Pointer(y)) = z + Float64FromInt32(4)*_pio2_1t - *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Float64FromInt32(4)*_pio2_1t + z = x + float64(Float64FromInt32(4)*_pio2_1) + *(*float64)(unsafe.Pointer(y)) = z + Tdouble_t(Float64FromInt32(4)*_pio2_1t) + *(*float64)(unsafe.Pointer(y + 1*8)) = z - *(*float64)(unsafe.Pointer(y)) + Tdouble_t(Float64FromInt32(4)*_pio2_1t) return -int32(4) } } @@ -100943,22 +100951,22 @@ func X__rem_pio2(tls *TLS, x float64, y uintptr) (r1 int32) { medium: ; /* rint(x/(pi/2)) */ - fn = x*_invpio2 + _toint - _toint + fn = Tdouble_t(x*_invpio2) + _toint - _toint n = int32(fn) - r = x - fn*_pio2_1 - w = fn * _pio2_1t /* 1st round, good to 85 bits */ + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) /* 1st round, good to 85 bits */ /* Matters with directed rounding. */ if r-w < -_pio4 { n-- fn-- - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } else { if r-w > _pio4 { n++ fn++ - r = x - fn*_pio2_1 - w = fn * _pio2_1t + r = x - float64(fn*_pio2_1) + w = Tdouble_t(fn * _pio2_1t) } } *(*float64)(unsafe.Pointer(y)) = r - w @@ -100967,17 +100975,17 @@ medium: ex = Int32FromUint32(ix >> int32(20)) if ex-ey > int32(16) { /* 2nd round, good to 118 bits */ t = r - w = fn * _pio2_2 + w = Tdouble_t(fn * _pio2_2) r = t - w - w = fn*_pio2_2t - (t - r - w) + w = Tdouble_t(fn*_pio2_2t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w *(*float64)(unsafe.Pointer(bp)) = *(*float64)(unsafe.Pointer(y)) ey = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if ex-ey > int32(49) { /* 3rd round, good to 151 bits, covers all cases */ t = r - w = fn * _pio2_3 + w = Tdouble_t(fn * _pio2_3) r = t - w - w = fn*_pio2_3t - (t - r - w) + w = Tdouble_t(fn*_pio2_3t) - (t - r - w) *(*float64)(unsafe.Pointer(y)) = r - w } } @@ -101005,7 +101013,7 @@ _1: break } (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i] = float64(int32(z)) - z = (z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07) + z = Tdouble_t((z - (*(*[3]float64)(unsafe.Pointer(bp + 8)))[i]) * float64(1.6777216e+07)) goto _3 _3: ; @@ -101185,7 +101193,7 @@ func X__rem_pio2_large(tls *TLS, x uintptr, y uintptr, e0 int32, nx int32, prec if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _4 _4: ; @@ -101209,8 +101217,8 @@ recompute: if !(j > 0) { break } - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) z = q[j-int32(1)] + fw goto _5 _5: @@ -101219,8 +101227,8 @@ recompute: j-- } /* compute n */ - z = Xscalbn(tls, z, q0) /* actual value of z */ - z -= float64(8) * Xfloor(tls, z*float64(0.125)) /* trim off integer >= 8 */ + z = Xscalbn(tls, z, q0) /* actual value of z */ + z -= float64(float64(8) * Xfloor(tls, float64(z*float64(0.125)))) /* trim off integer >= 8 */ n = int32(z) z -= float64(n) ih = 0 @@ -101313,7 +101321,7 @@ recompute: if !(j <= jx) { break } - fw += *(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j] + fw += float64(*(*float64)(unsafe.Pointer(x + uintptr(j)*8)) * f[jx+i-j]) goto _10 _10: ; @@ -101340,8 +101348,8 @@ recompute: } else { /* break z into 24-bit if necessary */ z = Xscalbn(tls, z, -q0) if z >= float64(1.6777216e+07) { - fw = float64(int32(Float64FromFloat64(5.960464477539063e-08) * z)) - (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - Float64FromFloat64(1.6777216e+07)*fw) + fw = float64(int32(float64(Float64FromFloat64(5.960464477539063e-08) * z))) + (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(z - float64(Float64FromFloat64(1.6777216e+07)*fw)) jz += int32(1) q0 += int32(24) (*(*[20]Tint32_t)(unsafe.Pointer(bp)))[jz] = int32(fw) @@ -101356,7 +101364,7 @@ recompute: if !(i >= 0) { break } - q[i] = fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i]) + q[i] = float64(fw * float64((*(*[20]Tint32_t)(unsafe.Pointer(bp)))[i])) fw *= float64(5.960464477539063e-08) goto _11 _11: @@ -101375,7 +101383,7 @@ recompute: if !(k <= jp && k <= jz-i) { break } - fw += _PIo2[k] * q[i+k] + fw += float64(_PIo2[k] * q[i+k]) goto _13 _13: ; @@ -101566,19 +101574,19 @@ func X__rem_pio2f(tls *TLS, x float32, y uintptr) (r int32) { /* 25+53 bit pi is good enough for medium size */ if ix < uint32(0x4dc90fdb) { /* |x| ~< 2^28*(pi/2), medium size */ /* Use a specialized rint() to get fn. */ - fn = float64(x)*_invpio21 + _toint1 - _toint1 + fn = Tdouble_t(float64(x)*_invpio21) + _toint1 - _toint1 n = int32(fn) - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) /* Matters with directed rounding. */ if *(*float64)(unsafe.Pointer(y)) < -_pio41 { n-- fn-- - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } else { if *(*float64)(unsafe.Pointer(y)) > _pio41 { n++ fn++ - *(*float64)(unsafe.Pointer(y)) = float64(x) - fn*_pio2_11 - fn*_pio2_1t1 + *(*float64)(unsafe.Pointer(y)) = float64(x) - Tdouble_t(fn*_pio2_11) - Tdouble_t(fn*_pio2_1t1) } } return n @@ -101675,14 +101683,14 @@ func X__sin(tls *TLS, x float64, y float64, iy int32) (r1 float64) { } var r, v, w, z Tdouble_t _, _, _, _ = r, v, w, z - z = x * x - w = z * z - r = _S2 + z*(_S3+z*_S4) + z*w*(_S5+z*_S6) - v = z * x + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S2 + float64(z*(_S3+float64(z*_S4))) + float64(Tdouble_t(z*w)*(_S5+float64(z*_S6))) + v = Tdouble_t(z * x) if iy == 0 { - return x + v*(_S1+z*r) + return x + float64(v*(_S1+float64(z*r))) } else { - return x - (z*(Float64FromFloat64(0.5)*y-v*r) - y - v*_S1) + return x - (Tdouble_t(z*(float64(Float64FromFloat64(0.5)*y)-float64(v*r))) - y - Tdouble_t(v*_S1)) } return r1 } @@ -101704,11 +101712,11 @@ func X__sindf(tls *TLS, x float64) (r1 float32) { var r, s, w, z Tdouble_t _, _, _, _ = r, s, w, z /* Try to optimize for parallel evaluation as in __tandf.c. */ - z = x * x - w = z * z - r = _S31 + z*_S41 - s = z * x - return float32(x + s*(_S11+z*_S21) + s*w*r) + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) + r = _S31 + float64(z*_S41) + s = Tdouble_t(z * x) + return float32(x + float64(s*(_S11+float64(z*_S21))) + float64(Tdouble_t(s*w)*r)) } var _T = [13]float64{ @@ -101751,21 +101759,21 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { x = _pio42 - x + (_pio4lo - y) y = float64(0) } - z = x * x - w = z * z + z = Tdouble_t(x * x) + w = Tdouble_t(z * z) /* * Break x^5*(T[1]+x^2*T[2]+...) into * x^5(T[1]+x^4*T[3]+...+x^20*T[11]) + * x^5(x^2*(T[2]+x^4*T[4]+...+x^22*[T12])) */ - r = _T[int32(1)] + w*(_T[int32(3)]+w*(_T[int32(5)]+w*(_T[int32(7)]+w*(_T[int32(9)]+w*_T[int32(11)])))) - v = z * (_T[int32(2)] + w*(_T[int32(4)]+w*(_T[int32(6)]+w*(_T[int32(8)]+w*(_T[int32(10)]+w*_T[int32(12)]))))) - s = z * x - r = y + z*(s*(r+v)+y) + s*_T[0] + r = _T[int32(1)] + float64(w*(_T[int32(3)]+float64(w*(_T[int32(5)]+float64(w*(_T[int32(7)]+float64(w*(_T[int32(9)]+float64(w*_T[int32(11)]))))))))) + v = Tdouble_t(z * (_T[int32(2)] + float64(w*(_T[int32(4)]+float64(w*(_T[int32(6)]+float64(w*(_T[int32(8)]+float64(w*(_T[int32(10)]+float64(w*_T[int32(12)]))))))))))) + s = Tdouble_t(z * x) + r = y + float64(z*(Tdouble_t(s*(r+v))+y)) + float64(s*_T[0]) w = x + r if big != 0 { s = float64(int32(1) - int32(2)*odd) - v = s - float64(2)*(x+(r-w*w/(w+s))) + v = s - Tdouble_t(float64(2)*(x+(r-Tdouble_t(w*w)/(w+s)))) if sign != 0 { v1 = -v } else { @@ -101786,7 +101794,7 @@ func X__tan(tls *TLS, x float64, y float64, odd int32) (r1 float64) { a0 = v3 v4 = *(*Tuint64_t)(unsafe.Pointer(&a0))>>Int32FromInt32(32)<>int32(31) != 0 { - return Float64FromInt32(2)*_pio2_hi + Float64FromFloat32(7.52316384526264e-37) + return float64(Float64FromInt32(2)*_pio2_hi) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) } @@ -101887,24 +101895,24 @@ func Xacos(tls *TLS, x float64) (r float64) { if ix <= uint32(0x3c600000) { /* |x| < 2**-57 */ return _pio2_hi + Float64FromFloat32(7.52316384526264e-37) } - return _pio2_hi - (x - (_pio2_lo - x*_R(tls, x*x))) + return _pio2_hi - (x - (_pio2_lo - float64(x*_R(tls, float64(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (float64(1) + x) * float64(0.5) + z = float64((float64(1) + x) * float64(0.5)) s = Xsqrt(tls, z) - w = _R(tls, z)*s - _pio2_lo - return Float64FromInt32(2) * (_pio2_hi - (s + w)) + w = float64(_R(tls, z)*s) - _pio2_lo + return float64(Float64FromInt32(2) * (_pio2_hi - (s + w))) } /* x > 0.5 */ - z = (float64(1) - x) * float64(0.5) + z = float64((float64(1) - x) * float64(0.5)) s = Xsqrt(tls, z) df = s v1 = *(*Tuint64_t)(unsafe.Pointer(&df))>>Int32FromInt32(32)<= uint32(0x3f800000) { if ix == uint32(0x3f800000) { if hx>>int32(31) != 0 { - return Float32FromInt32(2)*_pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) + return float32(Float32FromInt32(2)*_pio2_hi1) + Float32FromFloat32(7.52316384526264e-37) } return Float32FromInt32(0) } @@ -101947,24 +101955,24 @@ func Xacosf(tls *TLS, x float32) (r float32) { if ix <= uint32(0x32800000) { /* |x| < 2**-26 */ return _pio2_hi1 + Float32FromFloat32(7.52316384526264e-37) } - return _pio2_hi1 - (x - (_pio2_lo1 - x*_R1(tls, x*x))) + return _pio2_hi1 - (x - (_pio2_lo1 - float32(x*_R1(tls, float32(x*x))))) } /* x < -0.5 */ if hx>>int32(31) != 0 { - z = (Float32FromInt32(1) + x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) + x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) - w = _R1(tls, z)*s - _pio2_lo1 - return Float32FromInt32(2) * (_pio2_hi1 - (s + w)) + w = float32(_R1(tls, z)*s) - _pio2_lo1 + return float32(Float32FromInt32(2) * (_pio2_hi1 - (s + w))) } /* x > 0.5 */ - z = (Float32FromInt32(1) - x) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - x) * Float32FromFloat32(0.5)) s = Xsqrtf(tls, z) hx = *(*Tuint32_t)(unsafe.Pointer(&s)) v1 = hx & uint32(0xfffff000) df = *(*float32)(unsafe.Pointer(&v1)) - c = (z - df*df) / (s + df) - w = _R1(tls, z)*s + c - return Float32FromInt32(2) * (df + w) + c = (z - float32(df*df)) / (s + df) + w = float32(_R1(tls, z)*s) + c + return float32(Float32FromInt32(2) * (df + w)) } // C documentation @@ -101995,11 +102003,11 @@ func Xacosh(tls *TLS, x float64) (r float64) { /* x < 1 domain error is handled in the called functions */ if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| < 2, up to 2ulp error in [1,1.125] */ - return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, (x-Float64FromInt32(1))*(x-Float64FromInt32(1))+Float64FromInt32(2)*(x-Float64FromInt32(1)))) + return Xlog1p(tls, x-Float64FromInt32(1)+Xsqrt(tls, float64((x-Float64FromInt32(1))*(x-Float64FromInt32(1)))+float64(Float64FromInt32(2)*(x-Float64FromInt32(1))))) } if e < Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(26)) { /* |x| < 0x1p26 */ - return Xlog(tls, Float64FromInt32(2)*x-Float64FromInt32(1)/(x+Xsqrt(tls, x*x-Float64FromInt32(1)))) + return Xlog(tls, float64(Float64FromInt32(2)*x)-Float64FromInt32(1)/(x+Xsqrt(tls, float64(x*x)-Float64FromInt32(1)))) } /* |x| >= 0x1p26 or nan */ return Xlog(tls, x) + float64(0.6931471805599453) @@ -102033,11 +102041,11 @@ func Xacoshf(tls *TLS, x float32) (r float32) { if a < Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 0x1p12 or x <= -2 or nan */ return Xlogf(tls, x) + Float32FromFloat32(0.6931471805599453) @@ -102076,8 +102084,8 @@ var _qS41 = float64(0.07703815055590194) /* 0x3FB3B8C5, 0xB12E9282 * func _R2(tls *TLS, z float64) (r float64) { var p, q Tdouble_t _, _ = p, q - p = z * (_pS02 + z*(_pS12+z*(_pS22+z*(_pS31+z*(_pS41+z*_pS51))))) - q = float64(1) + z*(_qS12+z*(_qS21+z*(_qS31+z*_qS41))) + p = Tdouble_t(z * (_pS02 + float64(z*(_pS12+float64(z*(_pS22+float64(z*(_pS31+float64(z*(_pS41+float64(z*_pS51))))))))))) + q = float64(1) + float64(z*(_qS12+float64(z*(_qS21+float64(z*(_qS31+float64(z*_qS41))))))) return p / q } @@ -102097,7 +102105,7 @@ func Xasin(tls *TLS, x float64) (r1 float64) { lx = uint32(*(*Tuint64_t)(unsafe.Pointer(&x))) if ix-uint32(0x3ff00000)|lx == uint32(0) { /* asin(1) = +-pi/2 with inexact */ - return x*_pio2_hi2 + Float64FromFloat32(7.52316384526264e-37) + return float64(x*_pio2_hi2) + Float64FromFloat32(7.52316384526264e-37) } return Float64FromInt32(0) / (x - x) } @@ -102107,21 +102115,21 @@ func Xasin(tls *TLS, x float64) (r1 float64) { if ix < uint32(0x3e500000) && ix >= uint32(0x00100000) { return x } - return x + x*_R2(tls, x*x) + return x + float64(x*_R2(tls, float64(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5) + z = float64((Float64FromInt32(1) - Xfabs(tls, x)) * float64(0.5)) s = Xsqrt(tls, z) r = _R2(tls, z) if ix >= uint32(0x3fef3333) { /* if |x| > 0.975 */ - x = _pio2_hi2 - (Float64FromInt32(2)*(s+s*r) - _pio2_lo2) + x = _pio2_hi2 - (float64(Float64FromInt32(2)*(s+float64(s*r))) - _pio2_lo2) } else { /* f+c = sqrt(z) */ f = s v1 = *(*Tuint64_t)(unsafe.Pointer(&f))>>Int32FromInt32(32)<>int32(31) != 0 { return -x @@ -102140,8 +102148,8 @@ var _qS13 = float32(-Float64FromFloat64(0.7066296339)) func _R3(tls *TLS, z float32) (r float32) { var p, q Tfloat_t _, _ = p, q - p = float64(z * (_pS03 + z*(_pS13+z*_pS23))) - q = float64(Float32FromFloat32(1) + z*_qS13) + p = Tfloat_t(z * (_pS03 + float32(z*(_pS13+float32(z*_pS23))))) + q = float64(Float32FromFloat32(1) + float32(z*_qS13)) return float32(p / q) } @@ -102158,7 +102166,7 @@ func Xasinf(tls *TLS, x float32) (r float32) { ix = hx & uint32(0x7fffffff) if ix >= uint32(0x3f800000) { /* |x| >= 1 */ if ix == uint32(0x3f800000) { /* |x| == 1 */ - return float32(float64(x)*_pio2 + Float64FromFloat32(7.52316384526264e-37)) + return float32(float64(float64(x)*_pio2) + Float64FromFloat32(7.52316384526264e-37)) } /* asin(+-1) = +-pi/2 with inexact */ return Float32FromInt32(0) / (x - x) /* asin(|x|>1) is NaN */ } @@ -102167,12 +102175,12 @@ func Xasinf(tls *TLS, x float32) (r float32) { if ix < uint32(0x39800000) && ix >= uint32(0x00800000) { return x } - return x + x*_R3(tls, x*x) + return x + float32(x*_R3(tls, float32(x*x))) } /* 1 > |x| >= 0.5 */ - z = (Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5) + z = float32((Float32FromInt32(1) - Xfabsf(tls, x)) * Float32FromFloat32(0.5)) s = Xsqrt(tls, float64(z)) - x = float32(_pio2 - Float64FromInt32(2)*(s+s*float64(_R3(tls, z)))) + x = float32(_pio2 - float64(Float64FromInt32(2)*(s+float64(s*float64(_R3(tls, z)))))) if hx>>int32(31) != 0 { return -x } @@ -102216,11 +102224,11 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)+Int32FromInt32(1)) { /* |x| >= 2 */ - x3 = Xlog(tls, Float64FromInt32(2)*x3+Float64FromInt32(1)/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+x3)) + x3 = Xlog(tls, float64(Float64FromInt32(2)*x3)+Float64FromInt32(1)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+x3)) } else { if e >= Uint32FromInt32(Int32FromInt32(0x3ff)-Int32FromInt32(26)) { /* |x| >= 0x1p-26, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1p(tls, x3+x3*x3/(Xsqrt(tls, x3*x3+Float64FromInt32(1))+Float64FromInt32(1))) + x3 = Xlog1p(tls, x3+float64(x3*x3)/(Xsqrt(tls, float64(x3*x3)+Float64FromInt32(1))+Float64FromInt32(1))) } else { /* |x| < 0x1p-26, raise inexact if x != 0 */ if uint64(8) == uint64(4) { @@ -102229,7 +102237,7 @@ func Xasinh(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } } @@ -102281,11 +102289,11 @@ func Xasinhf(tls *TLS, x3 float32) (r float32) { } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)+Int32FromInt32(1)<= 2 */ - x3 = Xlogf(tls, Float32FromInt32(2)*x3+Float32FromInt32(1)/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+x3)) + x3 = Xlogf(tls, float32(Float32FromInt32(2)*x3)+Float32FromInt32(1)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+x3)) } else { if i >= Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)<= 0x1p-12, up to 1.6ulp error in [0.125,0.5] */ - x3 = Xlog1pf(tls, x3+x3*x3/(Xsqrtf(tls, x3*x3+Float32FromInt32(1))+Float32FromInt32(1))) + x3 = Xlog1pf(tls, x3+float32(x3*x3)/(Xsqrtf(tls, float32(x3*x3)+Float32FromInt32(1))+Float32FromInt32(1))) } else { /* |x| < 0x1p-12, raise inexact if x!=0 */ if uint64(4) == uint64(4) { @@ -102411,7 +102419,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { if ix < uint32(0x3ff30000) { /* |x| < 1.1875 */ if ix < uint32(0x3fe60000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (float64(2)*x3 - float64(1)) / (float64(2) + x3) + x3 = (float64(float64(2)*x3) - float64(1)) / (float64(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - float64(1)) / (x3 + float64(1)) @@ -102419,7 +102427,7 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } else { if ix < uint32(0x40038000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - float64(1.5)) / (float64(1) + float64(1.5)*x3) + x3 = (x3 - float64(1.5)) / (float64(1) + float64(float64(1.5)*x3)) } else { /* 2.4375 <= |x| < 2^66 */ id = int32(3) x3 = -Float64FromFloat64(1) / x3 @@ -102427,15 +102435,15 @@ func Xatan(tls *TLS, x3 float64) (r float64) { } } /* end of argument reduction */ - z = x3 * x3 - w = z * z + z = Tdouble_t(x3 * x3) + w = Tdouble_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (_aT[0] + w*(_aT[int32(2)]+w*(_aT[int32(4)]+w*(_aT[int32(6)]+w*(_aT[int32(8)]+w*_aT[int32(10)]))))) - s2 = w * (_aT[int32(1)] + w*(_aT[int32(3)]+w*(_aT[int32(5)]+w*(_aT[int32(7)]+w*_aT[int32(9)])))) + s1 = Tdouble_t(z * (_aT[0] + float64(w*(_aT[int32(2)]+float64(w*(_aT[int32(4)]+float64(w*(_aT[int32(6)]+float64(w*(_aT[int32(8)]+float64(w*_aT[int32(10)]))))))))))) + s2 = Tdouble_t(w * (_aT[int32(1)] + float64(w*(_aT[int32(3)]+float64(w*(_aT[int32(5)]+float64(w*(_aT[int32(7)]+float64(w*_aT[int32(9)]))))))))) if id < 0 { - return x3 - x3*(s1+s2) + return x3 - float64(x3*(s1+s2)) } - z = _atanhi[id] - (x3*(s1+s2) - _atanlo[id] - x3) + z = _atanhi[id] - (float64(x3*(s1+s2)) - _atanlo[id] - x3) if sign != 0 { v4 = -z } else { @@ -102521,9 +102529,9 @@ _2: case uint32(1): return -_pi / Float64FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float64FromInt32(3) * _pi / Float64FromInt32(4) /* atan(+INF,-INF) */ + return float64(Float64FromInt32(3)*_pi) / Float64FromInt32(4) /* atan(+INF,-INF) */ case uint32(3): - return float64(-Int32FromInt32(3)) * _pi / Float64FromInt32(4) /* atan(-INF,-INF) */ + return float64(float64(-Int32FromInt32(3))*_pi) / Float64FromInt32(4) /* atan(-INF,-INF) */ } } else { switch m { @@ -102638,9 +102646,9 @@ _2: case uint32(1): return -_pi1 / Float32FromInt32(4) /* atan(-INF,+INF) */ case uint32(2): - return Float32FromInt32(3) * _pi1 / Float32FromInt32(4) /*atan(+INF,-INF)*/ + return float32(Float32FromInt32(3)*_pi1) / Float32FromInt32(4) /*atan(+INF,-INF)*/ case uint32(3): - return float32(-Int32FromInt32(3)) * _pi1 / Float32FromInt32(4) /*atan(-INF,-INF)*/ + return float32(float32(-Int32FromInt32(3))*_pi1) / Float32FromInt32(4) /*atan(-INF,-INF)*/ } } else { switch m { @@ -102755,7 +102763,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x00800000) { /* raise underflow for subnormal x */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -102772,7 +102780,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { if ix < uint32(0x3f980000) { /* |x| < 1.1875 */ if ix < uint32(0x3f300000) { /* 7/16 <= |x| < 11/16 */ id = 0 - x3 = (Float32FromFloat32(2)*x3 - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) + x3 = (float32(Float32FromFloat32(2)*x3) - Float32FromFloat32(1)) / (Float32FromFloat32(2) + x3) } else { /* 11/16 <= |x| < 19/16 */ id = int32(1) x3 = (x3 - Float32FromFloat32(1)) / (x3 + Float32FromFloat32(1)) @@ -102780,7 +102788,7 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } else { if ix < uint32(0x401c0000) { /* |x| < 2.4375 */ id = int32(2) - x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + Float32FromFloat32(1.5)*x3) + x3 = (x3 - Float32FromFloat32(1.5)) / (Float32FromFloat32(1) + float32(Float32FromFloat32(1.5)*x3)) } else { /* 2.4375 <= |x| < 2**26 */ id = int32(3) x3 = -Float32FromFloat32(1) / x3 @@ -102788,15 +102796,15 @@ func Xatanf(tls *TLS, x3 float32) (r float32) { } } /* end of argument reduction */ - z = float64(x3 * x3) - w = z * z + z = Tfloat_t(x3 * x3) + w = Tfloat_t(z * z) /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ - s1 = z * (float64(_aT1[0]) + w*(float64(_aT1[int32(2)])+w*float64(_aT1[int32(4)]))) - s2 = w * (float64(_aT1[int32(1)]) + w*float64(_aT1[int32(3)])) + s1 = Tfloat_t(z * (float64(_aT1[0]) + Tfloat_t(w*(float64(_aT1[int32(2)])+Tfloat_t(w*float64(_aT1[int32(4)])))))) + s2 = Tfloat_t(w * (float64(_aT1[int32(1)]) + Tfloat_t(w*float64(_aT1[int32(3)])))) if id < 0 { - return float32(float64(x3) - float64(x3)*(s1+s2)) + return float32(float64(x3) - Tfloat_t(float64(x3)*(s1+s2))) } - z = float64(_atanhi1[id]) - (float64(x3)*(s1+s2) - float64(_atanlo1[id]) - float64(x3)) + z = float64(_atanhi1[id]) - (Tfloat_t(float64(x3)*(s1+s2)) - float64(_atanlo1[id]) - float64(x3)) if sign != 0 { v4 = -z } else { @@ -102853,11 +102861,11 @@ func Xatanh(tls *TLS, x3 float64) (r float64) { } } else { /* |x| < 0.5, up to 1.7ulp error */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*y3+Float64FromInt32(2)*y3*y3/(Float64FromInt32(1)-y3)) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, Tdouble_t(Float64FromInt32(2)*y3)+Tdouble_t(Tdouble_t(Float64FromInt32(2)*y3)*y3)/(Float64FromInt32(1)-y3))) } } else { /* avoid overflow */ - y3 = float64(0.5) * Xlog1p(tls, Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))) + y3 = Tdouble_t(float64(0.5) * Xlog1p(tls, float64(Float64FromInt32(2)*(y3/(Float64FromInt32(1)-y3))))) } if s != 0 { v1 = -y3 @@ -102903,22 +102911,22 @@ func Xatanhf(tls *TLS, x3 float32) (r float32) { /* handle underflow */ if *(*Tuint32_t)(unsafe.Pointer(bp)) < Uint32FromInt32(Int32FromInt32(1)<> int32(32) & uint64(0x7fffffff)) if hx == uint32(0) { return x @@ -103010,7 +103018,7 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { hx = hx/uint32(3) + _B1 } p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63))) *(*Tuint64_t)(unsafe.Pointer(bp)) |= uint64(hx) << int32(32) t = *(*float64)(unsafe.Pointer(bp)) /* @@ -103023,8 +103031,8 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * * Try to optimize for parallel evaluation as in __tanf.c. */ - r = t * t * (t / x) - t = t * (_P0 + r*(_P1+r*_P2) + r*r*r*(_P3+r*_P4)) + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) /* * Round t away from zero to 23 bits (sloppily except for ensuring that * the result is larger in magnitude than cbrt(x) but not much more than @@ -103036,14 +103044,14 @@ func Xcbrt(tls *TLS, x float64) (r1 float64) { * before the final error is larger than 0.667 ulps. */ *(*float64)(unsafe.Pointer(bp)) = t - *(*Tuint64_t)(unsafe.Pointer(bp)) = (*(*Tuint64_t)(unsafe.Pointer(bp)) + Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) + *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(*(*Tuint64_t)(unsafe.Pointer(bp))+Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) t = *(*float64)(unsafe.Pointer(bp)) /* one step Newton iteration to 53 bits with error < 0.667 ulps */ - s = t * t /* t*t is exact */ - r = x / s /* error <= 0.5 ulps; |r| < |t| */ - w = t + t /* t+t is exact */ - r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ - t = t + t*r /* error <= 0.5 + 0.5/3 + epsilon */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ return t } @@ -103081,7 +103089,7 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { if hx == uint32(0) { return x } /* cbrt(+-0) is itself */ - *(*float32)(unsafe.Pointer(bp)) = x * Float32FromFloat32(1.6777216e+07) + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) hx = hx/uint32(3) + _B21 } else { @@ -103095,14 +103103,14 @@ func Xcbrtf(tls *TLS, x float32) (r1 float32) { * without causing overflow or underflow. */ T = float64(*(*float32)(unsafe.Pointer(bp))) - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* * Second step Newton iteration to 47 bits. In double precision for * efficiency and accuracy. */ - r = T * T * T - T = T * (float64(x) + float64(x) + r) / (float64(x) + r + r) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) /* rounding to 24 bits is perfect in round-to-nearest mode */ return float32(T) } @@ -103288,9 +103296,9 @@ func Xcopysign(tls *TLS, x float64, y float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp + 8)) = y p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | *(*Tuint64_t)(unsafe.Pointer(bp + 8))&(Uint64FromUint64(1)<log(0x1p26) then the 1/t is not needed */ - return float64(0.5) * (t + Float64FromInt32(1)/t) + return float64(float64(0.5) * (t + Float64FromInt32(1)/t)) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ @@ -103590,12 +103598,12 @@ func Xcoshf(tls *TLS, x3 float32) (r float32) { return Float32FromInt32(1) } t = Xexpm1f(tls, x3) - return Float32FromInt32(1) + t*t/(Float32FromInt32(2)*(Float32FromInt32(1)+t)) + return Float32FromInt32(1) + float32(t*t)/float32(Float32FromInt32(2)*(Float32FromInt32(1)+t)) } /* |x| < log(FLT_MAX) */ if w < uint32(0x42b17217) { t = Xexpf(tls, x3) - return Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t) + return float32(Float32FromFloat32(0.5) * (t + Float32FromInt32(1)/t)) } /* |x| > log(FLT_MAX) or nan */ t = X__expo2f(tls, x3, Float32FromFloat32(1)) @@ -103690,8 +103698,8 @@ func _erfc1(tls *TLS, x float64) (r float64) { var P, Q, s Tdouble_t _, _, _ = P, Q, s s = Xfabs(tls, x) - Float64FromInt32(1) - P = _pa0 + s*(_pa1+s*(_pa2+s*(_pa3+s*(_pa4+s*(_pa5+s*_pa6))))) - Q = Float64FromInt32(1) + s*(_qa1+s*(_qa2+s*(_qa3+s*(_qa4+s*(_qa5+s*_qa6))))) + P = _pa0 + float64(s*(_pa1+float64(s*(_pa2+float64(s*(_pa3+float64(s*(_pa4+float64(s*(_pa5+float64(s*_pa6))))))))))) + Q = Float64FromInt32(1) + Tdouble_t(s*(_qa1+float64(s*(_qa2+float64(s*(_qa3+float64(s*(_qa4+float64(s*(_qa5+float64(s*_qa6))))))))))) return Float64FromInt32(1) - _erx - P/Q } @@ -103704,18 +103712,18 @@ func _erfc2(tls *TLS, ix Tuint32_t, x float64) (r float64) { return _erfc1(tls, x) } x = Xfabs(tls, x) - s = Float64FromInt32(1) / (x * x) + s = Float64FromInt32(1) / float64(x*x) if ix < uint32(0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ - R = _ra0 + s*(_ra1+s*(_ra2+s*(_ra3+s*(_ra4+s*(_ra5+s*(_ra6+s*_ra7)))))) - S = float64(1) + s*(_sa1+s*(_sa2+s*(_sa3+s*(_sa4+s*(_sa5+s*(_sa6+s*(_sa7+s*_sa8))))))) + R = _ra0 + float64(s*(_ra1+float64(s*(_ra2+float64(s*(_ra3+float64(s*(_ra4+float64(s*(_ra5+float64(s*(_ra6+float64(s*_ra7))))))))))))) + S = float64(1) + float64(s*(_sa1+float64(s*(_sa2+float64(s*(_sa3+float64(s*(_sa4+float64(s*(_sa5+float64(s*(_sa6+float64(s*(_sa7+float64(s*_sa8))))))))))))))) } else { /* |x| > 1/.35 */ - R = _rb0 + s*(_rb1+s*(_rb2+s*(_rb3+s*(_rb4+s*(_rb5+s*_rb6))))) - S = float64(1) + s*(_sb1+s*(_sb2+s*(_sb3+s*(_sb4+s*(_sb5+s*(_sb6+s*_sb7)))))) + R = _rb0 + float64(s*(_rb1+float64(s*(_rb2+float64(s*(_rb3+float64(s*(_rb4+float64(s*(_rb5+float64(s*_rb6))))))))))) + S = float64(1) + float64(s*(_sb1+float64(s*(_sb2+float64(s*(_sb3+float64(s*(_sb4+float64(s*(_sb5+float64(s*(_sb6+float64(s*_sb7))))))))))))) } z = x v1 = *(*Tuint64_t)(unsafe.Pointer(&z))>>Int32FromInt32(32)<= 1/0.35 */ - R = float64(_rb01) + s*(float64(_rb11)+s*(float64(_rb21)+s*(float64(_rb31)+s*(float64(_rb41)+s*(float64(_rb51)+s*float64(_rb61)))))) - S = Float64FromFloat32(1) + s*(float64(_sb11)+s*(float64(_sb21)+s*(float64(_sb31)+s*(float64(_sb41)+s*(float64(_sb51)+s*(float64(_sb61)+s*float64(_sb71))))))) + R = float64(_rb01) + Tfloat_t(s*(float64(_rb11)+Tfloat_t(s*(float64(_rb21)+Tfloat_t(s*(float64(_rb31)+Tfloat_t(s*(float64(_rb41)+Tfloat_t(s*(float64(_rb51)+Tfloat_t(s*float64(_rb61)))))))))))) + S = Float64FromFloat32(1) + Tfloat_t(s*(float64(_sb11)+Tfloat_t(s*(float64(_sb21)+Tfloat_t(s*(float64(_sb31)+Tfloat_t(s*(float64(_sb41)+Tfloat_t(s*(float64(_sb51)+Tfloat_t(s*(float64(_sb61)+Tfloat_t(s*float64(_sb71)))))))))))))) } ix = *(*Tuint32_t)(unsafe.Pointer(&x)) v1 = ix & uint32(0xffffe000) z = *(*float32)(unsafe.Pointer(&v1)) - return Xexpf(tls, -z*z-Float32FromFloat32(0.5625)) * Xexpf(tls, float32(float64((z-x)*(z+x))+R/S)) / x + return float32(Xexpf(tls, float32(-z*z)-Float32FromFloat32(0.5625))*Xexpf(tls, float32(Tfloat_t((z-x)*(z+x))+R/S))) / x } func Xerff(tls *TLS, x float32) (r1 float32) { @@ -103922,13 +103930,13 @@ func Xerff(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x3f580000) { /* |x| < 0.84375 */ if ix < uint32(0x31800000) { /* |x| < 2**-28 */ /*avoid underflow */ - return Float32FromFloat32(0.125) * (Float32FromInt32(8)*x + _efx81*x) + return float32(Float32FromFloat32(0.125) * (float32(Float32FromInt32(8)*x) + float32(_efx81*x))) } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromInt32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromInt32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s - return x + x*y + return x + float32(x*y) } if ix < uint32(0x40c00000) { /* |x| < 6 */ y = Float32FromInt32(1) - _erfc21(tls, ix, x) @@ -103963,14 +103971,14 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if ix < uint32(0x23800000) { /* |x| < 2**-56 */ return Float32FromFloat32(1) - x } - z = x * x - r = _pp01 + z*(_pp11+z*(_pp21+z*(_pp31+z*_pp41))) - s = Float32FromFloat32(1) + z*(_qq11+z*(_qq21+z*(_qq31+z*(_qq41+z*_qq51)))) + z = float32(x * x) + r = _pp01 + float32(z*(_pp11+float32(z*(_pp21+float32(z*(_pp31+float32(z*_pp41))))))) + s = Float32FromFloat32(1) + float32(z*(_qq11+float32(z*(_qq21+float32(z*(_qq31+float32(z*(_qq41+float32(z*_qq51))))))))) y = r / s if sign != 0 || ix < uint32(0x3e800000) { /* x < 1/4 */ - return Float32FromFloat32(1) - (x + x*y) + return Float32FromFloat32(1) - (x + float32(x*y)) } - return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + x*y) + return Float32FromFloat32(0.5) - (x - Float32FromFloat32(0.5) + float32(x*y)) } if ix < uint32(0x41e00000) { /* |x| < 28 */ if sign != 0 { @@ -103983,7 +103991,7 @@ func Xerfcf(tls *TLS, x float32) (r1 float32) { if sign != 0 { v2 = Float32FromInt32(2) - Float32FromFloat32(7.52316384526264e-37) } else { - v2 = Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37) + v2 = float32(Float32FromFloat32(7.52316384526264e-37) * Float32FromFloat32(7.52316384526264e-37)) } return v2 } @@ -104025,9 +104033,9 @@ func _specialcase(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r flo _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v6 = y goto _7 _7: @@ -104176,8 +104184,8 @@ func Xexp10(tls *TLS, x float64) (r float64) { if !(y != 0) { return _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] } - y = Xexp2(tls, float64(3.321928094887362)*y) - return y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)] + y = Xexp2(tls, float64(float64(3.321928094887362)*y)) + return float64(y * _p10[int32(*(*float64)(unsafe.Pointer(bp)))+int32(15)]) } return Xpow(tls, float64(10), x) } @@ -104252,10 +104260,10 @@ func Xexp10f(tls *TLS, x float32) (r float32) { if !(y != 0) { return _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] } - y = Xexp2f(tls, Float32FromFloat32(3.321928094887362)*y) - return y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)] + y = Xexp2f(tls, float32(Float32FromFloat32(3.321928094887362)*y)) + return float32(y * _p101[int32(*(*float32)(unsafe.Pointer(bp)))+int32(7)]) } - return float32(Xexp2(tls, float64(3.321928094887362)*float64(x))) + return float32(Xexp2(tls, float64(float64(3.321928094887362)*float64(x)))) } var _p101 = [15]float32{ @@ -104315,9 +104323,9 @@ func _specialcase1(tls *TLS, tmp Tdouble_t, sbits Tuint64_t, ki Tuint64_t) (r fl _, _, _, _, _, _, _, _, _, _, _ = hi, lo, scale, y, y1, y2, y3, v1, v3, v5, v7 if ki&uint64(0x80000000) == uint64(0) { /* k > 0, the exponent of scale might have overflowed by 1. */ - sbits = sbits - Uint64FromUint64(1)< 2^-65 and scale > 2^-928, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v8 = y goto _9 _9: @@ -104501,11 +104509,11 @@ _3: t = *(*Tuint64_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__exp2f_data)) + uintptr(ki%Uint64FromInt32(Int32FromInt32(1)< int32(56) { /* suffice to return exp(x)-1 */ y3 = x3 - e + float64(1) if k == int32(1024) { - y3 = y3 * float64(2) * float64(8.98846567431158e+307) + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) } else { - y3 = y3 * twopk + y3 = Tdouble_t(y3 * twopk) } return y3 - float64(1) } *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ if k < int32(20) { - y3 = (x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) } else { - y3 = (x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) } return y3 } @@ -104839,10 +104847,10 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } else { v1 = Float32FromFloat32(0.5) } - k = int32(_invln21*x3 + v1) + k = int32(float32(_invln21*x3) + v1) t = float64(k) - hi = float64(x3) - t*float64(_ln2_hi1) /* t*ln2_hi is exact here */ - lo = t * float64(_ln2_lo1) + hi = float64(x3) - Tfloat_t(t*float64(_ln2_hi1)) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * float64(_ln2_lo1)) } x3 = float32(hi - lo) c = hi - float64(x3) - lo @@ -104850,7 +104858,7 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ if hx < uint32(0x00800000) { if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -104865,42 +104873,42 @@ func Xexpm1f(tls *TLS, x3 float32) (r float32) { } } /* x is now in primary range */ - hfx = float64(Float32FromFloat32(0.5) * x3) - hxs = float64(x3) * hfx - r1 = Float64FromFloat32(1) + hxs*(float64(_Q11)+hxs*float64(_Q21)) - t = Float64FromFloat32(3) - r1*hfx - e = hxs * ((r1 - t) / (Float64FromFloat32(6) - float64(x3)*t)) + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(float64(x3) * hfx) + r1 = Float64FromFloat32(1) + Tfloat_t(hxs*(float64(_Q11)+Tfloat_t(hxs*float64(_Q21)))) + t = Float64FromFloat32(3) - Tfloat_t(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float64FromFloat32(6) - Tfloat_t(float64(x3)*t)))) if k == 0 { /* c is 0 */ - return float32(float64(x3) - (float64(x3)*e - hxs)) + return float32(float64(x3) - (Tfloat_t(float64(x3)*e) - hxs)) } - e = float64(x3)*(e-c) - c + e = Tfloat_t(float64(x3)*(e-c)) - c e -= hxs /* exp(x) ~ 2^k (Xreduced - e + 1) */ if k == -int32(1) { - return float32(Float64FromFloat32(0.5)*(float64(x3)-e) - Float64FromFloat32(0.5)) + return float32(Tfloat_t(Float64FromFloat32(0.5)*(float64(x3)-e)) - Float64FromFloat32(0.5)) } if k == int32(1) { if x3 < -Float32FromFloat32(0.25) { return float32(float64(-Float32FromFloat32(2)) * (e - float64(x3+Float32FromFloat32(0.5)))) } - return float32(Float64FromFloat32(1) + Float64FromFloat32(2)*(float64(x3)-e)) + return float32(Float64FromFloat32(1) + Tfloat_t(Float64FromFloat32(2)*(float64(x3)-e))) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ twopk = float64(*(*float32)(unsafe.Pointer(bp))) if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ y3 = float64(x3) - e + Float64FromFloat32(1) if k == int32(128) { - y3 = y3 * Float64FromFloat32(2) * Float64FromFloat32(1.7014118346046923e+38) + y3 = Tfloat_t(Tfloat_t(y3*Float64FromFloat32(2)) * Float64FromFloat32(1.7014118346046923e+38)) } else { - y3 = y3 * twopk + y3 = Tfloat_t(y3 * twopk) } return float32(y3 - Float64FromFloat32(1)) } *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ if k < int32(23) { - y3 = (float64(x3) - e + float64(Float32FromInt32(1)-*(*float32)(unsafe.Pointer(bp)))) * twopk + y3 = Tfloat_t((float64(x3) - e + float64(Float32FromInt32(1)-*(*float32)(unsafe.Pointer(bp)))) * twopk) } else { - y3 = (float64(x3) - (e + float64(*(*float32)(unsafe.Pointer(bp)))) + Float64FromInt32(1)) * twopk + y3 = Tfloat_t((float64(x3) - (e + float64(*(*float32)(unsafe.Pointer(bp)))) + Float64FromInt32(1)) * twopk) } return float32(y3) } @@ -104935,7 +104943,7 @@ func Xfabs(tls *TLS, x float64) (r float64) { }{} *(*float64)(unsafe.Pointer(bp)) = x p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) return *(*float64)(unsafe.Pointer(bp)) } @@ -105249,7 +105257,7 @@ func _normalize(tls *TLS, x float64) (r Tnum) { sign = e & int32(0x800) e &= int32(0x7ff) if !(e != 0) { - v1 = x * float64(9.223372036854776e+18) + v1 = float64(x * float64(9.223372036854776e+18)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) e = Int32FromUint64(ix >> int32(52) & uint64(0x7ff)) if e != 0 { @@ -105259,8 +105267,8 @@ func _normalize(tls *TLS, x float64) (r Tnum) { } e = v2 } - ix = ix & (Uint64FromUint64(1)<= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) || ny.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { - return x1*y1 + z + return float64(x1*y1) + z } if nz.Fe >= Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { if nz.Fe > Int32FromInt32(0x7ff)-Int32FromInt32(0x3ff)-Int32FromInt32(52)-Int32FromInt32(1) { /* z==0 */ - return x1*y1 + z + return float64(x1*y1) + z } return z } @@ -105451,7 +105459,7 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { } } else { /* exact +-0 */ - return x1*y1 + z + return float64(x1*y1) + z } } e -= d @@ -105472,8 +105480,8 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { /* min normal after rounding, underflow depends on arch behaviour which can be imitated by a double to float conversion */ - fltmin = float32(Float64FromFloat64(1.0842021401737618e-19) * Float64FromFloat32(1.1754943508222875e-38) * r1) - return Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin) + fltmin = float32(float64(Float64FromFloat64(1.0842021401737618e-19)*Float64FromFloat32(1.1754943508222875e-38)) * r1) + return float64(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * float64(fltmin)) } /* one bit is lost when scaled, add another top bit to only round once at conversion if it is inexact */ @@ -105483,11 +105491,11 @@ func Xfma(tls *TLS, x1 float64, y1 float64, z float64) (r2 float64) { i = -i } r1 = float64(i) - r1 = Float64FromInt32(2)*r1 - c /* remove top bit */ + r1 = float64(Float64FromInt32(2)*r1) - c /* remove top bit */ /* raise underflow portably, such that it cannot be optimized away */ - tiny = Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r1 - r1 += tiny * tiny * (r1 - r1) + tiny = Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) / Float64FromFloat32(1.1754943508222875e-38) * r1) + r1 += float64(Tdouble_t(tiny*tiny) * (r1 - r1)) } } else { /* only round once when scaled */ @@ -105811,11 +105819,11 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { _2: } if v3 || BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)<>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105877,7 +105885,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { i = uxi - *(*Tuint64_t)(unsafe.Pointer(bp + 16)) if i>>int32(63) == uint64(0) { if i == uint64(0) { - return Float64FromInt32(0) * x + return float64(Float64FromInt32(0) * x) } uxi = i } @@ -105893,7 +105901,7 @@ func Xfmod(tls *TLS, x float64, y float64) (r float64) { } /* scale result */ if ex > 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -105954,11 +105962,11 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if uxi<>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106018,7 +106026,7 @@ func Xfmodf(tls *TLS, x float32, y float32) (r float32) { i = uxi - *(*Tuint32_t)(unsafe.Pointer(bp + 8)) if i>>int32(31) == uint32(0) { if i == uint32(0) { - return Float32FromInt32(0) * x + return float32(Float32FromInt32(0) * x) } uxi = i } @@ -106077,7 +106085,7 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { ee = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) if !(ee != 0) { if x != 0 { - x = Xfrexp(tls, x*float64(1.8446744073709552e+19), e) + x = Xfrexp(tls, float64(x*float64(1.8446744073709552e+19)), e) *(*int32)(unsafe.Pointer(e)) -= int32(64) } else { *(*int32)(unsafe.Pointer(e)) = 0 @@ -106090,9 +106098,9 @@ func Xfrexp(tls *TLS, x float64, e uintptr) (r float64) { } *(*int32)(unsafe.Pointer(e)) = ee - int32(0x3fe) p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & Uint64FromUint64(0x800fffffffffffff)) p2 = bp - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) | Uint64FromUint64(0x3fe0000000000000)) return *(*float64)(unsafe.Pointer(bp)) } @@ -106153,11 +106161,11 @@ const SPLIT = 1 func _sq(tls *TLS, hi uintptr, lo uintptr, x float64) { var xc, xh, xl Tdouble_t _, _, _ = xc, xh, xl - xc = x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1)) + xc = Tdouble_t(x * (Float64FromFloat64(1.34217728e+08) + Float64FromInt32(1))) xh = x - xc + xc xl = x - xh - *(*Tdouble_t)(unsafe.Pointer(hi)) = x * x - *(*Tdouble_t)(unsafe.Pointer(lo)) = xh*xh - *(*Tdouble_t)(unsafe.Pointer(hi)) + Float64FromInt32(2)*xh*xl + xl*xl + *(*Tdouble_t)(unsafe.Pointer(hi)) = Tdouble_t(x * x) + *(*Tdouble_t)(unsafe.Pointer(lo)) = Tdouble_t(xh*xh) - *(*Tdouble_t)(unsafe.Pointer(hi)) + Tdouble_t(Tdouble_t(Float64FromInt32(2)*xh)*xl) + Tdouble_t(xl*xl) } func Xhypot(tls *TLS, x float64, y float64) (r float64) { @@ -106205,9 +106213,9 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { *(*float64)(unsafe.Pointer(bp + 8)) = y /* arrange |x| >= |y| */ p1 = bp - *(*Tuint64_t)(unsafe.Pointer(p1)) = *(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) p2 = bp + 8 - *(*Tuint64_t)(unsafe.Pointer(p2)) = *(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1)) + *(*Tuint64_t)(unsafe.Pointer(p2)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p2)) & (-Uint64FromUint64(1) >> Int32FromInt32(1))) if *(*Tuint64_t)(unsafe.Pointer(bp)) < *(*Tuint64_t)(unsafe.Pointer(bp + 8)) { ut = *(*struct { Fi [0]Tuint64_t @@ -106258,7 +106266,7 @@ func Xhypot(tls *TLS, x float64, y float64) (r float64) { } _sq(tls, bp+16, bp+24, x) _sq(tls, bp+32, bp+40, y) - return z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16))) + return float64(z * Xsqrt(tls, *(*Tdouble_t)(unsafe.Pointer(bp + 40))+*(*Tdouble_t)(unsafe.Pointer(bp + 24))+*(*Tdouble_t)(unsafe.Pointer(bp + 32))+*(*Tdouble_t)(unsafe.Pointer(bp + 16)))) } func Xhypotf(tls *TLS, x float32, y float32) (r float32) { @@ -106337,7 +106345,7 @@ func Xhypotf(tls *TLS, x float32, y float32) (r float32) { y *= Float32FromFloat32(1.2379400392853803e+27) } } - return float32(z * float64(Xsqrtf(tls, float32(float64(x)*float64(x)+float64(y)*float64(y))))) + return float32(z * float64(Xsqrtf(tls, float32(float64(float64(x)*float64(x))+float64(float64(y)*float64(y)))))) } func Xhypotl(tls *TLS, x float64, y float64) (r float64) { @@ -106530,8 +106538,8 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { /* avoid overflow in 2*x, big ulp error when x>=0x1p1023 */ if ix < uint32(0x7fe00000) { ss = s - c - z = -Xcos(tls, Float64FromInt32(2)*x) - if s*c < Float64FromInt32(0) { + z = -Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) < Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106540,10 +106548,10 @@ func _common(tls *TLS, ix Tuint32_t, x float64, y0 int32) (r float64) { if y0 != 0 { ss = -ss } - cc = _pzero(tls, x)*cc - _qzero(tls, x)*ss + cc = float64(_pzero(tls, x)*cc) - float64(_qzero(tls, x)*ss) } } - return _invsqrtpi * cc / Xsqrt(tls, x) + return float64(_invsqrtpi*cc) / Xsqrt(tls, x) } // C documentation @@ -106571,7 +106579,7 @@ func Xj0(tls *TLS, x float64) (r1 float64) { ix &= uint32(0x7fffffff) /* j0(+-inf)=0, j0(nan)=nan */ if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } x = Xfabs(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106581,16 +106589,16 @@ func Xj0(tls *TLS, x float64) (r1 float64) { /* 1 - x*x/4 + x*x*R(x^2)/S(x^2) */ if ix >= uint32(0x3f200000) { /* |x| >= 2**-13 */ /* up to 4ulp error close to 2 */ - z = x * x - r = z * (_R02 + z*(_R03+z*(_R04+z*_R05))) - s = Float64FromInt32(1) + z*(_S01+z*(_S02+z*(_S03+z*_S04))) - return (Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2)) + z*(r/s) + z = float64(x * x) + r = float64(z * (_R02 + float64(z*(_R03+float64(z*(_R04+float64(z*_R05))))))) + s = Float64FromInt32(1) + float64(z*(_S01+float64(z*(_S02+float64(z*(_S03+float64(z*_S04))))))) + return float64((Float64FromInt32(1)+x/Float64FromInt32(2))*(Float64FromInt32(1)-x/Float64FromInt32(2))) + float64(z*(r/s)) } /* 1 - x*x/4 */ /* prevent underflow */ /* inexact should be raised when x!=0, this is not done correctly */ if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - x = float64(0.25) * x * x + x = float64(float64(float64(0.25)*x) * x) } return Float64FromInt32(1) - x } @@ -106636,12 +106644,12 @@ func Xy0(tls *TLS, x float64) (r float64) { /* U(x^2)/V(x^2) + (2/pi)*j0(x)*log(x) */ if ix >= uint32(0x3e400000) { /* x >= 2**-27 */ /* large ulp error near the first zero, x ~= 0.89 */ - z = x * x - u = _u00 + z*(_u01+z*(_u02+z*(_u03+z*(_u04+z*(_u05+z*_u06))))) - v = float64(1) + z*(_v01+z*(_v02+z*(_v03+z*_v04))) - return u/v + _tpi*(Xj0(tls, x)*Xlog(tls, x)) + z = float64(x * x) + u = _u00 + float64(z*(_u01+float64(z*(_u02+float64(z*(_u03+float64(z*(_u04+float64(z*(_u05+float64(z*_u06))))))))))) + v = float64(1) + float64(z*(_v01+float64(z*(_v02+float64(z*(_v03+float64(z*_v04))))))) + return u/v + float64(_tpi*float64(Xj0(tls, x)*Xlog(tls, x))) } - return _u00 + _tpi*Xlog(tls, x) + return _u00 + float64(_tpi*Xlog(tls, x)) } // C documentation @@ -106742,9 +106750,9 @@ func _pzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -106850,9 +106858,9 @@ func _qzero(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (-Float64FromFloat64(0.125) + r/s) / x } @@ -106874,8 +106882,8 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { cc = s + c if ix < uint32(0x7f000000) { ss = s - c - z = -Xcosf(tls, Float32FromInt32(2)*x) - if s*c < Float32FromInt32(0) { + z = -Xcosf(tls, float32(Float32FromInt32(2)*x)) + if float32(s*c) < Float32FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -106884,10 +106892,10 @@ func _common1(tls *TLS, ix Tuint32_t, x float32, y0 int32) (r float32) { if y0 != 0 { ss = -ss } - cc = _pzerof(tls, x)*cc - _qzerof(tls, x)*ss + cc = float32(_pzerof(tls, x)*cc) - float32(_qzerof(tls, x)*ss) } } - return _invsqrtpi1 * cc / Xsqrtf(tls, x) + return float32(_invsqrtpi1*cc) / Xsqrtf(tls, x) } // C documentation @@ -106914,7 +106922,7 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { ix = *(*Tuint32_t)(unsafe.Pointer(&x)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } x = Xfabsf(tls, x) if ix >= uint32(0x40000000) { /* |x| >= 2 */ @@ -106923,13 +106931,13 @@ func Xj0f(tls *TLS, x float32) (r1 float32) { } if ix >= uint32(0x3a000000) { /* |x| >= 2**-11 */ /* up to 4ulp error near 2 */ - z = x * x - r = z * (_R021 + z*(_R031+z*(_R041+z*_R051))) - s = Float32FromInt32(1) + z*(_S011+z*(_S021+z*(_S031+z*_S041))) - return (Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2)) + z*(r/s) + z = float32(x * x) + r = float32(z * (_R021 + float32(z*(_R031+float32(z*(_R041+float32(z*_R051))))))) + s = Float32FromInt32(1) + float32(z*(_S011+float32(z*(_S021+float32(z*(_S031+float32(z*_S041))))))) + return float32((Float32FromInt32(1)+x/Float32FromInt32(2))*(Float32FromInt32(1)-x/Float32FromInt32(2))) + float32(z*(r/s)) } if ix >= uint32(0x21800000) { /* |x| >= 2**-60 */ - x = Float32FromFloat32(0.25) * x * x + x = float32(float32(Float32FromFloat32(0.25)*x) * x) } return Float32FromInt32(1) - x } @@ -106970,12 +106978,12 @@ func Xy0f(tls *TLS, x float32) (r float32) { } if ix >= uint32(0x39000000) { /* x >= 2**-13 */ /* large ulp error at x ~= 0.89 */ - z = x * x - u = _u001 + z*(_u011+z*(_u021+z*(_u031+z*(_u041+z*(_u051+z*_u061))))) - v = Float32FromInt32(1) + z*(_v011+z*(_v021+z*(_v031+z*_v041))) - return u/v + _tpi1*(Xj0f(tls, x)*Xlogf(tls, x)) + z = float32(x * x) + u = _u001 + float32(z*(_u011+float32(z*(_u021+float32(z*(_u031+float32(z*(_u041+float32(z*(_u051+float32(z*_u061))))))))))) + v = Float32FromInt32(1) + float32(z*(_v011+float32(z*(_v021+float32(z*(_v031+float32(z*_v041))))))) + return u/v + float32(_tpi1*float32(Xj0f(tls, x)*Xlogf(tls, x))) } - return _u001 + _tpi1*Xlogf(tls, x) + return _u001 + float32(_tpi1*Xlogf(tls, x)) } // C documentation @@ -107075,9 +107083,9 @@ func _pzerof(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 4*4))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 4*4)))))))))))) return float32(Float64FromFloat32(1) + r/s) } @@ -107183,9 +107191,9 @@ func _qzerof(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))))))))) return float32((float64(-Float32FromFloat32(0.125)) + r/s) / float64(x)) } @@ -107212,8 +107220,8 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if ix < uint32(0x7fe00000) { /* avoid overflow in 2*x */ ss = -s - c - z = Xcos(tls, Float64FromInt32(2)*x) - if s*c > Float64FromInt32(0) { + z = Xcos(tls, float64(Float64FromInt32(2)*x)) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107222,13 +107230,13 @@ func _common2(tls *TLS, ix Tuint32_t, x float64, y1 int32, sign int32) (r float6 if y1 != 0 { ss = -ss } - cc = _pone(tls, x)*cc - _qone(tls, x)*ss + cc = float64(_pone(tls, x)*cc) - float64(_qone(tls, x)*ss) } } if sign != 0 { cc = -cc } - return _invsqrtpi2 * cc / Xsqrt(tls, x) + return float64(_invsqrtpi2*cc) / Xsqrt(tls, x) } // C documentation @@ -107258,21 +107266,21 @@ func Xj1(tls *TLS, x float64) (r1 float64) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7ff00000) { - return Float64FromInt32(1) / (x * x) + return Float64FromInt32(1) / float64(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common2(tls, ix, Xfabs(tls, x), 0, sign) } if ix >= uint32(0x38000000) { /* |x| >= 2**-127 */ - z = x * x - r = z * (_r00 + z*(_r01+z*(_r02+z*_r03))) - s = Float64FromInt32(1) + z*(_s01+z*(_s02+z*(_s03+z*(_s04+z*_s05)))) + z = float64(x * x) + r = float64(z * (_r00 + float64(z*(_r01+float64(z*(_r02+float64(z*_r03))))))) + s = Float64FromInt32(1) + float64(z*(_s01+float64(z*(_s02+float64(z*(_s03+float64(z*(_s04+float64(z*_s05))))))))) z = r / s } else { /* avoid underflow, raise inexact if x!=0 */ z = x } - return (float64(0.5) + z) * x + return float64((float64(0.5) + z) * x) } var _U0 = [5]float64{ @@ -107318,10 +107326,10 @@ func Xy1(tls *TLS, x float64) (r float64) { if ix < uint32(0x3c900000) { /* x < 2**-54 */ return -_tpi2 / x } - z = x * x - u = _U0[0] + z*(_U0[int32(1)]+z*(_U0[int32(2)]+z*(_U0[int32(3)]+z*_U0[int32(4)]))) - v = Float64FromInt32(1) + z*(_V0[0]+z*(_V0[int32(1)]+z*(_V0[int32(2)]+z*(_V0[int32(3)]+z*_V0[int32(4)])))) - return x*(u/v) + _tpi2*(Xj1(tls, x)*Xlog(tls, x)-Float64FromInt32(1)/x) + z = float64(x * x) + u = _U0[0] + float64(z*(_U0[int32(1)]+float64(z*(_U0[int32(2)]+float64(z*(_U0[int32(3)]+float64(z*_U0[int32(4)]))))))) + v = Float64FromInt32(1) + float64(z*(_V0[0]+float64(z*(_V0[int32(1)]+float64(z*(_V0[int32(2)]+float64(z*(_V0[int32(3)]+float64(z*_V0[int32(4)]))))))))) + return float64(x*(u/v)) + float64(_tpi2*(float64(Xj1(tls, x)*Xlog(tls, x))-Float64FromInt32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107421,9 +107429,9 @@ func _pone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z**(*float64)(unsafe.Pointer(q + 4*8)))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z**(*float64)(unsafe.Pointer(q + 4*8))))))))))) return float64(1) + r/s } @@ -107528,9 +107536,9 @@ func _qone(tls *TLS, x float64) (r1 float64) { } } } - z = float64(1) / (x * x) - r = *(*float64)(unsafe.Pointer(p)) + z*(*(*float64)(unsafe.Pointer(p + 1*8))+z*(*(*float64)(unsafe.Pointer(p + 2*8))+z*(*(*float64)(unsafe.Pointer(p + 3*8))+z*(*(*float64)(unsafe.Pointer(p + 4*8))+z**(*float64)(unsafe.Pointer(p + 5*8)))))) - s = float64(1) + z*(*(*float64)(unsafe.Pointer(q))+z*(*(*float64)(unsafe.Pointer(q + 1*8))+z*(*(*float64)(unsafe.Pointer(q + 2*8))+z*(*(*float64)(unsafe.Pointer(q + 3*8))+z*(*(*float64)(unsafe.Pointer(q + 4*8))+z**(*float64)(unsafe.Pointer(q + 5*8))))))) + z = float64(1) / float64(x*x) + r = *(*float64)(unsafe.Pointer(p)) + float64(z*(*(*float64)(unsafe.Pointer(p + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(p + 4*8))+float64(z**(*float64)(unsafe.Pointer(p + 5*8))))))))))) + s = float64(1) + float64(z*(*(*float64)(unsafe.Pointer(q))+float64(z*(*(*float64)(unsafe.Pointer(q + 1*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 2*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 3*8))+float64(z*(*(*float64)(unsafe.Pointer(q + 4*8))+float64(z**(*float64)(unsafe.Pointer(q + 5*8))))))))))))) return (float64(0.375) + r/s) / x } @@ -107548,8 +107556,8 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 cc = s - c if ix < uint32(0x7f000000) { ss = -s - c - z = float64(Xcosf(tls, Float32FromInt32(2)*x)) - if s*c > Float64FromInt32(0) { + z = float64(Xcosf(tls, float32(Float32FromInt32(2)*x))) + if float64(s*c) > Float64FromInt32(0) { cc = z / ss } else { ss = z / cc @@ -107558,13 +107566,13 @@ func _common3(tls *TLS, ix Tuint32_t, x float32, y1 int32, sign int32) (r float3 if y1 != 0 { ss = -ss } - cc = float64(_ponef(tls, x))*cc - float64(_qonef(tls, x))*ss + cc = float64(float64(_ponef(tls, x))*cc) - float64(float64(_qonef(tls, x))*ss) } } if sign != 0 { cc = -cc } - return float32(float64(_invsqrtpi3) * cc / float64(Xsqrtf(tls, x))) + return float32(float64(float64(_invsqrtpi3)*cc) / float64(Xsqrtf(tls, x))) } // C documentation @@ -107594,20 +107602,20 @@ func Xj1f(tls *TLS, x float32) (r1 float32) { sign = Int32FromUint32(ix >> int32(31)) ix &= uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return Float32FromInt32(1) / (x * x) + return Float32FromInt32(1) / float32(x*x) } if ix >= uint32(0x40000000) { /* |x| >= 2 */ return _common3(tls, ix, Xfabsf(tls, x), 0, sign) } if ix >= uint32(0x39000000) { /* |x| >= 2**-13 */ - z = x * x - r = z * (_r001 + z*(_r011+z*(_r021+z*_r031))) - s = Float32FromInt32(1) + z*(_s011+z*(_s021+z*(_s031+z*(_s041+z*_s051)))) + z = float32(x * x) + r = float32(z * (_r001 + float32(z*(_r011+float32(z*(_r021+float32(z*_r031))))))) + s = Float32FromInt32(1) + float32(z*(_s011+float32(z*(_s021+float32(z*(_s031+float32(z*(_s041+float32(z*_s051))))))))) z = Float32FromFloat32(0.5) + r/s } else { z = Float32FromFloat32(0.5) } - return z * x + return float32(z * x) } var _U01 = [5]float32{ @@ -107649,10 +107657,10 @@ func Xy1f(tls *TLS, x float32) (r float32) { if ix < uint32(0x33000000) { /* x < 2**-25 */ return -_tpi3 / x } - z = x * x - u = _U01[0] + z*(_U01[int32(1)]+z*(_U01[int32(2)]+z*(_U01[int32(3)]+z*_U01[int32(4)]))) - v = Float32FromFloat32(1) + z*(_V01[0]+z*(_V01[int32(1)]+z*(_V01[int32(2)]+z*(_V01[int32(3)]+z*_V01[int32(4)])))) - return x*(u/v) + _tpi3*(Xj1f(tls, x)*Xlogf(tls, x)-Float32FromFloat32(1)/x) + z = float32(x * x) + u = _U01[0] + float32(z*(_U01[int32(1)]+float32(z*(_U01[int32(2)]+float32(z*(_U01[int32(3)]+float32(z*_U01[int32(4)]))))))) + v = Float32FromFloat32(1) + float32(z*(_V01[0]+float32(z*(_V01[int32(1)]+float32(z*(_V01[int32(2)]+float32(z*(_V01[int32(3)]+float32(z*_V01[int32(4)]))))))))) + return float32(x*(u/v)) + float32(_tpi3*(float32(Xj1f(tls, x)*Xlogf(tls, x))-Float32FromFloat32(1)/x)) } /* For x >= 8, the asymptotic expansions of pone is @@ -107752,9 +107760,9 @@ func _ponef(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 4*4))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 4*4)))))))))))) return float32(Float64FromFloat32(1) + r/s) } @@ -107859,9 +107867,9 @@ func _qonef(tls *TLS, x float32) (r1 float32) { } } } - z = float64(Float32FromFloat32(1) / (x * x)) - r = float64(*(*float32)(unsafe.Pointer(p))) + z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(p + 5*4))))))) - s = Float64FromFloat32(1) + z*(float64(*(*float32)(unsafe.Pointer(q)))+z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))) + z = float64(Float32FromFloat32(1) / float32(x*x)) + r = float64(*(*float32)(unsafe.Pointer(p))) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(p + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(p + 5*4)))))))))))) + s = Float64FromFloat32(1) + Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 1*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 2*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 3*4)))+Tfloat_t(z*(float64(*(*float32)(unsafe.Pointer(q + 4*4)))+Tfloat_t(z*float64(*(*float32)(unsafe.Pointer(q + 5*4)))))))))))))) return float32((Float64FromFloat32(0.375) + r/s) / float64(x)) } @@ -107936,7 +107944,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { temp = Xcos(tls, x) + Xsin(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xj0(tls, x) b = Xj1(tls, x) @@ -107947,7 +107955,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = b*(float64(2)*float64(i)/x) - a /* avoid underflow */ + b = float64(b*(float64(float64(2)*float64(i))/x)) - a /* avoid underflow */ a = temp goto _1 _1: @@ -107961,7 +107969,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if nm1 > int32(32) { /* underflow */ b = float64(0) } else { - temp = x * float64(0.5) + temp = float64(x * float64(0.5)) b = temp a = float64(1) i = int32(2) @@ -107980,16 +107988,16 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { } } else { nf = float64(nm1) + float64(1) - w = Float64FromInt32(2) * nf / x + w = float64(Float64FromInt32(2)*nf) / x h = Float64FromInt32(2) / x z = w + h q0 = w - q1 = w*z - float64(1) + q1 = float64(w*z) - float64(1) k = int32(1) for q1 < float64(1e+09) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float64(z*q1) - q0 q0 = q1 q1 = tmp } @@ -107999,7 +108007,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { if !(i >= 0) { break } - t = Float64FromInt32(1) / (Float64FromInt32(2)*(float64(i)+nf)/x - t) + t = Float64FromInt32(1) / (float64(Float64FromInt32(2)*(float64(i)+nf))/x - t) goto _3 _3: ; @@ -108015,7 +108023,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlog(tls, Xfabs(tls, w)) + tmp = float64(nf * Xlog(tls, Xfabs(tls, w))) if tmp < float64(709.782712893384) { i = nm1 for { @@ -108023,7 +108031,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp goto _4 _4: @@ -108037,7 +108045,7 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { break } temp = b - b = b*(float64(2)*float64(i))/x - a + b = float64(b*float64(float64(2)*float64(i)))/x - a a = temp /* scale b to avoid spurious overflow */ if b > float64(3.273390607896142e+150) { @@ -108054,9 +108062,9 @@ func Xjn(tls *TLS, n int32, x float64) (r float64) { z = Xj0(tls, x) w = Xj1(tls, x) if Xfabs(tls, z) >= Xfabs(tls, w) { - b = t * z / b + b = float64(t*z) / b } else { - b = t * w / a + b = float64(t*w) / a } } } @@ -108138,7 +108146,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { temp = Xsin(tls, x) - Xcos(tls, x) break } - b = _invsqrtpi4 * temp / Xsqrt(tls, x) + b = float64(_invsqrtpi4*temp) / Xsqrt(tls, x) } else { a = Xy0(tls, x) b = Xy1(tls, x) @@ -108151,7 +108159,7 @@ func Xyn(tls *TLS, n int32, x float64) (r float64) { } i++ temp = b - b = float64(2)*float64(i)/x*b - a + b = float64(float64(float64(2)*float64(i))/x*b) - a ib = uint32(*(*Tuint64_t)(unsafe.Pointer(&b)) >> int32(32)) a = temp goto _2 @@ -108211,7 +108219,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = b*(Float32FromFloat32(2)*float32(i)/x) - a + b = float32(b*(float32(Float32FromFloat32(2)*float32(i))/x)) - a a = temp goto _1 _1: @@ -108224,7 +108232,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if nm1 > int32(8) { /* underflow */ nm1 = int32(8) } - temp = Float32FromFloat32(0.5) * x + temp = float32(Float32FromFloat32(0.5) * x) b = temp a = Float32FromFloat32(1) i = int32(2) @@ -108242,16 +108250,16 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { b = b / a } else { nf = float32(nm1) + Float32FromFloat32(1) - w = Float32FromInt32(2) * nf / x + w = float32(Float32FromInt32(2)*nf) / x h = Float32FromInt32(2) / x z = w + h q0 = w - q1 = w*z - Float32FromFloat32(1) + q1 = float32(w*z) - Float32FromFloat32(1) k = int32(1) for q1 < Float32FromFloat32(10000) { k += int32(1) z += h - tmp = z*q1 - q0 + tmp = float32(z*q1) - q0 q0 = q1 q1 = tmp } @@ -108261,7 +108269,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { if !(i >= 0) { break } - t = Float32FromFloat32(1) / (Float32FromInt32(2)*(float32(i)+nf)/x - t) + t = Float32FromFloat32(1) / (float32(Float32FromInt32(2)*(float32(i)+nf))/x - t) goto _3 _3: ; @@ -108277,7 +108285,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { * then recurrent value may overflow and the result is * likely underflow to zero */ - tmp = nf * Xlogf(tls, Xfabsf(tls, w)) + tmp = float32(nf * Xlogf(tls, Xfabsf(tls, w))) if tmp < Float32FromFloat32(88.721679688) { i = nm1 for { @@ -108285,7 +108293,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp goto _4 _4: @@ -108299,7 +108307,7 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { break } temp = b - b = Float32FromFloat32(2)*float32(i)*b/x - a + b = float32(float32(Float32FromFloat32(2)*float32(i))*b)/x - a a = temp /* scale b to avoid spurious overflow */ if b > Float32FromFloat32(1.152921504606847e+18) { @@ -108316,9 +108324,9 @@ func Xjnf(tls *TLS, n int32, x float32) (r float32) { z = Xj0f(tls, x) w = Xj1f(tls, x) if Xfabsf(tls, z) >= Xfabsf(tls, w) { - b = t * z / b + b = float32(t*z) / b } else { - b = t * w / a + b = float32(t*w) / a } } } @@ -108381,7 +108389,7 @@ func Xynf(tls *TLS, n int32, x float32) (r float32) { } i++ temp = b - b = Float32FromFloat32(2)*float32(i)/x*b - a + b = float32(float32(Float32FromFloat32(2)*float32(i))/x*b) - a ib = *(*Tuint32_t)(unsafe.Pointer(&b)) a = temp goto _2 @@ -108498,8 +108506,8 @@ func _sin_pi(tls *TLS, x float64) (r float64) { var n int32 _ = n /* spurious inexact if odd int */ - x = float64(2) * (x*float64(0.5) - Xfloor(tls, x*float64(0.5))) /* x mod 2.0 */ - n = int32(x * Float64FromFloat64(4)) + x = float64(float64(2) * (float64(x*float64(0.5)) - Xfloor(tls, float64(x*float64(0.5))))) /* x mod 2.0 */ + n = int32(float64(x * Float64FromFloat64(4))) n = (n + int32(1)) / int32(2) x -= float64(float32(n) * Float32FromFloat32(0.5)) x *= _pi2 @@ -108546,7 +108554,7 @@ func X__lgamma_r(tls *TLS, x float64, signgamp uintptr) (r1 float64) { sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) ix = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) if ix >= uint32(0x7ff00000) { - return x * x + return float64(x * x) } if ix < Uint32FromInt32((Int32FromInt32(0x3ff)-Int32FromInt32(70))<> int32(31)) ix = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) if ix >= uint32(0x7f800000) { - return x * x + return float32(x * x) } if ix < uint32(0x35000000) { /* |x| < 2**-21, return -log(|x|) */ if sign != 0 { @@ -108823,7 +108831,7 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } else { t = -t } - nadj = Xlogf(tls, _pi3/(t*x)) + nadj = Xlogf(tls, _pi3/float32(t*x)) } /* purge off 1 and 2 */ if ix == uint32(0x3f800000) || ix == uint32(0x40000000) { @@ -108861,31 +108869,31 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { } switch i { case 0: - z = y * y - p1 = _a01 + z*(_a21+z*(_a41+z*(_a61+z*(_a81+z*_a101)))) - p2 = z * (_a12 + z*(_a31+z*(_a51+z*(_a71+z*(_a91+z*_a111))))) - p = y*p1 + p2 - r += p - Float32FromFloat32(0.5)*y + z = float32(y * y) + p1 = _a01 + float32(z*(_a21+float32(z*(_a41+float32(z*(_a61+float32(z*(_a81+float32(z*_a101))))))))) + p2 = float32(z * (_a12 + float32(z*(_a31+float32(z*(_a51+float32(z*(_a71+float32(z*(_a91+float32(z*_a111))))))))))) + p = float32(y*p1) + p2 + r += p - float32(Float32FromFloat32(0.5)*y) case int32(1): - z = y * y - w = z * y - p1 = _t01 + w*(_t31+w*(_t61+w*(_t91+w*_t121))) /* parallel comp */ - p2 = _t15 + w*(_t41+w*(_t71+w*(_t101+w*_t131))) - p3 = _t21 + w*(_t51+w*(_t81+w*(_t111+w*_t141))) - p = z*p1 - (_tt1 - w*(p2+y*p3)) + z = float32(y * y) + w = float32(z * y) + p1 = _t01 + float32(w*(_t31+float32(w*(_t61+float32(w*(_t91+float32(w*_t121))))))) /* parallel comp */ + p2 = _t15 + float32(w*(_t41+float32(w*(_t71+float32(w*(_t101+float32(w*_t131))))))) + p3 = _t21 + float32(w*(_t51+float32(w*(_t81+float32(w*(_t111+float32(w*_t141))))))) + p = float32(z*p1) - (_tt1 - float32(w*(p2+float32(y*p3)))) r += _tf1 + p case int32(2): - p1 = y * (_u07 + y*(_u11+y*(_u21+y*(_u31+y*(_u41+y*_u51))))) - p2 = Float32FromFloat32(1) + y*(_v11+y*(_v21+y*(_v31+y*(_v41+y*_v51)))) - r += -Float32FromFloat32(0.5)*y + p1/p2 + p1 = float32(y * (_u07 + float32(y*(_u11+float32(y*(_u21+float32(y*(_u31+float32(y*(_u41+float32(y*_u51))))))))))) + p2 = Float32FromFloat32(1) + float32(y*(_v11+float32(y*(_v21+float32(y*(_v31+float32(y*(_v41+float32(y*_v51))))))))) + r += float32(-Float32FromFloat32(0.5)*y) + p1/p2 } } else { if ix < uint32(0x41000000) { /* x < 8.0 */ i = int32(x) y = x - float32(i) - p = y * (_s06 + y*(_s11+y*(_s21+y*(_s31+y*(_s41+y*(_s51+y*_s61)))))) - q = Float32FromFloat32(1) + y*(_r11+y*(_r21+y*(_r31+y*(_r41+y*(_r51+y*_r61))))) - r = Float32FromFloat32(0.5)*y + p/q + p = float32(y * (_s06 + float32(y*(_s11+float32(y*(_s21+float32(y*(_s31+float32(y*(_s41+float32(y*(_s51+float32(y*_s61))))))))))))) + q = Float32FromFloat32(1) + float32(y*(_r11+float32(y*(_r21+float32(y*(_r31+float32(y*(_r41+float32(y*(_r51+float32(y*_r61))))))))))) + r = float32(Float32FromFloat32(0.5)*y) + p/q z = Float32FromFloat32(1) /* lgamma(1+s) = log(s) + lgamma(s) */ switch i { case int32(7): @@ -108909,11 +108917,11 @@ func X__lgammaf_r(tls *TLS, x float32, signgamp uintptr) (r1 float32) { if ix < uint32(0x5c800000) { /* 8.0 <= x < 2**58 */ t = Xlogf(tls, x) z = Float32FromFloat32(1) / x - y = z * z - w = _w01 + z*(_w11+y*(_w21+y*(_w31+y*(_w41+y*(_w51+y*_w61))))) - r = (x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1)) + w + y = float32(z * z) + w = _w01 + float32(z*(_w11+float32(y*(_w21+float32(y*(_w31+float32(y*(_w41+float32(y*(_w51+float32(y*_w61))))))))))) + r = float32((x-Float32FromFloat32(0.5))*(t-Float32FromFloat32(1))) + w } else { /* 2**58 <= x <= inf */ - r = x * (Xlogf(tls, x) - Float32FromFloat32(1)) + r = float32(x * (Xlogf(tls, x) - Float32FromFloat32(1))) } } } @@ -109048,17 +109056,17 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return Float64FromInt32(0) } r = x1 - float64(1) - r2 = r * r - r3 = r * r2 - y1 = r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8)) + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8)) + r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8))+r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8))+r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8))+r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))) + r2 = Tdouble_t(r * r) + r3 = Tdouble_t(r * r2) + y1 = Tdouble_t(r3 * (*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 1*8)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 2*8))) + float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 3*8))) + float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 5*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 6*8)))+float64(r3*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 7*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 8*8)))+float64(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 9*8)))+float64(r3**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56 + 10*8))))))))) /* Worst-case error is around 0.507 ULP. */ - w = r * float64(1.34217728e+08) + w = Tdouble_t(r * float64(1.34217728e+08)) rhi = r + w - w rlo = r - rhi - w = rhi * rhi * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) /* B[0] == -0.5. */ + w = Tdouble_t(Tdouble_t(rhi*rhi) * *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))) /* B[0] == -0.5. */ hi = r + w lo = r - hi + w - lo += *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56)) * rlo * (rhi + r) + lo += Tdouble_t(float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 56))*rlo) * (rhi + r)) y1 += lo y1 += hi y = y1 @@ -109080,9 +109088,9 @@ func Xlog(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v9 = x1 * float64(4.503599627370496e+15) + v9 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v9)) - ix = ix - Uint64FromUint64(52)<> (Int32FromInt32(52) - Int32FromInt32(LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-5: 0.5 + 4.13/N + abs-poly-error*2^57 ULP (+ 0.002 ULP without fma) Worst case error if |y| > 0x1p-4: 0.5 + 2.06/N + abs-poly-error*2^56 ULP (+ 0.001 ULP without fma). */ - y1 = lo + r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16)) + r*r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8))+r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8)))) + hi + y1 = lo + Tdouble_t(r2**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16))) + Tdouble_t(Tdouble_t(r*r2)*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 1*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 2*8)))+float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 3*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log_data)) + 16 + 4*8))))))) + hi y = y1 v10 = y goto _11 @@ -109162,7 +109170,7 @@ func Xlog10(tls *TLS, x float64) (r float64) { k = 0 if hx < uint32(0x00100000) || hx>>int32(31) != 0 { if *(*Tuint64_t)(unsafe.Pointer(bp))<>int32(31) != 0 { return (x - x) / float64(0) @@ -109188,12 +109196,12 @@ func Xlog10(tls *TLS, x float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hx)<>int32(31) != 0 { /* x < 2**-126 */ if ix<>int32(31) != 0 { return (x - x) / Float32FromFloat32(0) @@ -109283,19 +109291,19 @@ func Xlog10f(tls *TLS, x float32) (r float32) { x = *(*float32)(unsafe.Pointer(bp)) f = float64(x - Float32FromFloat32(1)) s = f / (Float64FromFloat32(2) + f) - z = s * s - w = z * z - t1 = w * (float64(_Lg21) + w*float64(_Lg41)) - t2 = z * (float64(_Lg11) + w*float64(_Lg31)) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (float64(_Lg21) + Tfloat_t(w*float64(_Lg41)))) + t2 = Tfloat_t(z * (float64(_Lg11) + Tfloat_t(w*float64(_Lg31)))) R = t2 + t1 - hfsq = Float64FromFloat32(0.5) * f * f + hfsq = Tfloat_t(Tfloat_t(Float64FromFloat32(0.5)*f) * f) hi = f - hfsq *(*float32)(unsafe.Pointer(bp)) = float32(hi) *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0xfffff000) hi = float64(*(*float32)(unsafe.Pointer(bp))) - lo = f - hi - hfsq + s*(hfsq+R) + lo = f - hi - hfsq + Tfloat_t(s*(hfsq+R)) dk = float64(k) - return float32(dk*float64(_log10_2lo1) + (lo+hi)*float64(_ivln10lo1) + lo*float64(_ivln10hi1) + hi*float64(_ivln10hi1) + dk*float64(_log10_2hi1)) + return float32(Tfloat_t(dk*float64(_log10_2lo1)) + Tfloat_t((lo+hi)*float64(_ivln10lo1)) + Tfloat_t(lo*float64(_ivln10hi1)) + Tfloat_t(hi*float64(_ivln10hi1)) + Tfloat_t(dk*float64(_log10_2hi1))) } func Xlog10l(tls *TLS, x float64) (r float64) { @@ -109397,15 +109405,15 @@ func Xlog1p(tls *TLS, x3 float64) (r float64) { *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)<> (Int32FromInt32(52) - Int32FromInt32(LOG2_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0x1p-4: 0.547 ULP (0.550 ULP without fma). ~ 0.5 + 2/N/ln2 + abs-poly-error*0x1p56 ULP (+ 0.003 ULP without fma). */ - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8)) + r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))) + r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))) - y1 = lo + r2*p + hi + p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16)) + float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 1*8))) + float64(r2*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 2*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 3*8))))) + float64(r4*(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 4*8))+float64(r**(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2_data)) + 16 + 5*8))))) + y1 = lo + Tdouble_t(r2*p) + hi y = y1 v10 = y goto _11 @@ -109681,7 +109689,7 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -109703,14 +109711,14 @@ func Xlog2f(tls *TLS, x1 float32) (r1 float32) { })(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + uintptr(i)*16))).Flogc z = float64(*(*float32)(unsafe.Pointer(&iz))) /* log2(x) = log1p(z/c-1)/ln2 + log2(c) + k */ - r = z*invc - Float64FromInt32(1) + r = Tdouble_t(z*invc) - Float64FromInt32(1) y0 = logc + float64(k) /* Pipelined polynomial evaluation to approximate log1p(r)/ln2. */ - r2 = r * r - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) - y1 = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2 + y1 - p = *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r + y0 - y1 = y1*r2 + p + r2 = Tdouble_t(r * r) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 1*8))*r) + *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 2*8)) + y1 = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256))*r2) + y1 + p = float64(*(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&X__log2f_data)) + 256 + 3*8))*r) + y0 + y1 = Tdouble_t(y1*r2) + p y = float32(y1) v2 = y goto _3 @@ -109772,10 +109780,10 @@ func Xlogb(tls *TLS, x float64) (r float64) { goto _2 _2: if !(BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)<> Int32FromInt32(12) >> e + mask = uint64(-Uint64FromUint64(1) >> Int32FromInt32(12) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&mask == uint64(0) { *(*float64)(unsafe.Pointer(iptr)) = x p3 = bp - *(*Tuint64_t)(unsafe.Pointer(p3)) = *(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63)) + *(*Tuint64_t)(unsafe.Pointer(p3)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p3)) & (Uint64FromUint64(1) << Int32FromInt32(63))) return *(*float64)(unsafe.Pointer(bp)) } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^mask @@ -110196,13 +110204,13 @@ _2: if *(*Tuint64_t)(unsafe.Pointer(bp + 8)) == *(*Tuint64_t)(unsafe.Pointer(bp + 16)) { return y3 } - ax = *(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) - ay = *(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2)) + ax = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 8)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) + ay = uint64(*(*Tuint64_t)(unsafe.Pointer(bp + 16)) & (-Uint64FromUint64(1) / Uint64FromInt32(2))) if ax == uint64(0) { if ay == uint64(0) { return y3 } - *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = *(*Tuint64_t)(unsafe.Pointer(bp + 16))&(Uint64FromUint64(1)< ay || (*(*Tuint64_t)(unsafe.Pointer(bp + 8))^*(*Tuint64_t)(unsafe.Pointer(bp + 16)))&(Uint64FromUint64(1)<> (Int32FromInt32(52) - Int32FromInt32(POW_LOG_TABLE_BITS)) % Uint64FromInt32(Int32FromInt32(1)<> int32(52)) /* arithmetic shift */ - iz = ix - tmp&(Uint64FromUint64(0xfff)< 0, the exponent of scale might have overflowed by <= 460. */ - sbits = sbits - Uint64FromUint64(1009)< 2^-200 and scale > 2^-739, so there is no spurious underflow here even without fma. */ - y = scale + scale*tmp + y = scale + Tdouble_t(scale*tmp) v7 = y goto _8 _8: @@ -110772,10 +110780,10 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { if BoolInt32(uint64(2)*ix < uint64(2)**(*Tuint64_t)(unsafe.Pointer(&v6))) == BoolInt32(!(iy>>Int32FromInt32(63) != 0)) { return float64(0) } /* |x|<1 && y==inf or |x|>1 && y==-inf. */ - return y1 * y1 + return float64(y1 * y1) } if _zeroinfnan(tls, ix) != 0 { - x2 = x1 * x1 + x2 = Tdouble_t(x1 * x1) if ix>>int32(63) != 0 && _checkint(tls, iy) == int32(1) { x2 = -x2 } @@ -110835,15 +110843,15 @@ func Xpow(tls *TLS, x1 float64, y1 float64) (r float64) { } if topx == uint32(0) { /* Normalize subnormal x so exponent becomes negative. */ - v15 = x1 * float64(4.503599627370496e+15) + v15 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v15)) ix &= uint64(0x7fffffffffffffff) - ix = ix - Uint64FromUint64(52)<1 && y==-inf. */ - return y1 * y1 + return float32(y1 * y1) } if _zeroinfnan1(tls, ix) != 0 { - x2 = float64(x1 * x1) + x2 = Tfloat_t(x1 * x1) if ix&uint32(0x80000000) != 0 && _checkint1(tls, iy) == int32(1) { x2 = -x2 } @@ -111049,22 +111057,22 @@ func Xpowf(tls *TLS, x1 float32, y1 float32) (r float32) { } if ix < uint32(0x00800000) { /* Normalize subnormal x so exponent becomes negative. */ - v4 = x1 * Float32FromFloat32(8.388608e+06) + v4 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v4)) ix &= uint32(0x7fffffff) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } } logx = _log2_inline(tls, ix) - ylogx = float64(y1) * logx /* cannot overflow, y is single prec. */ + ylogx = Tdouble_t(float64(y1) * logx) /* cannot overflow, y is single prec. */ v5 = ylogx - v6 = float64(126) * float64(Int32FromInt32(1)<>int32(47)&uint64(0xffff) >= *(*Tuint64_t)(unsafe.Pointer(&v6))>>int32(47) { /* |y*log(x)| >= 126. */ - if ylogx > float64(127.99999995700433)*float64(Int32FromInt32(1)< Tdouble_t(float64(127.99999995700433)*float64(Int32FromInt32(1)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<> Int32FromInt32(12)) - uxi = uxi | Uint64FromUint64(1)<> Int32FromInt32(12))) + uxi = Tuint64_t(uxi | Uint64FromUint64(1)<> Int32FromInt32(12)) + *(*Tuint64_t)(unsafe.Pointer(p6)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p6)) & (-Uint64FromUint64(1) >> Int32FromInt32(12))) p7 = bp + 16 - *(*Tuint64_t)(unsafe.Pointer(p7)) = *(*Tuint64_t)(unsafe.Pointer(p7)) | Uint64FromUint64(1)< 0 { - uxi = uxi - Uint64FromUint64(1)<>= Uint64FromInt32(-ex + int32(1)) @@ -111289,7 +111297,7 @@ end: if sy != 0 { y = -y } - if ex == ey || ex+int32(1) == ey && (Float64FromInt32(2)*x > y || Float64FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float64(Float64FromInt32(2)*x) > y || float64(Float64FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111362,7 +111370,7 @@ func Xremquof(tls *TLS, x float32, y float32, quo uintptr) (r float32) { _2: } if v3 || BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 || ex == int32(0xff) { - return x * y / (x * y) + return float32(x*y) / float32(x*y) } if *(*Tuint32_t)(unsafe.Pointer(bp + 4))< y || Float32FromInt32(2)*x == y && q%uint32(2) != 0) { + if ex == ey || ex+int32(1) == ey && (float32(Float32FromInt32(2)*x) > y || float32(Float32FromInt32(2)*x) == y && q%uint32(2) != 0) { x -= y q++ } @@ -111637,10 +111645,10 @@ func Xround(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + _toint6 } else { - y2 = x3 + _toint6 + y2 = float64(x3 + _toint6) } } - return Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp)) + return float64(Float64FromInt32(0) * *(*float64)(unsafe.Pointer(bp))) } y3 = x3 + _toint6 - _toint6 - x3 if y3 > float64(0.5) { @@ -111704,7 +111712,7 @@ func Xroundf(tls *TLS, x3 float32) (r float32) { y2 = float64(x3) + _toint7 } } - return Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp)) + return float32(Float32FromInt32(0) * *(*float32)(unsafe.Pointer(bp))) } y3 = float64(x3) + _toint7 - _toint7 - float64(x3) if y3 > Float64FromFloat32(0.5) { @@ -111758,7 +111766,7 @@ _2: _4: } if v5 || BoolInt32(v3&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) < Uint64FromUint64(0x7ff)< float64(0) { - return x * fn + return float64(x * fn) } else { return x / -fn } @@ -111809,7 +111817,7 @@ _2: _4: } if v5 || BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { - return x * fn + return float32(x * fn) } *(*float32)(unsafe.Pointer(bp)) = fn v6 = *(*uint32)(unsafe.Pointer(bp)) @@ -111817,7 +111825,7 @@ _2: _7: if !(BoolInt32(v6&Uint32FromInt32(0x7fffffff) < Uint32FromInt32(0x7f800000)) != 0) { if fn > Float32FromFloat32(0) { - return x * fn + return float32(x * fn) } else { return x / -fn } @@ -111900,10 +111908,10 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { if n < -int32(1022) { /* make sure final n < -53 to avoid double rounding in the subnormal range */ - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { - y *= Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15) + y *= Tdouble_t(Float64FromFloat64(2.2250738585072014e-308) * Float64FromFloat64(9.007199254740992e+15)) n += Int32FromInt32(1022) - Int32FromInt32(53) if n < -int32(1022) { n = -int32(1022) @@ -111912,7 +111920,7 @@ func Xscalbn(tls *TLS, x float64, n int32) (r float64) { } } *(*Tuint64_t)(unsafe.Pointer(bp)) = Uint64FromInt32(Int32FromInt32(0x3ff)+n) << int32(52) - x = y * *(*float64)(unsafe.Pointer(bp)) + x = float64(y * *(*float64)(unsafe.Pointer(bp))) return x } @@ -111942,10 +111950,10 @@ func Xscalbnf(tls *TLS, x float32, n int32) (r float32) { } } else { if n < -int32(126) { - y *= float64(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { - y *= float64(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) + y *= Tfloat_t(Float32FromFloat32(1.1754943508222875e-38) * Float32FromFloat32(1.6777216e+07)) n += Int32FromInt32(126) - Int32FromInt32(24) if n < -int32(126) { n = -int32(126) @@ -112136,10 +112144,10 @@ const M_PI_25 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsincosf(tls *TLS, x3 float32, sin uintptr, cos uintptr) { if __ccgo_strace { @@ -112298,10 +112306,10 @@ const M_PI_27 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _s1pio21 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _s2pio21 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _s3pio21 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _s4pio21 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _s1pio21 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _s2pio21 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _s3pio21 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _s4pio21 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xsinf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112446,14 +112454,14 @@ func Xsinh(tls *TLS, x float64) (r float64) { /* note: this branch avoids spurious underflow */ return x } - return h * (Float64FromInt32(2)*t - t*t/(t+Float64FromInt32(1))) + return float64(h * (float64(Float64FromInt32(2)*t) - float64(t*t)/(t+Float64FromInt32(1)))) } /* note: |x|>log(0x1p26)+eps could be just h*exp(x) */ - return h * (t + t/(t+Float64FromInt32(1))) + return float64(h * (t + t/(t+Float64FromInt32(1)))) } /* |x| > log(DBL_MAX) or nan */ /* note: the result is stored to handle overflow */ - t = X__expo2(tls, absx, Float64FromInt32(2)*h) + t = X__expo2(tls, absx, float64(Float64FromInt32(2)*h)) return t } @@ -112494,12 +112502,12 @@ func Xsinhf(tls *TLS, x float32) (r float32) { if w < Uint32FromInt32(Int32FromInt32(0x3f800000)-Int32FromInt32(12)< logf(FLT_MAX) or nan */ - t = X__expo2f(tls, absx, Float32FromInt32(2)*h) + t = X__expo2f(tls, absx, float32(Float32FromInt32(2)*h)) return t } @@ -112566,7 +112574,7 @@ func Xsqrt(tls *TLS, x1 float64) (r1 float64) { return X__math_invalid(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * float64(4.503599627370496e+15) + v1 = float64(x1 * float64(4.503599627370496e+15)) ix = *(*Tuint64_t)(unsafe.Pointer(&v1)) top = ix >> int32(52) top -= uint64(52) @@ -112716,7 +112724,7 @@ func Xsqrtf(tls *TLS, x1 float32) (r1 float32) { return X__math_invalidf(tls, x1) } /* x is subnormal, normalize it. */ - v1 = x1 * Float32FromFloat32(8.388608e+06) + v1 = float32(x1 * Float32FromFloat32(8.388608e+06)) ix = *(*Tuint32_t)(unsafe.Pointer(&v1)) ix -= Uint32FromInt32(Int32FromInt32(23) << Int32FromInt32(23)) } @@ -112849,10 +112857,10 @@ const M_PI_29 = 1.5707963267948966 // // /* Small multiples of pi/2 rounded to double precision. */ -var _t1pio2 = Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966) /* 0x3FF921FB, 0x54442D18 */ -var _t2pio2 = Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966) /* 0x400921FB, 0x54442D18 */ -var _t3pio2 = Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966) /* 0x4012D97C, 0x7F3321D2 */ -var _t4pio2 = Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966) /* 0x401921FB, 0x54442D18 */ +var _t1pio2 = float64(Float64FromInt32(1) * Float64FromFloat64(1.5707963267948966)) /* 0x3FF921FB, 0x54442D18 */ +var _t2pio2 = float64(Float64FromInt32(2) * Float64FromFloat64(1.5707963267948966)) /* 0x400921FB, 0x54442D18 */ +var _t3pio2 = float64(Float64FromInt32(3) * Float64FromFloat64(1.5707963267948966)) /* 0x4012D97C, 0x7F3321D2 */ +var _t4pio2 = float64(Float64FromInt32(4) * Float64FromFloat64(1.5707963267948966)) /* 0x401921FB, 0x54442D18 */ func Xtanf(tls *TLS, x3 float32) (r float32) { if __ccgo_strace { @@ -112989,18 +112997,18 @@ func Xtanh(tls *TLS, x3 float64) (r float64) { /* note: this branch avoids raising overflow */ t = Float64FromInt32(1) - Float64FromInt32(0)/x3 } else { - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = Float64FromInt32(1) - Float64FromInt32(2)/(t+Float64FromInt32(2)) } } else { if w > uint32(0x3fd058ae) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1(tls, Float64FromInt32(2)*x3) + t = Xexpm1(tls, float64(Float64FromInt32(2)*x3)) t = t / (t + Float64FromInt32(2)) } else { if w >= uint32(0x00100000) { /* |x| >= 0x1p-1022, up to 2ulp error in [0.1,0.2554] */ - t = Xexpm1(tls, float64(-Int32FromInt32(2))*x3) + t = Xexpm1(tls, float64(float64(-Int32FromInt32(2))*x3)) t = -t / (t + Float64FromInt32(2)) } else { /* |x| is subnormal */ @@ -113061,23 +113069,23 @@ func Xtanhf(tls *TLS, x3 float32) (r float32) { /* |x| > 10 */ t = Float32FromInt32(1) + Float32FromInt32(0)/x3 } else { - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = Float32FromInt32(1) - Float32FromInt32(2)/(t+Float32FromInt32(2)) } } else { if w > uint32(0x3e82c578) { /* |x| > log(5/3)/2 ~= 0.2554 */ - t = Xexpm1f(tls, Float32FromInt32(2)*x3) + t = Xexpm1f(tls, float32(Float32FromInt32(2)*x3)) t = t / (t + Float32FromInt32(2)) } else { if w >= uint32(0x00800000) { /* |x| >= 0x1p-126 */ - t = Xexpm1f(tls, float32(-Int32FromInt32(2))*x3) + t = Xexpm1f(tls, float32(float32(-Int32FromInt32(2))*x3)) t = -t / (t + Float32FromInt32(2)) } else { /* |x| is subnormal */ if uint64(4) == uint64(4) { - y = x3 * x3 + y = float32(x3 * x3) } else { if uint64(4) == uint64(8) { y1 = float64(x3 * x3) @@ -113125,12 +113133,12 @@ func _sinpi(tls *TLS, x float64) (r float64) { _ = n /* argument reduction: x = |x| mod 2 */ /* spurious inexact when x is odd int */ - x = x * float64(0.5) - x = Float64FromInt32(2) * (x - Xfloor(tls, x)) + x = float64(x * float64(0.5)) + x = float64(Float64FromInt32(2) * (x - Xfloor(tls, x))) /* reduce x into [-.25,.25] */ n = int32(Float64FromInt32(4) * x) n = (n + int32(1)) / int32(2) - x -= float64(n) * float64(0.5) + x -= float64(float64(n) * float64(0.5)) x *= _pi4 switch n { default: /* case 4 */ @@ -113226,8 +113234,8 @@ func _S(tls *TLS, x float64) (r float64) { if !(i >= 0) { break } - num = num*x + _Snum[i] - den = den*x + _Sden[i] + num = Tdouble_t(num*x) + _Snum[i] + den = Tdouble_t(den*x) + _Sden[i] goto _1 _1: ; @@ -113309,7 +113317,7 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { y2 = float64(float32(Float64FromFloat64(1.1754943508222875e-38) / x3)) } } - if Xfloor(tls, x3)*float64(0.5) == Xfloor(tls, x3*float64(0.5)) { + if float64(Xfloor(tls, x3)*float64(0.5)) == Xfloor(tls, float64(x3*float64(0.5))) { return Float64FromInt32(0) } return -Float64FromFloat64(0) @@ -113333,17 +113341,17 @@ func Xtgamma(tls *TLS, x3 float64) (r1 float64) { dy -= absx } z = absx - float64(0.5) - r = _S(tls, absx) * Xexp(tls, -y3) + r = Tdouble_t(_S(tls, absx) * Xexp(tls, -y3)) if x3 < Float64FromInt32(0) { /* reflection formula for negative x */ /* sinpi(absx) is not 0, integers are already handled */ - r = -_pi4 / (_sinpi(tls, absx) * absx * r) + r = -_pi4 / float64(float64(_sinpi(tls, absx)*absx)*r) dy = -dy z = -z } - r += dy * (_gmhalf + Float64FromFloat64(0.5)) * r / y3 - z = Xpow(tls, y3, float64(0.5)*z) - y3 = r * z * z + r += Tdouble_t(Tdouble_t(dy*(_gmhalf+Float64FromFloat64(0.5)))*r) / y3 + z = Xpow(tls, y3, float64(float64(0.5)*z)) + y3 = float64(Tdouble_t(r*z) * z) return y3 } @@ -113394,7 +113402,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if e < int32(12) { e = int32(1) } - m = -Uint64FromUint64(1) >> e + m = uint64(-Uint64FromUint64(1) >> e) if *(*Tuint64_t)(unsafe.Pointer(bp))&m == uint64(0) { return x3 } @@ -113404,7 +113412,7 @@ func Xtrunc(tls *TLS, x3 float64) (r float64) { if uint64(8) == uint64(8) { y1 = x3 + Float64FromFloat32(1.329227995784916e+36) } else { - y2 = x3 + Float64FromFloat32(1.329227995784916e+36) + y2 = float64(x3 + Float64FromFloat32(1.329227995784916e+36)) } } *(*Tuint64_t)(unsafe.Pointer(bp)) &= ^m @@ -114009,15 +114017,7 @@ func Xgethostid(tls *TLS) (r int64) { const optpos = 0 -type Tucontext_t3 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t -} - -type t__ucontext1 = Tucontext_t3 +type t__ucontext1 = Tucontext_t1 func X__getopt_msg(tls *TLS, a uintptr, b uintptr, c uintptr, l Tsize_t) { if __ccgo_strace { @@ -115165,7 +115165,7 @@ type Thistory = struct { Fbase int32 } -func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { +func _do_nftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32, h uintptr) (r1 int32) { bp := tls.Alloc(192) defer tls.Free(192) var d, de, v10 uintptr @@ -115271,7 +115271,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } } if v8 = !(flags&Int32FromInt32(FTW_DEPTH) != 0); v8 { - v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+176) + v7 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+176) r = v7 } if v8 && v7 != 0 { @@ -115312,7 +115312,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(j))) = uint8('/') Xstrcpy(tls, path+uintptr(j)+uintptr(1), de+19) - v11 = _do_nftw(tls, path, fn, fd_limit-int32(1), flags, bp+144) + v11 = _do_nftw(tls, path, __ccgo_fp_fn, fd_limit-int32(1), flags, bp+144) r = v11 if v11 != 0 { Xclosedir(tls, d) @@ -115327,7 +115327,7 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h } *(*uint8)(unsafe.Pointer(path + uintptr(l))) = uint8(0) if v13 = flags&int32(FTW_DEPTH) != 0; v13 { - v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, path, bp, type1, bp+176) + v12 = (*(*func(*TLS, uintptr, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_fn})))(tls, path, bp, type1, bp+176) r = v12 } if v13 && v12 != 0 { @@ -115336,9 +115336,11 @@ func _do_nftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32, h return 0 } -func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 int32) { +type t__ccgo_fp__Xnftw_1 = func(*TLS, uintptr, uintptr, int32, uintptr) int32 + +func Xnftw(tls *TLS, path uintptr, __ccgo_fp_fn uintptr, fd_limit int32, flags int32) (r1 int32) { if __ccgo_strace { - trc("tls=%v path=%v fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, fn, fd_limit, flags, origin(2)) + trc("tls=%v path=%v __ccgo_fp_fn=%v fd_limit=%v flags=%v, (%v:)", tls, path, __ccgo_fp_fn, fd_limit, flags, origin(2)) defer func() { trc("-> %v", r1) }() } bp := tls.Alloc(4112) @@ -115358,7 +115360,7 @@ func Xnftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32, flags int32) (r1 } Xmemcpy(tls, bp+4, path, l+uint64(1)) _pthread_setcancelstate(tls, int32(PTHREAD_CANCEL_DISABLE), bp) - r = _do_nftw(tls, bp+4, fn, fd_limit, flags, UintptrFromInt32(0)) + r = _do_nftw(tls, bp+4, __ccgo_fp_fn, fd_limit, flags, UintptrFromInt32(0)) _pthread_setcancelstate(tls, *(*int32)(unsafe.Pointer(bp)), uintptr(0)) return r } @@ -116138,8 +116140,6 @@ type Tsockaddr_storage = struct { F__ss_align uint64 } -type t__ucontext2 = Tucontext_t2 - var _lock2 [1]int32 var _log_ident [32]uint8 var _log_opt int32 @@ -116543,14 +116543,6 @@ const SA = 194 const SB = 244 const bittab = 0 -type Tucontext_t4 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t -} - func Xbtowc(tls *TLS, c int32) (r Twint_t) { if __ccgo_strace { trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) @@ -116563,7 +116555,7 @@ func Xbtowc(tls *TLS, c int32) (r Twint_t) { if Uint32FromInt32(b) < uint32(128) { v1 = Uint32FromInt32(b) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -116764,7 +116756,7 @@ func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t, st uintptr) (r Tsize *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolUint64(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -116935,7 +116927,7 @@ func Xmbsrtowcs(tls *TLS, ws uintptr, src uintptr, wn Tsize_t, st uintptr) (r Ts goto resume0 } } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -117163,7 +117155,7 @@ func Xmbtowc(tls *TLS, wc uintptr, src uintptr, n Tsize_t) (r int32) { *(*Twchar_t)(unsafe.Pointer(wc)) = v1 return BoolInt32(!!(v1 != 0)) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v2 = int32(4) } else { v2 = int32(1) @@ -117233,7 +117225,7 @@ func Xwcrtomb(tls *TLS, s uintptr, wc Twchar_t, st uintptr) (r Tsize_t) { *(*uint8)(unsafe.Pointer(s)) = Uint8FromInt32(wc) return uint64(1) } else { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -117440,7 +117432,7 @@ func Xwctob(tls *TLS, c Twint_t) (r int32) { if c < uint32(128) { return Int32FromUint32(c) } - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v1 = int32(4) } else { v1 = int32(1) @@ -118366,13 +118358,6 @@ const _ns_uop_delete = 0 const _ns_uop_add = 1 const _ns_uop_max = 2 -type Tns_tsig_key1 = struct { - Fname [1025]uint8 - Falg [1025]uint8 - Fdata uintptr - Flen1 int32 -} - type Tns_tsig_key = struct { Fname [1025]uint8 Falg [1025]uint8 @@ -118380,14 +118365,6 @@ type Tns_tsig_key = struct { Flen1 int32 } -type Tns_tcp_tsig_state1 = struct { - Fcounter int32 - Fkey uintptr - Fctx uintptr - Fsig [512]uint8 - Fsiglen int32 -} - type Tns_tcp_tsig_state = struct { Fcounter int32 Fkey uintptr @@ -119037,9 +119014,11 @@ type Tresolvconf = struct { Ftimeout uint32 } -func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__dns_parse_2 = func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32 + +func X__dns_parse(tls *TLS, r uintptr, rlen int32, __ccgo_fp_callback uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v r=%v rlen=%v callback=%v ctx=%v, (%v:)", tls, r, rlen, callback, ctx, origin(2)) + trc("tls=%v r=%v rlen=%v __ccgo_fp_callback=%v ctx=%v, (%v:)", tls, r, rlen, __ccgo_fp_callback, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var ancount, len1, qdcount, v1, v2 int32 @@ -119085,7 +119064,7 @@ func X__dns_parse(tls *TLS, r uintptr, rlen int32, callback uintptr, ctx uintptr if int64(len1+int32(10)) > int64(r+uintptr(rlen))-int64(p) { return -int32(1) } - if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { + if (*(*func(*TLS, uintptr, int32, uintptr, int32, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_callback})))(tls, ctx, Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 1))), p+uintptr(10), len1, r, rlen) < 0 { return -int32(1) } p += uintptr(int32(10) + len1) @@ -121276,10 +121255,10 @@ func X__h_errno_location(tls *TLS) (r uintptr) { trc("tls=%v, (%v:)", tls, origin(2)) defer func() { trc("-> %v", r) }() } - if !((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstack != 0) { + if !((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstack != 0) { return uintptr(unsafe.Pointer(&Xh_errno)) } - return ___get_tp(tls) + 160 + return uintptr(___get_tp(tls)) + 160 } func Xherror(tls *TLS, msg uintptr) { @@ -121303,18 +121282,6 @@ func Xherror(tls *TLS, msg uintptr) { Xfprintf(tls, uintptr(unsafe.Pointer(&X__stderr_FILE)), __ccgo_ts+1102, VaList(bp+8, v1, v2, Xhstrerror(tls, *(*int32)(unsafe.Pointer(X__h_errno_location(tls)))))) } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - -type Tucontext_t5 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t -} - var _msgs1 = [84]uint8{'H', 'o', 's', 't', ' ', 'n', 'o', 't', ' ', 'f', 'o', 'u', 'n', 'd', 0, 'T', 'r', 'y', ' ', 'a', 'g', 'a', 'i', 'n', 0, 'N', 'o', 'n', '-', 'r', 'e', 'c', 'o', 'v', 'e', 'r', 'a', 'b', 'l', 'e', ' ', 'e', 'r', 'r', 'o', 'r', 0, 'A', 'd', 'd', 'r', 'e', 's', 's', ' ', 'n', 'o', 't', ' ', 'a', 'v', 'a', 'i', 'l', 'a', 'b', 'l', 'e', 0, 0, 'U', 'n', 'k', 'n', 'o', 'w', 'n', ' ', 'e', 'r', 'r', 'o', 'r'} func Xhstrerror(tls *TLS, ecode int32) (r uintptr) { @@ -123126,7 +123093,7 @@ func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype i return v22 } -func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, cb uintptr, ctx uintptr) (r1 int32) { +func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { bp := tls.Alloc(8192) defer tls.Free(8192) var h uintptr @@ -123216,7 +123183,7 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, if Int32FromUint16((*Tnlmsghdr)(unsafe.Pointer(h)).Fnlmsg_type) == int32(NLMSG_ERROR) { return -int32(1) } - ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cb})))(tls, ctx, h) + ret = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cb})))(tls, ctx, h) if ret != 0 { return ret } @@ -123229,9 +123196,11 @@ func ___netlink_enumerate(tls *TLS, fd int32, seq uint32, type1 int32, af int32, return r1 } -func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, ctx uintptr) (r1 int32) { +type t__ccgo_fp__X__rtnetlink_enumerate_2 = func(*TLS, uintptr, uintptr) int32 + +func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, __ccgo_fp_cb uintptr, ctx uintptr) (r1 int32) { if __ccgo_strace { - trc("tls=%v link_af=%v addr_af=%v cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, cb, ctx, origin(2)) + trc("tls=%v link_af=%v addr_af=%v __ccgo_fp_cb=%v ctx=%v, (%v:)", tls, link_af, addr_af, __ccgo_fp_cb, ctx, origin(2)) defer func() { trc("-> %v", r1) }() } var fd, r int32 @@ -123240,9 +123209,9 @@ func X__rtnetlink_enumerate(tls *TLS, link_af int32, addr_af int32, cb uintptr, if fd < 0 { return -int32(1) } - r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(1), int32(RTM_GETLINK), link_af, __ccgo_fp_cb, ctx) if !(r != 0) { - r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, cb, ctx) + r = ___netlink_enumerate(tls, fd, uint32(2), int32(RTM_GETADDR), addr_af, __ccgo_fp_cb, ctx) } X__syscall1(tls, int64(SYS_close), int64(fd)) return r @@ -128385,7 +128354,7 @@ func _fnmatch_internal(tls *TLS, pat uintptr, m Tsize_t, str uintptr, n Tsize_t, break } if v9 = uint32(*(*uint8)(unsafe.Pointer(s + uintptr(-Int32FromInt32(1))))) < uint32(128); !v9 { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v8 = int32(4) } else { v8 = int32(1) @@ -128623,7 +128592,7 @@ func _append(tls *TLS, tail uintptr, name uintptr, len1 Tsize_t, mark int32) (r return 0 } -func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, errfunc uintptr, tail uintptr) (r1 int32) { +func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, tail uintptr) (r1 int32) { bp := tls.Alloc(144) defer tls.Free(144) var de, dir, p, p2, v11, v2, v7, v8 uintptr @@ -128732,7 +128701,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } } if !(type1 != 0) && Xlstat(tls, buf, bp) != 0 { - if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if *(*int32)(unsafe.Pointer(X__errno_location(tls))) != int32(ENOENT) && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } return 0 @@ -128769,7 +128738,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } dir = Xopendir(tls, v7) if !(dir != 0) { - if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { + if (*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0 { return int32(GLOB_ABORTED) } return 0 @@ -128821,7 +128790,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag } else { v11 = __ccgo_ts } - r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, errfunc, tail) + r = _do_glob(tls, buf, pos+l, Int32FromUint8((*Tdirent)(unsafe.Pointer(de)).Fd_type), v11, flags, __ccgo_fp_errfunc, tail) if r != 0 { Xclosedir(tls, dir) return r @@ -128832,7 +128801,7 @@ func _do_glob(tls *TLS, buf uintptr, pos Tsize_t, type1 int32, pat uintptr, flag *(*uint8)(unsafe.Pointer(p2)) = saved_sep } Xclosedir(tls, dir) - if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { + if readerr != 0 && ((*(*func(*TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_errfunc})))(tls, buf, *(*int32)(unsafe.Pointer(X__errno_location(tls)))) != 0 || flags&int32(GLOB_ERR) != 0) { return int32(GLOB_ABORTED) } *(*int32)(unsafe.Pointer(X__errno_location(tls))) = old_errno @@ -128944,9 +128913,11 @@ func _expand_tilde(tls *TLS, pat uintptr, buf uintptr, pos uintptr) (r int32) { return 0 } -func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r int32) { +type t__ccgo_fp__Xglob_2 = func(*TLS, uintptr, int32) int32 + +func Xglob(tls *TLS, pat uintptr, flags int32, __ccgo_fp_errfunc uintptr, g uintptr) (r int32) { if __ccgo_strace { - trc("tls=%v pat=%v flags=%v errfunc=%v g=%v, (%v:)", tls, pat, flags, errfunc, g, origin(2)) + trc("tls=%v pat=%v flags=%v __ccgo_fp_errfunc=%v g=%v, (%v:)", tls, pat, flags, __ccgo_fp_errfunc, g, origin(2)) defer func() { trc("-> %v", r) }() } bp := tls.Alloc(4128) @@ -128972,8 +128943,8 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in } offs = v1 error1 = 0 - if !(errfunc != 0) { - errfunc = __ccgo_fp(_ignore_err) + if !(__ccgo_fp_errfunc != 0) { + __ccgo_fp_errfunc = __ccgo_fp(_ignore_err) } if !(flags&Int32FromInt32(GLOB_APPEND) != 0) { (*Tglob_t)(unsafe.Pointer(g)).Fgl_offs = offs @@ -128992,7 +128963,7 @@ func Xglob(tls *TLS, pat uintptr, flags int32, errfunc uintptr, g uintptr) (r in error1 = _expand_tilde(tls, bp+4120, bp+16, bp+4112) } if !(error1 != 0) { - error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, errfunc, bp+8) + error1 = _do_glob(tls, bp+16, *(*Tsize_t)(unsafe.Pointer(bp + 4112)), 0, *(*uintptr)(unsafe.Pointer(bp + 4120)), flags, __ccgo_fp_errfunc, bp+8) } Xfree(tls, p) } @@ -134216,9 +134187,11 @@ func Xremque(tls *TLS, element uintptr) { } } -func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134234,7 +134207,7 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134246,9 +134219,11 @@ func Xlsearch(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, return Xmemcpy(tls, p+uintptr(n)*uintptr(v1), key, width) } -func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, compar uintptr) (r uintptr) { +type t__ccgo_fp__Xlfind_4 = func(*TLS, uintptr, uintptr) int32 + +func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, __ccgo_fp_compar uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nelp=%v width=%v compar=%v, (%v:)", tls, key, base, nelp, width, compar, origin(2)) + trc("tls=%v key=%v base=%v nelp=%v width=%v __ccgo_fp_compar=%v, (%v:)", tls, key, base, nelp, width, __ccgo_fp_compar, origin(2)) defer func() { trc("-> %v", r) }() } var i, n Tsize_t @@ -134264,7 +134239,7 @@ func Xlfind(tls *TLS, key uintptr, base uintptr, nelp uintptr, width Tsize_t, co if !(i < n) { break } - if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { + if (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_compar})))(tls, key, p+uintptr(i)*uintptr(v1)) == 0 { return p + uintptr(i)*uintptr(v1) } goto _2 @@ -134283,9 +134258,11 @@ type Tnode1 = struct { Fh int32 } -func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtdelete_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtdelete(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var a [97]uintptr @@ -134309,7 +134286,7 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { return uintptr(0) } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134354,9 +134331,11 @@ func Xtdelete(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { return parent } -func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { +type t__ccgo_fp__Xtdestroy_1 = func(*TLS, uintptr) + +func Xtdestroy(tls *TLS, root uintptr, __ccgo_fp_freekey uintptr) { if __ccgo_strace { - trc("tls=%v root=%v freekey=%v, (%v:)", tls, root, freekey, origin(2)) + trc("tls=%v root=%v __ccgo_fp_freekey=%v, (%v:)", tls, root, __ccgo_fp_freekey, origin(2)) } var r uintptr _ = r @@ -134364,17 +134343,19 @@ func Xtdestroy(tls *TLS, root uintptr, freekey uintptr) { if r == uintptr(0) { return } - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), freekey) - Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), freekey) - if freekey != 0 { - (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_freekey) + Xtdestroy(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_freekey) + if __ccgo_fp_freekey != 0 { + (*(*func(*TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freekey})))(tls, (*Tnode1)(unsafe.Pointer(r)).Fkey) } Xfree(tls, r) } -func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xtfind_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtfind(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var c int32 @@ -134388,7 +134369,7 @@ func Xtfind(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { break } @@ -134476,9 +134457,11 @@ func X__tsearch_balance(tls *TLS, p uintptr) (r int32) { return _rot(tls, p, n, BoolInt32(h0 < h1)) } -func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { +type t__ccgo_fp__Xtsearch_2 = func(*TLS, uintptr, uintptr) int32 + +func Xtsearch(tls *TLS, key uintptr, rootp uintptr, __ccgo_fp_cmp uintptr) (r1 uintptr) { if __ccgo_strace { - trc("tls=%v key=%v rootp=%v cmp=%v, (%v:)", tls, key, rootp, cmp, origin(2)) + trc("tls=%v key=%v rootp=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, rootp, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r1) }() } var a [96]uintptr @@ -134498,7 +134481,7 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { if !(n != 0) { break } - c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) + c = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, (*Tnode1)(unsafe.Pointer(n)).Fkey) if !(c != 0) { return n } @@ -134534,26 +134517,28 @@ func Xtsearch(tls *TLS, key uintptr, rootp uintptr, cmp uintptr) (r1 uintptr) { return r } -func _walk(tls *TLS, r uintptr, action uintptr, d int32) { +func _walk(tls *TLS, r uintptr, __ccgo_fp_action uintptr, d int32) { if !(r != 0) { return } if (*Tnode1)(unsafe.Pointer(r)).Fh == int32(1) { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_leaf), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_leaf), d) } else { - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_preorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_postorder), d) - _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), action, d+int32(1)) - (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{action})))(tls, r, int32(_endorder), d) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_preorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_postorder), d) + _walk(tls, *(*uintptr)(unsafe.Pointer(r + 8 + 1*8)), __ccgo_fp_action, d+int32(1)) + (*(*func(*TLS, uintptr, TVISIT, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_action})))(tls, r, int32(_endorder), d) } } -func Xtwalk(tls *TLS, root uintptr, action uintptr) { +type t__ccgo_fp__Xtwalk_1 = func(*TLS, uintptr, int32, int32) + +func Xtwalk(tls *TLS, root uintptr, __ccgo_fp_action uintptr) { if __ccgo_strace { - trc("tls=%v root=%v action=%v, (%v:)", tls, root, action, origin(2)) + trc("tls=%v root=%v __ccgo_fp_action=%v, (%v:)", tls, root, __ccgo_fp_action, origin(2)) } - _walk(tls, root, action, 0) + _walk(tls, root, __ccgo_fp_action, 0) } func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { @@ -134564,8 +134549,6 @@ func Xpoll(tls *TLS, fds uintptr, n Tnfds_t, timeout int32) (r int32) { return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_poll), int64(fds), Int64FromUint64(n), int64(timeout), 0, 0, 0)))) } -type t__ucontext3 = Tucontext_t5 - func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v fds=%v n=%v to=%v mask=%v, (%v:)", tls, fds, n, to, mask, origin(2)) @@ -134601,8 +134584,6 @@ func Xppoll(tls *TLS, fds uintptr, n Tnfds_t, to uintptr, mask uintptr) (r int32 return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_ppoll), int64(fds), Int64FromUint64(n), int64(v3), int64(mask), int64(Int32FromInt32(_NSIG)/Int32FromInt32(8)), 0)))) } -type t__ucontext4 = Tucontext_t4 - func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts uintptr, mask uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v ts=%v mask=%v, (%v:)", tls, n, rfds, wfds, efds, ts, mask, origin(2)) @@ -134643,14 +134624,6 @@ func Xpselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, ts ui return int32(X__syscall_ret(tls, Uint64FromInt64(___syscall_cp(tls, int64(SYS_pselect6), int64(n), int64(rfds), int64(wfds), int64(efds), int64(v3), int64(bp+16))))) } -type Tucontext_t6 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t - Fuc_sigmask Tsigset_t -} - func Xselect(tls *TLS, n int32, rfds uintptr, wfds uintptr, efds uintptr, tv uintptr) (r int32) { if __ccgo_strace { trc("tls=%v n=%v rfds=%v wfds=%v efds=%v tv=%v, (%v:)", tls, n, rfds, wfds, efds, tv, origin(2)) @@ -134834,7 +134807,7 @@ func Xraise(tls *TLS, sig int32) (r int32) { var _ /* set at bp+0 */ Tsigset_t _ = ret X__block_app_sigs(tls, bp) - ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid), int64(sig))))) + ret = int32(X__syscall_ret(tls, Uint64FromInt64(X__syscall2(tls, int64(SYS_tkill), int64((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid), int64(sig))))) X__restore_sigs(tls, bp) return ret } @@ -135140,14 +135113,6 @@ func Xsigaltstack(tls *TLS, ss uintptr, old uintptr) (r int32) { const SST_SIZE = 8 -type Tucontext_t7 = struct { - Fuc_flags uint64 - Fuc_link uintptr - Fuc_stack Tstack_t - Fuc_mcontext Tmcontext_t1 - Fuc_sigmask Tsigset_t -} - func Xsigandset(tls *TLS, dest uintptr, left uintptr, right uintptr) (r1 int32) { if __ccgo_strace { trc("tls=%v dest=%v left=%v right=%v, (%v:)", tls, dest, left, right, origin(2)) @@ -135625,13 +135590,13 @@ func _fstatat_statx(tls *TLS, fd int32, path uintptr, st uintptr, flag int32) (r return ret } *(*Tstat)(unsafe.Pointer(st)) = Tstat{ - Fst_dev: uint64((*(*Tstatx1)(unsafe.Pointer(bp))).Fstx_dev_major)&Uint64FromUint64(0xfffff000)<= 0 { v1 = ___lockfile(tls, f) @@ -138332,7 +138297,7 @@ func X__do_orphaned_stdio_locks(tls *TLS) { } var f uintptr _ = f - f = (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks + f = (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks for { if !(f != 0) { break @@ -138360,7 +138325,7 @@ func X__unlist_locked_file(tls *TLS, f uintptr) { if (*TFILE)(unsafe.Pointer(f)).Fprev_locked != 0 { (*TFILE)(unsafe.Pointer((*TFILE)(unsafe.Pointer(f)).Fprev_locked)).Fnext_locked = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } else { - (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked + (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Fstdio_locks = (*TFILE)(unsafe.Pointer(f)).Fnext_locked } } } @@ -138387,7 +138352,7 @@ func Xftrylockfile(tls *TLS, f uintptr) (r int32) { var self Tpthread_t var v5 bool _, _, _, _, _, _, _ = owner, self, tid, v1, v2, v3, v5 - self = ___get_tp(tls) + self = uintptr(___get_tp(tls)) tid = (*t__pthread)(unsafe.Pointer(self)).Ftid owner = AtomicLoadPInt32(f + 140) if owner & ^Int32FromInt32(MAYBE_WAITERS) == tid { @@ -138449,7 +138414,7 @@ func Xfwide(tls *TLS, f uintptr, mode int32) (r int32) { __need_unlock = v1 if mode != 0 { if !((*TFILE)(unsafe.Pointer(f)).Flocale != 0) { - if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale)) != 0) { + if !!(*(*uintptr)(unsafe.Pointer((*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale)) != 0) { v3 = int32(4) } else { v3 = int32(1) @@ -138665,7 +138630,7 @@ func Xgetc(tls *TLS, f1 uintptr) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = f1 l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -138799,7 +138764,7 @@ func Xgetchar(tls *TLS) (r int32) { _, _, _, _, _, _ = l, v1, v2, v4, v5, v6 v1 = uintptr(unsafe.Pointer(&X__stdin_FILE)) l = AtomicLoadPInt32(v1 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if (*TFILE)(unsafe.Pointer(v1)).Frpos != (*TFILE)(unsafe.Pointer(v1)).Frend { v6 = v1 + 8 v5 = *(*uintptr)(unsafe.Pointer(v6)) @@ -139525,7 +139490,7 @@ func Xputc(tls *TLS, c1 int32, f1 uintptr) (r int32) { v1 = c1 v2 = f1 l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -139669,7 +139634,7 @@ func Xputchar(tls *TLS, c1 int32) (r int32) { v1 = c1 v2 = uintptr(unsafe.Pointer(&X__stdout_FILE)) l = AtomicLoadPInt32(v2 + 140) - if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Ftid { + if l < 0 || l != 0 && l & ^Int32FromInt32(MAYBE_WAITERS) == (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Ftid { if Int32FromUint8(Uint8FromInt32(v1)) != (*TFILE)(unsafe.Pointer(v2)).Flbf && (*TFILE)(unsafe.Pointer(v2)).Fwpos != (*TFILE)(unsafe.Pointer(v2)).Fwend { v6 = Uint8FromInt32(v1) v8 = v2 + 40 @@ -140196,7 +140161,7 @@ func Xungetwc(tls *TLS, c Twint_t, f uintptr) (r Twint_t) { var v3 bool var _ /* mbc at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _ = __need_unlock, l, loc, ploc, v1, v2, v3, v4, v5, p6 - ploc = ___get_tp(tls) + 168 + ploc = uintptr(___get_tp(tls)) + 168 loc = *(*Tlocale_t)(unsafe.Pointer(ploc)) if AtomicLoadPInt32(f+140) >= 0 { v1 = ___lockfile(tls, f) @@ -140448,7 +140413,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -140470,7 +140435,7 @@ func _pop_arg(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -140659,7 +140624,7 @@ _4: } return v7 } - y = Xfrexpl(tls, y, bp+512) * Float64FromInt32(2) + y = float64(Xfrexpl(tls, y, bp+512) * Float64FromInt32(2)) if y != 0 { *(*int32)(unsafe.Pointer(bp + 512))-- } @@ -140722,7 +140687,7 @@ _4: v14 = s s++ *(*uint8)(unsafe.Pointer(v14)) = Uint8FromInt32(Int32FromUint8(_xdigits1[x]) | t&int32(32)) - y = Float64FromInt32(16) * (y - float64(x)) + y = float64(Float64FromInt32(16) * (y - float64(x))) if int64(s)-t__predefined_ptrdiff_t(bp+516) == int64(1) && (y != 0 || p > 0 || Uint32FromInt32(fl)&(Uint32FromUint32(1)<<(Int32FromUint8('#')-Int32FromUint8(' '))) != 0) { v15 = s s++ @@ -140775,7 +140740,7 @@ _4: *(*Tuint32_t)(unsafe.Pointer(z)) = uint32(y) v21 = z z += 4 - y = Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21)))) + y = float64(Float64FromInt32(1000000000) * (y - float64(*(*Tuint32_t)(unsafe.Pointer(v21))))) } for *(*int32)(unsafe.Pointer(bp + 512)) > 0 { carry = uint32(0) @@ -142625,7 +142590,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_ULONG): (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) case int32(_ULLONG): - (*Targ)(unsafe.Pointer(arg)).Fi = VaUint64(&*(*Tva_list)(unsafe.Pointer(ap))) + (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUint64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_SHORT): (*Targ)(unsafe.Pointer(arg)).Fi = Uint64FromInt16(int16(VaInt32(&*(*Tva_list)(unsafe.Pointer(ap))))) case int32(_USHORT): @@ -142647,7 +142612,7 @@ func _pop_arg1(tls *TLS, arg uintptr, type1 int32, ap uintptr) { case int32(_UIPTR): (*Targ)(unsafe.Pointer(arg)).Fi = uint64(VaUintptr(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_DBL): - *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) + *(*float64)(unsafe.Pointer(arg)) = float64(VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap)))) case int32(_LDBL): *(*float64)(unsafe.Pointer(arg)) = VaFloat64(&*(*Tva_list)(unsafe.Pointer(ap))) } @@ -144277,9 +144242,11 @@ func Xatoll(tls *TLS, s uintptr) (r int64) { return v5 } -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, cmp uintptr) (r uintptr) { +type t__ccgo_fp__Xbsearch_4 = func(*TLS, uintptr, uintptr) int32 + +func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp uintptr) (r uintptr) { if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) + trc("tls=%v key=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, key, base, nel, width, __ccgo_fp_cmp, origin(2)) defer func() { trc("-> %v", r) }() } var sign int32 @@ -144287,7 +144254,7 @@ func Xbsearch(tls *TLS, key uintptr, base uintptr, nel Tsize_t, width Tsize_t, c _, _ = sign, try for nel > uint64(0) { try = base + uintptr(width*(nel/uint64(2))) - sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, key, try) + sign = (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, key, try) if sign < 0 { nel /= uint64(2) } else { @@ -144557,7 +144524,7 @@ func _shr(tls *TLS, p uintptr, n int32) { *(*Tsize_t)(unsafe.Pointer(p + 1*8)) >>= Uint64FromInt32(n) } -func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { +func _sift(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pshift int32, lp uintptr) { bp := tls.Alloc(912) defer tls.Free(912) var i, v1, v2 int32 @@ -144569,10 +144536,10 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi for pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], lf, arg) >= 0 && (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, (*(*[113]uintptr)(unsafe.Pointer(bp)))[0], rt, arg) >= 0 { break } - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, rt, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, rt, arg) >= 0 { v1 = i i++ (*(*[113]uintptr)(unsafe.Pointer(bp)))[v1] = lf @@ -144589,7 +144556,7 @@ func _sift(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pshi _cycle(tls, width, bp, i) } -func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { +func _trinkle(tls *TLS, head uintptr, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr, pp uintptr, pshift int32, trusty int32, lp uintptr) { bp := tls.Alloc(928) defer tls.Free(928) var i, trail, v1 int32 @@ -144603,13 +144570,13 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0] = head for (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp)))[int32(1)] != uint64(0) { stepson = head - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift)*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, stepson, (*(*[113]uintptr)(unsafe.Pointer(bp + 16)))[0], arg) <= 0 { break } if !(trusty != 0) && pshift > int32(1) { rt = head - uintptr(width) lf = head - uintptr(width) - uintptr(*(*Tsize_t)(unsafe.Pointer(lp + uintptr(pshift-int32(2))*8))) - if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, lf, stepson, arg) >= 0 { + if (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, rt, stepson, arg) >= 0 || (*(*func(*TLS, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_cmp})))(tls, lf, stepson, arg) >= 0 { break } } @@ -144624,13 +144591,15 @@ func _trinkle(tls *TLS, head uintptr, width Tsize_t, cmp Tcmpfun, arg uintptr, p } if !(trusty != 0) { _cycle(tls, width, bp+16, i) - _sift(tls, head, width, cmp, arg, pshift, lp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, lp) } } -func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__X__qsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } bp := tls.Alloc(784) defer tls.Free(784) @@ -144668,14 +144637,14 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, } for head < high { if (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0]&uint64(3) == uint64(3) { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) _shr(tls, bp+768, int32(2)) pshift += int32(2) } else { if (*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift-int32(1)] >= Uint64FromInt64(int64(high)-int64(head)) { - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) } else { - _sift(tls, head, width, cmp, arg, pshift, bp) + _sift(tls, head, width, __ccgo_fp_cmp, arg, pshift, bp) } if pshift == int32(1) { _shl(tls, bp+768, int32(1)) @@ -144688,7 +144657,7 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) head += uintptr(width) } - _trinkle(tls, head, width, cmp, arg, bp+768, pshift, 0, bp) + _trinkle(tls, head, width, __ccgo_fp_cmp, arg, bp+768, pshift, 0, bp) for pshift != int32(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[0] != uint64(1) || (*(*[2]Tsize_t)(unsafe.Pointer(bp + 768)))[int32(1)] != uint64(0) { if pshift <= int32(1) { trail = _pntz(tls, bp+768) @@ -144699,31 +144668,35 @@ func X__qsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, pshift -= int32(2) *(*Tsize_t)(unsafe.Pointer(bp + 768)) ^= uint64(7) _shr(tls, bp+768, int32(1)) - _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, cmp, arg, bp+768, pshift+int32(1), int32(1), bp) + _trinkle(tls, head-uintptr((*(*[96]Tsize_t)(unsafe.Pointer(bp)))[pshift])-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift+int32(1), int32(1), bp) _shl(tls, bp+768, int32(1)) *(*Tsize_t)(unsafe.Pointer(bp + 768)) |= uint64(1) - _trinkle(tls, head-uintptr(width), width, cmp, arg, bp+768, pshift, int32(1), bp) + _trinkle(tls, head-uintptr(width), width, __ccgo_fp_cmp, arg, bp+768, pshift, int32(1), bp) } head -= uintptr(width) } } -func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun, arg uintptr) { +type t__ccgo_fp__Xqsort_r_3 = func(*TLS, uintptr, uintptr, uintptr) int32 + +func Xqsort_r(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun, arg uintptr) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v arg=%v, (%v:)", tls, base, nel, width, cmp, arg, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v arg=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, arg, origin(2)) } - X__qsort_r(tls, base, nel, width, cmp, arg) + X__qsort_r(tls, base, nel, width, __ccgo_fp_cmp, arg) } func _wrapper_cmp(tls *TLS, v1 uintptr, v2 uintptr, cmp uintptr) (r int32) { return (*(*func(*TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{cmp})))(tls, v1, v2) } -func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, cmp Tcmpfun) { +type t__ccgo_fp__Xqsort_3 = func(*TLS, uintptr, uintptr) int32 + +func Xqsort(tls *TLS, base uintptr, nel Tsize_t, width Tsize_t, __ccgo_fp_cmp Tcmpfun) { if __ccgo_strace { - trc("tls=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, base, nel, width, cmp, origin(2)) + trc("tls=%v base=%v nel=%v width=%v __ccgo_fp_cmp=%v, (%v:)", tls, base, nel, width, __ccgo_fp_cmp, origin(2)) } - X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), cmp) + X__qsort_r(tls, base, nel, width, __ccgo_fp(_wrapper_cmp), __ccgo_fp_cmp) } func _strtox(tls *TLS, s uintptr, p uintptr, prec int32) (r float64) { @@ -144818,7 +144791,7 @@ func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _strtox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _strtox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -144826,7 +144799,7 @@ func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_strtox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_strtox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -145098,7 +145071,7 @@ func Xwcstoul(tls *TLS, s uintptr, p uintptr, base int32) (r uint64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return _wcstox1(tls, s, p, base, Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1)) + return _wcstox1(tls, s, p, base, uint64(Uint64FromUint64(2)*Uint64FromInt64(0x7fffffffffffffff)+Uint64FromInt32(1))) } func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { @@ -145106,7 +145079,7 @@ func Xwcstol(tls *TLS, s uintptr, p uintptr, base int32) (r int64) { trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) defer func() { trc("-> %v", r) }() } - return Int64FromUint64(_wcstox1(tls, s, p, base, Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1)))) + return Int64FromUint64(_wcstox1(tls, s, p, base, uint64(Uint64FromUint64(0)+Uint64FromInt64(-Int64FromInt64(0x7fffffffffffffff)-Int64FromInt32(1))))) } func Xwcstoimax(tls *TLS, s uintptr, p uintptr, base int32) (r Tintmax_t) { @@ -149198,7 +149171,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { if local != 0 { off = Int32FromUint32(_zi_read32(tls, _types+uintptr(int32(6)*Int32FromUint8(*(*uint8)(unsafe.Pointer(_index + uintptr(m-uint64(1)))))))) } - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { n /= uint64(2) } else { a = m @@ -149238,7 +149211,7 @@ func _scan_trans(tls *TLS, t int64, local int32, alt uintptr) (r Tsize_t) { } /* If t is before first transition, use the above-found type * and the index-zero (after transition) type as the alt. */ - if t-int64(off) < Int64FromUint64(x) { + if t-int64(off) < int64(Int64FromUint64(x)) { if alt != 0 { *(*Tsize_t)(unsafe.Pointer(alt)) = uint64(*(*uint8)(unsafe.Pointer(_index))) } @@ -150359,7 +150332,7 @@ func Xstrftime(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize_t trc("tls=%v s=%v n=%v f=%v tm=%v, (%v:)", tls, s, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__strftime_l(tls, s, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xstrftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -151103,7 +151076,7 @@ func Xwcsftime(tls *TLS, wcs uintptr, n Tsize_t, f uintptr, tm uintptr) (r Tsize trc("tls=%v wcs=%v n=%v f=%v tm=%v, (%v:)", tls, wcs, n, f, tm, origin(2)) defer func() { trc("-> %v", r) }() } - return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(___get_tp(tls))).Flocale) + return X__wcsftime_l(tls, wcs, n, f, tm, (*t__pthread)(unsafe.Pointer(uintptr(___get_tp(tls)))).Flocale) } func Xwcsftime_l(tls *TLS, s uintptr, n Tsize_t, f uintptr, tm uintptr, loc Tlocale_t) (r Tsize_t) { @@ -152195,7 +152168,7 @@ var X__exp2f_data = Texp2f_data{ 2: float64(0.6931471806916203), }, Fshift: float64(6.755399441055744e+15), - Finvln2_scaled: Float64FromFloat64(1.4426950408889634) * float64(Int32FromInt32(1)< ccgo.go -//go:generate go fmt ./... +///go.generate echo package libc > ccgo.go +///go:generate go fmt -l -s -w ./... -// Package libc provides run time support for ccgo generated programs and -// implements selected parts of the C standard library. package libc // import "modernc.org/libc" //TODO use O_RDONLY etc. from fcntl header @@ -1952,7 +1950,7 @@ func getLocalLocation() (loc *gotime.Location) { } // time_t mktime(struct tm *tm); -func Xmktime(t *TLS, ptm uintptr) time.Time_t { +func Xmktime(t *TLS, ptm uintptr) (r time.Time_t) { if __ccgo_strace { trc("t=%v ptm=%v, (%v:)", t, ptm, origin(2)) } @@ -1969,7 +1967,8 @@ func Xmktime(t *TLS, ptm uintptr) time.Time_t { ) (*time.Tm)(unsafe.Pointer(ptm)).Ftm_wday = int32(tt.Weekday()) (*time.Tm)(unsafe.Pointer(ptm)).Ftm_yday = int32(tt.YearDay() - 1) - return time.Time_t(tt.Unix()) + r = time.Time_t(tt.Unix()) + return r } // char *strpbrk(const char *s, const char *accept); @@ -2314,14 +2313,6 @@ func Xwcwidth(t *TLS, c wchar_t) int32 { panic(todo("")) } -// int clock_gettime(clockid_t clk_id, struct timespec *tp); -func Xclock_gettime(t *TLS, clk_id int32, tp uintptr) int32 { - if __ccgo_strace { - trc("t=%v clk_id=%v tp=%v, (%v:)", t, clk_id, tp, origin(2)) - } - panic(todo("")) -} - // AtExit will attempt to run f at process exit. The execution cannot be // guaranteed, neither its ordering with respect to any other handlers // registered by AtExit. @@ -2650,3 +2641,933 @@ func Xlrint(tls *TLS, x float64) (r long) { } return long(Xrint(tls, x)) } + +func X__builtin_trunc(tls *TLS, x float64) (r float64) { + return Xtrunc(tls, x) +} + +func X__builtin_fmin(tls *TLS, x float64, y float64) (r float64) { + return Xfmin(tls, x, y) +} + +func Xfmin(tls *TLS, x float64, y float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + defer func() { trc("-> %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var v1, v10, v3, v5, v7 uint64 + var v12, v9 float64 + var _ /* __u at bp+0 */ struct { + F__i [0]uint64 + F__f float64 + } + _, _, _, _, _, _, _ = v1, v10, v12, v3, v5, v7, v9 + *(*float64)(unsafe.Pointer(bp)) = x + v1 = *(*uint64)(unsafe.Pointer(bp)) + goto _2 +_2: + if BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(63)) != Int32FromUint64(v7>>Int32FromInt32(63)) { + *(*float64)(unsafe.Pointer(bp)) = x + v10 = *(*uint64)(unsafe.Pointer(bp)) + goto _11 + _11: + if Int32FromUint64(v10>>Int32FromInt32(63)) != 0 { + v9 = x + } else { + v9 = y + } + return v9 + } + if x < y { + v12 = x + } else { + v12 = y + } + return v12 +} + +func Xfminf(tls *TLS, x float32, y float32) (r float32) { + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + defer func() { trc("-> %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var v1, v10, v3, v5, v7 uint32 + var v12, v9 float32 + var _ /* __u at bp+0 */ struct { + F__i [0]uint32 + F__f float32 + } + _, _, _, _, _, _, _ = v1, v10, v12, v3, v5, v7, v9 + *(*float32)(unsafe.Pointer(bp)) = x + v1 = *(*uint32)(unsafe.Pointer(bp)) + goto _2 +_2: + if BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { + return y + } + *(*float32)(unsafe.Pointer(bp)) = y + v3 = *(*uint32)(unsafe.Pointer(bp)) + goto _4 +_4: + if BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { + return x + } + /* handle signed zeros, see C99 Annex F.9.9.2 */ + *(*float32)(unsafe.Pointer(bp)) = x + v5 = *(*uint32)(unsafe.Pointer(bp)) + goto _6 +_6: + *(*float32)(unsafe.Pointer(bp)) = y + v7 = *(*uint32)(unsafe.Pointer(bp)) + goto _8 +_8: + if Int32FromUint32(v5>>Int32FromInt32(31)) != Int32FromUint32(v7>>Int32FromInt32(31)) { + *(*float32)(unsafe.Pointer(bp)) = x + v10 = *(*uint32)(unsafe.Pointer(bp)) + goto _11 + _11: + if Int32FromUint32(v10>>Int32FromInt32(31)) != 0 { + v9 = x + } else { + v9 = y + } + return v9 + } + if x < y { + v12 = x + } else { + v12 = y + } + return v12 +} + +func Xfminl(tls *TLS, x float64, y float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + defer func() { trc("-> %v", r) }() + } + return Xfmin(tls, x, y) +} + +func Xfmax(tls *TLS, x float64, y float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + defer func() { trc("-> %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var v1, v10, v3, v5, v7 uint64 + var v12, v9 float64 + var _ /* __u at bp+0 */ struct { + F__i [0]uint64 + F__f float64 + } + _, _, _, _, _, _, _ = v1, v10, v12, v3, v5, v7, v9 + *(*float64)(unsafe.Pointer(bp)) = x + v1 = *(*uint64)(unsafe.Pointer(bp)) + goto _2 +_2: + if BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)<>Int32FromInt32(63)) != Int32FromUint64(v7>>Int32FromInt32(63)) { + *(*float64)(unsafe.Pointer(bp)) = x + v10 = *(*uint64)(unsafe.Pointer(bp)) + goto _11 + _11: + if Int32FromUint64(v10>>Int32FromInt32(63)) != 0 { + v9 = y + } else { + v9 = x + } + return v9 + } + if x < y { + v12 = y + } else { + v12 = x + } + return v12 +} + +func Xfmaxf(tls *TLS, x float32, y float32) (r float32) { + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + defer func() { trc("-> %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var v1, v10, v3, v5, v7 uint32 + var v12, v9 float32 + var _ /* __u at bp+0 */ struct { + F__i [0]uint32 + F__f float32 + } + _, _, _, _, _, _, _ = v1, v10, v12, v3, v5, v7, v9 + *(*float32)(unsafe.Pointer(bp)) = x + v1 = *(*uint32)(unsafe.Pointer(bp)) + goto _2 +_2: + if BoolInt32(v1&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { + return y + } + *(*float32)(unsafe.Pointer(bp)) = y + v3 = *(*uint32)(unsafe.Pointer(bp)) + goto _4 +_4: + if BoolInt32(v3&uint32(0x7fffffff) > uint32(0x7f800000)) != 0 { + return x + } + /* handle signed zeroes, see C99 Annex F.9.9.2 */ + *(*float32)(unsafe.Pointer(bp)) = x + v5 = *(*uint32)(unsafe.Pointer(bp)) + goto _6 +_6: + *(*float32)(unsafe.Pointer(bp)) = y + v7 = *(*uint32)(unsafe.Pointer(bp)) + goto _8 +_8: + if Int32FromUint32(v5>>Int32FromInt32(31)) != Int32FromUint32(v7>>Int32FromInt32(31)) { + *(*float32)(unsafe.Pointer(bp)) = x + v10 = *(*uint32)(unsafe.Pointer(bp)) + goto _11 + _11: + if Int32FromUint32(v10>>Int32FromInt32(31)) != 0 { + v9 = y + } else { + v9 = x + } + return v9 + } + if x < y { + v12 = y + } else { + v12 = x + } + return v12 +} + +func Xfmaxl(tls *TLS, x float64, y float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) + defer func() { trc("-> %v", r) }() + } + return Xfmax(tls, x, y) +} + +func X__builtin_fmax(tls *TLS, x float64, y float64) (r float64) { + return Xfmax(tls, x, y) +} + +func Xexpm1(tls *TLS, x3 float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x3=%v, (%v:)", tls, x3, origin(2)) + defer func() { trc("-> %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var c, e, hfx, hi, hxs, lo, r1, t, twopk, y3 Tdouble_t + var hx Tuint32_t + var k, sign int32 + var y float32 + var y1, y2, v3 float64 + var v1 uint64 + var _ /* __u at bp+0 */ struct { + F__i [0]uint64 + F__f float64 + } + var _ /* u at bp+8 */ struct { + Fi [0]Tuint64_t + Ff float64 + } + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, e, hfx, hi, hx, hxs, k, lo, r1, sign, t, twopk, y, y1, y2, y3, v1, v3 + *(*struct { + Fi [0]Tuint64_t + Ff float64 + })(unsafe.Pointer(bp + 8)) = struct { + Fi [0]Tuint64_t + Ff float64 + }{} + *(*float64)(unsafe.Pointer(bp + 8)) = x3 + hx = uint32(*(*Tuint64_t)(unsafe.Pointer(bp + 8)) >> int32(32) & uint64(0x7fffffff)) + sign = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp + 8)) >> int32(63)) + /* filter out huge and non-finite argument */ + if hx >= uint32(0x4043687A) { /* if |x|>=56*ln2 */ + *(*float64)(unsafe.Pointer(bp)) = x3 + v1 = *(*uint64)(unsafe.Pointer(bp)) + goto _2 + _2: + if BoolInt32(v1&(-Uint64FromUint64(1)>>Int32FromInt32(1)) > Uint64FromUint64(0x7ff)< _o_threshold { + x3 *= float64(8.98846567431158e+307) + return x3 + } + } + /* argument reduction */ + if hx > uint32(0x3fd62e42) { /* if |x| > 0.5 ln2 */ + if hx < uint32(0x3FF0A2B2) { /* and |x| < 1.5 ln2 */ + if !(sign != 0) { + hi = x3 - _ln2_hi + lo = _ln2_lo + k = int32(1) + } else { + hi = x3 + _ln2_hi + lo = -_ln2_lo + k = -int32(1) + } + } else { + if sign != 0 { + v3 = -Float64FromFloat64(0.5) + } else { + v3 = float64(0.5) + } + k = int32(float64(_invln2*x3) + v3) + t = float64(k) + hi = x3 - float64(t*_ln2_hi) /* t*ln2_hi is exact here */ + lo = Tdouble_t(t * _ln2_lo) + } + x3 = hi - lo + c = hi - x3 - lo + } else { + if hx < uint32(0x3c900000) { /* |x| < 2**-54, return x */ + if hx < uint32(0x00100000) { + if uint64(4) == uint64(4) { + y = float32(x3) + } else { + if uint64(4) == uint64(8) { + y1 = float64(float32(x3)) + } else { + y2 = float64(float32(x3)) + } + } + } + return x3 + } else { + k = 0 + } + } + /* x is now in primary range */ + hfx = Tdouble_t(float64(0.5) * x3) + hxs = Tdouble_t(x3 * hfx) + r1 = float64(1) + float64(hxs*(_Q1+float64(hxs*(_Q2+float64(hxs*(_Q3+float64(hxs*(_Q4+float64(hxs*_Q5))))))))) + t = float64(3) - float64(r1*hfx) + e = Tdouble_t(hxs * ((r1 - t) / (Float64FromFloat64(6) - float64(x3*t)))) + if k == 0 { /* c is 0 */ + return x3 - (float64(x3*e) - hxs) + } + e = float64(x3*(e-c)) - c + e -= hxs + /* exp(x) ~ 2^k (Xreduced - e + 1) */ + if k == -int32(1) { + return float64(float64(0.5)*(x3-e)) - float64(0.5) + } + if k == int32(1) { + if x3 < -Float64FromFloat64(0.25) { + return float64(-Float64FromFloat64(2) * (e - (x3 + Float64FromFloat64(0.5)))) + } + return float64(1) + float64(float64(2)*(x3-e)) + } + *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)+k) << int32(52) /* 2^k */ + twopk = *(*float64)(unsafe.Pointer(bp + 8)) + if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ + y3 = x3 - e + float64(1) + if k == int32(1024) { + y3 = Tdouble_t(Tdouble_t(y3*float64(2)) * float64(8.98846567431158e+307)) + } else { + y3 = Tdouble_t(y3 * twopk) + } + return y3 - float64(1) + } + *(*Tuint64_t)(unsafe.Pointer(bp + 8)) = Uint64FromInt32(Int32FromInt32(0x3ff)-k) << int32(52) /* 2^-k */ + if k < int32(20) { + y3 = Tdouble_t((x3 - e + (Float64FromInt32(1) - *(*float64)(unsafe.Pointer(bp + 8)))) * twopk) + } else { + y3 = Tdouble_t((x3 - (e + *(*float64)(unsafe.Pointer(bp + 8))) + Float64FromInt32(1)) * twopk) + } + return y3 +} + +var _ln2_hi1 = float32(0.69313812256) /* 0x3f317180 */ +var _ln2_lo1 = float32(9.0580006145e-06) /* 0x3717f7d1 */ +var _invln21 = float32(1.4426950216) /* 0x3fb8aa3b */ +/* + * Domain [-0.34568, 0.34568], range ~[-6.694e-10, 6.696e-10]: + * |6 / x * (1 + 2 * (1 / (exp(x) - 1) - 1 / x)) - q(x)| < 2**-30.04 + * Scaled coefficients: Qn_here = 2**n * Qn_for_q (see s_expm1.c): + */ +var _Q11 = float32(-Float64FromFloat64(0.033333212137)) /* -0x888868.0p-28 */ +var _Q21 = float32(0.0015807170421) /* 0xcf3010.0p-33 */ + +func Xexpm1f(tls *TLS, x3 float32) (r float32) { + if __ccgo_strace { + trc("tls=%v x3=%v, (%v:)", tls, x3, origin(2)) + defer func() { trc("-> %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var c, e, hfx, hi, hxs, lo, r1, t, twopk, y3 Tfloat_t + var hx Tuint32_t + var k, sign int32 + var y, v1 float32 + var y1, y2 float64 + var _ /* u at bp+0 */ struct { + Fi [0]Tuint32_t + Ff float32 + } + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, e, hfx, hi, hx, hxs, k, lo, r1, sign, t, twopk, y, y1, y2, y3, v1 + *(*struct { + Fi [0]Tuint32_t + Ff float32 + })(unsafe.Pointer(bp)) = struct { + Fi [0]Tuint32_t + Ff float32 + }{} + *(*float32)(unsafe.Pointer(bp)) = x3 + hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) + sign = Int32FromUint32(*(*Tuint32_t)(unsafe.Pointer(bp)) >> int32(31)) + /* filter out huge and non-finite argument */ + if hx >= uint32(0x4195b844) { /* if |x|>=27*ln2 */ + if hx > uint32(0x7f800000) { /* NaN */ + return x3 + } + if sign != 0 { + return float32(-Int32FromInt32(1)) + } + if hx > uint32(0x42b17217) { /* x > log(FLT_MAX) */ + x3 *= Float32FromFloat32(1.7014118346046923e+38) + return x3 + } + } + /* argument reduction */ + if hx > uint32(0x3eb17218) { /* if |x| > 0.5 ln2 */ + if hx < uint32(0x3F851592) { /* and |x| < 1.5 ln2 */ + if !(sign != 0) { + hi = x3 - _ln2_hi1 + lo = _ln2_lo1 + k = int32(1) + } else { + hi = x3 + _ln2_hi1 + lo = -_ln2_lo1 + k = -int32(1) + } + } else { + if sign != 0 { + v1 = -Float32FromFloat32(0.5) + } else { + v1 = Float32FromFloat32(0.5) + } + k = int32(float32(_invln21*x3) + v1) + t = float32(k) + hi = x3 - float32(t*_ln2_hi1) /* t*ln2_hi is exact here */ + lo = Tfloat_t(t * _ln2_lo1) + } + x3 = hi - lo + c = hi - x3 - lo + } else { + if hx < uint32(0x33000000) { /* when |x|<2**-25, return x */ + if hx < uint32(0x00800000) { + if uint64(4) == uint64(4) { + y = float32(x3 * x3) + } else { + if uint64(4) == uint64(8) { + y1 = float64(x3 * x3) + } else { + y2 = float64(x3 * x3) + } + } + } + return x3 + } else { + k = 0 + } + } + /* x is now in primary range */ + hfx = Tfloat_t(Float32FromFloat32(0.5) * x3) + hxs = Tfloat_t(x3 * hfx) + r1 = Float32FromFloat32(1) + float32(hxs*(_Q11+float32(hxs*_Q21))) + t = Float32FromFloat32(3) - float32(r1*hfx) + e = Tfloat_t(hxs * ((r1 - t) / (Float32FromFloat32(6) - float32(x3*t)))) + if k == 0 { /* c is 0 */ + return x3 - (float32(x3*e) - hxs) + } + e = float32(x3*(e-c)) - c + e -= hxs + /* exp(x) ~ 2^k (Xreduced - e + 1) */ + if k == -int32(1) { + return float32(Float32FromFloat32(0.5)*(x3-e)) - Float32FromFloat32(0.5) + } + if k == int32(1) { + if x3 < -Float32FromFloat32(0.25) { + return float32(-Float32FromFloat32(2) * (e - (x3 + Float32FromFloat32(0.5)))) + } + return Float32FromFloat32(1) + float32(Float32FromFloat32(2)*(x3-e)) + } + *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) + k) << int32(23)) /* 2^k */ + twopk = *(*float32)(unsafe.Pointer(bp)) + if k < 0 || k > int32(56) { /* suffice to return exp(x)-1 */ + y3 = x3 - e + Float32FromFloat32(1) + if k == int32(128) { + y3 = Tfloat_t(Tfloat_t(y3*Float32FromFloat32(2)) * Float32FromFloat32(1.7014118346046923e+38)) + } else { + y3 = Tfloat_t(y3 * twopk) + } + return y3 - Float32FromFloat32(1) + } + *(*Tuint32_t)(unsafe.Pointer(bp)) = Uint32FromInt32((int32(0x7f) - k) << int32(23)) /* 2^-k */ + if k < int32(23) { + y3 = Tfloat_t((x3 - e + (Float32FromInt32(1) - *(*float32)(unsafe.Pointer(bp)))) * twopk) + } else { + y3 = Tfloat_t((x3 - (e + *(*float32)(unsafe.Pointer(bp))) + Float32FromInt32(1)) * twopk) + } + return y3 +} + +func Xexpm1l(tls *TLS, x float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + defer func() { trc("-> %v", r) }() + } + return Xexpm1(tls, x) +} + +type Tdouble_t = float64 +type Tuint32_t = uint32 +type Tuint64_t = uint64 + +var _o_threshold = float64(709.782712893384) /* 0x40862E42, 0xFEFA39EF */ +var _ln2_hi = float64(0.6931471803691238) /* 0x3fe62e42, 0xfee00000 */ +var _ln2_lo = float64(1.9082149292705877e-10) /* 0x3dea39ef, 0x35793c76 */ +var _invln2 = float64(1.4426950408889634) /* 0x3ff71547, 0x652b82fe */ +/* Scaled Q's: Qn_here = 2**n * Qn_above, for R(2*z) where z = hxs = x*x/2: */ +var _Q1 = -Float64FromFloat64(0.03333333333333313) /* BFA11111 111110F4 */ +var _Q2 = float64(0.0015873015872548146) /* 3F5A01A0 19FE5585 */ +var _Q3 = -Float64FromFloat64(7.93650757867488e-05) /* BF14CE19 9EAADBB7 */ +var _Q4 = float64(4.008217827329362e-06) /* 3ED0CFCA 86E65239 */ +var _Q5 = -Float64FromFloat64(2.0109921818362437e-07) /* BE8AFDB7 6E09C32D */ + +var _ln2_hi2 = float64(0.6931471803691238) /* 3fe62e42 fee00000 */ +var _ln2_lo2 = float64(1.9082149292705877e-10) /* 3dea39ef 35793c76 */ +var _Lg12 = float64(0.6666666666666735) /* 3FE55555 55555593 */ +var _Lg22 = float64(0.3999999999940942) /* 3FD99999 9997FA04 */ +var _Lg32 = float64(0.2857142874366239) /* 3FD24924 94229359 */ +var _Lg42 = float64(0.22222198432149784) /* 3FCC71C5 1D8E78AF */ +var _Lg51 = float64(0.1818357216161805) /* 3FC74664 96CB03DE */ +var _Lg61 = float64(0.15313837699209373) /* 3FC39A09 D078C69F */ +var _Lg71 = float64(0.14798198605116586) /* 3FC2F112 DF3E5244 */ + +func Xlog1p(tls *TLS, x3 float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x3=%v, (%v:)", tls, x3, origin(2)) + defer func() { trc("-> %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var R, c, dk, f, hfsq, s, t1, t2, w, z Tdouble_t + var hu, hx Tuint32_t + var k int32 + var y float32 + var y1, y2, v1 float64 + var _ /* u at bp+0 */ struct { + Fi [0]Tuint64_t + Ff float64 + } + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = R, c, dk, f, hfsq, hu, hx, k, s, t1, t2, w, y, y1, y2, z, v1 + *(*struct { + Fi [0]Tuint64_t + Ff float64 + })(unsafe.Pointer(bp)) = struct { + Fi [0]Tuint64_t + Ff float64 + }{} + *(*float64)(unsafe.Pointer(bp)) = x3 + hx = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32)) + k = int32(1) + if hx < uint32(0x3fda827a) || hx>>int32(31) != 0 { /* 1+x < sqrt(2)+ */ + if hx >= uint32(0xbff00000) { /* x <= -1.0 */ + if x3 == float64(-Int32FromInt32(1)) { + return x3 / float64(0) + } /* log1p(-1) = -inf */ + return (x3 - x3) / float64(0) /* log1p(x<-1) = NaN */ + } + if hx<= uint32(0x7ff00000) { + return x3 + } + } + if k != 0 { + *(*float64)(unsafe.Pointer(bp)) = Float64FromInt32(1) + x3 + hu = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32)) + hu += Uint32FromInt32(Int32FromInt32(0x3ff00000) - Int32FromInt32(0x3fe6a09e)) + k = Int32FromUint32(hu>>Int32FromInt32(20)) - int32(0x3ff) + /* correction term ~ log(1+x)-log(u), avoid underflow in c/u */ + if k < int32(54) { + if k >= int32(2) { + v1 = Float64FromInt32(1) - (*(*float64)(unsafe.Pointer(bp)) - x3) + } else { + v1 = x3 - (*(*float64)(unsafe.Pointer(bp)) - Float64FromInt32(1)) + } + c = v1 + c /= *(*float64)(unsafe.Pointer(bp)) + } else { + c = Float64FromInt32(0) + } + /* reduce u into [sqrt(2)/2, sqrt(2)] */ + hu = hu&uint32(0x000fffff) + uint32(0x3fe6a09e) + *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(hu)< %v", r) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var R, c, dk, f, hfsq, s, t1, t2, w, z Tfloat_t + var iu, ix Tuint32_t + var k int32 + var y, v1 float32 + var y1, y2 float64 + var _ /* u at bp+0 */ struct { + Fi [0]Tuint32_t + Ff float32 + } + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = R, c, dk, f, hfsq, iu, ix, k, s, t1, t2, w, y, y1, y2, z, v1 + *(*struct { + Fi [0]Tuint32_t + Ff float32 + })(unsafe.Pointer(bp)) = struct { + Fi [0]Tuint32_t + Ff float32 + }{} + *(*float32)(unsafe.Pointer(bp)) = x3 + ix = *(*Tuint32_t)(unsafe.Pointer(bp)) + k = int32(1) + if ix < uint32(0x3ed413d0) || ix>>int32(31) != 0 { /* 1+x < sqrt(2)+ */ + if ix >= uint32(0xbf800000) { /* x <= -1.0 */ + if x3 == float32(-Int32FromInt32(1)) { + return x3 / Float32FromFloat32(0) + } /* log1p(-1)=+inf */ + return (x3 - x3) / Float32FromFloat32(0) /* log1p(x<-1)=NaN */ + } + if ix<= uint32(0x7f800000) { + return x3 + } + } + if k != 0 { + *(*float32)(unsafe.Pointer(bp)) = Float32FromInt32(1) + x3 + iu = *(*Tuint32_t)(unsafe.Pointer(bp)) + iu += Uint32FromInt32(Int32FromInt32(0x3f800000) - Int32FromInt32(0x3f3504f3)) + k = Int32FromUint32(iu>>Int32FromInt32(23)) - int32(0x7f) + /* correction term ~ log(1+x)-log(u), avoid underflow in c/u */ + if k < int32(25) { + if k >= int32(2) { + v1 = Float32FromInt32(1) - (*(*float32)(unsafe.Pointer(bp)) - x3) + } else { + v1 = x3 - (*(*float32)(unsafe.Pointer(bp)) - Float32FromInt32(1)) + } + c = v1 + c /= *(*float32)(unsafe.Pointer(bp)) + } else { + c = Float32FromInt32(0) + } + /* reduce u into [sqrt(2)/2, sqrt(2)] */ + iu = iu&uint32(0x007fffff) + uint32(0x3f3504f3) + *(*Tuint32_t)(unsafe.Pointer(bp)) = iu + f = *(*float32)(unsafe.Pointer(bp)) - Float32FromInt32(1) + } + s = f / (Float32FromFloat32(2) + f) + z = Tfloat_t(s * s) + w = Tfloat_t(z * z) + t1 = Tfloat_t(w * (_Lg23 + float32(w*_Lg43))) + t2 = Tfloat_t(z * (_Lg13 + float32(w*_Lg33))) + R = t2 + t1 + hfsq = Tfloat_t(float32(Float32FromFloat32(0.5)*f) * f) + dk = float32(k) + return Tfloat_t(s*(hfsq+R)) + (Tfloat_t(dk*_ln2_lo3) + c) - hfsq + f + Tfloat_t(dk*_ln2_hi3) +} + +func Xlog1pl(tls *TLS, x float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + defer func() { trc("-> %v", r) }() + } + return Xlog1p(tls, x) +} + +type Tfloat_t = float32 + +var _B1 = uint32(715094163) /* B1 = (1023-1023/3-0.03306235651)*2**20 */ +var _B2 = uint32(696219795) /* B2 = (1023-1023/3-54/3-0.03306235651)*2**20 */ + +// C documentation +// +// /* |1/cbrt(x) - p(x)| < 2**-23.5 (~[-7.93e-8, 7.929e-8]). */ + +var _P0 = float64(1.87595182427177) /* 0x3ffe03e6, 0x0f61e692 */ +var _P1 = -Float64FromFloat64(1.8849797954337717) /* 0xbffe28e0, 0x92f02420 */ +var _P2 = float64(1.6214297201053545) /* 0x3ff9f160, 0x4a49d6c2 */ +var _P3 = -Float64FromFloat64(0.758397934778766) /* 0xbfe844cb, 0xbee751d9 */ +var _P4 = float64(0.14599619288661245) /* 0x3fc2b000, 0xd4e4edd7 */ + +func Xcbrt(tls *TLS, x float64) (r1 float64) { + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + defer func() { trc("-> %v", r1) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var hx Tuint32_t + var r, s, t, w Tdouble_t + var p1 uintptr + var _ /* u at bp+0 */ struct { + Fi [0]Tuint64_t + Ff float64 + } + _, _, _, _, _, _ = hx, r, s, t, w, p1 + *(*struct { + Fi [0]Tuint64_t + Ff float64 + })(unsafe.Pointer(bp)) = struct { + Fi [0]Tuint64_t + Ff float64 + }{} + *(*float64)(unsafe.Pointer(bp)) = x + hx = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) + if hx >= uint32(0x7ff00000) { /* cbrt(NaN,INF) is itself */ + return x + x + } + /* + * Rough cbrt to 5 bits: + * cbrt(2**e*(1+m) ~= 2**(e/3)*(1+(e%3+m)/3) + * where e is integral and >= 0, m is real and in [0, 1), and "/" and + * "%" are integer division and modulus with rounding towards minus + * infinity. The RHS is always >= the LHS and has a maximum relative + * error of about 1 in 16. Adding a bias of -0.03306235651 to the + * (e%3+m)/3 term reduces the error to about 1 in 32. With the IEEE + * floating point representation, for finite positive normal values, + * ordinary integer divison of the value in bits magically gives + * almost exactly the RHS of the above provided we first subtract the + * exponent bias (1023 for doubles) and later add it back. We do the + * subtraction virtually to keep e >= 0 so that ordinary integer + * division rounds towards minus infinity; this is also efficient. + */ + if hx < uint32(0x00100000) { /* zero or subnormal? */ + *(*float64)(unsafe.Pointer(bp)) = float64(x * float64(1.8014398509481984e+16)) + hx = uint32(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(32) & uint64(0x7fffffff)) + if hx == uint32(0) { + return x + } /* cbrt(0) is itself */ + hx = hx/uint32(3) + _B2 + } else { + hx = hx/uint32(3) + _B1 + } + p1 = bp + *(*Tuint64_t)(unsafe.Pointer(p1)) = Tuint64_t(*(*Tuint64_t)(unsafe.Pointer(p1)) & (Uint64FromUint64(1) << Int32FromInt32(63))) + *(*Tuint64_t)(unsafe.Pointer(bp)) |= uint64(hx) << int32(32) + t = *(*float64)(unsafe.Pointer(bp)) + /* + * New cbrt to 23 bits: + * cbrt(x) = t*cbrt(x/t**3) ~= t*P(t**3/x) + * where P(r) is a polynomial of degree 4 that approximates 1/cbrt(r) + * to within 2**-23.5 when |r - 1| < 1/10. The rough approximation + * has produced t such than |t/cbrt(x) - 1| ~< 1/32, and cubing this + * gives us bounds for r = t**3/x. + * + * Try to optimize for parallel evaluation as in __tanf.c. + */ + r = Tdouble_t(Tdouble_t(t*t) * (t / x)) + t = Tdouble_t(t * (_P0 + float64(r*(_P1+float64(r*_P2))) + float64(Tdouble_t(Tdouble_t(r*r)*r)*(_P3+float64(r*_P4))))) + /* + * Round t away from zero to 23 bits (sloppily except for ensuring that + * the result is larger in magnitude than cbrt(x) but not much more than + * 2 23-bit ulps larger). With rounding towards zero, the error bound + * would be ~5/6 instead of ~4/6. With a maximum error of 2 23-bit ulps + * in the rounded t, the infinite-precision error in the Newton + * approximation barely affects third digit in the final error + * 0.667; the error in the rounded t can be up to about 3 23-bit ulps + * before the final error is larger than 0.667 ulps. + */ + *(*float64)(unsafe.Pointer(bp)) = t + *(*Tuint64_t)(unsafe.Pointer(bp)) = uint64(*(*Tuint64_t)(unsafe.Pointer(bp))+Uint64FromUint32(0x80000000)) & uint64(0xffffffffc0000000) + t = *(*float64)(unsafe.Pointer(bp)) + /* one step Newton iteration to 53 bits with error < 0.667 ulps */ + s = Tdouble_t(t * t) /* t*t is exact */ + r = x / s /* error <= 0.5 ulps; |r| < |t| */ + w = t + t /* t+t is exact */ + r = (r - t) / (w + r) /* r-t is exact; w+r ~= 3*t */ + t = t + Tdouble_t(t*r) /* error <= 0.5 + 0.5/3 + epsilon */ + return t +} + +var _B11 = uint32(709958130) /* B1 = (127-127.0/3-0.03306235651)*2**23 */ +var _B21 = uint32(642849266) /* B2 = (127-127.0/3-24/3-0.03306235651)*2**23 */ + +func Xcbrtf(tls *TLS, x float32) (r1 float32) { + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + defer func() { trc("-> %v", r1) }() + } + bp := tls.Alloc(16) + defer tls.Free(16) + var T, r Tdouble_t + var hx Tuint32_t + var _ /* u at bp+0 */ struct { + Fi [0]Tuint32_t + Ff float32 + } + _, _, _ = T, hx, r + *(*struct { + Fi [0]Tuint32_t + Ff float32 + })(unsafe.Pointer(bp)) = struct { + Fi [0]Tuint32_t + Ff float32 + }{} + *(*float32)(unsafe.Pointer(bp)) = x + hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) + if hx >= uint32(0x7f800000) { /* cbrt(NaN,INF) is itself */ + return x + x + } + /* rough cbrt to 5 bits */ + if hx < uint32(0x00800000) { /* zero or subnormal? */ + if hx == uint32(0) { + return x + } /* cbrt(+-0) is itself */ + *(*float32)(unsafe.Pointer(bp)) = float32(x * Float32FromFloat32(1.6777216e+07)) + hx = *(*Tuint32_t)(unsafe.Pointer(bp)) & uint32(0x7fffffff) + hx = hx/uint32(3) + _B21 + } else { + hx = hx/uint32(3) + _B11 + } + *(*Tuint32_t)(unsafe.Pointer(bp)) &= uint32(0x80000000) + *(*Tuint32_t)(unsafe.Pointer(bp)) |= hx + /* + * First step Newton iteration (solving t*t-x/t == 0) to 16 bits. In + * double precision so that its terms can be arranged for efficiency + * without causing overflow or underflow. + */ + T = float64(*(*float32)(unsafe.Pointer(bp))) + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) + /* + * Second step Newton iteration to 47 bits. In double precision for + * efficiency and accuracy. + */ + r = Tdouble_t(Tdouble_t(T*T) * T) + T = Tdouble_t(T*(float64(x)+float64(x)+r)) / (float64(x) + r + r) + /* rounding to 24 bits is perfect in round-to-nearest mode */ + return float32(T) +} + +func Xcbrtl(tls *TLS, x float64) (r float64) { + if __ccgo_strace { + trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) + defer func() { trc("-> %v", r) }() + } + return Xcbrt(tls, x) +} diff --git a/vendor/modernc.org/libc/libc_all.go b/vendor/modernc.org/libc/libc_all.go index 6e3b977..0e20d95 100644 --- a/vendor/modernc.org/libc/libc_all.go +++ b/vendor/modernc.org/libc/libc_all.go @@ -2,9 +2,11 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// Package libc is a partial reimplementation of C libc in pure Go. package libc // import "modernc.org/libc" import ( + "math" "sync/atomic" "unsafe" @@ -32,3 +34,46 @@ func X__sync_sub_and_fetch[T constraints.Integer](t *TLS, p uintptr, v T) T { panic(todo("")) } } + +// GoString returns the value of a C string at s. +func GoString(s uintptr) string { + if s == 0 { + return "" + } + + p := s + for *(*byte)(unsafe.Pointer(p)) != 0 { + p++ + } + return string(unsafe.Slice((*byte)(unsafe.Pointer(s)), p-s)) +} + +// GoBytes returns a byte slice from a C char* having length len bytes. +func GoBytes(s uintptr, len int) []byte { + return unsafe.Slice((*byte)(unsafe.Pointer(s)), len) +} + +func X__isfinitef(tls *TLS, f float32) int32 { + d := float64(f) + if !math.IsInf(d, 0) && !math.IsNaN(d) { + return 1 + } + + return 0 +} + +func X__isfinite(tls *TLS, d float64) int32 { + if !math.IsInf(d, 0) && !math.IsNaN(d) { + return 1 + } + + return 0 +} + +func X__isfinitel(tls *TLS, d float64) int32 { + if !math.IsInf(d, 0) && !math.IsNaN(d) { + return 1 + } + + return 0 +} diff --git a/vendor/modernc.org/libc/libc_darwin.go b/vendor/modernc.org/libc/libc_darwin.go index c33cc6b..bbad7d3 100644 --- a/vendor/modernc.org/libc/libc_darwin.go +++ b/vendor/modernc.org/libc/libc_darwin.go @@ -7,8 +7,11 @@ package libc // import "modernc.org/libc" import ( crand "crypto/rand" "encoding/hex" + "errors" "fmt" "io" + "io/fs" + mbits "math/bits" "os" "os/exec" gosignal "os/signal" @@ -39,6 +42,7 @@ import ( "modernc.org/libc/unistd" "modernc.org/libc/uuid/uuid" "modernc.org/libc/wctype" + "modernc.org/memory" ) const ( @@ -49,16 +53,14 @@ const ( // in6_addr_any in.In6_addr // ) +type Tsize_t = types.Size_t + type ( syscallErrno = unix.Errno long = types.User_long_t ulong = types.User_ulong_t ) -type pthreadAttr struct { - detachState int32 -} - // // Keep these outside of the var block otherwise go generate will miss them. var X__stderrp = Xstdout var X__stdinp = Xstdin @@ -94,6 +96,18 @@ func (f file) setErr() { (*stdio.FILE)(unsafe.Pointer(f)).F_flags |= 1 } +func (f file) clearErr() { + (*stdio.FILE)(unsafe.Pointer(f)).F_flags &^= 3 +} + +func (f file) eof() bool { + return (*stdio.FILE)(unsafe.Pointer(f)).F_flags&2 != 0 +} + +func (f file) setEOF() { + (*stdio.FILE)(unsafe.Pointer(f)).F_flags |= 2 +} + func (f file) close(t *TLS) int32 { r := Xclose(t, f.fd()) Xfree(t, uintptr(f)) @@ -125,6 +139,19 @@ func fwrite(fd int32, b []byte) (int, error) { return unix.Write(int(fd), b) } +func Xclearerr(tls *TLS, f uintptr) { + file(f).clearErr() +} + +func Xfeof(t *TLS, f uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v f=%v, (%v:)", t, f, origin(2)) + defer func() { trc("-> %v", r) }() + } + r = BoolInt32(file(f).eof()) + return r +} + func X__inline_isnand(t *TLS, x float64) int32 { if __ccgo_strace { trc("t=%v x=%v, (%v:)", t, x, origin(2)) @@ -355,6 +382,9 @@ func Xlocaltime(_ *TLS, timep uintptr) uintptr { localtime.Ftm_wday = int32(t.Weekday()) localtime.Ftm_yday = int32(t.YearDay()) localtime.Ftm_isdst = Bool32(isTimeDST(t)) + _, off := t.Zone() + localtime.Ftm_gmtoff = int64(off) + localtime.Ftm_zone = 0 return uintptr(unsafe.Pointer(&localtime)) } @@ -372,6 +402,9 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { (*time.Tm)(unsafe.Pointer(result)).Ftm_wday = int32(t.Weekday()) (*time.Tm)(unsafe.Pointer(result)).Ftm_yday = int32(t.YearDay()) (*time.Tm)(unsafe.Pointer(result)).Ftm_isdst = Bool32(isTimeDST(t)) + _, off := t.Zone() + (*time.Tm)(unsafe.Pointer(result)).Ftm_gmtoff = int64(off) + (*time.Tm)(unsafe.Pointer(result)).Ftm_zone = 0 return result } @@ -1539,6 +1572,9 @@ func Xfread(t *TLS, ptr uintptr, size, nmemb types.Size_t, stream uintptr) types n, err = unix.Read(int(fd), nil) default: n, err = unix.Read(int(fd), (*RawMem)(unsafe.Pointer(ptr))[:count:count]) + if n == 0 { + file(stream).setEOF() + } if dmesgs && err == nil { dmesg("%v: fd %v, n %#x\n%s", origin(1), fd, n, hex.Dump((*RawMem)(unsafe.Pointer(ptr))[:n:n])) } @@ -1670,12 +1706,11 @@ func Xfputs(t *TLS, s, stream uintptr) int32 { if __ccgo_strace { trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) } - panic(todo("")) - // if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { - // return -1 - // } + if _, _, err := unix.Syscall(unix.SYS_WRITE, uintptr(file(stream).fd()), s, uintptr(Xstrlen(t, s))); err != 0 { + return -1 + } - // return 0 + return 0 } var getservbynameStaticResult netdb.Servent @@ -2174,11 +2209,13 @@ func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { panic(todo("")) } -func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { - if __ccgo_strace { - trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) +func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) (r int32) { + if uint32(state) > 1 { + return errno.EINVAL } - panic(todo("")) + + (*pthreadAttr)(unsafe.Pointer(a)).detachState = state + return 0 } func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { @@ -2447,11 +2484,20 @@ func Xnanosleep(t *TLS, req, rem uintptr) int32 { // } // size_t malloc_size(const void *ptr); -func Xmalloc_size(t *TLS, ptr uintptr) types.Size_t { +func Xmalloc_size(t *TLS, p uintptr) (r types.Size_t) { if __ccgo_strace { - trc("t=%v ptr=%v, (%v:)", t, ptr, origin(2)) + trc("t=%v p=%v, (%v:)", t, p, origin(2)) + defer func() { trc("-> %v", r) }() } - panic(todo("")) + if p == 0 { + return 0 + } + + allocMu.Lock() + + defer allocMu.Unlock() + + return types.Size_t(memory.UintptrUsableSize(p)) } // int open(const char *pathname, int flags, ...); @@ -2518,3 +2564,226 @@ func X__builtin_lround(tls *TLS, x float64) (r long) { func Xlround(tls *TLS, x float64) (r long) { return long(Xround(tls, x)) } + +// https://g.co/gemini/share/2c37d5b57994 + +// Constants mirroring C's ftw type flags +const ( + FTW_F = 0 // Regular file + FTW_D = 1 // Directory (visited pre-order) + FTW_DNR = 2 // Directory that cannot be read + FTW_NS = 4 // Stat failed (permissions, broken link, etc.) + FTW_SL = 4 // Symbolic link (lstat was used) + // Note: C's ftw might have other flags like FTW_DP (post-order dir) or FTW_SLN + // which are not directly supported by filepath.WalkDir's simple pre-order traversal. + // This emulation focuses on the most common flags associated with stat/lstat results. +) + +// ftwStopError is used internally to signal that the walk should stop +// because the user callback returned a non-zero value. +type ftwStopError struct { + stopValue int +} + +func (e *ftwStopError) Error() string { + return fmt.Sprintf("ftw walk stopped by callback with return value %d", e.stopValue) +} + +// goFtwFunc is the callback function type, mirroring the C ftw callback. +// It receives the path, file info (if available), and a type flag. +// Returning a non-zero value stops the walk and becomes the return value of Ftw. +// Returning 0 continues the walk. +type goFtwFunc func(path string, info os.FileInfo, typeflag int) int + +// Ftw emulates the C standard library function ftw(3). +// It walks the directory tree starting at 'dirpath' and calls the 'callback' +// function for each entry encountered. +// +// Parameters: +// - dirpath: The root directory path for the traversal. +// - callback: The goFtwFunc to call for each file system entry. +// - nopenfd: This parameter is part of the C ftw signature but is IGNORED +// in this Go implementation. Go's filepath.WalkDir manages concurrency +// and file descriptors internally. +// +// Returns: +// - 0 on successful completion of the walk. +// - The non-zero value returned by the callback, if the callback terminated the walk. +// - -1 if an error occurred during the walk that wasn't handled by calling +// the callback with FTW_DNR or FTW_NS (e.g., error accessing the initial dirpath). +func ftw(dirpath string, callback goFtwFunc, nopenfd int) int { + // nopenfd is ignored in this Go implementation. + + walkErr := filepath.WalkDir(dirpath, func(path string, d fs.DirEntry, err error) error { + var info os.FileInfo + var typeflag int + + // --- Handle errors passed by WalkDir --- + if err != nil { + // Check if the error is related to accessing a directory + if errors.Is(err, fs.ErrPermission) || errors.Is(err, unix.EACCES) { // Added syscall.EACCES check + // Try to determine if it's a directory we can't read + // We might not have 'd' if the error occurred trying to list 'path' contents + // Let's try a direct Lstat on the path itself if d is nil + lstatInfo, lstatErr := os.Lstat(path) + if lstatErr == nil && lstatInfo.IsDir() { + typeflag = FTW_DNR // Directory, but WalkDir errored (likely reading it) + info = lstatInfo // Provide the info we could get + } else { + // Can't confirm it's a directory, or Lstat itself failed + typeflag = FTW_NS // Treat as general stat failure + // info remains nil + } + } else { + // Other errors (e.g., broken symlink during traversal, I/O error) + typeflag = FTW_NS + // Attempt to get Lstat info even if WalkDir had an error, maybe it's available + lstatInfo, _ := os.Lstat(path) // Ignore error here, if it fails info stays nil + info = lstatInfo + } + // Even with errors, call the callback with the path and appropriate flag + stopVal := callback(path, info, typeflag) + if stopVal != 0 { + return &ftwStopError{stopValue: stopVal} + } + // If the error was on a directory, returning the error might stop WalkDir + // from descending. If it was fs.ErrPermission on a dir, WalkDir might + // pass filepath.SkipDir implicitly or continue depending on implementation. + // Let's return nil here to *try* to continue the walk for other siblings + // if the callback didn't stop it. The callback *was* notified. + // If the error prevents further progress WalkDir will stop anyway. + return nil // Allow walk to potentially continue elsewhere + } + + // --- No error from WalkDir, process the DirEntry --- + info, err = d.Info() // Get FileInfo (like C's stat/lstat result) + if err != nil { + // Error getting info for an entry WalkDir *could* list (rare, maybe permissions changed?) + typeflag = FTW_NS + // info remains nil + } else { + // Determine type flag based on file mode + mode := info.Mode() + if mode&fs.ModeSymlink != 0 { + typeflag = FTW_SL + } else if mode.IsDir() { + typeflag = FTW_D // Visited pre-order + } else if mode.IsRegular() { + typeflag = FTW_F + } else { + // Other types (device, socket, pipe, etc.) - C ftw usually lumps these under FTW_F + // or might have FTW_NS if stat fails. Let's treat non-dir, non-link, non-regular + // as FTW_F for simplicity, aligning with common C practice, or FTW_NS if stat failed above. + // Since we have info here, we know stat didn't fail. + // Let's be more specific, maybe treat others as FTW_NS? Or stick to FTW_F? + // C ftw man page isn't super specific about all types. FTW_F seems reasonable. + typeflag = FTW_F // Treat other valid types as 'files' for simplicity + } + } + + // --- Call the user callback --- + stopVal := callback(path, info, typeflag) + if stopVal != 0 { + // User wants to stop the walk + return &ftwStopError{stopValue: stopVal} + } + + return nil // Continue walk + }) + + // --- Handle WalkDir's final return value --- + if walkErr == nil { + return 0 // Success + } + + // Check if the error was our custom stop signal + var stopErr *ftwStopError + if errors.As(walkErr, &stopErr) { + return stopErr.stopValue // Return the value from the callback + } + + // Otherwise, it was an unhandled error during the walk + // (e.g., initial dirpath access error, or other error not mapped to FTW_NS/DNR) + return -1 // General error return +} + +func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { + statp := tls.Alloc(int(unsafe.Sizeof(unix.Stat_t{}))) + + defer tls.Free(int(unsafe.Sizeof(unix.Stat_t{}))) + + return int32(ftw( + GoString(path), + func(path string, info os.FileInfo, typeflag int) int { + cs, _ := CString(path) + + defer Xfree(tls, cs) + + Xstat(tls, cs, statp) + return int((*(*func(*TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, cs, statp, int32(typeflag))) + }, + int(fd_limit), + )) +} + +func Xexecve(tls *TLS, path uintptr, argv uintptr, envp uintptr) (r int32) { + goPath := GoString(path) + var goArgv, goEnvp []string + for p := *(*uintptr)(unsafe.Pointer(argv)); p != 0; p = *(*uintptr)(unsafe.Pointer(argv)) { + goArgv = append(goArgv, GoString(p)) + argv += unsafe.Sizeof(uintptr(0)) + } + for p := *(*uintptr)(unsafe.Pointer(envp)); p != 0; p = *(*uintptr)(unsafe.Pointer(envp)) { + goEnvp = append(goEnvp, GoString(p)) + envp += unsafe.Sizeof(uintptr(0)) + } + if err := unix.Exec(goPath, goArgv, goEnvp); err != nil { + tls.setErrno(err) + return -1 + } + panic("unreachable") +} + +func Xsetuid(tls *TLS, uid uint32) (r int32) { + if __ccgo_strace { + trc("tls=%v uid=%v, (%v:)", tls, uid, origin(2)) + defer func() { trc("-> %v", r) }() + } + if err := unix.Setuid(int(uid)); err != nil { + tls.setErrno(err) + return -1 + } + + return 0 +} + +func Xsetgid(tls *TLS, gid uint32) (r int32) { + if __ccgo_strace { + trc("tls=%v gid=%v, (%v:)", tls, gid, origin(2)) + defer func() { trc("-> %v", r) }() + } + if err := unix.Setgid(int(gid)); err != nil { + tls.setErrno(err) + return -1 + } + + return 0 +} + +func Xdup(tls *TLS, fd int32) (r int32) { + if __ccgo_strace { + trc("tls=%v fd=%v, (%v:)", tls, fd, origin(2)) + defer func() { trc("-> %v", r) }() + } + nfd, err := unix.Dup(int(fd)) + if err != nil { + tls.setErrno(err) + return -1 + } + + return int32(nfd) +} + +func X__builtin_ctz(t *TLS, n uint32) int32 { + return int32(mbits.TrailingZeros32(n)) +} diff --git a/vendor/modernc.org/libc/libc_darwin_amd64.go b/vendor/modernc.org/libc/libc_darwin_amd64.go index 0513b1e..dd94eba 100644 --- a/vendor/modernc.org/libc/libc_darwin_amd64.go +++ b/vendor/modernc.org/libc/libc_darwin_amd64.go @@ -17,6 +17,11 @@ import ( "modernc.org/libc/utime" ) +// #define FE_DOWNWARD 0x0400 +// #define FE_UPWARD 0x0800 +const FE_DOWNWARD = 0x0400 +const FE_UPWARD = 0x0800 + // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { if __ccgo_strace { diff --git a/vendor/modernc.org/libc/libc_darwin_arm64.go b/vendor/modernc.org/libc/libc_darwin_arm64.go index ecb7c91..9e85e89 100644 --- a/vendor/modernc.org/libc/libc_darwin_arm64.go +++ b/vendor/modernc.org/libc/libc_darwin_arm64.go @@ -17,6 +17,11 @@ import ( "modernc.org/libc/utime" ) +// #define FE_UPWARD 0x00400000 +// #define FE_DOWNWARD 0x00800000 +const FE_UPWARD = 0x00400000 +const FE_DOWNWARD = 0x00800000 + // int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); func Xsigaction(t *TLS, signum int32, act, oldact uintptr) int32 { if __ccgo_strace { diff --git a/vendor/modernc.org/libc/libc_freebsd.go b/vendor/modernc.org/libc/libc_freebsd.go index 4fcae67..259325f 100644 --- a/vendor/modernc.org/libc/libc_freebsd.go +++ b/vendor/modernc.org/libc/libc_freebsd.go @@ -5,8 +5,12 @@ package libc // import "modernc.org/libc" import ( + "errors" "fmt" "io" + "io/fs" + "math" + mbits "math/bits" "os" "os/exec" "path/filepath" @@ -65,6 +69,8 @@ func X__runes_for_locale(t *TLS, l locale_t, p uintptr) uintptr { panic(todo("")) } +type Tsize_t = types.Size_t + type syscallErrno = unix.Errno type file uintptr @@ -80,6 +86,18 @@ func (f file) setErr() { (*stdio.FILE)(unsafe.Pointer(f)).F_flags |= 1 } +func (f file) clearErr() { + (*stdio.FILE)(unsafe.Pointer(f)).F_flags &^= 3 +} + +func (f file) eof() bool { + return (*stdio.FILE)(unsafe.Pointer(f)).F_flags&2 != 0 +} + +func (f file) setEOF() { + (*stdio.FILE)(unsafe.Pointer(f)).F_flags |= 2 +} + func (f file) close(t *TLS) int32 { r := Xclose(t, f.fd()) Xfree(t, uintptr(f)) @@ -110,6 +128,19 @@ func fwrite(fd int32, b []byte) (int, error) { return unix.Write(int(fd), b) //TODO use Xwrite } +func Xclearerr(tls *TLS, f uintptr) { + file(f).clearErr() +} + +func Xfeof(t *TLS, f uintptr) (r int32) { + if __ccgo_strace { + trc("t=%v f=%v, (%v:)", t, f, origin(2)) + defer func() { trc("-> %v", r) }() + } + r = BoolInt32(file(f).eof()) + return r +} + // unsigned long ___runetype(__ct_rune_t) __pure; func X___runetype(t *TLS, x types.X__ct_rune_t) ulong { if __ccgo_strace { @@ -199,6 +230,7 @@ var localtime time.Tm // struct tm *localtime(const time_t *timep); func Xlocaltime(_ *TLS, timep uintptr) uintptr { + // trc("%T timep=%+v", time.Time_t(0), *(*time.Time_t)(unsafe.Pointer(timep))) loc := getLocalLocation() ut := *(*time.Time_t)(unsafe.Pointer(timep)) t := gotime.Unix(int64(ut), 0).In(loc) @@ -211,11 +243,16 @@ func Xlocaltime(_ *TLS, timep uintptr) uintptr { localtime.Ftm_wday = int32(t.Weekday()) localtime.Ftm_yday = int32(t.YearDay()) localtime.Ftm_isdst = Bool32(isTimeDST(t)) + _, off := t.Zone() + localtime.Ftm_gmtoff = int64(off) + localtime.Ftm_zone = 0 + // trc("%T localtime=%+v", localtime, localtime) return uintptr(unsafe.Pointer(&localtime)) } // struct tm *localtime_r(const time_t *timep, struct tm *result); func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { + // trc("%T timep=%+v", time.Time_t(0), *(*time.Time_t)(unsafe.Pointer(timep))) loc := getLocalLocation() ut := *(*unix.Time_t)(unsafe.Pointer(timep)) t := gotime.Unix(int64(ut), 0).In(loc) @@ -228,6 +265,10 @@ func Xlocaltime_r(_ *TLS, timep, result uintptr) uintptr { (*time.Tm)(unsafe.Pointer(result)).Ftm_wday = int32(t.Weekday()) (*time.Tm)(unsafe.Pointer(result)).Ftm_yday = int32(t.YearDay()) (*time.Tm)(unsafe.Pointer(result)).Ftm_isdst = Bool32(isTimeDST(t)) + _, off := t.Zone() + (*time.Tm)(unsafe.Pointer(result)).Ftm_gmtoff = int64(off) + (*time.Tm)(unsafe.Pointer(result)).Ftm_zone = 0 + // trc("%T localtime_r=%+v", localtime, (*time.Tm)(unsafe.Pointer(result))) return result } @@ -501,6 +542,7 @@ func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { return -1 } + //trc("tvs=%+v", tvs) *(*unix.Timeval)(unsafe.Pointer(tv)) = tvs return 0 } @@ -879,7 +921,23 @@ func Xfileno(t *TLS, stream uintptr) int32 { if __ccgo_strace { trc("t=%v stream=%v, (%v:)", t, stream, origin(2)) } - panic(todo("")) + if stream == 0 { + if dmesgs { + dmesg("%v: FAIL", origin(1)) + } + t.setErrno(errno.EBADF) + return -1 + } + + if fd := int32((*stdio.FILE)(unsafe.Pointer(stream)).F_file); fd >= 0 { + return fd + } + + if dmesgs { + dmesg("%v: FAIL", origin(1)) + } + t.setErrno(errno.EBADF) + return -1 } func newCFtsent(t *TLS, info int, path string, stat *unix.Stat_t, err syscallErrno) uintptr { @@ -1563,12 +1621,167 @@ func fcntlCmdStr(cmd int32) string { } } +func X__strchrnul(tls *TLS, s uintptr, c int32) uintptr { /* strchrnul.c:10:6: */ + if __ccgo_strace { + trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) + } + c = int32(uint8(c)) + if !(c != 0) { + return s + uintptr(Xstrlen(tls, s)) + } + var w uintptr + for ; uintptr_t(s)%uintptr_t(unsafe.Sizeof(size_t(0))) != 0; s++ { + if !(int32(*(*int8)(unsafe.Pointer(s))) != 0) || int32(*(*uint8)(unsafe.Pointer(s))) == c { + return s + } + } + var k size_t = Uint64(Uint64FromInt32(-1)) / uint64(255) * size_t(c) + for w = s; !((*(*uint64)(unsafe.Pointer(w))-Uint64(Uint64FromInt32(-1))/uint64(255)) & ^*(*uint64)(unsafe.Pointer(w)) & (Uint64(Uint64FromInt32(-1))/uint64(255)*uint64(255/2+1)) != 0) && !((*(*uint64)(unsafe.Pointer(w))^k-Uint64(Uint64FromInt32(-1))/uint64(255)) & ^(*(*uint64)(unsafe.Pointer(w))^k) & (Uint64(Uint64FromInt32(-1))/uint64(255)*uint64(255/2+1)) != 0); w += 8 { + } + s = w + for ; *(*int8)(unsafe.Pointer(s)) != 0 && int32(*(*uint8)(unsafe.Pointer(s))) != c; s++ { + } + return s +} + +var _soldenv uintptr /* putenv.c:22:14: */ + // int setenv(const char *name, const char *value, int overwrite); -func Xsetenv(t *TLS, name, value uintptr, overwrite int32) int32 { +func Xsetenv(tls *TLS, var1 uintptr, value uintptr, overwrite int32) int32 { /* setenv.c:26:5: */ if __ccgo_strace { - trc("t=%v value=%v overwrite=%v, (%v:)", t, value, overwrite, origin(2)) + trc("tls=%v var1=%v value=%v overwrite=%v, (%v:)", tls, var1, value, overwrite, origin(2)) } - panic(todo("")) + var s uintptr + var l1 size_t + var l2 size_t + + if !(var1 != 0) || !(int32(AssignUint64(&l1, size_t((int64(X__strchrnul(tls, var1, '='))-int64(var1))/1))) != 0) || *(*int8)(unsafe.Pointer(var1 + uintptr(l1))) != 0 { + *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 + return -1 + } + if !(overwrite != 0) && Xgetenv(tls, var1) != 0 { + return 0 + } + + l2 = Xstrlen(tls, value) + s = Xmalloc(tls, l1+l2+uint64(2)) + if !(s != 0) { + return -1 + } + Xmemcpy(tls, s, var1, l1) + *(*int8)(unsafe.Pointer(s + uintptr(l1))) = int8('=') + Xmemcpy(tls, s+uintptr(l1)+uintptr(1), value, l2+uint64(1)) + return X__putenv(tls, s, l1, s) +} + +func X__putenv(tls *TLS, s uintptr, l size_t, r uintptr) int32 { /* putenv.c:8:5: */ + if __ccgo_strace { + trc("tls=%v s=%v l=%v r=%v, (%v:)", tls, s, l, r, origin(2)) + } + var i size_t + var newenv uintptr + var tmp uintptr + //TODO for (char **e = __environ; *e; e++, i++) + var e uintptr + i = uint64(0) + if !(Environ() != 0) { + goto __1 + } + //TODO for (char **e = __environ; *e; e++, i++) + e = Environ() +__2: + if !(*(*uintptr)(unsafe.Pointer(e)) != 0) { + goto __4 + } + if !!(Xstrncmp(tls, s, *(*uintptr)(unsafe.Pointer(e)), l+uint64(1)) != 0) { + goto __5 + } + tmp = *(*uintptr)(unsafe.Pointer(e)) + *(*uintptr)(unsafe.Pointer(e)) = s + X__env_rm_add(tls, tmp, r) + return 0 +__5: + ; + goto __3 +__3: + e += 8 + i++ + goto __2 + goto __4 +__4: + ; +__1: + ; + if !(Environ() == _soldenv) { + goto __6 + } + newenv = Xrealloc(tls, _soldenv, uint64(unsafe.Sizeof(uintptr(0)))*(i+uint64(2))) + if !!(newenv != 0) { + goto __8 + } + goto oom +__8: + ; + goto __7 +__6: + newenv = Xmalloc(tls, uint64(unsafe.Sizeof(uintptr(0)))*(i+uint64(2))) + if !!(newenv != 0) { + goto __9 + } + goto oom +__9: + ; + if !(i != 0) { + goto __10 + } + Xmemcpy(tls, newenv, Environ(), uint64(unsafe.Sizeof(uintptr(0)))*i) +__10: + ; + Xfree(tls, _soldenv) +__7: + ; + *(*uintptr)(unsafe.Pointer(newenv + uintptr(i)*8)) = s + *(*uintptr)(unsafe.Pointer(newenv + uintptr(i+uint64(1))*8)) = uintptr(0) + *(*uintptr)(unsafe.Pointer(EnvironP())) = AssignPtrUintptr(uintptr(unsafe.Pointer(&_soldenv)), newenv) + if !(r != 0) { + goto __11 + } + X__env_rm_add(tls, uintptr(0), r) +__11: + ; + return 0 +oom: + Xfree(tls, r) + return -1 +} + +var _senv_alloced uintptr /* setenv.c:7:14: */ +var _senv_alloced_n size_t /* setenv.c:8:16: */ + +func X__env_rm_add(tls *TLS, old uintptr, new uintptr) { /* setenv.c:5:6: */ + if __ccgo_strace { + trc("tls=%v old=%v new=%v, (%v:)", tls, old, new, origin(2)) + } + //TODO for (size_t i=0; i < env_alloced_n; i++) + var i size_t = uint64(0) + for ; i < _senv_alloced_n; i++ { + if *(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8)) == old { + *(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8)) = new + Xfree(tls, old) + return + } else if !(int32(*(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8))) != 0) && new != 0 { + *(*uintptr)(unsafe.Pointer(_senv_alloced + uintptr(i)*8)) = new + new = uintptr(0) + } + } + if !(new != 0) { + return + } + var t uintptr = Xrealloc(tls, _senv_alloced, uint64(unsafe.Sizeof(uintptr(0)))*(_senv_alloced_n+uint64(1))) + if !(t != 0) { + return + } + *(*uintptr)(unsafe.Pointer(AssignPtrUintptr(uintptr(unsafe.Pointer(&_senv_alloced)), t) + uintptr(PostIncUint64(&_senv_alloced_n, 1))*8)) = new } // int unsetenv(const char *name); @@ -2036,3 +2249,230 @@ __3: ; return Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(l)))) - Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(r)))) } + +func X__signbit(tls *TLS, x float64) (r int32) { + return int32(math.Float64bits(x) >> 63) +} + +func X__builtin_ctz(t *TLS, n uint32) int32 { + return int32(mbits.TrailingZeros32(n)) +} + +// https://g.co/gemini/share/2c37d5b57994 + +// Constants mirroring C's ftw type flags +const ( + FTW_F = 0 // Regular file + FTW_D = 1 // Directory (visited pre-order) + FTW_DNR = 2 // Directory that cannot be read + FTW_NS = 4 // Stat failed (permissions, broken link, etc.) + FTW_SL = 4 // Symbolic link (lstat was used) + // Note: C's ftw might have other flags like FTW_DP (post-order dir) or FTW_SLN + // which are not directly supported by filepath.WalkDir's simple pre-order traversal. + // This emulation focuses on the most common flags associated with stat/lstat results. +) + +// ftwStopError is used internally to signal that the walk should stop +// because the user callback returned a non-zero value. +type ftwStopError struct { + stopValue int +} + +func (e *ftwStopError) Error() string { + return fmt.Sprintf("ftw walk stopped by callback with return value %d", e.stopValue) +} + +// goFtwFunc is the callback function type, mirroring the C ftw callback. +// It receives the path, file info (if available), and a type flag. +// Returning a non-zero value stops the walk and becomes the return value of Ftw. +// Returning 0 continues the walk. +type goFtwFunc func(path string, info os.FileInfo, typeflag int) int + +// Ftw emulates the C standard library function ftw(3). +// It walks the directory tree starting at 'dirpath' and calls the 'callback' +// function for each entry encountered. +// +// Parameters: +// - dirpath: The root directory path for the traversal. +// - callback: The goFtwFunc to call for each file system entry. +// - nopenfd: This parameter is part of the C ftw signature but is IGNORED +// in this Go implementation. Go's filepath.WalkDir manages concurrency +// and file descriptors internally. +// +// Returns: +// - 0 on successful completion of the walk. +// - The non-zero value returned by the callback, if the callback terminated the walk. +// - -1 if an error occurred during the walk that wasn't handled by calling +// the callback with FTW_DNR or FTW_NS (e.g., error accessing the initial dirpath). +func ftw(dirpath string, callback goFtwFunc, nopenfd int) int { + // nopenfd is ignored in this Go implementation. + + walkErr := filepath.WalkDir(dirpath, func(path string, d fs.DirEntry, err error) error { + var info os.FileInfo + var typeflag int + + // --- Handle errors passed by WalkDir --- + if err != nil { + // Check if the error is related to accessing a directory + if errors.Is(err, fs.ErrPermission) || errors.Is(err, unix.EACCES) { // Added syscall.EACCES check + // Try to determine if it's a directory we can't read + // We might not have 'd' if the error occurred trying to list 'path' contents + // Let's try a direct Lstat on the path itself if d is nil + lstatInfo, lstatErr := os.Lstat(path) + if lstatErr == nil && lstatInfo.IsDir() { + typeflag = FTW_DNR // Directory, but WalkDir errored (likely reading it) + info = lstatInfo // Provide the info we could get + } else { + // Can't confirm it's a directory, or Lstat itself failed + typeflag = FTW_NS // Treat as general stat failure + // info remains nil + } + } else { + // Other errors (e.g., broken symlink during traversal, I/O error) + typeflag = FTW_NS + // Attempt to get Lstat info even if WalkDir had an error, maybe it's available + lstatInfo, _ := os.Lstat(path) // Ignore error here, if it fails info stays nil + info = lstatInfo + } + // Even with errors, call the callback with the path and appropriate flag + stopVal := callback(path, info, typeflag) + if stopVal != 0 { + return &ftwStopError{stopValue: stopVal} + } + // If the error was on a directory, returning the error might stop WalkDir + // from descending. If it was fs.ErrPermission on a dir, WalkDir might + // pass filepath.SkipDir implicitly or continue depending on implementation. + // Let's return nil here to *try* to continue the walk for other siblings + // if the callback didn't stop it. The callback *was* notified. + // If the error prevents further progress WalkDir will stop anyway. + return nil // Allow walk to potentially continue elsewhere + } + + // --- No error from WalkDir, process the DirEntry --- + info, err = d.Info() // Get FileInfo (like C's stat/lstat result) + if err != nil { + // Error getting info for an entry WalkDir *could* list (rare, maybe permissions changed?) + typeflag = FTW_NS + // info remains nil + } else { + // Determine type flag based on file mode + mode := info.Mode() + if mode&fs.ModeSymlink != 0 { + typeflag = FTW_SL + } else if mode.IsDir() { + typeflag = FTW_D // Visited pre-order + } else if mode.IsRegular() { + typeflag = FTW_F + } else { + // Other types (device, socket, pipe, etc.) - C ftw usually lumps these under FTW_F + // or might have FTW_NS if stat fails. Let's treat non-dir, non-link, non-regular + // as FTW_F for simplicity, aligning with common C practice, or FTW_NS if stat failed above. + // Since we have info here, we know stat didn't fail. + // Let's be more specific, maybe treat others as FTW_NS? Or stick to FTW_F? + // C ftw man page isn't super specific about all types. FTW_F seems reasonable. + typeflag = FTW_F // Treat other valid types as 'files' for simplicity + } + } + + // --- Call the user callback --- + stopVal := callback(path, info, typeflag) + if stopVal != 0 { + // User wants to stop the walk + return &ftwStopError{stopValue: stopVal} + } + + return nil // Continue walk + }) + + // --- Handle WalkDir's final return value --- + if walkErr == nil { + return 0 // Success + } + + // Check if the error was our custom stop signal + var stopErr *ftwStopError + if errors.As(walkErr, &stopErr) { + return stopErr.stopValue // Return the value from the callback + } + + // Otherwise, it was an unhandled error during the walk + // (e.g., initial dirpath access error, or other error not mapped to FTW_NS/DNR) + return -1 // General error return +} + +func Xftw(tls *TLS, path uintptr, fn uintptr, fd_limit int32) (r int32) { + statp := tls.Alloc(int(unsafe.Sizeof(unix.Stat_t{}))) + + defer tls.Free(int(unsafe.Sizeof(unix.Stat_t{}))) + + return int32(ftw( + GoString(path), + func(path string, info os.FileInfo, typeflag int) int { + cs, _ := CString(path) + + defer Xfree(tls, cs) + + Xstat(tls, cs, statp) + return int((*(*func(*TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{fn})))(tls, cs, statp, int32(typeflag))) + }, + int(fd_limit), + )) +} + +func Xexecve(tls *TLS, path uintptr, argv uintptr, envp uintptr) (r int32) { + goPath := GoString(path) + var goArgv, goEnvp []string + for p := *(*uintptr)(unsafe.Pointer(argv)); p != 0; p = *(*uintptr)(unsafe.Pointer(argv)) { + goArgv = append(goArgv, GoString(p)) + argv += unsafe.Sizeof(uintptr(0)) + } + for p := *(*uintptr)(unsafe.Pointer(envp)); p != 0; p = *(*uintptr)(unsafe.Pointer(envp)) { + goEnvp = append(goEnvp, GoString(p)) + envp += unsafe.Sizeof(uintptr(0)) + } + if err := unix.Exec(goPath, goArgv, goEnvp); err != nil { + tls.setErrno(err) + return -1 + } + panic("unreachable") +} + +func Xsetuid(tls *TLS, uid uint32) (r int32) { + if __ccgo_strace { + trc("tls=%v uid=%v, (%v:)", tls, uid, origin(2)) + defer func() { trc("-> %v", r) }() + } + if err := unix.Setuid(int(uid)); err != nil { + tls.setErrno(err) + return -1 + } + + return 0 +} + +func Xsetgid(tls *TLS, gid uint32) (r int32) { + if __ccgo_strace { + trc("tls=%v gid=%v, (%v:)", tls, gid, origin(2)) + defer func() { trc("-> %v", r) }() + } + if err := unix.Setgid(int(gid)); err != nil { + tls.setErrno(err) + return -1 + } + + return 0 +} + +func Xdup(tls *TLS, fd int32) (r int32) { + if __ccgo_strace { + trc("tls=%v fd=%v, (%v:)", tls, fd, origin(2)) + defer func() { trc("-> %v", r) }() + } + nfd, err := unix.Dup(int(fd)) + if err != nil { + tls.setErrno(err) + return -1 + } + + return int32(nfd) +} diff --git a/vendor/modernc.org/libc/libc_illumos.go b/vendor/modernc.org/libc/libc_illumos.go index 3900128..d3e2123 100644 --- a/vendor/modernc.org/libc/libc_illumos.go +++ b/vendor/modernc.org/libc/libc_illumos.go @@ -12,6 +12,7 @@ import ( "os/exec" "path/filepath" "runtime" + // "runtime/debug" "time" "unsafe" @@ -26,6 +27,7 @@ import ( "modernc.org/libc/limits" "modernc.org/libc/netdb" "modernc.org/libc/netinet/in" + // "modernc.org/libc/signal" "modernc.org/libc/stdio" "modernc.org/libc/sys/socket" @@ -55,6 +57,8 @@ type ( type file uintptr +type Tsize_t = types.Size_t + func (f file) fd() int32 { panic(todo("")) // return (*stdio.FILE)(unsafe.Pointer(f)).F_fileno @@ -2094,3 +2098,18 @@ func (s *byteScanner) UnreadByte() error { Xungetc(s.t, int32(s.last), s.stream) return nil } + +// int clock_gettime(clockid_t clk_id, struct timespec *tp); +func Xclock_gettime(t *TLS, clk_id int32, tp uintptr) int32 { + if __ccgo_strace { + trc("t=%v clk_id=%v tp=%v, (%v:)", t, clk_id, tp, origin(2)) + } + panic(todo("")) +} + +func Xgmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) { + if __ccgo_strace { + trc("tls=%v t=%v tm=%v, (%v:)", tls, t, tm, origin(2)) + } + panic(todo("")) +} diff --git a/vendor/modernc.org/libc/libc_musl.go b/vendor/modernc.org/libc/libc_musl.go index a385f7e..fc58b07 100644 --- a/vendor/modernc.org/libc/libc_musl.go +++ b/vendor/modernc.org/libc/libc_musl.go @@ -15,7 +15,7 @@ // have generated some Go code from C you should stick to the version of this // package that you used at that time and was tested with your payload. The // correct way to upgrade to a newer version of this package is to first -// recompile (C to Go) your code with a newwer version if ccgo that depends on +// recompile (C to Go) your code with a newer version of ccgo that depends on // the new libc version. // // If you use C to Go translated code provided by others, stick to the version @@ -229,29 +229,6 @@ func CString(s string) (uintptr, error) { return p, nil } -// GoBytes returns a byte slice from a C char* having length len bytes. -func GoBytes(s uintptr, len int) []byte { - return unsafe.Slice((*byte)(unsafe.Pointer(s)), len) -} - -// GoString returns the value of a C string at s. -func GoString(s uintptr) string { - if s == 0 { - return "" - } - - var buf []byte - for { - b := *(*byte)(unsafe.Pointer(s)) - if b == 0 { - return string(buf) - } - - buf = append(buf, b) - s++ - } -} - func mustMalloc(sz Tsize_t) (r uintptr) { if r = Xmalloc(nil, sz); r != 0 || sz == 0 { return r @@ -319,6 +296,11 @@ func NewTLS() (r *TLS) { } } +// StackSlots reports the number of tls stack slots currently in use. +func (tls *TLS) StackSlots() int { + return tls.sp +} + // int *__errno_location(void) func X__errno_location(tls *TLS) (r uintptr) { return tls.pthread + unsafe.Offsetof(t__pthread{}.Ferrno_val) diff --git a/vendor/modernc.org/libc/libc_netbsd.go b/vendor/modernc.org/libc/libc_netbsd.go index 2b9f450..3bf0a2b 100644 --- a/vendor/modernc.org/libc/libc_netbsd.go +++ b/vendor/modernc.org/libc/libc_netbsd.go @@ -86,6 +86,8 @@ func X__runes_for_locale(t *TLS, l locale_t, p uintptr) uintptr { panic(todo("")) } +type Tsize_t = types.Size_t + type file uintptr func (f file) fd() int32 { return int32((*stdio.FILE)(unsafe.Pointer(f)).F_file) } diff --git a/vendor/modernc.org/libc/libc_openbsd.go b/vendor/modernc.org/libc/libc_openbsd.go index 16c4afd..09e7a56 100644 --- a/vendor/modernc.org/libc/libc_openbsd.go +++ b/vendor/modernc.org/libc/libc_openbsd.go @@ -43,6 +43,8 @@ var ( in6_addr_any in.In6_addr ) +type Tsize_t = types.Size_t + type syscallErrno = unix.Errno // // Keep these outside of the var block otherwise go generate will miss them. diff --git a/vendor/modernc.org/libc/libc_unix.go b/vendor/modernc.org/libc/libc_unix.go index 1d9f1b1..69b1027 100644 --- a/vendor/modernc.org/libc/libc_unix.go +++ b/vendor/modernc.org/libc/libc_unix.go @@ -1298,21 +1298,6 @@ func Xstrftime(tls *TLS, s uintptr, n size_t, f uintptr, tm uintptr) (r size_t) } -func Xgmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) { - if __ccgo_strace { - trc("tls=%v t=%v tm=%v, (%v:)", tls, t, tm, origin(2)) - defer func() { trc("-> %v", r) }() - } - if x___secs_to_tm(tls, int64(*(*time_t)(unsafe.Pointer(t))), tm) < 0 { - *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(errno.EOVERFLOW) - return uintptr(0) - } - (*ctime.Tm)(unsafe.Pointer(tm)).Ftm_isdst = 0 - (*ctime.Tm)(unsafe.Pointer(tm)).Ftm_gmtoff = 0 - (*ctime.Tm)(unsafe.Pointer(tm)).Ftm_zone = uintptr(unsafe.Pointer(&x___utc)) - return tm -} - func x___secs_to_tm(tls *TLS, t int64, tm uintptr) (r int32) { var c_cycles, leap, months, q_cycles, qc_cycles, remdays, remsecs, remyears, wday, yday int32 var days, secs, years int64 diff --git a/vendor/modernc.org/libc/libc_unix3.go b/vendor/modernc.org/libc/libc_unix3.go new file mode 100644 index 0000000..a284d5d --- /dev/null +++ b/vendor/modernc.org/libc/libc_unix3.go @@ -0,0 +1,46 @@ +// Copyright 2024 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build unix && !illumos && !(linux && (amd64 || arm64 || loong64 || ppc64le || s390x || riscv64 || 386 || arm)) + +package libc // import "modernc.org/libc" + +import ( + "unsafe" + + "golang.org/x/sys/unix" + "modernc.org/libc/errno" + ctime "modernc.org/libc/time" +) + +// int clock_gettime(clockid_t clk_id, struct timespec *tp); +func Xclock_gettime(t *TLS, clk_id int32, tp uintptr) int32 { + if __ccgo_strace { + trc("t=%v clk_id=%v tp=%v, (%v:)", t, clk_id, tp, origin(2)) + } + var ts unix.Timespec + if err := unix.ClockGettime(clk_id, &ts); err != nil { + t.setErrno(err) + trc("FAIL: %v", err) + return -1 + } + + *(*unix.Timespec)(unsafe.Pointer(tp)) = ts + return 0 +} + +func Xgmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) { + if __ccgo_strace { + trc("tls=%v t=%v tm=%v, (%v:)", tls, t, tm, origin(2)) + defer func() { trc("-> %v", r) }() + } + if x___secs_to_tm(tls, int64(*(*time_t)(unsafe.Pointer(t))), tm) < 0 { + *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(errno.EOVERFLOW) + return uintptr(0) + } + (*ctime.Tm)(unsafe.Pointer(tm)).Ftm_isdst = 0 + (*ctime.Tm)(unsafe.Pointer(tm)).Ftm_gmtoff = 0 + (*ctime.Tm)(unsafe.Pointer(tm)).Ftm_zone = uintptr(unsafe.Pointer(&x___utc)) + return tm +} diff --git a/vendor/modernc.org/libc/libc_windows.go b/vendor/modernc.org/libc/libc_windows.go index 79bd88f..b5fb0a8 100644 --- a/vendor/modernc.org/libc/libc_windows.go +++ b/vendor/modernc.org/libc/libc_windows.go @@ -9,6 +9,7 @@ import ( "fmt" "golang.org/x/sys/windows" "math" + mbits "math/bits" "os" "os/exec" "os/user" @@ -42,6 +43,8 @@ var X_iob [stdio.X_IOB_ENTRIES]stdio.FILE var Xin6addr_any [16]byte var Xtimezone long // extern long timezone; +type Tsize_t = types.Size_t + var ( iobMap = map[uintptr]int32{} // &_iob[fd] -> fd wenvValid bool @@ -241,10 +244,18 @@ var ( procWcsncpy = modcrt.NewProc("wcsncpy") procWcsrchr = modcrt.NewProc("wcsrchr") - moducrt = windows.NewLazySystemDLL("ucrtbase.dll") - procFindfirst32 = moducrt.NewProc("_findfirst32") - procFindnext32 = moducrt.NewProc("_findnext32") - procStat64i32 = moducrt.NewProc("_stat64i32") + moducrt = windows.NewLazySystemDLL("ucrtbase.dll") + procFindfirst32 = moducrt.NewProc("_findfirst32") + procFindnext32 = moducrt.NewProc("_findnext32") + procStat64i32 = moducrt.NewProc("_stat64i32") + procWchmod = moducrt.NewProc("_wchmod") + procWfindfirst32 = moducrt.NewProc("_wfindfirst32") + procWfindfirst64i32 = moducrt.NewProc("_wfindfirst64i32") + procWfindnext32 = moducrt.NewProc("_wfindnext32") + procWfindnext64i32 = moducrt.NewProc("_wfindnext64i32") + procWmkdir = moducrt.NewProc("_wmkdir") + procWstat32 = moducrt.NewProc("_wstat32") + procWstat64i32 = moducrt.NewProc("_wstat64i32") ) var ( @@ -845,25 +856,49 @@ func Xmunmap(t *TLS, addr uintptr, length types.Size_t) int32 { // return 0 } +type Timeval = struct { + Ftv_sec int32 + Ftv_usec int32 +} + // int gettimeofday(struct timeval *tv, struct timezone *tz); func Xgettimeofday(t *TLS, tv, tz uintptr) int32 { if __ccgo_strace { trc("t=%v tz=%v, (%v:)", t, tz, origin(2)) } - panic(todo("")) - // if tz != 0 { - // panic(todo("")) - // } - - // var tvs unix.Timeval - // err := unix.Gettimeofday(&tvs) - // if err != nil { - // t.setErrno(err) - // return -1 - // } + if tv == 0 { + return 0 + } - // *(*unix.Timeval)(unsafe.Pointer(tv)) = tvs + // This seems to work as well + // var u64 uint64 + // procGetSystemTimeAsFileTime.Call(uintptr(unsafe.Pointer(&u64)), 0, 0) + // u64 /= 10 + // u64 -= 11644473600000000 + // (*Timeval)(unsafe.Pointer(tv)).Ftv_sec = int32(u64/1e6) + // (*Timeval)(unsafe.Pointer(tv)).Ftv_usec = int32(u64%1e6) // return 0 + + // But let's use the golang.org/x/sys version + windows.Gettimeofday((*windows.Timeval)(unsafe.Pointer(tv))) + return 0 +} + +type Timespec = struct { + Ftv_sec time.Time_t + Ftv_nsec int32 +} + +// int clock_gettime(clockid_t clk_id, struct timespec *tp); +func Xclock_gettime(t *TLS, clk_id int32, tp uintptr) int32 { + if __ccgo_strace { + trc("t=%v clk_id=%v tp=%v, (%v:)", t, clk_id, tp, origin(2)) + } + var u64 uint64 // [100ns] + procGetSystemTimeAsFileTime.Call(uintptr(unsafe.Pointer(&u64)), 0, 0) + (*Timespec)(unsafe.Pointer(tp)).Ftv_sec = time.Time_t((u64/10 - 11644473600000000) / 1e6) + (*Timespec)(unsafe.Pointer(tp)).Ftv_nsec = int32((u64 * 100) % 1e9) + return 0 } // int getsockopt(int sockfd, int level, int optname, void *optval, socklen_t *optlen); @@ -1770,14 +1805,6 @@ func Xrealpath(t *TLS, path, resolved_path uintptr) uintptr { return resolved_path } -// struct tm *gmtime_r(const time_t *timep, struct tm *result); -func Xgmtime_r(t *TLS, timep, result uintptr) uintptr { - if __ccgo_strace { - trc("t=%v result=%v, (%v:)", t, result, origin(2)) - } - panic(todo("")) -} - // // char *inet_ntoa(struct in_addr in); // func Xinet_ntoa(t *TLS, in1 in.In_addr) uintptr { // panic(todo("")) @@ -7108,22 +7135,49 @@ func Xsscanf(t *TLS, str, format, va uintptr) int32 { return r } +var _toint4 = Float64FromInt32(1) / Float64FromFloat64(2.220446049250313e-16) + func Xrint(tls *TLS, x float64) float64 { if __ccgo_strace { trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) } - switch { - case x == 0: // also +0 and -0 - return 0 - case math.IsInf(x, 0), math.IsNaN(x): - return x - case x >= math.MinInt64 && x <= math.MaxInt64 && float64(int64(x)) == x: + bp := tls.Alloc(16) + defer tls.Free(16) + var e, s int32 + var y Tdouble_t + var v1 float64 + var _ /* u at bp+0 */ struct { + Fi [0]Tuint64_t + Ff float64 + } + _, _, _, _ = e, s, y, v1 + *(*struct { + Fi [0]Tuint64_t + Ff float64 + })(unsafe.Pointer(bp)) = struct { + Fi [0]Tuint64_t + Ff float64 + }{} + *(*float64)(unsafe.Pointer(bp)) = x + e = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(52) & uint64(0x7ff)) + s = Int32FromUint64(*(*Tuint64_t)(unsafe.Pointer(bp)) >> int32(63)) + if e >= Int32FromInt32(0x3ff)+Int32FromInt32(52) { return x - case x >= 0: - return math.Floor(x + 0.5) - default: - return math.Ceil(x - 0.5) } + if s != 0 { + y = x - _toint4 + _toint4 + } else { + y = x + _toint4 - _toint4 + } + if y == Float64FromInt32(0) { + if s != 0 { + v1 = -Float64FromFloat64(0) + } else { + v1 = Float64FromInt32(0) + } + return v1 + } + return y } // FILE *fdopen(int fd, const char *mode); @@ -7471,15 +7525,131 @@ func AtomicLoadNUint8(ptr uintptr, memorder int32) uint8 { } // struct tm *gmtime( const time_t *sourceTime ); -func Xgmtime(t *TLS, sourceTime uintptr) uintptr { +// func Xgmtime(t *TLS, sourceTime uintptr) uintptr { +// if __ccgo_strace { +// trc("t=%v sourceTime=%v, (%v:)", t, sourceTime, origin(2)) +// } +// r0, _, err := procGmtime.Call(uintptr(sourceTime)) +// if err != windows.NOERROR { +// t.setErrno(err) +// } +// return uintptr(r0) +// } + +var _tm time.Tm + +// /tmp/libc/musl-master/src/time/gmtime.c:4:11: +func Xgmtime(tls *TLS, t uintptr) (r uintptr) { // /tmp/libc/musl-master/src/time/gmtime.c:7:2: if __ccgo_strace { - trc("t=%v sourceTime=%v, (%v:)", t, sourceTime, origin(2)) + trc("tls=%v t=%v, (%v:)", tls, t, origin(2)) + defer func() { trc("-> %v", r) }() } - r0, _, err := procGmtime.Call(uintptr(sourceTime)) - if err != windows.NOERROR { - t.setErrno(err) + r = Xgmtime_r(tls, t, uintptr(unsafe.Pointer(&_tm))) + return r +} + +var _days_in_month = [12]int8{ + 0: int8(31), + 1: int8(30), + 2: int8(31), + 3: int8(30), + 4: int8(31), + 5: int8(31), + 6: int8(30), + 7: int8(31), + 8: int8(30), + 9: int8(31), + 10: int8(31), + 11: int8(29), +} + +var x___utc = [4]int8{'U', 'T', 'C'} + +func Xgmtime_r(tls *TLS, t uintptr, tm uintptr) (r uintptr) { + if __ccgo_strace { + trc("tls=%v t=%v tm=%v, (%v:)", tls, t, tm, origin(2)) + defer func() { trc("-> %v", r) }() } - return uintptr(r0) + if x___secs_to_tm(tls, int64(*(*time.Time_t)(unsafe.Pointer(t))), tm) < 0 { + *(*int32)(unsafe.Pointer(X__errno_location(tls))) = int32(errno.EOVERFLOW) + return uintptr(0) + } + (*time.Tm)(unsafe.Pointer(tm)).Ftm_isdst = 0 + return tm +} + +func x___secs_to_tm(tls *TLS, t int64, tm uintptr) (r int32) { + var c_cycles, leap, months, q_cycles, qc_cycles, remdays, remsecs, remyears, wday, yday int32 + var days, secs, years int64 + _, _, _, _, _, _, _, _, _, _, _, _, _ = c_cycles, days, leap, months, q_cycles, qc_cycles, remdays, remsecs, remyears, secs, wday, yday, years + /* Reject time_t values whose year would overflow int */ + if t < int64(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff))*Int64FromInt64(31622400) || t > Int64FromInt32(limits.INT_MAX)*Int64FromInt64(31622400) { + return -int32(1) + } + secs = t - (Int64FromInt64(946684800) + int64(Int32FromInt32(86400)*(Int32FromInt32(31)+Int32FromInt32(29)))) + days = secs / int64(86400) + remsecs = int32(secs % int64(86400)) + if remsecs < 0 { + remsecs += int32(86400) + days-- + } + wday = int32((int64(3) + days) % int64(7)) + if wday < 0 { + wday += int32(7) + } + qc_cycles = int32(days / int64(Int32FromInt32(365)*Int32FromInt32(400)+Int32FromInt32(97))) + remdays = int32(days % int64(Int32FromInt32(365)*Int32FromInt32(400)+Int32FromInt32(97))) + if remdays < 0 { + remdays += Int32FromInt32(365)*Int32FromInt32(400) + Int32FromInt32(97) + qc_cycles-- + } + c_cycles = remdays / (Int32FromInt32(365)*Int32FromInt32(100) + Int32FromInt32(24)) + if c_cycles == int32(4) { + c_cycles-- + } + remdays -= c_cycles * (Int32FromInt32(365)*Int32FromInt32(100) + Int32FromInt32(24)) + q_cycles = remdays / (Int32FromInt32(365)*Int32FromInt32(4) + Int32FromInt32(1)) + if q_cycles == int32(25) { + q_cycles-- + } + remdays -= q_cycles * (Int32FromInt32(365)*Int32FromInt32(4) + Int32FromInt32(1)) + remyears = remdays / int32(365) + if remyears == int32(4) { + remyears-- + } + remdays -= remyears * int32(365) + leap = BoolInt32(!(remyears != 0) && (q_cycles != 0 || !(c_cycles != 0))) + yday = remdays + int32(31) + int32(28) + leap + if yday >= int32(365)+leap { + yday -= int32(365) + leap + } + years = int64(remyears+int32(4)*q_cycles+int32(100)*c_cycles) + int64(400)*int64(int64(qc_cycles)) + months = 0 + for { + if !(int32(_days_in_month[months]) <= remdays) { + break + } + remdays -= int32(_days_in_month[months]) + goto _1 + _1: + months++ + } + if months >= int32(10) { + months -= int32(12) + years++ + } + if years+int64(100) > int64(limits.INT_MAX) || years+int64(100) < int64(-Int32FromInt32(1)-Int32FromInt32(0x7fffffff)) { + return -int32(1) + } + (*time.Tm)(unsafe.Pointer(tm)).Ftm_year = int32(years + int64(100)) + (*time.Tm)(unsafe.Pointer(tm)).Ftm_mon = months + int32(2) + (*time.Tm)(unsafe.Pointer(tm)).Ftm_mday = remdays + int32(1) + (*time.Tm)(unsafe.Pointer(tm)).Ftm_wday = wday + (*time.Tm)(unsafe.Pointer(tm)).Ftm_yday = yday + (*time.Tm)(unsafe.Pointer(tm)).Ftm_hour = remsecs / int32(3600) + (*time.Tm)(unsafe.Pointer(tm)).Ftm_min = remsecs / int32(60) % int32(60) + (*time.Tm)(unsafe.Pointer(tm)).Ftm_sec = remsecs % int32(60) + return 0 } // size_t strftime( @@ -7609,3 +7779,79 @@ func X_strnicmp(tls *TLS, __Str1 uintptr, __Str2 uintptr, __MaxCount types.Size_ } return int32(r0) } + +func X__builtin_ctz(t *TLS, n uint32) int32 { + return int32(mbits.TrailingZeros32(n)) +} + +// intptr_t _wfindfirst64i32(const wchar_t *filespec, struct _wfinddata64i32_t *fileinfo); +func X_wfindfirst64i32(tls *TLS, filespec, fileinfo uintptr) (r types.Intptr_t) { + r0, _, err := procWfindfirst64i32.Call(filespec, fileinfo) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return types.Intptr_t(r0) +} + +// int _wfindnext64i32(intptr_t handle, struct _wfinddata64i32_t *fileinfo); +func X_wfindnext64i32(tls *TLS, handle types.Intptr_t, fileinfo uintptr) (r int32) { + r0, _, err := procWfindnext64i32.Call(uintptr(handle), fileinfo) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return int32(r0) +} + +// int _wchmod( const wchar_t *filename, int pmode ); +func X_wchmod(tls *TLS, filename uintptr, pmode int32) (r int32) { + r0, _, err := procWchmod.Call(filename, uintptr(pmode)) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return int32(r0) +} + +// int _wmkdir(const wchar_t *dirname); +func X_wmkdir(tls *TLS, dirname uintptr) (r int32) { + r0, _, err := procWmkdir.Call(dirname) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return int32(r0) +} + +// int _wstat64i32(const wchar_t *path, struct _stat64i32 *buffer); +func X_wstat64i32(tls *TLS, path, buffer uintptr) (r int32) { + r0, _, err := procWstat64i32.Call(path, buffer) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return int32(r0) +} + +// intptr_t _wfindfirst32(const wchar_t *filespec, struct _wfinddata32_t *fileinfo); +func X_wfindfirst32(tls *TLS, filespec, fileinfo uintptr) (r types.Intptr_t) { + r0, _, err := procWfindfirst32.Call(filespec, fileinfo) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return types.Intptr_t(r0) +} + +// int _wfindnext32(intptr_t handle, struct _wfinddata32_t *fileinfo); +func X_wfindnext32(tls *TLS, handle types.Intptr_t, fileinfo uintptr) (r int32) { + r0, _, err := procWfindnext32.Call(uintptr(handle), fileinfo) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return int32(r0) +} + +// int _wstat32(const wchar_t *path, struct __stat32 *buffer); +func X_wstat32(tls *TLS, path, buffer uintptr) (r int32) { + r0, _, err := procWstat32.Call(path, buffer) + if err != windows.NOERROR { + tls.setErrno(int32(err.(windows.Errno))) + } + return int32(r0) +} diff --git a/vendor/modernc.org/libc/mem.go b/vendor/modernc.org/libc/mem.go index cf4644e..c8a4f7f 100644 --- a/vendor/modernc.org/libc/mem.go +++ b/vendor/modernc.org/libc/mem.go @@ -24,7 +24,9 @@ func Xmalloc(t *TLS, n types.Size_t) uintptr { trc("t=%v n=%v, (%v:)", t, n, origin(2)) } if n == 0 { - return 0 + // malloc(0) should return unique pointers + // (often expected and gnulib replaces malloc if malloc(0) returns 0) + n = 1 } allocMu.Lock() @@ -43,18 +45,18 @@ func Xmalloc(t *TLS, n types.Size_t) uintptr { // void *calloc(size_t nmemb, size_t size); func Xcalloc(t *TLS, n, size types.Size_t) uintptr { if __ccgo_strace { - trc("t=%v size=%v, (%v:)", t, size, origin(2)) + trc("t=%v n=%v size=%v, (%v:)", t, n, size, origin(2)) } rq := int(n * size) if rq == 0 { - return 0 + rq = 1 } allocMu.Lock() defer allocMu.Unlock() - p, err := allocator.UintptrCalloc(int(n * size)) + p, err := allocator.UintptrCalloc(rq) if err != nil { t.setErrno(errno.ENOMEM) return 0 @@ -121,6 +123,25 @@ func UsableSize(p uintptr) types.Size_t { return types.Size_t(memory.UintptrUsableSize(p)) } +type MemAllocatorStat struct { + Allocs int + Bytes int + Mmaps int +} + +// MemStat returns the global memory allocator statistics. +// should be compiled with the memory.counters build tag for the data to be available. +func MemStat() MemAllocatorStat { + allocMu.Lock() + defer allocMu.Unlock() + + return MemAllocatorStat{ + Allocs: allocator.Allocs, + Bytes: allocator.Bytes, + Mmaps: allocator.Mmaps, + } +} + // MemAuditStart locks the memory allocator, initializes and enables memory // auditing. Finaly it unlocks the memory allocator. // diff --git a/vendor/modernc.org/libc/mem_brk.go b/vendor/modernc.org/libc/mem_brk.go index 3881d8e..4a76fab 100644 --- a/vendor/modernc.org/libc/mem_brk.go +++ b/vendor/modernc.org/libc/mem_brk.go @@ -35,7 +35,9 @@ func Xmalloc(t *TLS, n types.Size_t) uintptr { trc("t=%v n=%v, (%v:)", t, n, origin(2)) } if n == 0 { - return 0 + // malloc(0) should return unique pointers + // (often expected and gnulib replaces malloc if malloc(0) returns 0) + n = 1 } allocMu.Lock() @@ -57,7 +59,7 @@ func Xmalloc(t *TLS, n types.Size_t) uintptr { // void *calloc(size_t nmemb, size_t size); func Xcalloc(t *TLS, n, size types.Size_t) uintptr { if __ccgo_strace { - trc("t=%v size=%v, (%v:)", t, size, origin(2)) + trc("t=%v n=%v size=%v, (%v:)", t, n, size, origin(2)) } return Xmalloc(t, n*size) } @@ -93,6 +95,17 @@ func UsableSize(p uintptr) types.Size_t { return types.Size_t(*(*uintptr)(unsafe.Pointer(p - uintptrSize))) } +type MemAllocatorStat struct { + Allocs int + Bytes int + Mmaps int +} + +// MemStat no-op for this build tag +func MemStat() MemAllocatorStat { + return MemAllocatorStat{} +} + // MemAuditStart locks the memory allocator, initializes and enables memory // auditing. Finaly it unlocks the memory allocator. // diff --git a/vendor/modernc.org/libc/mem_brk_musl.go b/vendor/modernc.org/libc/mem_brk_musl.go index c42fb7b..c0a4ade 100644 --- a/vendor/modernc.org/libc/mem_brk_musl.go +++ b/vendor/modernc.org/libc/mem_brk_musl.go @@ -281,6 +281,17 @@ func UsableSize(p uintptr) Tsize_t { return heapUsable[p] } +type MemAllocatorStat struct { + Allocs int + Bytes int + Mmaps int +} + +// MemStat no-op for this build tag +func MemStat() MemAllocatorStat { + return MemAllocatorStat{} +} + // MemAuditStart locks the memory allocator, initializes and enables memory // auditing. Finaly it unlocks the memory allocator. // diff --git a/vendor/modernc.org/libc/mem_expvar.go b/vendor/modernc.org/libc/mem_expvar.go new file mode 100644 index 0000000..e2c5aae --- /dev/null +++ b/vendor/modernc.org/libc/mem_expvar.go @@ -0,0 +1,12 @@ +//go:build libc.memexpvar + +package libc + +import "expvar" + +func init() { + // make sure to build with -tags=memory.counters to have the actual data accumulated in memory allocator + expvar.Publish("memory.allocator", expvar.Func(func() interface{} { + return MemStat() + })) +} diff --git a/vendor/modernc.org/libc/mem_musl.go b/vendor/modernc.org/libc/mem_musl.go index 1d43cff..20f6c18 100644 --- a/vendor/modernc.org/libc/mem_musl.go +++ b/vendor/modernc.org/libc/mem_musl.go @@ -127,6 +127,25 @@ func UsableSize(p uintptr) Tsize_t { return Tsize_t(memory.UintptrUsableSize(p)) } +type MemAllocatorStat struct { + Allocs int + Bytes int + Mmaps int +} + +// MemStat returns the global memory allocator statistics. +// should be compiled with the memory.counters build tag for the data to be available. +func MemStat() MemAllocatorStat { + allocatorMu.Lock() + defer allocatorMu.Unlock() + + return MemAllocatorStat{ + Allocs: allocator.Allocs, + Bytes: allocator.Bytes, + Mmaps: allocator.Mmaps, + } +} + // MemAuditStart locks the memory allocator, initializes and enables memory // auditing. Finaly it unlocks the memory allocator. // diff --git a/vendor/modernc.org/libc/memgrind.go b/vendor/modernc.org/libc/memgrind.go index e43357a..d525fa2 100644 --- a/vendor/modernc.org/libc/memgrind.go +++ b/vendor/modernc.org/libc/memgrind.go @@ -77,7 +77,9 @@ func Xmalloc(t *TLS, size types.Size_t) uintptr { trc("t=%v size=%v, (%v:)", t, size, origin(2)) } if size == 0 { - return 0 + // malloc(0) should return unique pointers + // (often expected and gnulib replaces malloc if malloc(0) returns 0) + size = 1 } allocMu.Lock() @@ -113,18 +115,18 @@ func Xmalloc(t *TLS, size types.Size_t) uintptr { // void *calloc(size_t nmemb, size_t size); func Xcalloc(t *TLS, n, size types.Size_t) uintptr { if __ccgo_strace { - trc("t=%v size=%v, (%v:)", t, size, origin(2)) + trc("t=%v n=%v size=%v, (%v:)", t, n, size, origin(2)) } rq := int(n * size) if rq == 0 { - return 0 + rq = 1 } allocMu.Lock() defer allocMu.Unlock() - p, err := allocator.UintptrCalloc(int(n * size)) + p, err := allocator.UintptrCalloc(rq) // if dmesgs { // dmesg("%v: %v -> %#x, %v", origin(1), n*size, p, err) // } @@ -269,6 +271,21 @@ func UsableSize(p uintptr) types.Size_t { return types.Size_t(memory.UintptrUsableSize(p)) } +func Xmalloc_usable_size(tls *TLS, p uintptr) (r Tsize_t) { + return UsableSize(p) +} + +type MemAllocatorStat struct { + Allocs int + Bytes int + Mmaps int +} + +// MemStat no-op for this build tag +func MemStat() MemAllocatorStat { + return MemAllocatorStat{} +} + // MemAuditStart locks the memory allocator, initializes and enables memory // auditing. Finally it unlocks the memory allocator. // diff --git a/vendor/modernc.org/libc/memgrind_musl.go b/vendor/modernc.org/libc/memgrind_musl.go index 1ee3820..ee7c2dc 100644 --- a/vendor/modernc.org/libc/memgrind_musl.go +++ b/vendor/modernc.org/libc/memgrind_musl.go @@ -77,7 +77,9 @@ func Xmalloc(t *TLS, size Tsize_t) uintptr { trc("t=%v size=%v, (%v:)", t, size, origin(2)) } if size == 0 { - return 0 + // malloc(0) should return unique pointers + // (often expected and gnulib replaces malloc if malloc(0) returns 0) + size = 1 } allocatorMu.Lock() @@ -113,18 +115,18 @@ func Xmalloc(t *TLS, size Tsize_t) uintptr { // void *calloc(size_t nmemb, size_t size); func Xcalloc(t *TLS, n, size Tsize_t) uintptr { if __ccgo_strace { - trc("t=%v size=%v, (%v:)", t, size, origin(2)) + trc("t=%v n=%v size=%v, (%v:)", t, n, size, origin(2)) } rq := int(n * size) if rq == 0 { - return 0 + rq = 1 } allocatorMu.Lock() defer allocatorMu.Unlock() - p, err := allocator.UintptrCalloc(int(n * size)) + p, err := allocator.UintptrCalloc(rq) // if dmesgs { // dmesg("%v: %v -> %#x, %v", origin(1), n*size, p, err) // } @@ -269,6 +271,17 @@ func UsableSize(p uintptr) Tsize_t { return Tsize_t(memory.UintptrUsableSize(p)) } +type MemAllocatorStat struct { + Allocs int + Bytes int + Mmaps int +} + +// MemStat no-op for this build tag +func MemStat() MemAllocatorStat { + return MemAllocatorStat{} +} + func Xmalloc_usable_size(tls *TLS, p uintptr) (r Tsize_t) { return UsableSize(p) } diff --git a/vendor/modernc.org/libc/musl_darwin_amd64.go b/vendor/modernc.org/libc/musl_darwin_amd64.go index e0333fa..29081e4 100644 --- a/vendor/modernc.org/libc/musl_darwin_amd64.go +++ b/vendor/modernc.org/libc/musl_darwin_amd64.go @@ -357,7 +357,11 @@ type size_t = uint64 /* :9:23 */ type wchar_t = int32 /* :15:24 */ -var X__darwin_check_fd_set_overflow uintptr /* :146:5: */ +// /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/_types/_fd_def.h:54 +// int __darwin_check_fd_set_overflow(int, const void *, int) __API_AVAILABLE(macosx(11.0), ios(14.0), tvos(14.0), watchos(7.0)); +func X__darwin_check_fd_set_overflow(tls *TLS, _ int32, _ uintptr, _ int32) int32 { + return 1 +} // pthread opaque structures diff --git a/vendor/modernc.org/libc/musl_linux_amd64.go b/vendor/modernc.org/libc/musl_linux_amd64.go deleted file mode 100644 index 7d40d5f..0000000 --- a/vendor/modernc.org/libc/musl_linux_amd64.go +++ /dev/null @@ -1,7205 +0,0 @@ -// Code generated by 'ccgo -export-externs X -hide __syscall0,__syscall1,__syscall2,__syscall3,__syscall4,__syscall5,__syscall6 -nostdinc -nostdlib -o ../musl_linux_amd64.go -pkgname libc -static-locals-prefix _s -Iarch/x86_64 -Iarch/generic -Iobj/src/internal -Isrc/include -Isrc/internal -Iobj/include -Iinclude copyright.c src/ctype/__ctype_b_loc.c src/ctype/isalnum.c src/ctype/isalpha.c src/ctype/isdigit.c src/ctype/islower.c src/ctype/isprint.c src/ctype/isupper.c src/ctype/isxdigit.c src/dirent/closedir.c src/dirent/opendir.c src/dirent/readdir.c src/internal/floatscan.c src/internal/intscan.c src/internal/shgetc.c src/locale/localeconv.c src/math/__fpclassify.c src/math/__fpclassifyf.c src/math/__fpclassifyl.c src/math/copysignl.c src/math/fabsl.c src/math/fmodl.c src/math/nanf.c src/math/rint.c src/math/scalbn.c src/math/scalbnl.c src/multibyte/internal.c src/multibyte/mbrtowc.c src/multibyte/mbsinit.c src/network/freeaddrinfo.c src/network/getaddrinfo.c src/network/gethostbyaddr.c src/network/gethostbyaddr_r.c src/network/gethostbyname.c src/network/gethostbyname2.c src/network/gethostbyname2_r.c src/network/gethostbyname_r.c src/network/getnameinfo.c src/network/h_errno.c src/network/inet_aton.c src/network/inet_ntop.c src/network/inet_pton.c src/network/lookup_ipliteral.c src/network/lookup_name.c src/network/lookup_serv.c src/prng/rand_r.c src/stdio/__lockfile.c src/stdio/__toread.c src/stdio/__uflow.c src/stdio/sscanf.c src/stdio/vfscanf.c src/stdio/vsscanf.c src/stdlib/bsearch.c src/stdlib/strtod.c src/stdlib/strtol.c src/string/strdup.c src/string/strlcat.c src/string/strlcpy.c src/string/strncasecmp.c src/string/strncat.c src/string/strnlen.c src/string/strspn.c src/string/strtok.c src/thread/pthread_attr_get.c src/thread/pthread_attr_setdetachstate.c src/thread/pthread_mutex_lock.c src/thread/pthread_mutexattr_destroy.c src/thread/pthread_mutexattr_init.c src/thread/pthread_mutexattr_settype.c', DO NOT EDIT. - -//go:build !(linux && amd64) - -package libc - -import ( - "math" - "reflect" - "sync/atomic" - "unsafe" -) - -var _ = math.Pi -var _ reflect.Kind -var _ atomic.Value -var _ unsafe.Pointer - -// musl as a whole is licensed under the following standard MIT license: -// -// ---------------------------------------------------------------------- -// Copyright © 2005-2020 Rich Felker, et al. -// -// Permission is hereby granted, free of charge, to any person obtaining -// a copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to -// permit persons to whom the Software is furnished to do so, subject to -// the following conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -// ---------------------------------------------------------------------- -// -// Authors/contributors include: -// -// A. Wilcox -// Ada Worcester -// Alex Dowad -// Alex Suykov -// Alexander Monakov -// Andre McCurdy -// Andrew Kelley -// Anthony G. Basile -// Aric Belsito -// Arvid Picciani -// Bartosz Brachaczek -// Benjamin Peterson -// Bobby Bingham -// Boris Brezillon -// Brent Cook -// Chris Spiegel -// Clément Vasseur -// Daniel Micay -// Daniel Sabogal -// Daurnimator -// David Carlier -// David Edelsohn -// Denys Vlasenko -// Dmitry Ivanov -// Dmitry V. Levin -// Drew DeVault -// Emil Renner Berthing -// Fangrui Song -// Felix Fietkau -// Felix Janda -// Gianluca Anzolin -// Hauke Mehrtens -// He X -// Hiltjo Posthuma -// Isaac Dunham -// Jaydeep Patil -// Jens Gustedt -// Jeremy Huntwork -// Jo-Philipp Wich -// Joakim Sindholt -// John Spencer -// Julien Ramseier -// Justin Cormack -// Kaarle Ritvanen -// Khem Raj -// Kylie McClain -// Leah Neukirchen -// Luca Barbato -// Luka Perkov -// M Farkas-Dyck (Strake) -// Mahesh Bodapati -// Markus Wichmann -// Masanori Ogino -// Michael Clark -// Michael Forney -// Mikhail Kremnyov -// Natanael Copa -// Nicholas J. Kain -// orc -// Pascal Cuoq -// Patrick Oppenlander -// Petr Hosek -// Petr Skocik -// Pierre Carrier -// Reini Urban -// Rich Felker -// Richard Pennington -// Ryan Fairfax -// Samuel Holland -// Segev Finer -// Shiz -// sin -// Solar Designer -// Stefan Kristiansson -// Stefan O'Rear -// Szabolcs Nagy -// Timo Teräs -// Trutz Behn -// Valentin Ochs -// Will Dietz -// William Haddon -// William Pitcock -// -// Portions of this software are derived from third-party works licensed -// under terms compatible with the above MIT license: -// -// The TRE regular expression implementation (src/regex/reg* and -// src/regex/tre*) is Copyright © 2001-2008 Ville Laurikari and licensed -// under a 2-clause BSD license (license text in the source files). The -// included version has been heavily modified by Rich Felker in 2012, in -// the interests of size, simplicity, and namespace cleanliness. -// -// Much of the math library code (src/math/* and src/complex/*) is -// Copyright © 1993,2004 Sun Microsystems or -// Copyright © 2003-2011 David Schultz or -// Copyright © 2003-2009 Steven G. Kargl or -// Copyright © 2003-2009 Bruce D. Evans or -// Copyright © 2008 Stephen L. Moshier or -// Copyright © 2017-2018 Arm Limited -// and labelled as such in comments in the individual source files. All -// have been licensed under extremely permissive terms. -// -// The ARM memcpy code (src/string/arm/memcpy.S) is Copyright © 2008 -// The Android Open Source Project and is licensed under a two-clause BSD -// license. It was taken from Bionic libc, used on Android. -// -// The AArch64 memcpy and memset code (src/string/aarch64/*) are -// Copyright © 1999-2019, Arm Limited. -// -// The implementation of DES for crypt (src/crypt/crypt_des.c) is -// Copyright © 1994 David Burren. It is licensed under a BSD license. -// -// The implementation of blowfish crypt (src/crypt/crypt_blowfish.c) was -// originally written by Solar Designer and placed into the public -// domain. The code also comes with a fallback permissive license for use -// in jurisdictions that may not recognize the public domain. -// -// The smoothsort implementation (src/stdlib/qsort.c) is Copyright © 2011 -// Valentin Ochs and is licensed under an MIT-style license. -// -// The x86_64 port was written by Nicholas J. Kain and is licensed under -// the standard MIT terms. -// -// The mips and microblaze ports were originally written by Richard -// Pennington for use in the ellcc project. The original code was adapted -// by Rich Felker for build system and code conventions during upstream -// integration. It is licensed under the standard MIT terms. -// -// The mips64 port was contributed by Imagination Technologies and is -// licensed under the standard MIT terms. -// -// The powerpc port was also originally written by Richard Pennington, -// and later supplemented and integrated by John Spencer. It is licensed -// under the standard MIT terms. -// -// All other files which have no copyright comments are original works -// produced specifically for use as part of this library, written either -// by Rich Felker, the main author of the library, or by one or more -// contibutors listed above. Details on authorship of individual files -// can be found in the git version control history of the project. The -// omission of copyright and license comments in each file is in the -// interest of source tree size. -// -// In addition, permission is hereby granted for all public header files -// (include/* and arch/*/bits/*) and crt files intended to be linked into -// applications (crt/*, ldso/dlstart.c, and arch/*/crt_arch.h) to omit -// the copyright notice and permission notice otherwise required by the -// license, and to use these files without any requirement of -// attribution. These files include substantial contributions from: -// -// Bobby Bingham -// John Spencer -// Nicholas J. Kain -// Rich Felker -// Richard Pennington -// Stefan Kristiansson -// Szabolcs Nagy -// -// all of whom have explicitly granted such permission. -// -// This file previously contained text expressing a belief that most of -// the files covered by the above exception were sufficiently trivial not -// to be subject to copyright, resulting in confusion over whether it -// negated the permissions granted in the license. In the spirit of -// permissive licensing, and of not having licensing issues being an -// obstacle to adoption, that text has been removed. -const ( /* copyright.c:194:1: */ - __musl__copyright__ = 0 -) - -const ( /* nameser.h:117:1: */ - ns_uop_delete = 0 - ns_uop_add = 1 - ns_uop_max = 2 -) - -const ( /* nameser.h:147:1: */ - ns_t_invalid = 0 - ns_t_a = 1 - ns_t_ns = 2 - ns_t_md = 3 - ns_t_mf = 4 - ns_t_cname = 5 - ns_t_soa = 6 - ns_t_mb = 7 - ns_t_mg = 8 - ns_t_mr = 9 - ns_t_null = 10 - ns_t_wks = 11 - ns_t_ptr = 12 - ns_t_hinfo = 13 - ns_t_minfo = 14 - ns_t_mx = 15 - ns_t_txt = 16 - ns_t_rp = 17 - ns_t_afsdb = 18 - ns_t_x25 = 19 - ns_t_isdn = 20 - ns_t_rt = 21 - ns_t_nsap = 22 - ns_t_nsap_ptr = 23 - ns_t_sig = 24 - ns_t_key = 25 - ns_t_px = 26 - ns_t_gpos = 27 - ns_t_aaaa = 28 - ns_t_loc = 29 - ns_t_nxt = 30 - ns_t_eid = 31 - ns_t_nimloc = 32 - ns_t_srv = 33 - ns_t_atma = 34 - ns_t_naptr = 35 - ns_t_kx = 36 - ns_t_cert = 37 - ns_t_a6 = 38 - ns_t_dname = 39 - ns_t_sink = 40 - ns_t_opt = 41 - ns_t_apl = 42 - ns_t_tkey = 249 - ns_t_tsig = 250 - ns_t_ixfr = 251 - ns_t_axfr = 252 - ns_t_mailb = 253 - ns_t_maila = 254 - ns_t_any = 255 - ns_t_zxfr = 256 - ns_t_max = 65536 -) - -const ( /* nameser.h:210:1: */ - ns_c_invalid = 0 - ns_c_in = 1 - ns_c_2 = 2 - ns_c_chaos = 3 - ns_c_hs = 4 - ns_c_none = 254 - ns_c_any = 255 - ns_c_max = 65536 -) - -const ( /* nameser.h:221:1: */ - ns_kt_rsa = 1 - ns_kt_dh = 2 - ns_kt_dsa = 3 - ns_kt_private = 254 -) - -const ( /* nameser.h:228:1: */ - cert_t_pkix = 1 - cert_t_spki = 2 - cert_t_pgp = 3 - cert_t_url = 253 - cert_t_oid = 254 -) - -const ( /* nameser.h:28:1: */ - ns_s_qd = 0 - ns_s_zn = 0 - ns_s_an = 1 - ns_s_pr = 1 - ns_s_ns = 2 - ns_s_ud = 2 - ns_s_ar = 3 - ns_s_max = 4 -) - -const ( /* nameser.h:75:1: */ - ns_f_qr = 0 - ns_f_opcode = 1 - ns_f_aa = 2 - ns_f_tc = 3 - ns_f_rd = 4 - ns_f_ra = 5 - ns_f_z = 6 - ns_f_ad = 7 - ns_f_cd = 8 - ns_f_rcode = 9 - ns_f_max = 10 -) - -const ( /* nameser.h:89:1: */ - ns_o_query = 0 - ns_o_iquery = 1 - ns_o_status = 2 - ns_o_notify = 4 - ns_o_update = 5 - ns_o_max = 6 -) - -const ( /* nameser.h:98:1: */ - ns_r_noerror = 0 - ns_r_formerr = 1 - ns_r_servfail = 2 - ns_r_nxdomain = 3 - ns_r_notimpl = 4 - ns_r_refused = 5 - ns_r_yxdomain = 6 - ns_r_yxrrset = 7 - ns_r_nxrrset = 8 - ns_r_notauth = 9 - ns_r_notzone = 10 - ns_r_max = 11 - ns_r_badvers = 16 - ns_r_badsig = 16 - ns_r_badkey = 17 - ns_r_badtime = 18 -) - -const ( /* pthread_impl.h:58:1: */ - DT_EXITING = 0 - DT_JOINABLE = 1 - DT_DETACHED = 2 -) - -type ptrdiff_t = int64 /* :3:26 */ - -type size_t = uint64 /* :9:23 */ - -type wchar_t = int32 /* :15:24 */ - -type uint16_t = uint16 /* alltypes.h:126:25 */ - -type uint32_t = uint32 /* alltypes.h:131:25 */ - -type uint64_t = uint64 /* alltypes.h:136:25 */ - -func __bswap32(tls *TLS, __x uint32_t) uint32_t { /* endian.h:24:26: */ - return __x>>24 | __x>>8&uint32_t(0xff00) | __x<<8&uint32_t(0xff0000) | __x<<24 -} - -var table = [384]uint16{ - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), - uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), - uint16((0x200/256 | 0x200*256) % 65536), uint16((0x320/256 | 0x320*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x220/256 | 0x220*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), - uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), - uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), - uint16((0x160/256 | 0x160*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), - uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), - uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), - uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x8d8/256 | 0x8d8*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), - uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8d5/256 | 0x8d5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), - uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), - uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), - uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x8c5/256 | 0x8c5*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), - uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8d6/256 | 0x8d6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), - uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), - uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), - uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x8c6/256 | 0x8c6*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x4c0/256 | 0x4c0*256) % 65536), uint16((0x200/256 | 0x200*256) % 65536), - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), - uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), uint16(0), -} /* __ctype_b_loc.c:9:29 */ - -var ptable uintptr = 0 /* __ctype_b_loc.c:36:29 */ - -func X__ctype_b_loc(tls *TLS) uintptr { /* __ctype_b_loc.c:38:22: */ - if __ccgo_strace { - trc("tls=%v, (%v:)", tls, origin(2)) - } - return uintptr(unsafe.Pointer(&ptable)) -} - -func __isspace(tls *TLS, _c int32) int32 { /* ctype.h:26:21: */ - return Bool32(_c == ' ' || uint32(_c)-uint32('\t') < uint32(5)) -} - -type __locale_struct = struct{ cat [6]uintptr } /* alltypes.h:343:9 */ - -type locale_t = uintptr /* alltypes.h:343:32 */ - -func Xisalnum(tls *TLS, c int32) int32 { /* isalnum.c:3:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(func() int32 { - if 0 != 0 { - return Xisalpha(tls, c) - } - return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) - }() != 0 || func() int32 { - if 0 != 0 { - return Xisdigit(tls, c) - } - return Bool32(uint32(c)-uint32('0') < uint32(10)) - }() != 0) -} - -func X__isalnum_l(tls *TLS, c int32, l locale_t) int32 { /* isalnum.c:8:5: */ - if __ccgo_strace { - trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) - } - return Xisalnum(tls, c) -} - -func Xisalpha(tls *TLS, c int32) int32 { /* isalpha.c:4:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(uint32(c)|uint32(32)-uint32('a') < uint32(26)) -} - -func X__isalpha_l(tls *TLS, c int32, l locale_t) int32 { /* isalpha.c:9:5: */ - if __ccgo_strace { - trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) - } - return Xisalpha(tls, c) -} - -func Xisdigit(tls *TLS, c int32) int32 { /* isdigit.c:4:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(uint32(c)-uint32('0') < uint32(10)) -} - -func X__isdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isdigit.c:9:5: */ - if __ccgo_strace { - trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) - } - return Xisdigit(tls, c) -} - -func Xislower(tls *TLS, c int32) int32 { /* islower.c:4:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(uint32(c)-uint32('a') < uint32(26)) -} - -func X__islower_l(tls *TLS, c int32, l locale_t) int32 { /* islower.c:9:5: */ - if __ccgo_strace { - trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) - } - return Xislower(tls, c) -} - -func Xisprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) -} - -func X__builtin_isprint(tls *TLS, c int32) int32 { /* isprint.c:4:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(uint32(c)-uint32(0x20) < uint32(0x5f)) -} - -func X__isprint_l(tls *TLS, c int32, l locale_t) int32 { /* isprint.c:9:5: */ - if __ccgo_strace { - trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) - } - return Xisprint(tls, c) -} - -func Xisupper(tls *TLS, c int32) int32 { /* isupper.c:4:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(uint32(c)-uint32('A') < uint32(26)) -} - -func X__isupper_l(tls *TLS, c int32, l locale_t) int32 { /* isupper.c:9:5: */ - if __ccgo_strace { - trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) - } - return Xisupper(tls, c) -} - -func Xisxdigit(tls *TLS, c int32) int32 { /* isxdigit.c:3:5: */ - if __ccgo_strace { - trc("tls=%v c=%v, (%v:)", tls, c, origin(2)) - } - return Bool32(func() int32 { - if 0 != 0 { - return Xisdigit(tls, c) - } - return Bool32(uint32(c)-uint32('0') < uint32(10)) - }() != 0 || uint32(c)|uint32(32)-uint32('a') < uint32(6)) -} - -func X__isxdigit_l(tls *TLS, c int32, l locale_t) int32 { /* isxdigit.c:8:5: */ - if __ccgo_strace { - trc("tls=%v c=%v l=%v, (%v:)", tls, c, l, origin(2)) - } - return Xisxdigit(tls, c) -} - -type off_t = int64 /* alltypes.h:162:16 */ - -type ino_t = uint64 /* alltypes.h:167:25 */ - -type dirent = struct { - d_ino ino_t - d_off off_t - d_reclen uint16 - d_type uint8 - d_name [256]int8 - _ [5]byte -} /* dirent.h:5:1 */ - -type __dirstream = struct { - tell off_t - fd int32 - buf_pos int32 - buf_end int32 - lock [1]int32 - buf [2048]int8 -} /* dirent.h:20:9 */ - -type DIR = __dirstream /* dirent.h:20:28 */ - -type ssize_t = int64 /* alltypes.h:65:15 */ - -type intptr_t = int64 /* alltypes.h:70:15 */ - -type pid_t = int32 /* alltypes.h:235:13 */ - -type uid_t = uint32 /* alltypes.h:245:18 */ - -type gid_t = uint32 /* alltypes.h:250:18 */ - -type useconds_t = uint32 /* alltypes.h:260:18 */ - -type div_t = struct { - quot int32 - rem int32 -} /* stdlib.h:62:35 */ -type ldiv_t = struct { - quot int64 - rem int64 -} /* stdlib.h:63:36 */ -type lldiv_t = struct { - quot int64 - rem int64 -} /* stdlib.h:64:41 */ - -func Xclosedir(tls *TLS, dir uintptr) int32 { /* closedir.c:6:5: */ - if __ccgo_strace { - trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) - } - var ret int32 = Xclose(tls, (*DIR)(unsafe.Pointer(dir)).fd) - Xfree(tls, dir) - return ret -} - -type mode_t = uint32 /* alltypes.h:152:18 */ - -type iovec = struct { - iov_base uintptr - iov_len size_t -} /* alltypes.h:355:1 */ - -type flock = struct { - l_type int16 - l_whence int16 - _ [4]byte - l_start off_t - l_len off_t - l_pid pid_t - _ [4]byte -} /* fcntl.h:24:1 */ - -type file_handle = struct { - _ [0]uint32 - handle_bytes uint32 - handle_type int32 -} /* fcntl.h:167:1 */ - -type f_owner_ex = struct { - __type int32 - pid pid_t -} /* fcntl.h:172:1 */ - -type syscall_arg_t = int64 /* syscall.h:22:14 */ - -func Xopendir(tls *TLS, name uintptr) uintptr { /* opendir.c:8:5: */ - if __ccgo_strace { - trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) - } - var fd int32 - var dir uintptr - - if AssignInt32(&fd, Xopen(tls, name, 00|0200000|02000000, 0)) < 0 { - return uintptr(0) - } - if !(int32(AssignUintptr(&dir, Xcalloc(tls, uint64(1), uint64(unsafe.Sizeof(DIR{}))))) != 0) { - X__syscall1(tls, int64(3), int64(fd)) - return uintptr(0) - } - (*DIR)(unsafe.Pointer(dir)).fd = fd - return dir -} - -type max_align_t = struct { - __ll int64 - __ld float64 -} /* alltypes.h:41:54 */ - -type dirstream_buf_alignment_check = [1]int8 /* readdir.c:7:14 */ - -func Xreaddir(tls *TLS, dir uintptr) uintptr { /* readdir.c:10:15: */ - if __ccgo_strace { - trc("tls=%v dir=%v, (%v:)", tls, dir, origin(2)) - } - var de uintptr - - if (*DIR)(unsafe.Pointer(dir)).buf_pos >= (*DIR)(unsafe.Pointer(dir)).buf_end { - var len int32 = int32(X__syscall3(tls, int64(217), int64((*DIR)(unsafe.Pointer(dir)).fd), int64(dir+24), int64(unsafe.Sizeof([2048]int8{})))) - if len <= 0 { - if len < 0 && len != -2 { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = -len - } - return uintptr(0) - } - (*DIR)(unsafe.Pointer(dir)).buf_end = len - (*DIR)(unsafe.Pointer(dir)).buf_pos = 0 - } - de = dir + 24 + uintptr((*DIR)(unsafe.Pointer(dir)).buf_pos) - *(*int32)(unsafe.Pointer(dir + 12)) += int32((*dirent)(unsafe.Pointer(de)).d_reclen) - (*DIR)(unsafe.Pointer(dir)).tell = (*dirent)(unsafe.Pointer(de)).d_off - return de -} - -type uintptr_t = uint64 /* alltypes.h:55:24 */ - -type int8_t = int8 /* alltypes.h:96:25 */ - -type int16_t = int16 /* alltypes.h:101:25 */ - -type int32_t = int32 /* alltypes.h:106:25 */ - -type int64_t = int64 /* alltypes.h:111:25 */ - -type intmax_t = int64 /* alltypes.h:116:25 */ - -type uint8_t = uint8 /* alltypes.h:121:25 */ - -type uintmax_t = uint64 /* alltypes.h:146:25 */ - -type int_fast8_t = int8_t /* stdint.h:22:16 */ -type int_fast64_t = int64_t /* stdint.h:23:17 */ - -type int_least8_t = int8_t /* stdint.h:25:17 */ -type int_least16_t = int16_t /* stdint.h:26:17 */ -type int_least32_t = int32_t /* stdint.h:27:17 */ -type int_least64_t = int64_t /* stdint.h:28:17 */ - -type uint_fast8_t = uint8_t /* stdint.h:30:17 */ -type uint_fast64_t = uint64_t /* stdint.h:31:18 */ - -type uint_least8_t = uint8_t /* stdint.h:33:18 */ -type uint_least16_t = uint16_t /* stdint.h:34:18 */ -type uint_least32_t = uint32_t /* stdint.h:35:18 */ -type uint_least64_t = uint64_t /* stdint.h:36:18 */ - -type int_fast16_t = int32_t /* stdint.h:1:17 */ -type int_fast32_t = int32_t /* stdint.h:2:17 */ -type uint_fast16_t = uint32_t /* stdint.h:3:18 */ -type uint_fast32_t = uint32_t /* stdint.h:4:18 */ - -type _IO_FILE = struct { - flags uint32 - _ [4]byte - rpos uintptr - rend uintptr - close uintptr - wend uintptr - wpos uintptr - mustbezero_1 uintptr - wbase uintptr - read uintptr - write uintptr - seek uintptr - buf uintptr - buf_size size_t - prev uintptr - next uintptr - fd int32 - pipe_pid int32 - lockcount int64 - mode int32 - lock int32 - lbf int32 - _ [4]byte - cookie uintptr - off off_t - getln_buf uintptr - mustbezero_2 uintptr - shend uintptr - shlim off_t - shcnt off_t - prev_locked uintptr - next_locked uintptr - locale uintptr -} /* alltypes.h:320:9 */ - -type FILE = _IO_FILE /* alltypes.h:320:25 */ - -type va_list = uintptr /* alltypes.h:326:27 */ - -type _G_fpos64_t = struct { - _ [0]uint64 - __opaque [16]int8 -} /* stdio.h:54:9 */ - -type fpos_t = _G_fpos64_t /* stdio.h:58:3 */ - -type float_t = float32 /* alltypes.h:29:15 */ - -type double_t = float64 /* alltypes.h:34:16 */ - -func __FLOAT_BITS(tls *TLS, __f float32) uint32 { /* math.h:55:26: */ - bp := tls.Alloc(4) - defer tls.Free(4) - - // var __u struct {__f float32;} at bp, 4 - - *(*float32)(unsafe.Pointer(bp)) = __f - return *(*uint32)(unsafe.Pointer(bp)) -} - -func __DOUBLE_BITS(tls *TLS, __f float64) uint64 { /* math.h:61:36: */ - bp := tls.Alloc(8) - defer tls.Free(8) - - // var __u struct {__f float64;} at bp, 8 - - *(*float64)(unsafe.Pointer(bp)) = __f - return *(*uint64)(unsafe.Pointer(bp)) -} - -type __pthread = struct { - self uintptr - dtv uintptr - prev uintptr - next uintptr - sysinfo uintptr_t - canary uintptr_t - canary2 uintptr_t - tid int32 - errno_val int32 - detach_state int32 - cancel int32 - canceldisable uint8 - cancelasync uint8 - tsd_used uint8 /* unsigned char tsd_used: 1, unsigned char dlerror_flag: 1 */ - _ [5]byte - map_base uintptr - map_size size_t - stack uintptr - stack_size size_t - guard_size size_t - result uintptr - cancelbuf uintptr - tsd uintptr - robust_list struct { - head uintptr - off int64 - pending uintptr - } - timer_id int32 - _ [4]byte - locale locale_t - killlock [1]int32 - _ [4]byte - dlerror_buf uintptr - stdio_locks uintptr - canary_at_end uintptr_t - dtv_copy uintptr -} /* alltypes.h:273:9 */ - -func scanexp(tls *TLS, f uintptr, pok int32) int64 { /* floatscan.c:37:18: */ - var c int32 - var x int32 - var y int64 - var neg int32 = 0 - - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - if c == '+' || c == '-' { - neg = Bool32(c == '-') - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - if uint32(c-'0') >= 10 && pok != 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } - } - if uint32(c-'0') >= 10 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - return -0x7fffffffffffffff - int64(1) - } - for x = 0; uint32(c-'0') < 10 && x < 0x7fffffff/10; c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - x = 10*x + c - '0' - } - for y = int64(x); uint32(c-'0') < 10 && y < 0x7fffffffffffffff/int64(100); c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - y = int64(10)*y + int64(c) - int64('0') - } - for ; uint32(c-'0') < 10; c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - } - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if neg != 0 { - return -y - } - return y -} - -func decfloat(tls *TLS, f uintptr, c int32, bits int32, emin int32, sign int32, pok int32) float64 { /* floatscan.c:64:20: */ - bp := tls.Alloc(512) - defer tls.Free(512) - - // var x [128]uint32_t at bp, 512 - - var i int32 - var j int32 - var k int32 - var a int32 - var z int32 - var lrp int64 = int64(0) - var dc int64 = int64(0) - var e10 int64 = int64(0) - var lnz int32 = 0 - var gotdig int32 = 0 - var gotrad int32 = 0 - var rp int32 - var e2 int32 - var emax int32 = -emin - bits + 3 - var denormal int32 = 0 - var y float64 - var frac float64 = float64(0) - var bias float64 = float64(0) - - j = 0 - k = 0 - - // Don't let leading zeros consume buffer space - for ; c == '0'; c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - gotdig = 1 - } - if c == '.' { - gotrad = 1 - for c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }(); c == '0'; c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - gotdig = 1 - lrp-- - } - } - - *(*uint32_t)(unsafe.Pointer(bp)) = uint32_t(0) - for ; uint32(c-'0') < 10 || c == '.'; c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - if c == '.' { - if gotrad != 0 { - break - } - gotrad = 1 - lrp = dc - } else if k < 128-3 { - dc++ - if c != '0' { - lnz = int32(dc) - } - if j != 0 { - *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))*uint32_t(10) + uint32_t(c) - uint32_t('0') - } else { - *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = uint32_t(c - '0') - } - if PreIncInt32(&j, 1) == 9 { - k++ - j = 0 - } - gotdig = 1 - } else { - dc++ - if c != '0' { - lnz = (128 - 4) * 9 - *(*uint32_t)(unsafe.Pointer(bp + 124*4)) |= uint32_t(1) - } - } - } - if !(gotrad != 0) { - lrp = dc - } - - if gotdig != 0 && c|32 == 'e' { - e10 = scanexp(tls, f, pok) - if e10 == -0x7fffffffffffffff-int64(1) { - if pok != 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } else { - X__shlim(tls, f, int64(0)) - return float64(0) - } - e10 = int64(0) - } - lrp = lrp + e10 - } else if c >= 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } - if !(gotdig != 0) { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 - X__shlim(tls, f, int64(0)) - return float64(0) - } - - // Handle zero specially to avoid nasty special cases later - if !(int32(*(*uint32_t)(unsafe.Pointer(bp))) != 0) { - return float64(sign) * 0.0 - } - - // Optimize small integers (w/no exponent) and over/under-flow - if lrp == dc && dc < int64(10) && (bits > 30 || *(*uint32_t)(unsafe.Pointer(bp))>>bits == uint32_t(0)) { - return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp))) - } - if lrp > int64(-emin/2) { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - return float64(sign) * 1.79769313486231570815e+308 * 1.79769313486231570815e+308 - } - if lrp < int64(emin-2*53) { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - return float64(sign) * 2.22507385850720138309e-308 * 2.22507385850720138309e-308 - } - - // Align incomplete final B1B digit - if j != 0 { - for ; j < 9; j++ { - *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) *= uint32_t(10) - } - k++ - j = 0 - } - - a = 0 - z = k - e2 = 0 - rp = int32(lrp) - - // Optimize small to mid-size integers (even in exp. notation) - if lnz < 9 && lnz <= rp && rp < 18 { - if rp == 9 { - return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp))) - } - if rp < 9 { - return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp))) / float64(_sp10s[8-rp]) - } - var bitlim int32 = bits - 3*(rp-9) - if bitlim > 30 || *(*uint32_t)(unsafe.Pointer(bp))>>bitlim == uint32_t(0) { - return float64(sign) * float64(*(*uint32_t)(unsafe.Pointer(bp))) * float64(_sp10s[rp-10]) - } - } - - // Drop trailing zeros - for ; !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(z-1)*4))) != 0); z-- { - } - - // Align radix point to B1B digit boundary - if rp%9 != 0 { - var rpm9 int32 - if rp >= 0 { - rpm9 = rp % 9 - } else { - rpm9 = rp%9 + 9 - } - var p10 int32 = _sp10s[8-rpm9] - var carry uint32_t = uint32_t(0) - for k = a; k != z; k++ { - var tmp uint32_t = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) % uint32_t(p10) - *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))/uint32_t(p10) + carry - carry = uint32_t(1000000000/p10) * tmp - if k == a && !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))) != 0) { - a = (a + 1) & (128 - 1) - rp = rp - 9 - } - } - if carry != 0 { - *(*uint32_t)(unsafe.Pointer(bp + uintptr(PostIncInt32(&z, 1))*4)) = carry - } - rp = rp + (9 - rpm9) - } - - // Upscale until desired number of bits are left of radix point - for rp < 9*2 || rp == 9*2 && *(*uint32_t)(unsafe.Pointer(bp + uintptr(a)*4)) < _sth[0] { - var carry uint32_t = uint32_t(0) - e2 = e2 - 29 - for k = (z - 1) & (128 - 1); ; k = (k - 1) & (128 - 1) { - var tmp uint64_t = uint64_t(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)))<<29 + uint64_t(carry) - if tmp > uint64(1000000000) { - carry = uint32_t(tmp / uint64(1000000000)) - *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = uint32_t(tmp % uint64(1000000000)) - } else { - carry = uint32_t(0) - *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) = uint32_t(tmp) - } - if k == (z-1)&(128-1) && k != a && !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))) != 0) { - z = k - } - if k == a { - break - } - } - if carry != 0 { - rp = rp + 9 - a = (a - 1) & (128 - 1) - if a == z { - z = (z - 1) & (128 - 1) - *(*uint32_t)(unsafe.Pointer(bp + uintptr((z-1)&(128-1))*4)) |= *(*uint32_t)(unsafe.Pointer(bp + uintptr(z)*4)) - } - *(*uint32_t)(unsafe.Pointer(bp + uintptr(a)*4)) = carry - } - } - - // Downscale until exactly number of bits are left of radix point - for { - var carry uint32_t = uint32_t(0) - var sh int32 = 1 - for i = 0; i < 2; i++ { - k = (a + i) & (128 - 1) - if k == z || *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) < _sth[i] { - i = 2 - break - } - if *(*uint32_t)(unsafe.Pointer(bp + uintptr((a+i)&(128-1))*4)) > _sth[i] { - break - } - } - if i == 2 && rp == 9*2 { - break - } - // FIXME: find a way to compute optimal sh - if rp > 9+9*2 { - sh = 9 - } - e2 = e2 + sh - for k = a; k != z; k = (k + 1) & (128 - 1) { - var tmp uint32_t = *(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4)) & uint32_t(int32(1)<>sh + carry - carry = uint32_t(int32(1000000000)>>sh) * tmp - if k == a && !(int32(*(*uint32_t)(unsafe.Pointer(bp + uintptr(k)*4))) != 0) { - a = (a + 1) & (128 - 1) - i-- - rp = rp - 9 - } - } - if carry != 0 { - if (z+1)&(128-1) != a { - *(*uint32_t)(unsafe.Pointer(bp + uintptr(z)*4)) = carry - z = (z + 1) & (128 - 1) - } else { - *(*uint32_t)(unsafe.Pointer(bp + uintptr((z-1)&(128-1))*4)) |= uint32_t(1) - } - } - } - - // Assemble desired bits into floating point variable - for y = float64(AssignInt32(&i, 0)); i < 2; i++ { - if (a+i)&(128-1) == z { - *(*uint32_t)(unsafe.Pointer(bp + uintptr(AssignInt32(&z, (z+1)&(128-1))-1)*4)) = uint32_t(0) - } - y = 1000000000.0*y + float64(*(*uint32_t)(unsafe.Pointer(bp + uintptr((a+i)&(128-1))*4))) - } - - y = y * float64(sign) - - // Limit precision for denormal results - if bits > 53+e2-emin { - bits = 53 + e2 - emin - if bits < 0 { - bits = 0 - } - denormal = 1 - } - - // Calculate bias term to force rounding, move out lower bits - if bits < 53 { - bias = Xcopysignl(tls, Xscalbn(tls, float64(1), 2*53-bits-1), y) - frac = Xfmodl(tls, y, Xscalbn(tls, float64(1), 53-bits)) - y = y - frac - y = y + bias - } - - // Process tail of decimal input so it can affect rounding - if (a+i)&(128-1) != z { - var t uint32_t = *(*uint32_t)(unsafe.Pointer(bp + uintptr((a+i)&(128-1))*4)) - if t < uint32_t(500000000) && (t != 0 || (a+i+1)&(128-1) != z) { - frac = frac + 0.25*float64(sign) - } else if t > uint32_t(500000000) { - frac = frac + 0.75*float64(sign) - } else if t == uint32_t(500000000) { - if (a+i+1)&(128-1) == z { - frac = frac + 0.5*float64(sign) - } else { - frac = frac + 0.75*float64(sign) - } - } - if 53-bits >= 2 && !(Xfmodl(tls, frac, float64(1)) != 0) { - frac += 1 - } - } - - y = y + frac - y = y - bias - - if (e2+53)&0x7fffffff > emax-5 { - if Xfabsl(tls, y) >= float64(float64(2))/2.22044604925031308085e-16 { - if denormal != 0 && bits == 53+e2-emin { - denormal = 0 - } - y = y * 0.5 - e2++ - } - if e2+53 > emax || denormal != 0 && frac != 0 { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - } - } - - return Xscalbnl(tls, y, e2) -} - -var _sth = [2]uint32_t{uint32_t(9007199), uint32_t(254740991)} /* floatscan.c:67:24 */ -var _sp10s = [8]int32{10, 100, 1000, 10000, - 100000, 1000000, 10000000, 100000000} /* floatscan.c:80:19 */ - -func hexfloat(tls *TLS, f uintptr, bits int32, emin int32, sign int32, pok int32) float64 { /* floatscan.c:315:20: */ - var x uint32_t = uint32_t(0) - var y float64 = float64(0) - var scale float64 = float64(1) - var bias float64 = float64(0) - var gottail int32 = 0 - var gotrad int32 = 0 - var gotdig int32 = 0 - var rp int64 = int64(0) - var dc int64 = int64(0) - var e2 int64 = int64(0) - var d int32 - var c int32 - - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - - // Skip leading zeros - for ; c == '0'; c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - gotdig = 1 - } - - if c == '.' { - gotrad = 1 - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - // Count zeros after the radix point before significand - rp = int64(0) - __1: - if !(c == '0') { - goto __3 - } - gotdig = 1 - goto __2 - __2: - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - rp-- - goto __1 - goto __3 - __3: - } - - for ; uint32(c-'0') < 10 || uint32(c|32-'a') < 6 || c == '.'; c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() { - if c == '.' { - if gotrad != 0 { - break - } - rp = dc - gotrad = 1 - } else { - gotdig = 1 - if c > '9' { - d = c | 32 + 10 - 'a' - } else { - d = c - '0' - } - if dc < int64(8) { - x = x*uint32_t(16) + uint32_t(d) - } else if dc < int64(53/4+1) { - y = y + float64(d)*AssignDivFloat64(&scale, float64(16)) - } else if d != 0 && !(gottail != 0) { - y = y + 0.5*scale - gottail = 1 - } - dc++ - } - } - if !(gotdig != 0) { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if pok != 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if gotrad != 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } - } else { - X__shlim(tls, f, int64(0)) - } - return float64(sign) * 0.0 - } - if !(gotrad != 0) { - rp = dc - } - for dc < int64(8) { - x = x * uint32_t(16) - dc++ - } - if c|32 == 'p' { - e2 = scanexp(tls, f, pok) - if e2 == -0x7fffffffffffffff-int64(1) { - if pok != 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } else { - X__shlim(tls, f, int64(0)) - return float64(0) - } - e2 = int64(0) - } - } else { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } - e2 = e2 + (int64(4)*rp - int64(32)) - - if !(x != 0) { - return float64(sign) * 0.0 - } - if e2 > int64(-emin) { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - return float64(sign) * 1.79769313486231570815e+308 * 1.79769313486231570815e+308 - } - if e2 < int64(emin-2*53) { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - return float64(sign) * 2.22507385850720138309e-308 * 2.22507385850720138309e-308 - } - - for x < 0x80000000 { - if y >= 0.5 { - x = x + (x + uint32_t(1)) - y = y + (y - float64(1)) - } else { - x = x + x - y = y + y - } - e2-- - } - - if int64(bits) > int64(32)+e2-int64(emin) { - bits = int32(int64(32) + e2 - int64(emin)) - if bits < 0 { - bits = 0 - } - } - - if bits < 53 { - bias = Xcopysignl(tls, Xscalbn(tls, float64(1), 32+53-bits-1), float64(sign)) - } - - if bits < 32 && y != 0 && !(x&uint32_t(1) != 0) { - x++ - y = float64(0) - } - - y = bias + float64(sign)*float64(x) + float64(sign)*y - y = y - bias - - if !(y != 0) { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - } - - return Xscalbnl(tls, y, int32(e2)) -} - -func X__floatscan(tls *TLS, f uintptr, prec int32, pok int32) float64 { /* floatscan.c:427:13: */ - if __ccgo_strace { - trc("tls=%v f=%v prec=%v pok=%v, (%v:)", tls, f, prec, pok, origin(2)) - } - var sign int32 = 1 - var i size_t - var bits int32 - var emin int32 - var c int32 - - switch prec { - case 0: - bits = 24 - emin = -125 - bits - break - case 1: - bits = 53 - emin = -1021 - bits - break - case 2: - bits = 53 - emin = -1021 - bits - break - default: - return float64(0) - } - - for __isspace(tls, AssignInt32(&c, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }())) != 0 { - } - - if c == '+' || c == '-' { - sign = sign - 2*Bool32(c == '-') - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - } - - for i = uint64(0); i < uint64(8) && c|32 == int32(*(*int8)(unsafe.Pointer(ts /* "infinity" */ + uintptr(i)))); i++ { - if i < uint64(7) { - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - } - } - if i == uint64(3) || i == uint64(8) || i > uint64(3) && pok != 0 { - if i != uint64(8) { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if pok != 0 { - for ; i > uint64(3); i-- { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } - } - } - return float64(float32(sign) * X__builtin_inff(tls)) - } - if !(i != 0) { - for i = uint64(0); i < uint64(3) && c|32 == int32(*(*int8)(unsafe.Pointer(ts + 9 /* "nan" */ + uintptr(i)))); i++ { - if i < uint64(2) { - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - } - } - } - if i == uint64(3) { - if func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() != '(' { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - return float64(X__builtin_nanf(tls, ts+13)) - } - for i = uint64(1); ; i++ { - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - if uint32(c-'0') < 10 || uint32(c-'A') < 26 || uint32(c-'a') < 26 || c == '_' { - continue - } - if c == ')' { - return float64(X__builtin_nanf(tls, ts+13)) - } - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if !(pok != 0) { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 - X__shlim(tls, f, int64(0)) - return float64(0) - } - for PostDecUint64(&i, 1) != 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - } - return float64(X__builtin_nanf(tls, ts+13)) - } - return float64(X__builtin_nanf(tls, ts+13)) - } - - if i != 0 { - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 - X__shlim(tls, f, int64(0)) - return float64(0) - } - - if c == '0' { - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - if c|32 == 'x' { - return hexfloat(tls, f, bits, emin, sign, pok) - } - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - c = '0' - } - - return decfloat(tls, f, c, bits, emin, sign, pok) -} - -// Lookup table for digit values. -1==255>=36 -> invalid -var table1 = [257]uint8{Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - uint8(0), uint8(1), uint8(2), uint8(3), uint8(4), uint8(5), uint8(6), uint8(7), uint8(8), uint8(9), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), uint8(10), uint8(11), uint8(12), uint8(13), uint8(14), uint8(15), uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(21), uint8(22), uint8(23), uint8(24), - uint8(25), uint8(26), uint8(27), uint8(28), uint8(29), uint8(30), uint8(31), uint8(32), uint8(33), uint8(34), uint8(35), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), uint8(10), uint8(11), uint8(12), uint8(13), uint8(14), uint8(15), uint8(16), uint8(17), uint8(18), uint8(19), uint8(20), uint8(21), uint8(22), uint8(23), uint8(24), - uint8(25), uint8(26), uint8(27), uint8(28), uint8(29), uint8(30), uint8(31), uint8(32), uint8(33), uint8(34), uint8(35), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), - Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), Uint8FromInt32(-1), -} /* intscan.c:7:28 */ - -func X__intscan(tls *TLS, f uintptr, base uint32, pok int32, lim uint64) uint64 { /* intscan.c:26:20: */ - if __ccgo_strace { - trc("tls=%v f=%v base=%v pok=%v lim=%v, (%v:)", tls, f, base, pok, lim, origin(2)) - } - var val uintptr - var c int32 - var neg int32 - var x uint32 - var y uint64 - var bs int32 - val = uintptr(unsafe.Pointer(&table1)) + uintptr(1) - neg = 0 - if !(base > uint32(36) || base == uint32(1)) { - goto __1 - } - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 - return uint64(0) -__1: - ; -__2: - if !(__isspace(tls, AssignInt32(&c, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }())) != 0) { - goto __3 - } - goto __2 -__3: - ; - if !(c == '+' || c == '-') { - goto __4 - } - neg = -Bool32(c == '-') - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() -__4: - ; - if !((base == uint32(0) || base == uint32(16)) && c == '0') { - goto __5 - } - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - if !(c|32 == 'x') { - goto __7 - } - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - if !(int32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) >= 16) { - goto __9 - } - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if !(pok != 0) { - goto __10 - } - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - goto __11 -__10: - X__shlim(tls, f, int64(0)) -__11: - ; - return uint64(0) -__9: - ; - base = uint32(16) - goto __8 -__7: - if !(base == uint32(0)) { - goto __12 - } - base = uint32(8) -__12: - ; -__8: - ; - goto __6 -__5: - if !(base == uint32(0)) { - goto __13 - } - base = uint32(10) -__13: - ; - if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) >= base) { - goto __14 - } - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - X__shlim(tls, f, int64(0)) - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 22 - return uint64(0) -__14: - ; -__6: - ; - if !(base == uint32(10)) { - goto __15 - } - x = uint32(0) -__17: - if !(uint32(c-'0') < 10 && x <= 0xffffffff/uint32(10)-uint32(1)) { - goto __19 - } - x = x*uint32(10) + uint32(c-'0') - goto __18 -__18: - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - goto __17 - goto __19 -__19: - ; - y = uint64(x) -__20: - if !(uint32(c-'0') < 10 && y <= (2*uint64(0x7fffffffffffffff)+uint64(1))/uint64(10) && uint64(10)*y <= 2*uint64(0x7fffffffffffffff)+uint64(1)-uint64(c-'0')) { - goto __22 - } - y = y*uint64(10) + uint64(c-'0') - goto __21 -__21: - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() - goto __20 - goto __22 -__22: - ; - if !(uint32(c-'0') >= 10) { - goto __23 - } - goto done -__23: - ; - goto __16 -__15: - if !!(base&(base-uint32(1)) != 0) { - goto __24 - } - bs = int32(*(*int8)(unsafe.Pointer(ts + 14 + uintptr(uint32(0x17)*base>>5&uint32(7))))) - x = uint32(0) -__26: - if !(uint32(*(*uint8)(unsafe.Pointer(val + uintptr(c)))) < base && x <= 0xffffffff/uint32(32)) { - goto __28 - } - x = x<>bs) { - goto __31 - } - y = y<= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if !(y >= lim) { - goto __43 - } - if !(!(lim&uint64(1) != 0) && !(neg != 0)) { - goto __44 - } - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - return lim - uint64(1) - goto __45 -__44: - if !(y > lim) { - goto __46 - } - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 34 - return lim -__46: - ; -__45: - ; -__43: - ; - return y ^ uint64(neg) - uint64(neg) -} - -// The shcnt field stores the number of bytes read so far, offset by -// the value of buf-rpos at the last function call (__shlim or __shgetc), -// so that between calls the inline shcnt macro can add rpos-buf to get -// the actual count. - -func X__shlim(tls *TLS, f uintptr, lim off_t) { /* shgetc.c:8:6: */ - if __ccgo_strace { - trc("tls=%v f=%v lim=%v, (%v:)", tls, f, lim, origin(2)) - } - (*FILE)(unsafe.Pointer(f)).shlim = lim - (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf) - int64((*FILE)(unsafe.Pointer(f)).rpos)) / 1 - // If lim is nonzero, rend must be a valid pointer. - if lim != 0 && (int64((*FILE)(unsafe.Pointer(f)).rend)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 > lim { - (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rpos + uintptr(lim) - } else { - (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rend - } -} - -func X__shgetc(tls *TLS, f uintptr) int32 { /* shgetc.c:19:5: */ - if __ccgo_strace { - trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) - } - var c int32 - var cnt off_t = (*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 - if (*FILE)(unsafe.Pointer(f)).shlim != 0 && cnt >= (*FILE)(unsafe.Pointer(f)).shlim || AssignInt32(&c, X__uflow(tls, f)) < 0 { - (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 + cnt - (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rpos - (*FILE)(unsafe.Pointer(f)).shlim = int64(-1) - return -1 - } - cnt++ - if (*FILE)(unsafe.Pointer(f)).shlim != 0 && (int64((*FILE)(unsafe.Pointer(f)).rend)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 > (*FILE)(unsafe.Pointer(f)).shlim-cnt { - (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rpos + uintptr((*FILE)(unsafe.Pointer(f)).shlim-cnt) - } else { - (*FILE)(unsafe.Pointer(f)).shend = (*FILE)(unsafe.Pointer(f)).rend - } - (*FILE)(unsafe.Pointer(f)).shcnt = (int64((*FILE)(unsafe.Pointer(f)).buf)-int64((*FILE)(unsafe.Pointer(f)).rpos))/1 + cnt - if (*FILE)(unsafe.Pointer(f)).rpos <= (*FILE)(unsafe.Pointer(f)).buf { - *(*uint8)(unsafe.Pointer((*FILE)(unsafe.Pointer(f)).rpos + UintptrFromInt32(-1))) = uint8(c) - } - return c -} - -type lconv = struct { - decimal_point uintptr - thousands_sep uintptr - grouping uintptr - int_curr_symbol uintptr - currency_symbol uintptr - mon_decimal_point uintptr - mon_thousands_sep uintptr - mon_grouping uintptr - positive_sign uintptr - negative_sign uintptr - int_frac_digits int8 - frac_digits int8 - p_cs_precedes int8 - p_sep_by_space int8 - n_cs_precedes int8 - n_sep_by_space int8 - p_sign_posn int8 - n_sign_posn int8 - int_p_cs_precedes int8 - int_p_sep_by_space int8 - int_n_cs_precedes int8 - int_n_sep_by_space int8 - int_p_sign_posn int8 - int_n_sign_posn int8 - _ [2]byte -} /* locale.h:24:1 */ - -// Support signed or unsigned plain-char - -// Implementation choices... - -// Arbitrary numbers... - -// POSIX/SUS requirements follow. These numbers come directly -// from SUS and have nothing to do with the host system. - -var posix_lconv = lconv{decimal_point: ts + 23, thousands_sep: ts + 13, grouping: ts + 13, int_curr_symbol: ts + 13, currency_symbol: ts + 13, mon_decimal_point: ts + 13, mon_thousands_sep: ts + 13, mon_grouping: ts + 13, positive_sign: ts + 13, negative_sign: ts + 13, int_frac_digits: Int8FromInt32(255), frac_digits: Int8FromInt32(255), p_cs_precedes: Int8FromInt32(255), p_sep_by_space: Int8FromInt32(255), n_cs_precedes: Int8FromInt32(255), n_sep_by_space: Int8FromInt32(255), p_sign_posn: Int8FromInt32(255), n_sign_posn: Int8FromInt32(255), int_p_cs_precedes: Int8FromInt32(255), int_p_sep_by_space: Int8FromInt32(255), int_n_cs_precedes: Int8FromInt32(255), int_n_sep_by_space: Int8FromInt32(255), int_p_sign_posn: Int8FromInt32(255), int_n_sign_posn: Int8FromInt32(255)} /* localeconv.c:4:27 */ - -func Xlocaleconv(tls *TLS) uintptr { /* localeconv.c:31:14: */ - if __ccgo_strace { - trc("tls=%v, (%v:)", tls, origin(2)) - } - return uintptr(unsafe.Pointer(&posix_lconv)) -} - -func X__fpclassify(tls *TLS, x float64) int32 { /* __fpclassify.c:4:5: */ - if __ccgo_strace { - trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) - } - bp := tls.Alloc(8) - defer tls.Free(8) - - *(*struct{ f float64 })(unsafe.Pointer(bp)) = func() (r struct{ f float64 }) { - *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x - return r - }() - var e int32 = int32(*(*uint64_t)(unsafe.Pointer(bp)) >> 52 & uint64(0x7ff)) - if !(e != 0) { - if *(*uint64_t)(unsafe.Pointer(bp))<<1 != 0 { - return 3 - } - return 2 - } - if e == 0x7ff { - if *(*uint64_t)(unsafe.Pointer(bp))<<12 != 0 { - return 0 - } - return 1 - } - return 4 -} - -func X__fpclassifyf(tls *TLS, x float32) int32 { /* __fpclassifyf.c:4:5: */ - if __ccgo_strace { - trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) - } - bp := tls.Alloc(4) - defer tls.Free(4) - - *(*struct{ f float32 })(unsafe.Pointer(bp)) = func() (r struct{ f float32 }) { - *(*float32)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x - return r - }() - var e int32 = int32(*(*uint32_t)(unsafe.Pointer(bp)) >> 23 & uint32_t(0xff)) - if !(e != 0) { - if *(*uint32_t)(unsafe.Pointer(bp))<<1 != 0 { - return 3 - } - return 2 - } - if e == 0xff { - if *(*uint32_t)(unsafe.Pointer(bp))<<9 != 0 { - return 0 - } - return 1 - } - return 4 -} - -func X__fpclassifyl(tls *TLS, x float64) int32 { /* __fpclassifyl.c:4:5: */ - if __ccgo_strace { - trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) - } - return X__fpclassify(tls, x) -} - -func Xcopysignl(tls *TLS, x float64, y float64) float64 { /* copysignl.c:4:13: */ - if __ccgo_strace { - trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) - } - return Xcopysign(tls, x, y) -} - -func Xfabsl(tls *TLS, x float64) float64 { /* fabsl.c:3:13: */ - if __ccgo_strace { - trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) - } - return Xfabs(tls, x) -} - -func Xfmodl(tls *TLS, x float64, y float64) float64 { /* fmodl.c:4:13: */ - if __ccgo_strace { - trc("tls=%v x=%v y=%v, (%v:)", tls, x, y, origin(2)) - } - return Xfmod(tls, x, y) -} - -func Xnanf(tls *TLS, s uintptr) float32 { /* nanf.c:3:7: */ - if __ccgo_strace { - trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) - } - return X__builtin_nanf(tls, ts+13) -} - -var toint double_t = float64(float64(1)) / 2.22044604925031308085e-16 /* rint.c:10:23 */ - -func Xrint(tls *TLS, x float64) float64 { /* rint.c:12:8: */ - if __ccgo_strace { - trc("tls=%v x=%v, (%v:)", tls, x, origin(2)) - } - bp := tls.Alloc(8) - defer tls.Free(8) - - *(*struct{ f float64 })(unsafe.Pointer(bp)) = func() (r struct{ f float64 }) { - *(*float64)(unsafe.Pointer(uintptr(unsafe.Pointer(&r)) + 0)) = x - return r - }() - var e int32 = int32(*(*uint64_t)(unsafe.Pointer(bp)) >> 52 & uint64(0x7ff)) - var s int32 = int32(*(*uint64_t)(unsafe.Pointer(bp)) >> 63) - var y double_t - - if e >= 0x3ff+52 { - return x - } - if s != 0 { - y = x - toint + toint - } else { - y = x + toint - toint - } - if y == float64(0) { - if s != 0 { - return -Float64FromFloat64(0.0) - } - return float64(0) - } - return y -} - -func Xscalbn(tls *TLS, x float64, n int32) float64 { /* scalbn.c:4:8: */ - if __ccgo_strace { - trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) - } - bp := tls.Alloc(8) - defer tls.Free(8) - - // var u struct {f float64;} at bp, 8 - - var y double_t = x - - if n > 1023 { - y = y * 0x1p1023 - n = n - 1023 - if n > 1023 { - y = y * 0x1p1023 - n = n - 1023 - if n > 1023 { - n = 1023 - } - } - } else if n < -1022 { - // make sure final n < -53 to avoid double - // rounding in the subnormal range - y = y * (float64(0x1p-1022) * 0x1p53) - n = n + (1022 - 53) - if n < -1022 { - y = y * (float64(0x1p-1022) * 0x1p53) - n = n + (1022 - 53) - if n < -1022 { - n = -1022 - } - } - } - *(*uint64_t)(unsafe.Pointer(bp)) = uint64_t(0x3ff+n) << 52 - x = y * *(*float64)(unsafe.Pointer(bp)) - return x -} - -func Xscalbnl(tls *TLS, x float64, n int32) float64 { /* scalbnl.c:4:13: */ - if __ccgo_strace { - trc("tls=%v x=%v n=%v, (%v:)", tls, x, n, origin(2)) - } - return Xscalbn(tls, x, n) -} - -// Support signed or unsigned plain-char - -// Implementation choices... - -// Arbitrary numbers... - -// POSIX/SUS requirements follow. These numbers come directly -// from SUS and have nothing to do with the host system. - -type __locale_map = struct { - __map uintptr - map_size size_t - name [24]int8 - next uintptr -} /* alltypes.h:343:9 */ - -type tls_module = struct { - next uintptr - image uintptr - len size_t - size size_t - align size_t - offset size_t -} /* libc.h:14:1 */ - -type __libc = struct { - can_do_threads int8 - threaded int8 - secure int8 - need_locks int8 - threads_minus_1 int32 - auxv uintptr - tls_head uintptr - tls_size size_t - tls_align size_t - tls_cnt size_t - page_size size_t - global_locale struct{ cat [6]uintptr } -} /* libc.h:20:1 */ - -type time_t = int64 /* alltypes.h:85:16 */ - -type clockid_t = int32 /* alltypes.h:214:13 */ - -type timespec = struct { - tv_sec time_t - tv_nsec int64 -} /* alltypes.h:229:1 */ - -type pthread_t = uintptr /* alltypes.h:273:26 */ - -type pthread_once_t = int32 /* alltypes.h:279:13 */ - -type pthread_key_t = uint32 /* alltypes.h:284:18 */ - -type pthread_spinlock_t = int32 /* alltypes.h:289:13 */ - -type pthread_mutexattr_t = struct{ __attr uint32 } /* alltypes.h:294:37 */ - -type pthread_condattr_t = struct{ __attr uint32 } /* alltypes.h:299:37 */ - -type pthread_barrierattr_t = struct{ __attr uint32 } /* alltypes.h:304:37 */ - -type pthread_rwlockattr_t = struct{ __attr [2]uint32 } /* alltypes.h:309:40 */ - -type __sigset_t = struct{ __bits [16]uint64 } /* alltypes.h:349:9 */ - -type sigset_t = __sigset_t /* alltypes.h:349:71 */ - -type pthread_attr_t = struct { - __u struct { - _ [0]uint64 - __i [14]int32 - } -} /* alltypes.h:372:147 */ - -type pthread_mutex_t = struct { - __u struct { - _ [0]uint64 - __i [10]int32 - } -} /* alltypes.h:377:157 */ - -type pthread_cond_t = struct { - __u struct { - _ [0]uint64 - __i [12]int32 - } -} /* alltypes.h:387:112 */ - -type pthread_rwlock_t = struct { - __u struct { - _ [0]uint64 - __i [14]int32 - } -} /* alltypes.h:397:139 */ - -type pthread_barrier_t = struct { - __u struct { - _ [0]uint64 - __i [8]int32 - } -} /* alltypes.h:402:137 */ - -type sched_param = struct { - sched_priority int32 - __reserved1 int32 - __reserved2 [2]struct { - __reserved1 time_t - __reserved2 int64 - } - __reserved3 int32 - _ [4]byte -} /* sched.h:19:1 */ - -type timer_t = uintptr /* alltypes.h:209:14 */ - -type clock_t = int64 /* alltypes.h:219:14 */ - -type tm = struct { - tm_sec int32 - tm_min int32 - tm_hour int32 - tm_mday int32 - tm_mon int32 - tm_year int32 - tm_wday int32 - tm_yday int32 - tm_isdst int32 - _ [4]byte - tm_gmtoff int64 - tm_zone uintptr -} /* time.h:38:1 */ - -type itimerspec = struct { - it_interval struct { - tv_sec time_t - tv_nsec int64 - } - it_value struct { - tv_sec time_t - tv_nsec int64 - } -} /* time.h:80:1 */ - -type sigevent = struct { - sigev_value struct { - _ [0]uint64 - sival_int int32 - _ [4]byte - } - sigev_signo int32 - sigev_notify int32 - sigev_notify_function uintptr - sigev_notify_attributes uintptr - __pad [32]int8 -} /* time.h:107:1 */ - -type __ptcb = struct { - __f uintptr - __x uintptr - __next uintptr -} /* alltypes.h:273:9 */ - -type sigaltstack = struct { - ss_sp uintptr - ss_flags int32 - _ [4]byte - ss_size size_t -} /* signal.h:44:9 */ - -type stack_t = sigaltstack /* signal.h:44:28 */ - -type greg_t = int64 /* signal.h:59:19 */ -type gregset_t = [23]int64 /* signal.h:59:27 */ -type _fpstate = struct { - cwd uint16 - swd uint16 - ftw uint16 - fop uint16 - rip uint64 - rdp uint64 - mxcsr uint32 - mxcr_mask uint32 - _st [8]struct { - significand [4]uint16 - exponent uint16 - padding [3]uint16 - } - _xmm [16]struct{ element [4]uint32 } - padding [24]uint32 -} /* signal.h:60:9 */ - -type fpregset_t = uintptr /* signal.h:71:3 */ -type sigcontext = struct { - r8 uint64 - r9 uint64 - r10 uint64 - r11 uint64 - r12 uint64 - r13 uint64 - r14 uint64 - r15 uint64 - rdi uint64 - rsi uint64 - rbp uint64 - rbx uint64 - rdx uint64 - rax uint64 - rcx uint64 - rsp uint64 - rip uint64 - eflags uint64 - cs uint16 - gs uint16 - fs uint16 - __pad0 uint16 - err uint64 - trapno uint64 - oldmask uint64 - cr2 uint64 - fpstate uintptr - __reserved1 [8]uint64 -} /* signal.h:72:1 */ - -type mcontext_t = struct { - gregs gregset_t - fpregs fpregset_t - __reserved1 [8]uint64 -} /* signal.h:84:3 */ - -type __ucontext = struct { - uc_flags uint64 - uc_link uintptr - uc_stack stack_t - uc_mcontext mcontext_t - uc_sigmask sigset_t - __fpregs_mem [64]uint64 -} /* signal.h:97:9 */ - -type ucontext_t = __ucontext /* signal.h:104:3 */ - -type sigval = struct { - _ [0]uint64 - sival_int int32 - _ [4]byte -} /* time.h:107:1 */ - -type siginfo_t = struct { - si_signo int32 - si_errno int32 - si_code int32 - _ [4]byte - __si_fields struct { - _ [0]uint64 - __pad [112]int8 - } -} /* signal.h:145:3 */ - -type sigaction = struct { - __sa_handler struct{ sa_handler uintptr } - sa_mask sigset_t - sa_flags int32 - _ [4]byte - sa_restorer uintptr -} /* signal.h:167:1 */ - -type sig_t = uintptr /* signal.h:251:14 */ - -type sig_atomic_t = int32 /* signal.h:269:13 */ - -func a_cas(tls *TLS, p uintptr, t int32, s int32) int32 { /* atomic_arch.h:2:19: */ - panic(`arch/x86_64/atomic_arch.h:4:2: assembler statements not supported`) - return t -} - -func a_swap(tls *TLS, p uintptr, v int32) int32 { /* atomic_arch.h:20:19: */ - panic(`arch/x86_64/atomic_arch.h:22:2: assembler statements not supported`) - return v -} - -func a_or(tls *TLS, p uintptr, v int32) { /* atomic_arch.h:46:20: */ - panic(`arch/x86_64/atomic_arch.h:48:2: assembler statements not supported`) -} - -func a_or_64(tls *TLS, p uintptr, v uint64_t) { /* atomic_arch.h:62:20: */ - panic(`arch/x86_64/atomic_arch.h:64:2: assembler statements not supported`) -} - -func a_ctz_64(tls *TLS, x uint64_t) int32 { /* atomic_arch.h:112:19: */ - panic(`arch/x86_64/atomic_arch.h:114:2: assembler statements not supported`) - return int32(x) -} - -func a_ctz_32(tls *TLS, x uint32_t) int32 { /* atomic.h:256:19: */ - return int32(_sdebruijn328[x&-x*uint32_t(0x076be629)>>27]) -} - -var _sdebruijn328 = [32]int8{ - int8(0), int8(1), int8(23), int8(2), int8(29), int8(24), int8(19), int8(3), int8(30), int8(27), int8(25), int8(11), int8(20), int8(8), int8(4), int8(13), - int8(31), int8(22), int8(28), int8(18), int8(26), int8(10), int8(7), int8(12), int8(21), int8(17), int8(9), int8(6), int8(16), int8(5), int8(15), int8(14), -} /* atomic.h:261:20 */ - -type __timer = struct { - timerid int32 - _ [4]byte - thread pthread_t -} /* pthread_impl.h:64:1 */ - -func __pthread_self(tls *TLS) uintptr { /* pthread_arch.h:1:30: */ - var self uintptr - panic(`arch/x86_64/pthread_arch.h:4:2: assembler statements not supported`) - return self -} - -func __wake(tls *TLS, addr uintptr, cnt int32, priv int32) { /* pthread_impl.h:155:20: */ - if priv != 0 { - priv = 128 - } - if cnt < 0 { - cnt = 0x7fffffff - } - _ = Bool32(X__syscall3(tls, int64(202), int64(addr), int64(1|priv), int64(cnt)) != int64(-38) || X__syscall3(tls, int64(202), int64(addr), int64(1), int64(cnt)) != 0) -} - -func __futexwait(tls *TLS, addr uintptr, val int32, priv int32) { /* pthread_impl.h:162:20: */ - if priv != 0 { - priv = 128 - } - _ = Bool32(X__syscall4(tls, int64(202), int64(addr), int64(0|priv), int64(val), int64(0)) != int64(-38) || X__syscall4(tls, int64(202), int64(addr), int64(0), int64(val), int64(0)) != 0) -} - -var X__fsmu8 = [51]uint32_t{ - func() uint32 { - if 0x2 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x2) - }(), func() uint32 { - if 0x3 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x3) - }(), func() uint32 { - if 0x4 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x4) - }(), func() uint32 { - if 0x5 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x5) - }(), func() uint32 { - if 0x6 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x6) - }(), func() uint32 { - if 0x7 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x7) - }(), - func() uint32 { - if 0x8 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x8) - }(), func() uint32 { - if 0x9 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x9) - }(), func() uint32 { - if 0xa < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xa) - }(), func() uint32 { - if 0xb < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xb) - }(), func() uint32 { - if 0xc < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xc) - }(), func() uint32 { - if 0xd < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xd) - }(), func() uint32 { - if 0xe < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xe) - }(), func() uint32 { - if 0xf < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xf) - }(), - func() uint32 { - if 0x0+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x0+16) - }(), func() uint32 { - if 0x1+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x1+16) - }(), func() uint32 { - if 0x2+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x2+16) - }(), func() uint32 { - if 0x3+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x3+16) - }(), func() uint32 { - if 0x4+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x4+16) - }(), func() uint32 { - if 0x5+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x5+16) - }(), func() uint32 { - if 0x6+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x6+16) - }(), func() uint32 { - if 0x7+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x7+16) - }(), - func() uint32 { - if 0x8+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x8+16) - }(), func() uint32 { - if 0x9+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0x9+16) - }(), func() uint32 { - if 0xa+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xa+16) - }(), func() uint32 { - if 0xb+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xb+16) - }(), func() uint32 { - if 0xc+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xc+16) - }(), func() uint32 { - if 0xd+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xd+16) - }(), func() uint32 { - if 0xe+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xe+16) - }(), func() uint32 { - if 0xf+16 < 2 { - return Uint32FromInt32(-1) - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23 | uint32_t(0xf+16) - }(), - func() uint32 { - if 0x0 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x0 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x0), func() uint32 { - if 0x1 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x1 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x1), func() uint32 { - if 0x2 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x2 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x2), func() uint32 { - if 0x3 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x3 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x3), func() uint32 { - if 0x4 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x4 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x4), func() uint32 { - if 0x5 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x5 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x5), func() uint32 { - if 0x6 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x6 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x6), func() uint32 { - if 0x7 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x7 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x7), - func() uint32 { - if 0x8 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x8 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x8), func() uint32 { - if 0x9 == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0x9 == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0x9), func() uint32 { - if 0xa == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0xa == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0xa), func() uint32 { - if 0xb == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0xb == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0xb), func() uint32 { - if 0xc == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0xc == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0xc), func() uint32 { - if 0xd == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0xd == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0xd), func() uint32 { - if 0xe == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0xe == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0xe), func() uint32 { - if 0xf == 0 { - return func() uint32 { - if Int32(0xa0) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0xa0)) - }() << 23 - } - return func() uint32 { - if 0xf == 0xd { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xa0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(0xf), - func() uint32 { - if 0x0 >= 5 { - return uint32(0) - } - return func() uint32 { - if 0x0 == 0 { - return func() uint32 { - if Int32(0x90) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x90)) - }() << 23 - } - return func() uint32 { - if 0x0 == 4 { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0x90)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>12 | uint32_t(0x0), func() uint32 { - if 0x1 >= 5 { - return uint32(0) - } - return func() uint32 { - if 0x1 == 0 { - return func() uint32 { - if Int32(0x90) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x90)) - }() << 23 - } - return func() uint32 { - if 0x1 == 4 { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0x90)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>12 | uint32_t(0x1), func() uint32 { - if 0x2 >= 5 { - return uint32(0) - } - return func() uint32 { - if 0x2 == 0 { - return func() uint32 { - if Int32(0x90) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x90)) - }() << 23 - } - return func() uint32 { - if 0x2 == 4 { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0x90)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>12 | uint32_t(0x2), func() uint32 { - if 0x3 >= 5 { - return uint32(0) - } - return func() uint32 { - if 0x3 == 0 { - return func() uint32 { - if Int32(0x90) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x90)) - }() << 23 - } - return func() uint32 { - if 0x3 == 4 { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0x90)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>12 | uint32_t(0x3), func() uint32 { - if 0x4 >= 5 { - return uint32(0) - } - return func() uint32 { - if 0x4 == 0 { - return func() uint32 { - if Int32(0x90) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x90)) - }() << 23 - } - return func() uint32 { - if 0x4 == 4 { - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0x90)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - } - return func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }() << 23 - }() - }() - }() | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>6 | uint32_t(func() uint32 { - if Int32(0x80) == Int32(0x80) { - return Uint32(Uint32(0x40) - Uint32FromInt32(0xc0)) - } - return Uint32(Uint32(0) - Uint32FromInt32(0x80)) - }()<<23)>>12 | uint32_t(0x4), -} /* internal.c:18:16 */ - -type wint_t = uint32 /* alltypes.h:198:18 */ - -type wctype_t = uint64 /* alltypes.h:203:23 */ - -type __mbstate_t = struct { - __opaque1 uint32 - __opaque2 uint32 -} /* alltypes.h:337:9 */ - -type mbstate_t = __mbstate_t /* alltypes.h:337:63 */ - -func Xmbrtowc(tls *TLS, wc uintptr, src uintptr, n size_t, st uintptr) size_t { /* mbrtowc.c:6:8: */ - if __ccgo_strace { - trc("tls=%v wc=%v src=%v n=%v st=%v, (%v:)", tls, wc, src, n, st, origin(2)) - } - bp := tls.Alloc(4) - defer tls.Free(4) - - var c uint32 - var s uintptr - var N uint32 - // var dummy wchar_t at bp, 4 - s = src - N = uint32(n) - - if !!(st != 0) { - goto __1 - } - st = uintptr(unsafe.Pointer(&_sinternal_state)) -__1: - ; - c = *(*uint32)(unsafe.Pointer(st)) - - if !!(s != 0) { - goto __2 - } - if !(c != 0) { - goto __4 - } - goto ilseq -__4: - ; - return uint64(0) - goto __3 -__2: - if !!(wc != 0) { - goto __5 - } - wc = bp /* &dummy */ -__5: - ; -__3: - ; - - if !!(n != 0) { - goto __6 - } - return Uint64FromInt32(-2) -__6: - ; - if !!(c != 0) { - goto __7 - } - if !(int32(*(*uint8)(unsafe.Pointer(s))) < 0x80) { - goto __8 - } - return BoolUint64(!!(AssignPtrInt32(wc, wchar_t(*(*uint8)(unsafe.Pointer(s)))) != 0)) -__8: - ; - if !(func() int32 { - if !!(int32(*(*uintptr)(unsafe.Pointer((*__pthread)(unsafe.Pointer(__pthread_self(tls))).locale))) != 0) { - return 4 - } - return 1 - }() == 1) { - goto __9 - } - *(*wchar_t)(unsafe.Pointer(wc)) = 0xdfff & int32(int8(*(*uint8)(unsafe.Pointer(s)))) - return 1 -__9: - ; - if !(uint32(*(*uint8)(unsafe.Pointer(s)))-0xc2 > 0xf4-0xc2) { - goto __10 - } - goto ilseq -__10: - ; - c = X__fsmu8[uint32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))))-0xc2] - n-- -__7: - ; - - if !(n != 0) { - goto __11 - } - if !((int32(*(*uint8)(unsafe.Pointer(s)))>>3-0x10|(int32(*(*uint8)(unsafe.Pointer(s)))>>3+int32_t(c)>>26))&CplInt32(7) != 0) { - goto __12 - } - goto ilseq -__12: - ; -loop: - c = c<<6 | uint32(int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&s, 1))))-0x80) - n-- - if !!(c&(uint32(1)<<31) != 0) { - goto __13 - } - *(*uint32)(unsafe.Pointer(st)) = uint32(0) - *(*wchar_t)(unsafe.Pointer(wc)) = wchar_t(c) - return size_t(N) - n -__13: - ; - if !(n != 0) { - goto __14 - } - if !(uint32(*(*uint8)(unsafe.Pointer(s)))-0x80 >= uint32(0x40)) { - goto __15 - } - goto ilseq -__15: - ; - goto loop -__14: - ; -__11: - ; - - *(*uint32)(unsafe.Pointer(st)) = c - return Uint64FromInt32(-2) -ilseq: - *(*uint32)(unsafe.Pointer(st)) = uint32(0) - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 84 - return Uint64FromInt32(-1) -} - -var _sinternal_state uint32 /* mbrtowc.c:8:18: */ - -func Xmbsinit(tls *TLS, st uintptr) int32 { /* mbsinit.c:3:5: */ - if __ccgo_strace { - trc("tls=%v st=%v, (%v:)", tls, st, origin(2)) - } - return Bool32(!(st != 0) || !(int32(*(*uint32)(unsafe.Pointer(st))) != 0)) -} - -type imaxdiv_t = struct { - quot intmax_t - rem intmax_t -} /* inttypes.h:14:40 */ - -type socklen_t = uint32 /* alltypes.h:361:18 */ - -type sa_family_t = uint16 /* alltypes.h:366:24 */ - -type msghdr = struct { - msg_name uintptr - msg_namelen socklen_t - _ [4]byte - msg_iov uintptr - msg_iovlen int32 - __pad1 int32 - msg_control uintptr - msg_controllen socklen_t - __pad2 int32 - msg_flags int32 - _ [4]byte -} /* socket.h:22:1 */ - -type cmsghdr = struct { - cmsg_len socklen_t - __pad1 int32 - cmsg_level int32 - cmsg_type int32 -} /* socket.h:44:1 */ - -type linger = struct { - l_onoff int32 - l_linger int32 -} /* socket.h:74:1 */ - -type sockaddr = struct { - sa_family sa_family_t - sa_data [14]int8 -} /* socket.h:367:1 */ - -type sockaddr_storage = struct { - ss_family sa_family_t - __ss_padding [118]int8 - __ss_align uint64 -} /* socket.h:372:1 */ - -type in_port_t = uint16_t /* in.h:12:18 */ -type in_addr_t = uint32_t /* in.h:13:18 */ -type in_addr = struct{ s_addr in_addr_t } /* in.h:14:1 */ - -type sockaddr_in = struct { - sin_family sa_family_t - sin_port in_port_t - sin_addr struct{ s_addr in_addr_t } - sin_zero [8]uint8_t -} /* in.h:16:1 */ - -type in6_addr = struct { - __in6_union struct { - _ [0]uint32 - __s6_addr [16]uint8_t - } -} /* in.h:23:1 */ - -type sockaddr_in6 = struct { - sin6_family sa_family_t - sin6_port in_port_t - sin6_flowinfo uint32_t - sin6_addr struct { - __in6_union struct { - _ [0]uint32 - __s6_addr [16]uint8_t - } - } - sin6_scope_id uint32_t -} /* in.h:34:1 */ - -type ipv6_mreq = struct { - ipv6mr_multiaddr struct { - __in6_union struct { - _ [0]uint32 - __s6_addr [16]uint8_t - } - } - ipv6mr_interface uint32 -} /* in.h:42:1 */ - -type ip_opts = struct { - ip_dst struct{ s_addr in_addr_t } - ip_opts [40]int8 -} /* in.h:229:1 */ - -type ip_mreq = struct { - imr_multiaddr struct{ s_addr in_addr_t } - imr_interface struct{ s_addr in_addr_t } -} /* in.h:247:1 */ - -type ip_mreqn = struct { - imr_multiaddr struct{ s_addr in_addr_t } - imr_address struct{ s_addr in_addr_t } - imr_ifindex int32 -} /* in.h:252:1 */ - -type ip_mreq_source = struct { - imr_multiaddr struct{ s_addr in_addr_t } - imr_interface struct{ s_addr in_addr_t } - imr_sourceaddr struct{ s_addr in_addr_t } -} /* in.h:258:1 */ - -type ip_msfilter = struct { - imsf_multiaddr struct{ s_addr in_addr_t } - imsf_interface struct{ s_addr in_addr_t } - imsf_fmode uint32_t - imsf_numsrc uint32_t - imsf_slist [1]struct{ s_addr in_addr_t } -} /* in.h:264:1 */ - -type group_req = struct { - gr_interface uint32_t - _ [4]byte - gr_group struct { - ss_family sa_family_t - __ss_padding [118]int8 - __ss_align uint64 - } -} /* in.h:275:1 */ - -type group_source_req = struct { - gsr_interface uint32_t - _ [4]byte - gsr_group struct { - ss_family sa_family_t - __ss_padding [118]int8 - __ss_align uint64 - } - gsr_source struct { - ss_family sa_family_t - __ss_padding [118]int8 - __ss_align uint64 - } -} /* in.h:280:1 */ - -type group_filter = struct { - gf_interface uint32_t - _ [4]byte - gf_group struct { - ss_family sa_family_t - __ss_padding [118]int8 - __ss_align uint64 - } - gf_fmode uint32_t - gf_numsrc uint32_t - gf_slist [1]struct { - ss_family sa_family_t - __ss_padding [118]int8 - __ss_align uint64 - } -} /* in.h:286:1 */ - -type in_pktinfo = struct { - ipi_ifindex int32 - ipi_spec_dst struct{ s_addr in_addr_t } - ipi_addr struct{ s_addr in_addr_t } -} /* in.h:297:1 */ - -type in6_pktinfo = struct { - ipi6_addr struct { - __in6_union struct { - _ [0]uint32 - __s6_addr [16]uint8_t - } - } - ipi6_ifindex uint32 -} /* in.h:303:1 */ - -type ip6_mtuinfo = struct { - ip6m_addr struct { - sin6_family sa_family_t - sin6_port in_port_t - sin6_flowinfo uint32_t - sin6_addr struct { - __in6_union struct { - _ [0]uint32 - __s6_addr [16]uint8_t - } - } - sin6_scope_id uint32_t - } - ip6m_mtu uint32_t -} /* in.h:308:1 */ - -type addrinfo = struct { - ai_flags int32 - ai_family int32 - ai_socktype int32 - ai_protocol int32 - ai_addrlen socklen_t - _ [4]byte - ai_addr uintptr - ai_canonname uintptr - ai_next uintptr -} /* netdb.h:16:1 */ - -// Legacy functions follow (marked OBsolete in SUS) - -type netent = struct { - n_name uintptr - n_aliases uintptr - n_addrtype int32 - n_net uint32_t -} /* netdb.h:62:1 */ - -type hostent = struct { - h_name uintptr - h_aliases uintptr - h_addrtype int32 - h_length int32 - h_addr_list uintptr -} /* netdb.h:69:1 */ - -type servent = struct { - s_name uintptr - s_aliases uintptr - s_port int32 - _ [4]byte - s_proto uintptr -} /* netdb.h:78:1 */ - -type protoent = struct { - p_name uintptr - p_aliases uintptr - p_proto int32 - _ [4]byte -} /* netdb.h:85:1 */ - -type aibuf = struct { - ai struct { - ai_flags int32 - ai_family int32 - ai_socktype int32 - ai_protocol int32 - ai_addrlen socklen_t - _ [4]byte - ai_addr uintptr - ai_canonname uintptr - ai_next uintptr - } - sa struct { - sin struct { - sin_family sa_family_t - sin_port in_port_t - sin_addr struct{ s_addr in_addr_t } - sin_zero [8]uint8_t - } - _ [12]byte - } - lock [1]int32 - slot int16 - ref int16 - _ [4]byte -} /* lookup.h:10:1 */ - -type sa = struct { - sin struct { - sin_family sa_family_t - sin_port in_port_t - sin_addr struct{ s_addr in_addr_t } - sin_zero [8]uint8_t - } - _ [12]byte -} /* lookup.h:10:1 */ - -type address = struct { - family int32 - scopeid uint32 - addr [16]uint8_t - sortkey int32 -} /* lookup.h:20:1 */ - -type service = struct { - port uint16_t - proto uint8 - socktype uint8 -} /* lookup.h:27:1 */ - -type resolvconf = struct { - ns [3]struct { - family int32 - scopeid uint32 - addr [16]uint8_t - sortkey int32 - } - nns uint32 - attempts uint32 - ndots uint32 - timeout uint32 -} /* lookup.h:34:1 */ - -func Xfreeaddrinfo(tls *TLS, p uintptr) { /* freeaddrinfo.c:7:6: */ - if __ccgo_strace { - trc("tls=%v p=%v, (%v:)", tls, p, origin(2)) - } - var cnt size_t - cnt = uint64(1) -__1: - if !((*addrinfo)(unsafe.Pointer(p)).ai_next != 0) { - goto __3 - } - goto __2 -__2: - cnt++ - p = (*addrinfo)(unsafe.Pointer(p)).ai_next - goto __1 - goto __3 -__3: - ; - var b uintptr = p - uintptr(uint64(uintptr(0))) - b -= 88 * uintptr((*aibuf)(unsafe.Pointer(b)).slot) - //TODO LOCK(b->lock); - if !(int32(AssignSubPtrInt16(b+82, int16(cnt))) != 0) { - Xfree(tls, b) - } - //TODO else UNLOCK(b->lock); -} - -func Xgetaddrinfo(tls *TLS, host uintptr, serv uintptr, hint uintptr, res uintptr) int32 { /* getaddrinfo.c:12:5: */ - if __ccgo_strace { - trc("tls=%v host=%v serv=%v hint=%v res=%v, (%v:)", tls, host, serv, hint, res, origin(2)) - } - bp := tls.Alloc(1608) - defer tls.Free(1608) - - // var ports [2]service at bp, 8 - - // var addrs [48]address at bp+8, 1344 - - // var canon [256]int8 at bp+1352, 256 - - var outcanon uintptr - var nservs int32 - var naddrs int32 - var nais int32 - var canon_len int32 - var i int32 - var j int32 - var k int32 - var family int32 = 0 - var flags int32 = 0 - var proto int32 = 0 - var socktype int32 = 0 - var out uintptr - - if !(host != 0) && !(serv != 0) { - return -2 - } - - if hint != 0 { - family = (*addrinfo)(unsafe.Pointer(hint)).ai_family - flags = (*addrinfo)(unsafe.Pointer(hint)).ai_flags - proto = (*addrinfo)(unsafe.Pointer(hint)).ai_protocol - socktype = (*addrinfo)(unsafe.Pointer(hint)).ai_socktype - - var mask int32 = 0x01 | 0x02 | 0x04 | 0x08 | 0x10 | 0x20 | 0x400 - if flags&mask != flags { - return -1 - } - - switch family { - case 2: - fallthrough - case 10: - fallthrough - case 0: - break - fallthrough - default: - return -6 - } - } - - if flags&0x20 != 0 { - Xabort(tls) //TODO- - // /* Define the "an address is configured" condition for address - // * families via ability to create a socket for the family plus - // * routability of the loopback address for the family. */ - // static const struct sockaddr_in lo4 = { - // .sin_family = AF_INET, .sin_port = 65535, - // .sin_addr.s_addr = __BYTE_ORDER == __BIG_ENDIAN - // ? 0x7f000001 : 0x0100007f - // }; - // static const struct sockaddr_in6 lo6 = { - // .sin6_family = AF_INET6, .sin6_port = 65535, - // .sin6_addr = IN6ADDR_LOOPBACK_INIT - // }; - // int tf[2] = { AF_INET, AF_INET6 }; - // const void *ta[2] = { &lo4, &lo6 }; - // socklen_t tl[2] = { sizeof lo4, sizeof lo6 }; - // for (i=0; i<2; i++) { - // if (family==tf[1-i]) continue; - // int s = socket(tf[i], SOCK_CLOEXEC|SOCK_DGRAM, - // IPPROTO_UDP); - // if (s>=0) { - // int cs; - // pthread_setcancelstate( - // PTHREAD_CANCEL_DISABLE, &cs); - // int r = connect(s, ta[i], tl[i]); - // pthread_setcancelstate(cs, 0); - // close(s); - // if (!r) continue; - // } - // switch (errno) { - // case EADDRNOTAVAIL: - // case EAFNOSUPPORT: - // case EHOSTUNREACH: - // case ENETDOWN: - // case ENETUNREACH: - // break; - // default: - // return EAI_SYSTEM; - // } - // if (family == tf[i]) return EAI_NONAME; - // family = tf[1-i]; - // } - } - - nservs = X__lookup_serv(tls, bp, serv, proto, socktype, flags) - if nservs < 0 { - return nservs - } - - naddrs = X__lookup_name(tls, bp+8, bp+1352, host, family, flags) - if naddrs < 0 { - return naddrs - } - - nais = nservs * naddrs - canon_len = int32(Xstrlen(tls, bp+1352)) - out = Xcalloc(tls, uint64(1), uint64(nais)*uint64(unsafe.Sizeof(aibuf{}))+uint64(canon_len)+uint64(1)) - if !(out != 0) { - return -10 - } - - if canon_len != 0 { - outcanon = out + uintptr(nais)*88 - Xmemcpy(tls, outcanon, bp+1352, uint64(canon_len+1)) - } else { - outcanon = uintptr(0) - } - - for k = AssignInt32(&i, 0); i < naddrs; i++ { - j = 0 - __1: - if !(j < nservs) { - goto __3 - } - { - (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).slot = int16(k) - //TODO out[k].ai = (struct addrinfo){ - //TODO .ai_family = addrs[i].family, - //TODO .ai_socktype = ports[j].socktype, - //TODO .ai_protocol = ports[j].proto, - //TODO .ai_addrlen = addrs[i].family == AF_INET - //TODO ? sizeof(struct sockaddr_in) - //TODO : sizeof(struct sockaddr_in6), - //TODO .ai_addr = (void *)&out[k].sa, - //TODO .ai_canonname = outcanon }; - (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_family = (*address)(unsafe.Pointer(bp + 8 + uintptr(i)*28)).family - (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_socktype = int32((*service)(unsafe.Pointer(bp + uintptr(j)*4)).socktype) - (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_protocol = int32((*service)(unsafe.Pointer(bp + uintptr(j)*4)).proto) - (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_addrlen = func() uint32 { - if (*address)(unsafe.Pointer(bp+8+uintptr(i)*28)).family == 2 { - return uint32(unsafe.Sizeof(sockaddr_in{})) - } - return uint32(unsafe.Sizeof(sockaddr_in6{})) - }() - (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_addr = out + uintptr(k)*88 + 48 - (*aibuf)(unsafe.Pointer(out + uintptr(k)*88)).ai.ai_canonname = outcanon - if k != 0 { - (*aibuf)(unsafe.Pointer(out + uintptr(k-1)*88)).ai.ai_next = out + uintptr(k)*88 - } - switch (*address)(unsafe.Pointer(bp + 8 + uintptr(i)*28)).family { - case 2: - (*sockaddr_in)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin_family = sa_family_t(2) - (*sockaddr_in)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin_port = Xhtons(tls, (*service)(unsafe.Pointer(bp+uintptr(j)*4)).port) - Xmemcpy(tls, out+uintptr(k)*88+48+4, bp+8+uintptr(i)*28+8, uint64(4)) - break - case 10: - (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin6_family = sa_family_t(10) - (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin6_port = Xhtons(tls, (*service)(unsafe.Pointer(bp+uintptr(j)*4)).port) - (*sockaddr_in6)(unsafe.Pointer(out + uintptr(k)*88 + 48)).sin6_scope_id = (*address)(unsafe.Pointer(bp + 8 + uintptr(i)*28)).scopeid - Xmemcpy(tls, out+uintptr(k)*88+48+8, bp+8+uintptr(i)*28+8, uint64(16)) - break - } - - } - goto __2 - __2: - j++ - k++ - goto __1 - goto __3 - __3: - } - (*aibuf)(unsafe.Pointer(out)).ref = int16(nais) - *(*uintptr)(unsafe.Pointer(res)) = out - return 0 -} - -type ucred = struct { - pid pid_t - uid uid_t - gid gid_t -} /* socket.h:57:1 */ - -type mmsghdr = struct { - msg_hdr struct { - msg_name uintptr - msg_namelen socklen_t - _ [4]byte - msg_iov uintptr - msg_iovlen int32 - __pad1 int32 - msg_control uintptr - msg_controllen socklen_t - __pad2 int32 - msg_flags int32 - _ [4]byte - } - msg_len uint32 - _ [4]byte -} /* socket.h:63:1 */ - -func Xgethostbyaddr(tls *TLS, a uintptr, l socklen_t, af int32) uintptr { /* gethostbyaddr.c:7:16: */ - if __ccgo_strace { - trc("tls=%v a=%v l=%v af=%v, (%v:)", tls, a, l, af, origin(2)) - } - bp := tls.Alloc(8) - defer tls.Free(8) - - var size size_t = uint64(63) - // var res uintptr at bp, 8 - - var err int32 - for __ccgo := true; __ccgo; __ccgo = err == 34 { - Xfree(tls, _sh) - _sh = Xmalloc(tls, AssignAddUint64(&size, size+uint64(1))) - if !(_sh != 0) { - *(*int32)(unsafe.Pointer(X__h_errno_location(tls))) = 3 - return uintptr(0) - } - err = Xgethostbyaddr_r(tls, a, l, af, _sh, - _sh+uintptr(1)*32, size-size_t(unsafe.Sizeof(hostent{})), bp, X__h_errno_location(tls)) - } - if err != 0 { - return uintptr(0) - } - return _sh -} - -var _sh uintptr /* gethostbyaddr.c:9:24: */ - -func Xgethostbyaddr_r(tls *TLS, a uintptr, l socklen_t, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyaddr_r.c:10:5: */ - if __ccgo_strace { - trc("tls=%v a=%v l=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, a, l, af, h, buf, buflen, res, err, origin(2)) - } - bp := tls.Alloc(28) - defer tls.Free(28) - - //TODO union { - //TODO struct sockaddr_in sin; - //TODO struct sockaddr_in6 sin6; - //TODO } sa = { .sin.sin_family = af }; - *(*struct { - sin sockaddr_in - _ [12]byte - })(unsafe.Pointer(bp)) = struct { - sin sockaddr_in - _ [12]byte - }{} //TODO- - (*sockaddr_in)(unsafe.Pointer(bp)).sin_family = sa_family_t(af) //TODO- - var sl socklen_t - if af == 10 { - sl = uint32(unsafe.Sizeof(sockaddr_in6{})) - } else { - sl = uint32(unsafe.Sizeof(sockaddr_in{})) - } - var i int32 - - *(*uintptr)(unsafe.Pointer(res)) = uintptr(0) - - // Load address argument into sockaddr structure - if af == 10 && l == socklen_t(16) { - Xmemcpy(tls, bp+8, a, uint64(16)) - } else if af == 2 && l == socklen_t(4) { - Xmemcpy(tls, bp+4, a, uint64(4)) - } else { - *(*int32)(unsafe.Pointer(err)) = 3 - return 22 - } - - // Align buffer and check for space for pointers and ip address - i = int32(uintptr_t(buf) & (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1))) - if !(i != 0) { - i = int32(unsafe.Sizeof(uintptr(0))) - } - if buflen <= uint64(5)*uint64(unsafe.Sizeof(uintptr(0)))-uint64(i)+uint64(l) { - return 34 - } - buf += uintptr(uint64(unsafe.Sizeof(uintptr(0))) - uint64(i)) - buflen = buflen - (uint64(5)*uint64(unsafe.Sizeof(uintptr(0))) - uint64(i) + uint64(l)) - - (*hostent)(unsafe.Pointer(h)).h_addr_list = buf - buf += uintptr(uint64(2) * uint64(unsafe.Sizeof(uintptr(0)))) - (*hostent)(unsafe.Pointer(h)).h_aliases = buf - buf += uintptr(uint64(2) * uint64(unsafe.Sizeof(uintptr(0)))) - - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list)) = buf - Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list)), a, uint64(l)) - buf += uintptr(l) - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + 1*8)) = uintptr(0) - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases)) = buf - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = uintptr(0) - - switch Xgetnameinfo(tls, bp, sl, buf, uint32(buflen), uintptr(0), uint32(0), 0) { - case -3: - *(*int32)(unsafe.Pointer(err)) = 2 - return 11 - case -12: - return 34 - default: - fallthrough - case -10: - fallthrough - case -11: - fallthrough - case -4: - *(*int32)(unsafe.Pointer(err)) = 3 - return *(*int32)(unsafe.Pointer(X___errno_location(tls))) - case 0: - break - } - - (*hostent)(unsafe.Pointer(h)).h_addrtype = af - (*hostent)(unsafe.Pointer(h)).h_length = int32(l) - (*hostent)(unsafe.Pointer(h)).h_name = *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases)) - *(*uintptr)(unsafe.Pointer(res)) = h - return 0 -} - -func Xgethostbyname(tls *TLS, name uintptr) uintptr { /* gethostbyname.c:8:16: */ - if __ccgo_strace { - trc("tls=%v name=%v, (%v:)", tls, name, origin(2)) - } - return Xgethostbyname2(tls, name, 2) -} - -func Xgethostbyname2(tls *TLS, name uintptr, af int32) uintptr { /* gethostbyname2.c:8:16: */ - if __ccgo_strace { - trc("tls=%v name=%v af=%v, (%v:)", tls, name, af, origin(2)) - } - bp := tls.Alloc(8) - defer tls.Free(8) - - var size size_t = uint64(63) - // var res uintptr at bp, 8 - - var err int32 - for __ccgo := true; __ccgo; __ccgo = err == 34 { - Xfree(tls, _sh1) - _sh1 = Xmalloc(tls, AssignAddUint64(&size, size+uint64(1))) - if !(_sh1 != 0) { - *(*int32)(unsafe.Pointer(X__h_errno_location(tls))) = 3 - return uintptr(0) - } - err = Xgethostbyname2_r(tls, name, af, _sh1, - _sh1+uintptr(1)*32, size-size_t(unsafe.Sizeof(hostent{})), bp, X__h_errno_location(tls)) - } - if err != 0 { - return uintptr(0) - } - return _sh1 -} - -var _sh1 uintptr /* gethostbyname2.c:10:24: */ - -func Xgethostbyname2_r(tls *TLS, name uintptr, af int32, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname2_r.c:11:5: */ - if __ccgo_strace { - trc("tls=%v name=%v af=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, af, h, buf, buflen, res, err, origin(2)) - } - bp := tls.Alloc(1600) - defer tls.Free(1600) - - // var addrs [48]address at bp, 1344 - - // var canon [256]int8 at bp+1344, 256 - - var i int32 - var cnt int32 - var align size_t - var need size_t - - *(*uintptr)(unsafe.Pointer(res)) = uintptr(0) - cnt = X__lookup_name(tls, bp, bp+1344, name, af, 0x02) - if cnt < 0 { - switch cnt { - case -2: - *(*int32)(unsafe.Pointer(err)) = 1 - return 2 - fallthrough - case -3: - *(*int32)(unsafe.Pointer(err)) = 2 - return 11 - fallthrough - default: - fallthrough - case -4: - *(*int32)(unsafe.Pointer(err)) = 3 - return 74 - fallthrough - case -10: - fallthrough - case -11: - *(*int32)(unsafe.Pointer(err)) = 3 - return *(*int32)(unsafe.Pointer(X___errno_location(tls))) - } - } - - (*hostent)(unsafe.Pointer(h)).h_addrtype = af - (*hostent)(unsafe.Pointer(h)).h_length = func() int32 { - if af == 10 { - return 16 - } - return 4 - }() - - // Align buffer - align = -uintptr_t(buf) & (uint64(unsafe.Sizeof(uintptr(0))) - uint64(1)) - - need = uint64(4) * uint64(unsafe.Sizeof(uintptr(0))) - need = need + uint64(cnt+1)*(uint64(unsafe.Sizeof(uintptr(0)))+uint64((*hostent)(unsafe.Pointer(h)).h_length)) - need = need + (Xstrlen(tls, name) + uint64(1)) - need = need + (Xstrlen(tls, bp+1344) + uint64(1)) - need = need + align - - if need > buflen { - return 34 - } - - buf += uintptr(align) - (*hostent)(unsafe.Pointer(h)).h_aliases = buf - buf += uintptr(uint64(3) * uint64(unsafe.Sizeof(uintptr(0)))) - (*hostent)(unsafe.Pointer(h)).h_addr_list = buf - buf += uintptr(uint64(cnt+1) * uint64(unsafe.Sizeof(uintptr(0)))) - - for i = 0; i < cnt; i++ { - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)) = buf - buf += uintptr((*hostent)(unsafe.Pointer(h)).h_length) - Xmemcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)), bp+uintptr(i)*28+8, uint64((*hostent)(unsafe.Pointer(h)).h_length)) - } - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_addr_list + uintptr(i)*8)) = uintptr(0) - - (*hostent)(unsafe.Pointer(h)).h_name = AssignPtrUintptr((*hostent)(unsafe.Pointer(h)).h_aliases, buf) - Xstrcpy(tls, (*hostent)(unsafe.Pointer(h)).h_name, bp+1344) - buf += uintptr(Xstrlen(tls, (*hostent)(unsafe.Pointer(h)).h_name) + uint64(1)) - - if Xstrcmp(tls, (*hostent)(unsafe.Pointer(h)).h_name, name) != 0 { - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = buf - Xstrcpy(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)), name) - buf += uintptr(Xstrlen(tls, *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8))) + uint64(1)) - } else { - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 1*8)) = uintptr(0) - } - - *(*uintptr)(unsafe.Pointer((*hostent)(unsafe.Pointer(h)).h_aliases + 2*8)) = uintptr(0) - - *(*uintptr)(unsafe.Pointer(res)) = h - return 0 -} - -func Xgethostbyname_r(tls *TLS, name uintptr, h uintptr, buf uintptr, buflen size_t, res uintptr, err uintptr) int32 { /* gethostbyname_r.c:6:5: */ - if __ccgo_strace { - trc("tls=%v name=%v h=%v buf=%v buflen=%v res=%v err=%v, (%v:)", tls, name, h, buf, buflen, res, err, origin(2)) - } - return Xgethostbyname2_r(tls, name, 2, h, buf, buflen, res, err) -} - -type if_nameindex = struct { - if_index uint32 - _ [4]byte - if_name uintptr -} /* if.h:12:1 */ - -type ifaddr = struct { - ifa_addr struct { - sa_family sa_family_t - sa_data [14]int8 - } - ifa_ifu struct { - ifu_broadaddr struct { - sa_family sa_family_t - sa_data [14]int8 - } - } - ifa_ifp uintptr - ifa_next uintptr -} /* if.h:51:1 */ - -type ifmap = struct { - mem_start uint64 - mem_end uint64 - base_addr uint16 - irq uint8 - dma uint8 - port uint8 - _ [3]byte -} /* if.h:64:1 */ - -type ifreq = struct { - ifr_ifrn struct{ ifrn_name [16]int8 } - ifr_ifru struct { - _ [0]uint64 - ifru_addr struct { - sa_family sa_family_t - sa_data [14]int8 - } - _ [8]byte - } -} /* if.h:76:1 */ - -type ifconf = struct { - ifc_len int32 - _ [4]byte - ifc_ifcu struct{ ifcu_buf uintptr } -} /* if.h:116:1 */ - -type ns_sect = uint32 /* nameser.h:37:3 */ - -type __ns_msg = struct { - _msg uintptr - _eom uintptr - _id uint16_t - _flags uint16_t - _counts [4]uint16_t - _ [4]byte - _sections [4]uintptr - _sect ns_sect - _rrnum int32 - _msg_ptr uintptr -} /* nameser.h:39:9 */ - -type ns_msg = __ns_msg /* nameser.h:46:3 */ - -type _ns_flagdata = struct { - mask int32 - shift int32 -} /* nameser.h:48:1 */ - -type __ns_rr = struct { - name [1025]int8 - _ [1]byte - __type uint16_t - rr_class uint16_t - _ [2]byte - ttl uint32_t - rdlength uint16_t - _ [2]byte - rdata uintptr -} /* nameser.h:59:9 */ - -type ns_rr = __ns_rr /* nameser.h:66:3 */ - -type ns_flag = uint32 /* nameser.h:87:3 */ - -type ns_opcode = uint32 /* nameser.h:96:3 */ - -type ns_rcode = uint32 /* nameser.h:115:3 */ - -type ns_update_operation = uint32 /* nameser.h:121:3 */ - -type ns_tsig_key1 = struct { - name [1025]int8 - alg [1025]int8 - _ [6]byte - data uintptr - len int32 - _ [4]byte -} /* nameser.h:123:1 */ - -type ns_tsig_key = ns_tsig_key1 /* nameser.h:128:28 */ - -type ns_tcp_tsig_state1 = struct { - counter int32 - _ [4]byte - key uintptr - ctx uintptr - sig [512]uint8 - siglen int32 - _ [4]byte -} /* nameser.h:130:1 */ - -type ns_tcp_tsig_state = ns_tcp_tsig_state1 /* nameser.h:137:34 */ - -type ns_type = uint32 /* nameser.h:200:3 */ - -type ns_class = uint32 /* nameser.h:219:3 */ - -type ns_key_types = uint32 /* nameser.h:226:3 */ - -type ns_cert_types = uint32 /* nameser.h:234:3 */ - -type HEADER = struct { - _ [0]uint32 - id uint32 /* unsigned id: 16, unsigned rd: 1, unsigned tc: 1, unsigned aa: 1, unsigned opcode: 4, unsigned qr: 1, unsigned rcode: 4, unsigned cd: 1, unsigned ad: 1, unsigned unused: 1, unsigned ra: 1 */ - qdcount uint32 /* unsigned qdcount: 16, unsigned ancount: 16 */ - nscount uint32 /* unsigned nscount: 16, unsigned arcount: 16 */ -} /* nameser.h:353:3 */ - -// unused; purely for broken apps -type __res_state = struct { - retrans int32 - retry int32 - options uint64 - nscount int32 - nsaddr_list [3]struct { - sin_family sa_family_t - sin_port in_port_t - sin_addr struct{ s_addr in_addr_t } - sin_zero [8]uint8_t - } - id uint16 - _ [2]byte - dnsrch [7]uintptr - defdname [256]int8 - pfcode uint64 - ndots uint32 /* unsigned ndots: 4, unsigned nsort: 4, unsigned ipv6_unavail: 1, unsigned unused: 23 */ - _ [4]byte - sort_list [10]struct { - addr struct{ s_addr in_addr_t } - mask uint32_t - } - qhook uintptr - rhook uintptr - res_h_errno int32 - _vcsock int32 - _flags uint32 - _ [4]byte - _u struct { - _ [0]uint64 - pad [52]int8 - _ [4]byte - } -} /* resolv.h:26:9 */ - -// unused; purely for broken apps -type res_state = uintptr /* resolv.h:62:3 */ - -type res_sym = struct { - number int32 - _ [4]byte - name uintptr - humanname uintptr -} /* resolv.h:70:1 */ - -func itoa(tls *TLS, p uintptr, x uint32) uintptr { /* getnameinfo.c:18:13: */ - p += uintptr(uint64(3) * uint64(unsafe.Sizeof(int32(0)))) - *(*int8)(unsafe.Pointer(PreDecUintptr(&p, 1))) = int8(0) - for __ccgo := true; __ccgo; __ccgo = x != 0 { - *(*int8)(unsafe.Pointer(PreDecUintptr(&p, 1))) = int8(uint32('0') + x%uint32(10)) - x = x / uint32(10) - } - return p -} - -func mkptr4(tls *TLS, s uintptr, ip uintptr) { /* getnameinfo.c:28:13: */ - bp := tls.Alloc(32) - defer tls.Free(32) - - Xsprintf(tls, s, ts+25, - VaList(bp, int32(*(*uint8)(unsafe.Pointer(ip + 3))), int32(*(*uint8)(unsafe.Pointer(ip + 2))), int32(*(*uint8)(unsafe.Pointer(ip + 1))), int32(*(*uint8)(unsafe.Pointer(ip))))) -} - -func mkptr6(tls *TLS, s uintptr, ip uintptr) { /* getnameinfo.c:34:13: */ - var i int32 - for i = 15; i >= 0; i-- { - *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = _sxdigits[int32(*(*uint8)(unsafe.Pointer(ip + uintptr(i))))&15] - *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8('.') - *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = _sxdigits[int32(*(*uint8)(unsafe.Pointer(ip + uintptr(i))))>>4] - *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) = int8('.') - } - Xstrcpy(tls, s, ts+50) -} - -var _sxdigits = *(*[17]int8)(unsafe.Pointer(ts + 59)) /* getnameinfo.c:36:20 */ - -func reverse_hosts(tls *TLS, buf uintptr, a uintptr, scopeid uint32, family int32) { /* getnameinfo.c:45:13: */ - bp := tls.Alloc(556) - defer tls.Free(556) - - // var line [512]int8 at bp+16, 512 - - var p uintptr - var z uintptr - var _buf [1032]uint8 - _ = _buf - // var atmp [16]uint8 at bp, 16 - - // var iplit address at bp+528, 28 - - //TODO FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf); - var f uintptr = Xfopen(tls, ts+76, ts+87) - if !(f != 0) { - return - } - if family == 2 { - Xmemcpy(tls, bp+uintptr(12), a, uint64(4)) - Xmemcpy(tls, bp, ts+90, uint64(12)) - a = bp /* &atmp[0] */ - } - for Xfgets(tls, bp+16, int32(unsafe.Sizeof([512]int8{})), f) != 0 { - if AssignUintptr(&p, Xstrchr(tls, bp+16, '#')) != 0 { - *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8('\n') - *(*int8)(unsafe.Pointer(p)) = int8(0) - } - - for p = bp + 16; /* &line[0] */ *(*int8)(unsafe.Pointer(p)) != 0 && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0); p++ { - } - *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8(0) - if X__lookup_ipliteral(tls, bp+528, bp+16, 0) <= 0 { - continue - } - - if (*address)(unsafe.Pointer(bp+528)).family == 2 { - Xmemcpy(tls, bp+528+8+uintptr(12), bp+528+8, uint64(4)) - Xmemcpy(tls, bp+528+8, ts+90, uint64(12)) - (*address)(unsafe.Pointer(bp + 528 /* &iplit */)).scopeid = uint32(0) - } - - if Xmemcmp(tls, a, bp+528+8, uint64(16)) != 0 || (*address)(unsafe.Pointer(bp+528)).scopeid != scopeid { - continue - } - - for ; *(*int8)(unsafe.Pointer(p)) != 0 && __isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0; p++ { - } - for z = p; *(*int8)(unsafe.Pointer(z)) != 0 && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(z)))) != 0); z++ { - } - *(*int8)(unsafe.Pointer(z)) = int8(0) - if (int64(z)-int64(p))/1 < int64(256) { - Xmemcpy(tls, buf, p, uint64((int64(z)-int64(p))/1+int64(1))) - break - } - } - //TODO __fclose_ca(f); - Xfclose(tls, f) -} - -func reverse_services(tls *TLS, buf uintptr, port int32, dgram int32) { /* getnameinfo.c:87:13: */ - Xabort(tls) //TODO- - // unsigned long svport; - // char line[128], *p, *z; - // unsigned char _buf[1032]; - // FILE _f, *f = __fopen_rb_ca("/etc/services", &_f, _buf, sizeof _buf); - // if (!f) return; - // while (fgets(line, sizeof line, f)) { - // if ((p=strchr(line, '#'))) *p++='\n', *p=0; - - // for (p=line; *p && !isspace(*p); p++); - // if (!*p) continue; - // *p++ = 0; - // svport = strtoul(p, &z, 10); - - // if (svport != port || z==p) continue; - // if (dgram && strncmp(z, "/udp", 4)) continue; - // if (!dgram && strncmp(z, "/tcp", 4)) continue; - // if (p-line > 32) continue; - - // memcpy(buf, line, p-line); - // break; - // } - // __fclose_ca(f); -} - -func Xgetnameinfo(tls *TLS, sa1 uintptr, sl socklen_t, node uintptr, nodelen socklen_t, serv uintptr, servlen socklen_t, flags int32) int32 { /* getnameinfo.c:125:5: */ - if __ccgo_strace { - trc("tls=%v sa1=%v sl=%v node=%v nodelen=%v serv=%v servlen=%v flags=%v, (%v:)", tls, sa1, sl, node, nodelen, serv, servlen, flags, origin(2)) - } - bp := tls.Alloc(347) - defer tls.Free(347) - - // var ptr [78]int8 at bp, 78 - - // var buf [256]int8 at bp+78, 256 - - // var num [13]int8 at bp+334, 13 - - var af int32 = int32((*sockaddr)(unsafe.Pointer(sa1)).sa_family) - var a uintptr - var scopeid uint32 - - switch af { - case 2: - a = sa1 + 4 - if uint64(sl) < uint64(unsafe.Sizeof(sockaddr_in{})) { - return -6 - } - mkptr4(tls, bp, a) - scopeid = uint32(0) - break - case 10: - a = sa1 + 8 - if uint64(sl) < uint64(unsafe.Sizeof(sockaddr_in6{})) { - return -6 - } - if Xmemcmp(tls, a, ts+90, uint64(12)) != 0 { - mkptr6(tls, bp, a) - } else { - mkptr4(tls, bp, a+uintptr(12)) - } - scopeid = (*sockaddr_in6)(unsafe.Pointer(sa1)).sin6_scope_id - break - default: - return -6 - } - - if node != 0 && nodelen != 0 { - *(*int8)(unsafe.Pointer(bp + 78)) = int8(0) - if !(flags&0x01 != 0) { - reverse_hosts(tls, bp+78, a, scopeid, af) - } - if !(int32(*(*int8)(unsafe.Pointer(bp + 78))) != 0) && !(flags&0x01 != 0) { - Xabort(tls) //TODO- - // unsigned char query[18+PTR_MAX], reply[512]; - // int qlen = __res_mkquery(0, ptr, 1, RR_PTR, - // 0, 0, 0, query, sizeof query); - // query[3] = 0; /* don't need AD flag */ - // int rlen = __res_send(query, qlen, reply, sizeof reply); - // buf[0] = 0; - // if (rlen > 0) - // __dns_parse(reply, rlen, dns_parse_callback, buf); - } - if !(int32(*(*int8)(unsafe.Pointer(bp + 78))) != 0) { - if flags&0x08 != 0 { - return -2 - } - Xinet_ntop(tls, af, a, bp+78, uint32(unsafe.Sizeof([256]int8{}))) - if scopeid != 0 { - Xabort(tls) //TODO- - // char *p = 0, tmp[IF_NAMESIZE+1]; - // if (!(flags & NI_NUMERICSCOPE) && - // (IN6_IS_ADDR_LINKLOCAL(a) || - // IN6_IS_ADDR_MC_LINKLOCAL(a))) - // p = if_indextoname(scopeid, tmp+1); - // if (!p) - // p = itoa(num, scopeid); - // *--p = '%'; - // strcat(buf, p); - } - } - if Xstrlen(tls, bp+78) >= size_t(nodelen) { - return -12 - } - Xstrcpy(tls, node, bp+78) - } - - if serv != 0 && servlen != 0 { - var p uintptr = bp + 78 /* buf */ - var port int32 = int32(Xntohs(tls, (*sockaddr_in)(unsafe.Pointer(sa1)).sin_port)) - *(*int8)(unsafe.Pointer(bp + 78)) = int8(0) - if !(flags&0x02 != 0) { - reverse_services(tls, bp+78, port, flags&0x10) - } - if !(int32(*(*int8)(unsafe.Pointer(p))) != 0) { - p = itoa(tls, bp+334, uint32(port)) - } - if Xstrlen(tls, p) >= size_t(servlen) { - return -12 - } - Xstrcpy(tls, serv, p) - } - - return 0 -} - -var Xh_errno int32 /* h_errno.c:4:5: */ - -func X__h_errno_location(tls *TLS) uintptr { /* h_errno.c:6:5: */ - if __ccgo_strace { - trc("tls=%v, (%v:)", tls, origin(2)) - } - return uintptr(unsafe.Pointer(&Xh_errno)) -} - -func X__inet_aton(tls *TLS, s0 uintptr, dest uintptr) int32 { /* inet_aton.c:7:5: */ - if __ccgo_strace { - trc("tls=%v s0=%v dest=%v, (%v:)", tls, s0, dest, origin(2)) - } - bp := tls.Alloc(40) - defer tls.Free(40) - - var s uintptr = s0 - var d uintptr = dest - *(*[4]uint64)(unsafe.Pointer(bp /* a */)) = [4]uint64{0: uint64(0)} - // var z uintptr at bp+32, 8 - - var i int32 - - for i = 0; i < 4; i++ { - *(*uint64)(unsafe.Pointer(bp + uintptr(i)*8)) = Xstrtoul(tls, s, bp+32, 0) - if *(*uintptr)(unsafe.Pointer(bp + 32)) == s || *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32)))) != 0 && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))))) != '.' || !(func() int32 { - if 0 != 0 { - return Xisdigit(tls, int32(*(*int8)(unsafe.Pointer(s)))) - } - return Bool32(uint32(*(*int8)(unsafe.Pointer(s)))-uint32('0') < uint32(10)) - }() != 0) { - return 0 - } - if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 32))))) != 0) { - break - } - s = *(*uintptr)(unsafe.Pointer(bp + 32)) + uintptr(1) - } - if i == 4 { - return 0 - } - switch i { - case 0: - *(*uint64)(unsafe.Pointer(bp + 1*8)) = *(*uint64)(unsafe.Pointer(bp)) & uint64(0xffffff) - AssignShrPtrUint64(bp, int(24)) - fallthrough - case 1: - *(*uint64)(unsafe.Pointer(bp + 2*8)) = *(*uint64)(unsafe.Pointer(bp + 1*8)) & uint64(0xffff) - AssignShrPtrUint64(bp+1*8, int(16)) - fallthrough - case 2: - *(*uint64)(unsafe.Pointer(bp + 3*8)) = *(*uint64)(unsafe.Pointer(bp + 2*8)) & uint64(0xff) - AssignShrPtrUint64(bp+2*8, int(8)) - } - for i = 0; i < 4; i++ { - if *(*uint64)(unsafe.Pointer(bp + uintptr(i)*8)) > uint64(255) { - return 0 - } - *(*uint8)(unsafe.Pointer(d + uintptr(i))) = uint8(*(*uint64)(unsafe.Pointer(bp + uintptr(i)*8))) - } - return 1 -} - -func Xinet_ntop(tls *TLS, af int32, a0 uintptr, s uintptr, l socklen_t) uintptr { /* inet_ntop.c:7:12: */ - if __ccgo_strace { - trc("tls=%v af=%v a0=%v s=%v l=%v, (%v:)", tls, af, a0, s, l, origin(2)) - } - bp := tls.Alloc(276) - defer tls.Free(276) - - var a uintptr = a0 - var i int32 - var j int32 - var max int32 - var best int32 - // var buf [100]int8 at bp+176, 100 - - switch af { - case 2: - if socklen_t(Xsnprintf(tls, s, uint64(l), ts+103, VaList(bp, int32(*(*uint8)(unsafe.Pointer(a))), int32(*(*uint8)(unsafe.Pointer(a + 1))), int32(*(*uint8)(unsafe.Pointer(a + 2))), int32(*(*uint8)(unsafe.Pointer(a + 3)))))) < l { - return s - } - break - case 10: - if Xmemcmp(tls, a, ts+90, uint64(12)) != 0 { - Xsnprintf(tls, bp+176, uint64(unsafe.Sizeof([100]int8{})), - ts+115, - VaList(bp+32, 256*int32(*(*uint8)(unsafe.Pointer(a)))+int32(*(*uint8)(unsafe.Pointer(a + 1))), 256*int32(*(*uint8)(unsafe.Pointer(a + 2)))+int32(*(*uint8)(unsafe.Pointer(a + 3))), - 256*int32(*(*uint8)(unsafe.Pointer(a + 4)))+int32(*(*uint8)(unsafe.Pointer(a + 5))), 256*int32(*(*uint8)(unsafe.Pointer(a + 6)))+int32(*(*uint8)(unsafe.Pointer(a + 7))), - 256*int32(*(*uint8)(unsafe.Pointer(a + 8)))+int32(*(*uint8)(unsafe.Pointer(a + 9))), 256*int32(*(*uint8)(unsafe.Pointer(a + 10)))+int32(*(*uint8)(unsafe.Pointer(a + 11))), - 256*int32(*(*uint8)(unsafe.Pointer(a + 12)))+int32(*(*uint8)(unsafe.Pointer(a + 13))), 256*int32(*(*uint8)(unsafe.Pointer(a + 14)))+int32(*(*uint8)(unsafe.Pointer(a + 15))))) - } else { - Xsnprintf(tls, bp+176, uint64(unsafe.Sizeof([100]int8{})), - ts+139, - VaList(bp+96, 256*int32(*(*uint8)(unsafe.Pointer(a)))+int32(*(*uint8)(unsafe.Pointer(a + 1))), 256*int32(*(*uint8)(unsafe.Pointer(a + 2)))+int32(*(*uint8)(unsafe.Pointer(a + 3))), - 256*int32(*(*uint8)(unsafe.Pointer(a + 4)))+int32(*(*uint8)(unsafe.Pointer(a + 5))), 256*int32(*(*uint8)(unsafe.Pointer(a + 6)))+int32(*(*uint8)(unsafe.Pointer(a + 7))), - 256*int32(*(*uint8)(unsafe.Pointer(a + 8)))+int32(*(*uint8)(unsafe.Pointer(a + 9))), 256*int32(*(*uint8)(unsafe.Pointer(a + 10)))+int32(*(*uint8)(unsafe.Pointer(a + 11))), - int32(*(*uint8)(unsafe.Pointer(a + 12))), int32(*(*uint8)(unsafe.Pointer(a + 13))), int32(*(*uint8)(unsafe.Pointer(a + 14))), int32(*(*uint8)(unsafe.Pointer(a + 15))))) - } - // Replace longest /(^0|:)[:0]{2,}/ with "::" - i = AssignInt32(&best, 0) - max = 2 - for ; *(*int8)(unsafe.Pointer(bp + 176 + uintptr(i))) != 0; i++ { - if i != 0 && int32(*(*int8)(unsafe.Pointer(bp + 176 + uintptr(i)))) != ':' { - continue - } - j = int32(Xstrspn(tls, bp+176+uintptr(i), ts+169)) - if j > max { - best = i - max = j - } - } - if max > 3 { - *(*int8)(unsafe.Pointer(bp + 176 + uintptr(best))) = AssignPtrInt8(bp+176+uintptr(best+1), int8(':')) - Xmemmove(tls, bp+176+uintptr(best)+uintptr(2), bp+176+uintptr(best)+uintptr(max), uint64(i-best-max+1)) - } - if Xstrlen(tls, bp+176) < size_t(l) { - Xstrcpy(tls, s, bp+176) - return s - } - break - default: - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 97 - return uintptr(0) - } - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 28 - return uintptr(0) -} - -func hexval(tls *TLS, c uint32) int32 { /* inet_pton.c:7:12: */ - if c-uint32('0') < uint32(10) { - return int32(c - uint32('0')) - } - c = c | uint32(32) - if c-uint32('a') < uint32(6) { - return int32(c - uint32('a') + uint32(10)) - } - return -1 -} - -func Xinet_pton(tls *TLS, af int32, s uintptr, a0 uintptr) int32 { /* inet_pton.c:15:5: */ - if __ccgo_strace { - trc("tls=%v af=%v s=%v a0=%v, (%v:)", tls, af, s, a0, origin(2)) - } - bp := tls.Alloc(16) - defer tls.Free(16) - - // var ip [8]uint16_t at bp, 16 - - var a uintptr = a0 - var i int32 - var j int32 - var v int32 - var d int32 - var brk int32 = -1 - var need_v4 int32 = 0 - - if af == 2 { - for i = 0; i < 4; i++ { - for v = AssignInt32(&j, 0); j < 3 && func() int32 { - if 0 != 0 { - return Xisdigit(tls, int32(*(*int8)(unsafe.Pointer(s + uintptr(j))))) - } - return Bool32(uint32(*(*int8)(unsafe.Pointer(s + uintptr(j))))-uint32('0') < uint32(10)) - }() != 0; j++ { - v = 10*v + int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) - '0' - } - if j == 0 || j > 1 && int32(*(*int8)(unsafe.Pointer(s))) == '0' || v > 255 { - return 0 - } - *(*uint8)(unsafe.Pointer(a + uintptr(i))) = uint8(v) - if int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) == 0 && i == 3 { - return 1 - } - if int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != '.' { - return 0 - } - s += uintptr(j + 1) - } - return 0 - } else if af != 10 { - *(*int32)(unsafe.Pointer(X___errno_location(tls))) = 97 - return -1 - } - - if int32(*(*int8)(unsafe.Pointer(s))) == ':' && int32(*(*int8)(unsafe.Pointer(PreIncUintptr(&s, 1)))) != ':' { - return 0 - } - - for i = 0; ; i++ { - if int32(*(*int8)(unsafe.Pointer(s))) == ':' && brk < 0 { - brk = i - *(*uint16_t)(unsafe.Pointer(bp + uintptr(i&7)*2)) = uint16_t(0) - if !(int32(*(*int8)(unsafe.Pointer(PreIncUintptr(&s, 1)))) != 0) { - break - } - if i == 7 { - return 0 - } - continue - } - for v = AssignInt32(&j, 0); j < 4 && AssignInt32(&d, hexval(tls, uint32(*(*int8)(unsafe.Pointer(s + uintptr(j)))))) >= 0; j++ { - v = 16*v + d - } - if j == 0 { - return 0 - } - *(*uint16_t)(unsafe.Pointer(bp + uintptr(i&7)*2)) = uint16_t(v) - if !(int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != 0) && (brk >= 0 || i == 7) { - break - } - if i == 7 { - return 0 - } - if int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != ':' { - if int32(*(*int8)(unsafe.Pointer(s + uintptr(j)))) != '.' || i < 6 && brk < 0 { - return 0 - } - need_v4 = 1 - i++ - break - } - s += uintptr(j + 1) - } - if brk >= 0 { - Xmemmove(tls, bp+uintptr(brk)*2+uintptr(7)*2-uintptr(i)*2, bp+uintptr(brk)*2, uint64(2*(i+1-brk))) - for j = 0; j < 7-i; j++ { - *(*uint16_t)(unsafe.Pointer(bp + uintptr(brk+j)*2)) = uint16_t(0) - } - } - for j = 0; j < 8; j++ { - *(*uint8)(unsafe.Pointer(PostIncUintptr(&a, 1))) = uint8(int32(*(*uint16_t)(unsafe.Pointer(bp + uintptr(j)*2))) >> 8) - *(*uint8)(unsafe.Pointer(PostIncUintptr(&a, 1))) = uint8(*(*uint16_t)(unsafe.Pointer(bp + uintptr(j)*2))) - } - if need_v4 != 0 && Xinet_pton(tls, 2, s, a-uintptr(4)) <= 0 { - return 0 - } - return 1 -} - -func X__lookup_ipliteral(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_ipliteral.c:12:5: */ - if __ccgo_strace { - trc("tls=%v buf=%v name=%v family=%v, (%v:)", tls, buf, name, family, origin(2)) - } - bp := tls.Alloc(96) - defer tls.Free(96) - - // var a4 in_addr at bp, 4 - - // var a6 in6_addr at bp+68, 16 - - if X__inet_aton(tls, name, bp) > 0 { - if family == 10 { // wrong family - return -2 - } - Xmemcpy(tls, buf+8, bp, uint64(unsafe.Sizeof(in_addr{}))) - (*address)(unsafe.Pointer(buf)).family = 2 - (*address)(unsafe.Pointer(buf)).scopeid = uint32(0) - return 1 - } - // var tmp [64]int8 at bp+4, 64 - - var p uintptr = Xstrchr(tls, name, '%') - // var z uintptr at bp+88, 8 - - var scopeid uint64 = uint64(0) - if p != 0 && (int64(p)-int64(name))/1 < int64(64) { - Xmemcpy(tls, bp+4, name, uint64((int64(p)-int64(name))/1)) - *(*int8)(unsafe.Pointer(bp + 4 + uintptr((int64(p)-int64(name))/1))) = int8(0) - name = bp + 4 /* &tmp[0] */ - } - - if Xinet_pton(tls, 10, name, bp+68) <= 0 { - return 0 - } - if family == 2 { // wrong family - return -2 - } - - Xmemcpy(tls, buf+8, bp+68, uint64(unsafe.Sizeof(in6_addr{}))) - (*address)(unsafe.Pointer(buf)).family = 10 - if p != 0 { - if func() int32 { - if 0 != 0 { - return Xisdigit(tls, int32(*(*int8)(unsafe.Pointer(PreIncUintptr(&p, 1))))) - } - return Bool32(uint32(*(*int8)(unsafe.Pointer(PreIncUintptr(&p, 1))))-uint32('0') < uint32(10)) - }() != 0 { - scopeid = Xstrtoull(tls, p, bp+88, 10) - } else { - *(*uintptr)(unsafe.Pointer(bp + 88 /* z */)) = p - uintptr(1) - } - if *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 88)))) != 0 { - Xabort(tls) //TODO- - // if (!IN6_IS_ADDR_LINKLOCAL(&a6) && - // !IN6_IS_ADDR_MC_LINKLOCAL(&a6)) - // return EAI_NONAME; - // scopeid = if_nametoindex(p); - // if (!scopeid) return EAI_NONAME; - } - if scopeid > uint64(0xffffffff) { - return -2 - } - } - (*address)(unsafe.Pointer(buf)).scopeid = uint32(scopeid) - return 1 -} - -func is_valid_hostname(tls *TLS, host uintptr) int32 { /* lookup_name.c:18:12: */ - var s uintptr - //TODO if (strnlen(host, 255)-1 >= 254 || mbstowcs(0, host, 0) == -1) return 0; - if Xstrnlen(tls, host, uint64(255))-uint64(1) >= uint64(254) { - return 0 - } - for s = host; int32(*(*uint8)(unsafe.Pointer(s))) >= 0x80 || int32(*(*uint8)(unsafe.Pointer(s))) == '.' || int32(*(*uint8)(unsafe.Pointer(s))) == '-' || Xisalnum(tls, int32(*(*uint8)(unsafe.Pointer(s)))) != 0; s++ { - } - return BoolInt32(!(*(*uint8)(unsafe.Pointer(s)) != 0)) -} - -var Xzero_struct_address address /* lookup_name.c:27:16: */ - -func name_from_null(tls *TLS, buf uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:29:12: */ - var cnt int32 = 0 - if name != 0 { - return 0 - } - if flags&0x01 != 0 { - //TODO if (family != AF_INET6) - //TODO buf[cnt++] = (struct address){ .family = AF_INET }; - if family != 10 { - var x = Xzero_struct_address - x.family = 2 - *(*address)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*28)) = x - } - //TODO if (family != AF_INET) - //TODO buf[cnt++] = (struct address){ .family = AF_INET6 }; - if family != 2 { - var x = Xzero_struct_address - x.family = 10 - *(*address)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*28)) = x - } - } else { - Xabort(tls) //TODO- - // if (family != AF_INET6) - // buf[cnt++] = (struct address){ .family = AF_INET, .addr = { 127,0,0,1 } }; - // if (family != AF_INET) - // buf[cnt++] = (struct address){ .family = AF_INET6, .addr = { [15] = 1 } }; - } - return cnt -} - -func name_from_numeric(tls *TLS, buf uintptr, name uintptr, family int32) int32 { /* lookup_name.c:58:12: */ - return X__lookup_ipliteral(tls, buf, name, family) -} - -func name_from_hosts(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32) int32 { /* lookup_name.c:63:12: */ - bp := tls.Alloc(512) - defer tls.Free(512) - - // var line [512]int8 at bp, 512 - - var l size_t = Xstrlen(tls, name) - var cnt int32 = 0 - var badfam int32 = 0 - var _buf [1032]uint8 - _ = _buf - //TODO FILE _f, *f = __fopen_rb_ca("/etc/hosts", &_f, _buf, sizeof _buf); - var _f FILE - _ = _f - var f uintptr = Xfopen(tls, ts+76, ts+87) - if !(f != 0) { - switch *(*int32)(unsafe.Pointer(X___errno_location(tls))) { - case 2: - fallthrough - case 20: - fallthrough - case 13: - return 0 - fallthrough - default: - return -11 - } - } - for Xfgets(tls, bp, int32(unsafe.Sizeof([512]int8{})), f) != 0 && cnt < 48 { - var p uintptr - var z uintptr - - if AssignUintptr(&p, Xstrchr(tls, bp, '#')) != 0 { - *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8('\n') - *(*int8)(unsafe.Pointer(p)) = int8(0) - } - for p = bp + uintptr(1); AssignUintptr(&p, Xstrstr(tls, p, name)) != 0 && (!(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p + UintptrFromInt32(-1))))) != 0) || !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p + uintptr(l))))) != 0)); p++ { - } - if !(p != 0) { - continue - } - - // Isolate IP address to parse - for p = bp; /* &line[0] */ *(*int8)(unsafe.Pointer(p)) != 0 && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0); p++ { - } - *(*int8)(unsafe.Pointer(PostIncUintptr(&p, 1))) = int8(0) - switch name_from_numeric(tls, buf+uintptr(cnt)*28, bp, family) { - case 1: - cnt++ - break - case 0: - continue - default: - badfam = -2 - continue - } - - // Extract first name as canonical name - for ; *(*int8)(unsafe.Pointer(p)) != 0 && __isspace(tls, int32(*(*int8)(unsafe.Pointer(p)))) != 0; p++ { - } - for z = p; *(*int8)(unsafe.Pointer(z)) != 0 && !(__isspace(tls, int32(*(*int8)(unsafe.Pointer(z)))) != 0); z++ { - } - *(*int8)(unsafe.Pointer(z)) = int8(0) - if is_valid_hostname(tls, p) != 0 { - Xmemcpy(tls, canon, p, uint64((int64(z)-int64(p))/1+int64(1))) - } - } - //TODO __fclose_ca(f); - Xfclose(tls, f) - if cnt != 0 { - return cnt - } - return badfam -} - -type dpc_ctx = struct { - addrs uintptr - canon uintptr - cnt int32 - _ [4]byte -} /* lookup_name.c:112:1 */ - -func name_from_dns_search(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32) int32 { /* lookup_name.c:191:12: */ - return -1 //TODO- - Xabort(tls) - return int32(0) //TODO- - // char search[256]; - // struct resolvconf conf; - // size_t l, dots; - // char *p, *z; - - // if (__get_resolv_conf(&conf, search, sizeof search) < 0) return -1; - - // /* Count dots, suppress search when >=ndots or name ends in - // * a dot, which is an explicit request for global scope. */ - // for (dots=l=0; name[l]; l++) if (name[l]=='.') dots++; - // if (dots >= conf.ndots || name[l-1]=='.') *search = 0; - - // /* Strip final dot for canon, fail if multiple trailing dots. */ - // if (name[l-1]=='.') l--; - // if (!l || name[l-1]=='.') return EAI_NONAME; - - // /* This can never happen; the caller already checked length. */ - // if (l >= 256) return EAI_NONAME; - - // /* Name with search domain appended is setup in canon[]. This both - // * provides the desired default canonical name (if the requested - // * name is not a CNAME record) and serves as a buffer for passing - // * the full requested name to name_from_dns. */ - // memcpy(canon, name, l); - // canon[l] = '.'; - - // for (p=search; *p; p=z) { - // for (; isspace(*p); p++); - // for (z=p; *z && !isspace(*z); z++); - // if (z==p) break; - // if (z-p < 256 - l - 1) { - // memcpy(canon+l+1, p, z-p); - // canon[z-p+1+l] = 0; - // int cnt = name_from_dns(buf, canon, canon, family, &conf); - // if (cnt) return cnt; - // } - // } - - // canon[l] = 0; - // return name_from_dns(buf, canon, name, family, &conf); -} - -type policy = struct { - addr [16]uint8 - len uint8 - mask uint8 - prec uint8 - label uint8 -} /* lookup_name.c:237:14 */ - -var defpolicy = [6]policy{ - {addr: *(*[16]uint8)(unsafe.Pointer(ts + 172)), len: uint8(15), mask: uint8(0xff), prec: uint8(50)}, - {addr: *(*[16]uint8)(unsafe.Pointer(ts + 189)), len: uint8(11), mask: uint8(0xff), prec: uint8(35), label: uint8(4)}, - {addr: *(*[16]uint8)(unsafe.Pointer(ts + 205)), len: uint8(1), mask: uint8(0xff), prec: uint8(30), label: uint8(2)}, - {addr: *(*[16]uint8)(unsafe.Pointer(ts + 221)), len: uint8(3), mask: uint8(0xff), prec: uint8(5), label: uint8(5)}, - {addr: *(*[16]uint8)(unsafe.Pointer(ts + 237)), mask: uint8(0xfe), prec: uint8(3), label: uint8(13)}, - // Last rule must match all addresses to stop loop. - {addr: *(*[16]uint8)(unsafe.Pointer(ts + 253)), prec: uint8(40), label: uint8(1)}, -} /* lookup_name.c:241:3 */ - -func policyof(tls *TLS, a uintptr) uintptr { /* lookup_name.c:259:28: */ - var i int32 - for i = 0; ; i++ { - if Xmemcmp(tls, a, uintptr(unsafe.Pointer(&defpolicy))+uintptr(i)*20, uint64(defpolicy[i].len)) != 0 { - continue - } - if int32(*(*uint8_t)(unsafe.Pointer(a + uintptr(defpolicy[i].len))))&int32(defpolicy[i].mask) != - int32(*(*uint8)(unsafe.Pointer(uintptr(unsafe.Pointer(&defpolicy)) + uintptr(i)*20 + uintptr(defpolicy[i].len)))) { - continue - } - return uintptr(unsafe.Pointer(&defpolicy)) + uintptr(i)*20 - } - return uintptr(0) -} - -func labelof(tls *TLS, a uintptr) int32 { /* lookup_name.c:272:12: */ - return int32((*policy)(unsafe.Pointer(policyof(tls, a))).label) -} - -func scopeof(tls *TLS, a uintptr) int32 { /* lookup_name.c:277:12: */ - if int32(*(*uint8_t)(unsafe.Pointer(a))) == 0xff { - return int32(*(*uint8_t)(unsafe.Pointer(a + 1))) & 15 - } - if int32(*(*uint8_t)(unsafe.Pointer(a))) == 0xfe && int32(*(*uint8_t)(unsafe.Pointer(a + 1)))&0xc0 == 0x80 { - return 2 - } - if *(*uint32_t)(unsafe.Pointer(a)) == uint32_t(0) && *(*uint32_t)(unsafe.Pointer(a + 1*4)) == uint32_t(0) && *(*uint32_t)(unsafe.Pointer(a + 2*4)) == uint32_t(0) && int32(*(*uint8_t)(unsafe.Pointer(a + 12))) == 0 && int32(*(*uint8_t)(unsafe.Pointer(a + 13))) == 0 && int32(*(*uint8_t)(unsafe.Pointer(a + 14))) == 0 && int32(*(*uint8_t)(unsafe.Pointer(a + 15))) == 1 { - return 2 - } - if int32(*(*uint8_t)(unsafe.Pointer(a))) == 0xfe && int32(*(*uint8_t)(unsafe.Pointer(a + 1)))&0xc0 == 0xc0 { - return 5 - } - return 14 -} - -func prefixmatch(tls *TLS, s uintptr, d uintptr) int32 { /* lookup_name.c:286:12: */ - // FIXME: The common prefix length should be limited to no greater - // than the nominal length of the prefix portion of the source - // address. However the definition of the source prefix length is - // not clear and thus this limiting is not yet implemented. - var i uint32 - for i = uint32(0); i < uint32(128) && !((int32(*(*uint8_t)(unsafe.Pointer(s /* &.__in6_union */ /* &.__s6_addr */ + uintptr(i/uint32(8)))))^int32(*(*uint8_t)(unsafe.Pointer(d /* &.__in6_union */ /* &.__s6_addr */ + uintptr(i/uint32(8))))))&(int32(128)>>(i%uint32(8))) != 0); i++ { - } - return int32(i) -} - -func addrcmp(tls *TLS, _a uintptr, _b uintptr) int32 { /* lookup_name.c:305:12: */ - var a uintptr = _a - var b uintptr = _b - return (*address)(unsafe.Pointer(b)).sortkey - (*address)(unsafe.Pointer(a)).sortkey -} - -func X__lookup_name(tls *TLS, buf uintptr, canon uintptr, name uintptr, family int32, flags int32) int32 { /* lookup_name.c:311:5: */ - if __ccgo_strace { - trc("tls=%v buf=%v canon=%v name=%v family=%v flags=%v, (%v:)", tls, buf, canon, name, family, flags, origin(2)) - } - bp := tls.Alloc(92) - defer tls.Free(92) - - var cnt int32 = 0 - var i int32 - var j int32 - _ = j - - *(*int8)(unsafe.Pointer(canon)) = int8(0) - if name != 0 { - // reject empty name and check len so it fits into temp bufs - var l size_t = Xstrnlen(tls, name, uint64(255)) - if l-uint64(1) >= uint64(254) { - return -2 - } - Xmemcpy(tls, canon, name, l+uint64(1)) - } - - // Procedurally, a request for v6 addresses with the v4-mapped - // flag set is like a request for unspecified family, followed - // by filtering of the results. - if flags&0x08 != 0 { - if family == 10 { - family = 0 - } else { - flags = flags - 0x08 - } - } - - // Try each backend until there's at least one result. - cnt = name_from_null(tls, buf, name, family, flags) - if !(cnt != 0) { - cnt = name_from_numeric(tls, buf, name, family) - } - if !(cnt != 0) && !(flags&0x04 != 0) { - cnt = name_from_hosts(tls, buf, canon, name, family) - if !(cnt != 0) { - cnt = name_from_dns_search(tls, buf, canon, name, family) - } - } - if cnt <= 0 { - if cnt != 0 { - return cnt - } - return -2 - } - - // Filter/transform results for v4-mapped lookup, if requested. - if flags&0x08 != 0 { - Xabort(tls) //TODO- - // if (!(flags & AI_ALL)) { - // /* If any v6 results exist, remove v4 results. */ - // for (i=0; i= 0 { - if !(Xconnect(tls, fd, da, dalen) != 0) { - key = key | 0x40000000 - if !(Xgetsockname(tls, fd, sa1, bp+88) != 0) { - if family == 2 { - Xmemcpy(tls, - bp+28+8+uintptr(12), - bp+72+4, uint64(4)) - } - if dscope == scopeof(tls, bp+28+8) { - key = key | 0x20000000 - } - if dlabel == labelof(tls, bp+28+8) { - key = key | 0x10000000 - } - prefixlen = prefixmatch(tls, bp+28+8, - bp+8) - } - } - Xclose(tls, fd) - } - key = key | dprec<<20 - key = key | (15-dscope)<<16 - key = key | prefixlen<<8 - key = key | (48-i)<<0 - (*address)(unsafe.Pointer(buf + uintptr(i)*28)).sortkey = key - } - Xqsort(tls, buf, uint64(cnt), uint64(unsafe.Sizeof(address{})), *(*uintptr)(unsafe.Pointer(&struct { - f func(*TLS, uintptr, uintptr) int32 - }{addrcmp}))) - - //TODO pthread_setcancelstate(cs, 0); - - return cnt -} - -func X__lookup_serv(tls *TLS, buf uintptr, name uintptr, proto int32, socktype int32, flags int32) int32 { /* lookup_serv.c:12:5: */ - if __ccgo_strace { - trc("tls=%v buf=%v name=%v proto=%v socktype=%v flags=%v, (%v:)", tls, buf, name, proto, socktype, flags, origin(2)) - } - bp := tls.Alloc(8) - defer tls.Free(8) - - var line [128]int8 - _ = line - var cnt int32 = 0 - var p uintptr - _ = p - *(*uintptr)(unsafe.Pointer(bp /* z */)) = ts + 13 /* "" */ - var port uint64 = uint64(0) - - switch socktype { - case 1: - switch proto { - case 0: - proto = 6 - fallthrough - case 6: - break - default: - return -8 - } - break - case 2: - switch proto { - case 0: - proto = 17 - fallthrough - case 17: - break - default: - return -8 - } - fallthrough - case 0: - break - default: - if name != 0 { - return -8 - } - (*service)(unsafe.Pointer(buf)).port = uint16_t(0) - (*service)(unsafe.Pointer(buf)).proto = uint8(proto) - (*service)(unsafe.Pointer(buf)).socktype = uint8(socktype) - return 1 - } - - if name != 0 { - if !(int32(*(*int8)(unsafe.Pointer(name))) != 0) { - return -8 - } - port = Xstrtoul(tls, name, bp, 10) - } - if !(int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp))))) != 0) { - if port > uint64(65535) { - return -8 - } - if proto != 17 { - (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).port = uint16_t(port) - (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).socktype = uint8(1) - (*service)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*4)).proto = uint8(6) - } - if proto != 6 { - (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).port = uint16_t(port) - (*service)(unsafe.Pointer(buf + uintptr(cnt)*4)).socktype = uint8(2) - (*service)(unsafe.Pointer(buf + uintptr(PostIncInt32(&cnt, 1))*4)).proto = uint8(17) - } - return cnt - } - - if flags&0x400 != 0 { - return -2 - } - - var l size_t = Xstrlen(tls, name) - _ = l - - Xabort(tls) //TODO- - // unsigned char _buf[1032]; - // FILE _f, *f = __fopen_rb_ca("/etc/services", &_f, _buf, sizeof _buf); - // if (!f) switch (errno) { - // case ENOENT: - // case ENOTDIR: - // case EACCES: - // return EAI_SERVICE; - // default: - // return EAI_SYSTEM; - // } - - Xabort(tls) //TODO- - // while (fgets(line, sizeof line, f) && cnt < MAXSERVS) { - // if ((p=strchr(line, '#'))) *p++='\n', *p=0; - - // /* Find service name */ - // for(p=line; (p=strstr(p, name)); p++) { - // if (p>line && !isspace(p[-1])) continue; - // if (p[l] && !isspace(p[l])) continue; - // break; - // } - // if (!p) continue; - - // /* Skip past canonical name at beginning of line */ - // for (p=line; *p && !isspace(*p); p++); - - // port = strtoul(p, &z, 10); - // if (port > 65535 || z==p) continue; - // if (!strncmp(z, "/udp", 4)) { - // if (proto == IPPROTO_TCP) continue; - // buf[cnt].port = port; - // buf[cnt].socktype = SOCK_DGRAM; - // buf[cnt++].proto = IPPROTO_UDP; - // } - // if (!strncmp(z, "/tcp", 4)) { - // if (proto == IPPROTO_UDP) continue; - // buf[cnt].port = port; - // buf[cnt].socktype = SOCK_STREAM; - // buf[cnt++].proto = IPPROTO_TCP; - // } - // } - // __fclose_ca(f); - // return cnt > 0 ? cnt : EAI_SERVICE; - Xabort(tls) - return int32(0) //TODO- -} - -func temper(tls *TLS, x uint32) uint32 { /* rand_r.c:3:17: */ - x = x ^ x>>11 - x = x ^ x<<7&0x9D2C5680 - x = x ^ x<<15&0xEFC60000 - x = x ^ x>>18 - return x -} - -func Xrand_r(tls *TLS, seed uintptr) int32 { /* rand_r.c:12:5: */ - if __ccgo_strace { - trc("tls=%v seed=%v, (%v:)", tls, seed, origin(2)) - } - return int32(temper(tls, AssignPtrUint32(seed, *(*uint32)(unsafe.Pointer(seed))*uint32(1103515245)+uint32(12345))) / uint32(2)) -} - -func X__lockfile(tls *TLS, f uintptr) int32 { /* __lockfile.c:4:5: */ - if __ccgo_strace { - trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) - } - var owner int32 = (*FILE)(unsafe.Pointer(f)).lock - var tid int32 = (*__pthread)(unsafe.Pointer(__pthread_self(tls))).tid - if owner&CplInt32(0x40000000) == tid { - return 0 - } - owner = a_cas(tls, f+140, 0, tid) - if !(owner != 0) { - return 1 - } - for AssignInt32(&owner, a_cas(tls, f+140, 0, tid|0x40000000)) != 0 { - if owner&0x40000000 != 0 || a_cas(tls, f+140, owner, owner|0x40000000) == owner { - __futexwait(tls, f+140, owner|0x40000000, 1) - } - } - return 1 -} - -func X__unlockfile(tls *TLS, f uintptr) { /* __lockfile.c:19:6: */ - if __ccgo_strace { - trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) - } - if a_swap(tls, f+140, 0)&0x40000000 != 0 { - __wake(tls, f+140, 1, 1) - } -} - -func X__toread(tls *TLS, f uintptr) int32 { /* __toread.c:3:5: */ - if __ccgo_strace { - trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) - } - *(*int32)(unsafe.Pointer(f + 136)) |= (*FILE)(unsafe.Pointer(f)).mode - 1 - if (*FILE)(unsafe.Pointer(f)).wpos != (*FILE)(unsafe.Pointer(f)).wbase { - (*struct { - f func(*TLS, uintptr, uintptr, size_t) size_t - })(unsafe.Pointer(&struct{ uintptr }{(*FILE)(unsafe.Pointer(f)).write})).f(tls, f, uintptr(0), uint64(0)) - } - (*FILE)(unsafe.Pointer(f)).wpos = AssignPtrUintptr(f+56, AssignPtrUintptr(f+32, uintptr(0))) - if (*FILE)(unsafe.Pointer(f)).flags&uint32(4) != 0 { - *(*uint32)(unsafe.Pointer(f)) |= uint32(32) - return -1 - } - (*FILE)(unsafe.Pointer(f)).rpos = AssignPtrUintptr(f+16, (*FILE)(unsafe.Pointer(f)).buf+uintptr((*FILE)(unsafe.Pointer(f)).buf_size)) - if (*FILE)(unsafe.Pointer(f)).flags&uint32(16) != 0 { - return -1 - } - return 0 -} - -func X__toread_needs_stdio_exit(tls *TLS) { /* __toread.c:16:13: */ - if __ccgo_strace { - trc("tls=%v, (%v:)", tls, origin(2)) - } - X__builtin_abort(tls) //TODO- - // __stdio_exit_needed(); -} - -// This function assumes it will never be called if there is already -// data buffered for reading. - -func X__uflow(tls *TLS, f uintptr) int32 { /* __uflow.c:6:5: */ - if __ccgo_strace { - trc("tls=%v f=%v, (%v:)", tls, f, origin(2)) - } - bp := tls.Alloc(1) - defer tls.Free(1) - - // var c uint8 at bp, 1 - - if !(X__toread(tls, f) != 0) && (*struct { - f func(*TLS, uintptr, uintptr, size_t) size_t - })(unsafe.Pointer(&struct{ uintptr }{(*FILE)(unsafe.Pointer(f)).read})).f(tls, f, bp, uint64(1)) == uint64(1) { - return int32(*(*uint8)(unsafe.Pointer(bp))) - } - return -1 -} - -func Xsscanf(tls *TLS, s uintptr, fmt uintptr, va uintptr) int32 { /* sscanf.c:4:5: */ - if __ccgo_strace { - trc("tls=%v s=%v fmt=%v va=%v, (%v:)", tls, s, fmt, va, origin(2)) - } - var ret int32 - var ap va_list - _ = ap - ap = va - ret = Xvsscanf(tls, s, fmt, ap) - _ = ap - return ret -} - -type wctrans_t = uintptr /* wctype.h:20:19 */ - -func store_int(tls *TLS, dest uintptr, size int32, i uint64) { /* vfscanf.c:22:13: */ - if !(dest != 0) { - return - } - switch size { - case -2: - *(*int8)(unsafe.Pointer(dest)) = int8(i) - break - case -1: - *(*int16)(unsafe.Pointer(dest)) = int16(i) - break - case 0: - *(*int32)(unsafe.Pointer(dest)) = int32(i) - break - case 1: - *(*int64)(unsafe.Pointer(dest)) = int64(i) - break - case 3: - *(*int64)(unsafe.Pointer(dest)) = int64(i) - break - } -} - -func arg_n(tls *TLS, ap va_list, n uint32) uintptr { /* vfscanf.c:44:13: */ - var p uintptr - var i uint32 - var ap2 va_list - _ = ap2 - ap2 = ap - for i = n; i > uint32(1); i-- { - VaUintptr(&ap2) - } - p = VaUintptr(&ap2) - _ = ap2 - return p -} - -func Xvfscanf(tls *TLS, f uintptr, fmt uintptr, ap va_list) int32 { /* vfscanf.c:56:5: */ - if __ccgo_strace { - trc("tls=%v f=%v fmt=%v ap=%v, (%v:)", tls, f, fmt, ap, origin(2)) - } - bp := tls.Alloc(276) - defer tls.Free(276) - - var width int32 - var size int32 - var alloc int32 - var base int32 - var p uintptr - var c int32 - var t int32 - var s uintptr - var wcs uintptr - // var st mbstate_t at bp+268, 8 - - var dest uintptr - var invert int32 - var matches int32 - var x uint64 - var y float64 - var pos off_t - // var scanset [257]uint8 at bp, 257 - - var i size_t - var k size_t - // var wc wchar_t at bp+260, 4 - - var __need_unlock int32 - var tmp uintptr - var tmp1 uintptr - alloc = 0 - dest = uintptr(0) - matches = 0 - pos = int64(0) - __need_unlock = 0 - - if !!(int32((*FILE)(unsafe.Pointer(f)).rpos) != 0) { - goto __1 - } - X__toread(tls, f) -__1: - ; - if !!(int32((*FILE)(unsafe.Pointer(f)).rpos) != 0) { - goto __2 - } - goto input_fail -__2: - ; - - p = fmt -__3: - if !(*(*uint8)(unsafe.Pointer(p)) != 0) { - goto __5 - } - - alloc = 0 - - if !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p)))) != 0) { - goto __6 - } -__7: - if !(__isspace(tls, int32(*(*uint8)(unsafe.Pointer(p + 1)))) != 0) { - goto __8 - } - p++ - goto __7 -__8: - ; - X__shlim(tls, f, int64(0)) -__9: - if !(__isspace(tls, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }()) != 0) { - goto __10 - } - goto __9 -__10: - ; - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1) - goto __4 -__6: - ; - if !(int32(*(*uint8)(unsafe.Pointer(p))) != '%' || int32(*(*uint8)(unsafe.Pointer(p + 1))) == '%') { - goto __11 - } - X__shlim(tls, f, int64(0)) - if !(int32(*(*uint8)(unsafe.Pointer(p))) == '%') { - goto __12 - } - p++ -__14: - if !(__isspace(tls, AssignInt32(&c, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }())) != 0) { - goto __15 - } - goto __14 -__15: - ; - goto __13 -__12: - c = func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() -__13: - ; - if !(c != int32(*(*uint8)(unsafe.Pointer(p)))) { - goto __16 - } - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if !(c < 0) { - goto __17 - } - goto input_fail -__17: - ; - goto match_fail -__16: - ; - pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1) - goto __4 -__11: - ; - - p++ - if !(int32(*(*uint8)(unsafe.Pointer(p))) == '*') { - goto __18 - } - dest = uintptr(0) - p++ - goto __19 -__18: - if !(func() int32 { - if 0 != 0 { - return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(p)))) - } - return Bool32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10)) - }() != 0 && int32(*(*uint8)(unsafe.Pointer(p + 1))) == '$') { - goto __20 - } - dest = arg_n(tls, ap, uint32(int32(*(*uint8)(unsafe.Pointer(p)))-'0')) - p += uintptr(2) - goto __21 -__20: - dest = VaUintptr(&ap) -__21: - ; -__19: - ; - - width = 0 -__22: - if !(func() int32 { - if 0 != 0 { - return Xisdigit(tls, int32(*(*uint8)(unsafe.Pointer(p)))) - } - return Bool32(uint32(*(*uint8)(unsafe.Pointer(p)))-uint32('0') < uint32(10)) - }() != 0) { - goto __24 - } - width = 10*width + int32(*(*uint8)(unsafe.Pointer(p))) - '0' - goto __23 -__23: - p++ - goto __22 - goto __24 -__24: - ; - - if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'm') { - goto __25 - } - wcs = uintptr(0) - s = uintptr(0) - alloc = BoolInt32(!!(dest != 0)) - p++ - goto __26 -__25: - alloc = 0 -__26: - ; - - size = 0 - switch int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1)))) { - case 'h': - goto __28 - case 'l': - goto __29 - case 'j': - goto __30 - case 'z': - goto __31 - case 't': - goto __32 - case 'L': - goto __33 - case 'd': - goto __34 - case 'i': - goto __35 - case 'o': - goto __36 - case 'u': - goto __37 - case 'x': - goto __38 - case 'a': - goto __39 - case 'e': - goto __40 - case 'f': - goto __41 - case 'g': - goto __42 - case 'A': - goto __43 - case 'E': - goto __44 - case 'F': - goto __45 - case 'G': - goto __46 - case 'X': - goto __47 - case 's': - goto __48 - case 'c': - goto __49 - case '[': - goto __50 - case 'S': - goto __51 - case 'C': - goto __52 - case 'p': - goto __53 - case 'n': - goto __54 - default: - goto __55 - } - goto __27 -__28: - if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'h') { - goto __56 - } - p++ - size = -2 - goto __57 -__56: - size = -1 -__57: - ; - goto __27 -__29: - if !(int32(*(*uint8)(unsafe.Pointer(p))) == 'l') { - goto __58 - } - p++ - size = 3 - goto __59 -__58: - size = 1 -__59: - ; - goto __27 -__30: - size = 3 - goto __27 -__31: -__32: - size = 1 - goto __27 -__33: - size = 2 - goto __27 -__34: -__35: -__36: -__37: -__38: -__39: -__40: -__41: -__42: -__43: -__44: -__45: -__46: -__47: -__48: -__49: -__50: -__51: -__52: -__53: -__54: - p-- - goto __27 -__55: - goto fmt_fail -__27: - ; - - t = int32(*(*uint8)(unsafe.Pointer(p))) - - // C or S - if !(t&0x2f == 3) { - goto __60 - } - t = t | 32 - size = 1 -__60: - ; - - switch t { - case 'c': - goto __62 - case '[': - goto __63 - case 'n': - goto __64 - default: - goto __65 - } - goto __61 -__62: - if !(width < 1) { - goto __66 - } - width = 1 -__66: - ; -__63: - goto __61 -__64: - store_int(tls, dest, size, uint64(pos)) - // do not increment match count, etc! - goto __4 -__65: - X__shlim(tls, f, int64(0)) -__67: - if !(__isspace(tls, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }()) != 0) { - goto __68 - } - goto __67 -__68: - ; - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1) -__61: - ; - - X__shlim(tls, f, int64(width)) - if !(func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }() < 0) { - goto __69 - } - goto input_fail -__69: - ; - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - - switch t { - case 's': - goto __71 - case 'c': - goto __72 - case '[': - goto __73 - case 'p': - goto __74 - case 'X': - goto __75 - case 'x': - goto __76 - case 'o': - goto __77 - case 'd': - goto __78 - case 'u': - goto __79 - case 'i': - goto __80 - case 'a': - goto __81 - case 'A': - goto __82 - case 'e': - goto __83 - case 'E': - goto __84 - case 'f': - goto __85 - case 'F': - goto __86 - case 'g': - goto __87 - case 'G': - goto __88 - } - goto __70 -__71: -__72: -__73: - if !(t == 'c' || t == 's') { - goto __89 - } - Xmemset(tls, bp, -1, uint64(unsafe.Sizeof([257]uint8{}))) - *(*uint8)(unsafe.Pointer(bp)) = uint8(0) - if !(t == 's') { - goto __91 - } - *(*uint8)(unsafe.Pointer(bp + 10)) = uint8(0) - *(*uint8)(unsafe.Pointer(bp + 11)) = uint8(0) - *(*uint8)(unsafe.Pointer(bp + 12)) = uint8(0) - *(*uint8)(unsafe.Pointer(bp + 13)) = uint8(0) - *(*uint8)(unsafe.Pointer(bp + 14)) = uint8(0) - *(*uint8)(unsafe.Pointer(bp + 33)) = uint8(0) -__91: - ; - goto __90 -__89: - if !(int32(*(*uint8)(unsafe.Pointer(PreIncUintptr(&p, 1)))) == '^') { - goto __92 - } - p++ - invert = 1 - goto __93 -__92: - invert = 0 -__93: - ; - Xmemset(tls, bp, invert, uint64(unsafe.Sizeof([257]uint8{}))) - *(*uint8)(unsafe.Pointer(bp)) = uint8(0) - if !(int32(*(*uint8)(unsafe.Pointer(p))) == '-') { - goto __94 - } - p++ - *(*uint8)(unsafe.Pointer(bp + 46)) = uint8(1 - invert) - goto __95 -__94: - if !(int32(*(*uint8)(unsafe.Pointer(p))) == ']') { - goto __96 - } - p++ - *(*uint8)(unsafe.Pointer(bp + 94)) = uint8(1 - invert) -__96: - ; -__95: - ; -__97: - if !(int32(*(*uint8)(unsafe.Pointer(p))) != ']') { - goto __99 - } - if !!(int32(*(*uint8)(unsafe.Pointer(p))) != 0) { - goto __100 - } - goto fmt_fail -__100: - ; - if !(int32(*(*uint8)(unsafe.Pointer(p))) == '-' && *(*uint8)(unsafe.Pointer(p + 1)) != 0 && int32(*(*uint8)(unsafe.Pointer(p + 1))) != ']') { - goto __101 - } - c = int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&p, 1) + UintptrFromInt32(-1)))) -__102: - if !(c < int32(*(*uint8)(unsafe.Pointer(p)))) { - goto __104 - } - *(*uint8)(unsafe.Pointer(bp + uintptr(1+c))) = uint8(1 - invert) - goto __103 -__103: - c++ - goto __102 - goto __104 -__104: - ; -__101: - ; - *(*uint8)(unsafe.Pointer(bp + uintptr(1+int32(*(*uint8)(unsafe.Pointer(p)))))) = uint8(1 - invert) - goto __98 -__98: - p++ - goto __97 - goto __99 -__99: - ; -__90: - ; - wcs = uintptr(0) - s = uintptr(0) - i = uint64(0) - if t == 'c' { - k = uint64(uint32(width) + 1) - } else { - k = uint64(31) - } - if !(size == 1) { - goto __105 - } - if !(alloc != 0) { - goto __107 - } - wcs = Xmalloc(tls, k*size_t(unsafe.Sizeof(wchar_t(0)))) - if !!(wcs != 0) { - goto __109 - } - goto alloc_fail -__109: - ; - goto __108 -__107: - wcs = dest -__108: - ; - *(*mbstate_t)(unsafe.Pointer(bp + 268 /* st */)) = mbstate_t{} -__110: - if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }())+1))) != 0) { - goto __111 - } - switch Xmbrtowc(tls, bp+260, func() uintptr { *(*int8)(unsafe.Pointer(bp + 264)) = int8(c); return bp + 264 }(), uint64(1), bp+268 /* &st */) { - case Uint64FromInt32(-1): - goto __113 - case Uint64FromInt32(-2): - goto __114 - } - goto __112 -__113: - goto input_fail -__114: - goto __110 -__112: - ; - if !(wcs != 0) { - goto __115 - } - *(*wchar_t)(unsafe.Pointer(wcs + uintptr(PostIncUint64(&i, 1))*4)) = *(*wchar_t)(unsafe.Pointer(bp + 260 /* wc */)) -__115: - ; - if !(alloc != 0 && i == k) { - goto __116 - } - k = k + (k + uint64(1)) - tmp = Xrealloc(tls, wcs, k*size_t(unsafe.Sizeof(wchar_t(0)))) - if !!(tmp != 0) { - goto __117 - } - goto alloc_fail -__117: - ; - wcs = tmp -__116: - ; - goto __110 -__111: - ; - if !!(Xmbsinit(tls, bp+268) != 0) { - goto __118 - } - goto input_fail -__118: - ; - goto __106 -__105: - if !(alloc != 0) { - goto __119 - } - s = Xmalloc(tls, k) - if !!(s != 0) { - goto __121 - } - goto alloc_fail -__121: - ; -__122: - if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }())+1))) != 0) { - goto __123 - } - *(*int8)(unsafe.Pointer(s + uintptr(PostIncUint64(&i, 1)))) = int8(c) - if !(i == k) { - goto __124 - } - k = k + (k + uint64(1)) - tmp1 = Xrealloc(tls, s, k) - if !!(tmp1 != 0) { - goto __125 - } - goto alloc_fail -__125: - ; - s = tmp1 -__124: - ; - goto __122 -__123: - ; - goto __120 -__119: - if !(AssignUintptr(&s, dest) != 0) { - goto __126 - } -__128: - if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }())+1))) != 0) { - goto __129 - } - *(*int8)(unsafe.Pointer(s + uintptr(PostIncUint64(&i, 1)))) = int8(c) - goto __128 -__129: - ; - goto __127 -__126: -__130: - if !(*(*uint8)(unsafe.Pointer(bp + uintptr(AssignInt32(&c, func() int32 { - if (*FILE)(unsafe.Pointer(f)).rpos != (*FILE)(unsafe.Pointer(f)).shend { - return int32(*(*uint8)(unsafe.Pointer(PostIncUintptr(&(*FILE)(unsafe.Pointer(f)).rpos, 1)))) - } - return X__shgetc(tls, f) - }())+1))) != 0) { - goto __131 - } - goto __130 -__131: - ; -__127: - ; -__120: - ; -__106: - ; - if (*FILE)(unsafe.Pointer(f)).shlim >= int64(0) { - (*FILE)(unsafe.Pointer(f)).rpos-- - } else { - } - if !!((*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != 0) { - goto __132 - } - goto match_fail -__132: - ; - if !(t == 'c' && (*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != off_t(width)) { - goto __133 - } - goto match_fail -__133: - ; - if !(alloc != 0) { - goto __134 - } - if !(size == 1) { - goto __135 - } - *(*uintptr)(unsafe.Pointer(dest)) = wcs - goto __136 -__135: - *(*uintptr)(unsafe.Pointer(dest)) = s -__136: - ; -__134: - ; - if !(t != 'c') { - goto __137 - } - if !(wcs != 0) { - goto __138 - } - *(*wchar_t)(unsafe.Pointer(wcs + uintptr(i)*4)) = 0 -__138: - ; - if !(s != 0) { - goto __139 - } - *(*int8)(unsafe.Pointer(s + uintptr(i))) = int8(0) -__139: - ; -__137: - ; - goto __70 -__74: -__75: -__76: - base = 16 - goto int_common -__77: - base = 8 - goto int_common -__78: -__79: - base = 10 - goto int_common -__80: - base = 0 -int_common: - x = X__intscan(tls, f, uint32(base), 0, 2*uint64(0x7fffffffffffffff)+uint64(1)) - if !!((*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != 0) { - goto __140 - } - goto match_fail -__140: - ; - if !(t == 'p' && dest != 0) { - goto __141 - } - *(*uintptr)(unsafe.Pointer(dest)) = uintptr(uintptr_t(x)) - goto __142 -__141: - store_int(tls, dest, size, x) -__142: - ; - goto __70 -__81: -__82: -__83: -__84: -__85: -__86: -__87: -__88: - y = X__floatscan(tls, f, size, 0) - if !!((*FILE)(unsafe.Pointer(f)).shcnt+(int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1 != 0) { - goto __143 - } - goto match_fail -__143: - ; - if !(dest != 0) { - goto __144 - } - switch size { - case 0: - goto __146 - case 1: - goto __147 - case 2: - goto __148 - } - goto __145 -__146: - *(*float32)(unsafe.Pointer(dest)) = float32(y) - goto __145 -__147: - *(*float64)(unsafe.Pointer(dest)) = y - goto __145 -__148: - *(*float64)(unsafe.Pointer(dest)) = y - goto __145 -__145: - ; -__144: - ; - goto __70 -__70: - ; - - pos = pos + ((*FILE)(unsafe.Pointer(f)).shcnt + (int64((*FILE)(unsafe.Pointer(f)).rpos)-int64((*FILE)(unsafe.Pointer(f)).buf))/1) - if !(dest != 0) { - goto __149 - } - matches++ -__149: - ; - goto __4 -__4: - p++ - goto __3 - goto __5 -__5: - ; - if !(0 != 0) { - goto __150 - } -fmt_fail: -alloc_fail: -input_fail: - if !!(matches != 0) { - goto __151 - } - matches-- -__151: - ; -match_fail: - if !(alloc != 0) { - goto __152 - } - Xfree(tls, s) - Xfree(tls, wcs) -__152: - ; -__150: - ; -__153: - if !(__need_unlock != 0) { - goto __156 - } - X__unlockfile(tls, f) -__156: - ; - goto __154 -__154: - if 0 != 0 { - goto __153 - } - goto __155 -__155: - ; - return matches -} - -func string_read(tls *TLS, f uintptr, buf uintptr, len size_t) size_t { /* vsscanf.c:4:15: */ - var src uintptr = (*FILE)(unsafe.Pointer(f)).cookie - var k size_t = len + uint64(256) - var end uintptr = Xmemchr(tls, src, 0, k) - if end != 0 { - k = size_t((int64(end) - int64(src)) / 1) - } - if k < len { - len = k - } - Xmemcpy(tls, buf, src, len) - (*FILE)(unsafe.Pointer(f)).rpos = src + uintptr(len) - (*FILE)(unsafe.Pointer(f)).rend = src + uintptr(k) - (*FILE)(unsafe.Pointer(f)).cookie = src + uintptr(k) - return len -} - -func Xvsscanf(tls *TLS, s uintptr, fmt uintptr, ap va_list) int32 { /* vsscanf.c:18:5: */ - if __ccgo_strace { - trc("tls=%v s=%v fmt=%v ap=%v, (%v:)", tls, s, fmt, ap, origin(2)) - } - bp := tls.Alloc(232) - defer tls.Free(232) - - *(*FILE)(unsafe.Pointer(bp /* f */)) = FILE{read: *(*uintptr)(unsafe.Pointer(&struct { - f func(*TLS, uintptr, uintptr, size_t) size_t - }{string_read})), buf: s, lock: -1, cookie: s} - return Xvfscanf(tls, bp, fmt, ap) -} - -func Xbsearch(tls *TLS, key uintptr, base uintptr, nel size_t, width size_t, cmp uintptr) uintptr { /* bsearch.c:3:6: */ - if __ccgo_strace { - trc("tls=%v key=%v base=%v nel=%v width=%v cmp=%v, (%v:)", tls, key, base, nel, width, cmp, origin(2)) - } - var try uintptr - var sign int32 - for nel > uint64(0) { - try = base + uintptr(width*(nel/uint64(2))) - sign = (*struct { - f func(*TLS, uintptr, uintptr) int32 - })(unsafe.Pointer(&struct{ uintptr }{cmp})).f(tls, key, try) - if sign < 0 { - nel = nel / uint64(2) - } else if sign > 0 { - base = try + uintptr(width) - nel = nel - (nel/uint64(2) + uint64(1)) - } else { - return try - } - } - return uintptr(0) -} - -func strtox(tls *TLS, s uintptr, p uintptr, prec int32) float64 { /* strtod.c:6:20: */ - bp := tls.Alloc(232) - defer tls.Free(232) - - // var f FILE at bp, 232 - - (*FILE)(unsafe.Pointer(bp)).buf = AssignPtrUintptr(bp+8, s) - (*FILE)(unsafe.Pointer(bp)).rend = UintptrFromInt32(-1) - X__shlim(tls, bp, int64(0)) - var y float64 = X__floatscan(tls, bp, prec, 1) - var cnt off_t = (*FILE)(unsafe.Pointer(bp)).shcnt + (int64((*FILE)(unsafe.Pointer(bp)).rpos)-int64((*FILE)(unsafe.Pointer(bp)).buf))/1 - if p != 0 { - *(*uintptr)(unsafe.Pointer(p)) = func() uintptr { - if cnt != 0 { - return s + uintptr(cnt) - } - return s - }() - } - return y -} - -func Xstrtof(tls *TLS, s uintptr, p uintptr) float32 { /* strtod.c:17:7: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) - } - return float32(strtox(tls, s, p, 0)) -} - -func Xstrtod(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:22:8: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) - } - return strtox(tls, s, p, 1) -} - -func Xstrtold(tls *TLS, s uintptr, p uintptr) float64 { /* strtod.c:27:13: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v, (%v:)", tls, s, p, origin(2)) - } - return strtox(tls, s, p, 2) -} - -func strtox1(tls *TLS, s uintptr, p uintptr, base int32, lim uint64) uint64 { /* strtol.c:8:27: */ - bp := tls.Alloc(232) - defer tls.Free(232) - - // var f FILE at bp, 232 - - (*FILE)(unsafe.Pointer(bp)).buf = AssignPtrUintptr(bp+8, s) - (*FILE)(unsafe.Pointer(bp)).rend = UintptrFromInt32(-1) - X__shlim(tls, bp, int64(0)) - var y uint64 = X__intscan(tls, bp, uint32(base), 1, lim) - if p != 0 { - var cnt size_t = size_t((*FILE)(unsafe.Pointer(bp)).shcnt + (int64((*FILE)(unsafe.Pointer(bp)).rpos)-int64((*FILE)(unsafe.Pointer(bp)).buf))/1) - *(*uintptr)(unsafe.Pointer(p)) = s + uintptr(cnt) - } - return y -} - -func Xstrtoull(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:21:20: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) - } - return strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1)) -} - -func Xstrtoll(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:26:11: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) - } - return int64(strtox1(tls, s, p, base, Uint64FromInt64(-0x7fffffffffffffff-int64(1)))) -} - -func Xstrtoul(tls *TLS, s uintptr, p uintptr, base int32) uint64 { /* strtol.c:31:15: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) - } - return uint64(strtox1(tls, s, p, base, 2*uint64(0x7fffffffffffffff)+uint64(1))) -} - -func Xstrtol(tls *TLS, s uintptr, p uintptr, base int32) int64 { /* strtol.c:36:6: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) - } - return int64(strtox1(tls, s, p, base, 0+Uint64FromInt64(Int64(-Int64(0x7fffffffffffffff))-Int64FromInt32(1)))) -} - -func Xstrtoimax(tls *TLS, s uintptr, p uintptr, base int32) intmax_t { /* strtol.c:41:10: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) - } - return intmax_t(Xstrtoll(tls, s, p, base)) -} - -func Xstrtoumax(tls *TLS, s uintptr, p uintptr, base int32) uintmax_t { /* strtol.c:46:11: */ - if __ccgo_strace { - trc("tls=%v s=%v p=%v base=%v, (%v:)", tls, s, p, base, origin(2)) - } - return uintmax_t(Xstrtoull(tls, s, p, base)) -} - -func Xstrdup(tls *TLS, s uintptr) uintptr { /* strdup.c:4:6: */ - if __ccgo_strace { - trc("tls=%v s=%v, (%v:)", tls, s, origin(2)) - } - var l size_t = Xstrlen(tls, s) - var d uintptr = Xmalloc(tls, l+uint64(1)) - if !(d != 0) { - return uintptr(0) - } - return Xmemcpy(tls, d, s, l+uint64(1)) -} - -func Xstrlcat(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcat.c:4:8: */ - if __ccgo_strace { - trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) - } - var l size_t = Xstrnlen(tls, d, n) - if l == n { - return l + Xstrlen(tls, s) - } - return l + Xstrlcpy(tls, d+uintptr(l), s, n-l) -} - -// Support signed or unsigned plain-char - -// Implementation choices... - -// Arbitrary numbers... - -// POSIX/SUS requirements follow. These numbers come directly -// from SUS and have nothing to do with the host system. - -func Xstrlcpy(tls *TLS, d uintptr, s uintptr, n size_t) size_t { /* strlcpy.c:11:8: */ - if __ccgo_strace { - trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) - } - var d0 uintptr - var wd uintptr - var ws uintptr - d0 = d - - if !!(int32(PostDecUint64(&n, 1)) != 0) { - goto __1 - } - goto finish -__1: - ; - if !(uintptr_t(s)&(uint64(unsafe.Sizeof(size_t(0)))-uint64(1)) == uintptr_t(d)&(uint64(unsafe.Sizeof(size_t(0)))-uint64(1))) { - goto __2 - } -__3: - if !(uintptr_t(s)&(uint64(unsafe.Sizeof(size_t(0)))-uint64(1)) != 0 && n != 0 && AssignPtrInt8(d, *(*int8)(unsafe.Pointer(s))) != 0) { - goto __5 - } - goto __4 -__4: - n-- - s++ - d++ - goto __3 - goto __5 -__5: - ; - if !(n != 0 && *(*int8)(unsafe.Pointer(s)) != 0) { - goto __6 - } - wd = d - ws = s -__7: - if !(n >= size_t(unsafe.Sizeof(size_t(0))) && !((*(*uint64)(unsafe.Pointer(ws))-Uint64(Uint64FromInt32(-1))/uint64(255)) & ^*(*uint64)(unsafe.Pointer(ws)) & (Uint64(Uint64FromInt32(-1))/uint64(255)*uint64(255/2+1)) != 0)) { - goto __9 - } - *(*size_t)(unsafe.Pointer(wd)) = *(*uint64)(unsafe.Pointer(ws)) - goto __8 -__8: - n = n - size_t(unsafe.Sizeof(size_t(0))) - ws += 8 - wd += 8 - goto __7 - goto __9 -__9: - ; - d = wd - s = ws -__6: - ; -__2: - ; -__10: - if !(n != 0 && AssignPtrInt8(d, *(*int8)(unsafe.Pointer(s))) != 0) { - goto __12 - } - goto __11 -__11: - n-- - s++ - d++ - goto __10 - goto __12 -__12: - ; - *(*int8)(unsafe.Pointer(d)) = int8(0) -finish: - return size_t((int64(d)-int64(d0))/1) + Xstrlen(tls, s) -} - -func Xstrncasecmp(tls *TLS, _l uintptr, _r uintptr, n size_t) int32 { /* strncasecmp.c:4:5: */ - if __ccgo_strace { - trc("tls=%v _l=%v _r=%v n=%v, (%v:)", tls, _l, _r, n, origin(2)) - } - var l uintptr = _l - var r uintptr = _r - if !(int32(PostDecUint64(&n, 1)) != 0) { - return 0 - } -__1: - if !(*(*uint8)(unsafe.Pointer(l)) != 0 && *(*uint8)(unsafe.Pointer(r)) != 0 && n != 0 && (int32(*(*uint8)(unsafe.Pointer(l))) == int32(*(*uint8)(unsafe.Pointer(r))) || Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(l)))) == Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(r)))))) { - goto __3 - } - goto __2 -__2: - l++ - r++ - n-- - goto __1 - goto __3 -__3: - ; - return Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(l)))) - Xtolower(tls, int32(*(*uint8)(unsafe.Pointer(r)))) -} - -func X__strncasecmp_l(tls *TLS, l uintptr, r uintptr, n size_t, loc locale_t) int32 { /* strncasecmp.c:12:5: */ - if __ccgo_strace { - trc("tls=%v l=%v r=%v n=%v loc=%v, (%v:)", tls, l, r, n, loc, origin(2)) - } - return Xstrncasecmp(tls, l, r, n) -} - -func Xstrncat(tls *TLS, d uintptr, s uintptr, n size_t) uintptr { /* strncat.c:3:6: */ - if __ccgo_strace { - trc("tls=%v d=%v s=%v n=%v, (%v:)", tls, d, s, n, origin(2)) - } - var a uintptr = d - d += uintptr(Xstrlen(tls, d)) - for n != 0 && *(*int8)(unsafe.Pointer(s)) != 0 { - n-- - *(*int8)(unsafe.Pointer(PostIncUintptr(&d, 1))) = *(*int8)(unsafe.Pointer(PostIncUintptr(&s, 1))) - } - *(*int8)(unsafe.Pointer(PostIncUintptr(&d, 1))) = int8(0) - return a -} - -func Xstrnlen(tls *TLS, s uintptr, n size_t) size_t { /* strnlen.c:3:8: */ - if __ccgo_strace { - trc("tls=%v s=%v n=%v, (%v:)", tls, s, n, origin(2)) - } - var p uintptr = Xmemchr(tls, s, 0, n) - if p != 0 { - return uint64((int64(p) - int64(s)) / 1) - } - return n -} - -func Xstrspn(tls *TLS, s uintptr, c uintptr) size_t { /* strspn.c:6:8: */ - if __ccgo_strace { - trc("tls=%v s=%v c=%v, (%v:)", tls, s, c, origin(2)) - } - bp := tls.Alloc(32) - defer tls.Free(32) - - var a uintptr = s - *(*[4]size_t)(unsafe.Pointer(bp /* byteset */)) = [4]size_t{0: uint64(0)} - - if !(int32(*(*int8)(unsafe.Pointer(c))) != 0) { - return uint64(0) - } - if !(int32(*(*int8)(unsafe.Pointer(c + 1))) != 0) { - for ; int32(*(*int8)(unsafe.Pointer(s))) == int32(*(*int8)(unsafe.Pointer(c))); s++ { - } - return size_t((int64(s) - int64(a)) / 1) - } - - for ; *(*int8)(unsafe.Pointer(c)) != 0 && AssignOrPtrUint64(bp+uintptr(size_t(*(*uint8)(unsafe.Pointer(c)))/(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))*8, size_t(uint64(1))<<(size_t(*(*uint8)(unsafe.Pointer(c)))%(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))) != 0; c++ { - } - for ; *(*int8)(unsafe.Pointer(s)) != 0 && *(*size_t)(unsafe.Pointer(bp + uintptr(size_t(*(*uint8)(unsafe.Pointer(s)))/(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))*8))&(size_t(uint64(1))<<(size_t(*(*uint8)(unsafe.Pointer(s)))%(uint64(8)*uint64(unsafe.Sizeof(size_t(0)))))) != 0; s++ { - } - return size_t((int64(s) - int64(a)) / 1) -} - -func Xstrtok(tls *TLS, s uintptr, sep uintptr) uintptr { /* strtok.c:3:6: */ - if __ccgo_strace { - trc("tls=%v s=%v sep=%v, (%v:)", tls, s, sep, origin(2)) - } - if !(s != 0) && !(int32(AssignUintptr(&s, _sp)) != 0) { - return uintptr(0) - } - s += uintptr(Xstrspn(tls, s, sep)) - if !(int32(*(*int8)(unsafe.Pointer(s))) != 0) { - return AssignPtrUintptr(uintptr(unsafe.Pointer(&_sp)), uintptr(0)) - } - _sp = s + uintptr(Xstrcspn(tls, s, sep)) - if *(*int8)(unsafe.Pointer(_sp)) != 0 { - *(*int8)(unsafe.Pointer(PostIncUintptr(&_sp, 1))) = int8(0) - } else { - _sp = uintptr(0) - } - return s -} - -var _sp uintptr /* strtok.c:5:14: */ - -func X__ccgo_pthreadAttrGetDetachState(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:3:5: */ - if __ccgo_strace { - trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) - } - return *(*int32)(unsafe.Pointer(a + 6*4)) -} - -func Xpthread_attr_getdetachstate(tls *TLS, a uintptr, state uintptr) int32 { /* pthread_attr_get.c:7:5: */ - if __ccgo_strace { - trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) - } - *(*int32)(unsafe.Pointer(state)) = *(*int32)(unsafe.Pointer(a + 6*4)) - return 0 -} - -// -// int pthread_attr_getguardsize(const pthread_attr_t *restrict a, size_t *restrict size) -// { -// *size = a->_a_guardsize; -// return 0; -// } -// -// int pthread_attr_getinheritsched(const pthread_attr_t *restrict a, int *restrict inherit) -// { -// *inherit = a->_a_sched; -// return 0; -// } -// -// int pthread_attr_getschedparam(const pthread_attr_t *restrict a, struct sched_param *restrict param) -// { -// param->sched_priority = a->_a_prio; -// return 0; -// } -// -// int pthread_attr_getschedpolicy(const pthread_attr_t *restrict a, int *restrict policy) -// { -// *policy = a->_a_policy; -// return 0; -// } -// -// int pthread_attr_getscope(const pthread_attr_t *restrict a, int *restrict scope) -// { -// *scope = PTHREAD_SCOPE_SYSTEM; -// return 0; -// } -// -// int pthread_attr_getstack(const pthread_attr_t *restrict a, void **restrict addr, size_t *restrict size) -// { -// if (!a->_a_stackaddr) -// return EINVAL; -// *size = a->_a_stacksize; -// *addr = (void *)(a->_a_stackaddr - *size); -// return 0; -// } -// -// int pthread_attr_getstacksize(const pthread_attr_t *restrict a, size_t *restrict size) -// { -// *size = a->_a_stacksize; -// return 0; -// } -// -// int pthread_barrierattr_getpshared(const pthread_barrierattr_t *restrict a, int *restrict pshared) -// { -// *pshared = !!a->__attr; -// return 0; -// } -// -// int pthread_condattr_getclock(const pthread_condattr_t *restrict a, clockid_t *restrict clk) -// { -// *clk = a->__attr & 0x7fffffff; -// return 0; -// } -// -// int pthread_condattr_getpshared(const pthread_condattr_t *restrict a, int *restrict pshared) -// { -// *pshared = a->__attr>>31; -// return 0; -// } -// -// int pthread_mutexattr_getprotocol(const pthread_mutexattr_t *restrict a, int *restrict protocol) -// { -// *protocol = PTHREAD_PRIO_NONE; -// return 0; -// } -// int pthread_mutexattr_getpshared(const pthread_mutexattr_t *restrict a, int *restrict pshared) -// { -// *pshared = a->__attr / 128U % 2; -// return 0; -// } -// -// int pthread_mutexattr_getrobust(const pthread_mutexattr_t *restrict a, int *restrict robust) -// { -// *robust = a->__attr / 4U % 2; -// return 0; -// } - -func X__ccgo_pthreadMutexattrGettype(tls *TLS, a uintptr) int32 { /* pthread_attr_get.c:93:5: */ - if __ccgo_strace { - trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) - } - return int32((*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr & uint32(3)) -} - -// int pthread_mutexattr_gettype(const pthread_mutexattr_t *restrict a, int *restrict type) -// { -// *type = a->__attr & 3; -// return 0; -// } -// -// int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t *restrict a, int *restrict pshared) -// { -// *pshared = a->__attr[0]; -// return 0; -// } - -func Xpthread_attr_setdetachstate(tls *TLS, a uintptr, state int32) int32 { /* pthread_attr_setdetachstate.c:3:5: */ - if __ccgo_strace { - trc("tls=%v a=%v state=%v, (%v:)", tls, a, state, origin(2)) - } - if uint32(state) > 1 { - return 22 - } - *(*int32)(unsafe.Pointer(a + 6*4)) = state - return 0 -} - -func X__ccgo_getMutexType(tls *TLS, m uintptr) int32 { /* pthread_mutex_lock.c:3:5: */ - if __ccgo_strace { - trc("tls=%v m=%v, (%v:)", tls, m, origin(2)) - } - return *(*int32)(unsafe.Pointer(m)) & 15 -} - -// int __pthread_mutex_lock(pthread_mutex_t *m) -// { -// if ((m->_m_type&15) == PTHREAD_MUTEX_NORMAL -// && !a_cas(&m->_m_lock, 0, EBUSY)) -// return 0; -// -// return __pthread_mutex_timedlock(m, 0); -// } -// -// weak_alias(__pthread_mutex_lock, pthread_mutex_lock); - -func Xpthread_mutexattr_destroy(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_destroy.c:3:5: */ - if __ccgo_strace { - trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) - } - return 0 -} - -func Xpthread_mutexattr_init(tls *TLS, a uintptr) int32 { /* pthread_mutexattr_init.c:3:5: */ - if __ccgo_strace { - trc("tls=%v a=%v, (%v:)", tls, a, origin(2)) - } - *(*pthread_mutexattr_t)(unsafe.Pointer(a)) = pthread_mutexattr_t{} - return 0 -} - -func Xpthread_mutexattr_settype(tls *TLS, a uintptr, type1 int32) int32 { /* pthread_mutexattr_settype.c:3:5: */ - if __ccgo_strace { - trc("tls=%v a=%v type1=%v, (%v:)", tls, a, type1, origin(2)) - } - if uint32(type1) > uint32(2) { - return 22 - } - (*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr = (*pthread_mutexattr_t)(unsafe.Pointer(a)).__attr&Uint32FromInt32(CplInt32(3)) | uint32(type1) - return 0 -} - -func init() { - *(*uintptr)(unsafe.Pointer(uintptr(unsafe.Pointer(&ptable)) + 0)) = uintptr(unsafe.Pointer(&table)) + uintptr(128)*2 // __ctype_b_loc.c:36:45: -} - -var ts1 = "infinity\x00nan\x00\x00\x00\x01\x02\x04\a\x03\x06\x05\x00.\x00%d.%d.%d.%d.in-addr.arpa\x00ip6.arpa\x000123456789abcdef\x00/etc/hosts\x00rb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00%d.%d.%d.%d\x00%x:%x:%x:%x:%x:%x:%x:%x\x00%x:%x:%x:%x:%x:%x:%d.%d.%d.%d\x00:0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00 \x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" -var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data diff --git a/vendor/modernc.org/libc/pthread.go b/vendor/modernc.org/libc/pthread.go index 3d8bc0b..538766b 100644 --- a/vendor/modernc.org/libc/pthread.go +++ b/vendor/modernc.org/libc/pthread.go @@ -42,6 +42,7 @@ type TLS struct { jumpBuffers []uintptr lastError uint32 pthreadData + sp int stack stackHeader ID int32 @@ -67,6 +68,11 @@ func newTLS(detached bool) *TLS { return t } +// StackSlots reports the number of tls stack slots currently in use. +func (tls *TLS) StackSlots() int { + return tls.sp +} + func (t *TLS) alloca(n size_t) (r uintptr) { r = Xmalloc(t, n) t.allocas = append(t.allocas, r) @@ -183,7 +189,7 @@ func Xpthread_attr_setstacksize(t *TLS, attr uintptr, stackSize types.Size_t) in if __ccgo_strace { trc("t=%v attr=%v stackSize=%v, (%v:)", t, attr, stackSize, origin(2)) } - panic(todo("")) + return 0 } // Go side data of pthread_cond_t. diff --git a/vendor/modernc.org/libc/pthread_all.go b/vendor/modernc.org/libc/pthread_all.go index b5f0dfd..be50411 100644 --- a/vendor/modernc.org/libc/pthread_all.go +++ b/vendor/modernc.org/libc/pthread_all.go @@ -12,12 +12,16 @@ import ( "modernc.org/libc/pthread" ) +type pthreadAttr struct { + detachState int32 +} + // int pthread_attr_init(pthread_attr_t *attr); func Xpthread_attr_init(t *TLS, pAttr uintptr) int32 { if __ccgo_strace { trc("t=%v pAttr=%v, (%v:)", t, pAttr, origin(2)) } - *(*pthread.Pthread_attr_t)(unsafe.Pointer(pAttr)) = pthread.Pthread_attr_t{} + *(*pthreadAttr)(unsafe.Pointer(pAttr)) = pthreadAttr{} return 0 } diff --git a/vendor/modernc.org/libc/pthread_musl.go b/vendor/modernc.org/libc/pthread_musl.go index 01fa300..c051945 100644 --- a/vendor/modernc.org/libc/pthread_musl.go +++ b/vendor/modernc.org/libc/pthread_musl.go @@ -22,14 +22,26 @@ type pthreadCleanupItem struct { routine, arg uintptr } -// C version is 40 bytes (64b) and 24 bytes (32b). -type pthreadMutex struct { // 64b 32b - sync.Mutex // 0 8 0 8 - count int32 // 8 4 8 4 - mType uint32 // 12 4 12 4 - outer sync.Mutex // 16 8 16 8 - owner int32 // 24 4 24 4 - // 28 28 +// C original, unpatched version +// +// include/alltypes.h.in:86:TYPEDEF struct { +// union { +// int __i[sizeof(long)==8?10:6]; +// volatile int __vi[sizeof(long)==8?10:6]; +// volatile void *volatile __p[sizeof(long)==8?5:6]; +// } __u; +// } pthread_mutex_t; + +//TODO(jnml) can remove __ccgo_room patches now. + +// We overlay the C version with our version below. It must not be larger than +// the C version. +type pthreadMutex struct { // gc 64b 32b | tinygo 64b 32b + sync.Mutex // 0 8 0 4 | 0 16 0 8 + count int32 // 8 4 4 4 | 16 4 8 4 + typ uint32 // 12 4 8 4 | 20 4 12 4 + owner int32 // 16 4 12 4 | 24 4 16 4 + // 20 16 | 28 20 } type pthreadConds struct { @@ -39,7 +51,6 @@ type pthreadConds struct { var ( // Ensure there's enough space for unsafe type conversions. - _ [unsafe.Sizeof(sync.Mutex{}) - __CCGO_SIZEOF_GO_MUTEX]byte _ [unsafe.Sizeof(Tpthread_mutex_t{}) - unsafe.Sizeof(pthreadMutex{})]byte _ [unsafe.Sizeof(Tpthread_attr_t{}) - unsafe.Sizeof(pthreadAttr{})]byte @@ -255,103 +266,75 @@ func Xpthread_self(tls *TLS) uintptr { func Xpthread_mutex_init(tls *TLS, m, a uintptr) int32 { *(*Tpthread_mutex_t)(unsafe.Pointer(m)) = Tpthread_mutex_t{} if a != 0 { - (*pthreadMutex)(unsafe.Pointer(m)).mType = (*Tpthread_mutexattr_t)(unsafe.Pointer(a)).F__attr + (*pthreadMutex)(unsafe.Pointer(m)).typ = (*Tpthread_mutexattr_t)(unsafe.Pointer(a)).F__attr } return 0 } -func Xpthread_mutex_destroy(tls *TLS, mutex uintptr) int32 { +func Xpthread_mutex_destroy(tls *TLS, m uintptr) int32 { + *(*Tpthread_mutex_t)(unsafe.Pointer(m)) = Tpthread_mutex_t{} return 0 } func Xpthread_mutex_lock(tls *TLS, m uintptr) int32 { - (*pthreadMutex)(unsafe.Pointer(m)).outer.Lock() - owner := (*pthreadMutex)(unsafe.Pointer(m)).owner - typ := (*pthreadMutex)(unsafe.Pointer(m)).mType - switch typ { + switch typ := (*pthreadMutex)(unsafe.Pointer(m)).typ; typ { case PTHREAD_MUTEX_NORMAL: - (*pthreadMutex)(unsafe.Pointer(m)).owner = tls.ID - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() (*pthreadMutex)(unsafe.Pointer(m)).Lock() + return 0 case PTHREAD_MUTEX_RECURSIVE: - switch owner { - case 0: + if atomic.CompareAndSwapInt32(&((*pthreadMutex)(unsafe.Pointer(m)).owner), 0, tls.ID) { (*pthreadMutex)(unsafe.Pointer(m)).count = 1 - (*pthreadMutex)(unsafe.Pointer(m)).owner = tls.ID - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() (*pthreadMutex)(unsafe.Pointer(m)).Lock() return 0 - case tls.ID: + } + + if atomic.LoadInt32(&((*pthreadMutex)(unsafe.Pointer(m)).owner)) == tls.ID { (*pthreadMutex)(unsafe.Pointer(m)).count++ - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() return 0 - default: - wait: - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() + } + + for { (*pthreadMutex)(unsafe.Pointer(m)).Lock() - (*pthreadMutex)(unsafe.Pointer(m)).outer.Lock() - if (*pthreadMutex)(unsafe.Pointer(m)).owner != 0 { - goto wait + if atomic.CompareAndSwapInt32(&((*pthreadMutex)(unsafe.Pointer(m)).owner), 0, tls.ID) { + (*pthreadMutex)(unsafe.Pointer(m)).count = 1 + return 0 } - (*pthreadMutex)(unsafe.Pointer(m)).count = 1 - (*pthreadMutex)(unsafe.Pointer(m)).owner = tls.ID - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() - return 0 + (*pthreadMutex)(unsafe.Pointer(m)).Unlock() } default: - panic(todo("typ=%v", typ)) + panic(todo("", typ)) } - return 0 } func Xpthread_mutex_trylock(tls *TLS, m uintptr) int32 { - (*pthreadMutex)(unsafe.Pointer(m)).outer.Lock() - owner := (*pthreadMutex)(unsafe.Pointer(m)).owner - typ := (*pthreadMutex)(unsafe.Pointer(m)).mType - switch typ { + switch typ := (*pthreadMutex)(unsafe.Pointer(m)).typ; typ { case PTHREAD_MUTEX_NORMAL: - if owner != 0 { - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() - return EBUSY + if (*pthreadMutex)(unsafe.Pointer(m)).TryLock() { + return 0 } - (*pthreadMutex)(unsafe.Pointer(m)).owner = tls.ID - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() - (*pthreadMutex)(unsafe.Pointer(m)).Lock() - return 0 + return EBUSY default: panic(todo("typ=%v", typ)) } } func Xpthread_mutex_unlock(tls *TLS, m uintptr) int32 { - (*pthreadMutex)(unsafe.Pointer(m)).outer.Lock() - count := (*pthreadMutex)(unsafe.Pointer(m)).count - owner := (*pthreadMutex)(unsafe.Pointer(m)).owner - typ := (*pthreadMutex)(unsafe.Pointer(m)).mType - switch typ { + switch typ := (*pthreadMutex)(unsafe.Pointer(m)).typ; typ { case PTHREAD_MUTEX_NORMAL: - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() (*pthreadMutex)(unsafe.Pointer(m)).Unlock() return 0 case PTHREAD_MUTEX_RECURSIVE: - switch owner { - case tls.ID: - switch count { - case 1: - (*pthreadMutex)(unsafe.Pointer(m)).owner = 0 - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() - (*pthreadMutex)(unsafe.Pointer(m)).Unlock() - return 0 - default: - (*pthreadMutex)(unsafe.Pointer(m)).count-- - (*pthreadMutex)(unsafe.Pointer(m)).outer.Unlock() - return 0 - } - default: - panic(todo("", owner, tls.ID)) + if atomic.LoadInt32(&((*pthreadMutex)(unsafe.Pointer(m)).owner)) != tls.ID { + return EPERM } + + if atomic.AddInt32(&((*pthreadMutex)(unsafe.Pointer(m)).count), -1) == 0 { + atomic.StoreInt32(&((*pthreadMutex)(unsafe.Pointer(m)).owner), 0) + (*pthreadMutex)(unsafe.Pointer(m)).Unlock() + } + return 0 default: panic(todo("", typ)) } @@ -404,9 +387,8 @@ func Xpthread_cond_timedwait(tls *TLS, c, m, ts uintptr) (r int32) { } }() - switch typ := (*pthreadMutex)(unsafe.Pointer(m)).mType; typ { + switch typ := (*pthreadMutex)(unsafe.Pointer(m)).typ; typ { case PTHREAD_MUTEX_NORMAL: - (*pthreadMutex)(unsafe.Pointer(m)).owner = 0 (*pthreadMutex)(unsafe.Pointer(m)).Unlock() select { case <-ch: @@ -414,7 +396,6 @@ func Xpthread_cond_timedwait(tls *TLS, c, m, ts uintptr) (r int32) { case <-to: r = ETIMEDOUT } - (*pthreadMutex)(unsafe.Pointer(m)).owner = tls.ID (*pthreadMutex)(unsafe.Pointer(m)).Lock() return r default: diff --git a/vendor/modernc.org/libc/stdatomic.go b/vendor/modernc.org/libc/stdatomic.go index 7df6531..bc718bb 100644 --- a/vendor/modernc.org/libc/stdatomic.go +++ b/vendor/modernc.org/libc/stdatomic.go @@ -6,6 +6,7 @@ package libc // import "modernc.org/libc" import ( "sync" + "sync/atomic" "unsafe" ) @@ -21,6 +22,10 @@ var ( // { tmp = *ptr; *ptr op= val; return tmp; } // { tmp = *ptr; *ptr = ~(*ptr & val); return tmp; } // nand +func X__c11_atomic_fetch_addInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { + return X__atomic_fetch_addInt8(t, ptr, val, 0) +} + func X__atomic_fetch_addInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { int8Mu.Lock() @@ -31,6 +36,10 @@ func X__atomic_fetch_addInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { return r } +func X__c11_atomic_fetch_addUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { + return X__atomic_fetch_addUint8(t, ptr, val, 0) +} + func X__atomic_fetch_addUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { int8Mu.Lock() @@ -41,6 +50,10 @@ func X__atomic_fetch_addUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) return r } +func X__c11_atomic_fetch_addInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { + return X__atomic_fetch_addInt16(t, ptr, val, 0) +} + func X__atomic_fetch_addInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { int16Mu.Lock() @@ -51,6 +64,10 @@ func X__atomic_fetch_addInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) return r } +func X__c11_atomic_fetch_addUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { + return X__atomic_fetch_addUint16(t, ptr, val, 0) +} + func X__atomic_fetch_addUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { int16Mu.Lock() @@ -61,6 +78,10 @@ func X__atomic_fetch_addUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint return r } +func X__c11_atomic_fetch_addInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { + return X__atomic_fetch_addInt32(t, ptr, val, 0) +} + func X__atomic_fetch_addInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { int32Mu.Lock() @@ -71,6 +92,10 @@ func X__atomic_fetch_addInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) return r } +func X__c11_atomic_fetch_addUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { + return X__atomic_fetch_addUint32(t, ptr, val, 0) +} + func X__atomic_fetch_addUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { int32Mu.Lock() @@ -81,6 +106,10 @@ func X__atomic_fetch_addUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint return r } +func X__c11_atomic_fetch_addInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { + return X__atomic_fetch_addInt64(t, ptr, val, 0) +} + func X__atomic_fetch_addInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { int64Mu.Lock() @@ -91,6 +120,10 @@ func X__atomic_fetch_addInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) return r } +func X__c11_atomic_fetch_addUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { + return X__atomic_fetch_addUint64(t, ptr, val, 0) +} + func X__atomic_fetch_addUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { int64Mu.Lock() @@ -103,6 +136,10 @@ func X__atomic_fetch_addUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint // ---- +func X__c11_atomic_fetch_andInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { + return X__atomic_fetch_andInt8(t, ptr, val, 0) +} + func X__atomic_fetch_andInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { int8Mu.Lock() @@ -113,6 +150,10 @@ func X__atomic_fetch_andInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { return r } +func X__c11_atomic_fetch_andUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { + return X__atomic_fetch_andUint8(t, ptr, val, 0) +} + func X__atomic_fetch_andUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { int8Mu.Lock() @@ -123,6 +164,10 @@ func X__atomic_fetch_andUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) return r } +func X__c11_atomic_fetch_andInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { + return X__atomic_fetch_andInt16(t, ptr, val, 0) +} + func X__atomic_fetch_andInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { int16Mu.Lock() @@ -133,6 +178,10 @@ func X__atomic_fetch_andInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) return r } +func X__c11_atomic_fetch_andUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { + return X__atomic_fetch_andUint16(t, ptr, val, 0) +} + func X__atomic_fetch_andUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { int16Mu.Lock() @@ -143,6 +192,10 @@ func X__atomic_fetch_andUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint return r } +func X__c11_atomic_fetch_andInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { + return X__atomic_fetch_andInt32(t, ptr, val, 0) +} + func X__atomic_fetch_andInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { int32Mu.Lock() @@ -153,6 +206,10 @@ func X__atomic_fetch_andInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) return r } +func X__c11_atomic_fetch_andUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { + return X__atomic_fetch_andUint32(t, ptr, val, 0) +} + func X__atomic_fetch_andUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { int32Mu.Lock() @@ -163,6 +220,10 @@ func X__atomic_fetch_andUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint return r } +func X__c11_atomic_fetch_andInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { + return X__atomic_fetch_andInt64(t, ptr, val, 0) +} + func X__atomic_fetch_andInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { int64Mu.Lock() @@ -173,6 +234,10 @@ func X__atomic_fetch_andInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) return r } +func X__c11_atomic_fetch_andUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { + return X__atomic_fetch_andUint64(t, ptr, val, 0) +} + func X__atomic_fetch_andUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { int64Mu.Lock() @@ -185,6 +250,10 @@ func X__atomic_fetch_andUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint // ---- +func X__c11_atomic_fetch_orInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { + return X__atomic_fetch_orInt8(t, ptr, val, 0) +} + func X__atomic_fetch_orInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { int8Mu.Lock() @@ -195,6 +264,10 @@ func X__atomic_fetch_orInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { return r } +func X__c11_atomic_fetch_orUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { + return X__atomic_fetch_orUint8(t, ptr, val, 0) +} + func X__atomic_fetch_orUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { int8Mu.Lock() @@ -205,6 +278,10 @@ func X__atomic_fetch_orUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) return r } +func X__c11_atomic_fetch_orInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { + return X__atomic_fetch_orInt16(t, ptr, val, 0) +} + func X__atomic_fetch_orInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { int16Mu.Lock() @@ -215,6 +292,10 @@ func X__atomic_fetch_orInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) return r } +func X__c11_atomic_fetch_orUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { + return X__atomic_fetch_orUint16(t, ptr, val, 0) +} + func X__atomic_fetch_orUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { int16Mu.Lock() @@ -225,6 +306,10 @@ func X__atomic_fetch_orUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint1 return r } +func X__c11_atomic_fetch_orInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { + return X__atomic_fetch_orInt32(t, ptr, val, 0) +} + func X__atomic_fetch_orInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { int32Mu.Lock() @@ -235,6 +320,10 @@ func X__atomic_fetch_orInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) return r } +func X__c11_atomic_fetch_orUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { + return X__atomic_fetch_orUint32(t, ptr, val, 0) +} + func X__atomic_fetch_orUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { int32Mu.Lock() @@ -245,6 +334,10 @@ func X__atomic_fetch_orUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint3 return r } +func X__c11_atomic_fetch_orInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { + return X__atomic_fetch_orInt64(t, ptr, val, 0) +} + func X__atomic_fetch_orInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { int64Mu.Lock() @@ -255,6 +348,10 @@ func X__atomic_fetch_orInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) return r } +func X__c11_atomic_fetch_orUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { + return X__atomic_fetch_orUint64(t, ptr, val, 0) +} + func X__atomic_fetch_orUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { int64Mu.Lock() @@ -267,6 +364,10 @@ func X__atomic_fetch_orUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint6 // ---- +func X__c11_atomic_fetch_subInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { + return X__atomic_fetch_subInt8(t, ptr, val, 0) +} + func X__atomic_fetch_subInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { int8Mu.Lock() @@ -277,6 +378,10 @@ func X__atomic_fetch_subInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { return r } +func X__c11_atomic_fetch_subUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { + return X__atomic_fetch_subUint8(t, ptr, val, 0) +} + func X__atomic_fetch_subUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { int8Mu.Lock() @@ -287,6 +392,10 @@ func X__atomic_fetch_subUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) return r } +func X__c11_atomic_fetch_subInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { + return X__atomic_fetch_subInt16(t, ptr, val, 0) +} + func X__atomic_fetch_subInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { int16Mu.Lock() @@ -297,6 +406,10 @@ func X__atomic_fetch_subInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) return r } +func X__c11_atomic_fetch_subUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { + return X__atomic_fetch_subUint16(t, ptr, val, 0) +} + func X__atomic_fetch_subUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { int16Mu.Lock() @@ -307,6 +420,10 @@ func X__atomic_fetch_subUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint return r } +func X__c11_atomic_fetch_subInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { + return X__atomic_fetch_subInt32(t, ptr, val, 0) +} + func X__atomic_fetch_subInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { int32Mu.Lock() @@ -317,6 +434,10 @@ func X__atomic_fetch_subInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) return r } +func X__c11_atomic_fetch_subUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { + return X__atomic_fetch_subUint32(t, ptr, val, 0) +} + func X__atomic_fetch_subUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { int32Mu.Lock() @@ -327,6 +448,10 @@ func X__atomic_fetch_subUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint return r } +func X__c11_atomic_fetch_subInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { + return X__atomic_fetch_subInt64(t, ptr, val, 0) +} + func X__atomic_fetch_subInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { int64Mu.Lock() @@ -337,6 +462,10 @@ func X__atomic_fetch_subInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) return r } +func X__c11_atomic_fetch_subUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { + return X__atomic_fetch_subUint64(t, ptr, val, 0) +} + func X__atomic_fetch_subUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { int64Mu.Lock() @@ -349,6 +478,10 @@ func X__atomic_fetch_subUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint // ---- +func X__c11_atomic_fetch_xorInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { + return X__atomic_fetch_xorInt8(t, ptr, val, 0) +} + func X__atomic_fetch_xorInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { int8Mu.Lock() @@ -359,6 +492,10 @@ func X__atomic_fetch_xorInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { return r } +func X__c11_atomic_fetch_xorUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { + return X__atomic_fetch_xorUint8(t, ptr, val, 0) +} + func X__atomic_fetch_xorUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { int8Mu.Lock() @@ -369,6 +506,10 @@ func X__atomic_fetch_xorUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) return r } +func X__c11_atomic_fetch_xorInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { + return X__atomic_fetch_xorInt16(t, ptr, val, 0) +} + func X__atomic_fetch_xorInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { int16Mu.Lock() @@ -379,6 +520,10 @@ func X__atomic_fetch_xorInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) return r } +func X__c11_atomic_fetch_xorUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { + return X__atomic_fetch_xorUint16(t, ptr, val, 0) +} + func X__atomic_fetch_xorUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { int16Mu.Lock() @@ -389,6 +534,10 @@ func X__atomic_fetch_xorUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint return r } +func X__c11_atomic_fetch_xorInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { + return X__atomic_fetch_xorInt32(t, ptr, val, 0) +} + func X__atomic_fetch_xorInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { int32Mu.Lock() @@ -399,6 +548,10 @@ func X__atomic_fetch_xorInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) return r } +func X__c11_atomic_fetch_xorUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { + return X__atomic_fetch_xorUint32(t, ptr, val, 0) +} + func X__atomic_fetch_xorUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { int32Mu.Lock() @@ -409,6 +562,10 @@ func X__atomic_fetch_xorUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint return r } +func X__c11_atomic_fetch_xorInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { + return X__atomic_fetch_xorInt64(t, ptr, val, 0) +} + func X__atomic_fetch_xorInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { int64Mu.Lock() @@ -419,6 +576,10 @@ func X__atomic_fetch_xorInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) return r } +func X__c11_atomic_fetch_xorUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { + return X__atomic_fetch_xorUint64(t, ptr, val, 0) +} + func X__atomic_fetch_xorUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { int64Mu.Lock() @@ -433,6 +594,16 @@ func X__atomic_fetch_xorUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint // void __atomic_exchange (type *ptr, type *val, type *ret, int memorder) +func X__c11_atomic_exchangeInt8(t *TLS, ptr uintptr, val int8, _ int32) (r int8) { + int8Mu.Lock() + + defer int8Mu.Unlock() + + r = *(*int8)(unsafe.Pointer(ptr)) + *(*int8)(unsafe.Pointer(ptr)) = val + return r +} + func X__atomic_exchangeInt8(t *TLS, ptr, val, ret uintptr, _ int32) { int8Mu.Lock() @@ -442,6 +613,16 @@ func X__atomic_exchangeInt8(t *TLS, ptr, val, ret uintptr, _ int32) { *(*int8)(unsafe.Pointer(ptr)) = *(*int8)(unsafe.Pointer(val)) } +func X__c11_atomic_exchangeUint8(t *TLS, ptr uintptr, val uint8, _ int32) (r uint8) { + int8Mu.Lock() + + defer int8Mu.Unlock() + + r = *(*uint8)(unsafe.Pointer(ptr)) + *(*uint8)(unsafe.Pointer(ptr)) = val + return r +} + func X__atomic_exchangeUint8(t *TLS, ptr, val, ret uintptr, _ int32) { int8Mu.Lock() @@ -451,6 +632,16 @@ func X__atomic_exchangeUint8(t *TLS, ptr, val, ret uintptr, _ int32) { *(*uint8)(unsafe.Pointer(ptr)) = *(*uint8)(unsafe.Pointer(val)) } +func X__c11_atomic_exchangeInt16(t *TLS, ptr uintptr, val int16, _ int32) (r int16) { + int16Mu.Lock() + + defer int16Mu.Unlock() + + r = *(*int16)(unsafe.Pointer(ptr)) + *(*int16)(unsafe.Pointer(ptr)) = val + return r +} + func X__atomic_exchangeInt16(t *TLS, ptr, val, ret uintptr, _ int32) { int16Mu.Lock() @@ -460,6 +651,16 @@ func X__atomic_exchangeInt16(t *TLS, ptr, val, ret uintptr, _ int32) { *(*int16)(unsafe.Pointer(ptr)) = *(*int16)(unsafe.Pointer(val)) } +func X__c11_atomic_exchangeUint16(t *TLS, ptr uintptr, val uint16, _ int32) (r uint16) { + int16Mu.Lock() + + defer int16Mu.Unlock() + + r = *(*uint16)(unsafe.Pointer(ptr)) + *(*uint16)(unsafe.Pointer(ptr)) = val + return r +} + func X__atomic_exchangeUint16(t *TLS, ptr, val, ret uintptr, _ int32) { int16Mu.Lock() @@ -469,40 +670,36 @@ func X__atomic_exchangeUint16(t *TLS, ptr, val, ret uintptr, _ int32) { *(*uint16)(unsafe.Pointer(ptr)) = *(*uint16)(unsafe.Pointer(val)) } -func X__atomic_exchangeInt32(t *TLS, ptr, val, ret uintptr, _ int32) { - int32Mu.Lock() +func X__c11_atomic_exchangeInt32(t *TLS, ptr uintptr, val int32, _ int32) (r int32) { + return atomic.SwapInt32((*int32)(unsafe.Pointer(ptr)), val) +} - defer int32Mu.Unlock() +func X__atomic_exchangeInt32(t *TLS, ptr, val, ret uintptr, _ int32) { + *(*int32)(unsafe.Pointer(ret)) = atomic.SwapInt32((*int32)(unsafe.Pointer(ptr)), *(*int32)(unsafe.Pointer(val))) +} - *(*int32)(unsafe.Pointer(ret)) = *(*int32)(unsafe.Pointer(ptr)) - *(*int32)(unsafe.Pointer(ptr)) = *(*int32)(unsafe.Pointer(val)) +func X__c11_atomic_exchangeUint32(t *TLS, ptr uintptr, val uint32, _ int32) (r uint32) { + return uint32(atomic.SwapInt32((*int32)(unsafe.Pointer(ptr)), int32(val))) } func X__atomic_exchangeUint32(t *TLS, ptr, val, ret uintptr, _ int32) { - int32Mu.Lock() - - defer int32Mu.Unlock() + *(*uint32)(unsafe.Pointer(ret)) = atomic.SwapUint32((*uint32)(unsafe.Pointer(ptr)), *(*uint32)(unsafe.Pointer(val))) +} - *(*uint32)(unsafe.Pointer(ret)) = *(*uint32)(unsafe.Pointer(ptr)) - *(*uint32)(unsafe.Pointer(ptr)) = *(*uint32)(unsafe.Pointer(val)) +func X__c11_atomic_exchangeInt64(t *TLS, ptr uintptr, val int64, _ int32) (r int64) { + return atomic.SwapInt64((*int64)(unsafe.Pointer(ptr)), val) } func X__atomic_exchangeInt64(t *TLS, ptr, val, ret uintptr, _ int32) { - int64Mu.Lock() - - defer int64Mu.Unlock() + *(*int64)(unsafe.Pointer(ret)) = atomic.SwapInt64((*int64)(unsafe.Pointer(ptr)), *(*int64)(unsafe.Pointer(val))) +} - *(*int64)(unsafe.Pointer(ret)) = *(*int64)(unsafe.Pointer(ptr)) - *(*int64)(unsafe.Pointer(ptr)) = *(*int64)(unsafe.Pointer(val)) +func X__c11_atomic_exchangeUint64(t *TLS, ptr uintptr, val uint64, _ int32) (r uint64) { + return uint64(atomic.SwapInt64((*int64)(unsafe.Pointer(ptr)), int64(val))) } func X__atomic_exchangeUint64(t *TLS, ptr, val, ret uintptr, _ int32) { - int64Mu.Lock() - - defer int64Mu.Unlock() - - *(*uint64)(unsafe.Pointer(ret)) = *(*uint64)(unsafe.Pointer(ptr)) - *(*uint64)(unsafe.Pointer(ptr)) = *(*uint64)(unsafe.Pointer(val)) + *(*uint64)(unsafe.Pointer(ret)) = atomic.SwapUint64((*uint64)(unsafe.Pointer(ptr)), *(*uint64)(unsafe.Pointer(val))) } // ---- @@ -605,10 +802,94 @@ func X__atomic_compare_exchangeUint64(t *TLS, ptr, expected, desired uintptr, we return X__atomic_compare_exchangeInt64(t, ptr, expected, desired, weak, success, failure) } +func X__c11_atomic_compare_exchange_strongInt8(t *TLS, ptr, expected uintptr, desired int8, success, failure int32) int32 { + int8Mu.Lock() + + defer int8Mu.Unlock() + + have := *(*int8)(unsafe.Pointer(ptr)) + if have == *(*int8)(unsafe.Pointer(expected)) { + *(*int8)(unsafe.Pointer(ptr)) = desired + return 1 + } + + *(*int8)(unsafe.Pointer(expected)) = have + return 0 +} + +func X__c11_atomic_compare_exchange_strongUint8(t *TLS, ptr, expected uintptr, desired uint8, success, failure int32) int32 { + return X__c11_atomic_compare_exchange_strongInt8(t, ptr, expected, int8(desired), success, failure) +} + +func X__c11_atomic_compare_exchange_strongInt16(t *TLS, ptr, expected uintptr, desired int16, success, failure int32) int32 { + int16Mu.Lock() + + defer int16Mu.Unlock() + + have := *(*int16)(unsafe.Pointer(ptr)) + if have == *(*int16)(unsafe.Pointer(expected)) { + *(*int16)(unsafe.Pointer(ptr)) = desired + return 1 + } + + *(*int16)(unsafe.Pointer(expected)) = have + return 0 +} + +func X__c11_atomic_compare_exchange_strongUint16(t *TLS, ptr, expected uintptr, desired uint16, success, failure int32) int32 { + return X__c11_atomic_compare_exchange_strongInt16(t, ptr, expected, int16(desired), success, failure) +} + +func X__c11_atomic_compare_exchange_strongInt32(t *TLS, ptr, expected uintptr, desired, success, failure int32) int32 { + int32Mu.Lock() + + defer int32Mu.Unlock() + + have := *(*int32)(unsafe.Pointer(ptr)) + if have == *(*int32)(unsafe.Pointer(expected)) { + *(*int32)(unsafe.Pointer(ptr)) = desired + return 1 + } + + *(*int32)(unsafe.Pointer(expected)) = have + return 0 +} + +func X__c11_atomic_compare_exchange_strongUint32(t *TLS, ptr, expected uintptr, desired uint32, success, failure int32) int32 { + return X__c11_atomic_compare_exchange_strongInt32(t, ptr, expected, int32(desired), success, failure) +} + +func X__c11_atomic_compare_exchange_strongInt64(t *TLS, ptr, expected uintptr, desired int64, success, failure int32) int32 { + int64Mu.Lock() + + defer int64Mu.Unlock() + + have := *(*int64)(unsafe.Pointer(ptr)) + if have == *(*int64)(unsafe.Pointer(expected)) { + *(*int64)(unsafe.Pointer(ptr)) = desired + return 1 + } + + *(*int64)(unsafe.Pointer(expected)) = have + return 0 +} + +func X__c11_atomic_compare_exchange_strongUint64(t *TLS, ptr, expected uintptr, desired uint64, success, failure int32) int32 { + return X__c11_atomic_compare_exchange_strongInt64(t, ptr, expected, int64(desired), success, failure) +} + // ---- // void __atomic_load (type *ptr, type *ret, int memorder) +func X__c11_atomic_loadInt8(t *TLS, ptr uintptr, memorder int32) (r int8) { + int8Mu.Lock() + + defer int8Mu.Unlock() + + return *(*int8)(unsafe.Pointer(ptr)) +} + func X__atomic_loadInt8(t *TLS, ptr, ret uintptr, memorder int32) { int8Mu.Lock() @@ -617,10 +898,22 @@ func X__atomic_loadInt8(t *TLS, ptr, ret uintptr, memorder int32) { *(*int8)(unsafe.Pointer(ret)) = *(*int8)(unsafe.Pointer(ptr)) } +func X__c11_atomic_loadUint8(t *TLS, ptr uintptr, memorder int32) (r uint8) { + return uint8(X__c11_atomic_loadInt8(t, ptr, memorder)) +} + func X__atomic_loadUint8(t *TLS, ptr, ret uintptr, memorder int32) { X__atomic_loadInt8(t, ptr, ret, memorder) } +func X__c11_atomic_loadInt16(t *TLS, ptr uintptr, memorder int32) (r int16) { + int16Mu.Lock() + + defer int16Mu.Unlock() + + return *(*int16)(unsafe.Pointer(ptr)) +} + func X__atomic_loadInt16(t *TLS, ptr, ret uintptr, memorder int32) { int16Mu.Lock() @@ -629,28 +922,40 @@ func X__atomic_loadInt16(t *TLS, ptr, ret uintptr, memorder int32) { *(*int16)(unsafe.Pointer(ret)) = *(*int16)(unsafe.Pointer(ptr)) } +func X__c11_atomic_loadUint16(t *TLS, ptr uintptr, memorder int32) (r uint16) { + return uint16(X__c11_atomic_loadInt16(t, ptr, memorder)) +} + func X__atomic_loadUint16(t *TLS, ptr, ret uintptr, memorder int32) { X__atomic_loadInt16(t, ptr, ret, memorder) } -func X__atomic_loadInt32(t *TLS, ptr, ret uintptr, memorder int32) { - int32Mu.Lock() +func X__c11_atomic_loadInt32(t *TLS, ptr uintptr, memorder int32) (r int32) { + return atomic.LoadInt32((*int32)(unsafe.Pointer(ptr))) +} - defer int32Mu.Unlock() +func X__atomic_loadInt32(t *TLS, ptr, ret uintptr, memorder int32) { + *(*int32)(unsafe.Pointer(ret)) = atomic.LoadInt32((*int32)(unsafe.Pointer(ptr))) +} - *(*int32)(unsafe.Pointer(ret)) = *(*int32)(unsafe.Pointer(ptr)) +func X__c11_atomic_loadUint32(t *TLS, ptr uintptr, memorder int32) (r uint32) { + return uint32(X__c11_atomic_loadInt32(t, ptr, memorder)) } func X__atomic_loadUint32(t *TLS, ptr, ret uintptr, memorder int32) { X__atomic_loadInt32(t, ptr, ret, memorder) } -func X__atomic_loadInt64(t *TLS, ptr, ret uintptr, memorder int32) { - int64Mu.Lock() +func X__c11_atomic_loadInt64(t *TLS, ptr uintptr, memorder int32) (r int64) { + return atomic.LoadInt64((*int64)(unsafe.Pointer(ptr))) +} - defer int64Mu.Unlock() +func X__atomic_loadInt64(t *TLS, ptr, ret uintptr, memorder int32) { + *(*int64)(unsafe.Pointer(ret)) = atomic.LoadInt64((*int64)(unsafe.Pointer(ptr))) +} - *(*int64)(unsafe.Pointer(ret)) = *(*int64)(unsafe.Pointer(ptr)) +func X__c11_atomic_loadUint64(t *TLS, ptr uintptr, memorder int32) (r uint64) { + return uint64(X__c11_atomic_loadInt64(t, ptr, memorder)) } func X__atomic_loadUint64(t *TLS, ptr, ret uintptr, memorder int32) { @@ -661,6 +966,14 @@ func X__atomic_loadUint64(t *TLS, ptr, ret uintptr, memorder int32) { // void __atomic_store (type *ptr, type *val, int memorder) +func X__c11_atomic_storeInt8(t *TLS, ptr uintptr, val int8, memorder int32) { + int8Mu.Lock() + + defer int8Mu.Unlock() + + *(*int8)(unsafe.Pointer(ptr)) = val +} + func X__atomic_storeInt8(t *TLS, ptr, val uintptr, memorder int32) { int8Mu.Lock() @@ -669,10 +982,22 @@ func X__atomic_storeInt8(t *TLS, ptr, val uintptr, memorder int32) { *(*int8)(unsafe.Pointer(ptr)) = *(*int8)(unsafe.Pointer(val)) } +func X__c11_atomic_storeUint8(t *TLS, ptr uintptr, val uint8, memorder int32) { + X__c11_atomic_storeInt8(t, ptr, int8(val), memorder) +} + func X__atomic_storeUint8(t *TLS, ptr, val uintptr, memorder int32) { X__atomic_storeInt8(t, ptr, val, memorder) } +func X__c11_atomic_storeInt16(t *TLS, ptr uintptr, val int16, memorder int32) { + int16Mu.Lock() + + defer int16Mu.Unlock() + + *(*int16)(unsafe.Pointer(ptr)) = val +} + func X__atomic_storeInt16(t *TLS, ptr, val uintptr, memorder int32) { int16Mu.Lock() @@ -681,30 +1006,139 @@ func X__atomic_storeInt16(t *TLS, ptr, val uintptr, memorder int32) { *(*int16)(unsafe.Pointer(ptr)) = *(*int16)(unsafe.Pointer(val)) } +func X__c11_atomic_storeUint16(t *TLS, ptr uintptr, val uint16, memorder int32) { + X__c11_atomic_storeInt16(t, ptr, int16(val), memorder) +} + func X__atomic_storeUint16(t *TLS, ptr, val uintptr, memorder int32) { X__atomic_storeInt16(t, ptr, val, memorder) } -func X__atomic_storeInt32(t *TLS, ptr, val uintptr, memorder int32) { - int32Mu.Lock() +func X__c11_atomic_storeInt32(t *TLS, ptr uintptr, val int32, memorder int32) { + atomic.StoreInt32((*int32)(unsafe.Pointer(ptr)), val) +} - defer int32Mu.Unlock() +func X__atomic_storeInt32(t *TLS, ptr, val uintptr, memorder int32) { + atomic.StoreInt32((*int32)(unsafe.Pointer(ptr)), *(*int32)(unsafe.Pointer(val))) +} - *(*int32)(unsafe.Pointer(ptr)) = *(*int32)(unsafe.Pointer(val)) +func X__c11_atomic_storeUint32(t *TLS, ptr uintptr, val uint32, memorder int32) { + X__c11_atomic_storeInt32(t, ptr, int32(val), memorder) } func X__atomic_storeUint32(t *TLS, ptr, val uintptr, memorder int32) { X__atomic_storeInt32(t, ptr, val, memorder) } +func X__c11_atomic_storeInt64(t *TLS, ptr uintptr, val int64, memorder int32) { + atomic.StoreInt64((*int64)(unsafe.Pointer(ptr)), val) +} + func X__atomic_storeInt64(t *TLS, ptr, val uintptr, memorder int32) { + atomic.StoreInt64((*int64)(unsafe.Pointer(ptr)), *(*int64)(unsafe.Pointer(val))) +} + +func X__c11_atomic_storeUint64(t *TLS, ptr uintptr, val uint64, memorder int32) { + X__c11_atomic_storeInt64(t, ptr, int64(val), memorder) +} + +func X__atomic_storeUint64(t *TLS, ptr, val uintptr, memorder int32) { + X__atomic_storeInt64(t, ptr, val, memorder) +} + +// type __sync_val_compare_and_swap (type *ptr, type oldval type newval, ...) +func X__sync_val_compare_and_swapInt8(t *TLS, ptr uintptr, oldval, newval int8) (r int8) { + int8Mu.Lock() + + defer int8Mu.Unlock() + + if r = *(*int8)(unsafe.Pointer(ptr)); r == oldval { + *(*int8)(unsafe.Pointer(ptr)) = newval + } + + return r +} + +func X__sync_val_compare_and_swapUint8(t *TLS, ptr uintptr, oldval, newval uint8) (r uint8) { + int8Mu.Lock() + + defer int8Mu.Unlock() + + if r = *(*uint8)(unsafe.Pointer(ptr)); r == oldval { + *(*uint8)(unsafe.Pointer(ptr)) = newval + } + + return r +} + +func X__sync_val_compare_and_swapInt16(t *TLS, ptr uintptr, oldval, newval int16) (r int16) { + int16Mu.Lock() + + defer int16Mu.Unlock() + + if r = *(*int16)(unsafe.Pointer(ptr)); r == oldval { + *(*int16)(unsafe.Pointer(ptr)) = newval + } + + return r +} + +func X__sync_val_compare_and_swapUint16(t *TLS, ptr uintptr, oldval, newval uint16) (r uint16) { + int16Mu.Lock() + + defer int16Mu.Unlock() + + if r = *(*uint16)(unsafe.Pointer(ptr)); r == oldval { + *(*uint16)(unsafe.Pointer(ptr)) = newval + } + + return r +} + +func X__sync_val_compare_and_swapInt32(t *TLS, ptr uintptr, oldval, newval int32) (r int32) { + int32Mu.Lock() + + defer int32Mu.Unlock() + + if r = *(*int32)(unsafe.Pointer(ptr)); r == oldval { + *(*int32)(unsafe.Pointer(ptr)) = newval + } + + return r +} + +func X__sync_val_compare_and_swapUint32(t *TLS, ptr uintptr, oldval, newval uint32) (r uint32) { + int32Mu.Lock() + + defer int32Mu.Unlock() + + if r = *(*uint32)(unsafe.Pointer(ptr)); r == oldval { + *(*uint32)(unsafe.Pointer(ptr)) = newval + } + + return r +} + +func X__sync_val_compare_and_swapInt64(t *TLS, ptr uintptr, oldval, newval int64) (r int64) { int64Mu.Lock() defer int64Mu.Unlock() - *(*int64)(unsafe.Pointer(ptr)) = *(*int64)(unsafe.Pointer(val)) + if r = *(*int64)(unsafe.Pointer(ptr)); r == oldval { + *(*int64)(unsafe.Pointer(ptr)) = newval + } + + return r } -func X__atomic_storeUint64(t *TLS, ptr, val uintptr, memorder int32) { - X__atomic_storeInt64(t, ptr, val, memorder) +func X__sync_val_compare_and_swapUint64(t *TLS, ptr uintptr, oldval, newval uint64) (r uint64) { + int64Mu.Lock() + + defer int64Mu.Unlock() + + if r = *(*uint64)(unsafe.Pointer(ptr)); r == oldval { + *(*uint64)(unsafe.Pointer(ptr)) = newval + } + + return r } diff --git a/vendor/modernc.org/libc/tls_linux_amd64.go b/vendor/modernc.org/libc/tls_linux_amd64.go new file mode 100644 index 0000000..cba2c44 --- /dev/null +++ b/vendor/modernc.org/libc/tls_linux_amd64.go @@ -0,0 +1,33 @@ +// Copyright 2025 The Libc Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package libc // import "modernc.org/libc" + +//go:noescape +func TLSAlloc(p0 *TLS, p1 int) uintptr + +//go:noescape +func TLSFree(p0 *TLS, p1 int) + +//go:noescape +func TLSAllocaEntry(p0 *TLS) + +//go:noescape +func TLSAllocaExit(p0 *TLS) + +func tlsAlloc(tls *TLS, n int) uintptr { + return tls.Alloc(n) +} + +func tlsFree(tls *TLS, n int) { + tls.Free(n) +} + +func tlsAllocaEntry(tls *TLS) { + tls.AllocaEntry() +} + +func tlsAllocaExit(tls *TLS) { + tls.AllocaExit() +} diff --git a/vendor/modernc.org/libc/tls_linux_amd64.s b/vendor/modernc.org/libc/tls_linux_amd64.s new file mode 100644 index 0000000..d726787 --- /dev/null +++ b/vendor/modernc.org/libc/tls_linux_amd64.s @@ -0,0 +1,40 @@ +#include "funcdata.h" +#include "textflag.h" + +TEXT ·TLSAlloc(SB),$24-24 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ p0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·tlsAlloc(SB) + MOVQ 16(SP), AX + MOVQ AX, ret+16(FP) + RET + +TEXT ·TLSFree(SB),$16-16 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ p0+0(FP), AX + MOVQ AX, 0(SP) + MOVQ p1+8(FP), AX + MOVQ AX, 8(SP) + CALL ·tlsFree(SB) + RET + +TEXT ·TLSAllocaEntry(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ p0+0(FP), AX + MOVQ AX, 0(SP) + CALL ·tlsAllocaEntry(SB) + RET + +TEXT ·TLSAllocaExit(SB),$8-8 + GO_ARGS + NO_LOCAL_POINTERS + MOVQ p0+0(FP), AX + MOVQ AX, 0(SP) + CALL ·tlsAllocaExit(SB) + RET diff --git a/vendor/modernc.org/libc/unconvert.sh b/vendor/modernc.org/libc/unconvert.sh deleted file mode 100644 index 93fba25..0000000 --- a/vendor/modernc.org/libc/unconvert.sh +++ /dev/null @@ -1,6 +0,0 @@ -set -evx -until unconvert -fastmath ./... -do - unconvert -fastmath -apply ./... -done -git checkout -f pthread_musl.go diff --git a/vendor/modernc.org/memory/LICENSE-LOGO b/vendor/modernc.org/memory/LICENSE-LOGO new file mode 100644 index 0000000..ec496d1 --- /dev/null +++ b/vendor/modernc.org/memory/LICENSE-LOGO @@ -0,0 +1 @@ +https://commons.wikimedia.org/wiki/File:Memory_infra_logo.png diff --git a/vendor/modernc.org/memory/Makefile b/vendor/modernc.org/memory/Makefile index f844f13..40a9132 100644 --- a/vendor/modernc.org/memory/Makefile +++ b/vendor/modernc.org/memory/Makefile @@ -37,30 +37,59 @@ editor: build_all_targets: GOOS=darwin GOARCH=amd64 go build + GOOS=darwin GOARCH=amd64 staticcheck GOOS=darwin GOARCH=arm64 go build + GOOS=darwin GOARCH=arm64 staticcheck GOOS=freebsd GOARCH=386 go build + GOOS=freebsd GOARCH=386 staticcheck GOOS=freebsd GOARCH=amd64 go build + GOOS=freebsd GOARCH=amd64 staticcheck GOOS=freebsd GOARCH=arm go build + GOOS=freebsd GOARCH=arm staticcheck GOOS=freebsd GOARCH=arm64 go build + GOOS=freebsd GOARCH=arm64 staticcheck GOOS=illumos GOARCH=amd64 go build + GOOS=illumos GOARCH=amd64 staticcheck GOOS=linux GOARCH=386 go build + GOOS=linux GOARCH=386 staticcheck GOOS=linux GOARCH=amd64 go build + GOOS=linux GOARCH=amd64 staticcheck GOOS=linux GOARCH=arm go build + GOOS=linux GOARCH=arm staticcheck GOOS=linux GOARCH=arm64 go build + GOOS=linux GOARCH=arm64 staticcheck GOOS=linux GOARCH=loong64 go build + GOOS=linux GOARCH=loong64 staticcheck GOOS=linux GOARCH=mips go build + GOOS=linux GOARCH=mips staticcheck GOOS=linux GOARCH=mips64le go build + GOOS=linux GOARCH=mips64le staticcheck GOOS=linux GOARCH=mipsle go build + GOOS=linux GOARCH=mipsle staticcheck + GOOS=linux GOARCH=ppc64le go build + GOOS=linux GOARCH=ppc64le staticcheck GOOS=linux GOARCH=riscv64 go build + GOOS=linux GOARCH=riscv64 staticcheck GOOS=linux GOARCH=s390x go build + GOOS=linux GOARCH=s390x staticcheck GOOS=netbsd GOARCH=386 go build + GOOS=netbsd GOARCH=386 staticcheck GOOS=netbsd GOARCH=amd64 go build + GOOS=netbsd GOARCH=amd64 staticcheck GOOS=netbsd GOARCH=arm go build + GOOS=netbsd GOARCH=arm staticcheck GOOS=openbsd GOARCH=386 go build + GOOS=openbsd GOARCH=386 staticcheck GOOS=openbsd GOARCH=amd64 go build + GOOS=openbsd GOARCH=amd64 staticcheck GOOS=openbsd GOARCH=arm64 go build + GOOS=openbsd GOARCH=arm64 staticcheck GOOS=windows GOARCH=386 go build + GOOS=windows GOARCH=386 staticcheck GOOS=windows GOARCH=amd64 go build + GOOS=windows GOARCH=amd64 staticcheck + GOOS=windows GOARCH=arm64 go build + GOOS=windows GOARCH=arm64 staticcheck internalError: egrep -ho '"internal error.*"' *.go | sort | cat -n diff --git a/vendor/modernc.org/memory/README.md b/vendor/modernc.org/memory/README.md index 9354a36..02c3012 100644 --- a/vendor/modernc.org/memory/README.md +++ b/vendor/modernc.org/memory/README.md @@ -1,4 +1,4 @@ -# memory +![logo-png](logo.png) Package memory implements a memory allocator. @@ -10,4 +10,4 @@ Installation $ go get modernc.org/memory -Documentation: [godoc.org/modernc.org/memory](http://godoc.org/modernc.org/memory) +[![Go Reference](https://pkg.go.dev/badge/modernc.org/memory.0.svg)](https://pkg.go.dev/modernc.org/memory) diff --git a/vendor/modernc.org/memory/logo.png b/vendor/modernc.org/memory/logo.png new file mode 100644 index 0000000..ba4eb20 Binary files /dev/null and b/vendor/modernc.org/memory/logo.png differ diff --git a/vendor/modernc.org/memory/memory.go b/vendor/modernc.org/memory/memory.go index c6d02df..6593c42 100644 --- a/vendor/modernc.org/memory/memory.go +++ b/vendor/modernc.org/memory/memory.go @@ -57,7 +57,6 @@ import ( "fmt" "math/bits" "os" - "reflect" "unsafe" ) @@ -110,6 +109,12 @@ func (a *Allocator) mmap(size int) (uintptr /* *page */, error) { return 0, err } + //TODO(jnml) The returned size may now be nearly as twice as large as we asked + //for. Use that extra capacity. For that we need to move the respective + //Allocator.cap item into the page struct so the page cap becomes dynamic. + // + // Related: This is a consequence of fixing the bigsort.test failures on + // linux/s390x, see: https://gitlab.com/cznic/sqlite/-/issues/207 if counters { a.Mmaps++ a.Bytes += size @@ -352,12 +357,7 @@ func (a *Allocator) Calloc(size int) (r []byte, err error) { return nil, err } - var b []byte - sh := (*reflect.SliceHeader)(unsafe.Pointer(&b)) - sh.Cap = usableSize(p) - sh.Data = p - sh.Len = size - return b, nil + return (*rawmem)(unsafe.Pointer(p))[:size:usableSize(p)], nil } // Close releases all OS resources used by a and sets it to its zero value. @@ -396,11 +396,7 @@ func (a *Allocator) Malloc(size int) (r []byte, err error) { return nil, err } - sh := (*reflect.SliceHeader)(unsafe.Pointer(&r)) - sh.Cap = usableSize(p) - sh.Data = p - sh.Len = size - return r, nil + return (*rawmem)(unsafe.Pointer(p))[:size:usableSize(p)], nil } // Realloc changes the size of the backing array of b to size bytes or returns @@ -422,11 +418,7 @@ func (a *Allocator) Realloc(b []byte, size int) (r []byte, err error) { return nil, err } - sh := (*reflect.SliceHeader)(unsafe.Pointer(&r)) - sh.Cap = usableSize(p) - sh.Data = p - sh.Len = size - return r, nil + return (*rawmem)(unsafe.Pointer(p))[:size:usableSize(p)], nil } // UsableSize reports the size of the memory block allocated at p, which must diff --git a/vendor/modernc.org/memory/mmap_darwin.go b/vendor/modernc.org/memory/mmap_darwin.go deleted file mode 100644 index d597cb4..0000000 --- a/vendor/modernc.org/memory/mmap_darwin.go +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2017 The Memory Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build amd64 || arm64 -// +build amd64 arm64 - -package memory - -import ( - _ "unsafe" -) - -// Function syscall.mmap for darwin and openbsd calls internal/abi.FuncPCABI0, -// which is implemented as a compile intrinsic so the code cannot be reused. -// Using go:linkname directive to link mmapSyscall to syscall.mmap - -//go:linkname mmapSyscall syscall.mmap -func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) diff --git a/vendor/modernc.org/memory/mmap_freebsd_32.go b/vendor/modernc.org/memory/mmap_freebsd_32.go deleted file mode 100644 index 8b88f1b..0000000 --- a/vendor/modernc.org/memory/mmap_freebsd_32.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-GO file. - -//go:build (freebsd && 386) || (freebsd && arm) -// +build freebsd,386 freebsd,arm - -package memory - -import ( - "syscall" -) - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_386.go -func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos), uintptr(pos>>32), 0, 0) - ret = uintptr(r0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/modernc.org/memory/mmap_freebsd_64.go b/vendor/modernc.org/memory/mmap_freebsd_64.go deleted file mode 100644 index 9a988bc..0000000 --- a/vendor/modernc.org/memory/mmap_freebsd_64.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-GO file. - -//go:build (freebsd && amd64) || (freebsd && arm64) -// +build freebsd,amd64 freebsd,arm64 - -package memory - -import ( - "syscall" -) - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_amd64.go;l=1337-1346 -func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), uintptr(pos)) - ret = uintptr(r0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/modernc.org/memory/mmap_illumos_amd64.go b/vendor/modernc.org/memory/mmap_illumos_amd64.go deleted file mode 100644 index 1006fe8..0000000 --- a/vendor/modernc.org/memory/mmap_illumos_amd64.go +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2011 Evan Shaw. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-MMAP-GO file. - -// Modifications (c) 2022 The Memory Authors. - -package memory // import "modernc.org/memory" - -import ( - "os" - "syscall" - _ "unsafe" -) - -const ( - pageSizeLog = 20 - - // $ find /usr/include -name syscall.h - // /usr/include/sys/syscall.h - // $ grep -ni munmap /usr/include/sys/syscall.h - // 293:#define SYS_munmap 117 - // $ grep -ni mmap /usr/include/sys/syscall.h - // 291:#define SYS_mmap 115 - // 303:#define SYS_mmapobj 127 - // 442:#define SYS_mmap64 214 - // $ - // $ uname -a - // SunOS omnios64 5.11 omnios-r151044-d3b715b9d1 i86pc i386 i86pc - // $ - sys_MUNMAP = 117 - sys_MMAP = 214 -) - -var ( - osPageMask = osPageSize - 1 - osPageSize = os.Getpagesize() -) - -//go:linkname mmapSyscall syscall.mmap -func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) - -func unmap(addr uintptr, size int) error { - _, _, errno := syscall.Syscall(sys_MUNMAP, addr, uintptr(size), 0) - if errno != 0 { - return errno - } - - return nil -} - -// pageSize aligned. -func mmap(size int) (uintptr, int, error) { - size = roundup(size, osPageSize) - // The actual mmap syscall varies by architecture. mmapSyscall provides same - // functionality as the unexported funtion syscall.mmap and is declared in - // mmap_*_*.go and mmap_fallback.go. To add support for a new architecture, - // check function mmap in src/syscall/syscall_*_*.go or - // src/syscall/zsyscall_*_*.go in Go's source code. - p, err := mmapSyscall(0, uintptr(size+pageSize), syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_PRIVATE|syscall.MAP_ANON, -1, 0) - if err != nil { - return 0, 0, err - } - - n := size + pageSize - if p&uintptr(osPageMask) != 0 { - panic("internal error") - } - - mod := int(p) & pageMask - if mod != 0 { - m := pageSize - mod - if err := unmap(p, m); err != nil { - return 0, 0, err - } - - n -= m - p += uintptr(m) - } - - if p&uintptr(pageMask) != 0 { - panic("internal error") - } - - if n-size != 0 { - if err := unmap(p+uintptr(size), n-size); err != nil { - return 0, 0, err - } - } - - return p, size, nil -} diff --git a/vendor/modernc.org/memory/mmap_linux_32.go b/vendor/modernc.org/memory/mmap_linux_32.go deleted file mode 100644 index 207ad41..0000000 --- a/vendor/modernc.org/memory/mmap_linux_32.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-GO file. - -//go:build linux && (386 || arm || mips || mipsle) -// +build linux -// +build 386 arm mips mipsle - -package memory - -import ( - "syscall" -) - -// Function syscall.mmap and syscall.mmap2 are same for linux/386, linux/arm, -// linux/mips and linux/mipsle - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/syscall_linux_386.go;l=99-105 -func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { - page := uintptr(offset / 4096) - if offset != int64(page)*4096 { - return 0, syscall.EINVAL - } - return mmap2Syscall(addr, length, prot, flags, fd, page) -} - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_linux_386.go;l=1361-1370 -func mmap2Syscall(addr uintptr, length uintptr, prot int, flags int, fd int, pageOffset uintptr) (xaddr uintptr, err error) { - r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP2, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(pageOffset)) - xaddr = uintptr(r0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/modernc.org/memory/mmap_linux_64.go b/vendor/modernc.org/memory/mmap_linux_64.go deleted file mode 100644 index 6b7e93d..0000000 --- a/vendor/modernc.org/memory/mmap_linux_64.go +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-GO file. - -//go:build linux && (amd64 || arm64 || mips64 || mips64le || riscv64 || ppc64le || loong64) -// +build linux -// +build amd64 arm64 mips64 mips64le riscv64 ppc64le loong64 - -package memory - -import ( - "syscall" -) - -// Function syscall.mmap is same for linux/amd64, linux/arm64, linux/mips64, -// linux/mips64le and linux/riscv64. - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_linux_amd64.go;l=1575-1584 -func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { - r0, _, e1 := syscall.Syscall6(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)) - xaddr = uintptr(r0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/modernc.org/memory/mmap_linux_s390x.go b/vendor/modernc.org/memory/mmap_linux_s390x.go deleted file mode 100644 index bf7260e..0000000 --- a/vendor/modernc.org/memory/mmap_linux_s390x.go +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-GO file. - -package memory - -import ( - "syscall" - "unsafe" -) - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/syscall_linux_s390x.go;l=105-115 -// Linux on s390x uses the old mmap interface, which requires arguments to be passed in a struct. -// mmap2 also requires arguments to be passed in a struct; it is currently not exposed in . -func mmapSyscall(addr uintptr, length uintptr, prot int, flags int, fd int, offset int64) (xaddr uintptr, err error) { - mmap_args := [6]uintptr{addr, length, uintptr(prot), uintptr(flags), uintptr(fd), uintptr(offset)} - r0, _, e1 := syscall.Syscall(syscall.SYS_MMAP, uintptr(unsafe.Pointer(&mmap_args[0])), 0, 0) - xaddr = uintptr(r0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/modernc.org/memory/mmap_netbsd_32.go b/vendor/modernc.org/memory/mmap_netbsd_32.go deleted file mode 100644 index 2c17038..0000000 --- a/vendor/modernc.org/memory/mmap_netbsd_32.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-GO file. - -//go:build (netbsd && 386) || (netbsd && arm) -// +build netbsd,386 netbsd,arm - -package memory - -import ( - "syscall" -) - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_freebsd_386.go -func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), uintptr(pos>>32), 0) - ret = uintptr(r0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/modernc.org/memory/mmap_netbsd_64.go b/vendor/modernc.org/memory/mmap_netbsd_64.go deleted file mode 100644 index 5c09a7b..0000000 --- a/vendor/modernc.org/memory/mmap_netbsd_64.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-GO file. - -//go:build netbsd && amd64 -// +build netbsd,amd64 - -package memory - -import ( - "syscall" -) - -// https://cs.opensource.google/go/go/+/refs/tags/go1.17.8:src/syscall/zsyscall_netbsd_amd64.go;l=1190 -func mmapSyscall(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) { - r0, _, e1 := syscall.Syscall9(syscall.SYS_MMAP, uintptr(addr), uintptr(length), uintptr(prot), uintptr(flag), uintptr(fd), 0, uintptr(pos), 0, 0) - ret = uintptr(r0) - if e1 != 0 { - err = e1 - } - return -} diff --git a/vendor/modernc.org/memory/mmap_openbsd.go b/vendor/modernc.org/memory/mmap_openbsd.go deleted file mode 100644 index 24cc0a4..0000000 --- a/vendor/modernc.org/memory/mmap_openbsd.go +++ /dev/null @@ -1,97 +0,0 @@ -// Copyright 2011 Evan Shaw. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE-MMAP-GO file. - -// Modifications (c) 2024 The Memory Authors. -// Copyright 2024 The Memory Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build openbsd && (386 || amd64 || arm64) - -package memory - -import ( - "fmt" - "os" - "sync" - "unsafe" - - "golang.org/x/sys/unix" -) - -// track what can be unmapped -var allocmap map[uintptr][]byte -var m sync.Mutex - -const pageSizeLog = 20 - -var ( - osPageMask = osPageSize - 1 - osPageSize = os.Getpagesize() -) - -func init() { - allocmap = make(map[uintptr][]byte) -} - -func unmap(addr uintptr, size int) error { - if trace { - fmt.Fprintf(os.Stderr, "unmap %#x\n", addr) - } - - a, ok := allocmap[addr] - if !ok { - if trace { - fmt.Fprintf(os.Stderr, "unmap %#x: not found\n", addr) - } - // panic("unmap called on unknown mapping") - return nil - } - - if err := unix.Munmap(a); err != nil { - if trace { - fmt.Fprintf(os.Stderr, "unmap: %s\n", err.Error()) - } - // panic(err.Error()) - return err - } - - m.Lock() - delete(allocmap, addr) - m.Unlock() - - return nil -} - -func mmap(size int) (uintptr, int, error) { - roundsize := roundup(size, osPageSize) + pageSize - - b, err := unix.Mmap(-1, 0, roundsize, unix.PROT_READ|unix.PROT_WRITE, unix.MAP_PRIVATE|unix.MAP_ANON) - if err != nil { - return 0, 0, err - } - - p := uintptr(unsafe.Pointer(&b[0])) - - if trace { - fmt.Fprintf(os.Stderr, "mmap actual @%#x size: %#x\n", p, roundsize) - } - - // waste all the space until the next page - r := (p + uintptr(pageSize)) &^ uintptr(pageMask) - nsize := (roundsize) - int((r - p)) - if nsize < size { - panic("didn't allocate enough to meet initial request!") - } - - if trace { - fmt.Fprintf(os.Stderr, "mmap page-rounded @%#x size: %#x\n", r, nsize) - } - - m.Lock() - allocmap[r] = b - m.Unlock() - - return r, nsize, nil -} diff --git a/vendor/modernc.org/memory/mmap_unix.go b/vendor/modernc.org/memory/mmap_unix.go index de57b88..8ee9915 100644 --- a/vendor/modernc.org/memory/mmap_unix.go +++ b/vendor/modernc.org/memory/mmap_unix.go @@ -2,19 +2,19 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE-MMAP-GO file. -//go:build darwin || dragonfly || freebsd || linux || (solaris && !illumos) || netbsd -// +build darwin dragonfly freebsd linux solaris,!illumos netbsd +//go:build unix // Modifications (c) 2017 The Memory Authors. package memory // import "modernc.org/memory" import ( + "golang.org/x/sys/unix" "os" - "syscall" + "unsafe" ) -const pageSizeLog = 20 +const pageSizeLog = 16 var ( osPageMask = osPageSize - 1 @@ -22,37 +22,29 @@ var ( ) func unmap(addr uintptr, size int) error { - _, _, errno := syscall.Syscall(syscall.SYS_MUNMAP, addr, uintptr(size), 0) - if errno != 0 { - return errno - } - - return nil + return unix.MunmapPtr(unsafe.Pointer(addr), uintptr(size)) } // pageSize aligned. func mmap(size int) (uintptr, int, error) { size = roundup(size, osPageSize) - - // The actual mmap syscall varies by architecture. mmapSyscall provides same - // functionality as the unexported funtion syscall.mmap and is declared in - // mmap_*_*.go and mmap_fallback.go. To add support for a new architecture, - // check function mmap in src/syscall/syscall_*_*.go or - // src/syscall/zsyscall_*_*.go in Go's source code. - p, err := mmapSyscall(0, uintptr(size+pageSize), syscall.PROT_READ|syscall.PROT_WRITE, syscall.MAP_PRIVATE|syscall.MAP_ANON, -1, 0) + // Ask for more so we can align the result at a pageSize boundary + n := size + pageSize + up, err := unix.MmapPtr(-1, 0, nil, uintptr(n), unix.PROT_READ|unix.PROT_WRITE, unix.MAP_PRIVATE|unix.MAP_ANON) if err != nil { return 0, 0, err } - n := size + pageSize + p := uintptr(up) if p&uintptr(osPageMask) != 0 { panic("internal error") } mod := int(p) & pageMask - if mod != 0 { + if mod != 0 { // Return the extra part before pageSize aligned block m := pageSize - mod if err := unmap(p, m); err != nil { + unmap(p, n) // Do not leak the first mmap return 0, 0, err } @@ -64,9 +56,13 @@ func mmap(size int) (uintptr, int, error) { panic("internal error") } - if n-size != 0 { + if n > size { // Return the extra part after pageSize aligned block if err := unmap(p+uintptr(size), n-size); err != nil { - return 0, 0, err + // Do not error when the kernel rejects the extra part after, just return the + // unexpectedly enlarged size. + // + // Fixes the bigsort.test failures on linux/s390x, see: https://gitlab.com/cznic/sqlite/-/issues/207 + size = n } } diff --git a/vendor/modernc.org/memory/mmap_windows.go b/vendor/modernc.org/memory/mmap_windows.go index f085a22..f88e516 100644 --- a/vendor/modernc.org/memory/mmap_windows.go +++ b/vendor/modernc.org/memory/mmap_windows.go @@ -5,8 +5,8 @@ package memory // import "modernc.org/memory" import ( - "os" syscall "golang.org/x/sys/windows" + "os" ) const ( diff --git a/vendor/modernc.org/sqlite/AUTHORS b/vendor/modernc.org/sqlite/AUTHORS index 61af343..7b23676 100644 --- a/vendor/modernc.org/sqlite/AUTHORS +++ b/vendor/modernc.org/sqlite/AUTHORS @@ -15,6 +15,7 @@ Dan Peterson David Walton Davsk Ltd Co FerretDB Inc. +Harald Albrecht Jaap Aarts Jan Mercl <0xjnml@gmail.com> Josh Bleecher Snyder @@ -28,3 +29,4 @@ Saed SayedAhmed Steffen Butzer Toni Spets W. Michael Petullo +SUSE LLC diff --git a/vendor/modernc.org/sqlite/CONTRIBUTORS b/vendor/modernc.org/sqlite/CONTRIBUTORS index e9ea3af..e853421 100644 --- a/vendor/modernc.org/sqlite/CONTRIBUTORS +++ b/vendor/modernc.org/sqlite/CONTRIBUTORS @@ -17,6 +17,8 @@ David Walton Elle Mouton FlyingOnion <731677080@qq.com> Gleb Sakhnov +Guénaël Muller +Harald Albrecht Jaap Aarts Jan Mercl <0xjnml@gmail.com> Josh Bleecher Snyder @@ -36,5 +38,7 @@ Sean McGivern Steffen Butzer Toni Spets W. Michael Petullo +Walter Wanderley Yaacov Akiba Slama Prathyush PV +SUSE LLC diff --git a/vendor/modernc.org/sqlite/Makefile b/vendor/modernc.org/sqlite/Makefile index f1d70c7..8a46c64 100644 --- a/vendor/modernc.org/sqlite/Makefile +++ b/vendor/modernc.org/sqlite/Makefile @@ -15,10 +15,10 @@ build_all_targets: GOOS=darwin GOARCH=arm64 go build -v ./... GOOS=freebsd GOARCH=amd64 go test -c -o /dev/null GOOS=freebsd GOARCH=amd64 go build -v ./... - GOOS=freebsd GOARCH=386 go test -c -o /dev/null - GOOS=freebsd GOARCH=386 go build -v ./... - GOOS=freebsd GOARCH=arm go test -c -o /dev/null - GOOS=freebsd GOARCH=arm go build -v ./... + # GOOS=freebsd GOARCH=386 go test -c -o /dev/null + # GOOS=freebsd GOARCH=386 go build -v ./... + # GOOS=freebsd GOARCH=arm go test -c -o /dev/null + # GOOS=freebsd GOARCH=arm go build -v ./... GOOS=freebsd GOARCH=arm64 go test -c -o /dev/null GOOS=freebsd GOARCH=arm64 go build -v ./... GOOS=linux GOARCH=386 go test -c -o /dev/null @@ -56,13 +56,12 @@ clean: go clean edit: - @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile go.mod builder.json all_test.go vendor_libsqlite3.go & fi + @if [ -f "Session.vim" ]; then gvim -S & else gvim -p Makefile go.mod builder.json all_test.go & fi editor: - gofmt -l -s -w . go test -c -o /dev/null go build -v -o /dev/null ./... - go build -o /dev/null vendor_libsqlite3.go + cd vendor_libsqlite3 && go build -o /dev/null main.go test: go test -v -timeout 24h diff --git a/vendor/modernc.org/sqlite/README.md b/vendor/modernc.org/sqlite/README.md index 8f4acdb..1616f91 100644 --- a/vendor/modernc.org/sqlite/README.md +++ b/vendor/modernc.org/sqlite/README.md @@ -5,3 +5,7 @@ [![LiberaPay](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/jnml/donate) [![receives](https://img.shields.io/liberapay/receives/jnml.svg?logo=liberapay)](https://liberapay.com/jnml/donate) [![patrons](https://img.shields.io/liberapay/patrons/jnml.svg?logo=liberapay)](https://liberapay.com/jnml/donate) + +[The SQLite Drivers Benchmarks Game] + +[The SQLite Drivers Benchmarks Game]: https://pkg.go.dev/modernc.org/sqlite-bench#readme-tl-dr-scorecard diff --git a/vendor/modernc.org/sqlite/bind_blob.go b/vendor/modernc.org/sqlite/bind_blob.go deleted file mode 100644 index e20da5e..0000000 --- a/vendor/modernc.org/sqlite/bind_blob.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2024 The Sqlite Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !linux - -package sqlite // import "modernc.org/sqlite" - -import ( - "unsafe" - - "modernc.org/libc" - sqlite3 "modernc.org/sqlite/lib" -) - -// C documentation -// -// int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); -func (c *conn) bindBlob(pstmt uintptr, idx1 int, value []byte) (uintptr, error) { - if value != nil && len(value) == 0 { - if rc := sqlite3.Xsqlite3_bind_zeroblob(c.tls, pstmt, int32(idx1), 0); rc != sqlite3.SQLITE_OK { - return 0, c.errstr(rc) - } - return 0, nil - } - - p, err := c.malloc(len(value)) - if err != nil { - return 0, err - } - if len(value) != 0 { - copy((*libc.RawMem)(unsafe.Pointer(p))[:len(value):len(value)], value) - } - if rc := sqlite3.Xsqlite3_bind_blob(c.tls, pstmt, int32(idx1), p, int32(len(value)), 0); rc != sqlite3.SQLITE_OK { - c.free(p) - return 0, c.errstr(rc) - } - - return p, nil -} diff --git a/vendor/modernc.org/sqlite/bind_blob_musl.go b/vendor/modernc.org/sqlite/bind_blob_musl.go deleted file mode 100644 index f3bad1c..0000000 --- a/vendor/modernc.org/sqlite/bind_blob_musl.go +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2024 The Sqlite Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build linux - -package sqlite // import "modernc.org/sqlite" - -import ( - "unsafe" - - "modernc.org/libc" - sqlite3 "modernc.org/sqlite/lib" -) - -// C documentation -// -// int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); -func (c *conn) bindBlob(pstmt uintptr, idx1 int, value []byte) (uintptr, error) { - if value == nil { - if rc := sqlite3.Xsqlite3_bind_null(c.tls, pstmt, int32(idx1)); rc != sqlite3.SQLITE_OK { - return 0, c.errstr(rc) - } - return 0, nil - } - - p, err := c.malloc(len(value)) - if err != nil { - return 0, err - } - if len(value) != 0 { - copy((*libc.RawMem)(unsafe.Pointer(p))[:len(value):len(value)], value) - } - if rc := sqlite3.Xsqlite3_bind_blob(c.tls, pstmt, int32(idx1), p, int32(len(value)), 0); rc != sqlite3.SQLITE_OK { - c.free(p) - return 0, c.errstr(rc) - } - - return p, nil -} diff --git a/vendor/modernc.org/sqlite/convert.go b/vendor/modernc.org/sqlite/convert.go new file mode 100644 index 0000000..1b19dc6 --- /dev/null +++ b/vendor/modernc.org/sqlite/convert.go @@ -0,0 +1,299 @@ +// Extracted from Go database/sql source code + +// Copyright 2011 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Type conversions for Scan. + +package sqlite + +import ( + "database/sql" + "database/sql/driver" + "errors" + "fmt" + "reflect" + "strconv" + "time" +) + +var errNilPtr = errors.New("destination pointer is nil") // embedded in descriptive error + +// convertAssign copies to dest the value in src, converting it if possible. +// An error is returned if the copy would result in loss of information. +// dest should be a pointer type. +func convertAssign(dest, src interface{}) error { + // Common cases, without reflect. + switch s := src.(type) { + case string: + switch d := dest.(type) { + case *string: + if d == nil { + return errNilPtr + } + *d = s + return nil + case *[]byte: + if d == nil { + return errNilPtr + } + *d = []byte(s) + return nil + case *sql.RawBytes: + if d == nil { + return errNilPtr + } + *d = append((*d)[:0], s...) + return nil + } + case []byte: + switch d := dest.(type) { + case *string: + if d == nil { + return errNilPtr + } + *d = string(s) + return nil + case *interface{}: + if d == nil { + return errNilPtr + } + *d = cloneBytes(s) + return nil + case *[]byte: + if d == nil { + return errNilPtr + } + *d = cloneBytes(s) + return nil + case *sql.RawBytes: + if d == nil { + return errNilPtr + } + *d = s + return nil + } + case time.Time: + switch d := dest.(type) { + case *time.Time: + *d = s + return nil + case *string: + *d = s.Format(time.RFC3339Nano) + return nil + case *[]byte: + if d == nil { + return errNilPtr + } + *d = []byte(s.Format(time.RFC3339Nano)) + return nil + case *sql.RawBytes: + if d == nil { + return errNilPtr + } + *d = s.AppendFormat((*d)[:0], time.RFC3339Nano) + return nil + } + case nil: + switch d := dest.(type) { + case *interface{}: + if d == nil { + return errNilPtr + } + *d = nil + return nil + case *[]byte: + if d == nil { + return errNilPtr + } + *d = nil + return nil + case *sql.RawBytes: + if d == nil { + return errNilPtr + } + *d = nil + return nil + } + } + + var sv reflect.Value + + switch d := dest.(type) { + case *string: + sv = reflect.ValueOf(src) + switch sv.Kind() { + case reflect.Bool, + reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, + reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, + reflect.Float32, reflect.Float64: + *d = asString(src) + return nil + } + case *[]byte: + sv = reflect.ValueOf(src) + if b, ok := asBytes(nil, sv); ok { + *d = b + return nil + } + case *sql.RawBytes: + sv = reflect.ValueOf(src) + if b, ok := asBytes([]byte(*d)[:0], sv); ok { + *d = sql.RawBytes(b) + return nil + } + case *bool: + bv, err := driver.Bool.ConvertValue(src) + if err == nil { + *d = bv.(bool) + } + return err + case *interface{}: + *d = src + return nil + } + + if scanner, ok := dest.(sql.Scanner); ok { + return scanner.Scan(src) + } + + dpv := reflect.ValueOf(dest) + if dpv.Kind() != reflect.Ptr { + return errors.New("destination not a pointer") + } + if dpv.IsNil() { + return errNilPtr + } + + if !sv.IsValid() { + sv = reflect.ValueOf(src) + } + + dv := reflect.Indirect(dpv) + if sv.IsValid() && sv.Type().AssignableTo(dv.Type()) { + switch b := src.(type) { + case []byte: + dv.Set(reflect.ValueOf(cloneBytes(b))) + default: + dv.Set(sv) + } + return nil + } + + if dv.Kind() == sv.Kind() && sv.Type().ConvertibleTo(dv.Type()) { + dv.Set(sv.Convert(dv.Type())) + return nil + } + + // The following conversions use a string value as an intermediate representation + // to convert between various numeric types. + // + // This also allows scanning into user defined types such as "type Int int64". + // For symmetry, also check for string destination types. + switch dv.Kind() { + case reflect.Ptr: + if src == nil { + dv.Set(reflect.Zero(dv.Type())) + return nil + } + dv.Set(reflect.New(dv.Type().Elem())) + return convertAssign(dv.Interface(), src) + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + s := asString(src) + i64, err := strconv.ParseInt(s, 10, dv.Type().Bits()) + if err != nil { + err = strconvErr(err) + return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err) + } + dv.SetInt(i64) + return nil + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + s := asString(src) + u64, err := strconv.ParseUint(s, 10, dv.Type().Bits()) + if err != nil { + err = strconvErr(err) + return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err) + } + dv.SetUint(u64) + return nil + case reflect.Float32, reflect.Float64: + s := asString(src) + f64, err := strconv.ParseFloat(s, dv.Type().Bits()) + if err != nil { + err = strconvErr(err) + return fmt.Errorf("converting driver.Value type %T (%q) to a %s: %v", src, s, dv.Kind(), err) + } + dv.SetFloat(f64) + return nil + case reflect.String: + switch v := src.(type) { + case string: + dv.SetString(v) + return nil + case []byte: + dv.SetString(string(v)) + return nil + } + } + + return fmt.Errorf("unsupported Scan, storing driver.Value type %T into type %T", src, dest) +} + +func strconvErr(err error) error { + if ne, ok := err.(*strconv.NumError); ok { + return ne.Err + } + return err +} + +func cloneBytes(b []byte) []byte { + if b == nil { + return nil + } + c := make([]byte, len(b)) + copy(c, b) + return c +} + +func asString(src interface{}) string { + switch v := src.(type) { + case string: + return v + case []byte: + return string(v) + } + rv := reflect.ValueOf(src) + switch rv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.FormatInt(rv.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return strconv.FormatUint(rv.Uint(), 10) + case reflect.Float64: + return strconv.FormatFloat(rv.Float(), 'g', -1, 64) + case reflect.Float32: + return strconv.FormatFloat(rv.Float(), 'g', -1, 32) + case reflect.Bool: + return strconv.FormatBool(rv.Bool()) + } + return fmt.Sprintf("%v", src) +} + +func asBytes(buf []byte, rv reflect.Value) (b []byte, ok bool) { + switch rv.Kind() { + case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: + return strconv.AppendInt(buf, rv.Int(), 10), true + case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64: + return strconv.AppendUint(buf, rv.Uint(), 10), true + case reflect.Float32: + return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 32), true + case reflect.Float64: + return strconv.AppendFloat(buf, rv.Float(), 'g', -1, 64), true + case reflect.Bool: + return strconv.AppendBool(buf, rv.Bool()), true + case reflect.String: + s := rv.String() + return append(buf, s...), true + } + return +} diff --git a/vendor/modernc.org/sqlite/doc.go b/vendor/modernc.org/sqlite/doc.go index 0efdc9b..34c1037 100644 --- a/vendor/modernc.org/sqlite/doc.go +++ b/vendor/modernc.org/sqlite/doc.go @@ -27,21 +27,25 @@ // // OS Arch SQLite version // ------------------------------ -// darwin amd64 3.49.0 -// darwin arm64 3.49.0 -// freebsd amd64 3.49.0 -// freebsd arm64 3.49.0 -// linux 386 3.49.0 -// linux amd64 3.49.0 -// linux arm 3.49.0 -// linux arm64 3.49.0 -// linux loong64 3.49.0 -// linux ppc64le 3.49.0 -// linux riscv64 3.49.0 -// linux s390x 3.49.0 -// windows 386 3.49.0 -// windows amd64 3.49.0 -// windows arm64 3.49.0 +// darwin amd64 3.50.4 +// darwin arm64 3.50.4 +// freebsd amd64 3.50.4 +// freebsd arm64 3.50.4 +// linux 386 3.50.4 +// linux amd64 3.50.4 +// linux arm 3.50.4 +// linux arm64 3.50.4 +// linux loong64 3.50.4 +// linux ppc64le 3.50.4 +// linux riscv64 3.50.4 +// linux s390x 3.50.4 +// windows 386 3.50.4 +// windows amd64 3.50.4 +// windows arm64 3.50.4 +// +// # Benchmarks +// +// [The SQLite Drivers Benchmarks Game] // // # Builders // @@ -51,6 +55,10 @@ // // # Changelog // +// - 2025-10-10 v1.39.1: Upgrade to SQLite 3.50.4. +// +// - 2025-06-09 v1.38.0: Upgrade to SQLite 3.50.1. +// // - 2025-02-26 v1.36.0: Upgrade to SQLite 3.49.0. // // - 2024-11-16 v1.34.0: Implement ResetSession and IsValid methods in connection @@ -289,4 +297,6 @@ // # Sqlite documentation // // See https://sqlite.org/docs.html +// +// [The SQLite Drivers Benchmarks Game]: https://pkg.go.dev/modernc.org/sqlite-bench#readme-tl-dr-scorecard package sqlite // import "modernc.org/sqlite" diff --git a/vendor/modernc.org/sqlite/lib/mutex.go b/vendor/modernc.org/sqlite/lib/mutex.go index 4dd679a..305b246 100644 --- a/vendor/modernc.org/sqlite/lib/mutex.go +++ b/vendor/modernc.org/sqlite/lib/mutex.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +//go:build !linux + package sqlite3 import ( @@ -57,170 +59,40 @@ var ( }{mutexNotheld})), } - MutexCounters = libc.NewPerfCounter([]string{ - "enter-fast", - "enter-recursive", - "enter-recursive-loop", - "try-fast", - "try-recursive", - }) - MutexEnterCallers = libc.NewStackCapture(4) - - mutexes mutexPool - - mutexApp1 = mutexes.alloc(false) - mutexApp2 = mutexes.alloc(false) - mutexApp3 = mutexes.alloc(false) - mutexLRU = mutexes.alloc(false) - mutexMaster = mutexes.alloc(false) - mutexMem = mutexes.alloc(false) - mutexOpen = mutexes.alloc(false) - mutexPMem = mutexes.alloc(false) - mutexPRNG = mutexes.alloc(false) - mutexVFS1 = mutexes.alloc(false) - mutexVFS2 = mutexes.alloc(false) - mutexVFS3 = mutexes.alloc(false) + mutexApp10 mutex + mutexApp20 mutex + mutexApp30 mutex + mutexLRU0 mutex + mutexMaster0 mutex + mutexMem0 mutex + mutexOpen0 mutex + mutexPMem0 mutex + mutexPRNG0 mutex + mutexVFS10 mutex + mutexVFS20 mutex + mutexVFS30 mutex + + mutexApp1 = uintptr(unsafe.Pointer(&mutexApp10)) + mutexApp2 = uintptr(unsafe.Pointer(&mutexApp20)) + mutexApp3 = uintptr(unsafe.Pointer(&mutexApp30)) + mutexLRU = uintptr(unsafe.Pointer(&mutexLRU0)) + mutexMaster = uintptr(unsafe.Pointer(&mutexMaster0)) + mutexMem = uintptr(unsafe.Pointer(&mutexMem0)) + mutexOpen = uintptr(unsafe.Pointer(&mutexOpen0)) + mutexPMem = uintptr(unsafe.Pointer(&mutexPMem0)) + mutexPRNG = uintptr(unsafe.Pointer(&mutexPRNG0)) + mutexVFS1 = uintptr(unsafe.Pointer(&mutexVFS10)) + mutexVFS2 = uintptr(unsafe.Pointer(&mutexVFS20)) + mutexVFS3 = uintptr(unsafe.Pointer(&mutexVFS30)) ) -type mutexPool struct { - sync.Mutex - a []*[256]mutex - freeList []int -} - -func mutexFromPtr(p uintptr) *mutex { - if p == 0 { - return nil - } - - ix := p - 1 - - mutexes.Lock() - defer mutexes.Unlock() - - return &mutexes.a[ix>>8][ix&255] -} - -func (m *mutexPool) alloc(recursive bool) uintptr { - m.Lock() - defer m.Unlock() - - n := len(m.freeList) - if n == 0 { - outer := len(m.a) << 8 - m.a = append(m.a, &[256]mutex{}) - for i := 0; i < 256; i++ { - m.freeList = append(m.freeList, outer+i) - } - n = len(m.freeList) - } - ix := m.freeList[n-1] - outer := ix >> 8 - inner := ix & 255 - m.freeList = m.freeList[:n-1] - p := &m.a[outer][inner] - p.poolIndex = ix - p.recursive = recursive - return uintptr(ix) + 1 -} - -func (m *mutexPool) free(p uintptr) { - ptr := mutexFromPtr(p) - ix := ptr.poolIndex - *ptr = mutex{} - - m.Lock() - defer m.Unlock() - - m.freeList = append(m.freeList, ix) -} - type mutex struct { sync.Mutex - wait sync.Mutex - - poolIndex int - - cnt int32 - id int32 - + cnt int32 + id int32 // tls.ID recursive bool } -func (m *mutex) enter(id int32) { - // MutexEnterCallers.Record() - if !m.recursive { - // MutexCounters.Inc(0) - m.Lock() - m.id = id - return - } - - // MutexCounters.Inc(1) - for { - m.Lock() - switch m.id { - case 0: - m.cnt = 1 - m.id = id - m.wait.Lock() - m.Unlock() - return - case id: - m.cnt++ - m.Unlock() - return - } - - // MutexCounters.Inc(2) - m.Unlock() - m.wait.Lock() - //lint:ignore SA2001 TODO report staticcheck issue - m.wait.Unlock() - } -} - -func (m *mutex) try(id int32) int32 { - if !m.recursive { - // MutexCounters.Inc(3) - return SQLITE_BUSY - } - - // MutexCounters.Inc(4) - m.Lock() - switch m.id { - case 0: - m.cnt = 1 - m.id = id - m.wait.Lock() - m.Unlock() - return SQLITE_OK - case id: - m.cnt++ - m.Unlock() - return SQLITE_OK - } - - m.Unlock() - return SQLITE_BUSY -} - -func (m *mutex) leave(id int32) { - if !m.recursive { - m.id = 0 - m.Unlock() - return - } - - m.Lock() - m.cnt-- - if m.cnt == 0 { - m.id = 0 - m.wait.Unlock() - } - m.Unlock() -} - // int (*xMutexInit)(void); // // The xMutexInit method defined by this structure is invoked as part of system @@ -285,14 +157,15 @@ func mutexEnd(tls *libc.TLS) int32 { return SQLITE_OK } // SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() returns a // different mutex on every call. For the static mutex types, the same mutex is // returned on every call that has the same type number. -func mutexAlloc(tls *libc.TLS, typ int32) uintptr { - defer func() { - }() +func mutexAlloc(tls *libc.TLS, typ int32) (r uintptr) { switch typ { case SQLITE_MUTEX_FAST: - return mutexes.alloc(false) + r = libc.Xcalloc(tls, 1, types.Size_t(unsafe.Sizeof(mutex{}))) + return r case SQLITE_MUTEX_RECURSIVE: - return mutexes.alloc(true) + r = libc.Xcalloc(tls, 1, types.Size_t(unsafe.Sizeof(mutex{}))) + (*mutex)(unsafe.Pointer(r)).recursive = true + return r case SQLITE_MUTEX_STATIC_MASTER: return mutexMaster case SQLITE_MUTEX_STATIC_MEM: @@ -323,7 +196,9 @@ func mutexAlloc(tls *libc.TLS, typ int32) uintptr { } // void (*xMutexFree)(sqlite3_mutex *); -func mutexFree(tls *libc.TLS, m uintptr) { mutexes.free(m) } +func mutexFree(tls *libc.TLS, m uintptr) { + libc.Xfree(tls, m) +} // The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt to enter // a mutex. If another thread is already within the mutex, @@ -344,7 +219,34 @@ func mutexEnter(tls *libc.TLS, m uintptr) { if m == 0 { return } - mutexFromPtr(m).enter(tls.ID) + + if !(*mutex)(unsafe.Pointer(m)).recursive { + (*mutex)(unsafe.Pointer(m)).Lock() + (*mutex)(unsafe.Pointer(m)).id = tls.ID + return + } + + id := tls.ID + if atomic.CompareAndSwapInt32(&(*mutex)(unsafe.Pointer(m)).id, 0, id) { + (*mutex)(unsafe.Pointer(m)).cnt = 1 + (*mutex)(unsafe.Pointer(m)).Lock() + return + } + + if atomic.LoadInt32(&(*mutex)(unsafe.Pointer(m)).id) == id { + (*mutex)(unsafe.Pointer(m)).cnt++ + return + } + + for { + (*mutex)(unsafe.Pointer(m)).Lock() + if atomic.CompareAndSwapInt32(&(*mutex)(unsafe.Pointer(m)).id, 0, id) { + (*mutex)(unsafe.Pointer(m)).cnt = 1 + return + } + + (*mutex)(unsafe.Pointer(m)).Unlock() + } } // int (*xMutexTry)(sqlite3_mutex *); @@ -353,7 +255,13 @@ func mutexTry(tls *libc.TLS, m uintptr) int32 { return SQLITE_OK } - return mutexFromPtr(m).try(tls.ID) + if !(*mutex)(unsafe.Pointer(m)).recursive { + if (*mutex)(unsafe.Pointer(m)).TryLock() { + return SQLITE_OK + } + } + + return SQLITE_BUSY } // void (*xMutexLeave)(sqlite3_mutex *); @@ -362,7 +270,16 @@ func mutexLeave(tls *libc.TLS, m uintptr) { return } - mutexFromPtr(m).leave(tls.ID) + if !(*mutex)(unsafe.Pointer(m)).recursive { + (*mutex)(unsafe.Pointer(m)).id = 0 + (*mutex)(unsafe.Pointer(m)).Unlock() + return + } + + if atomic.AddInt32(&(*mutex)(unsafe.Pointer(m)).cnt, -1) == 0 { + atomic.StoreInt32(&(*mutex)(unsafe.Pointer(m)).id, 0) + (*mutex)(unsafe.Pointer(m)).Unlock() + } } // The sqlite3_mutex_held() and sqlite3_mutex_notheld() routines are intended @@ -395,7 +312,7 @@ func mutexHeld(tls *libc.TLS, m uintptr) int32 { return 1 } - return libc.Bool32(atomic.LoadInt32(&mutexFromPtr(m).id) == tls.ID) + return libc.Bool32(atomic.LoadInt32(&(*mutex)(unsafe.Pointer(m)).id) == tls.ID) } // int (*xMutexNotheld)(sqlite3_mutex *); @@ -404,5 +321,5 @@ func mutexNotheld(tls *libc.TLS, m uintptr) int32 { return 1 } - return libc.Bool32(atomic.LoadInt32(&mutexFromPtr(m).id) != tls.ID) + return libc.Bool32(atomic.LoadInt32(&(*mutex)(unsafe.Pointer(m)).id) != tls.ID) } diff --git a/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go index af512f8..1079f5f 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_darwin_amd64.go @@ -1,4 +1,4 @@ -// Code generated for darwin/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/darwin/amd64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/darwin/amd64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/darwin/amd64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for darwin/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/darwin/amd64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/darwin/amd64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/darwin/amd64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build darwin && amd64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -166,6 +168,7 @@ const ATTR_FORK_SETMASK = 0 const ATTR_FORK_TOTALSIZE = 1 const ATTR_FORK_VALIDMASK = 3 const ATTR_MAX_BUFFER = 8192 +const ATTR_MAX_BUFFER_LONGPATHS = 7168 const ATTR_VOL_ALLOCATIONCLUMP = 64 const ATTR_VOL_ATTRIBUTES = 1073741824 const ATTR_VOL_CAPABILITIES = 131072 @@ -185,6 +188,7 @@ const ATTR_VOL_MOUNTFLAGS = 16384 const ATTR_VOL_MOUNTPOINT = 4096 const ATTR_VOL_NAME = 8192 const ATTR_VOL_OBJCOUNT = 256 +const ATTR_VOL_OWNER = 4194304 const ATTR_VOL_QUOTA_SIZE = 268435456 const ATTR_VOL_RESERVED_SIZE = 536870912 const ATTR_VOL_SETMASK = 2147491840 @@ -194,7 +198,7 @@ const ATTR_VOL_SPACEAVAIL = 16 const ATTR_VOL_SPACEFREE = 8 const ATTR_VOL_SPACEUSED = 8388608 const ATTR_VOL_UUID = 262144 -const ATTR_VOL_VALIDMASK = 4039114751 +const ATTR_VOL_VALIDMASK = 4043309055 const AT_EACCESS = 16 const AT_FDCWD = -2 const AT_FDONLY = 1024 @@ -288,7 +292,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -346,6 +349,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BUS_ADRALN = 1 const BUS_ADRERR = 2 @@ -953,7 +957,7 @@ const IFCAP_TSO4 = 32 const IFCAP_TSO6 = 64 const IFCAP_TXCSUM = 2 const IFCAP_TXSTATUS = 512 -const IFCAP_VALID = 32767 +const IFCAP_VALID = 65535 const IFCAP_VLAN_HWTAGGING = 8 const IFCAP_VLAN_MTU = 4 const IFF_ALLMULTI = 512 @@ -1102,6 +1106,7 @@ const IOPOL_VFS_IGNORE_PERMISSIONS_OFF = 0 const IOPOL_VFS_IGNORE_PERMISSIONS_ON = 1 const IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_DEFAULT = 0 const IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_ON = 1 +const IOPOL_VFS_SKIP_MTIME_UPDATE_IGNORE = 2 const IOPOL_VFS_SKIP_MTIME_UPDATE_OFF = 0 const IOPOL_VFS_SKIP_MTIME_UPDATE_ON = 1 const IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME = 1 @@ -1303,15 +1308,21 @@ const MAC_OS_VERSION_13_3 = 130300 const MAC_OS_VERSION_13_4 = 130400 const MAC_OS_VERSION_13_5 = 130500 const MAC_OS_VERSION_13_6 = 130600 +const MAC_OS_VERSION_13_7 = 130700 const MAC_OS_VERSION_14_0 = 140000 const MAC_OS_VERSION_14_1 = 140100 const MAC_OS_VERSION_14_2 = 140200 const MAC_OS_VERSION_14_3 = 140300 const MAC_OS_VERSION_14_4 = 140400 const MAC_OS_VERSION_14_5 = 140500 +const MAC_OS_VERSION_14_6 = 140600 +const MAC_OS_VERSION_14_7 = 140700 const MAC_OS_VERSION_15_0 = 150000 const MAC_OS_VERSION_15_1 = 150100 const MAC_OS_VERSION_15_2 = 150200 +const MAC_OS_VERSION_15_3 = 150300 +const MAC_OS_VERSION_15_4 = 150400 +const MAC_OS_VERSION_15_5 = 150500 const MAC_OS_X_VERSION_10_0 = 1000 const MAC_OS_X_VERSION_10_1 = 1010 const MAC_OS_X_VERSION_10_10 = 101000 @@ -1400,10 +1411,10 @@ const MAXUPRC = 266 const MAX_AUDIT_RECORDS = 20 const MAX_AUDIT_RECORD_SIZE = 32767 const MAX_CANON = 1024 -const MAX_FATAL_kGUARD_EXC_CODE = 128 +const MAX_FATAL_kGUARD_EXC_CODE = 0 const MAX_GRAFT_ARGS_SIZE = 512 const MAX_INPUT = 1024 -const MAX_OPTIONAL_kGUARD_EXC_CODE = 524288 +const MAX_OPTIONAL_kGUARD_EXC_CODE = 0 const MAX_PATHNAME = 512 const MAX_SECTOR_SIZE = 65536 const MBIGCLBYTES = 4096 @@ -1894,6 +1905,7 @@ const O_NONBLOCK = 4 const O_POPUP = 2147483648 const O_RDONLY = 0 const O_RDWR = 2 +const O_RESOLVE_BENEATH = 4096 const O_SEARCH = 1074790400 const O_SHLOCK = 16 const O_SYMLINK = 2097152 @@ -2447,6 +2459,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -2686,6 +2699,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -2896,6 +2910,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -3058,6 +3073,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -3066,7 +3082,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -3176,8 +3192,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3280,9 +3296,12 @@ const TARGET_CPU_SPARC = 0 const TARGET_CPU_X86 = 0 const TARGET_CPU_X86_64 = 1 const TARGET_IPHONE_SIMULATOR = 0 +const TARGET_OS_ARROW = 0 +const TARGET_OS_BRIDGE = 0 const TARGET_OS_DRIVERKIT = 0 const TARGET_OS_EMBEDDED = 0 const TARGET_OS_IOS = 0 +const TARGET_OS_IOSMAC = 0 const TARGET_OS_IPHONE = 0 const TARGET_OS_LINUX = 0 const TARGET_OS_MAC = 1 @@ -3298,6 +3317,7 @@ const TARGET_OS_VISION = 0 const TARGET_OS_WATCH = 0 const TARGET_OS_WIN32 = 0 const TARGET_OS_WINDOWS = 0 +const TARGET_OS_XR = 0 const TARGET_RT_64_BIT = 1 const TARGET_RT_BIG_ENDIAN = 0 const TARGET_RT_LITTLE_ENDIAN = 1 @@ -3923,6 +3943,8 @@ const _IONBF = 2 const _LARGEFILE64_SOURCE = 1 const _LARGEFILE_SOURCE = 1 const _LARGE_FILE = 1 +const _LIBC_COUNT__MB_LEN_MAX = 0 +const _LIBC_COUNT__PATH_MAX = 0 const _LP64 = 1 const _MALLOC_TYPE_AVAILABILITY = 0 const _PC_2_SYMLINKS = 15 @@ -4195,11 +4217,18 @@ const _XOPEN_XCU_VERSION = 4 const __API_TO_BE_DEPRECATED = 100000 const __API_TO_BE_DEPRECATED_DRIVERKIT = 100000 const __API_TO_BE_DEPRECATED_IOS = 100000 +const __API_TO_BE_DEPRECATED_IOSAPPLICATIONEXTENSION = 100000 +const __API_TO_BE_DEPRECATED_KERNELKIT = 100000 const __API_TO_BE_DEPRECATED_MACCATALYST = 100000 +const __API_TO_BE_DEPRECATED_MACCATALYSTAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_MACOS = 100000 +const __API_TO_BE_DEPRECATED_MACOSAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_TVOS = 100000 +const __API_TO_BE_DEPRECATED_TVOSAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_VISIONOS = 100000 +const __API_TO_BE_DEPRECATED_VISIONOSAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_WATCHOS = 100000 +const __API_TO_BE_DEPRECATED_WATCHOSAPPLICATIONEXTENSION = 100000 const __APPLE_CC__ = 6000 const __APPLE__ = 1 const __ASSUME_PTR_ABI_SINGLE_BEGIN = 0 @@ -4211,6 +4240,9 @@ const __ATOMIC_RELAXED = 0 const __ATOMIC_RELEASE = 3 const __ATOMIC_SEQ_CST = 5 const __AUDIT_API_DEPRECATED = 0 +const __AVAILABILITY_FILE = "AvailabilityVersions.h" +const __AVAILABILITY_VERSIONS_VERSION_HASH = 93585900 +const __AVAILABILITY_VERSIONS_VERSION_STRING = "Local" const __BIGGEST_ALIGNMENT__ = 16 const __BITINT_MAXWIDTH__ = 8388608 const __BLOCKS__ = 1 @@ -4241,9 +4273,13 @@ const __BRIDGEOS_8_2 = 80200 const __BRIDGEOS_8_3 = 80300 const __BRIDGEOS_8_4 = 80400 const __BRIDGEOS_8_5 = 80500 +const __BRIDGEOS_8_6 = 80600 const __BRIDGEOS_9_0 = 90000 const __BRIDGEOS_9_1 = 90100 const __BRIDGEOS_9_2 = 90200 +const __BRIDGEOS_9_3 = 90300 +const __BRIDGEOS_9_4 = 90400 +const __BRIDGEOS_9_5 = 90500 const __BYTE_ORDER__ = 1234 const __CCGO__ = 1 const __CHAR_BIT__ = 8 @@ -4301,6 +4337,7 @@ const __DBL_MAX__ = 0 const __DBL_MIN_10_EXP__ = -307 const __DBL_MIN_EXP__ = -1021 const __DBL_MIN__ = 2.2250738585072014e-308 +const __DBL_NORM_MAX__ = 0 const __DECIMAL_DIG__ = 17 const __DRIVERKIT_19_0 = 190000 const __DRIVERKIT_20_0 = 200000 @@ -4315,10 +4352,15 @@ const __DRIVERKIT_23_2 = 230200 const __DRIVERKIT_23_3 = 230300 const __DRIVERKIT_23_4 = 230400 const __DRIVERKIT_23_5 = 230500 +const __DRIVERKIT_23_6 = 230600 const __DRIVERKIT_24_0 = 240000 const __DRIVERKIT_24_1 = 240100 const __DRIVERKIT_24_2 = 240200 -const __DYLDDL_DRIVERKIT_UNAVAILABLE = 0 +const __DRIVERKIT_24_3 = 240300 +const __DRIVERKIT_24_4 = 240400 +const __DRIVERKIT_24_5 = 240500 +const __DYLDDL_DLSYM_UNAVAILABLE = 0 +const __DYLDDL_UNAVAILABLE = 0 const __DYNAMIC__ = 1 const __ENABLE_LEGACY_MAC_AVAILABILITY = 1 const __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ = 150000 @@ -4338,6 +4380,7 @@ const __FLT16_MAX__ = 0 const __FLT16_MIN_10_EXP__ = -4 const __FLT16_MIN_EXP__ = -13 const __FLT16_MIN__ = 0 +const __FLT16_NORM_MAX__ = 0 const __FLT_DECIMAL_DIG__ = 9 const __FLT_DENORM_MIN__ = 0 const __FLT_DIG__ = 6 @@ -4352,6 +4395,7 @@ const __FLT_MAX__ = 0 const __FLT_MIN_10_EXP__ = -37 const __FLT_MIN_EXP__ = -125 const __FLT_MIN__ = 1.17549435e-38 +const __FLT_NORM_MAX__ = 0 const __FLT_RADIX__ = 2 const __FPCLASS_NEGINF = 4 const __FPCLASS_NEGNORMAL = 8 @@ -4377,6 +4421,8 @@ const __GCC_ATOMIC_POINTER_LOCK_FREE = 2 const __GCC_ATOMIC_SHORT_LOCK_FREE = 2 const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1 const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2 +const __GCC_CONSTRUCTIVE_SIZE = 64 +const __GCC_DESTRUCTIVE_SIZE = 64 const __GCC_HAVE_DWARF2_CFI_ASM = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = 1 @@ -4508,9 +4554,14 @@ const __IPHONE_17_2 = 170200 const __IPHONE_17_3 = 170300 const __IPHONE_17_4 = 170400 const __IPHONE_17_5 = 170500 +const __IPHONE_17_6 = 170600 +const __IPHONE_17_7 = 170700 const __IPHONE_18_0 = 180000 const __IPHONE_18_1 = 180100 const __IPHONE_18_2 = 180200 +const __IPHONE_18_3 = 180300 +const __IPHONE_18_4 = 180400 +const __IPHONE_18_5 = 180500 const __IPHONE_2_0 = 20000 const __IPHONE_2_1 = 20100 const __IPHONE_2_2 = 20200 @@ -4552,6 +4603,7 @@ const __LDBL_MAX__ = 0 const __LDBL_MIN_10_EXP__ = -307 const __LDBL_MIN_EXP__ = -1021 const __LDBL_MIN__ = 2.2250738585072014e-308 +const __LDBL_NORM_MAX__ = 0 const __LITTLE_ENDIAN__ = 1 const __LLONG_WIDTH__ = 64 const __LONG_LONG_MAX__ = 9223372036854775807 @@ -4616,17 +4668,28 @@ const __MAC_13_3 = 130300 const __MAC_13_4 = 130400 const __MAC_13_5 = 130500 const __MAC_13_6 = 130600 +const __MAC_13_7 = 130700 const __MAC_14_0 = 140000 const __MAC_14_1 = 140100 const __MAC_14_2 = 140200 const __MAC_14_3 = 140300 const __MAC_14_4 = 140400 const __MAC_14_5 = 140500 +const __MAC_14_6 = 140600 +const __MAC_14_7 = 140700 const __MAC_15_0 = 150000 const __MAC_15_1 = 150100 const __MAC_15_2 = 150200 -const __MAC_OS_X_VERSION_MAX_ALLOWED = 150200 +const __MAC_15_3 = 150300 +const __MAC_15_4 = 150400 +const __MAC_15_5 = 150500 +const __MAC_OS_X_VERSION_MAX_ALLOWED = 150500 const __MAC_OS_X_VERSION_MIN_REQUIRED = 150000 +const __MEMORY_SCOPE_DEVICE = 1 +const __MEMORY_SCOPE_SINGLE = 4 +const __MEMORY_SCOPE_SYSTEM = 0 +const __MEMORY_SCOPE_WRKGRP = 2 +const __MEMORY_SCOPE_WVFRNT = 3 const __MMX__ = 1 const __NO_INLINE__ = 1 const __NO_MATH_ERRNO__ = 1 @@ -4709,6 +4772,9 @@ const __SSE__ = 1 const __SSP__ = 1 const __SSSE3__ = 1 const __SSTR = 512 +const __STDC_EMBED_EMPTY__ = 2 +const __STDC_EMBED_FOUND__ = 1 +const __STDC_EMBED_NOT_FOUND__ = 0 const __STDC_HOSTED__ = 1 const __STDC_NO_THREADS__ = 1 const __STDC_UTF_16__ = 1 @@ -4762,9 +4828,13 @@ const __TVOS_17_2 = 170200 const __TVOS_17_3 = 170300 const __TVOS_17_4 = 170400 const __TVOS_17_5 = 170500 +const __TVOS_17_6 = 170600 const __TVOS_18_0 = 180000 const __TVOS_18_1 = 180100 const __TVOS_18_2 = 180200 +const __TVOS_18_3 = 180300 +const __TVOS_18_4 = 180400 +const __TVOS_18_5 = 180500 const __TVOS_9_0 = 90000 const __TVOS_9_1 = 90100 const __TVOS_9_2 = 90200 @@ -4845,22 +4915,31 @@ const __UINT_LEAST8_FMTu__ = "hhu" const __UINT_LEAST8_FMTx__ = "hhx" const __UINT_LEAST8_MAX__ = 255 const __USER_LABEL_PREFIX__ = 0 -const __VERSION__ = "Apple LLVM 16.0.0 (clang-1600.0.26.6)" +const __VERSION__ = "Apple LLVM 17.0.0 (clang-1700.0.13.5)" const __VISIONOS_1_0 = 10000 const __VISIONOS_1_1 = 10100 const __VISIONOS_1_2 = 10200 +const __VISIONOS_1_3 = 10300 const __VISIONOS_2_0 = 20000 const __VISIONOS_2_1 = 20100 const __VISIONOS_2_2 = 20200 +const __VISIONOS_2_3 = 20300 +const __VISIONOS_2_4 = 20400 +const __VISIONOS_2_5 = 20500 const __WATCHOS_10_0 = 100000 const __WATCHOS_10_1 = 100100 const __WATCHOS_10_2 = 100200 const __WATCHOS_10_3 = 100300 const __WATCHOS_10_4 = 100400 const __WATCHOS_10_5 = 100500 +const __WATCHOS_10_6 = 100600 +const __WATCHOS_10_7 = 100700 const __WATCHOS_11_0 = 110000 const __WATCHOS_11_1 = 110100 const __WATCHOS_11_2 = 110200 +const __WATCHOS_11_3 = 110300 +const __WATCHOS_11_4 = 110400 +const __WATCHOS_11_5 = 110500 const __WATCHOS_1_0 = 10000 const __WATCHOS_2_0 = 20000 const __WATCHOS_2_1 = 20100 @@ -4910,14 +4989,14 @@ const __WINT_TYPE__ = 0 const __WINT_WIDTH__ = 32 const __amd64 = 1 const __amd64__ = 1 -const __apple_build_version__ = 16000026 +const __apple_build_version__ = 17000013 const __bool_true_false_are_defined = 1 const __clang__ = 1 const __clang_literal_encoding__ = "UTF-8" -const __clang_major__ = 16 +const __clang_major__ = 17 const __clang_minor__ = 0 const __clang_patchlevel__ = 0 -const __clang_version__ = "16.0.0 (clang-1600.0.26.6)" +const __clang_version__ = "17.0.0 (clang-1700.0.13.5)" const __clang_wide_literal_encoding__ = "UTF-32" const __code_model_small__ = 1 const __const = 0 @@ -4925,6 +5004,7 @@ const __core2 = 1 const __core2__ = 1 const __exported_pop = 0 const __exported_push = 0 +const __has_bounds_safety_attributes = 0 const __has_ptrcheck = 0 const __has_safe_buffers = 0 const __header_inline = 0 @@ -4950,6 +5030,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -4959,9 +5042,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -5388,12 +5468,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -5522,30 +5596,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - // C documentation // // /* @@ -5827,6 +5877,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -6057,33 +6108,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -6162,19 +6186,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -6259,7 +6270,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6351,223 +6361,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
column OP expr
-** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -6649,20 +6442,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -6712,13 +6491,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -6777,9 +6549,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -6787,17 +6559,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -6824,12 +6596,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
createFlag Behavior when page is not already in cache // **
0 Do not allocate a new page. Return NULL. -// **
1 Allocate a new page if it easy and convenient to do so. +// **
1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -6846,7 +6618,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -6864,7 +6636,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -6898,24 +6670,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -6939,22 +6693,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -7015,7 +6753,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -7095,50 +6833,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -7535,340 +7229,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -7878,15 +7238,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -7902,14 +7253,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -7935,17 +7278,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -8000,11 +7332,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -8378,55 +7716,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type t__int8_t = int8 type t__uint8_t = uint8 @@ -10069,6 +9363,11 @@ type _RuneLocale = T_RuneLocale ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -10127,6 +9426,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -10236,14 +9546,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -10328,7 +9630,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -10430,7 +9732,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -10489,6 +9790,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -10500,9 +9802,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -10517,7 +9819,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -10566,8 +9867,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -10631,7 +9932,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -10703,19 +10003,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -10729,11 +10032,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -10744,40 +10044,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -10795,7 +10096,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -10807,6 +10108,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -10955,9 +10257,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -10974,10 +10276,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -11012,6 +10310,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -11192,7 +10491,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -11234,7 +10532,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -11407,9 +10704,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -11536,53 +10833,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -11686,16 +10936,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -11719,38 +10959,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -11763,34 +10976,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -11804,90 +10993,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -11906,187 +11011,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -12096,913 +11020,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -13027,611 +11044,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -13641,317 +11053,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -14037,228 +11138,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -15341,7 +12220,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -15419,72 +12297,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -15530,164 +12346,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - -/* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - /* -** Clear any existing type flags from a Mem and replace them with f +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -15713,18 +12376,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -15741,100 +12392,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -15856,13 +12413,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -15882,14 +12432,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -15968,7 +12511,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -16140,7 +12683,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -16198,7 +12741,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -16327,24 +12870,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -16521,7 +13046,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -16592,10 +13117,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -16731,7 +13256,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -16828,7 +13353,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -16969,10 +13494,10 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = 0 _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1210, -int32(1)) @@ -16983,7 +13508,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -17061,7 +13586,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -17209,7 +13734,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -17512,7 +14037,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -17669,7 +14194,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -17717,7 +14242,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -17822,7 +14347,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -18338,28 +14863,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -18367,19 +14892,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -18396,12 +14921,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -18409,7 +14934,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -18422,34 +14947,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -18551,7 +15076,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -18762,14 +15287,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -18784,9 +15302,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -19200,7 +15718,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -19530,6 +16052,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -19537,8 +16061,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -20525,17 +17049,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -20732,22 +17256,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -20996,11 +17521,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -21028,7 +17553,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -21050,7 +17575,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -21477,29 +18002,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint32(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -21614,25 +18117,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1666 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1666 } else { - v98 = __ccgo_ts + 1671 + v97 = __ccgo_ts + 1671 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -21640,15 +18147,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -21659,13 +18166,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -21679,35 +18219,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.X__builtin___memcpy_chk(tls, bufpt+uintptr(j1), __ccgo_ts+1678, uint64(8), ^t__predefined_size_t(0)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if libc.Int32FromUint8(libc.Uint8FromInt8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -21732,9 +18335,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -21748,7 +18351,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1678, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1704, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -21758,21 +18361,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1680, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1706, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1690, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1716, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1711, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1737, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -22011,7 +18614,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.X__builtin___memcpy_chk(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1)), ^t__predefined_size_t(0)) p1 = p + 29 @@ -22310,6 +18913,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -22327,11 +18932,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -22765,63 +19370,10 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.X__builtin___memcpy_chk(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132), ^t__predefined_size_t(0)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr _ = p *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -22830,11 +19382,11 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui return int32(SQLITE_NOMEM) } if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn } else { (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -22965,6 +19517,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = libc.Int8FromUint8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -23735,7 +20318,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -23910,7 +20493,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1725, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1751, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -24122,11 +20705,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.X__builtin___memcpy_chk(tls, bp+16, bp+24, uint64(8), ^t__predefined_size_t(0)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -24362,7 +20945,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -24452,7 +21035,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1750 + pow63 = __ccgo_ts + 1776 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -24679,7 +21262,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1769)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1795)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -24839,7 +21422,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1785 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1811 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -24948,7 +21531,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -25359,7 +21942,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1787, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1813, libc.VaList(bp+8, zType)) } // C documentation @@ -25388,7 +21971,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1832) + _logBadConnection(tls, __ccgo_ts+1858) } return 0 } else { @@ -25402,7 +21985,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1841) + _logBadConnection(tls, __ccgo_ts+1867) return 0 } else { return int32(1) @@ -25487,7 +22070,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -25842,23 +22425,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -25913,8 +22494,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -25947,9 +22528,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -25969,13 +22549,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -25983,7 +22562,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -25999,7 +22578,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -26011,7 +22590,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -26060,7 +22639,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -26070,20 +22649,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -26102,196 +22680,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1849, - 1: __ccgo_ts + 1859, - 2: __ccgo_ts + 1870, - 3: __ccgo_ts + 1882, - 4: __ccgo_ts + 1893, - 5: __ccgo_ts + 1905, - 6: __ccgo_ts + 1912, - 7: __ccgo_ts + 1920, - 8: __ccgo_ts + 1928, - 9: __ccgo_ts + 1933, - 10: __ccgo_ts + 1938, - 11: __ccgo_ts + 1944, - 12: __ccgo_ts + 1958, - 13: __ccgo_ts + 1964, - 14: __ccgo_ts + 1974, - 15: __ccgo_ts + 1979, - 16: __ccgo_ts + 1984, - 17: __ccgo_ts + 1987, - 18: __ccgo_ts + 1993, - 19: __ccgo_ts + 2000, - 20: __ccgo_ts + 2004, - 21: __ccgo_ts + 2014, - 22: __ccgo_ts + 2021, - 23: __ccgo_ts + 2028, - 24: __ccgo_ts + 2035, - 25: __ccgo_ts + 2042, - 26: __ccgo_ts + 2052, - 27: __ccgo_ts + 2061, - 28: __ccgo_ts + 2072, - 29: __ccgo_ts + 2081, - 30: __ccgo_ts + 2087, - 31: __ccgo_ts + 2097, - 32: __ccgo_ts + 2107, - 33: __ccgo_ts + 2112, - 34: __ccgo_ts + 2126, - 35: __ccgo_ts + 2137, - 36: __ccgo_ts + 2142, - 37: __ccgo_ts + 2149, - 38: __ccgo_ts + 2160, - 39: __ccgo_ts + 2165, - 40: __ccgo_ts + 2170, - 41: __ccgo_ts + 2176, - 42: __ccgo_ts + 2182, - 43: __ccgo_ts + 2188, - 44: __ccgo_ts + 2191, - 45: __ccgo_ts + 2195, - 46: __ccgo_ts + 2201, - 47: __ccgo_ts + 2212, - 48: __ccgo_ts + 2223, - 49: __ccgo_ts + 2231, - 50: __ccgo_ts + 2240, - 51: __ccgo_ts + 2246, - 52: __ccgo_ts + 2253, - 53: __ccgo_ts + 2261, - 54: __ccgo_ts + 2264, - 55: __ccgo_ts + 2267, - 56: __ccgo_ts + 2270, - 57: __ccgo_ts + 2273, - 58: __ccgo_ts + 2276, - 59: __ccgo_ts + 2279, - 60: __ccgo_ts + 2286, - 61: __ccgo_ts + 2296, - 62: __ccgo_ts + 2309, - 63: __ccgo_ts + 2320, - 64: __ccgo_ts + 2326, - 65: __ccgo_ts + 2333, - 66: __ccgo_ts + 2342, - 67: __ccgo_ts + 2351, - 68: __ccgo_ts + 2358, - 69: __ccgo_ts + 2371, - 70: __ccgo_ts + 2382, - 71: __ccgo_ts + 2387, - 72: __ccgo_ts + 2395, - 73: __ccgo_ts + 2401, - 74: __ccgo_ts + 2408, - 75: __ccgo_ts + 2420, - 76: __ccgo_ts + 2425, - 77: __ccgo_ts + 2434, - 78: __ccgo_ts + 2439, - 79: __ccgo_ts + 2448, - 80: __ccgo_ts + 2453, - 81: __ccgo_ts + 2458, - 82: __ccgo_ts + 2464, - 83: __ccgo_ts + 2472, - 84: __ccgo_ts + 2480, - 85: __ccgo_ts + 2490, - 86: __ccgo_ts + 2498, - 87: __ccgo_ts + 2505, - 88: __ccgo_ts + 2518, - 89: __ccgo_ts + 2523, - 90: __ccgo_ts + 2535, - 91: __ccgo_ts + 2543, - 92: __ccgo_ts + 2550, - 93: __ccgo_ts + 2561, - 94: __ccgo_ts + 2568, - 95: __ccgo_ts + 2575, - 96: __ccgo_ts + 2585, - 97: __ccgo_ts + 2594, - 98: __ccgo_ts + 2605, - 99: __ccgo_ts + 2611, - 100: __ccgo_ts + 2622, - 101: __ccgo_ts + 2632, - 102: __ccgo_ts + 2642, - 103: __ccgo_ts + 2651, - 104: __ccgo_ts + 2658, - 105: __ccgo_ts + 2664, - 106: __ccgo_ts + 2674, - 107: __ccgo_ts + 2685, - 108: __ccgo_ts + 2689, - 109: __ccgo_ts + 2698, - 110: __ccgo_ts + 2707, - 111: __ccgo_ts + 2714, - 112: __ccgo_ts + 2724, - 113: __ccgo_ts + 2731, - 114: __ccgo_ts + 2741, - 115: __ccgo_ts + 2749, - 116: __ccgo_ts + 2756, - 117: __ccgo_ts + 2770, - 118: __ccgo_ts + 2784, - 119: __ccgo_ts + 2792, - 120: __ccgo_ts + 2803, - 121: __ccgo_ts + 2816, - 122: __ccgo_ts + 2827, - 123: __ccgo_ts + 2833, - 124: __ccgo_ts + 2845, - 125: __ccgo_ts + 2854, - 126: __ccgo_ts + 2862, - 127: __ccgo_ts + 2871, - 128: __ccgo_ts + 2880, - 129: __ccgo_ts + 2887, - 130: __ccgo_ts + 2895, - 131: __ccgo_ts + 2902, - 132: __ccgo_ts + 2913, - 133: __ccgo_ts + 2927, - 134: __ccgo_ts + 2938, - 135: __ccgo_ts + 2946, - 136: __ccgo_ts + 2952, - 137: __ccgo_ts + 2960, - 138: __ccgo_ts + 2968, - 139: __ccgo_ts + 2978, - 140: __ccgo_ts + 2991, - 141: __ccgo_ts + 3001, - 142: __ccgo_ts + 3014, - 143: __ccgo_ts + 3023, - 144: __ccgo_ts + 3034, - 145: __ccgo_ts + 3042, - 146: __ccgo_ts + 3048, - 147: __ccgo_ts + 3060, - 148: __ccgo_ts + 3072, - 149: __ccgo_ts + 3080, - 150: __ccgo_ts + 3092, - 151: __ccgo_ts + 3105, - 152: __ccgo_ts + 3115, - 153: __ccgo_ts + 3125, - 154: __ccgo_ts + 3137, - 155: __ccgo_ts + 3142, - 156: __ccgo_ts + 3154, - 157: __ccgo_ts + 3164, - 158: __ccgo_ts + 3170, - 159: __ccgo_ts + 3180, - 160: __ccgo_ts + 3187, - 161: __ccgo_ts + 3199, - 162: __ccgo_ts + 3210, - 163: __ccgo_ts + 3218, - 164: __ccgo_ts + 3227, - 165: __ccgo_ts + 3236, - 166: __ccgo_ts + 3245, - 167: __ccgo_ts + 3252, - 168: __ccgo_ts + 3263, - 169: __ccgo_ts + 3276, - 170: __ccgo_ts + 3286, - 171: __ccgo_ts + 3293, - 172: __ccgo_ts + 3301, - 173: __ccgo_ts + 3310, - 174: __ccgo_ts + 3316, - 175: __ccgo_ts + 3323, - 176: __ccgo_ts + 3331, - 177: __ccgo_ts + 3339, - 178: __ccgo_ts + 3347, - 179: __ccgo_ts + 3357, - 180: __ccgo_ts + 3366, - 181: __ccgo_ts + 3377, - 182: __ccgo_ts + 3388, - 183: __ccgo_ts + 3399, - 184: __ccgo_ts + 3409, - 185: __ccgo_ts + 3415, - 186: __ccgo_ts + 3426, - 187: __ccgo_ts + 3437, - 188: __ccgo_ts + 3442, - 189: __ccgo_ts + 3450, + 0: __ccgo_ts + 1875, + 1: __ccgo_ts + 1885, + 2: __ccgo_ts + 1896, + 3: __ccgo_ts + 1908, + 4: __ccgo_ts + 1919, + 5: __ccgo_ts + 1931, + 6: __ccgo_ts + 1938, + 7: __ccgo_ts + 1946, + 8: __ccgo_ts + 1954, + 9: __ccgo_ts + 1959, + 10: __ccgo_ts + 1964, + 11: __ccgo_ts + 1970, + 12: __ccgo_ts + 1984, + 13: __ccgo_ts + 1990, + 14: __ccgo_ts + 2000, + 15: __ccgo_ts + 2005, + 16: __ccgo_ts + 2010, + 17: __ccgo_ts + 2013, + 18: __ccgo_ts + 2019, + 19: __ccgo_ts + 2026, + 20: __ccgo_ts + 2030, + 21: __ccgo_ts + 2040, + 22: __ccgo_ts + 2047, + 23: __ccgo_ts + 2054, + 24: __ccgo_ts + 2061, + 25: __ccgo_ts + 2068, + 26: __ccgo_ts + 2078, + 27: __ccgo_ts + 2087, + 28: __ccgo_ts + 2098, + 29: __ccgo_ts + 2107, + 30: __ccgo_ts + 2113, + 31: __ccgo_ts + 2123, + 32: __ccgo_ts + 2133, + 33: __ccgo_ts + 2138, + 34: __ccgo_ts + 2152, + 35: __ccgo_ts + 2163, + 36: __ccgo_ts + 2168, + 37: __ccgo_ts + 2175, + 38: __ccgo_ts + 2186, + 39: __ccgo_ts + 2191, + 40: __ccgo_ts + 2196, + 41: __ccgo_ts + 2202, + 42: __ccgo_ts + 2208, + 43: __ccgo_ts + 2214, + 44: __ccgo_ts + 2217, + 45: __ccgo_ts + 2221, + 46: __ccgo_ts + 2227, + 47: __ccgo_ts + 2238, + 48: __ccgo_ts + 2249, + 49: __ccgo_ts + 2257, + 50: __ccgo_ts + 2266, + 51: __ccgo_ts + 2272, + 52: __ccgo_ts + 2279, + 53: __ccgo_ts + 2287, + 54: __ccgo_ts + 2290, + 55: __ccgo_ts + 2293, + 56: __ccgo_ts + 2296, + 57: __ccgo_ts + 2299, + 58: __ccgo_ts + 2302, + 59: __ccgo_ts + 2305, + 60: __ccgo_ts + 2312, + 61: __ccgo_ts + 2322, + 62: __ccgo_ts + 2335, + 63: __ccgo_ts + 2346, + 64: __ccgo_ts + 2352, + 65: __ccgo_ts + 2359, + 66: __ccgo_ts + 2368, + 67: __ccgo_ts + 2377, + 68: __ccgo_ts + 2384, + 69: __ccgo_ts + 2397, + 70: __ccgo_ts + 2408, + 71: __ccgo_ts + 2413, + 72: __ccgo_ts + 2421, + 73: __ccgo_ts + 2427, + 74: __ccgo_ts + 2434, + 75: __ccgo_ts + 2446, + 76: __ccgo_ts + 2451, + 77: __ccgo_ts + 2460, + 78: __ccgo_ts + 2465, + 79: __ccgo_ts + 2474, + 80: __ccgo_ts + 2479, + 81: __ccgo_ts + 2484, + 82: __ccgo_ts + 2490, + 83: __ccgo_ts + 2498, + 84: __ccgo_ts + 2506, + 85: __ccgo_ts + 2516, + 86: __ccgo_ts + 2524, + 87: __ccgo_ts + 2531, + 88: __ccgo_ts + 2544, + 89: __ccgo_ts + 2549, + 90: __ccgo_ts + 2561, + 91: __ccgo_ts + 2569, + 92: __ccgo_ts + 2576, + 93: __ccgo_ts + 2587, + 94: __ccgo_ts + 2594, + 95: __ccgo_ts + 2601, + 96: __ccgo_ts + 2611, + 97: __ccgo_ts + 2620, + 98: __ccgo_ts + 2631, + 99: __ccgo_ts + 2637, + 100: __ccgo_ts + 2648, + 101: __ccgo_ts + 2658, + 102: __ccgo_ts + 2668, + 103: __ccgo_ts + 2677, + 104: __ccgo_ts + 2684, + 105: __ccgo_ts + 2690, + 106: __ccgo_ts + 2700, + 107: __ccgo_ts + 2711, + 108: __ccgo_ts + 2715, + 109: __ccgo_ts + 2724, + 110: __ccgo_ts + 2733, + 111: __ccgo_ts + 2740, + 112: __ccgo_ts + 2750, + 113: __ccgo_ts + 2757, + 114: __ccgo_ts + 2767, + 115: __ccgo_ts + 2775, + 116: __ccgo_ts + 2782, + 117: __ccgo_ts + 2796, + 118: __ccgo_ts + 2810, + 119: __ccgo_ts + 2818, + 120: __ccgo_ts + 2829, + 121: __ccgo_ts + 2842, + 122: __ccgo_ts + 2853, + 123: __ccgo_ts + 2859, + 124: __ccgo_ts + 2871, + 125: __ccgo_ts + 2880, + 126: __ccgo_ts + 2888, + 127: __ccgo_ts + 2897, + 128: __ccgo_ts + 2906, + 129: __ccgo_ts + 2913, + 130: __ccgo_ts + 2921, + 131: __ccgo_ts + 2928, + 132: __ccgo_ts + 2939, + 133: __ccgo_ts + 2953, + 134: __ccgo_ts + 2964, + 135: __ccgo_ts + 2972, + 136: __ccgo_ts + 2978, + 137: __ccgo_ts + 2986, + 138: __ccgo_ts + 2994, + 139: __ccgo_ts + 3004, + 140: __ccgo_ts + 3017, + 141: __ccgo_ts + 3027, + 142: __ccgo_ts + 3040, + 143: __ccgo_ts + 3049, + 144: __ccgo_ts + 3060, + 145: __ccgo_ts + 3068, + 146: __ccgo_ts + 3074, + 147: __ccgo_ts + 3086, + 148: __ccgo_ts + 3098, + 149: __ccgo_ts + 3106, + 150: __ccgo_ts + 3118, + 151: __ccgo_ts + 3131, + 152: __ccgo_ts + 3141, + 153: __ccgo_ts + 3151, + 154: __ccgo_ts + 3163, + 155: __ccgo_ts + 3168, + 156: __ccgo_ts + 3180, + 157: __ccgo_ts + 3190, + 158: __ccgo_ts + 3196, + 159: __ccgo_ts + 3206, + 160: __ccgo_ts + 3213, + 161: __ccgo_ts + 3225, + 162: __ccgo_ts + 3236, + 163: __ccgo_ts + 3244, + 164: __ccgo_ts + 3253, + 165: __ccgo_ts + 3262, + 166: __ccgo_ts + 3271, + 167: __ccgo_ts + 3278, + 168: __ccgo_ts + 3289, + 169: __ccgo_ts + 3302, + 170: __ccgo_ts + 3312, + 171: __ccgo_ts + 3319, + 172: __ccgo_ts + 3327, + 173: __ccgo_ts + 3336, + 174: __ccgo_ts + 3342, + 175: __ccgo_ts + 3349, + 176: __ccgo_ts + 3357, + 177: __ccgo_ts + 3365, + 178: __ccgo_ts + 3373, + 179: __ccgo_ts + 3383, + 180: __ccgo_ts + 3392, + 181: __ccgo_ts + 3403, + 182: __ccgo_ts + 3414, + 183: __ccgo_ts + 3425, + 184: __ccgo_ts + 3435, + 185: __ccgo_ts + 3441, + 186: __ccgo_ts + 3452, + 187: __ccgo_ts + 3463, + 188: __ccgo_ts + 3468, + 189: __ccgo_ts + 3476, } type Tu_char = uint8 @@ -27671,6 +24249,7 @@ const _kGUARD_EXC_INVALID_OPTIONS = 3 const _kGUARD_EXC_SET_CONTEXT = 4 const _kGUARD_EXC_THREAD_SET_STATE = 5 const _kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE = 6 +const _kGUARD_EXC_SERVICE_PORT_VIOLATION_FATAL = 7 const _kGUARD_EXC_UNGUARDED = 8 const _kGUARD_EXC_INCORRECT_GUARD = 16 const _kGUARD_EXC_IMMOVABLE = 32 @@ -27689,6 +24268,8 @@ const _kGUARD_EXC_SEND_INVALID_VOUCHER = 131072 const _kGUARD_EXC_SEND_INVALID_RIGHT = 262144 const _kGUARD_EXC_RCV_INVALID_NAME = 524288 const _kGUARD_EXC_RCV_GUARDED_DESC = 1048576 +const _kGUARD_EXC_SERVICE_PORT_VIOLATION_NON_FATAL = 1048577 +const _kGUARD_EXC_PROVISIONAL_REPLY_PORT = 1048578 const _kGUARD_EXC_MOD_REFS_NON_FATAL = 2097152 const _kGUARD_EXC_IMMOVABLE_NON_FATAL = 4194304 const _kGUARD_EXC_REQUIRE_REPLY_PORT_SEMANTICS = 8388608 @@ -28107,22 +24688,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -28155,32 +24720,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 - FopenFlags int32 - FfsFlags uint32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -28258,91 +24797,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3460, + FzName: __ccgo_ts + 3486, }, 1: { - FzName: __ccgo_ts + 3465, + FzName: __ccgo_ts + 3491, }, 2: { - FzName: __ccgo_ts + 3471, + FzName: __ccgo_ts + 3497, }, 3: { - FzName: __ccgo_ts + 3478, + FzName: __ccgo_ts + 3504, }, 4: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3511, }, 5: { - FzName: __ccgo_ts + 3490, + FzName: __ccgo_ts + 3516, }, 6: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 7: { - FzName: __ccgo_ts + 3506, + FzName: __ccgo_ts + 3532, }, 8: { - FzName: __ccgo_ts + 3512, + FzName: __ccgo_ts + 3538, }, 9: { - FzName: __ccgo_ts + 3517, + FzName: __ccgo_ts + 3543, }, 10: { - FzName: __ccgo_ts + 3523, + FzName: __ccgo_ts + 3549, }, 11: { - FzName: __ccgo_ts + 3531, + FzName: __ccgo_ts + 3557, }, 12: { - FzName: __ccgo_ts + 3537, + FzName: __ccgo_ts + 3563, }, 13: { - FzName: __ccgo_ts + 3544, + FzName: __ccgo_ts + 3570, }, 14: { - FzName: __ccgo_ts + 3553, + FzName: __ccgo_ts + 3579, }, 15: { - FzName: __ccgo_ts + 3560, + FzName: __ccgo_ts + 3586, }, 16: { - FzName: __ccgo_ts + 3570, + FzName: __ccgo_ts + 3596, }, 17: { - FzName: __ccgo_ts + 3577, + FzName: __ccgo_ts + 3603, }, 18: { - FzName: __ccgo_ts + 3591, + FzName: __ccgo_ts + 3617, }, 19: { - FzName: __ccgo_ts + 3597, + FzName: __ccgo_ts + 3623, }, 20: { - FzName: __ccgo_ts + 3603, + FzName: __ccgo_ts + 3629, }, 21: { - FzName: __ccgo_ts + 3610, + FzName: __ccgo_ts + 3636, }, 22: { - FzName: __ccgo_ts + 3618, + FzName: __ccgo_ts + 3644, }, 23: { - FzName: __ccgo_ts + 3623, + FzName: __ccgo_ts + 3649, }, 24: { - FzName: __ccgo_ts + 3630, + FzName: __ccgo_ts + 3656, }, 25: { - FzName: __ccgo_ts + 3637, + FzName: __ccgo_ts + 3663, }, 26: { - FzName: __ccgo_ts + 3649, + FzName: __ccgo_ts + 3675, }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -28402,7 +24941,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -28440,10 +24979,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -28579,9 +25118,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3670, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3696, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3713, O_RDONLY, libc.Int32FromUint16(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3739, O_RDONLY, libc.Int32FromUint16(m)) < 0 { break } } @@ -28817,48 +25356,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr - FsharedByte uint64 -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -28902,7 +25399,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1665 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3723, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3749, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -28930,7 +25427,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< int32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3809, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3836, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -29648,7 +26145,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -30111,13 +26608,6 @@ type TafpLockingContext = struct { type afpLockingContext = TafpLockingContext -type TafpLockingContext1 = struct { - Freserved int32 - FdbPath uintptr -} - -type afpLockingContext1 = TafpLockingContext1 - type TByteRangeLockPB2 = struct { Foffset uint64 Flength uint64 @@ -30304,7 +26794,7 @@ func _afpLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { */ if eFileLock == int32(SHARED_LOCK) { lrc1Errno = 0 - mask = libc.Int64FromUint32(0xffffffff) | libc.Int64FromInt32(0x7fffffff)< 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -30865,7 +27355,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3577, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3603, bp, int32(42579)) } // C documentation @@ -30902,7 +27392,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -31454,7 +27855,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -31517,7 +27918,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -31750,7 +28151,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*int32)(unsafe.Pointer(bp + 144)) = 0 if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1665, int32(1), bp+144) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -32790,10 +29190,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3952, - 3: __ccgo_ts + 3961, - 4: __ccgo_ts + 3970, - 5: __ccgo_ts + 1678, + 2: __ccgo_ts + 3978, + 3: __ccgo_ts + 3987, + 4: __ccgo_ts + 3996, + 5: __ccgo_ts + 1704, } // C documentation @@ -32802,8 +29202,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3975) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3989) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+4001) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+4015) } // C documentation @@ -32865,7 +29265,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = 0 - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3996, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4022, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -33037,7 +29437,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4013) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4039) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -33194,7 +29594,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3460, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3486, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -33230,13 +29630,13 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } if libc.Xfstatfs(tls, fd, bp) == -int32(1) { _storeLastErrno(tls, p, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - _robust_close(tls, p, fd, int32(45048)) + _robust_close(tls, p, fd, int32(45308)) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(13)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+144, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(1026)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3649, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3675, zIn, int32(45510)) return } (*(*[1026]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -33508,14 +29898,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if int32(*(*int8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3478, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3504, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*int8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = 0 if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)< uint64(PATH_MAX) || pathLen < uint64(6) || libc.Xstrlcpy(tls, bp+uintptr(pathLen-uint64(5)), __ccgo_ts+4106, uint64(6)) != uint64(5) { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4112, libc.VaList(bp+2144, libc.Int32FromUint64(pathLen))) + if pathLen > uint64(PATH_MAX) || pathLen < uint64(6) || libc.Xstrlcpy(tls, bp+uintptr(pathLen-uint64(5)), __ccgo_ts+4132, uint64(6)) != uint64(5) { + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4138, libc.VaList(bp+2144, libc.Int32FromUint64(pathLen))) goto end_breaklock } /* read the conch content */ readLen = libc.Uint64FromInt64((*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(9)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, bp+1024, libc.Uint64FromInt32(libc.Int32FromInt32(PROXY_HEADERLEN)+libc.Int32FromInt32(PROXY_HOSTIDLEN)+libc.Int32FromInt32(PATH_MAX)), 0)) if readLen < libc.Uint64FromInt32(libc.Int32FromInt32(PROXY_HEADERLEN)+libc.Int32FromInt32(PROXY_HOSTIDLEN)) { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4132, libc.VaList(bp+2144, libc.Int32FromUint64(readLen))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4158, libc.VaList(bp+2144, libc.Int32FromUint64(readLen))) goto end_breaklock } /* write it out to the temporary break file */ fd = _robust_open(tls, bp, libc.Int32FromInt32(O_RDWR)|libc.Int32FromInt32(O_CREAT)|libc.Int32FromInt32(O_EXCL)|libc.Int32FromInt32(O_NOFOLLOW), uint16(0)) if fd < 0 { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4152, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4178, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) goto end_breaklock } if (*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(12)].FpCurrent})))(tls, fd, bp+1024, readLen, 0) != libc.Int64FromUint64(readLen) { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4171, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4197, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) goto end_breaklock } if libc.Xrename(tls, bp, cPath) != 0 { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4189, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4215, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) goto end_breaklock } rc = 0 - libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4208, libc.VaList(bp+2144, cPath)) - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, int32(45977)) + libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4234, libc.VaList(bp+2144, cPath)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, int32(46237)) (*TunixFile)(unsafe.Pointer(conchFile)).Fh = fd (*TunixFile)(unsafe.Pointer(conchFile)).FopenFlags = libc.Int32FromInt32(O_RDWR) | libc.Int32FromInt32(O_CREAT) goto end_breaklock @@ -34175,9 +30551,9 @@ end_breaklock: if rc != 0 { if fd >= 0 { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, bp) - _robust_close(tls, pFile, fd, int32(45985)) + _robust_close(tls, pFile, fd, int32(46245)) } - libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4232, libc.VaList(bp+2144, cPath, bp+2065)) + libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4258, libc.VaList(bp+2144, cPath, bp+2065)) } return rc } @@ -34398,14 +30774,14 @@ func _proxyTakeConch(tls *libc.TLS, pFile uintptr) (r int32) { ; if rc == SQLITE_OK && (*TunixFile)(unsafe.Pointer(pFile)).FopenFlags != 0 { if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(46238)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(46498)) } (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) fd = _robust_open(tls, (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FdbPath, (*TunixFile)(unsafe.Pointer(pFile)).FopenFlags, uint16(0)) if fd >= 0 { (*TunixFile)(unsafe.Pointer(pFile)).Fh = fd } else { - rc = _sqlite3CantopenError(tls, int32(46246)) /* SQLITE_BUSY? proxyTakeConch called + rc = _sqlite3CantopenError(tls, int32(46506)) /* SQLITE_BUSY? proxyTakeConch called during locking */ } } @@ -34528,7 +30904,7 @@ func _proxyCreateConchPathname(tls *libc.TLS, dbPath uintptr, pConchPath uintptr i++ } /* append the "-conch" suffix to the file */ - libc.X__builtin___memcpy_chk(tls, conchPath+uintptr(i+int32(1)), __ccgo_ts+4270, uint64(7), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, conchPath+uintptr(i+int32(1)), __ccgo_ts+4296, uint64(7), ^t__predefined_size_t(0)) return SQLITE_OK } @@ -34548,7 +30924,7 @@ func _switchLockProxyPath(tls *libc.TLS, pFile uintptr, path uintptr) (r int32) return int32(SQLITE_BUSY) } /* nothing to do if the path is NULL, :auto: or matches the existing path */ - if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4059) != 0) || oldPath != 0 && !(libc.Xstrncmp(tls, oldPath, path, uint64(PATH_MAX)) != 0) { + if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4085) != 0) || oldPath != 0 && !(libc.Xstrncmp(tls, oldPath, path, uint64(PATH_MAX)) != 0) { return SQLITE_OK } else { lockProxy = (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxy @@ -34587,7 +30963,7 @@ func _proxyGetDbPathForUnixFile(tls *libc.TLS, pFile uintptr, dbPath uintptr) (r if (*TunixFile)(unsafe.Pointer(pFile)).FpMethod == uintptr(unsafe.Pointer(&_dotlockIoMethods)) { /* dot lock style uses the locking context to store the dot lock ** file path */ - len1 = libc.Int32FromUint64(libc.Xstrlen(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext) - libc.Xstrlen(tls, __ccgo_ts+4277)) + len1 = libc.Int32FromUint64(libc.Xstrlen(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext) - libc.Xstrlen(tls, __ccgo_ts+4303)) libc.X__builtin___memcpy_chk(tls, dbPath, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext, libc.Uint64FromInt32(len1+int32(1)), ^t__predefined_size_t(0)) } else { /* all other styles use the locking context to store the db file path */ @@ -34622,7 +30998,7 @@ func _proxyTransformUnixFile(tls *libc.TLS, pFile uintptr, path uintptr) (r int3 return int32(SQLITE_BUSY) } _proxyGetDbPathForUnixFile(tls, pFile, bp) - if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4059) != 0) { + if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4085) != 0) { lockPath = libc.UintptrFromInt32(0) } else { lockPath = path @@ -34697,7 +31073,7 @@ func _proxyFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int if (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != 0 { *(*uintptr)(unsafe.Pointer(pArg)) = (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath } else { - *(*uintptr)(unsafe.Pointer(pArg)) = __ccgo_ts + 4283 + *(*uintptr)(unsafe.Pointer(pArg)) = __ccgo_ts + 4309 } } else { *(*uintptr)(unsafe.Pointer(pArg)) = libc.UintptrFromInt32(0) @@ -34722,7 +31098,7 @@ func _proxyFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int proxyPath = pArg if isProxyStyle != 0 { pCtx1 = (*TunixFile)(unsafe.Pointer(pFile1)).FlockingContext - if !(libc.Xstrcmp(tls, pArg, __ccgo_ts+4059) != 0) || (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath != 0 && !(libc.Xstrncmp(tls, (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath, proxyPath, uint64(PATH_MAX)) != 0) { + if !(libc.Xstrcmp(tls, pArg, __ccgo_ts+4085) != 0) || (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath != 0 && !(libc.Xstrncmp(tls, (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath, proxyPath, uint64(PATH_MAX)) != 0) { rc = SQLITE_OK } else { rc = _switchLockProxyPath(tls, pFile1, proxyPath) @@ -34991,55 +31367,55 @@ var _aVfs = [9]Tsqlite3_vfs{ FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4301, + FzName: __ccgo_ts + 4327, }, 1: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4306, + FzName: __ccgo_ts + 4332, }, 2: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4316, + FzName: __ccgo_ts + 4342, }, 3: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 3934, + FzName: __ccgo_ts + 3960, }, 4: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4329, + FzName: __ccgo_ts + 4355, }, 5: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4340, + FzName: __ccgo_ts + 4366, }, 6: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4351, + FzName: __ccgo_ts + 4377, }, 7: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4360, + FzName: __ccgo_ts + 4386, }, 8: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4369, + FzName: __ccgo_ts + 4395, }, } @@ -35310,71 +31686,6 @@ type TMemStore = struct { type MemStore = TMemStore -/* Access to a lower-level VFS that (might) implement dynamic loading, -** access to randomness, etc. - */ - -/* Storage for a memdb file. -** -** An memdb object can be shared or separate. Shared memdb objects can be -** used by more than one database connection. Mutexes are used by shared -** memdb objects to coordinate access. Separate memdb objects are only -** connected to a single database connection and do not require additional -** mutexes. -** -** Shared memdb objects have .zFName!=0 and .pMutex!=0. They are created -** using "file:/name?vfs=memdb". The first character of the name must be -** "/" or else the object will be a separate memdb object. All shared -** memdb objects are stored in memdb_g.apMemStore[] in an arbitrary order. -** -** Separate memdb objects are created using a name that does not begin -** with "/" or using sqlite3_deserialize(). -** -** Access rules for shared MemStore objects: -** -** * .zFName is initialized when the object is created and afterwards -** is unchanged until the object is destroyed. So it can be accessed -** at any time as long as we know the object is not being destroyed, -** which means while either the SQLITE_MUTEX_STATIC_VFS1 or -** .pMutex is held or the object is not part of memdb_g.apMemStore[]. -** -** * Can .pMutex can only be changed while holding the -** SQLITE_MUTEX_STATIC_VFS1 mutex or while the object is not part -** of memdb_g.apMemStore[]. -** -** * Other fields can only be changed while holding the .pMutex mutex -** or when the .nRef is less than zero and the object is not part of -** memdb_g.apMemStore[]. -** -** * The .aData pointer has the added requirement that it can can only -** be changed (for resizing) when nMmap is zero. -** - */ -type TMemStore1 = struct { - Fsz Tsqlite3_int64 - FszAlloc Tsqlite3_int64 - FszMax Tsqlite3_int64 - FaData uintptr - FpMutex uintptr - FnMmap int32 - FmFlags uint32 - FnRdLock int32 - FnWrLock int32 - FnRef int32 - FzFName uintptr -} - -type MemStore1 = TMemStore1 - -/* An open file */ -type TMemFile1 = struct { - Fbase Tsqlite3_file - FpStore uintptr - FeLock int32 -} - -type MemFile1 = TMemFile1 - // C documentation // // /* @@ -35403,7 +31714,7 @@ var _memdb_g TMemFS var _memdb_vfs = Tsqlite3_vfs{ FiVersion: int32(2), FmxPathname: int32(1024), - FzName: __ccgo_ts + 4380, + FzName: __ccgo_ts + 4406, } func init() { @@ -35749,7 +32060,7 @@ func _memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = int32(SQLITE_NOTFOUND) _memdbEnter(tls, p) if op == int32(SQLITE_FCNTL_VFSNAME) { - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4386, libc.VaList(bp+8, (*TMemStore)(unsafe.Pointer(p)).FaData, (*TMemStore)(unsafe.Pointer(p)).Fsz)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4412, libc.VaList(bp+8, (*TMemStore)(unsafe.Pointer(p)).FaData, (*TMemStore)(unsafe.Pointer(p)).Fsz)) rc = SQLITE_OK } if op == int32(SQLITE_FCNTL_SIZE_LIMIT) { @@ -35844,12 +32155,12 @@ func _memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags i i++ } if p == uintptr(0) { - p = _sqlite3Malloc(tls, uint64(72)+libc.Uint64FromInt32(szName)+uint64(3)) + p = _sqlite3Malloc(tls, uint64(72)+libc.Uint64FromInt64(int64(szName))+uint64(3)) if p == uintptr(0) { Xsqlite3_mutex_leave(tls, pVfsMutex) return int32(SQLITE_NOMEM) } - apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(8)*libc.Uint64FromInt32(_memdb_g.FnMemStore+libc.Int32FromInt32(1))) + apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(8)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(_memdb_g.FnMemStore))) if apNew == uintptr(0) { Xsqlite3_free(tls, p) Xsqlite3_mutex_leave(tls, pVfsMutex) @@ -35924,7 +32235,7 @@ func _memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, bp := tls.Alloc(16) defer tls.Free(16) _ = pVfs - Xsqlite3_snprintf(tls, nOut, zOut, __ccgo_ts+3864, libc.VaList(bp+8, zPath)) + Xsqlite3_snprintf(tls, nOut, zOut, __ccgo_ts+3890, libc.VaList(bp+8, zPath)) return SQLITE_OK } @@ -36071,7 +32382,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp return uintptr(0) } szPage = _sqlite3BtreeGetPageSize(tls, pBt) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4401, libc.VaList(bp+24, zSchema)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4427, libc.VaList(bp+24, zSchema)) if zSql != 0 { v1 = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), bp, uintptr(0)) } else { @@ -36089,7 +32400,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) if sz == 0 { Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) - Xsqlite3_exec(tls, db, __ccgo_ts+4424, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4450, uintptr(0), uintptr(0), uintptr(0)) rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == int32(SQLITE_ROW) { sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) @@ -36152,7 +32463,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint rc = int32(SQLITE_ERROR) goto end_deserialize } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4449, libc.VaList(bp+16, zSchema)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4475, libc.VaList(bp+16, zSchema)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -36233,101 +32544,6 @@ func _sqlite3MemdbInit(tls *libc.TLS) (r int32) { return Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&_memdb_vfs)), 0) } -/************** End of memdb.c ***********************************************/ -/************** Begin file bitvec.c ******************************************/ -/* -** 2008 February 16 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements an object that represents a fixed-length -** bitmap. Bits are numbered starting with 1. -** -** A bitmap is used to record which pages of a database file have been -** journalled during a transaction, or which pages have the "dont-write" -** property. Usually only a few pages are meet either condition. -** So the bitmap is usually sparse and has low cardinality. -** But sometimes (for example when during a DROP of a large table) most -** or all of the pages in a database can get journalled. In those cases, -** the bitmap becomes dense with high cardinality. The algorithm needs -** to handle both cases well. -** -** The size of the bitmap is fixed when the object is created. -** -** All bits are clear when the bitmap is created. Individual bits -** may be set or cleared one at a time. -** -** Test operations are about 100 times more common that set operations. -** Clear operations are exceedingly rare. There are usually between -** 5 and 500 set operations per Bitvec object, though the number of sets can -** sometimes grow into tens of thousands or larger. The size of the -** Bitvec object is the number of pages in the database file at the -** start of a transaction, and is thus usually less than a few thousand, -** but can be as large as 2 billion for a really big database. - */ -/* #include "sqliteInt.h" */ - -/* Size of the Bitvec structure in bytes. */ - -/* Round the union size down to the nearest pointer boundary, since that's how -** it will be aligned within the Bitvec struct. */ - -/* Type of the array "element" for the bitmap representation. -** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE. -** Setting this to the "natural word" size of your CPU may improve -** performance. */ -/* Size, in bits, of the bitmap element. */ -/* Number of elements in a bitmap array. */ -/* Number of bits in the bitmap array. */ - -/* Number of u32 values in hash table. */ -/* Maximum number of entries in hash table before -** sub-dividing and re-hashing. */ -/* Hashing function for the aHash representation. -** Empirical testing showed that the *37 multiplier -** (an arbitrary prime)in the hash function provided -** no fewer collisions than the no-op *1. */ - -/* -** A bitmap is an instance of the following structure. -** -** This bitmap records the existence of zero or more bits -** with values between 1 and iSize, inclusive. -** -** There are three possible representations of the bitmap. -** If iSize<=BITVEC_NBIT, then Bitvec.u.aBitmap[] is a straight -** bitmap. The least significant bit is bit 1. -** -** If iSize>BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -36465,7 +32681,13 @@ bitvec_set_rehash: } else { libc.X__builtin___memcpy_chk(tls, aiValues, p+16, uint64(496), ^t__predefined_size_t(0)) libc.X__builtin___memset_chk(tls, p+16, 0, uint64(496), ^t__predefined_size_t(0)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -36519,7 +32741,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.X__builtin___memcpy_chk(tls, aiValues, p+16, uint64(496), ^t__predefined_size_t(0)) @@ -36563,7 +32785,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -36638,7 +32860,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -36692,7 +32914,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -36726,66 +32948,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -36959,14 +33121,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.X__builtin___memset_chk(tls, p, 0, uint64(80), ^t__predefined_size_t(0)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -37782,123 +33944,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -37979,7 +34024,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -38073,7 +34118,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -38114,7 +34159,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -38242,7 +34287,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) } else { return _sqlite3HeapNearlyFull(tls) } @@ -38262,17 +34307,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -38290,7 +34337,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -38302,7 +34349,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -38503,10 +34550,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -39092,25 +35140,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -40072,258 +36101,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -40422,7 +36199,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -40651,7 +36428,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -40669,7 +36446,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -41242,6 +37019,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -41888,7 +37674,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -41900,7 +37687,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -41921,11 +37708,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -41954,7 +37742,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -42187,7 +37975,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -42324,7 +38112,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -42340,7 +38128,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -43087,10 +38875,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -43991,7 +39779,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -44035,7 +39823,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -44066,7 +39854,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -44117,7 +39905,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -44152,7 +39940,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.X__builtin___memcpy_chk(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname), ^t__predefined_size_t(0)) pPtr += uintptr(nPathname) - libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4491, uint64(8), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4517, uint64(8), ^t__predefined_size_t(0)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -44162,7 +39950,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.X__builtin___memcpy_chk(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname), ^t__predefined_size_t(0)) pPtr += uintptr(nPathname) - libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4500, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4526, uint64(4), ^t__predefined_size_t(0)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -44204,8 +39992,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4505, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4512, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4531, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4538, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -44288,7 +40076,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -44544,7 +40332,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -44719,7 +40507,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -44750,7 +40538,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -44822,7 +40610,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -45882,7 +41670,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -46179,7 +41967,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -46447,7 +42235,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4522, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4548, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -47011,9 +42799,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -47028,227 +42816,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -47267,28 +42834,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -47347,7 +42893,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -47359,7 +42905,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -47448,6 +42994,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -47715,14 +43262,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -47889,7 +43428,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -47977,12 +43516,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -48116,7 +43655,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -48557,10 +44096,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -48658,7 +44197,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -48697,7 +44236,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = *(*Tu32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -48710,7 +44249,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -48726,7 +44265,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -48747,7 +44286,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -48813,7 +44352,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -48863,7 +44402,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4577, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4603, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -49078,7 +44617,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -49104,7 +44650,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -49827,8 +45373,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -49915,7 +45461,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -50061,7 +45607,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -50088,7 +45634,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -50097,6 +45643,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -50141,6 +45688,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -50412,7 +45962,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -50593,7 +46143,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -50602,7 +46152,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -50654,14 +46204,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -51207,283 +46757,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -51616,27 +46889,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -51799,10 +47051,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -51811,14 +47064,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -52518,11 +47771,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -52696,7 +47949,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -52709,12 +47962,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -52758,7 +48011,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -52766,7 +48019,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -52954,7 +48207,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -52987,7 +48240,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -53186,7 +48439,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -53226,12 +48479,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -53239,21 +48492,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.X__builtin___memmove_chk(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz)), ^t__predefined_size_t(0)) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -53300,12 +48553,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -53321,7 +48574,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -53381,7 +48634,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -53398,14 +48651,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -53448,11 +48701,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -53466,7 +48719,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -53519,42 +48772,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -53562,70 +48813,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -53671,7 +48922,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -53697,7 +48948,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -53736,12 +48987,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -53768,7 +49019,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -53799,11 +49050,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))< iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -53832,11 +49083,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -53845,7 +49096,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -53867,15 +49118,13 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.X__builtin___memset_chk(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr)), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr)), ^t__predefined_size_t(0)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt8(int8(flags)) if flags&int32(PTF_LEAF) == 0 { @@ -53883,14 +49132,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.X__builtin___memset_chk(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4), ^t__predefined_size_t(0)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.X__builtin___memset_chk(tls, data+uintptr(hdr+int32(1)), 0, uint64(4), ^t__predefined_size_t(0)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -53998,7 +49247,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -54060,7 +49309,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -54148,7 +49397,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4603) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4629) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -54772,7 +50021,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -54934,7 +50183,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4612, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4638, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -54972,7 +50221,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -55413,7 +50662,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -55437,7 +50686,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -55446,7 +50695,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -55460,7 +50709,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -55490,7 +50739,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -55586,7 +50835,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -55624,7 +50873,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -55691,7 +50940,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -55734,7 +50983,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -55764,7 +51013,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -56230,7 +51479,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -56622,7 +51871,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -56632,7 +51881,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -56663,7 +51912,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -56689,7 +51938,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -56763,7 +52012,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -56898,7 +52147,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -56910,7 +52159,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -57026,7 +52275,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -57040,7 +52289,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -57274,7 +52523,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -57358,7 +52607,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -57370,7 +52619,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -57572,7 +52821,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -57605,7 +52854,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -57614,7 +52863,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -57743,7 +52992,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -57853,7 +53102,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -57941,7 +53190,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -57996,7 +53245,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -58022,7 +53271,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -58049,7 +53298,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -58120,7 +53369,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -58258,7 +53507,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -58309,7 +53558,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -58318,7 +53567,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -58408,7 +53657,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -58426,7 +53675,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -58449,7 +53698,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -58670,10 +53919,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -58964,17 +54213,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -59064,12 +54302,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -59077,7 +54315,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.X__builtin___memmove_chk(tls, pData, pCell, uint64(sz), ^t__predefined_size_t(0)) i++ @@ -59172,7 +54410,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.X__builtin___memmove_chk(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz), ^t__predefined_size_t(0)) @@ -59253,7 +54491,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -59280,7 +54518,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -59320,7 +54558,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.X__builtin___memmove_chk(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2)), ^t__predefined_size_t(0)) nCell -= nShift @@ -59391,7 +54629,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -59436,7 +54674,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -59632,10 +54870,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -59758,8 +54997,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -59799,7 +55038,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -59822,7 +55061,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.X__builtin___memset_chk(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow)), ^t__predefined_size_t(0)) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -59953,7 +55192,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -59996,7 +55235,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -60055,7 +55294,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -60087,7 +55326,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -60317,7 +55556,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -60563,7 +55802,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -60636,7 +55875,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -60795,7 +56034,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -60826,7 +56065,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -60911,7 +56150,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -61003,7 +56242,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -61039,7 +56278,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -61069,10 +56308,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.X__builtin___memcpy_chk(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8))), ^t__predefined_size_t(0)) return SQLITE_OK @@ -61190,12 +56429,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.X__builtin___memcpy_chk(tls, aOut, aIn, uint64(nIn), ^t__predefined_size_t(0)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -61205,14 +56444,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -61312,21 +56551,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx))))< _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -61571,7 +56810,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -61652,14 +56891,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -61796,7 +57035,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -62061,7 +57300,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4616, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4642, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -62109,11 +57348,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4618, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4644, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4641, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4667, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -62139,11 +57378,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4771, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4797, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -62215,11 +57454,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4810 + v2 = __ccgo_ts + 4836 } else { - v2 = __ccgo_ts + 4815 + v2 = __ccgo_ts + 4841 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4836, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4862, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -62355,12 +57594,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4862 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4888 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4880, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4906, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5034, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5060, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5064, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5090, 0) doCoverageCheck = 0 goto _4 } @@ -62445,7 +57684,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5088, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5114, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -62468,7 +57707,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5112, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5138, 0) depth = d2 } } else { @@ -62545,7 +57784,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5137, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5163, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -62559,7 +57798,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5174, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5200, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -62650,7 +57889,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 5226 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 5252 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -62674,11 +57913,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+5237, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+5263, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5282, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+5308, 0) } } } @@ -62715,10 +57954,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+5337, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5363, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5357, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5383, libc.VaList(bp+248, i)) } goto _3 _3: @@ -62848,14 +58087,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -63066,45 +58305,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -63157,7 +58357,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3864, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -63167,7 +58367,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5389, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5415, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -63196,7 +58396,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5409, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5435, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -63226,7 +58426,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5440, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5466, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -63902,7 +59102,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5480, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5506, libc.VaList(bp+40, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -64040,9 +59240,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -64217,20 +59414,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) - libc.X__builtin___memset_chk(tls, bp+56, 0, uint64(56), ^t__predefined_size_t(0)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp+48, 0, uint64(56), ^t__predefined_size_t(0)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.X__builtin___memcpy_chk(tls, pMem, bp+56, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pMem, bp+48, uint64(56), ^t__predefined_size_t(0)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -64245,10 +59442,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -64707,7 +59904,7 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) @@ -64720,8 +59917,8 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -64880,7 +60077,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -64922,11 +60119,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -64936,7 +60133,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -64958,12 +60155,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -65002,7 +60199,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -65114,8 +60311,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -65166,7 +60363,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -65174,8 +60372,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -65232,14 +60430,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -65253,7 +60451,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -65278,14 +60476,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3864, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -65385,7 +60583,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5487 + zNeg = __ccgo_ts + 5513 } } } @@ -65400,7 +60598,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5489, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5515, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -65704,7 +60902,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -65720,7 +60918,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -65730,7 +60928,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -65781,9 +60979,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -65857,7 +61055,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.X__builtin___memset_chk(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136), ^t__predefined_size_t(0)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -66191,12 +61389,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -66370,7 +61567,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -66387,7 +61584,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -66455,8 +61652,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -66469,11 +61666,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -66510,13 +61707,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -66547,7 +61747,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -67049,7 +62249,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5494, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5520, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -67062,39 +62262,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1665 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5499) == 0 { - zColl = __ccgo_ts + 5506 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5525) == 0 { + zColl = __ccgo_ts + 5532 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5487 + v3 = __ccgo_ts + 5513 } else { v3 = __ccgo_ts + 1665 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5508 + v4 = __ccgo_ts + 5534 } else { v4 = __ccgo_ts + 1665 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5511, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5537, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5545, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5535, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5561, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5544, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5570, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5544, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5570, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1426, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5551, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5577, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1393, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -67111,14 +62311,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1666 } else { - zP4 = __ccgo_ts + 5554 + zP4 = __ccgo_ts + 5580 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5561, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5587, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -67133,20 +62333,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5569, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5595, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5574, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5600, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5576 + zP4 = __ccgo_ts + 5602 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5584, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5610, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -67160,10 +62360,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5521, - 1: __ccgo_ts + 5523, - 2: __ccgo_ts + 5525, - 3: __ccgo_ts + 5530, + 0: __ccgo_ts + 5547, + 1: __ccgo_ts + 5549, + 2: __ccgo_ts + 5551, + 3: __ccgo_ts + 5556, } // C documentation @@ -67960,7 +63160,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -67979,7 +63179,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -67987,7 +63187,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -68114,7 +63314,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5600, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5626, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -68122,18 +63322,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5612, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5638, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5626, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5652, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5641, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5667, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -68364,7 +63564,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -69752,7 +64952,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -69787,7 +64987,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -69841,7 +65041,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -69973,7 +65173,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -70125,7 +65325,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -70156,7 +65356,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -70307,15 +65507,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5684 + zContext = __ccgo_ts + 5710 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5703 + zContext = __ccgo_ts + 5729 } else { - zContext = __ccgo_ts + 5722 + zContext = __ccgo_ts + 5748 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5731, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5757, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -70410,10 +65610,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -70422,9 +65623,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -70504,7 +65705,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5767, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5793, 0) return int32(1) } else { return 0 @@ -70514,7 +65715,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5812, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5838, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -70572,7 +65773,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -70899,12 +66100,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -70921,29 +66122,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -70973,13 +66178,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -70991,11 +66198,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -71003,23 +66214,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -71075,7 +66292,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5852, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5878, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -71276,7 +66493,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -71406,7 +66623,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -71575,6 +66792,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -71588,7 +66807,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -71626,13 +66845,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -71866,18 +67085,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5875, - 1: __ccgo_ts + 5880, - 2: __ccgo_ts + 5887, - 3: __ccgo_ts + 5890, - 4: __ccgo_ts + 5893, - 5: __ccgo_ts + 5896, - 6: __ccgo_ts + 5899, - 7: __ccgo_ts + 5902, - 8: __ccgo_ts + 5910, - 9: __ccgo_ts + 5913, - 10: __ccgo_ts + 5920, - 11: __ccgo_ts + 5928, + 0: __ccgo_ts + 5901, + 1: __ccgo_ts + 5906, + 2: __ccgo_ts + 5913, + 3: __ccgo_ts + 5916, + 4: __ccgo_ts + 5919, + 5: __ccgo_ts + 5922, + 6: __ccgo_ts + 5925, + 7: __ccgo_ts + 5928, + 8: __ccgo_ts + 5936, + 9: __ccgo_ts + 5939, + 10: __ccgo_ts + 5946, + 11: __ccgo_ts + 5954, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -72132,14 +67351,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5935, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5961, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -72177,7 +67396,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -72187,7 +67406,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -72198,24 +67417,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -72263,7 +67486,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -72271,32 +67496,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -72713,11 +67944,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -72726,7 +67957,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -72740,7 +67971,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -72775,7 +68006,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -72810,7 +68041,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -72876,11 +68107,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -72903,7 +68134,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -72925,7 +68156,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -73052,7 +68283,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5975, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6001, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -73090,7 +68321,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1426, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5480, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5506, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -73105,28 +68336,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5979, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6005, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5986, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6012, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5999, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6025, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6002, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6028, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6007, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6033, int32(1)) } } } @@ -73290,9 +68521,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -73318,12 +68549,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -73332,28 +68561,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.X__builtin___memset_chk(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40), ^t__predefined_size_t(0)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -73744,12 +68973,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -73766,7 +68995,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -73784,7 +69013,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -74498,19 +69727,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+6043, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+6069, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+6064, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+6090, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+6071, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+6097, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -75724,7 +70953,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -75740,6 +70969,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -76233,7 +71468,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -76336,7 +71571,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+6095, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6119, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+6209, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6233, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -76932,7 +72167,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+6263, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6287, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -76962,12 +72197,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 6318 + v250 = __ccgo_ts + 6342 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6366 + v251 = __ccgo_ts + 6390 } else { - v251 = __ccgo_ts + 6409 + v251 = __ccgo_ts + 6433 } v250 = v251 } @@ -77059,7 +72294,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6450) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6474) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -78143,7 +73378,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, int8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -78170,7 +73405,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -78629,7 +73864,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -79062,7 +74297,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -79392,7 +74627,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -79423,13 +74658,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6495 + zSchema = __ccgo_ts + 6519 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6509, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6533, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -79444,7 +74679,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -79681,7 +74916,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6552, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6576, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -79698,15 +74933,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -79787,11 +75022,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -80003,7 +75238,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -80053,7 +75288,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -80109,7 +75344,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -80188,11 +75423,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6589 + v286 = __ccgo_ts + 6613 } else { - v286 = __ccgo_ts + 6594 + v286 = __ccgo_ts + 6618 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6601, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6625, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -80345,7 +75580,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6653, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6677, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -80507,7 +75742,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6682, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6706, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -80587,12 +75822,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.X__builtin___memset_chk(tls, bp+800, 0, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp+800, 0, uint64(48), ^t__predefined_size_t(0)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -80603,7 +75838,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -80697,7 +75932,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -80725,11 +75960,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -80857,7 +76092,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -81008,7 +76243,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6692, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6716, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -81095,15 +76330,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -81569,11 +76783,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3864 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -81652,14 +76866,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81678,11 +76892,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -81758,7 +76972,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81772,7 +76986,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3864 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -82039,108 +77253,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -82504,7 +77453,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -82830,8 +77779,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -82845,9 +77794,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -82995,8 +77944,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -83045,18 +77994,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -83190,7 +78140,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -83344,6 +78294,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -84839,57 +79792,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -85186,7 +80088,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -85889,25 +80791,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6999, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+7024, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+7007+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7026+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+7032+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7051+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6495+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6519+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7045+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7070+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7045+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7070+7) == 0 { return int32(1) } } @@ -85946,23 +80848,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -85994,7 +80895,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+7059, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+7084, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -86088,7 +80989,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+7064) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+7089) != 0 { goto _2 } } @@ -86110,57 +81011,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -86205,11 +81093,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7066, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7091, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7070, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7095, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -86218,36 +81106,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7074, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7099, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -86276,18 +81153,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -86334,15 +81211,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7083, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7108, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7114, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7139, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -86353,8 +81230,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -86394,7 +81271,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+7169, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+7194, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.X__builtin___memset_chk(tls, pExpr+64, 0, uint64(8), ^t__predefined_size_t(0)) return int32(WRC_Prune) @@ -86414,7 +81291,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -86423,7 +81300,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 7204 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 7229 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -86433,26 +81310,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 7213 + v8 = __ccgo_ts + 7238 } else { - v10 = __ccgo_ts + 7228 + v8 = __ccgo_ts + 7253 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7250, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7275, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7263, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7288, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7273, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7298, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7334, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7359, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -86501,8 +81378,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -86576,19 +81453,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 7341 + zIn = __ccgo_ts + 7366 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7369 + zIn = __ccgo_ts + 7394 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7387 + zIn = __ccgo_ts + 7412 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7405 + zIn = __ccgo_ts + 7430 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7448, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -86614,7 +81491,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -86760,7 +81637,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7443, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7468, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -86815,7 +81692,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7460, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7485, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -86839,7 +81716,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7524, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -86853,13 +81730,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -86879,16 +81756,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7560, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7585, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -86899,35 +81773,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7588, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7613, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7631 + zType = __ccgo_ts + 7656 } else { - zType = __ccgo_ts + 7638 + zType = __ccgo_ts + 7663 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7648, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7673, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7676, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7701, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7698, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7723, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7742, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7767, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -87012,7 +81889,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7790, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7815, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -87024,7 +81901,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7801, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7826, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -87070,7 +81947,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -87195,7 +82072,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7812, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7837, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -87230,7 +82107,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7868, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7893, 0) return int32(1) } i = 0 @@ -87268,7 +82145,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7902, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7927, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -87338,7 +82215,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7908, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7933, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -87372,7 +82249,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7969, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7994, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -87685,7 +82562,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8000, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8025, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -87752,7 +82629,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7902) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7927) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -87763,7 +82640,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+8039) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+8064) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -87773,7 +82650,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8045, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8070, 0) return int32(WRC_Abort) } goto _6 @@ -87995,33 +82872,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.X__builtin___memset_chk(tls, bp+88, 0, uint64(56), ^t__predefined_size_t(0)) - libc.X__builtin___memset_chk(tls, bp, 0, uint64(88), ^t__predefined_size_t(0)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) + pSrc = bp + 56 + libc.X__builtin___memset_chk(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80), ^t__predefined_size_t(0)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -88073,7 +82952,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -88281,7 +83160,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -88756,7 +83635,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -88835,7 +83714,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8104, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8129, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -89022,7 +83901,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.X__builtin___memset_chk(tls, pNew, 0, uint64(72), ^t__predefined_size_t(0)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -89180,11 +84059,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 8152 + v2 = __ccgo_ts + 8177 } else { v2 = __ccgo_ts + 1665 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8154, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8179, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -89230,10 +84109,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -89261,7 +84140,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8198, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8223, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -89281,7 +84160,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8232, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8257, libc.VaList(bp+8, p)) } // C documentation @@ -89352,7 +84231,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8282, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8307, libc.VaList(bp+8, pExpr)) } } } @@ -89404,7 +84283,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8302, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8327, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -89437,7 +84316,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8345, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8370, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -89673,12 +84552,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -89820,7 +84693,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -89960,7 +84833,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -89981,27 +84853,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -90047,9 +84912,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -90059,8 +84924,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -90074,7 +84939,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -90125,7 +84990,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -90206,7 +85071,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -90224,7 +85089,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -90305,7 +85170,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8368, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8393, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -90434,7 +85299,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8398, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8423, libc.VaList(bp+8, zObject)) } } @@ -90532,10 +85397,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8421) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8446) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8426) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8451) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -91213,13 +86078,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8432) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8457) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8440) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8465) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8446) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8471) == 0 { return int32(1) } return 0 @@ -91234,32 +86099,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8432, - 1: __ccgo_ts + 8440, - 2: __ccgo_ts + 8446, + 0: __ccgo_ts + 8457, + 1: __ccgo_ts + 8465, + 2: __ccgo_ts + 8471, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -91468,7 +86320,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -91521,7 +86373,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8450, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8475, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -91621,12 +86473,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -92218,7 +87071,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8665) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8690) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -92314,14 +87167,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -92349,9 +87202,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -92484,7 +87337,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -92614,13 +87467,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -93400,7 +88258,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8758, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8783, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -93412,7 +88270,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -93427,7 +88285,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8785, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8810, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -93456,7 +88314,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -93532,7 +88390,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8368, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8393, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -93595,7 +88453,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -93605,7 +88463,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -93613,7 +88471,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -93626,9 +88484,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -93710,7 +88568,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8809, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8834, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -93781,17 +88639,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -93800,7 +88658,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -93812,6 +88670,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -93831,7 +88710,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -93901,7 +88780,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -93945,7 +88824,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -94018,7 +88897,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -94045,8 +88924,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -94212,7 +89091,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -94421,7 +89302,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -95128,7 +90011,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -95357,10 +90240,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -95398,7 +90281,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -95412,7 +90295,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -95426,10 +90309,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -95439,25 +90325,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8884, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -95470,7 +90360,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -95480,11 +90370,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -95504,13 +90394,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -95580,7 +90470,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -95616,6 +90506,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -95633,44 +90524,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8884, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -95750,7 +90646,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -95758,7 +90654,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -95776,7 +90672,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -95795,11 +90691,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -95917,8 +90813,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8859, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8913, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -95936,10 +90832,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8887, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8941, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9062, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9116, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -95955,9 +90851,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9236, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9290, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9383, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9437, 0) } } @@ -96013,7 +90909,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9534, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9588, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -96022,11 +90918,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9593, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9647, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9599, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9653, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -96056,21 +90952,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9626, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9680, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9810, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9864, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+10115, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10131, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+10169, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10185, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10189, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10243, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -96078,7 +90974,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -96086,7 +90982,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10454, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10508, 0) goto exit_rename_table exit_rename_table: ; @@ -96103,7 +90999,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10467, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10521, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -96143,11 +91039,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10505, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10559, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10537, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10591, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -96163,10 +91059,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10564) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10618) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10623) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10677) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -96178,13 +91074,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10676) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10730) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10722) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10776) } } /* Modify the CREATE TABLE statement. */ @@ -96198,7 +91094,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10749, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10803, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -96226,7 +91122,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10895, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10949, libc.VaList(bp+16, zTab, zDb)) } } } @@ -96264,12 +91160,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11248, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11302, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11282, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11336, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -96284,7 +91180,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -96292,8 +91188,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11312, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11366, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -96354,18 +91250,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 11331 + zType = __ccgo_ts + 11385 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11336 + zType = __ccgo_ts + 11390 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11350 + v1 = __ccgo_ts + 11404 } else { - v1 = __ccgo_ts + 11367 + v1 = __ccgo_ts + 11421 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11385, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11439, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -96412,21 +91308,9 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11403, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11457, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -96442,11 +91326,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11424, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11606, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11478, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11660, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10454, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10508, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -96456,31 +91340,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -96497,16 +91356,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -96809,9 +91658,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -96922,11 +91771,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11737 + v1 = __ccgo_ts + 11791 } else { v1 = __ccgo_ts + 1665 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11739, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11793, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -96997,30 +91846,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11762, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11816, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -97041,9 +91894,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -97059,15 +91911,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11770, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11824, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -97078,16 +91930,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.X__builtin___memcpy_chk(tls, zOut, zSql, libc.Uint64FromInt64(nSql), ^t__predefined_size_t(0)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -97104,21 +91956,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11737 + v1 = __ccgo_ts + 11791 } else { v1 = __ccgo_ts + 1665 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11776, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11830, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.X__builtin___memmove_chk(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)), ^t__predefined_size_t(0)) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.X__builtin___memmove_chk(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)), ^t__predefined_size_t(0)) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.X__builtin___memcpy_chk(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace), ^t__predefined_size_t(0)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -97144,7 +91996,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -97454,7 +92306,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -97721,7 +92573,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.X__builtin___memset_chk(tls, bp+504, 0, uint64(56), ^t__predefined_size_t(0)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -97904,7 +92756,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -97988,8 +92840,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -98005,12 +92858,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.X__builtin___memset_chk(tls, bp+424, 0, uint64(56), ^t__predefined_size_t(0)) @@ -98084,7 +92937,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -98101,7 +92954,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11781, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11835, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -98156,23 +93009,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11403, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11457, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11788 + v1 = __ccgo_ts + 11842 } else { - v1 = __ccgo_ts + 6018 + v1 = __ccgo_ts + 6044 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11800, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11854, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11828, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11882, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -98184,31 +93037,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1665, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11876, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11997, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+12051, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -98222,7 +93075,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -98233,8 +93086,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -98295,27 +93148,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12015, + FzName: __ccgo_ts + 12069, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12036, + FzName: __ccgo_ts + 12090, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12056, + FzName: __ccgo_ts + 12110, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12075, + FzName: __ccgo_ts + 12129, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12094, + FzName: __ccgo_ts + 12148, }, } @@ -98526,8 +93379,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12197, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12251, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -98537,10 +93395,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12220, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12274, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12250, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12304, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -98572,15 +93430,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 12117, - FzCols: __ccgo_ts + 12130, + FzName: __ccgo_ts + 12171, + FzCols: __ccgo_ts + 12184, }, 1: { - FzName: __ccgo_ts + 12143, - FzCols: __ccgo_ts + 12156, + FzName: __ccgo_ts + 12197, + FzCols: __ccgo_ts + 12210, }, 2: { - FzName: __ccgo_ts + 12184, + FzName: __ccgo_ts + 12238, }, } @@ -98633,44 +93491,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -98794,7 +93614,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -98810,12 +93631,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -98823,7 +93644,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -98882,7 +93703,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12268, + FzName: __ccgo_ts + 12322, } func init() { @@ -99256,7 +94077,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12278, + FzName: __ccgo_ts + 12332, } func init() { @@ -99306,7 +94127,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12288, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12342, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -99317,7 +94138,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12293, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12347, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -99356,7 +94177,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12299, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12353, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -99374,7 +94195,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12305, + FzName: __ccgo_ts + 12359, } func init() { @@ -99440,7 +94261,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+12314, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12368, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -99449,12 +94270,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.X__builtin___memcpy_chk(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+12117, uint64(13), ^t__predefined_size_t(0)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.X__builtin___memcpy_chk(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+12171, uint64(13), ^t__predefined_size_t(0)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -99576,7 +94397,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -99656,7 +94477,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -99687,7 +94508,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12324, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12378, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -99778,7 +94599,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12324, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12378, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -99815,7 +94636,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -99848,11 +94669,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12328) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12382) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12332) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12386) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -99960,13 +94781,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -100016,17 +94830,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+12336, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12390, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12347, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12401, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12357, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12411, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -100038,13 +94852,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -100095,7 +94902,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -100298,8 +95105,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -100405,11 +95212,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+12143, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+12197, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12369, __ccgo_ts+12438, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12423, __ccgo_ts+12492, zDb) } return rc } @@ -100475,10 +95282,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+12117, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+12171, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12490, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12544, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -100591,7 +95398,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+7059, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+7084, zName) == 0) } // C documentation @@ -100643,11 +95450,11 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4380) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4406) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12531, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12585, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -100678,7 +95485,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12534, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12588, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -100687,7 +95494,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12571, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12625, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -100699,13 +95506,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.X__builtin___memcpy_chk(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2), ^t__predefined_size_t(0)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -100743,7 +95550,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12601, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12655, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -100751,7 +95558,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12630, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12684, 0) rc = int32(SQLITE_ERROR) } } @@ -100798,7 +95605,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1635, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12698, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12752, libc.VaList(bp+56, zFile)) } } } @@ -100860,15 +95667,15 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { i++ } if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12726, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12780, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12747, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12801, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12773, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12827, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -100963,7 +95770,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12795, + FzName: __ccgo_ts + 12849, } func init() { @@ -100985,7 +95792,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12809, + FzName: __ccgo_ts + 12863, } func init() { @@ -101011,7 +95818,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12823, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12877, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -101045,7 +95852,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12847, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12901, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -101172,6 +95979,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -101244,9 +96053,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -101262,7 +96071,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12893, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12947, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -101290,11 +96099,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12916, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12970, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12922, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12976, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12928, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12982, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -101354,7 +96163,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8440 + zCol = __ccgo_ts + 8465 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -101389,7 +96198,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12955, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13009, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -101426,47 +96235,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -101507,7 +96275,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -101605,7 +96373,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -101683,7 +96453,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -101697,7 +96467,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -101810,21 +96582,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+7059) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+7084) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7026+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7045+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6495+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7007) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7051+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7070+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6519+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7032) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7045+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6495) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7070+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6519) } } } @@ -101854,12 +96626,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7045+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6495) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7070+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6519) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7026+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7007) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7051+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7032) } } } @@ -101897,7 +96669,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12970, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+13024, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -101907,7 +96679,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -101915,15 +96687,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12978 + v1 = __ccgo_ts + 13032 } else { - v1 = __ccgo_ts + 12991 + v1 = __ccgo_ts + 13045 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7263, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7288, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7334, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7359, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -101961,12 +96733,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6495+7) == 0 { - return __ccgo_ts + 7045 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6519+7) == 0 { + return __ccgo_ts + 7070 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7007+7) == 0 { - return __ccgo_ts + 7026 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7032+7) == 0 { + return __ccgo_ts + 7051 } } return zName @@ -102090,9 +96862,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -102491,7 +97263,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6495) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6519) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -102523,7 +97295,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+7059, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+7084, zName) { break } goto _1 @@ -102581,13 +97353,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13005, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13059, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13022, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13076, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -102635,8 +97407,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13042, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13096, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -102672,23 +97444,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -102808,7 +97582,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -102851,9 +97625,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -102866,7 +97640,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13084, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13138, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -102882,9 +97656,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 11331 + v2 = __ccgo_ts + 11385 } else { - v2 = __ccgo_ts + 9593 + v2 = __ccgo_ts + 9647 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -102894,9 +97668,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 7007 + v3 = __ccgo_ts + 7032 } else { - v3 = __ccgo_ts + 6495 + v3 = __ccgo_ts + 6519 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -102920,11 +97694,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 11331 + v4 = __ccgo_ts + 11385 } else { - v4 = __ccgo_ts + 9593 + v4 = __ccgo_ts + 9647 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13125, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13179, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -102932,11 +97706,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13146, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13200, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -102968,19 +97742,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -103000,15 +97784,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -103023,7 +97812,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -103084,7 +97873,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13181, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13235, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -103093,14 +97882,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+13215, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+13269, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -103132,11 +97923,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -103147,7 +97938,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13235, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13289, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -103157,12 +97948,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+13258, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+13312, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+13265, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+13319, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -103204,21 +97995,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.X__builtin___memcpy_chk(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn), ^t__predefined_size_t(0)) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13275, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13329, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -103229,7 +98009,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.X__builtin___memset_chk(tls, pCol, 0, uint64(16), ^t__predefined_size_t(0)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -103242,12 +98022,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -103419,10 +98208,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13301, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13355, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13346, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13400, 0) } else { libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -103480,7 +98269,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13387, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13441, 0) } } @@ -103508,8 +98297,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -103517,7 +98306,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13439, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13493, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -103536,21 +98325,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -103573,7 +98351,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13480, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13534, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -103601,8 +98379,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -103689,17 +98472,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13590, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13579, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13633, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13587, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13641, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -103731,7 +98514,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13594, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13648, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -103872,9 +98655,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -103885,31 +98669,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { zSep = __ccgo_ts + 1665 - zSep2 = __ccgo_ts + 13625 - zEnd = __ccgo_ts + 5519 + zSep2 = __ccgo_ts + 13679 + zEnd = __ccgo_ts + 5545 } else { - zSep = __ccgo_ts + 13627 - zSep2 = __ccgo_ts + 13631 - zEnd = __ccgo_ts + 13636 + zSep = __ccgo_ts + 13681 + zSep2 = __ccgo_ts + 13685 + zEnd = __ccgo_ts + 13690 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13639, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.X__builtin___memcpy_chk(tls, zStmt, __ccgo_ts+13693, uint64(13), ^t__predefined_size_t(0)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -103920,8 +98704,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.X__builtin___memcpy_chk(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1), ^t__predefined_size_t(0)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -103934,17 +98719,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3864, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.X__builtin___memcpy_chk(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1)), ^t__predefined_size_t(0)) return zStmt } var _azType1 = [6]uintptr{ 0: __ccgo_ts + 1665, - 1: __ccgo_ts + 13653, - 2: __ccgo_ts + 13659, - 3: __ccgo_ts + 13664, - 4: __ccgo_ts + 13669, - 5: __ccgo_ts + 13659, + 1: __ccgo_ts + 13707, + 2: __ccgo_ts + 13713, + 3: __ccgo_ts + 13718, + 4: __ccgo_ts + 13723, + 5: __ccgo_ts + 13713, } // C documentation @@ -103953,15 +98739,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -103976,7 +98763,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.X__builtin___memcpy_chk(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn), ^t__predefined_size_t(0)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -104209,8 +98996,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -104310,7 +99107,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -104323,8 +99120,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -104354,7 +99151,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -104573,9 +99370,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13675, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13729, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13708, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13762, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -104596,11 +99393,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13735, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13789, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13785, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13839, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -104647,7 +99444,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13817, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13871, 0) return } } @@ -104681,16 +99478,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9593 - zType2 = __ccgo_ts + 13861 + zType = __ccgo_ts + 9647 + zType2 = __ccgo_ts + 13915 } else { /* A view */ - zType = __ccgo_ts + 11331 - zType2 = __ccgo_ts + 13867 + zType = __ccgo_ts + 11385 + zType2 = __ccgo_ts + 13921 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -104707,24 +99504,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -104772,13 +99574,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13872, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13926, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13887, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13941, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -104787,15 +99599,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13985, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14039, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14027, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14081, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+14061, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+14115, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -104813,7 +99625,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+10115) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+10169) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -104846,7 +99658,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14082, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14136, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -104863,7 +99675,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11331, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11385, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -104960,7 +99772,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14118, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14172, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -105144,7 +99956,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14148, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14202, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -105157,7 +99969,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14163, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14217, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -105240,9 +100052,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+14230, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+14284, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12220, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12274, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -105283,7 +100095,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14244, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14298, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -105292,7 +100104,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14289, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14343, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -105327,11 +100139,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3485, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3511, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7801, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7826, int32(10)) == 0 { return 0 } return int32(1) @@ -105386,9 +100198,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -105421,18 +100233,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14356, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14410, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14438, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14418, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14472, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -105442,7 +100254,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12332, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12386, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -105490,19 +100302,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14450, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14504, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14513, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14567, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -105559,7 +100371,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14607, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14661, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -105674,11 +100486,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -105700,7 +100512,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -105745,13 +100557,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -105774,23 +100586,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -105819,11 +100631,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14653 + v2 = __ccgo_ts + 14707 } else { - v2 = __ccgo_ts + 14659 + v2 = __ccgo_ts + 14713 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14664, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14718, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -105901,7 +100713,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14692, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14746, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -105911,7 +100723,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14698, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14752, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -105925,16 +100737,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14748, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14776, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14830, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14801, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14855, 0) goto exit_create_index } /* @@ -105955,19 +100767,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14692, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14746, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14835, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14889, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14869, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14923, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -105988,7 +100800,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14893, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14947, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -106006,9 +100818,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7007 + v2 = __ccgo_ts + 7032 } else { - v2 = __ccgo_ts + 6495 + v2 = __ccgo_ts + 6519 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -106036,7 +100848,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14692) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14746) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -106068,7 +100880,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -106120,7 +100932,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14916, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14970, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -106130,7 +100942,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -106140,8 +100952,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -106219,7 +101031,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -106267,7 +101079,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14977, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15031, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -106297,8 +101109,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15019, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15073, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -106311,7 +101123,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -106340,9 +101152,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1665 } else { - v13 = __ccgo_ts + 15036 + v13 = __ccgo_ts + 15090 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+15044, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+15098, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -106350,7 +101162,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15064, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15118, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -106358,7 +101170,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15123, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15177, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -106521,16 +101333,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15150, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15204, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15168, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15222, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -106538,9 +101350,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -106556,8 +101368,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15241, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12328, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15295, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12382, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -106630,12 +101442,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -106747,13 +101559,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15301, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -106834,7 +101646,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -106884,7 +101696,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -107055,11 +101867,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 15337 + v1 = __ccgo_ts + 15391 } else { - v1 = __ccgo_ts + 15340 + v1 = __ccgo_ts + 15394 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15346, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15400, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -107258,7 +102070,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15382, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15436, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -107305,9 +102117,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15388 + v1 = __ccgo_ts + 15442 } else { - v1 = __ccgo_ts + 15397 + v1 = __ccgo_ts + 15451 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -107339,9 +102151,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15382, - 1: __ccgo_ts + 15404, - 2: __ccgo_ts + 15388, + 0: __ccgo_ts + 15436, + 1: __ccgo_ts + 15458, + 2: __ccgo_ts + 15442, } // C documentation @@ -107361,7 +102173,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15412, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15466, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -107386,7 +102198,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12970, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -107817,7 +102629,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15612, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -108699,11 +103509,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15645, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15699, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15674, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15728, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -108807,7 +103617,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -108864,7 +103674,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15748, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15802, -int32(1)) return } if argc == int32(3) { @@ -110583,7 +105398,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15781, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15835, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -110665,7 +105480,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -110737,28 +105552,28 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15826, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15880, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15834, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15888, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -110790,13 +105605,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15842, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15896 + } else { + v2 = __ccgo_ts + 15900 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1666, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.X__builtin___memmove_chk(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n), ^t__predefined_size_t(0)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15903, -int32(1)) + return +} + // C documentation // // /* @@ -110808,6 +105759,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -110818,7 +105773,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -111253,7 +106208,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -111342,7 +106297,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11737, + 0: __ccgo_ts + 11791, } // C documentation @@ -111354,8 +106309,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -111370,7 +106325,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -111382,16 +106337,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.X__builtin___memcpy_chk(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep), ^t__predefined_size_t(0)) j += int64(nSep) } - libc.X__builtin___memcpy_chk(tls, z+uintptr(j), v, libc.Uint64FromInt64(k), ^t__predefined_size_t(0)) - j += k + libc.X__builtin___memcpy_chk(tls, z+uintptr(j), v, libc.Uint64FromInt32(k), ^t__predefined_size_t(0)) + j += int64(k) } } goto _2 @@ -111502,7 +106457,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15845, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15926, int32(4), libc.UintptrFromInt32(0)) } } @@ -111563,7 +106518,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12955, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+13009, -int32(1)) return } if argc == int32(2) { @@ -111594,17 +106549,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -111673,7 +106617,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -111755,7 +106699,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15725, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15779, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -111818,12 +106762,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -111987,7 +106925,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -111998,7 +106936,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -112105,7 +107043,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15850, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15931, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -112134,8 +107072,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15856, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15856, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15937, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15937, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -112315,11 +107253,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -112423,7 +107361,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -112436,542 +107374,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15861, + FzName: __ccgo_ts + 15942, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15881, + FzName: __ccgo_ts + 15962, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15894, + FzName: __ccgo_ts + 15975, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15912, + FzName: __ccgo_ts + 15993, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15921, + FzName: __ccgo_ts + 16002, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15929, + FzName: __ccgo_ts + 16010, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15929, + FzName: __ccgo_ts + 16010, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15944, + FzName: __ccgo_ts + 16025, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15970, + FzName: __ccgo_ts + 16051, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15995, + FzName: __ccgo_ts + 16076, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 16004, + FzName: __ccgo_ts + 16085, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 16015, + FzName: __ccgo_ts + 16096, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 16022, + FzName: __ccgo_ts + 16103, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16036, + FzName: __ccgo_ts + 16117, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16036, + FzName: __ccgo_ts + 16117, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16042, + FzName: __ccgo_ts + 16123, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16042, + FzName: __ccgo_ts + 16123, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 16048, + FzName: __ccgo_ts + 16129, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 16048, + FzName: __ccgo_ts + 16129, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16053, + FzName: __ccgo_ts + 16134, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16053, + FzName: __ccgo_ts + 16134, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16057, + FzName: __ccgo_ts + 16138, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16057, + FzName: __ccgo_ts + 16138, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 16061, + FzName: __ccgo_ts + 16142, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 16068, + FzName: __ccgo_ts + 16149, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 16076, + FzName: __ccgo_ts + 16157, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 16083, + FzName: __ccgo_ts + 16164, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16096, + FzName: __ccgo_ts + 16177, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16102, + FzName: __ccgo_ts + 16183, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16109, + FzName: __ccgo_ts + 16190, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16116, + FzName: __ccgo_ts + 16197, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16124, + FzName: __ccgo_ts + 16205, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16129, + FzName: __ccgo_ts + 16210, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16133, + FzName: __ccgo_ts + 16214, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16133, + FzName: __ccgo_ts + 16214, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16139, + FzName: __ccgo_ts + 16220, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16145, + FzName: __ccgo_ts + 16226, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16151, + FzName: __ccgo_ts + 16232, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16155, + FzName: __ccgo_ts + 16236, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16155, + FzName: __ccgo_ts + 16236, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16161, + FzName: __ccgo_ts + 16242, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16168, + FzName: __ccgo_ts + 16249, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16178, + FzName: __ccgo_ts + 16259, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16185, + FzName: __ccgo_ts + 16266, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16192, + FzName: __ccgo_ts + 16273, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16203, + FzName: __ccgo_ts + 16284, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16210, + FzName: __ccgo_ts + 16291, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16225, + FzName: __ccgo_ts + 16306, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16242, + FzName: __ccgo_ts + 16323, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16253, + FzName: __ccgo_ts + 16334, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16259, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16341, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16277, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16347, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16285, + FzName: __ccgo_ts + 16360, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16299, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16378, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16307, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16386, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16316, + FzName: __ccgo_ts + 16400, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16316, + FzName: __ccgo_ts + 16408, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16323, + FzName: __ccgo_ts + 16417, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16323, + FzName: __ccgo_ts + 16417, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16424, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16424, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16333, + FzName: __ccgo_ts + 16434, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16337, + FzName: __ccgo_ts + 16438, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16343, + FzName: __ccgo_ts + 16444, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16347, + FzName: __ccgo_ts + 16448, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16347, + FzName: __ccgo_ts + 16448, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16353, + FzName: __ccgo_ts + 16454, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16353, + FzName: __ccgo_ts + 16454, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16366, + FzName: __ccgo_ts + 16467, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16377, + FzName: __ccgo_ts + 16478, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15856, + FzName: __ccgo_ts + 15937, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15856, + FzName: __ccgo_ts + 15937, }, - 70: { + 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16382, + FzName: __ccgo_ts + 16483, }, - 71: { + 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1238, }, - 72: { + 74: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1246, }, - 73: { + 75: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16387, + FzName: __ccgo_ts + 16488, }, - 74: { + 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16393, + FzName: __ccgo_ts + 16494, }, - 75: { + 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16396, + FzName: __ccgo_ts + 16497, }, - 76: { + 78: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16400, + FzName: __ccgo_ts + 16501, }, - 77: { + 79: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16406, - }, - 78: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16396, - }, - 79: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16411, + FzName: __ccgo_ts + 16507, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16415, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16497, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16419, + FzName: __ccgo_ts + 16512, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16425, + FzName: __ccgo_ts + 16516, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16429, + FzName: __ccgo_ts + 16520, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16434, + FzName: __ccgo_ts + 16526, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16439, + FzName: __ccgo_ts + 16530, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16444, + FzName: __ccgo_ts + 16535, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16450, + FzName: __ccgo_ts + 16540, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16454, + FzName: __ccgo_ts + 16545, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16458, + FzName: __ccgo_ts + 16551, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16462, + FzName: __ccgo_ts + 16555, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16467, + FzName: __ccgo_ts + 16559, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16472, + FzName: __ccgo_ts + 16563, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16477, + FzName: __ccgo_ts + 16568, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16483, + FzName: __ccgo_ts + 16573, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16489, + FzName: __ccgo_ts + 16578, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16495, + FzName: __ccgo_ts + 16584, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16500, + FzName: __ccgo_ts + 16590, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16508, + FzName: __ccgo_ts + 16596, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16516, + FzName: __ccgo_ts + 16601, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16519, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16609, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16617, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16620, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 7204, + FzName: __ccgo_ts + 7229, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16524, + FzName: __ccgo_ts + 16625, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16528, + FzName: __ccgo_ts + 16629, }, } @@ -113030,109 +107979,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -113356,7 +108307,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -113449,7 +108400,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16531, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16632, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -114273,7 +109224,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -114560,11 +109511,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 7070, + Fz: __ccgo_ts + 7095, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 7066, + Fz: __ccgo_ts + 7091, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -114628,7 +109579,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5654) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5680) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -114644,7 +109595,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -115092,7 +110043,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -115210,7 +110161,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8697, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8722, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -115276,11 +110227,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -115605,7 +110556,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -115619,7 +110570,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -115654,7 +110605,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -115667,7 +110618,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -115794,27 +110745,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -115895,7 +110846,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -115922,7 +110873,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -115931,44 +110882,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16576, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16677, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16617, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16718, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -115990,31 +110925,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16649, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16750, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -116038,10 +110973,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -116082,8 +111017,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -116100,34 +111035,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16657, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16758, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16709, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16810, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -116234,18 +111169,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -116255,13 +111190,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -116272,14 +111207,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -116296,16 +111231,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -116416,11 +111351,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -116479,7 +111414,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16801) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16902) } goto insert_cleanup insert_cleanup: @@ -116602,33 +111537,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -116875,7 +111783,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12916, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12970, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -119109,7 +113697,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16853, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16954, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -119129,19 +113717,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.X__builtin___memcpy_chk(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16857, uint64(6), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16958, uint64(6), ^t__predefined_size_t(0)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16863, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16964, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -119156,14 +113744,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16906, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+17007, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -119187,7 +113775,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16938, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17039, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -119196,7 +113784,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16815, + 0: __ccgo_ts + 16916, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -119265,14 +113853,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -119287,7 +113870,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -119305,7 +113888,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -119320,7 +113903,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -119330,6 +113913,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -119341,7 +113926,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -119353,7 +113938,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -119429,7 +114014,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16975, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+17076, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -119483,63 +114068,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5910, - 1: __ccgo_ts + 17014, - 2: __ccgo_ts + 9593, - 3: __ccgo_ts + 17018, - 4: __ccgo_ts + 17023, - 5: __ccgo_ts + 17026, - 6: __ccgo_ts + 17036, - 7: __ccgo_ts + 17046, - 8: __ccgo_ts + 17052, - 9: __ccgo_ts + 17056, - 10: __ccgo_ts + 17061, - 11: __ccgo_ts + 17066, - 12: __ccgo_ts + 17074, - 13: __ccgo_ts + 17085, - 14: __ccgo_ts + 17088, - 15: __ccgo_ts + 17095, - 16: __ccgo_ts + 17056, - 17: __ccgo_ts + 17061, - 18: __ccgo_ts + 17102, - 19: __ccgo_ts + 17107, - 20: __ccgo_ts + 17110, - 21: __ccgo_ts + 17117, - 22: __ccgo_ts + 17052, - 23: __ccgo_ts + 17056, - 24: __ccgo_ts + 17123, - 25: __ccgo_ts + 17128, - 26: __ccgo_ts + 17133, - 27: __ccgo_ts + 17056, - 28: __ccgo_ts + 17137, - 29: __ccgo_ts + 17061, - 30: __ccgo_ts + 17145, - 31: __ccgo_ts + 17149, - 32: __ccgo_ts + 17154, - 33: __ccgo_ts + 12332, - 34: __ccgo_ts + 12328, - 35: __ccgo_ts + 17160, - 36: __ccgo_ts + 17165, - 37: __ccgo_ts + 17170, - 38: __ccgo_ts + 17014, - 39: __ccgo_ts + 17056, - 40: __ccgo_ts + 17175, - 41: __ccgo_ts + 17182, - 42: __ccgo_ts + 17189, - 43: __ccgo_ts + 9593, - 44: __ccgo_ts + 17197, - 45: __ccgo_ts + 5913, - 46: __ccgo_ts + 17203, - 47: __ccgo_ts + 17014, - 48: __ccgo_ts + 17056, - 49: __ccgo_ts + 17208, - 50: __ccgo_ts + 17213, - 51: __ccgo_ts + 16396, - 52: __ccgo_ts + 17218, - 53: __ccgo_ts + 17231, - 54: __ccgo_ts + 17240, - 55: __ccgo_ts + 17247, - 56: __ccgo_ts + 17258, + 0: __ccgo_ts + 5936, + 1: __ccgo_ts + 17115, + 2: __ccgo_ts + 9647, + 3: __ccgo_ts + 17119, + 4: __ccgo_ts + 17124, + 5: __ccgo_ts + 17127, + 6: __ccgo_ts + 17137, + 7: __ccgo_ts + 17147, + 8: __ccgo_ts + 17153, + 9: __ccgo_ts + 17157, + 10: __ccgo_ts + 17162, + 11: __ccgo_ts + 17167, + 12: __ccgo_ts + 17175, + 13: __ccgo_ts + 17186, + 14: __ccgo_ts + 17189, + 15: __ccgo_ts + 17157, + 16: __ccgo_ts + 17196, + 17: __ccgo_ts + 17162, + 18: __ccgo_ts + 17204, + 19: __ccgo_ts + 17208, + 20: __ccgo_ts + 17213, + 21: __ccgo_ts + 17219, + 22: __ccgo_ts + 17157, + 23: __ccgo_ts + 17162, + 24: __ccgo_ts + 17226, + 25: __ccgo_ts + 17231, + 26: __ccgo_ts + 17234, + 27: __ccgo_ts + 17241, + 28: __ccgo_ts + 17153, + 29: __ccgo_ts + 17157, + 30: __ccgo_ts + 17247, + 31: __ccgo_ts + 17252, + 32: __ccgo_ts + 17257, + 33: __ccgo_ts + 17115, + 34: __ccgo_ts + 17157, + 35: __ccgo_ts + 17261, + 36: __ccgo_ts + 17268, + 37: __ccgo_ts + 17275, + 38: __ccgo_ts + 12386, + 39: __ccgo_ts + 12382, + 40: __ccgo_ts + 17283, + 41: __ccgo_ts + 17288, + 42: __ccgo_ts + 17293, + 43: __ccgo_ts + 9647, + 44: __ccgo_ts + 17298, + 45: __ccgo_ts + 5939, + 46: __ccgo_ts + 17304, + 47: __ccgo_ts + 17309, + 48: __ccgo_ts + 16497, + 49: __ccgo_ts + 17314, + 50: __ccgo_ts + 17115, + 51: __ccgo_ts + 17157, + 52: __ccgo_ts + 17327, + 53: __ccgo_ts + 17332, + 54: __ccgo_ts + 17341, + 55: __ccgo_ts + 17348, + 56: __ccgo_ts + 17359, } // C documentation @@ -119558,343 +114143,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 17266, + FzName: __ccgo_ts + 17367, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 17281, + FzName: __ccgo_ts + 17382, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 17296, + FzName: __ccgo_ts + 17397, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 17308, + FzName: __ccgo_ts + 17409, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 17324, + FzName: __ccgo_ts + 17425, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 17247, + FzName: __ccgo_ts + 17348, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 17337, + FzName: __ccgo_ts + 17438, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17349, + FzName: __ccgo_ts + 17450, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17369, + FzName: __ccgo_ts + 17470, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17385, + FzName: __ccgo_ts + 17486, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17406, + FzName: __ccgo_ts + 17507, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17421, + FzName: __ccgo_ts + 17522, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17437, + FzName: __ccgo_ts + 17538, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17451, + FzName: __ccgo_ts + 17552, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17464, + FzName: __ccgo_ts + 17565, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17478, + FzName: __ccgo_ts + 17579, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17497, + FzName: __ccgo_ts + 17598, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17516, + FzName: __ccgo_ts + 17617, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17539, + FzName: __ccgo_ts + 17640, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17548, + FzName: __ccgo_ts + 17649, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17566, + FzName: __ccgo_ts + 17667, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17583, + FzName: __ccgo_ts + 17684, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17596, + FzName: __ccgo_ts + 17697, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17611, + FzName: __ccgo_ts + 17712, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17629, + FzName: __ccgo_ts + 17730, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17639, + FzName: __ccgo_ts + 17740, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17653, + FzName: __ccgo_ts + 17754, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17770, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17694, + FzName: __ccgo_ts + 17795, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17713, + FzName: __ccgo_ts + 17814, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17724, + FzName: __ccgo_ts + 17825, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17735, + FzName: __ccgo_ts + 17836, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17747, + FzName: __ccgo_ts + 17848, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17763, + FzName: __ccgo_ts + 17864, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17776, + FzName: __ccgo_ts + 17877, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17795, + FzName: __ccgo_ts + 17896, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17814, + FzName: __ccgo_ts + 17915, FePragTyp: uint8(PragTyp_LOCK_PROXY_FILE), FmPragFlg: uint8(PragFlg_NoColumns1), }, 37: { - FzName: __ccgo_ts + 17830, + FzName: __ccgo_ts + 17931, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17843, + FzName: __ccgo_ts + 17944, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 39: { - FzName: __ccgo_ts + 17858, + FzName: __ccgo_ts + 17959, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 17868, + FzName: __ccgo_ts + 17969, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 17880, + FzName: __ccgo_ts + 17981, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 17889, + FzName: __ccgo_ts + 17990, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 43: { - FzName: __ccgo_ts + 17900, + FzName: __ccgo_ts + 18001, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 44: { - FzName: __ccgo_ts + 17910, + FzName: __ccgo_ts + 18011, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 17922, + FzName: __ccgo_ts + 18023, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 46: { - FzName: __ccgo_ts + 17933, + FzName: __ccgo_ts + 18034, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 47: { - FzName: __ccgo_ts + 17945, + FzName: __ccgo_ts + 18046, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 48: { - FzName: __ccgo_ts + 17962, + FzName: __ccgo_ts + 18063, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 49: { - FzName: __ccgo_ts + 17981, + FzName: __ccgo_ts + 18082, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 50: { - FzName: __ccgo_ts + 18007, + FzName: __ccgo_ts + 18108, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 51: { - FzName: __ccgo_ts + 18022, + FzName: __ccgo_ts + 18123, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 18036, + FzName: __ccgo_ts + 18137, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 53: { - FzName: __ccgo_ts + 18055, + FzName: __ccgo_ts + 18156, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 18069, + FzName: __ccgo_ts + 18170, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 18085, + FzName: __ccgo_ts + 18186, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 56: { - FzName: __ccgo_ts + 18097, + FzName: __ccgo_ts + 18198, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 18108, + FzName: __ccgo_ts + 18209, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 58: { - FzName: __ccgo_ts + 18119, + FzName: __ccgo_ts + 18220, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -119902,45 +114487,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 18131, + FzName: __ccgo_ts + 18232, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 18142, + FzName: __ccgo_ts + 18243, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 18163, + FzName: __ccgo_ts + 18264, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 18171, + FzName: __ccgo_ts + 18272, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 63: { - FzName: __ccgo_ts + 18186, + FzName: __ccgo_ts + 18287, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 64: { - FzName: __ccgo_ts + 18199, + FzName: __ccgo_ts + 18300, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 18218, + FzName: __ccgo_ts + 18319, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 66: { - FzName: __ccgo_ts + 18233, + FzName: __ccgo_ts + 18334, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -119958,7 +114543,7 @@ var _aPragmaName = [67]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -120066,10 +114651,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18249) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18350) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18259) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18360) { return PAGER_LOCKINGMODE_NORMAL } } @@ -120087,13 +114672,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8753) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8778) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18266) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18367) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18271) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18372) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -120116,10 +114701,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17208) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17327) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+18283) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18384) == 0 { return int32(2) } else { return 0 @@ -120141,7 +114726,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18290, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18391, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -120271,15 +114856,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 18352 + zName = __ccgo_ts + 18453 case int32(OE_SetDflt): - zName = __ccgo_ts + 18361 + zName = __ccgo_ts + 18462 case int32(OE_Cascade): - zName = __ccgo_ts + 18373 + zName = __ccgo_ts + 18474 case int32(OE_Restrict): - zName = __ccgo_ts + 18381 + zName = __ccgo_ts + 18482 default: - zName = __ccgo_ts + 18390 + zName = __ccgo_ts + 18491 break } return zName @@ -120300,12 +114885,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18400, - 1: __ccgo_ts + 18407, - 2: __ccgo_ts + 18415, - 3: __ccgo_ts + 18419, - 4: __ccgo_ts + 18283, - 5: __ccgo_ts + 18428, + 0: __ccgo_ts + 18501, + 1: __ccgo_ts + 18508, + 2: __ccgo_ts + 18516, + 3: __ccgo_ts + 18520, + 4: __ccgo_ts + 18384, + 5: __ccgo_ts + 18529, } // C documentation @@ -120367,15 +114952,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18453 + zType = __ccgo_ts + 18554 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18455 + zType = __ccgo_ts + 18556 } else { - zType = __ccgo_ts + 8152 + zType = __ccgo_ts + 8177 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18457, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18558, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -120384,9 +114969,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18432, - 2: __ccgo_ts + 18437, - 3: __ccgo_ts + 18445, + 1: __ccgo_ts + 18533, + 2: __ccgo_ts + 18538, + 3: __ccgo_ts + 18546, } // C documentation @@ -120486,7 +115071,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18464, libc.VaList(bp+184, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18565, libc.VaList(bp+184, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -120529,7 +115114,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+184, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+184, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -120574,7 +115159,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -120633,7 +115218,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18468) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18569) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -120676,7 +115261,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -120704,7 +115289,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 18259 + zRet = __ccgo_ts + 18360 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -120732,7 +115317,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 18249 + zRet = __ccgo_ts + 18350 } _returnSingleText(tls, v, zRet) break @@ -121022,7 +115607,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18473, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18574, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -121032,7 +115617,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+184, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+184, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -121064,7 +115649,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p res1 = _sqlite3OsFileControl(tls, pFile1, int32(SQLITE_FCNTL_SET_LOCKPROXYFILE), libc.UintptrFromInt32(0)) } if res1 != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18498, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18599, 0) goto pragma_out } } @@ -121084,7 +115669,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18528, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18629, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -121116,8 +115701,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18581) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18682) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -121197,9 +115783,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18587 + v14 = __ccgo_ts + 18688 } else { - v14 = __ccgo_ts + 18595 + v14 = __ccgo_ts + 18696 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -121270,7 +115856,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18602, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18703, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 88)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+88, uintptr(0)) @@ -121300,19 +115886,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 11331 + zType = __ccgo_ts + 11385 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13579 + zType = __ccgo_ts + 13633 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18618 + zType = __ccgo_ts + 18719 } else { - zType = __ccgo_ts + 9593 + zType = __ccgo_ts + 9647 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18625, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18726, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -121359,9 +115945,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18632, libc.VaList(bp+184, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18733, libc.VaList(bp+184, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18637, libc.VaList(bp+184, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18738, libc.VaList(bp+184, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -121385,11 +115971,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18642, - 1: __ccgo_ts + 18644, - 2: __ccgo_ts + 17085, + 0: __ccgo_ts + 18743, + 1: __ccgo_ts + 18745, + 2: __ccgo_ts + 17186, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18646, libc.VaList(bp+184, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18747, libc.VaList(bp+184, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -121408,7 +115994,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18652, libc.VaList(bp+184, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18753, libc.VaList(bp+184, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -121425,7 +116011,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18656, libc.VaList(bp+184, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18757, libc.VaList(bp+184, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -121475,7 +116061,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8152, libc.VaList(bp+184, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8177, libc.VaList(bp+184, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -121487,7 +116073,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1608)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8152, libc.VaList(bp+184, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8177, libc.VaList(bp+184, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -121513,7 +116099,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18659, libc.VaList(bp+184, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18668)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18760, libc.VaList(bp+184, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18769)) goto _32 _32: ; @@ -121527,8 +116113,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -121654,7 +116240,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18673, libc.VaList(bp+184, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18774, libc.VaList(bp+184, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 104))) @@ -121750,7 +116336,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -121794,7 +116380,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -121845,7 +116431,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18677, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18778, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121856,7 +116442,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18701) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18802) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -121992,7 +116578,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 116)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18730, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18831, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -122054,7 +116640,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 116)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -122076,7 +116662,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18766, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18867, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -122089,7 +116675,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18786, libc.VaList(bp+184, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18887, libc.VaList(bp+184, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -122097,7 +116683,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18808, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18909, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -122108,10 +116694,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 116)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18831, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18932, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18833, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18934, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -122145,7 +116731,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18853, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18954, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -122169,9 +116755,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 120))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18883) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18984) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18888) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18989) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -122184,9 +116770,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 120))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18909) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19010) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18945) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19046) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -122214,9 +116800,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18883) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18984) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18956) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19057) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -122244,7 +116830,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 120))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18983) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19084) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -122341,7 +116927,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 112)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 19010 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 19111 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -122420,7 +117006,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19071, libc.VaList(bp+184, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19172, libc.VaList(bp+184, zRight)) } } } @@ -122525,13 +117111,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18266) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18367) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19096) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19197) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18419) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18520) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -122666,7 +117252,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -122696,7 +117282,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6999, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+7024, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -122758,7 +117344,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19104, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19205, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -123031,34 +117617,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19013, + FzName: __ccgo_ts + 19114, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19018, + FzName: __ccgo_ts + 19119, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19024, + FzName: __ccgo_ts + 19125, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19033, + FzName: __ccgo_ts + 19134, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19042, + FzName: __ccgo_ts + 19143, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19050, + FzName: __ccgo_ts + 19151, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19058, + FzName: __ccgo_ts + 19159, }, 7: { - FzName: __ccgo_ts + 19065, + FzName: __ccgo_ts + 19166, }, 8: {}, } @@ -123115,25 +117701,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -123154,14 +117721,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19122) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19223) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19137, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19238, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -123170,19 +117737,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19144, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19245, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19150) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19251) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19162) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19263) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5545, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -123197,7 +117764,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -123378,7 +117945,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -123390,13 +117957,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19177) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19278) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19185, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19286, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19189, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19290, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -123405,7 +117972,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -123531,24 +118098,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+19223, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+19324, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5521 + v1 = __ccgo_ts + 5547 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+19251, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+19352, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+19282, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+19383, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -123556,9 +118123,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 19193, - 1: __ccgo_ts + 19200, - 2: __ccgo_ts + 19212, + 0: __ccgo_ts + 19294, + 1: __ccgo_ts + 19301, + 2: __ccgo_ts + 19313, } // C documentation @@ -123634,7 +118201,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15019) + _corruptSchema(tls, pData, argv, __ccgo_ts+15073) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -123667,11 +118234,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+19290) + _corruptSchema(tls, pData, argv, __ccgo_ts+19391) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15019) + _corruptSchema(tls, pData, argv, __ccgo_ts+15073) } } } @@ -123710,18 +118277,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9593 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9647 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7007 + v2 = __ccgo_ts + 7032 } else { - v2 = __ccgo_ts + 6495 + v2 = __ccgo_ts + 6519 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8665 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19303 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8690 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19404 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -123805,7 +118372,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12630) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12684) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123831,7 +118398,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19375) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19476) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123846,7 +118413,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19399, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19500, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -124142,7 +118709,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -124155,9 +118722,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -124175,7 +118742,7 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.X__builtin___memset_chk(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) libc.X__builtin___memset_chk(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288), ^t__predefined_size_t(0)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse @@ -124204,7 +118771,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.X__builtin___memset_chk(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) libc.X__builtin___memset_chk(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288), ^t__predefined_size_t(0)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -124264,7 +118831,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19433, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19534, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -124280,7 +118847,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19463, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19564, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -124303,10 +118870,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -124314,7 +118881,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3864, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -124344,7 +118911,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -124478,7 +119045,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -124600,15 +119167,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -124644,21 +119202,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -124738,7 +119281,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -124746,7 +119289,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -124902,15 +119445,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11737 - zSp2 = __ccgo_ts + 11737 + zSp1 = __ccgo_ts + 11791 + zSp2 = __ccgo_ts + 11791 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19482, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19583, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -124967,25 +119510,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -125117,13 +119663,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -125201,7 +119747,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19512, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19613, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -125251,12 +119797,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19562, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19663, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -125271,9 +119817,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19626, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19727, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -125283,6 +119830,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -125317,7 +119871,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 7204, + Fz: __ccgo_ts + 7229, Fn: uint32(8), } @@ -125334,13 +119888,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -125365,7 +119912,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -125410,7 +119957,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -125434,7 +119981,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -125455,7 +120002,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -125578,7 +120125,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -125705,10 +120252,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -125716,7 +120263,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -125893,7 +120440,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19663, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19764, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -126004,8 +120551,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -126013,7 +120560,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.X__builtin___memset_chk(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, p+32, 0, libc.Uint64FromInt32(nExtra), ^t__predefined_size_t(0)) } else { return _sqlite3OomFault(tls, db) } @@ -126098,13 +120645,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19683 + z = __ccgo_ts + 19784 case int32(TK_INTERSECT): - z = __ccgo_ts + 19693 + z = __ccgo_ts + 19794 case int32(TK_EXCEPT): - z = __ccgo_ts + 19703 + z = __ccgo_ts + 19804 default: - z = __ccgo_ts + 19710 + z = __ccgo_ts + 19811 break } return z @@ -126125,7 +120672,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19716, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19817, libc.VaList(bp+8, zUsage)) } /* @@ -126162,13 +120709,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19739 + v1 = __ccgo_ts + 19840 } else { v1 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19753, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19854, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19784, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19885, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -126192,11 +120739,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -126412,7 +120959,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1139 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 17197 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 17298 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -126525,7 +121072,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -126534,7 +121081,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -126558,13 +121105,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 17197 + zCol = __ccgo_ts + 17298 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12970, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -126572,7 +121119,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19830, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19931, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -126626,7 +121173,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -126664,7 +121211,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 17197 + v3 = __ccgo_ts + 17298 } zName = v3 } else { @@ -126679,7 +121226,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19830, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19931, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -126715,7 +121262,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19839, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19940, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -126834,7 +121381,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19847 + zType = __ccgo_ts + 19948 } else { zType = uintptr(0) j = int32(1) @@ -126900,7 +121447,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -126928,7 +121475,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -126978,7 +121525,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -127001,7 +121548,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -127149,7 +121696,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19851, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19952, 0) return } /* Obtain authorization to do a recursive query */ @@ -127186,7 +121733,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -127197,7 +121744,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -127211,7 +121758,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -127242,7 +121789,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19900, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20001, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -127257,7 +121804,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19942, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20043, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -127285,7 +121832,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19948, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20049, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -127340,9 +121887,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1665 } else { - v1 = __ccgo_ts + 3754 + v1 = __ccgo_ts + 3780 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19963, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20064, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -127450,8 +121997,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19986, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20001, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20087, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20102, 0) } /* Generate code for the left and right SELECT statements. */ @@ -127476,7 +122023,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19683, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19784, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127502,7 +122049,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -127528,7 +122075,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20020, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20121, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127560,11 +122107,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -127586,7 +122133,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20020, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20121, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127693,6 +122240,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -127709,9 +122257,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20041, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20087, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20188, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -127782,7 +122330,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19663, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19764, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -127998,7 +122546,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -128030,7 +122578,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -128084,16 +122632,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7902) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7902) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7927) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7927) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -128111,32 +122659,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20169, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20270, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20180, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20281, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -128149,7 +122697,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20185, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20286, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -128359,11 +122907,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5499 + v1 = __ccgo_ts + 5525 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -128524,7 +123072,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -128714,9 +123262,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -128928,7 +123476,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -129075,7 +123623,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -129314,18 +123862,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -129365,11 +123901,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -129434,7 +123970,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -129452,12 +123988,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -129939,7 +124475,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -129985,13 +124521,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16053) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16134) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16057) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16138) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -130079,8 +124615,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20191, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20292, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -130104,7 +124640,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -130186,7 +124722,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -130204,7 +124740,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20209, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20310, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -130352,7 +124888,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -130380,7 +124916,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20232, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20333, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -130402,12 +124938,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20252, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20353, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -130424,7 +124960,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20295 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20396 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -130455,7 +124991,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20318, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20419, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -130464,9 +125000,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20356 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20457 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20390 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20491 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -130515,7 +125051,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -130525,7 +125061,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20428, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20529, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -130621,7 +125157,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -130630,7 +125166,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -130681,7 +125217,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20432, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20533, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -130696,7 +125232,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20471, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20572, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -130711,7 +125247,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15612, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -130835,7 +125371,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 7064 + v10 = __ccgo_ts + 7089 } zSchemaName = v10 } @@ -130852,7 +125388,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20502, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20603, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -130931,7 +125467,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20507, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20608, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -130944,7 +125480,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12916, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12970, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -130964,9 +125500,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20516, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20617, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20534, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20635, 0) } } } @@ -130980,7 +125516,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20554, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -131177,14 +125713,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -131193,7 +125729,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -131225,11 +125761,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -131282,7 +125818,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -131319,12 +125855,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20585, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20686, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20636, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20737, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -131345,7 +125881,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20669, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20770, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -131484,7 +126020,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -131592,7 +126128,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -131636,7 +126172,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -131659,7 +126195,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20702 + v1 = __ccgo_ts + 20803 } else { v1 = __ccgo_ts + 1665 } @@ -131668,7 +126204,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20725, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20826, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -131700,7 +126236,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8665) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8690) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -131829,6 +126365,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -131857,7 +126394,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16347) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16448) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -131890,9 +126427,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -131902,13 +126439,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -131928,7 +126465,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -132101,8 +126638,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -132111,11 +126648,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -132131,7 +126668,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -132155,14 +126692,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20737, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20838, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -132263,7 +126800,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20791, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20892, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -132464,14 +127001,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20831, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20932, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -132503,7 +127040,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -132518,7 +127055,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20846, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20947, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -132572,7 +127109,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -132605,7 +127142,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -132664,7 +127201,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -132693,6 +127230,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -132715,10 +127259,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -132752,8 +127296,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -132768,8 +127312,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -132798,8 +127342,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -132816,7 +127360,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -132829,11 +127373,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -132867,49 +127411,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -132917,16 +127462,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -132944,11 +127489,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20862 + v47 = __ccgo_ts + 20963 } else { - v46 = __ccgo_ts + 20871 + v47 = __ccgo_ts + 20972 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19716, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19817, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -132958,12 +127503,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -132976,13 +127521,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -132993,12 +127538,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -133047,12 +127592,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -133122,9 +127671,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -133141,10 +127690,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -133171,8 +127720,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -133212,32 +127761,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -133279,7 +127828,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20862) + _explainTempTable(tls, pParse, __ccgo_ts+20963) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -133385,7 +127934,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -133401,7 +127950,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20880, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20981, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -133491,7 +128040,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -133653,7 +128202,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20945, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21046, 0) goto trigger_cleanup } iDb = int32(1) @@ -133693,7 +128242,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20991, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+21092, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -133703,11 +128252,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20999, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21100, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21040, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21141, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -133716,13 +128265,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20991, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+21092, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21080, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21181, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -133730,8 +128279,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21106, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21207, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -133739,15 +128288,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 21144 + v1 = __ccgo_ts + 21245 } else { - v1 = __ccgo_ts + 21151 + v1 = __ccgo_ts + 21252 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21157, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21258, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21194, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21295, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -133767,9 +128316,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 7007 + v3 = __ccgo_ts + 7032 } else { - v3 = __ccgo_ts + 6495 + v3 = __ccgo_ts + 6519 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -133869,7 +128418,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20991, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+21092, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -133891,7 +128440,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21240, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21341, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -133907,10 +128456,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21288, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21389, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21363, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21464, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -134178,11 +128727,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21392, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21493, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -134220,9 +128769,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zTab = v1 if iDb == int32(1) { @@ -134237,7 +128786,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21412, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21513, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -134370,11 +128919,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21474 + v1 = __ccgo_ts + 21575 } else { - v1 = __ccgo_ts + 21481 + v1 = __ccgo_ts + 21582 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21488, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21589, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -134476,7 +129025,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21637, 0) return int32(1) } @@ -134624,12 +129173,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -134637,19 +129186,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.X__builtin___memset_chk(tls, bp, 0, uint64(128), ^t__predefined_size_t(0)) - libc.X__builtin___memset_chk(tls, bp+128, 0, uint64(88), ^t__predefined_size_t(0)) + pFrom = bp + 128 + libc.X__builtin___memset_chk(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80), ^t__predefined_size_t(0)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -134660,7 +129212,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.X__builtin___memset_chk(tls, bp+216, 0, uint64(56), ^t__predefined_size_t(0)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -134674,7 +129226,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -134742,7 +129294,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6692, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6716, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -134841,10 +129393,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21578, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21679, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -134866,7 +129420,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -134938,7 +129492,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -135354,13 +129908,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -135368,21 +129922,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -135429,7 +129983,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -135468,7 +130022,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -135512,58 +130066,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21592, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21693, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21628, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21729, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8440 + v10 = __ccgo_ts + 8465 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -135593,17 +130135,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -135615,11 +130157,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -135635,11 +130177,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -135648,18 +130190,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -135668,16 +130210,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -135695,24 +130237,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -135738,50 +130280,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -136079,8 +130621,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -136130,8 +130672,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -136178,11 +130720,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -136194,11 +130736,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -136241,7 +130783,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21647) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21748) } goto update_cleanup update_cleanup: @@ -136298,13 +130840,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -136346,11 +130888,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -136675,9 +131217,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 200)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21660, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21761, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21664, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21765, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -136766,13 +131308,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -136780,7 +131322,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+13005, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+13059, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -136862,7 +131404,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21737, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21741, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21838, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21842, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -136953,7 +131495,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -136992,17 +131534,17 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21745) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21846) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21785) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21886) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21828) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21929) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -137019,7 +131561,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21877) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21978) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -137072,7 +131614,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15382) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15436) if rc != SQLITE_OK { goto end_of_vacuum } @@ -137103,11 +131645,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21904, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22005, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22012, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22113, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -137116,7 +131658,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22066, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22167, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -137126,7 +131668,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22203, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22304, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -137217,39 +131759,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -137260,7 +131769,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -137269,7 +131778,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -137279,7 +131788,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -137304,15 +131813,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -137327,13 +131836,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -137653,7 +132164,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13235, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13289, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -137776,24 +132287,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22326, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22427, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+22350, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22451, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22449, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22550, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -137850,7 +132366,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -137877,7 +132393,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22468, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22569, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -137911,7 +132427,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -137919,9 +132435,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22510, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22611, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3864, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -137934,7 +132450,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22540 + zFormat = __ccgo_ts + 22641 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -137968,7 +132484,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+17088, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+17189, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -138049,13 +132565,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22586, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22687, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -138136,7 +132652,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22586, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22687, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -138184,7 +132700,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22605, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22706, 0) return int32(SQLITE_ERROR) } goto _1 @@ -138195,9 +132711,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -138239,7 +132755,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3864 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } @@ -138605,7 +133121,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -138695,7 +133211,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -138715,7 +133231,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -138779,7 +133295,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -138792,7 +133308,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -139052,436 +133568,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -139513,10 +133599,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22618 + return __ccgo_ts + 22719 } if i == -int32(1) { - return __ccgo_ts + 17197 + return __ccgo_ts + 17298 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -139535,10 +133621,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22625, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22726, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22631, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22732, int32(1)) } i = 0 for { @@ -139546,7 +133632,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13625, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13679, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -139555,11 +133641,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22631, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22732, int32(1)) } i = 0 for { @@ -139567,16 +133653,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13625, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13679, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5521, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5547, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } } @@ -139623,7 +133709,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22633, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22734, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -139631,12 +133717,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22625, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22726, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22636 + v2 = __ccgo_ts + 22737 } else { - v2 = __ccgo_ts + 22641 + v2 = __ccgo_ts + 22742 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -139653,7 +133739,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22649) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22750) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -139664,9 +133750,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22651) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22752) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } // C documentation @@ -139711,11 +133797,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22653 + v2 = __ccgo_ts + 22754 } else { - v2 = __ccgo_ts + 22660 + v2 = __ccgo_ts + 22761 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22665, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22766, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -139728,37 +133814,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11788 + zFmt = __ccgo_ts + 11842 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22671 + zFmt = __ccgo_ts + 22772 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22704 + zFmt = __ccgo_ts + 22805 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22729 + zFmt = __ccgo_ts + 22830 } else { - zFmt = __ccgo_ts + 22747 + zFmt = __ccgo_ts + 22848 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22756, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22857, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 17197 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22764, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 17298 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22865, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22795, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22896, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -139768,14 +133854,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22805, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22906, libc.VaList(bp+144, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22810) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22911) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22832 + v3 = __ccgo_ts + 22933 } else { - v3 = __ccgo_ts + 22840 + v3 = __ccgo_ts + 22941 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -139796,7 +133882,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22846, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22947, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -139826,10 +133912,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -139862,14 +133948,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22857, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22958, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22636, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22737, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22878, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22979, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -139893,16 +133979,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22625, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22726, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22636, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22737, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5545, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -140107,7 +134193,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -140163,8 +134249,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -140186,7 +134272,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -140243,10 +134329,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -140301,37 +134387,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -140356,10 +134428,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -140378,24 +134450,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -140407,8 +134479,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -140466,7 +134538,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -140548,7 +134620,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -140679,7 +134751,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -140816,7 +134888,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -140961,7 +135033,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -141022,11 +135094,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -141057,6 +135129,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -141195,7 +135270,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -141275,7 +135350,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -141309,7 +135384,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -141431,7 +135506,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -141624,7 +135699,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -141638,12 +135713,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -141681,11 +135757,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -141705,7 +135781,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -141741,21 +135817,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -141773,7 +135849,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -141828,7 +135904,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22886, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22987, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -141851,7 +135927,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22901, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23002, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -142340,9 +136416,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -142351,14 +136427,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22910, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23011, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -142397,15 +136473,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.X__builtin___memcpy_chk(tls, bp+8, pTabItem, uint64(80), ^t__predefined_size_t(0)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.X__builtin___memcpy_chk(tls, pFrom+8, pTabItem, uint64(80), ^t__predefined_size_t(0)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -142417,7 +136494,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -142490,7 +136567,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -142888,19 +136965,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 17046, + FzOp: __ccgo_ts + 17147, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16377, + FzOp: __ccgo_ts + 16478, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15856, + FzOp: __ccgo_ts + 15937, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22924, + FzOp: __ccgo_ts + 23025, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -143420,37 +137497,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -143688,7 +137769,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23032, 0) return } } else { @@ -143700,10 +137781,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23032, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -143762,7 +137843,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -143784,7 +137865,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8426 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8451 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -143885,7 +137966,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22972 + v13 = __ccgo_ts + 23073 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -144416,7 +138497,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22979, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23080, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -144488,22 +138569,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -144616,7 +138685,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -145532,7 +139601,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -147783,13 +141853,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -147889,6 +141954,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -147902,12 +141968,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -148353,7 +142436,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -148404,15 +142487,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -148444,7 +142518,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -148463,7 +142537,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -148500,7 +142574,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -148508,7 +142582,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -148529,19 +142603,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.X__builtin___memset_chk(tls, bp+16, 0, uint64(48), ^t__predefined_size_t(0)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -148637,7 +142711,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -148815,7 +142889,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -148843,6 +142917,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -148919,7 +143001,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -149156,7 +143238,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23052, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23153, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -149231,7 +143313,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23052, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23153, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -149385,7 +143467,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -149821,7 +143903,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+23078, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+23179, 0) rc = SQLITE_OK } else { break @@ -150050,17 +144132,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -151029,7 +145100,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23214, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -151607,7 +145678,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -151763,7 +145834,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23131, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23232, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -151784,11 +145855,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -151836,7 +145904,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+23159, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+23260, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -151981,7 +146049,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -152015,7 +146084,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -152037,7 +146106,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -152050,7 +146119,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -152141,11 +146210,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -152172,16 +146241,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -152229,7 +146298,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -152360,7 +146429,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -152538,7 +146607,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -152567,7 +146636,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -152577,7 +146646,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23177, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23278, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -152627,7 +146696,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -152896,7 +146965,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23206, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23307, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -153078,7 +147147,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23262, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23363, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -153404,7 +147473,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23307, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23408, libc.VaList(bp+8, zName)) } return p } @@ -153455,12 +147524,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23326, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23427, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23397, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23498, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -153533,7 +147602,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8665) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8690) } break } @@ -153564,16 +147633,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -153592,17 +147651,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -153620,7 +147679,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -153644,13 +147703,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -153665,23 +147724,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.X__builtin___memset_chk(tls, pExpr, 0, uint64(72), ^t__predefined_size_t(0)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -153697,13 +147756,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -153815,7 +147874,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23460, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23561, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -153851,7 +147910,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -153866,7 +147925,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -153885,11 +147944,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -153935,11 +147994,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -153956,7 +148015,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -153978,7 +148037,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.X__builtin___memcpy_chk(tls, pTab, pTab2, uint64(104), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pTab, pTab2, uint64(120), ^t__predefined_size_t(0)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -154102,7 +148161,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23486, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23587, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -154170,18 +148229,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23518 + zErr = __ccgo_ts + 23619 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23535 + zErr = __ccgo_ts + 23636 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23551 + zErr = __ccgo_ts + 23652 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23571, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23672, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -154205,7 +148264,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23604, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23705, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -154311,24 +148370,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -154346,12 +148405,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -154363,15 +148422,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -154423,11 +148482,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23651, - 1: __ccgo_ts + 23704, - 2: __ccgo_ts + 23206, - 3: __ccgo_ts + 23755, - 4: __ccgo_ts + 23807, + 0: __ccgo_ts + 23752, + 1: __ccgo_ts + 23805, + 2: __ccgo_ts + 23307, + 3: __ccgo_ts + 23856, + 4: __ccgo_ts + 23908, } var _aOp1 = [5]int32{ @@ -154480,87 +148539,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -155007,7 +148985,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -155103,7 +149081,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -155820,12 +149798,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -155833,13 +149811,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -155859,13 +149837,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -155892,7 +149870,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -156111,6 +150089,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -156171,7 +150153,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23857, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23958, libc.VaList(bp+8, p)) } // C documentation @@ -156185,6 +150167,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.X__builtin___memset_chk(tls, pParse+256, 0, uint64(32), ^t__predefined_size_t(0)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -156218,11 +150201,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23881 + v1 = __ccgo_ts + 23982 } else { - v1 = __ccgo_ts + 23890 + v1 = __ccgo_ts + 23991 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23896, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23997, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -156231,7 +150214,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23938, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24039, 0) } } } @@ -156337,7 +150320,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23972, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24073, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -162804,14 +156787,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -162822,16 +156797,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -162858,13 +156823,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.X__builtin___memcpy_chk(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24), ^t__predefined_size_t(0)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -163979,19 +157944,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -164794,20 +158759,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17197, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17298, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24010, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24111, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17110, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17234, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24010, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24111, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -164848,7 +158813,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -164993,7 +158963,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -165083,9 +159058,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -165440,7 +159415,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+24037) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+24138) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -165780,23 +159755,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8446 + } else { + v347 = __ccgo_ts + 8451 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8421 - } else { - v347 = __ccgo_ts + 8426 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -165854,11 +159843,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -165868,9 +159857,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -165878,11 +159867,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -165980,11 +159969,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -166034,15 +160023,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24046, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24147, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24242, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24225, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24326, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -166184,7 +160173,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -166378,7 +160367,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24310, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24411, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -168504,7 +162493,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -169109,14 +163098,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -169978,22 +163970,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -170004,11 +164005,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -170587,7 +164588,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -170607,7 +164608,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24397, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24498, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -170732,11 +164733,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -170908,14 +164909,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24940 + zErr = __ccgo_ts + 25041 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -170927,31 +164928,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24465, - 1: __ccgo_ts + 24478, - 3: __ccgo_ts + 24494, - 4: __ccgo_ts + 24519, - 5: __ccgo_ts + 24533, - 6: __ccgo_ts + 24552, + 0: __ccgo_ts + 24566, + 1: __ccgo_ts + 24579, + 3: __ccgo_ts + 24595, + 4: __ccgo_ts + 24620, + 5: __ccgo_ts + 24634, + 6: __ccgo_ts + 24653, 7: __ccgo_ts + 1635, - 8: __ccgo_ts + 24577, - 9: __ccgo_ts + 24614, - 10: __ccgo_ts + 24626, - 11: __ccgo_ts + 24641, - 12: __ccgo_ts + 24674, - 13: __ccgo_ts + 24692, - 14: __ccgo_ts + 24717, - 15: __ccgo_ts + 24746, - 17: __ccgo_ts + 6450, - 18: __ccgo_ts + 5852, - 19: __ccgo_ts + 24763, - 20: __ccgo_ts + 24781, - 21: __ccgo_ts + 24799, - 23: __ccgo_ts + 24833, - 25: __ccgo_ts + 24854, - 26: __ccgo_ts + 24880, - 27: __ccgo_ts + 24903, - 28: __ccgo_ts + 24924, + 8: __ccgo_ts + 24678, + 9: __ccgo_ts + 24715, + 10: __ccgo_ts + 24727, + 11: __ccgo_ts + 24742, + 12: __ccgo_ts + 24775, + 13: __ccgo_ts + 24793, + 14: __ccgo_ts + 24818, + 15: __ccgo_ts + 24847, + 17: __ccgo_ts + 6474, + 18: __ccgo_ts + 5878, + 19: __ccgo_ts + 24864, + 20: __ccgo_ts + 24882, + 21: __ccgo_ts + 24900, + 23: __ccgo_ts + 24934, + 25: __ccgo_ts + 24955, + 26: __ccgo_ts + 24981, + 27: __ccgo_ts + 25004, + 28: __ccgo_ts + 25025, } // C documentation @@ -171045,15 +165046,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -171061,6 +165064,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -171068,10 +165073,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -171098,6 +165103,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -171125,12 +165144,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -171148,9 +165167,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -171173,13 +165192,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25021, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25122, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -171197,15 +165216,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -171220,27 +165239,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -171251,30 +165270,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -171299,7 +165348,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+25084, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+25185, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -171330,13 +165379,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -171347,43 +165398,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -171394,12 +165449,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -171411,6 +165466,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -171418,82 +165475,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -171537,18 +165604,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -171574,7 +165643,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -171584,7 +165653,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+25135, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+25236, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -171706,7 +165775,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -171838,7 +165907,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171848,7 +165917,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171884,7 +165953,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -171897,7 +165966,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -171906,7 +165975,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25156, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25257, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -171941,9 +166010,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -172053,7 +166122,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+25224, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+25325, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -172083,8 +166152,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+25230, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25240, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+25331, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25341, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -172173,24 +166242,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+25268, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+25369, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+25272, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+25373, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 25272 + zModeType = __ccgo_ts + 25373 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25293, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25394, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3471 + zModeType = __ccgo_ts + 3497 } if aMode != 0 { mode = 0 @@ -172219,12 +166288,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25308, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25409, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25328, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25429, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -172248,7 +166317,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25352, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25453, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -172268,11 +166337,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25278, + Fz: __ccgo_ts + 25379, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 25285, + Fz: __ccgo_ts + 25386, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -172283,19 +166352,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25298, + Fz: __ccgo_ts + 25399, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 25301, + Fz: __ccgo_ts + 25402, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 25304, + Fz: __ccgo_ts + 25405, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 18283, + Fz: __ccgo_ts + 18384, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -172423,8 +166492,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22972, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+25368, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+23073, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25469, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -172445,10 +166514,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4603 + zFilename = __ccgo_ts + 4629 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -172457,7 +166526,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3864 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -172484,9 +166553,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 7059 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 7084 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24370 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24471 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -172580,7 +166649,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 25374 + zFilename = __ccgo_ts + 25475 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -172599,36 +166668,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -172636,7 +166713,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -172644,31 +166721,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -172702,12 +166783,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -172740,10 +166823,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -172754,7 +166837,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -172797,20 +166880,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+25377, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25478, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25402) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25503) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25422) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25523) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25429) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25530) } // C documentation @@ -172835,9 +166918,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -172864,29 +166947,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -172941,15 +167013,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25446, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25547, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3864 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -173128,8 +167200,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -173573,7 +167645,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -173969,7 +168041,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25474, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25575, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -174117,6 +168189,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -174140,7 +168214,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -174150,7 +168224,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -174162,7 +168236,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -174178,7 +168252,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -174187,7 +168261,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25482 + v2 = __ccgo_ts + 25583 } else { v2 = uintptr(0) } @@ -174266,7 +168340,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.X__builtin___memcpy_chk(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8), ^t__predefined_size_t(0)) Xsqlite3_free(tls, aDyn) @@ -174433,7 +168507,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -174650,6 +168724,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -174962,8 +169043,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -175020,7 +169101,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -175030,7 +169111,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -175068,18 +169149,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1651, - 1: __ccgo_ts + 8421, - 2: __ccgo_ts + 8426, - 3: __ccgo_ts + 6735, - 4: __ccgo_ts + 6735, - 5: __ccgo_ts + 6730, - 6: __ccgo_ts + 6730, - 7: __ccgo_ts + 8732, - 8: __ccgo_ts + 8732, - 9: __ccgo_ts + 8732, - 10: __ccgo_ts + 8732, - 11: __ccgo_ts + 25505, - 12: __ccgo_ts + 25511, + 1: __ccgo_ts + 8446, + 2: __ccgo_ts + 8451, + 3: __ccgo_ts + 6760, + 4: __ccgo_ts + 6760, + 5: __ccgo_ts + 6755, + 6: __ccgo_ts + 6755, + 7: __ccgo_ts + 8757, + 8: __ccgo_ts + 8757, + 9: __ccgo_ts + 8757, + 10: __ccgo_ts + 8757, + 11: __ccgo_ts + 25606, + 12: __ccgo_ts + 25612, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -175387,106 +169468,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -175566,7 +169547,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -175864,8 +169845,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25518 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25518 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -176001,7 +169982,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1651, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15826, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15880, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -176015,14 +169996,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25535, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25619, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -176076,7 +170055,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25648, -int32(1)) } } } @@ -176359,8 +170338,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25579, - FzRepl: __ccgo_ts + 25583, + FzMatch: __ccgo_ts + 25663, + FzRepl: __ccgo_ts + 25667, }, 1: { Fc1: int8('i'), @@ -176368,8 +170347,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25591, - FzRepl: __ccgo_ts + 25583, + FzMatch: __ccgo_ts + 25675, + FzRepl: __ccgo_ts + 25667, }, 2: { Fc1: int8('n'), @@ -176384,7 +170363,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25600, + FzMatch: __ccgo_ts + 25684, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -176392,7 +170371,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25605, + FzMatch: __ccgo_ts + 25689, FzRepl: __ccgo_ts + 1651, }, } @@ -176408,7 +170387,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25610, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25694, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -176426,23 +170405,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -176520,7 +170499,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -176591,7 +170570,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -176866,7 +170849,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25653, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25737, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -177296,7 +171279,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -177335,7 +171318,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8421, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8446, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -177343,7 +171326,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8426, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8451, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -177420,14 +171403,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25579, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25663, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25662) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25746) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25753) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25675, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25759, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -177612,7 +171595,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25753) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -177657,7 +171640,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -177670,7 +171653,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -177719,10 +171702,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -177756,15 +171735,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -177837,11 +171816,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8421, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8446, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8426, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8451, uint32(5)) return i + uint32(1) _6: ; @@ -177890,9 +171869,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25583 + v19 = __ccgo_ts + 25667 } else { - v19 = __ccgo_ts + 12288 + v19 = __ccgo_ts + 12342 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -177928,9 +171907,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.X__builtin___memcpy_chk(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp))), ^t__predefined_size_t(0)) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -177957,7 +171939,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25681, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25765, uint32(2)) zIn2++ sz2-- continue @@ -177980,7 +171962,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25684, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25768, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -177988,12 +171970,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25691, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25775, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25696, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25780, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -178096,16 +172078,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -178173,7 +172145,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25703, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -178196,12 +172168,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25706, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25790, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25703, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -178216,50 +172188,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.X__builtin___memset_chk(tls, bp+8, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -178311,6 +172239,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -178331,6 +172337,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -178403,9 +172412,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -178448,7 +172457,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -178936,7 +172956,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -179071,7 +173091,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -179172,7 +173192,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) return } @@ -179209,11 +173229,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25535, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25619, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -179226,7 +173243,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.X__builtin___memset_chk(tls, pParse, 0, uint64(72), ^t__predefined_size_t(0)) return int32(1) @@ -179245,10 +173262,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25753) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25662) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25746) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -179287,7 +173304,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25709, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25793, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -179303,7 +173320,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -179384,7 +173401,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -179396,34 +173413,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -179506,7 +173543,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -179566,7 +173603,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -179701,7 +173738,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25727 + v1 = __ccgo_ts + 25811 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -179711,7 +173748,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } eErr = uint8(1) @@ -179821,23 +173858,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25729, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25813, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25731, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25815, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5574, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5600, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1678, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1704, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25733, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25817, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25736, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25820, uint32(1)) } } } @@ -179877,7 +173914,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -180145,7 +174182,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -180169,7 +174206,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25738, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25822, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -180180,7 +174217,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25789, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25873, -int32(1)) _jsonStringReset(tls, bp) return } @@ -180252,7 +174289,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } goto json_remove_done @@ -180289,7 +174326,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16299) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16400) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -180320,9 +174357,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25823 + v1 = __ccgo_ts + 25907 } else { - v1 = __ccgo_ts + 25827 + v1 = __ccgo_ts + 25911 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -180370,7 +174407,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } goto json_type_done @@ -180417,7 +174454,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25834 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25918 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -180491,17 +174528,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25839, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25923, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -180510,18 +174546,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -180583,9 +174618,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -180692,7 +174725,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25896, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25980, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180784,20 +174817,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -180841,7 +174876,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25899, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25983, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180869,16 +174904,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -180897,24 +174922,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -180922,13 +174929,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -180944,7 +174944,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25902) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25986) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -181078,7 +175078,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25985, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+26069, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -181104,9 +175104,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25992, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+26076, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+26000, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+26084, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -181417,9 +175417,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.X__builtin___memset_chk(tls, p+192, 0, uint64(72), ^t__predefined_size_t(0)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -181492,7 +175491,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+26006, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+26090, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -181516,7 +175515,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25564, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25648, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -181577,186 +175576,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26008, + FzName: __ccgo_ts + 26092, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26013, + FzName: __ccgo_ts + 26097, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26019, + FzName: __ccgo_ts + 26103, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26030, + FzName: __ccgo_ts + 26114, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26042, + FzName: __ccgo_ts + 26126, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26042, + FzName: __ccgo_ts + 26126, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26060, + FzName: __ccgo_ts + 26144, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26080, + FzName: __ccgo_ts + 26164, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26093, + FzName: __ccgo_ts + 26177, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26107, + FzName: __ccgo_ts + 26191, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26110, + FzName: __ccgo_ts + 26194, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26114, + FzName: __ccgo_ts + 26198, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26126, + FzName: __ccgo_ts + 26210, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26139, + FzName: __ccgo_ts + 26223, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26151, + FzName: __ccgo_ts + 26235, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26164, + FzName: __ccgo_ts + 26248, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26175, + FzName: __ccgo_ts + 26259, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26187, + FzName: __ccgo_ts + 26271, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26187, + FzName: __ccgo_ts + 26271, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26199, + FzName: __ccgo_ts + 26283, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26210, + FzName: __ccgo_ts + 26294, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26222, + FzName: __ccgo_ts + 26306, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26235, + FzName: __ccgo_ts + 26319, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26248, + FzName: __ccgo_ts + 26332, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26262, + FzName: __ccgo_ts + 26346, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26271, + FzName: __ccgo_ts + 26355, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26281, + FzName: __ccgo_ts + 26365, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26281, + FzName: __ccgo_ts + 26365, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26291, + FzName: __ccgo_ts + 26375, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26291, + FzName: __ccgo_ts + 26375, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 26302, + FzName: __ccgo_ts + 26386, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26319, + FzName: __ccgo_ts + 26403, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 26337, + FzName: __ccgo_ts + 26421, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26355, + FzName: __ccgo_ts + 26439, }, } @@ -181839,17 +175838,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 26374, + FzName: __ccgo_ts + 26458, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26384, + FzName: __ccgo_ts + 26468, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -181899,224 +175900,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -182134,33 +175920,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -182171,79 +175951,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -182427,7 +176192,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.X__builtin___memset_chk(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize), ^t__predefined_size_t(0)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -182490,7 +176255,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26394, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26478, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -182501,7 +176266,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -182795,7 +176560,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26399, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26483, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -183336,7 +177101,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -183716,7 +177481,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26481) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26565) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -183794,7 +177559,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -184025,7 +177790,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.X__builtin___memcpy_chk(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1)), ^t__predefined_size_t(0)) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -184033,7 +177798,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -184271,7 +178036,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -184693,7 +178458,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -185202,11 +178967,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -185219,11 +178984,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -185251,7 +179016,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26495, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26579, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -185261,11 +179026,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26515, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26599, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26547, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26631, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185479,7 +179244,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26584, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26668, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -185533,9 +179298,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26729 + zFmt = __ccgo_ts + 26813 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+12117, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+12171, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -185593,9 +179358,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26785, - 1: __ccgo_ts + 5913, - 2: __ccgo_ts + 17197, + 0: __ccgo_ts + 26869, + 1: __ccgo_ts + 5939, + 2: __ccgo_ts + 17298, } var _rtreeModule = Tsqlite3_module{ @@ -185639,21 +179404,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27199, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27283, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27261, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27345, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27266, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27330, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27400, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27350, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27414, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27484, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -185683,7 +179448,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27449 + zFormat = __ccgo_ts + 27533 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -185698,31 +179463,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27557, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27641, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27602, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27686, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13625, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13679, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27629, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27713, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27651, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27735, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27659, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27743, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -185736,14 +179501,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26790, - 1: __ccgo_ts + 26843, - 2: __ccgo_ts + 26888, - 3: __ccgo_ts + 26940, - 4: __ccgo_ts + 26994, - 5: __ccgo_ts + 27039, - 6: __ccgo_ts + 27097, - 7: __ccgo_ts + 27152, + 0: __ccgo_ts + 26874, + 1: __ccgo_ts + 26927, + 2: __ccgo_ts + 26972, + 3: __ccgo_ts + 27024, + 4: __ccgo_ts + 27078, + 5: __ccgo_ts + 27123, + 6: __ccgo_ts + 27181, + 7: __ccgo_ts + 27236, } // C documentation @@ -185801,7 +179566,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27675, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27759, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -185809,17 +179574,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27695, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27779, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -185882,7 +179647,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -185896,13 +179661,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName), ^t__predefined_size_t(0)) - libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27938, uint64(6), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28022, uint64(6), ^t__predefined_size_t(0)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27944, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28028, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -185911,7 +179676,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27968, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28052, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -185925,19 +179690,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27995, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -185960,7 +179725,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -185971,7 +179736,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -185987,8 +179752,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27974, - 1: __ccgo_ts + 27985, + 0: __ccgo_ts + 28058, + 1: __ccgo_ts + 28069, } // C documentation @@ -186046,21 +179811,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11737, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11791, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27998, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28082, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28004, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28088, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+28008, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+28092, int32(1)) goto _1 _1: ; @@ -186087,7 +179852,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28010, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28094, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -186121,23 +179886,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -186190,7 +179938,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -186205,11 +179953,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4616 + v1 = __ccgo_ts + 4642 } else { v1 = __ccgo_ts + 1665 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28043, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28127, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -186243,7 +179991,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28050, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28134, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -186260,7 +180008,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28095, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28179, libc.VaList(bp+8, iNode)) } } return pRet @@ -186289,8 +180037,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 28127, - 1: __ccgo_ts + 28181, + 0: __ccgo_ts + 28211, + 1: __ccgo_ts + 28265, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -186303,21 +180051,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 28229 + v1 = __ccgo_ts + 28313 } else { - v1 = __ccgo_ts + 28237 + v1 = __ccgo_ts + 28321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28246, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28330, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 28229 + v2 = __ccgo_ts + 28313 } else { - v2 = __ccgo_ts + 28237 + v2 = __ccgo_ts + 28321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28291, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28375, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -186362,7 +180110,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28349, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28433, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -186380,7 +180128,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28397, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28481, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -186413,19 +180161,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28464, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28548, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28498, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28582, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28528, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28612, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -186470,12 +180218,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28583, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28667, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28614, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28698, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -186504,7 +180252,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28681, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28765, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -186514,11 +180262,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26495, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26579, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28709, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28793, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -186534,8 +180282,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28740, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28747, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28824, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28831, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -186562,7 +180310,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28755, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28839, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -186613,13 +180361,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28774, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28858, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 7059 + zDb = __ccgo_ts + 7084 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -186628,7 +180376,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 19010 + v1 = __ccgo_ts + 19111 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -186722,14 +180470,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -186754,16 +180494,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -186895,7 +180625,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -186940,7 +180670,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && int32(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -187002,7 +180732,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -187370,7 +181100,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -187385,9 +181115,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -187472,7 +181202,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -187546,13 +181276,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -187613,7 +181336,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -187652,7 +181375,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -187756,7 +181479,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -187787,36 +181510,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -187840,7 +181533,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -188124,7 +181817,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -188281,7 +181974,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.X__builtin___memset_chk(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)), ^t__predefined_size_t(0)) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -188293,13 +181986,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName), ^t__predefined_size_t(0)) - libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27938, uint64(6), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28022, uint64(6), ^t__predefined_size_t(0)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28898, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28982, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -188308,13 +182001,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28920, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29004, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27995, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -188322,7 +182015,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -188337,7 +182030,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -188549,7 +182242,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 17197 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 17298 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -188559,7 +182252,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28924 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29008 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -188567,7 +182260,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28930 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29014 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -188687,7 +182380,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28939, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+29023, 0) } goto geopoly_update_end } @@ -188787,16 +182480,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28979) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29063) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28995) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29079) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -188866,7 +182559,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29172, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29256, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -188880,61 +182573,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29010, + FzName: __ccgo_ts + 29094, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29023, + FzName: __ccgo_ts + 29107, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29036, + FzName: __ccgo_ts + 29120, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29049, + FzName: __ccgo_ts + 29133, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28995, + FzName: __ccgo_ts + 29079, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 29061, + FzName: __ccgo_ts + 29145, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28979, + FzName: __ccgo_ts + 29063, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 29084, + FzName: __ccgo_ts + 29168, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29098, + FzName: __ccgo_ts + 29182, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 29111, + FzName: __ccgo_ts + 29195, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 29125, + FzName: __ccgo_ts + 29209, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29141, + FzName: __ccgo_ts + 29225, }, } @@ -188960,7 +182653,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 29153, + FzName: __ccgo_ts + 29237, }, } @@ -188985,20 +182678,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29180, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29264, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29190, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29274, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29201, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29285, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28924, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29008, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29212, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29296, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -189072,7 +182765,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -189100,17 +182793,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26481, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26565, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -189118,33 +182813,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -189341,7 +183040,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -189762,248 +183461,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -190317,7 +183774,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+29222, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+29306, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -190327,7 +183784,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+29222, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+29306, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -190353,7 +183810,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -190376,7 +183833,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -190508,7 +183965,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+29243, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+29327, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -190597,7 +184054,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26394, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26478, zIn, uint64(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -190634,13 +184091,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.X__builtin___memset_chk(tls, pIter, 0, uint64(192), ^t__predefined_size_t(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29414 + v1 = __ccgo_ts + 29498 } else { v1 = __ccgo_ts + 1665 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29455, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29539, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29605) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29689) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -190807,7 +184264,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -190868,7 +184325,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29730, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29814, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -190878,7 +184335,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29849, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29933, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -190886,7 +184343,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29870, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29954, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -190898,7 +184355,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29921, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30005, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -190942,7 +184399,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.X__builtin___memcpy_chk(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol), ^t__predefined_size_t(0)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29942, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30026, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -190955,7 +184412,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.X__builtin___memset_chk(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol), ^t__predefined_size_t(0)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -191008,7 +184465,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20516, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20617, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -191019,7 +184476,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29999, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30083, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -191030,7 +184487,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+30018, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+30102, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -191038,7 +184495,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+30023, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+30107, zName) { bRbuRowid = int32(1) } } @@ -191052,17 +184509,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 30033 + v4 = __ccgo_ts + 30117 } else { - v4 = __ccgo_ts + 30046 + v4 = __ccgo_ts + 30130 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30055, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30139, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30084, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30168, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -191084,7 +184541,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30106, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30190, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -191130,8 +184587,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30217, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15547 goto _1 _1: ; @@ -191165,7 +184622,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30142, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30226, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -191213,21 +184670,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30155, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30239, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30187, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30271, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15493, __ccgo_ts+30210) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+30216, __ccgo_ts+30223, __ccgo_ts+5519) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15493, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15547, __ccgo_ts+30294) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+30300, __ccgo_ts+30307, __ccgo_ts+5545) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15547, __ccgo_ts+1665) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30231, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30315, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30273, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30357, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -191279,7 +184736,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1665 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -191301,15 +184758,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 30293 + zCol = __ccgo_ts + 30377 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30322, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30358, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15493 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+30385, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30406, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30442, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15547 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -191318,7 +184775,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30385, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30469, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { zSep = __ccgo_ts + 1665 iCol = 0 @@ -191335,15 +184792,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30433, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15493 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30517, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15547 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30440, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30524, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -191401,7 +184858,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1665 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -191410,7 +184867,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30452, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30536, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) zType = __ccgo_ts + 1665 } else { if iCid < 0 { @@ -191430,9 +184887,9 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 30293 + zCol = __ccgo_ts + 30377 } else { - zCol = __ccgo_ts + 30023 + zCol = __ccgo_ts + 30107 } } zType = __ccgo_ts + 1139 @@ -191440,24 +184897,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30474, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30558, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 30210 + v2 = __ccgo_ts + 30294 } else { v2 = __ccgo_ts + 1665 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30494, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30578, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30515, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30548, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30599, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30632, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15493 - zAnd = __ccgo_ts + 22625 + zCom = __ccgo_ts + 15547 + zAnd = __ccgo_ts + 22726 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -191511,11 +184968,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30572, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30656, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30584, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30668, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15493 + zS = __ccgo_ts + 15547 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -191527,7 +184984,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30677, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -191553,7 +185010,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30608, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30692, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { zSep = __ccgo_ts + 1665 @@ -191563,15 +185020,15 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30622, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22625 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30706, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22726 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30634, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30718, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -191581,8 +185038,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30684, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22625 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30768, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22726 } goto _2 _2: @@ -191605,7 +185062,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30697, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30781, 0) } // C documentation @@ -191647,16 +185104,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30684, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30768, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15547 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30723, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30807, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15547 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30753, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30837, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15547 } } } @@ -191740,16 +185197,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30790 + zSep = __ccgo_ts + 30874 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29942, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30026, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+17085) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+17186) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, zIdx))) } break } @@ -191760,16 +185217,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 30210 + v1 = __ccgo_ts + 30294 } else { v1 = __ccgo_ts + 1665 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30803, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15493 + z = _rbuMPrintf(tls, p, __ccgo_ts+30887, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15547 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30814, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30898, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -191815,7 +185272,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30818) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30902) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -191823,7 +185280,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -191832,21 +185289,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30868, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30952, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 30210 + v1 = __ccgo_ts + 30294 } else { v1 = __ccgo_ts + 1665 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30890, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15493 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30974, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15547 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30900, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30984, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30915, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30999, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, 0)) } } @@ -191883,7 +185340,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1665 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -191892,19 +185349,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1665 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30977 + zPk = __ccgo_ts + 31061 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30990 + v2 = __ccgo_ts + 31074 } else { v2 = __ccgo_ts + 1665 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31000, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15493 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+31084, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15547 goto _1 _1: ; @@ -191913,17 +185370,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31027, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+31111, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 31034 + v3 = __ccgo_ts + 31118 } else { v3 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31049, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31133, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, 0)) } } @@ -191949,7 +185406,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31081, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31165, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -191995,7 +185452,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+31138) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+31222) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -192164,7 +185621,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+31204, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+31288, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -192181,18 +185638,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31224, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31308, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31289, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31373, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31325, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31409, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -192207,26 +185664,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 31359 + v2 = __ccgo_ts + 31443 } else { - v2 = __ccgo_ts + 31363 + v2 = __ccgo_ts + 31447 } v1 = v2 } else { v1 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31369, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31453, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31430, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31514, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 31359 + v3 = __ccgo_ts + 31443 } else { - v3 = __ccgo_ts + 31363 + v3 = __ccgo_ts + 31447 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31491, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31575, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -192245,8 +185702,8 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7070) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7066) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7095) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7091) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -192255,39 +185712,39 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { v4 = __ccgo_ts + 1665 } else { - v4 = __ccgo_ts + 31650 + v4 = __ccgo_ts + 31734 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31659 + v5 = __ccgo_ts + 31743 } else { v5 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31669, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31753, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31705, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31789, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { zRbuRowid = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31733 + zRbuRowid = __ccgo_ts + 31817 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31745 + v6 = __ccgo_ts + 31829 } else { v6 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31762, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31838, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31846, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31922, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32137, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32221, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -192298,9 +185755,9 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 32236 + v7 = __ccgo_ts + 32320 } else { - v7 = __ccgo_ts + 32246 + v7 = __ccgo_ts + 32330 } zRbuRowid1 = v7 } @@ -192313,14 +185770,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30293, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30377, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15493, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15547, __ccgo_ts+1665) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 32257 + v8 = __ccgo_ts + 32341 } else { v8 = __ccgo_ts + 1665 } @@ -192330,11 +185787,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1665 } if zOrder != 0 { - v10 = __ccgo_ts + 23881 + v10 = __ccgo_ts + 23982 } else { v10 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32263, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32347, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -192422,9 +185879,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31650 + zPrefix = __ccgo_ts + 31734 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32311, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32395, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -192451,7 +185908,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -192498,7 +185955,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32341, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32425, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -192557,27 +186014,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32371, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32455, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32399, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+3485, uint64(4), ^t__predefined_size_t(0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32483, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+3511, uint64(4), ^t__predefined_size_t(0)) } else { - libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+7059, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+7084, uint64(4), ^t__predefined_size_t(0)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32417, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32501, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -192610,10 +186067,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32483, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32567, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+25224, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+25325, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -192629,14 +186086,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 32515 + v2 = __ccgo_ts + 32599 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1665 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32517, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32601, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -192647,27 +186104,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32549, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32633, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32564, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32648, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32581, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32665, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32597, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32681, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32625, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32709, 0) } } @@ -192717,7 +186174,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -192819,7 +186276,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -192849,7 +186306,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -192892,12 +186349,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -192919,21 +186376,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -192950,7 +186407,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32678, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32762, 0) } // C documentation @@ -192967,13 +186424,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32703, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32710, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32787, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32794, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -193105,7 +186562,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24781, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24882, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -193241,7 +186698,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32717) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32801) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -193254,7 +186711,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32739, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32823, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -193281,7 +186738,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32766, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32850, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -193317,9 +186774,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32926, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+33010, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32941, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33025, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -193342,9 +186799,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32961, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33045, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32986) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33070) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -193355,10 +186812,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33094) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33178) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+33159) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+33243) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -193376,7 +186833,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33203, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33287, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -193403,8 +186860,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+18186) - _rbuCopyPragma(tls, p, __ccgo_ts+17281) + _rbuCopyPragma(tls, p, __ccgo_ts+18287) + _rbuCopyPragma(tls, p, __ccgo_ts+17382) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -193412,7 +186869,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33228, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33312, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -193434,10 +186891,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -193451,10 +186908,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -193524,7 +186981,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33256, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33340, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -193547,10 +187004,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32703, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32787, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -193572,7 +187029,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+33281, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+33365, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -193619,7 +187076,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+33292, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+33376, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -193664,11 +187121,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33364, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33448, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33378) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33462) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -193677,7 +187134,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33435) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33519) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -193725,7 +187182,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.X__builtin___memcpy_chk(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1), ^t__predefined_size_t(0)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3864, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -193757,7 +187214,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33509, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33593, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -193779,17 +187236,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33541 + v3 = __ccgo_ts + 33625 } else { - v3 = __ccgo_ts + 33548 + v3 = __ccgo_ts + 33632 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33555, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33639, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15382, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15436, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -193801,21 +187258,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17900) - _rbuCopyPragma(tls, p, __ccgo_ts+17296) + _rbuCopyPragma(tls, p, __ccgo_ts+18001) + _rbuCopyPragma(tls, p, __ccgo_ts+17397) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33587, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33671, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33603, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33687, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -193893,7 +187350,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33627, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33711, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -193940,7 +187397,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31650, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31734, uint64(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -193968,16 +187425,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -193987,7 +187444,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33635, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33719, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -194088,32 +187545,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15397, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15451, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15397, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15451, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15382 + v1 = __ccgo_ts + 15436 } else { - v1 = __ccgo_ts + 33587 + v1 = __ccgo_ts + 33671 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33587, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33671, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -194139,9 +187596,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -194213,7 +187672,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -194416,7 +187875,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -194467,14 +187926,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.X__builtin___memset_chk(tls, zBuf, 0, libc.Uint64FromInt32(iAmt), ^t__predefined_size_t(0)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -196050,7 +189448,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33728, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33812, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -196073,13 +189471,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33736 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33820 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33745 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33829 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33750 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33834 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -196088,7 +189486,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -196177,12 +189575,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33760, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33844, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33915, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33999, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33929, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34013, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -196259,7 +189657,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33944, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+34028, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -196399,315 +189797,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -197460,7 +190549,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.X__builtin___memset_chk(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew)), ^t__predefined_size_t(0)) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -197553,11 +190642,11 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12117, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12171, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33951, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34035, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -197566,7 +190655,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34081, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34165, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -197592,10 +190681,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+30293)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+30377))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -197616,8 +190705,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+30293) - libc.X__builtin___memcpy_chk(tls, pAlloc, __ccgo_ts+30293, nName+uint64(1), ^t__predefined_size_t(0)) + nName = libc.Xstrlen(tls, __ccgo_ts+30377) + libc.X__builtin___memcpy_chk(tls, pAlloc, __ccgo_ts+30377, nName+uint64(1), ^t__predefined_size_t(0)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -197681,7 +190770,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -197698,6 +190787,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -197719,12 +190810,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12117, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12171, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -198014,10 +191105,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11737 + zSep = __ccgo_ts + 11791 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34111, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34195, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -198029,8 +191120,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1666 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5489, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15493 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5515, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15547 goto _1 _1: ; @@ -198111,13 +191202,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -198609,14 +191693,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -198684,8 +191760,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34118, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22625 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34202, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22726 if zRet == uintptr(0) { break } @@ -198714,8 +191790,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34152, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 34193 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34236, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 34277 if zRet == uintptr(0) { break } @@ -198726,7 +191802,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1785, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1811, 0) } return zRet } @@ -198737,12 +191813,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 34198 + v1 = __ccgo_ts + 34282 } else { - v1 = __ccgo_ts + 7064 + v1 = __ccgo_ts + 7089 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34209, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34293, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -198803,11 +191879,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15493 + v2 = __ccgo_ts + 15547 } else { v2 = __ccgo_ts + 1665 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34288, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34372, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -198835,7 +191911,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34307, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34391, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -198864,17 +191940,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.X__builtin___memset_chk(tls, bp, 0, uint64(16), ^t__predefined_size_t(0)) @@ -198887,7 +191964,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -198898,18 +191977,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34448, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34479, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -198935,7 +192040,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34364, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34500, 0) } rc = int32(SQLITE_SCHEMA) } @@ -198983,7 +192088,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -199095,15 +192200,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -199267,7 +192374,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5551, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5577, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -199567,12 +192674,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34391, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12117, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34395, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34419, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34428, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34473, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34527, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12171, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34531, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34555, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34564, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34609, bp) } else { i = 0 for { @@ -199580,17 +192687,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15493, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15547, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15493 + zSep = __ccgo_ts + 15547 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34487, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34623, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34491, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34627, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -199604,7 +192711,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34518, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34654, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -199725,7 +192832,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -199739,14 +192846,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34560, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34696, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -199815,8 +192922,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -199841,18 +192948,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34580, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34716, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -199876,28 +192983,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -200036,7 +193147,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -200051,9 +193162,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.X__builtin___memset_chk(tls, pRet, 0, uint64(152), ^t__predefined_size_t(0)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -200082,20 +193193,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -200107,13 +193222,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.X__builtin___memmove_chk(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove), ^t__predefined_size_t(0)) + libc.X__builtin___memmove_chk(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove), ^t__predefined_size_t(0)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -200269,7 +193385,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -200293,7 +193409,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -200308,7 +193424,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -200364,7 +193480,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -200469,7 +193585,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -200540,8 +193656,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -200575,7 +193691,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -200585,7 +193701,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -200664,7 +193780,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -200925,7 +194041,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -201002,7 +194118,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -201074,11 +194190,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -201090,8 +194206,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -201119,12 +194235,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -201132,9 +194252,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -201147,14 +194267,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -201178,29 +194290,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -201277,7 +194366,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+12117) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+12171) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -201286,9 +194375,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 libc.X__builtin___memset_chk(tls, bp+8, 0, uint64(16), ^t__predefined_size_t(0)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.X__builtin___memcpy_chk(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4), ^t__predefined_size_t(0)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34598, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34734, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34611, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34747, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -201298,9 +194387,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34617, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34753, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15493 + zSep = __ccgo_ts + 15547 } goto _2 _2: @@ -201309,7 +194398,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1665 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34622, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34758, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -201318,13 +194407,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34630, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34766, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34705, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34841, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22726 } goto _3 _3: @@ -201411,9 +194500,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34711, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34847, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34622, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34758, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -201423,9 +194512,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34617, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34753, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22726 } goto _1 _1: @@ -201433,9 +194522,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34729, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34865, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34193, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34277, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -201445,16 +194534,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34705, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34841, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34737 + zSep = __ccgo_ts + 34873 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5519, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5545, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -201480,7 +194569,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+7059, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+7084, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -201503,16 +194592,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34742, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34878, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22631, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22732, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15493, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15547, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -201520,19 +194609,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34760, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34896, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34771, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34907, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5519, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5545, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -201555,12 +194644,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+12117, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+12171, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34775) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34911) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34888) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35024) } return rc } @@ -201604,7 +194693,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -201622,11 +194711,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -201803,7 +194892,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -201827,7 +194916,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -201842,7 +194931,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -201893,7 +194982,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -201933,10 +195022,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -201974,11 +195063,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -202001,7 +195090,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -202020,7 +195109,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -202029,7 +195118,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -202039,10 +195128,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35032, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35168, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -202052,10 +195141,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35053, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35189, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -202068,7 +195157,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -202095,7 +195184,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.X__builtin___memset_chk(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte, ^t__predefined_size_t(0)) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -202123,7 +195212,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -202155,15 +195244,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35072, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35208, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35098, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35234, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -202187,9 +195276,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -202199,7 +195288,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+7059, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+7084, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -202218,18 +195307,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35128, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35264, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35172, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35308, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35243, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35379, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+12117) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+12171) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -202263,7 +195352,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -202272,7 +195361,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -202280,23 +195369,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.X__builtin___memset_chk(tls, bp+168, 0, uint64(152), ^t__predefined_size_t(0)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35303, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35439, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35333, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35469, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+35357, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+35333, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35493, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35469, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -202319,13 +195408,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -202334,11 +195427,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -202346,10 +195443,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -202357,37 +195460,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -202410,7 +195505,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -202780,7 +195875,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -202963,7 +196058,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -202998,8 +196093,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -203018,9 +196113,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -203072,7 +196167,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -203108,11 +196203,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -203125,18 +196226,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -203144,13 +196247,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -203192,12 +196297,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -203205,27 +196316,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -203380,7 +196482,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -203488,8 +196590,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -203501,9 +196603,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.X__builtin___memset_chk(tls, bp+24, 0, uint64(16), ^t__predefined_size_t(0)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -203577,21 +196679,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -203697,6 +196803,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -203742,24 +196849,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -203818,99 +196913,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -203932,14 +196934,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -203951,29 +196945,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -204029,15 +197006,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -204059,14 +197027,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -204137,7 +197097,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -204165,27 +197124,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -204216,7 +197166,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -204752,14 +197702,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -204770,16 +197712,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -204831,10 +197763,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -204940,12 +197872,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -205020,7 +197952,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35385, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35521, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -205376,7 +198308,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35413, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35549, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -205553,18 +198485,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -205647,22 +198567,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -205681,7 +198585,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35444, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35580, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -205780,7 +198684,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35451 + zErr = __ccgo_ts + 35587 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -205840,16 +198744,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -205868,7 +198762,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -206035,7 +198929,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35501 + zErr = __ccgo_ts + 35637 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -206217,15 +199111,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -206306,7 +199191,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -206398,13 +199283,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -206430,13 +199315,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35549 + z = __ccgo_ts + 35685 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35605 + z1 = __ccgo_ts + 35741 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -206469,19 +199354,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35663, + FzFunc: __ccgo_ts + 35799, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35671, + FzFunc: __ccgo_ts + 35807, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35681, + FzFunc: __ccgo_ts + 35817, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35686, + FzFunc: __ccgo_ts + 35822, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -206869,7 +199754,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -206956,21 +199841,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -207279,13 +200149,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -207345,7 +200208,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35702, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35838, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -207371,12 +200234,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35709, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35845, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35740, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35876, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -207385,7 +200248,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35773, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35909, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -207395,14 +200258,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35810, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35946, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35819, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35955, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -207429,7 +200292,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35852, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35988, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -207441,76 +200304,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35886, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36022, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35894, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35926, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36062, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35932, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36068, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35951, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36087, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35994, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36130, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35951, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36087, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36016, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36152, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36166, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36068, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36204, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36079, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36215, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36114, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36250, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36257, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5928, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5954, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8753, + FzName: __ccgo_ts + 8778, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 18266, + FzName: __ccgo_ts + 18367, }, 2: { - FzName: __ccgo_ts + 36152, + FzName: __ccgo_ts + 36288, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -207518,20 +200381,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36160, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36296, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36191, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36327, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36201, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36337, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36235, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36371, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -207592,16 +200455,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36263) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+17197) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36268, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36399) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+17298) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36404, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36298) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36434) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36308, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36444, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -207627,7 +200490,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36339, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36475, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -207635,12 +200498,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36344, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36480, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36351, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36487, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36495, 0) } } goto _1 @@ -207656,9 +200519,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36366, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36502, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36495, 0) } goto _2 _2: @@ -207721,8 +200584,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36263) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36374, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36399) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36510, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -207753,7 +200616,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36403, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36539, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -207783,7 +200646,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36423, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36559, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -207791,37 +200654,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36473, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36609, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36528, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36664, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35886 + zTail = __ccgo_ts + 36022 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35886 + zTail = __ccgo_ts + 36022 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36581 + zTail = __ccgo_ts + 36717 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36589, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36725, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+17197, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+17298, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -207890,7 +200753,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36600, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36736, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -207899,16 +200762,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 15493 + v2 = __ccgo_ts + 15547 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36616, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36752, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36623, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36263)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36759, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36399)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -207941,7 +200804,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -207951,9 +200814,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -208066,7 +200929,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36649) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36785) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -208077,7 +200940,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36654) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36790) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -208088,7 +200951,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36663) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36799) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -208102,7 +200965,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36673) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36809) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -208113,7 +200976,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36683) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36819) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -208130,7 +200993,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36695) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36831) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -208145,7 +201008,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36263) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36399) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -208160,7 +201023,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36707) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36843) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -208176,7 +201039,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36721) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36857) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -208219,7 +201082,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36731 + zSelect = __ccgo_ts + 36867 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -208239,7 +201102,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36763) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36899) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -208250,7 +201113,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36771, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36907, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -208315,112 +201178,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -208496,7 +201253,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36842, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36978, 0) return FTS5_EOF } goto _1 @@ -208507,7 +201264,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36862, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36998, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -208522,13 +201279,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36893, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37029, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36896, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37032, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31359, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31443, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -208572,7 +201329,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -209105,16 +201862,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -209139,14 +201886,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -210211,7 +202950,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -210221,7 +202960,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -210267,14 +203006,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -210327,12 +203058,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.X__builtin___memset_chk(tls, pNew, 0, uint64(72), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40), ^t__predefined_size_t(0)) } v3 = pNew pPhrase = v3 @@ -210466,7 +203197,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -210506,15 +203237,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.X__builtin___memcpy_chk(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte), ^t__predefined_size_t(0)) @@ -210555,7 +203286,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -210593,8 +203324,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36900, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35413, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+37036, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35549, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -210614,10 +203345,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36905, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37041, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -210651,7 +203385,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -210701,7 +203435,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -210752,7 +203486,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21628, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21729, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -210779,7 +203513,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.X__builtin___memcpy_chk(tls, pRet, pOrig, libc.Uint64FromInt64(nByte), ^t__predefined_size_t(0)) @@ -210876,7 +203610,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36934, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37070, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -210961,7 +203695,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -210974,7 +203708,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -211048,7 +203782,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -211074,11 +203808,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36987 + v2 = __ccgo_ts + 37123 } else { - v2 = __ccgo_ts + 36900 + v2 = __ccgo_ts + 37036 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36994, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37130, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -211091,7 +203825,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37044, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37180, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -211212,14 +203946,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -211235,7 +203961,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.X__builtin___memset_chk(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase), ^t__predefined_size_t(0)) i = 0 @@ -211259,14 +203985,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -211568,7 +204286,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -211631,67 +204349,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -211829,7 +204487,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -212141,7 +204799,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -212573,9 +205231,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -212612,7 +205270,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -212685,7 +205342,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -212720,7 +205376,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -212735,149 +205390,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -212885,187 +205404,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -213245,7 +205584,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37097, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37233, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -213350,7 +205689,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+37103, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+37239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -213379,7 +205718,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+37154, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+37290, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -213413,7 +205752,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+37203, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+37339, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -213491,7 +205830,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.X__builtin___memcpy_chk(tls, pNew, p, libc.Uint64FromInt64(nByte), ^t__predefined_size_t(0)) @@ -213582,7 +205921,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+37243, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+37379, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -213593,7 +205932,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.X__builtin___memcpy_chk(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+37243, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+37379, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -214274,7 +206613,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -214519,15 +206858,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -214628,7 +206967,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -215234,7 +207573,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37271, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37407, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -215323,7 +207662,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37355, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37491, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -215970,7 +208309,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -215996,14 +208335,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -216013,15 +208344,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -216135,7 +208457,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -216156,7 +208478,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -216880,7 +209202,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -217294,7 +209616,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37437, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37573, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -217749,13 +210071,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -217800,7 +210115,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37494, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37630, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -217969,7 +210284,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -218287,7 +210602,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37555, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37691, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -218562,7 +210877,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -218597,7 +210912,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -218876,16 +211191,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -219103,7 +211408,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -219140,7 +211445,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -219151,70 +211456,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -219283,7 +211525,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -219382,14 +211624,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -219436,19 +211670,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -219527,7 +211748,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -219577,7 +211798,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -219659,15 +211880,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) + pTmp = bp + libc.X__builtin___memset_chk(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16), ^t__predefined_size_t(0)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1665, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -219693,11 +211917,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37606, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37742, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26394, __ccgo_ts+37614, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26478, __ccgo_ts+37750, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12328, __ccgo_ts+37649, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12382, __ccgo_ts+37785, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -219895,7 +212119,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -220150,7 +212374,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37693) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37829) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -220501,7 +212725,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -220623,7 +212847,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -220743,7 +212967,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37097, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37233, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -221337,7 +213561,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37695, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37831, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -221568,7 +213792,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37781) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37917) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -221707,7 +213931,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -221762,87 +213985,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -221850,96 +213992,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -222190,7 +214242,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37786, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37922, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -222227,7 +214279,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5551, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5577, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -222246,7 +214298,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5551, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5577, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -222696,7 +214748,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -222724,7 +214776,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -222744,7 +214796,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -222759,7 +214811,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15493 + v1 = __ccgo_ts + 15547 } else { v1 = __ccgo_ts + 1665 } @@ -222769,11 +214821,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1665 } if bDesc != 0 { - v3 = __ccgo_ts + 37825 + v3 = __ccgo_ts + 37961 } else { - v3 = __ccgo_ts + 37830 + v3 = __ccgo_ts + 37966 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37834, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37970, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -222831,14 +214883,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37889, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+38025, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5910, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5936, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37895, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38031, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -222888,7 +214940,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37923, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38059, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -222921,7 +214973,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37933, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38069, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -222955,7 +215007,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37954, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38090, libc.VaList(bp+24, z)) } } } else { @@ -222963,7 +215015,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35681 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35817 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -223120,7 +215172,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37987, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38123, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -223320,7 +215372,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37992, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+38128, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -223453,10 +215505,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -225992,12 +217981,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39341, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39477, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39445, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39483, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39619, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -226006,7 +217995,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39521, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39657, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -226018,14 +218007,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26394, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12328, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38675, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26478, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12382, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38811, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36581, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36717, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35886, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36022, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -226045,13 +218034,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 31034 + v1 = __ccgo_ts + 31118 } else { v1 = __ccgo_ts + 1665 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39563, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39699, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39593, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39729, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -226092,7 +218081,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39637, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39773, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -226100,7 +218089,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39660, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39796, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -226115,7 +218104,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39666, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39802, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -226124,22 +218113,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35886, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36022, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39672 + zCols = __ccgo_ts + 39808 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39704 + zCols = __ccgo_ts + 39840 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36581, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36717, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38675, __ccgo_ts+39752, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38811, __ccgo_ts+39888, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36763, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36899, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -226184,14 +218173,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -226261,14 +218242,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -226296,6 +218277,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -226308,11 +218290,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -226325,6 +218320,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -226559,12 +218555,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39769, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39905, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39819, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39955, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39848, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39984, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -226572,7 +218568,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36763, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36899, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -226874,7 +218870,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39877, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+40013, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -226907,17 +218903,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -227004,7 +218989,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.X__builtin___memset_chk(tls, bp, 0, uint64(40), ^t__predefined_size_t(0)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -227106,14 +219091,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35886, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+36022, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -227765,11 +219732,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39931 + zCat = __ccgo_ts + 40067 libc.X__builtin___memset_chk(tls, p, 0, uint64(192), ^t__predefined_size_t(0)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -227779,7 +219746,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39940) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40076) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -227796,20 +219763,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39951) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40087) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*int8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39909) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40045) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39920) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40056) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39940) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40076) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -227845,7 +219812,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -228032,7 +219999,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -228060,14 +220027,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]int8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -228101,7 +220060,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39969 + zBase = __ccgo_ts + 40105 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -228145,14 +220104,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -228163,16 +220114,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -228318,64 +220259,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40115, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39982, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40118, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39987, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40123, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39992, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40128, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39995, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40131, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40134, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40003, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40139, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40008, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40144, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40012, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40148, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40018, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40154, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40023, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40159, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -228384,49 +220325,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40027, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40163, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40031, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40167, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40034, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40170, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40038, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40174, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40042, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40178, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40046, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40182, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40050, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40186, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40054, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40190, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -228443,20 +220384,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40058, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40194, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40061, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40064, uint64(3), ^t__predefined_size_t(0)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40197, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40200, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40068, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40054, uint64(3), ^t__predefined_size_t(0)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40204, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40190, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -228472,75 +220413,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40071, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40207, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40079, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40215, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40086, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40222, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40091, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40227, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39987, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40123, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40096, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40232, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39982, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40118, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40101, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40237, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40054, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40190, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40106, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40242, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16396, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16497, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40111, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40247, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40064, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40200, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40115, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40251, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40120, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40256, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40023, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40159, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40126, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40262, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40130, uint64(1), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40266, uint64(1), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40132, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40268, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40046, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40182, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -228549,48 +220490,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40138, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40274, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40054, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40190, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40146, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40282, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40152, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40288, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40157, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40293, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40163, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40299, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40050, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40186, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40171, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40307, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40179, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40315, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40183, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40319, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40046, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40182, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -228598,21 +220539,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40191, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40327, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40197, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40333, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40050, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40186, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40203, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40339, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40064, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40200, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -228630,48 +220571,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40210, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40346, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40131, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40215, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40351, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40220, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40356, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40131, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40226, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40362, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40131, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40179, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40315, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40232, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40368, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40238, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40374, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -228687,13 +220628,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40244, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40380, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40248, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40384, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40251, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40387, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -228701,7 +220642,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40254, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40390, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -228798,14 +220739,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -228823,13 +220764,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -228866,14 +220800,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40258) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40394) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39951) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40087) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -228911,7 +220845,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -229039,7 +220973,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -229115,11 +221049,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -229141,7 +221075,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40273)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40409)) } // C documentation @@ -229167,7 +221101,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39969, + FzName: __ccgo_ts + 40105, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -229175,7 +221109,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 40281, + FzName: __ccgo_ts + 40417, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -229183,7 +221117,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 40273, + FzName: __ccgo_ts + 40409, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -229213,7 +221147,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40287, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40423, pApi, bp+96, uintptr(0)) } return rc } @@ -234674,39 +226608,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -234729,16 +226630,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40294) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40430) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40298) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40434) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40302) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40438) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40311, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40447, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -234801,21 +226702,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 40345, - 1: __ccgo_ts + 40385, - 2: __ccgo_ts + 40420, + 0: __ccgo_ts + 40481, + 1: __ccgo_ts + 40521, + 2: __ccgo_ts + 40556, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24370, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24471, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40463, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -234836,23 +226738,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab), ^t__predefined_size_t(0)) - libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb), ^t__predefined_size_t(0)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -234985,10 +226887,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40496, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40632, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40527, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40663, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -235007,7 +226909,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40578, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40714, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -235457,7 +227359,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40604, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40740, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -235512,15 +227414,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40614 + return __ccgo_ts + 40750 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -235685,9 +227587,7 @@ var Xsqlite3_temp_directory uintptr *===-----------------------------------------------------------------------=== */ -/* FIXME: This is using the placeholder dates Clang produces for these macros - in C2x mode; switch to the correct values once they've been published. */ -/* Versions before C2x do require the second parameter. */ +/* Versions before C23 do require the second parameter. */ /*===---- __stdarg___va_copy.h - Definition of __va_copy -------------------=== * @@ -235773,7 +227673,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -235821,11 +227721,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-16.0.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00S\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00hfs\x00ufs\x00afpfs\x00smbfs\x00webdav\x00nfs\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00msdos\x00exfat\x00SQLITE_FORCE_PROXY_LOCKING\x00:auto:\x00fsync\x00/dev/urandom\x00sqliteplocks\x00/\x00dummy\x00break\x00path error (len %d)\x00read error (len %d)\x00create failed (%d)\x00write failed (%d)\x00rename failed (%d)\x00broke stale lock on %s\n\x00failed to break stale lock on %s, %s\n\x00-conch\x00.lock\x00:auto: (not held)\x00unix\x00unix-none\x00unix-dotfile\x00unix-posix\x00unix-flock\x00unix-afp\x00unix-nfs\x00unix-proxy\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dylib\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_proxy_file\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00failed to set lock proxy file\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-17.0.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00S\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00hfs\x00ufs\x00afpfs\x00smbfs\x00webdav\x00nfs\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00msdos\x00exfat\x00SQLITE_FORCE_PROXY_LOCKING\x00:auto:\x00fsync\x00/dev/urandom\x00sqliteplocks\x00/\x00dummy\x00break\x00path error (len %d)\x00read error (len %d)\x00create failed (%d)\x00write failed (%d)\x00rename failed (%d)\x00broke stale lock on %s\n\x00failed to break stale lock on %s, %s\n\x00-conch\x00.lock\x00:auto: (not held)\x00unix\x00unix-none\x00unix-dotfile\x00unix-posix\x00unix-flock\x00unix-afp\x00unix-nfs\x00unix-proxy\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dylib\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_proxy_file\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00failed to set lock proxy file\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go index ac41567..6a63273 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_darwin_arm64.go @@ -1,4 +1,4 @@ -// Code generated for darwin/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/darwin/arm64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/darwin/arm64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/darwin/arm64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for darwin/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/darwin/arm64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/darwin/arm64 -I /Users/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/darwin/arm64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build darwin && arm64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -166,6 +168,7 @@ const ATTR_FORK_SETMASK = 0 const ATTR_FORK_TOTALSIZE = 1 const ATTR_FORK_VALIDMASK = 3 const ATTR_MAX_BUFFER = 8192 +const ATTR_MAX_BUFFER_LONGPATHS = 7168 const ATTR_VOL_ALLOCATIONCLUMP = 64 const ATTR_VOL_ATTRIBUTES = 1073741824 const ATTR_VOL_CAPABILITIES = 131072 @@ -185,6 +188,7 @@ const ATTR_VOL_MOUNTFLAGS = 16384 const ATTR_VOL_MOUNTPOINT = 4096 const ATTR_VOL_NAME = 8192 const ATTR_VOL_OBJCOUNT = 256 +const ATTR_VOL_OWNER = 4194304 const ATTR_VOL_QUOTA_SIZE = 268435456 const ATTR_VOL_RESERVED_SIZE = 536870912 const ATTR_VOL_SETMASK = 2147491840 @@ -194,7 +198,7 @@ const ATTR_VOL_SPACEAVAIL = 16 const ATTR_VOL_SPACEFREE = 8 const ATTR_VOL_SPACEUSED = 8388608 const ATTR_VOL_UUID = 262144 -const ATTR_VOL_VALIDMASK = 4039114751 +const ATTR_VOL_VALIDMASK = 4043309055 const AT_EACCESS = 16 const AT_FDCWD = -2 const AT_FDONLY = 1024 @@ -288,7 +292,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -346,6 +349,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BUS_ADRALN = 1 const BUS_ADRERR = 2 @@ -948,7 +952,7 @@ const IFCAP_TSO4 = 32 const IFCAP_TSO6 = 64 const IFCAP_TXCSUM = 2 const IFCAP_TXSTATUS = 512 -const IFCAP_VALID = 32767 +const IFCAP_VALID = 65535 const IFCAP_VLAN_HWTAGGING = 8 const IFCAP_VLAN_MTU = 4 const IFF_ALLMULTI = 512 @@ -1097,6 +1101,7 @@ const IOPOL_VFS_IGNORE_PERMISSIONS_OFF = 0 const IOPOL_VFS_IGNORE_PERMISSIONS_ON = 1 const IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_DEFAULT = 0 const IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_ON = 1 +const IOPOL_VFS_SKIP_MTIME_UPDATE_IGNORE = 2 const IOPOL_VFS_SKIP_MTIME_UPDATE_OFF = 0 const IOPOL_VFS_SKIP_MTIME_UPDATE_ON = 1 const IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME = 1 @@ -1298,15 +1303,21 @@ const MAC_OS_VERSION_13_3 = 130300 const MAC_OS_VERSION_13_4 = 130400 const MAC_OS_VERSION_13_5 = 130500 const MAC_OS_VERSION_13_6 = 130600 +const MAC_OS_VERSION_13_7 = 130700 const MAC_OS_VERSION_14_0 = 140000 const MAC_OS_VERSION_14_1 = 140100 const MAC_OS_VERSION_14_2 = 140200 const MAC_OS_VERSION_14_3 = 140300 const MAC_OS_VERSION_14_4 = 140400 const MAC_OS_VERSION_14_5 = 140500 +const MAC_OS_VERSION_14_6 = 140600 +const MAC_OS_VERSION_14_7 = 140700 const MAC_OS_VERSION_15_0 = 150000 const MAC_OS_VERSION_15_1 = 150100 const MAC_OS_VERSION_15_2 = 150200 +const MAC_OS_VERSION_15_3 = 150300 +const MAC_OS_VERSION_15_4 = 150400 +const MAC_OS_VERSION_15_5 = 150500 const MAC_OS_X_VERSION_10_0 = 1000 const MAC_OS_X_VERSION_10_1 = 1010 const MAC_OS_X_VERSION_10_10 = 101000 @@ -1395,10 +1406,10 @@ const MAXUPRC = 266 const MAX_AUDIT_RECORDS = 20 const MAX_AUDIT_RECORD_SIZE = 32767 const MAX_CANON = 1024 -const MAX_FATAL_kGUARD_EXC_CODE = 128 +const MAX_FATAL_kGUARD_EXC_CODE = 0 const MAX_GRAFT_ARGS_SIZE = 512 const MAX_INPUT = 1024 -const MAX_OPTIONAL_kGUARD_EXC_CODE = 524288 +const MAX_OPTIONAL_kGUARD_EXC_CODE = 0 const MAX_PATHNAME = 512 const MAX_SECTOR_SIZE = 65536 const MBIGCLBYTES = 4096 @@ -1889,6 +1900,7 @@ const O_NONBLOCK = 4 const O_POPUP = 2147483648 const O_RDONLY = 0 const O_RDWR = 2 +const O_RESOLVE_BENEATH = 4096 const O_SEARCH = 1074790400 const O_SHLOCK = 16 const O_SYMLINK = 2097152 @@ -2442,6 +2454,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -2681,6 +2694,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -2891,6 +2905,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -3053,6 +3068,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -3061,7 +3077,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -3171,8 +3187,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3275,9 +3291,12 @@ const TARGET_CPU_SPARC = 0 const TARGET_CPU_X86 = 0 const TARGET_CPU_X86_64 = 0 const TARGET_IPHONE_SIMULATOR = 0 +const TARGET_OS_ARROW = 1 +const TARGET_OS_BRIDGE = 0 const TARGET_OS_DRIVERKIT = 0 const TARGET_OS_EMBEDDED = 0 const TARGET_OS_IOS = 0 +const TARGET_OS_IOSMAC = 0 const TARGET_OS_IPHONE = 0 const TARGET_OS_LINUX = 0 const TARGET_OS_MAC = 1 @@ -3293,6 +3312,7 @@ const TARGET_OS_VISION = 0 const TARGET_OS_WATCH = 0 const TARGET_OS_WIN32 = 0 const TARGET_OS_WINDOWS = 0 +const TARGET_OS_XR = 0 const TARGET_RT_64_BIT = 1 const TARGET_RT_BIG_ENDIAN = 0 const TARGET_RT_LITTLE_ENDIAN = 1 @@ -3920,6 +3940,8 @@ const _IONBF = 2 const _LARGEFILE64_SOURCE = 1 const _LARGEFILE_SOURCE = 1 const _LARGE_FILE = 1 +const _LIBC_COUNT__MB_LEN_MAX = 0 +const _LIBC_COUNT__PATH_MAX = 0 const _LP64 = 1 const _MALLOC_TYPE_AVAILABILITY = 0 const _PC_2_SYMLINKS = 15 @@ -4193,11 +4215,18 @@ const __AARCH64_SIMD__ = 1 const __API_TO_BE_DEPRECATED = 100000 const __API_TO_BE_DEPRECATED_DRIVERKIT = 100000 const __API_TO_BE_DEPRECATED_IOS = 100000 +const __API_TO_BE_DEPRECATED_IOSAPPLICATIONEXTENSION = 100000 +const __API_TO_BE_DEPRECATED_KERNELKIT = 100000 const __API_TO_BE_DEPRECATED_MACCATALYST = 100000 +const __API_TO_BE_DEPRECATED_MACCATALYSTAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_MACOS = 100000 +const __API_TO_BE_DEPRECATED_MACOSAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_TVOS = 100000 +const __API_TO_BE_DEPRECATED_TVOSAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_VISIONOS = 100000 +const __API_TO_BE_DEPRECATED_VISIONOSAPPLICATIONEXTENSION = 100000 const __API_TO_BE_DEPRECATED_WATCHOS = 100000 +const __API_TO_BE_DEPRECATED_WATCHOSAPPLICATIONEXTENSION = 100000 const __APPLE_CC__ = 6000 const __APPLE__ = 1 const __ARM64_ARCH_8__ = 1 @@ -4245,6 +4274,8 @@ const __ARM_NEON__ = 1 const __ARM_PCS_AAPCS64 = 1 const __ARM_SIZEOF_MINIMAL_ENUM = 4 const __ARM_SIZEOF_WCHAR_T = 4 +const __ARM_STATE_ZA = 1 +const __ARM_STATE_ZT0 = 1 const __ASSUME_PTR_ABI_SINGLE_BEGIN = 0 const __ASSUME_PTR_ABI_SINGLE_END = 0 const __ATOMIC_ACQUIRE = 2 @@ -4254,6 +4285,9 @@ const __ATOMIC_RELAXED = 0 const __ATOMIC_RELEASE = 3 const __ATOMIC_SEQ_CST = 5 const __AUDIT_API_DEPRECATED = 0 +const __AVAILABILITY_FILE = "AvailabilityVersions.h" +const __AVAILABILITY_VERSIONS_VERSION_HASH = 93585900 +const __AVAILABILITY_VERSIONS_VERSION_STRING = "Local" const __BIGGEST_ALIGNMENT__ = 8 const __BITINT_MAXWIDTH__ = 128 const __BLOCKS__ = 1 @@ -4284,9 +4318,13 @@ const __BRIDGEOS_8_2 = 80200 const __BRIDGEOS_8_3 = 80300 const __BRIDGEOS_8_4 = 80400 const __BRIDGEOS_8_5 = 80500 +const __BRIDGEOS_8_6 = 80600 const __BRIDGEOS_9_0 = 90000 const __BRIDGEOS_9_1 = 90100 const __BRIDGEOS_9_2 = 90200 +const __BRIDGEOS_9_3 = 90300 +const __BRIDGEOS_9_4 = 90400 +const __BRIDGEOS_9_5 = 90500 const __BYTE_ORDER__ = 1234 const __CCGO__ = 1 const __CHAR_BIT__ = 8 @@ -4343,6 +4381,7 @@ const __DBL_MAX__ = 0 const __DBL_MIN_10_EXP__ = -307 const __DBL_MIN_EXP__ = -1021 const __DBL_MIN__ = 2.2250738585072014e-308 +const __DBL_NORM_MAX__ = 0 const __DECIMAL_DIG__ = 17 const __DRIVERKIT_19_0 = 190000 const __DRIVERKIT_20_0 = 200000 @@ -4357,10 +4396,15 @@ const __DRIVERKIT_23_2 = 230200 const __DRIVERKIT_23_3 = 230300 const __DRIVERKIT_23_4 = 230400 const __DRIVERKIT_23_5 = 230500 +const __DRIVERKIT_23_6 = 230600 const __DRIVERKIT_24_0 = 240000 const __DRIVERKIT_24_1 = 240100 const __DRIVERKIT_24_2 = 240200 -const __DYLDDL_DRIVERKIT_UNAVAILABLE = 0 +const __DRIVERKIT_24_3 = 240300 +const __DRIVERKIT_24_4 = 240400 +const __DRIVERKIT_24_5 = 240500 +const __DYLDDL_DLSYM_UNAVAILABLE = 0 +const __DYLDDL_UNAVAILABLE = 0 const __DYNAMIC__ = 1 const __ENABLE_LEGACY_MAC_AVAILABILITY = 1 const __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ = 150000 @@ -4380,6 +4424,7 @@ const __FLT16_MAX__ = 0 const __FLT16_MIN_10_EXP__ = -4 const __FLT16_MIN_EXP__ = -13 const __FLT16_MIN__ = 0 +const __FLT16_NORM_MAX__ = 0 const __FLT_DECIMAL_DIG__ = 9 const __FLT_DENORM_MIN__ = 0 const __FLT_DIG__ = 6 @@ -4394,6 +4439,7 @@ const __FLT_MAX__ = 0 const __FLT_MIN_10_EXP__ = -37 const __FLT_MIN_EXP__ = -125 const __FLT_MIN__ = 1.17549435e-38 +const __FLT_NORM_MAX__ = 0 const __FLT_RADIX__ = 2 const __FPCLASS_NEGINF = 4 const __FPCLASS_NEGNORMAL = 8 @@ -4420,8 +4466,11 @@ const __GCC_ATOMIC_POINTER_LOCK_FREE = 2 const __GCC_ATOMIC_SHORT_LOCK_FREE = 2 const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1 const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2 +const __GCC_CONSTRUCTIVE_SIZE = 64 +const __GCC_DESTRUCTIVE_SIZE = 64 const __GCC_HAVE_DWARF2_CFI_ASM = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1 +const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1 @@ -4551,9 +4600,14 @@ const __IPHONE_17_2 = 170200 const __IPHONE_17_3 = 170300 const __IPHONE_17_4 = 170400 const __IPHONE_17_5 = 170500 +const __IPHONE_17_6 = 170600 +const __IPHONE_17_7 = 170700 const __IPHONE_18_0 = 180000 const __IPHONE_18_1 = 180100 const __IPHONE_18_2 = 180200 +const __IPHONE_18_3 = 180300 +const __IPHONE_18_4 = 180400 +const __IPHONE_18_5 = 180500 const __IPHONE_2_0 = 20000 const __IPHONE_2_1 = 20100 const __IPHONE_2_2 = 20200 @@ -4593,6 +4647,7 @@ const __LDBL_MAX__ = 0 const __LDBL_MIN_10_EXP__ = -307 const __LDBL_MIN_EXP__ = -1021 const __LDBL_MIN__ = 2.2250738585072014e-308 +const __LDBL_NORM_MAX__ = 0 const __LITTLE_ENDIAN__ = 1 const __LLONG_WIDTH__ = 64 const __LONG_LONG_MAX__ = 9223372036854775807 @@ -4657,17 +4712,28 @@ const __MAC_13_3 = 130300 const __MAC_13_4 = 130400 const __MAC_13_5 = 130500 const __MAC_13_6 = 130600 +const __MAC_13_7 = 130700 const __MAC_14_0 = 140000 const __MAC_14_1 = 140100 const __MAC_14_2 = 140200 const __MAC_14_3 = 140300 const __MAC_14_4 = 140400 const __MAC_14_5 = 140500 +const __MAC_14_6 = 140600 +const __MAC_14_7 = 140700 const __MAC_15_0 = 150000 const __MAC_15_1 = 150100 const __MAC_15_2 = 150200 -const __MAC_OS_X_VERSION_MAX_ALLOWED = 150200 +const __MAC_15_3 = 150300 +const __MAC_15_4 = 150400 +const __MAC_15_5 = 150500 +const __MAC_OS_X_VERSION_MAX_ALLOWED = 150500 const __MAC_OS_X_VERSION_MIN_REQUIRED = 150000 +const __MEMORY_SCOPE_DEVICE = 1 +const __MEMORY_SCOPE_SINGLE = 4 +const __MEMORY_SCOPE_SYSTEM = 0 +const __MEMORY_SCOPE_WRKGRP = 2 +const __MEMORY_SCOPE_WVFRNT = 3 const __NO_INLINE__ = 1 const __NO_MATH_ERRNO__ = 1 const __NULLABILITY_COMPLETENESS_POP = 0 @@ -4739,6 +4805,9 @@ const __SRD = 4 const __SRW = 16 const __SSP__ = 1 const __SSTR = 512 +const __STDC_EMBED_EMPTY__ = 2 +const __STDC_EMBED_FOUND__ = 1 +const __STDC_EMBED_NOT_FOUND__ = 0 const __STDC_HOSTED__ = 1 const __STDC_NO_THREADS__ = 1 const __STDC_UTF_16__ = 1 @@ -4792,9 +4861,13 @@ const __TVOS_17_2 = 170200 const __TVOS_17_3 = 170300 const __TVOS_17_4 = 170400 const __TVOS_17_5 = 170500 +const __TVOS_17_6 = 170600 const __TVOS_18_0 = 180000 const __TVOS_18_1 = 180100 const __TVOS_18_2 = 180200 +const __TVOS_18_3 = 180300 +const __TVOS_18_4 = 180400 +const __TVOS_18_5 = 180500 const __TVOS_9_0 = 90000 const __TVOS_9_1 = 90100 const __TVOS_9_2 = 90200 @@ -4875,22 +4948,31 @@ const __UINT_LEAST8_FMTu__ = "hhu" const __UINT_LEAST8_FMTx__ = "hhx" const __UINT_LEAST8_MAX__ = 255 const __USER_LABEL_PREFIX__ = 0 -const __VERSION__ = "Apple LLVM 16.0.0 (clang-1600.0.26.6)" +const __VERSION__ = "Apple LLVM 17.0.0 (clang-1700.0.13.5)" const __VISIONOS_1_0 = 10000 const __VISIONOS_1_1 = 10100 const __VISIONOS_1_2 = 10200 +const __VISIONOS_1_3 = 10300 const __VISIONOS_2_0 = 20000 const __VISIONOS_2_1 = 20100 const __VISIONOS_2_2 = 20200 +const __VISIONOS_2_3 = 20300 +const __VISIONOS_2_4 = 20400 +const __VISIONOS_2_5 = 20500 const __WATCHOS_10_0 = 100000 const __WATCHOS_10_1 = 100100 const __WATCHOS_10_2 = 100200 const __WATCHOS_10_3 = 100300 const __WATCHOS_10_4 = 100400 const __WATCHOS_10_5 = 100500 +const __WATCHOS_10_6 = 100600 +const __WATCHOS_10_7 = 100700 const __WATCHOS_11_0 = 110000 const __WATCHOS_11_1 = 110100 const __WATCHOS_11_2 = 110200 +const __WATCHOS_11_3 = 110300 +const __WATCHOS_11_4 = 110400 +const __WATCHOS_11_5 = 110500 const __WATCHOS_1_0 = 10000 const __WATCHOS_2_0 = 20000 const __WATCHOS_2_1 = 20100 @@ -4939,20 +5021,21 @@ const __WINT_MAX__ = 2147483647 const __WINT_TYPE__ = 0 const __WINT_WIDTH__ = 32 const __aarch64__ = 1 -const __apple_build_version__ = 16000026 +const __apple_build_version__ = 17000013 const __arm64 = 1 const __arm64__ = 1 const __bool_true_false_are_defined = 1 const __clang__ = 1 const __clang_literal_encoding__ = "UTF-8" -const __clang_major__ = 16 +const __clang_major__ = 17 const __clang_minor__ = 0 const __clang_patchlevel__ = 0 -const __clang_version__ = "16.0.0 (clang-1600.0.26.6)" +const __clang_version__ = "17.0.0 (clang-1700.0.13.5)" const __clang_wide_literal_encoding__ = "UTF-32" const __const = 0 const __exported_pop = 0 const __exported_push = 0 +const __has_bounds_safety_attributes = 0 const __has_ptrcheck = 0 const __has_safe_buffers = 0 const __header_inline = 0 @@ -4975,6 +5058,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -4984,9 +5070,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -5413,12 +5496,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -5547,30 +5624,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - // C documentation // // /* @@ -5852,6 +5905,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -6082,33 +6136,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -6187,19 +6214,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -6284,7 +6298,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -6376,223 +6389,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
column OP expr
-** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -6674,20 +6470,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -6737,13 +6519,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -6802,9 +6577,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -6812,17 +6587,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -6849,12 +6624,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
createFlag Behavior when page is not already in cache // **
0 Do not allocate a new page. Return NULL. -// **
1 Allocate a new page if it easy and convenient to do so. +// **
1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -6871,7 +6646,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -6889,7 +6664,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -6923,24 +6698,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -6964,22 +6721,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -7040,7 +6781,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -7120,50 +6861,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -7560,340 +7257,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -7903,15 +7266,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -7927,14 +7281,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -7960,17 +7306,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -8025,11 +7360,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -8403,55 +7744,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type t__int8_t = int8 type t__uint8_t = uint8 @@ -8868,6 +8165,32 @@ type t__arm_pagein_state = struct { F__pagein_error int32 } +type t__darwin_arm_sme_state = struct { + F__svcr t__uint64_t + F__tpidr2_el0 t__uint64_t + F__svl_b t__uint16_t +} + +type t__darwin_arm_sve_z_state = struct { + F__ccgo_align [0]uint32 + F__z [16][256]int8 +} + +type t__darwin_arm_sve_p_state = struct { + F__ccgo_align [0]uint32 + F__p [16][32]int8 +} + +type t__darwin_arm_sme_za_state = struct { + F__ccgo_align [0]uint32 + F__za [4096]int8 +} + +type t__darwin_arm_sme2_state = struct { + F__ccgo_align [0]uint32 + F__zt0 [64]int8 +} + type t__arm_legacy_debug_state = struct { F__bvr [16]t__uint32_t F__bcr [16]t__uint32_t @@ -9646,6 +8969,11 @@ type _RuneLocale = T_RuneLocale ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -9704,6 +9032,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -9813,14 +9152,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -9905,7 +9236,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -10007,7 +9338,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -10066,6 +9396,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -10077,9 +9408,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -10094,7 +9425,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -10143,8 +9473,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -10208,7 +9538,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -10280,19 +9609,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -10306,11 +9638,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -10321,40 +9650,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -10372,7 +9702,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -10384,6 +9714,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -10532,9 +9863,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -10551,10 +9882,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -10589,6 +9916,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -10769,7 +10097,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -10811,7 +10138,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -10984,9 +10310,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -11113,53 +10439,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -11263,16 +10542,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -11296,38 +10565,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -11340,34 +10582,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -11381,90 +10599,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -11483,187 +10617,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -11673,913 +10626,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -12604,611 +10650,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -13218,317 +10659,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -13614,228 +10744,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -14918,7 +11826,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -14996,72 +11903,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -15107,164 +11952,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - -/* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - /* -** Clear any existing type flags from a Mem and replace them with f +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -15290,18 +11982,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -15318,100 +11998,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -15433,13 +12019,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -15459,14 +12038,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -15545,7 +12117,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -15717,7 +12289,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -15775,7 +12347,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -15904,24 +12476,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -16098,7 +12652,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -16169,10 +12723,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -16308,7 +12862,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -16405,7 +12959,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -16546,10 +13100,10 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = 0 _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1210, -int32(1)) @@ -16560,7 +13114,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -16638,7 +13192,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -16786,7 +13340,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -17089,7 +13643,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -17246,7 +13800,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -17294,7 +13848,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -17399,7 +13953,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -17915,28 +14469,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -17944,19 +14498,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -17973,12 +14527,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -17986,7 +14540,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -17999,34 +14553,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -18128,7 +14682,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -18339,14 +14893,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -18361,9 +14908,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -18777,7 +15324,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -19107,6 +15658,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -19114,8 +15667,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -20102,17 +16655,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -20309,22 +16862,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -20573,11 +17127,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -20605,7 +17159,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -20627,7 +17181,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -21054,29 +17608,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint32(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -21191,25 +17723,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1666 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1666 } else { - v98 = __ccgo_ts + 1671 + v97 = __ccgo_ts + 1671 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -21217,15 +17753,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -21236,13 +17772,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -21256,35 +17825,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.X__builtin___memcpy_chk(tls, bufpt+uintptr(j1), __ccgo_ts+1678, uint64(8), ^t__predefined_size_t(0)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if libc.Int32FromUint8(libc.Uint8FromInt8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -21309,9 +17941,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -21325,7 +17957,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1678, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1704, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -21335,21 +17967,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1680, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1706, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1690, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1716, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1711, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1737, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -21588,7 +18220,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.X__builtin___memcpy_chk(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1)), ^t__predefined_size_t(0)) p1 = p + 29 @@ -21887,6 +18519,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -21904,11 +18538,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -22342,63 +18976,10 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.X__builtin___memcpy_chk(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132), ^t__predefined_size_t(0)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr _ = p *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -22407,11 +18988,11 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui return int32(SQLITE_NOMEM) } if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn } else { (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -22542,6 +19123,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = libc.Int8FromUint8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -23312,7 +19924,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -23487,7 +20099,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1725, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1751, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -23699,11 +20311,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.X__builtin___memcpy_chk(tls, bp+16, bp+24, uint64(8), ^t__predefined_size_t(0)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -23939,7 +20551,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -24029,7 +20641,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1750 + pow63 = __ccgo_ts + 1776 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -24256,7 +20868,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1769)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1795)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -24416,7 +21028,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1785 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1811 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -24525,7 +21137,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -24936,7 +21548,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1787, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1813, libc.VaList(bp+8, zType)) } // C documentation @@ -24965,7 +21577,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1832) + _logBadConnection(tls, __ccgo_ts+1858) } return 0 } else { @@ -24979,7 +21591,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1841) + _logBadConnection(tls, __ccgo_ts+1867) return 0 } else { return int32(1) @@ -25064,7 +21676,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -25419,23 +22031,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -25490,8 +22100,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -25524,9 +22134,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -25546,13 +22155,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -25560,7 +22168,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -25576,7 +22184,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -25588,7 +22196,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -25637,7 +22245,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -25647,20 +22255,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -25679,196 +22286,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1849, - 1: __ccgo_ts + 1859, - 2: __ccgo_ts + 1870, - 3: __ccgo_ts + 1882, - 4: __ccgo_ts + 1893, - 5: __ccgo_ts + 1905, - 6: __ccgo_ts + 1912, - 7: __ccgo_ts + 1920, - 8: __ccgo_ts + 1928, - 9: __ccgo_ts + 1933, - 10: __ccgo_ts + 1938, - 11: __ccgo_ts + 1944, - 12: __ccgo_ts + 1958, - 13: __ccgo_ts + 1964, - 14: __ccgo_ts + 1974, - 15: __ccgo_ts + 1979, - 16: __ccgo_ts + 1984, - 17: __ccgo_ts + 1987, - 18: __ccgo_ts + 1993, - 19: __ccgo_ts + 2000, - 20: __ccgo_ts + 2004, - 21: __ccgo_ts + 2014, - 22: __ccgo_ts + 2021, - 23: __ccgo_ts + 2028, - 24: __ccgo_ts + 2035, - 25: __ccgo_ts + 2042, - 26: __ccgo_ts + 2052, - 27: __ccgo_ts + 2061, - 28: __ccgo_ts + 2072, - 29: __ccgo_ts + 2081, - 30: __ccgo_ts + 2087, - 31: __ccgo_ts + 2097, - 32: __ccgo_ts + 2107, - 33: __ccgo_ts + 2112, - 34: __ccgo_ts + 2126, - 35: __ccgo_ts + 2137, - 36: __ccgo_ts + 2142, - 37: __ccgo_ts + 2149, - 38: __ccgo_ts + 2160, - 39: __ccgo_ts + 2165, - 40: __ccgo_ts + 2170, - 41: __ccgo_ts + 2176, - 42: __ccgo_ts + 2182, - 43: __ccgo_ts + 2188, - 44: __ccgo_ts + 2191, - 45: __ccgo_ts + 2195, - 46: __ccgo_ts + 2201, - 47: __ccgo_ts + 2212, - 48: __ccgo_ts + 2223, - 49: __ccgo_ts + 2231, - 50: __ccgo_ts + 2240, - 51: __ccgo_ts + 2246, - 52: __ccgo_ts + 2253, - 53: __ccgo_ts + 2261, - 54: __ccgo_ts + 2264, - 55: __ccgo_ts + 2267, - 56: __ccgo_ts + 2270, - 57: __ccgo_ts + 2273, - 58: __ccgo_ts + 2276, - 59: __ccgo_ts + 2279, - 60: __ccgo_ts + 2286, - 61: __ccgo_ts + 2296, - 62: __ccgo_ts + 2309, - 63: __ccgo_ts + 2320, - 64: __ccgo_ts + 2326, - 65: __ccgo_ts + 2333, - 66: __ccgo_ts + 2342, - 67: __ccgo_ts + 2351, - 68: __ccgo_ts + 2358, - 69: __ccgo_ts + 2371, - 70: __ccgo_ts + 2382, - 71: __ccgo_ts + 2387, - 72: __ccgo_ts + 2395, - 73: __ccgo_ts + 2401, - 74: __ccgo_ts + 2408, - 75: __ccgo_ts + 2420, - 76: __ccgo_ts + 2425, - 77: __ccgo_ts + 2434, - 78: __ccgo_ts + 2439, - 79: __ccgo_ts + 2448, - 80: __ccgo_ts + 2453, - 81: __ccgo_ts + 2458, - 82: __ccgo_ts + 2464, - 83: __ccgo_ts + 2472, - 84: __ccgo_ts + 2480, - 85: __ccgo_ts + 2490, - 86: __ccgo_ts + 2498, - 87: __ccgo_ts + 2505, - 88: __ccgo_ts + 2518, - 89: __ccgo_ts + 2523, - 90: __ccgo_ts + 2535, - 91: __ccgo_ts + 2543, - 92: __ccgo_ts + 2550, - 93: __ccgo_ts + 2561, - 94: __ccgo_ts + 2568, - 95: __ccgo_ts + 2575, - 96: __ccgo_ts + 2585, - 97: __ccgo_ts + 2594, - 98: __ccgo_ts + 2605, - 99: __ccgo_ts + 2611, - 100: __ccgo_ts + 2622, - 101: __ccgo_ts + 2632, - 102: __ccgo_ts + 2642, - 103: __ccgo_ts + 2651, - 104: __ccgo_ts + 2658, - 105: __ccgo_ts + 2664, - 106: __ccgo_ts + 2674, - 107: __ccgo_ts + 2685, - 108: __ccgo_ts + 2689, - 109: __ccgo_ts + 2698, - 110: __ccgo_ts + 2707, - 111: __ccgo_ts + 2714, - 112: __ccgo_ts + 2724, - 113: __ccgo_ts + 2731, - 114: __ccgo_ts + 2741, - 115: __ccgo_ts + 2749, - 116: __ccgo_ts + 2756, - 117: __ccgo_ts + 2770, - 118: __ccgo_ts + 2784, - 119: __ccgo_ts + 2792, - 120: __ccgo_ts + 2803, - 121: __ccgo_ts + 2816, - 122: __ccgo_ts + 2827, - 123: __ccgo_ts + 2833, - 124: __ccgo_ts + 2845, - 125: __ccgo_ts + 2854, - 126: __ccgo_ts + 2862, - 127: __ccgo_ts + 2871, - 128: __ccgo_ts + 2880, - 129: __ccgo_ts + 2887, - 130: __ccgo_ts + 2895, - 131: __ccgo_ts + 2902, - 132: __ccgo_ts + 2913, - 133: __ccgo_ts + 2927, - 134: __ccgo_ts + 2938, - 135: __ccgo_ts + 2946, - 136: __ccgo_ts + 2952, - 137: __ccgo_ts + 2960, - 138: __ccgo_ts + 2968, - 139: __ccgo_ts + 2978, - 140: __ccgo_ts + 2991, - 141: __ccgo_ts + 3001, - 142: __ccgo_ts + 3014, - 143: __ccgo_ts + 3023, - 144: __ccgo_ts + 3034, - 145: __ccgo_ts + 3042, - 146: __ccgo_ts + 3048, - 147: __ccgo_ts + 3060, - 148: __ccgo_ts + 3072, - 149: __ccgo_ts + 3080, - 150: __ccgo_ts + 3092, - 151: __ccgo_ts + 3105, - 152: __ccgo_ts + 3115, - 153: __ccgo_ts + 3125, - 154: __ccgo_ts + 3137, - 155: __ccgo_ts + 3142, - 156: __ccgo_ts + 3154, - 157: __ccgo_ts + 3164, - 158: __ccgo_ts + 3170, - 159: __ccgo_ts + 3180, - 160: __ccgo_ts + 3187, - 161: __ccgo_ts + 3199, - 162: __ccgo_ts + 3210, - 163: __ccgo_ts + 3218, - 164: __ccgo_ts + 3227, - 165: __ccgo_ts + 3236, - 166: __ccgo_ts + 3245, - 167: __ccgo_ts + 3252, - 168: __ccgo_ts + 3263, - 169: __ccgo_ts + 3276, - 170: __ccgo_ts + 3286, - 171: __ccgo_ts + 3293, - 172: __ccgo_ts + 3301, - 173: __ccgo_ts + 3310, - 174: __ccgo_ts + 3316, - 175: __ccgo_ts + 3323, - 176: __ccgo_ts + 3331, - 177: __ccgo_ts + 3339, - 178: __ccgo_ts + 3347, - 179: __ccgo_ts + 3357, - 180: __ccgo_ts + 3366, - 181: __ccgo_ts + 3377, - 182: __ccgo_ts + 3388, - 183: __ccgo_ts + 3399, - 184: __ccgo_ts + 3409, - 185: __ccgo_ts + 3415, - 186: __ccgo_ts + 3426, - 187: __ccgo_ts + 3437, - 188: __ccgo_ts + 3442, - 189: __ccgo_ts + 3450, + 0: __ccgo_ts + 1875, + 1: __ccgo_ts + 1885, + 2: __ccgo_ts + 1896, + 3: __ccgo_ts + 1908, + 4: __ccgo_ts + 1919, + 5: __ccgo_ts + 1931, + 6: __ccgo_ts + 1938, + 7: __ccgo_ts + 1946, + 8: __ccgo_ts + 1954, + 9: __ccgo_ts + 1959, + 10: __ccgo_ts + 1964, + 11: __ccgo_ts + 1970, + 12: __ccgo_ts + 1984, + 13: __ccgo_ts + 1990, + 14: __ccgo_ts + 2000, + 15: __ccgo_ts + 2005, + 16: __ccgo_ts + 2010, + 17: __ccgo_ts + 2013, + 18: __ccgo_ts + 2019, + 19: __ccgo_ts + 2026, + 20: __ccgo_ts + 2030, + 21: __ccgo_ts + 2040, + 22: __ccgo_ts + 2047, + 23: __ccgo_ts + 2054, + 24: __ccgo_ts + 2061, + 25: __ccgo_ts + 2068, + 26: __ccgo_ts + 2078, + 27: __ccgo_ts + 2087, + 28: __ccgo_ts + 2098, + 29: __ccgo_ts + 2107, + 30: __ccgo_ts + 2113, + 31: __ccgo_ts + 2123, + 32: __ccgo_ts + 2133, + 33: __ccgo_ts + 2138, + 34: __ccgo_ts + 2152, + 35: __ccgo_ts + 2163, + 36: __ccgo_ts + 2168, + 37: __ccgo_ts + 2175, + 38: __ccgo_ts + 2186, + 39: __ccgo_ts + 2191, + 40: __ccgo_ts + 2196, + 41: __ccgo_ts + 2202, + 42: __ccgo_ts + 2208, + 43: __ccgo_ts + 2214, + 44: __ccgo_ts + 2217, + 45: __ccgo_ts + 2221, + 46: __ccgo_ts + 2227, + 47: __ccgo_ts + 2238, + 48: __ccgo_ts + 2249, + 49: __ccgo_ts + 2257, + 50: __ccgo_ts + 2266, + 51: __ccgo_ts + 2272, + 52: __ccgo_ts + 2279, + 53: __ccgo_ts + 2287, + 54: __ccgo_ts + 2290, + 55: __ccgo_ts + 2293, + 56: __ccgo_ts + 2296, + 57: __ccgo_ts + 2299, + 58: __ccgo_ts + 2302, + 59: __ccgo_ts + 2305, + 60: __ccgo_ts + 2312, + 61: __ccgo_ts + 2322, + 62: __ccgo_ts + 2335, + 63: __ccgo_ts + 2346, + 64: __ccgo_ts + 2352, + 65: __ccgo_ts + 2359, + 66: __ccgo_ts + 2368, + 67: __ccgo_ts + 2377, + 68: __ccgo_ts + 2384, + 69: __ccgo_ts + 2397, + 70: __ccgo_ts + 2408, + 71: __ccgo_ts + 2413, + 72: __ccgo_ts + 2421, + 73: __ccgo_ts + 2427, + 74: __ccgo_ts + 2434, + 75: __ccgo_ts + 2446, + 76: __ccgo_ts + 2451, + 77: __ccgo_ts + 2460, + 78: __ccgo_ts + 2465, + 79: __ccgo_ts + 2474, + 80: __ccgo_ts + 2479, + 81: __ccgo_ts + 2484, + 82: __ccgo_ts + 2490, + 83: __ccgo_ts + 2498, + 84: __ccgo_ts + 2506, + 85: __ccgo_ts + 2516, + 86: __ccgo_ts + 2524, + 87: __ccgo_ts + 2531, + 88: __ccgo_ts + 2544, + 89: __ccgo_ts + 2549, + 90: __ccgo_ts + 2561, + 91: __ccgo_ts + 2569, + 92: __ccgo_ts + 2576, + 93: __ccgo_ts + 2587, + 94: __ccgo_ts + 2594, + 95: __ccgo_ts + 2601, + 96: __ccgo_ts + 2611, + 97: __ccgo_ts + 2620, + 98: __ccgo_ts + 2631, + 99: __ccgo_ts + 2637, + 100: __ccgo_ts + 2648, + 101: __ccgo_ts + 2658, + 102: __ccgo_ts + 2668, + 103: __ccgo_ts + 2677, + 104: __ccgo_ts + 2684, + 105: __ccgo_ts + 2690, + 106: __ccgo_ts + 2700, + 107: __ccgo_ts + 2711, + 108: __ccgo_ts + 2715, + 109: __ccgo_ts + 2724, + 110: __ccgo_ts + 2733, + 111: __ccgo_ts + 2740, + 112: __ccgo_ts + 2750, + 113: __ccgo_ts + 2757, + 114: __ccgo_ts + 2767, + 115: __ccgo_ts + 2775, + 116: __ccgo_ts + 2782, + 117: __ccgo_ts + 2796, + 118: __ccgo_ts + 2810, + 119: __ccgo_ts + 2818, + 120: __ccgo_ts + 2829, + 121: __ccgo_ts + 2842, + 122: __ccgo_ts + 2853, + 123: __ccgo_ts + 2859, + 124: __ccgo_ts + 2871, + 125: __ccgo_ts + 2880, + 126: __ccgo_ts + 2888, + 127: __ccgo_ts + 2897, + 128: __ccgo_ts + 2906, + 129: __ccgo_ts + 2913, + 130: __ccgo_ts + 2921, + 131: __ccgo_ts + 2928, + 132: __ccgo_ts + 2939, + 133: __ccgo_ts + 2953, + 134: __ccgo_ts + 2964, + 135: __ccgo_ts + 2972, + 136: __ccgo_ts + 2978, + 137: __ccgo_ts + 2986, + 138: __ccgo_ts + 2994, + 139: __ccgo_ts + 3004, + 140: __ccgo_ts + 3017, + 141: __ccgo_ts + 3027, + 142: __ccgo_ts + 3040, + 143: __ccgo_ts + 3049, + 144: __ccgo_ts + 3060, + 145: __ccgo_ts + 3068, + 146: __ccgo_ts + 3074, + 147: __ccgo_ts + 3086, + 148: __ccgo_ts + 3098, + 149: __ccgo_ts + 3106, + 150: __ccgo_ts + 3118, + 151: __ccgo_ts + 3131, + 152: __ccgo_ts + 3141, + 153: __ccgo_ts + 3151, + 154: __ccgo_ts + 3163, + 155: __ccgo_ts + 3168, + 156: __ccgo_ts + 3180, + 157: __ccgo_ts + 3190, + 158: __ccgo_ts + 3196, + 159: __ccgo_ts + 3206, + 160: __ccgo_ts + 3213, + 161: __ccgo_ts + 3225, + 162: __ccgo_ts + 3236, + 163: __ccgo_ts + 3244, + 164: __ccgo_ts + 3253, + 165: __ccgo_ts + 3262, + 166: __ccgo_ts + 3271, + 167: __ccgo_ts + 3278, + 168: __ccgo_ts + 3289, + 169: __ccgo_ts + 3302, + 170: __ccgo_ts + 3312, + 171: __ccgo_ts + 3319, + 172: __ccgo_ts + 3327, + 173: __ccgo_ts + 3336, + 174: __ccgo_ts + 3342, + 175: __ccgo_ts + 3349, + 176: __ccgo_ts + 3357, + 177: __ccgo_ts + 3365, + 178: __ccgo_ts + 3373, + 179: __ccgo_ts + 3383, + 180: __ccgo_ts + 3392, + 181: __ccgo_ts + 3403, + 182: __ccgo_ts + 3414, + 183: __ccgo_ts + 3425, + 184: __ccgo_ts + 3435, + 185: __ccgo_ts + 3441, + 186: __ccgo_ts + 3452, + 187: __ccgo_ts + 3463, + 188: __ccgo_ts + 3468, + 189: __ccgo_ts + 3476, } type Tu_char = uint8 @@ -27237,6 +23844,7 @@ const _kGUARD_EXC_INVALID_OPTIONS = 3 const _kGUARD_EXC_SET_CONTEXT = 4 const _kGUARD_EXC_THREAD_SET_STATE = 5 const _kGUARD_EXC_EXCEPTION_BEHAVIOR_ENFORCE = 6 +const _kGUARD_EXC_SERVICE_PORT_VIOLATION_FATAL = 7 const _kGUARD_EXC_UNGUARDED = 8 const _kGUARD_EXC_INCORRECT_GUARD = 16 const _kGUARD_EXC_IMMOVABLE = 32 @@ -27255,6 +23863,8 @@ const _kGUARD_EXC_SEND_INVALID_VOUCHER = 131072 const _kGUARD_EXC_SEND_INVALID_RIGHT = 262144 const _kGUARD_EXC_RCV_INVALID_NAME = 524288 const _kGUARD_EXC_RCV_GUARDED_DESC = 1048576 +const _kGUARD_EXC_SERVICE_PORT_VIOLATION_NON_FATAL = 1048577 +const _kGUARD_EXC_PROVISIONAL_REPLY_PORT = 1048578 const _kGUARD_EXC_MOD_REFS_NON_FATAL = 2097152 const _kGUARD_EXC_IMMOVABLE_NON_FATAL = 4194304 const _kGUARD_EXC_REQUIRE_REPLY_PORT_SEMANTICS = 8388608 @@ -27651,22 +24261,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -27699,32 +24293,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 - FopenFlags int32 - FfsFlags uint32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -27802,91 +24370,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3460, + FzName: __ccgo_ts + 3486, }, 1: { - FzName: __ccgo_ts + 3465, + FzName: __ccgo_ts + 3491, }, 2: { - FzName: __ccgo_ts + 3471, + FzName: __ccgo_ts + 3497, }, 3: { - FzName: __ccgo_ts + 3478, + FzName: __ccgo_ts + 3504, }, 4: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3511, }, 5: { - FzName: __ccgo_ts + 3490, + FzName: __ccgo_ts + 3516, }, 6: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 7: { - FzName: __ccgo_ts + 3506, + FzName: __ccgo_ts + 3532, }, 8: { - FzName: __ccgo_ts + 3512, + FzName: __ccgo_ts + 3538, }, 9: { - FzName: __ccgo_ts + 3517, + FzName: __ccgo_ts + 3543, }, 10: { - FzName: __ccgo_ts + 3523, + FzName: __ccgo_ts + 3549, }, 11: { - FzName: __ccgo_ts + 3531, + FzName: __ccgo_ts + 3557, }, 12: { - FzName: __ccgo_ts + 3537, + FzName: __ccgo_ts + 3563, }, 13: { - FzName: __ccgo_ts + 3544, + FzName: __ccgo_ts + 3570, }, 14: { - FzName: __ccgo_ts + 3553, + FzName: __ccgo_ts + 3579, }, 15: { - FzName: __ccgo_ts + 3560, + FzName: __ccgo_ts + 3586, }, 16: { - FzName: __ccgo_ts + 3570, + FzName: __ccgo_ts + 3596, }, 17: { - FzName: __ccgo_ts + 3577, + FzName: __ccgo_ts + 3603, }, 18: { - FzName: __ccgo_ts + 3591, + FzName: __ccgo_ts + 3617, }, 19: { - FzName: __ccgo_ts + 3597, + FzName: __ccgo_ts + 3623, }, 20: { - FzName: __ccgo_ts + 3603, + FzName: __ccgo_ts + 3629, }, 21: { - FzName: __ccgo_ts + 3610, + FzName: __ccgo_ts + 3636, }, 22: { - FzName: __ccgo_ts + 3618, + FzName: __ccgo_ts + 3644, }, 23: { - FzName: __ccgo_ts + 3623, + FzName: __ccgo_ts + 3649, }, 24: { - FzName: __ccgo_ts + 3630, + FzName: __ccgo_ts + 3656, }, 25: { - FzName: __ccgo_ts + 3637, + FzName: __ccgo_ts + 3663, }, 26: { - FzName: __ccgo_ts + 3649, + FzName: __ccgo_ts + 3675, }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -27946,7 +24514,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -27984,10 +24552,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -28123,9 +24691,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3670, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3696, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3713, O_RDONLY, libc.Int32FromUint16(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3739, O_RDONLY, libc.Int32FromUint16(m)) < 0 { break } } @@ -28361,48 +24929,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr - FsharedByte uint64 -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -28446,7 +24972,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1665 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3723, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3749, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -28474,7 +25000,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< int32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3809, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3836, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -29192,7 +25718,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -29655,13 +26181,6 @@ type TafpLockingContext = struct { type afpLockingContext = TafpLockingContext -type TafpLockingContext1 = struct { - Freserved int32 - FdbPath uintptr -} - -type afpLockingContext1 = TafpLockingContext1 - type TByteRangeLockPB2 = struct { Foffset uint64 Flength uint64 @@ -29848,7 +26367,7 @@ func _afpLock(tls *libc.TLS, id uintptr, eFileLock int32) (r int32) { */ if eFileLock == int32(SHARED_LOCK) { lrc1Errno = 0 - mask = libc.Int64FromUint32(0xffffffff) | libc.Int64FromInt32(0x7fffffff)< 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -30409,7 +26928,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3577, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3603, bp, int32(42579)) } // C documentation @@ -30446,7 +26965,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -30998,7 +27428,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -31061,7 +27491,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -31294,7 +27724,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*int32)(unsafe.Pointer(bp + 144)) = 0 if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1665, int32(1), bp+144) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -32334,10 +28763,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3952, - 3: __ccgo_ts + 3961, - 4: __ccgo_ts + 3970, - 5: __ccgo_ts + 1678, + 2: __ccgo_ts + 3978, + 3: __ccgo_ts + 3987, + 4: __ccgo_ts + 3996, + 5: __ccgo_ts + 1704, } // C documentation @@ -32346,8 +28775,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3975) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3989) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+4001) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+4015) } // C documentation @@ -32409,7 +28838,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = 0 - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3996, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4022, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -32581,7 +29010,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4013) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4039) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -32738,7 +29167,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3460, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3486, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -32774,13 +29203,13 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } if libc.Xfstatfs(tls, fd, bp) == -int32(1) { _storeLastErrno(tls, p, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - _robust_close(tls, p, fd, int32(45048)) + _robust_close(tls, p, fd, int32(45308)) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(13)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+144, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(1026)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3649, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3675, zIn, int32(45510)) return } (*(*[1026]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -33052,14 +29471,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if int32(*(*int8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3478, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3504, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*int8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = 0 if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)< uint64(PATH_MAX) || pathLen < uint64(6) || libc.Xstrlcpy(tls, bp+uintptr(pathLen-uint64(5)), __ccgo_ts+4106, uint64(6)) != uint64(5) { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4112, libc.VaList(bp+2144, libc.Int32FromUint64(pathLen))) + if pathLen > uint64(PATH_MAX) || pathLen < uint64(6) || libc.Xstrlcpy(tls, bp+uintptr(pathLen-uint64(5)), __ccgo_ts+4132, uint64(6)) != uint64(5) { + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4138, libc.VaList(bp+2144, libc.Int32FromUint64(pathLen))) goto end_breaklock } /* read the conch content */ readLen = libc.Uint64FromInt64((*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(9)].FpCurrent})))(tls, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, bp+1024, libc.Uint64FromInt32(libc.Int32FromInt32(PROXY_HEADERLEN)+libc.Int32FromInt32(PROXY_HOSTIDLEN)+libc.Int32FromInt32(PATH_MAX)), 0)) if readLen < libc.Uint64FromInt32(libc.Int32FromInt32(PROXY_HEADERLEN)+libc.Int32FromInt32(PROXY_HOSTIDLEN)) { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4132, libc.VaList(bp+2144, libc.Int32FromUint64(readLen))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4158, libc.VaList(bp+2144, libc.Int32FromUint64(readLen))) goto end_breaklock } /* write it out to the temporary break file */ fd = _robust_open(tls, bp, libc.Int32FromInt32(O_RDWR)|libc.Int32FromInt32(O_CREAT)|libc.Int32FromInt32(O_EXCL)|libc.Int32FromInt32(O_NOFOLLOW), uint16(0)) if fd < 0 { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4152, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4178, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) goto end_breaklock } if (*(*func(*libc.TLS, int32, uintptr, Tsize_t, Toff_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(12)].FpCurrent})))(tls, fd, bp+1024, readLen, 0) != libc.Int64FromUint64(readLen) { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4171, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4197, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) goto end_breaklock } if libc.Xrename(tls, bp, cPath) != 0 { - Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4189, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) + Xsqlite3_snprintf(tls, int32(64), bp+2065, __ccgo_ts+4215, libc.VaList(bp+2144, *(*int32)(unsafe.Pointer(libc.X__error(tls))))) goto end_breaklock } rc = 0 - libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4208, libc.VaList(bp+2144, cPath)) - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, int32(45977)) + libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4234, libc.VaList(bp+2144, cPath)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(conchFile)).Fh, int32(46237)) (*TunixFile)(unsafe.Pointer(conchFile)).Fh = fd (*TunixFile)(unsafe.Pointer(conchFile)).FopenFlags = libc.Int32FromInt32(O_RDWR) | libc.Int32FromInt32(O_CREAT) goto end_breaklock @@ -33719,9 +30124,9 @@ end_breaklock: if rc != 0 { if fd >= 0 { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, bp) - _robust_close(tls, pFile, fd, int32(45985)) + _robust_close(tls, pFile, fd, int32(46245)) } - libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4232, libc.VaList(bp+2144, cPath, bp+2065)) + libc.Xfprintf(tls, libc.X__stderrp, __ccgo_ts+4258, libc.VaList(bp+2144, cPath, bp+2065)) } return rc } @@ -33942,14 +30347,14 @@ func _proxyTakeConch(tls *libc.TLS, pFile uintptr) (r int32) { ; if rc == SQLITE_OK && (*TunixFile)(unsafe.Pointer(pFile)).FopenFlags != 0 { if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(46238)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(46498)) } (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) fd = _robust_open(tls, (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FdbPath, (*TunixFile)(unsafe.Pointer(pFile)).FopenFlags, uint16(0)) if fd >= 0 { (*TunixFile)(unsafe.Pointer(pFile)).Fh = fd } else { - rc = _sqlite3CantopenError(tls, int32(46246)) /* SQLITE_BUSY? proxyTakeConch called + rc = _sqlite3CantopenError(tls, int32(46506)) /* SQLITE_BUSY? proxyTakeConch called during locking */ } } @@ -34072,7 +30477,7 @@ func _proxyCreateConchPathname(tls *libc.TLS, dbPath uintptr, pConchPath uintptr i++ } /* append the "-conch" suffix to the file */ - libc.X__builtin___memcpy_chk(tls, conchPath+uintptr(i+int32(1)), __ccgo_ts+4270, uint64(7), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, conchPath+uintptr(i+int32(1)), __ccgo_ts+4296, uint64(7), ^t__predefined_size_t(0)) return SQLITE_OK } @@ -34092,7 +30497,7 @@ func _switchLockProxyPath(tls *libc.TLS, pFile uintptr, path uintptr) (r int32) return int32(SQLITE_BUSY) } /* nothing to do if the path is NULL, :auto: or matches the existing path */ - if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4059) != 0) || oldPath != 0 && !(libc.Xstrncmp(tls, oldPath, path, uint64(PATH_MAX)) != 0) { + if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4085) != 0) || oldPath != 0 && !(libc.Xstrncmp(tls, oldPath, path, uint64(PATH_MAX)) != 0) { return SQLITE_OK } else { lockProxy = (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxy @@ -34131,7 +30536,7 @@ func _proxyGetDbPathForUnixFile(tls *libc.TLS, pFile uintptr, dbPath uintptr) (r if (*TunixFile)(unsafe.Pointer(pFile)).FpMethod == uintptr(unsafe.Pointer(&_dotlockIoMethods)) { /* dot lock style uses the locking context to store the dot lock ** file path */ - len1 = libc.Int32FromUint64(libc.Xstrlen(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext) - libc.Xstrlen(tls, __ccgo_ts+4277)) + len1 = libc.Int32FromUint64(libc.Xstrlen(tls, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext) - libc.Xstrlen(tls, __ccgo_ts+4303)) libc.X__builtin___memcpy_chk(tls, dbPath, (*TunixFile)(unsafe.Pointer(pFile)).FlockingContext, libc.Uint64FromInt32(len1+int32(1)), ^t__predefined_size_t(0)) } else { /* all other styles use the locking context to store the db file path */ @@ -34166,7 +30571,7 @@ func _proxyTransformUnixFile(tls *libc.TLS, pFile uintptr, path uintptr) (r int3 return int32(SQLITE_BUSY) } _proxyGetDbPathForUnixFile(tls, pFile, bp) - if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4059) != 0) { + if !(path != 0) || int32(*(*int8)(unsafe.Pointer(path))) == int32('\000') || !(libc.Xstrcmp(tls, path, __ccgo_ts+4085) != 0) { lockPath = libc.UintptrFromInt32(0) } else { lockPath = path @@ -34241,7 +30646,7 @@ func _proxyFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int if (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath != 0 { *(*uintptr)(unsafe.Pointer(pArg)) = (*TproxyLockingContext)(unsafe.Pointer(pCtx)).FlockProxyPath } else { - *(*uintptr)(unsafe.Pointer(pArg)) = __ccgo_ts + 4283 + *(*uintptr)(unsafe.Pointer(pArg)) = __ccgo_ts + 4309 } } else { *(*uintptr)(unsafe.Pointer(pArg)) = libc.UintptrFromInt32(0) @@ -34266,7 +30671,7 @@ func _proxyFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int proxyPath = pArg if isProxyStyle != 0 { pCtx1 = (*TunixFile)(unsafe.Pointer(pFile1)).FlockingContext - if !(libc.Xstrcmp(tls, pArg, __ccgo_ts+4059) != 0) || (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath != 0 && !(libc.Xstrncmp(tls, (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath, proxyPath, uint64(PATH_MAX)) != 0) { + if !(libc.Xstrcmp(tls, pArg, __ccgo_ts+4085) != 0) || (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath != 0 && !(libc.Xstrncmp(tls, (*TproxyLockingContext)(unsafe.Pointer(pCtx1)).FlockProxyPath, proxyPath, uint64(PATH_MAX)) != 0) { rc = SQLITE_OK } else { rc = _switchLockProxyPath(tls, pFile1, proxyPath) @@ -34535,55 +30940,55 @@ var _aVfs = [9]Tsqlite3_vfs{ FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4301, + FzName: __ccgo_ts + 4327, }, 1: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4306, + FzName: __ccgo_ts + 4332, }, 2: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4316, + FzName: __ccgo_ts + 4342, }, 3: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 3934, + FzName: __ccgo_ts + 3960, }, 4: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4329, + FzName: __ccgo_ts + 4355, }, 5: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4340, + FzName: __ccgo_ts + 4366, }, 6: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4351, + FzName: __ccgo_ts + 4377, }, 7: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4360, + FzName: __ccgo_ts + 4386, }, 8: { FiVersion: int32(3), FszOsFile: int32(128), FmxPathname: int32(MAX_PATHNAME), - FzName: __ccgo_ts + 4369, + FzName: __ccgo_ts + 4395, }, } @@ -34854,71 +31259,6 @@ type TMemStore = struct { type MemStore = TMemStore -/* Access to a lower-level VFS that (might) implement dynamic loading, -** access to randomness, etc. - */ - -/* Storage for a memdb file. -** -** An memdb object can be shared or separate. Shared memdb objects can be -** used by more than one database connection. Mutexes are used by shared -** memdb objects to coordinate access. Separate memdb objects are only -** connected to a single database connection and do not require additional -** mutexes. -** -** Shared memdb objects have .zFName!=0 and .pMutex!=0. They are created -** using "file:/name?vfs=memdb". The first character of the name must be -** "/" or else the object will be a separate memdb object. All shared -** memdb objects are stored in memdb_g.apMemStore[] in an arbitrary order. -** -** Separate memdb objects are created using a name that does not begin -** with "/" or using sqlite3_deserialize(). -** -** Access rules for shared MemStore objects: -** -** * .zFName is initialized when the object is created and afterwards -** is unchanged until the object is destroyed. So it can be accessed -** at any time as long as we know the object is not being destroyed, -** which means while either the SQLITE_MUTEX_STATIC_VFS1 or -** .pMutex is held or the object is not part of memdb_g.apMemStore[]. -** -** * Can .pMutex can only be changed while holding the -** SQLITE_MUTEX_STATIC_VFS1 mutex or while the object is not part -** of memdb_g.apMemStore[]. -** -** * Other fields can only be changed while holding the .pMutex mutex -** or when the .nRef is less than zero and the object is not part of -** memdb_g.apMemStore[]. -** -** * The .aData pointer has the added requirement that it can can only -** be changed (for resizing) when nMmap is zero. -** - */ -type TMemStore1 = struct { - Fsz Tsqlite3_int64 - FszAlloc Tsqlite3_int64 - FszMax Tsqlite3_int64 - FaData uintptr - FpMutex uintptr - FnMmap int32 - FmFlags uint32 - FnRdLock int32 - FnWrLock int32 - FnRef int32 - FzFName uintptr -} - -type MemStore1 = TMemStore1 - -/* An open file */ -type TMemFile1 = struct { - Fbase Tsqlite3_file - FpStore uintptr - FeLock int32 -} - -type MemFile1 = TMemFile1 - // C documentation // // /* @@ -34947,7 +31287,7 @@ var _memdb_g TMemFS var _memdb_vfs = Tsqlite3_vfs{ FiVersion: int32(2), FmxPathname: int32(1024), - FzName: __ccgo_ts + 4380, + FzName: __ccgo_ts + 4406, } func init() { @@ -35293,7 +31633,7 @@ func _memdbFileControl(tls *libc.TLS, pFile uintptr, op int32, pArg uintptr) (r rc = int32(SQLITE_NOTFOUND) _memdbEnter(tls, p) if op == int32(SQLITE_FCNTL_VFSNAME) { - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4386, libc.VaList(bp+8, (*TMemStore)(unsafe.Pointer(p)).FaData, (*TMemStore)(unsafe.Pointer(p)).Fsz)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4412, libc.VaList(bp+8, (*TMemStore)(unsafe.Pointer(p)).FaData, (*TMemStore)(unsafe.Pointer(p)).Fsz)) rc = SQLITE_OK } if op == int32(SQLITE_FCNTL_SIZE_LIMIT) { @@ -35388,12 +31728,12 @@ func _memdbOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, pFd uintptr, flags i i++ } if p == uintptr(0) { - p = _sqlite3Malloc(tls, uint64(72)+libc.Uint64FromInt32(szName)+uint64(3)) + p = _sqlite3Malloc(tls, uint64(72)+libc.Uint64FromInt64(int64(szName))+uint64(3)) if p == uintptr(0) { Xsqlite3_mutex_leave(tls, pVfsMutex) return int32(SQLITE_NOMEM) } - apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(8)*libc.Uint64FromInt32(_memdb_g.FnMemStore+libc.Int32FromInt32(1))) + apNew = _sqlite3Realloc(tls, _memdb_g.FapMemStore, uint64(8)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(_memdb_g.FnMemStore))) if apNew == uintptr(0) { Xsqlite3_free(tls, p) Xsqlite3_mutex_leave(tls, pVfsMutex) @@ -35468,7 +31808,7 @@ func _memdbFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, bp := tls.Alloc(16) defer tls.Free(16) _ = pVfs - Xsqlite3_snprintf(tls, nOut, zOut, __ccgo_ts+3864, libc.VaList(bp+8, zPath)) + Xsqlite3_snprintf(tls, nOut, zOut, __ccgo_ts+3890, libc.VaList(bp+8, zPath)) return SQLITE_OK } @@ -35615,7 +31955,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp return uintptr(0) } szPage = _sqlite3BtreeGetPageSize(tls, pBt) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4401, libc.VaList(bp+24, zSchema)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4427, libc.VaList(bp+24, zSchema)) if zSql != 0 { v1 = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), bp, uintptr(0)) } else { @@ -35633,7 +31973,7 @@ func Xsqlite3_serialize(tls *libc.TLS, db uintptr, zSchema uintptr, piSize uintp sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) if sz == 0 { Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) - Xsqlite3_exec(tls, db, __ccgo_ts+4424, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4450, uintptr(0), uintptr(0), uintptr(0)) rc = Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == int32(SQLITE_ROW) { sz = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) * int64(szPage) @@ -35696,7 +32036,7 @@ func Xsqlite3_deserialize(tls *libc.TLS, db uintptr, zSchema uintptr, pData uint rc = int32(SQLITE_ERROR) goto end_deserialize } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4449, libc.VaList(bp+16, zSchema)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+4475, libc.VaList(bp+16, zSchema)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -35777,101 +32117,6 @@ func _sqlite3MemdbInit(tls *libc.TLS) (r int32) { return Xsqlite3_vfs_register(tls, uintptr(unsafe.Pointer(&_memdb_vfs)), 0) } -/************** End of memdb.c ***********************************************/ -/************** Begin file bitvec.c ******************************************/ -/* -** 2008 February 16 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements an object that represents a fixed-length -** bitmap. Bits are numbered starting with 1. -** -** A bitmap is used to record which pages of a database file have been -** journalled during a transaction, or which pages have the "dont-write" -** property. Usually only a few pages are meet either condition. -** So the bitmap is usually sparse and has low cardinality. -** But sometimes (for example when during a DROP of a large table) most -** or all of the pages in a database can get journalled. In those cases, -** the bitmap becomes dense with high cardinality. The algorithm needs -** to handle both cases well. -** -** The size of the bitmap is fixed when the object is created. -** -** All bits are clear when the bitmap is created. Individual bits -** may be set or cleared one at a time. -** -** Test operations are about 100 times more common that set operations. -** Clear operations are exceedingly rare. There are usually between -** 5 and 500 set operations per Bitvec object, though the number of sets can -** sometimes grow into tens of thousands or larger. The size of the -** Bitvec object is the number of pages in the database file at the -** start of a transaction, and is thus usually less than a few thousand, -** but can be as large as 2 billion for a really big database. - */ -/* #include "sqliteInt.h" */ - -/* Size of the Bitvec structure in bytes. */ - -/* Round the union size down to the nearest pointer boundary, since that's how -** it will be aligned within the Bitvec struct. */ - -/* Type of the array "element" for the bitmap representation. -** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE. -** Setting this to the "natural word" size of your CPU may improve -** performance. */ -/* Size, in bits, of the bitmap element. */ -/* Number of elements in a bitmap array. */ -/* Number of bits in the bitmap array. */ - -/* Number of u32 values in hash table. */ -/* Maximum number of entries in hash table before -** sub-dividing and re-hashing. */ -/* Hashing function for the aHash representation. -** Empirical testing showed that the *37 multiplier -** (an arbitrary prime)in the hash function provided -** no fewer collisions than the no-op *1. */ - -/* -** A bitmap is an instance of the following structure. -** -** This bitmap records the existence of zero or more bits -** with values between 1 and iSize, inclusive. -** -** There are three possible representations of the bitmap. -** If iSize<=BITVEC_NBIT, then Bitvec.u.aBitmap[] is a straight -** bitmap. The least significant bit is bit 1. -** -** If iSize>BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -36009,7 +32254,13 @@ bitvec_set_rehash: } else { libc.X__builtin___memcpy_chk(tls, aiValues, p+16, uint64(496), ^t__predefined_size_t(0)) libc.X__builtin___memset_chk(tls, p+16, 0, uint64(496), ^t__predefined_size_t(0)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -36063,7 +32314,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.X__builtin___memcpy_chk(tls, aiValues, p+16, uint64(496), ^t__predefined_size_t(0)) @@ -36107,7 +32358,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -36182,7 +32433,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -36236,7 +32487,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -36270,66 +32521,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -36503,14 +32694,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.X__builtin___memset_chk(tls, p, 0, uint64(80), ^t__predefined_size_t(0)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -37326,123 +33517,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -37523,7 +33597,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -37617,7 +33691,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -37658,7 +33732,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -37786,7 +33860,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) } else { return _sqlite3HeapNearlyFull(tls) } @@ -37806,17 +33880,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -37834,7 +33910,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -37846,7 +33922,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -38047,10 +34123,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -38636,25 +34713,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -39616,258 +35674,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -39966,7 +35772,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -40195,7 +36001,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -40213,7 +36019,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -40786,6 +36592,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -41432,7 +37247,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -41444,7 +37260,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -41465,11 +37281,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -41498,7 +37315,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -41731,7 +37548,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -41868,7 +37685,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -41884,7 +37701,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -42631,10 +38448,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -43535,7 +39352,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -43579,7 +39396,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -43610,7 +39427,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -43661,7 +39478,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -43696,7 +39513,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.X__builtin___memcpy_chk(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname), ^t__predefined_size_t(0)) pPtr += uintptr(nPathname) - libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4491, uint64(8), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4517, uint64(8), ^t__predefined_size_t(0)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -43706,7 +39523,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.X__builtin___memcpy_chk(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname), ^t__predefined_size_t(0)) pPtr += uintptr(nPathname) - libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4500, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pPtr, __ccgo_ts+4526, uint64(4), ^t__predefined_size_t(0)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -43748,8 +39565,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4505, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4512, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4531, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4538, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -43832,7 +39649,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -44088,7 +39905,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -44263,7 +40080,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -44294,7 +40111,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -44366,7 +40183,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -45426,7 +41243,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -45723,7 +41540,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -45991,7 +41808,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4522, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4548, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -46555,9 +42372,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -46572,227 +42389,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -46811,28 +42407,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -46891,7 +42466,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -46903,7 +42478,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -46992,6 +42567,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -47259,14 +42835,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -47433,7 +43001,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -47521,12 +43089,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -47660,7 +43228,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -48101,10 +43669,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -48202,7 +43770,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -48241,7 +43809,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = *(*Tu32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -48254,7 +43822,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -48270,7 +43838,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -48291,7 +43859,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -48357,7 +43925,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -48407,7 +43975,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4577, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4603, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -48622,7 +44190,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -48648,7 +44223,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -49371,8 +44946,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -49459,7 +45034,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -49605,7 +45180,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -49632,7 +45207,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -49641,6 +45216,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -49685,6 +45261,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -49956,7 +45535,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -50137,7 +45716,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -50146,7 +45725,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -50198,14 +45777,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -50751,283 +46330,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -51160,27 +46462,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -51343,10 +46624,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -51355,14 +46637,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -52062,11 +47344,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -52240,7 +47522,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -52253,12 +47535,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -52302,7 +47584,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -52310,7 +47592,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -52498,7 +47780,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -52531,7 +47813,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -52730,7 +48012,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -52770,12 +48052,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -52783,21 +48065,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.X__builtin___memmove_chk(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz)), ^t__predefined_size_t(0)) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -52844,12 +48126,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -52865,7 +48147,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -52925,7 +48207,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -52942,14 +48224,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -52992,11 +48274,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -53010,7 +48292,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -53063,42 +48345,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -53106,70 +48386,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -53215,7 +48495,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -53241,7 +48521,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -53280,12 +48560,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -53312,7 +48592,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -53343,11 +48623,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))< iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -53376,11 +48656,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -53389,7 +48669,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -53411,15 +48691,13 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.X__builtin___memset_chk(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr)), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr)), ^t__predefined_size_t(0)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt8(int8(flags)) if flags&int32(PTF_LEAF) == 0 { @@ -53427,14 +48705,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.X__builtin___memset_chk(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4), ^t__predefined_size_t(0)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.X__builtin___memset_chk(tls, data+uintptr(hdr+int32(1)), 0, uint64(4), ^t__predefined_size_t(0)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -53542,7 +48820,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -53604,7 +48882,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -53692,7 +48970,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4603) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4629) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -54316,7 +49594,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -54478,7 +49756,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4612, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4638, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -54516,7 +49794,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -54957,7 +50235,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -54981,7 +50259,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -54990,7 +50268,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -55004,7 +50282,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -55034,7 +50312,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -55130,7 +50408,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -55168,7 +50446,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -55235,7 +50513,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -55278,7 +50556,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -55308,7 +50586,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -55774,7 +51052,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -56166,7 +51444,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -56176,7 +51454,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -56207,7 +51485,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -56233,7 +51511,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -56307,7 +51585,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -56442,7 +51720,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -56454,7 +51732,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -56570,7 +51848,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -56584,7 +51862,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -56818,7 +52096,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -56902,7 +52180,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -56914,7 +52192,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -57116,7 +52394,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -57149,7 +52427,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -57158,7 +52436,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -57287,7 +52565,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -57397,7 +52675,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -57485,7 +52763,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -57540,7 +52818,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -57566,7 +52844,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -57593,7 +52871,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -57664,7 +52942,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -57802,7 +53080,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -57853,7 +53131,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -57862,7 +53140,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -57952,7 +53230,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -57970,7 +53248,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -57993,7 +53271,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -58214,10 +53492,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -58508,17 +53786,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -58608,12 +53875,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -58621,7 +53888,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.X__builtin___memmove_chk(tls, pData, pCell, uint64(sz), ^t__predefined_size_t(0)) i++ @@ -58716,7 +53983,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.X__builtin___memmove_chk(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz), ^t__predefined_size_t(0)) @@ -58797,7 +54064,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -58824,7 +54091,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -58864,7 +54131,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.X__builtin___memmove_chk(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2)), ^t__predefined_size_t(0)) nCell -= nShift @@ -58935,7 +54202,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -58980,7 +54247,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -59176,10 +54443,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -59302,8 +54570,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -59343,7 +54611,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -59366,7 +54634,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.X__builtin___memset_chk(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow)), ^t__predefined_size_t(0)) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -59497,7 +54765,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -59540,7 +54808,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -59599,7 +54867,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -59631,7 +54899,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -59861,7 +55129,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -60107,7 +55375,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -60180,7 +55448,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -60339,7 +55607,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -60370,7 +55638,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -60455,7 +55723,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -60547,7 +55815,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -60583,7 +55851,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -60613,10 +55881,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.X__builtin___memcpy_chk(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8))), ^t__predefined_size_t(0)) return SQLITE_OK @@ -60734,12 +56002,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.X__builtin___memcpy_chk(tls, aOut, aIn, uint64(nIn), ^t__predefined_size_t(0)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -60749,14 +56017,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -60856,21 +56124,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx))))< _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -61115,7 +56383,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -61196,14 +56464,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -61340,7 +56608,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -61605,7 +56873,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4616, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4642, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -61653,11 +56921,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4618, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4644, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4641, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4667, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -61683,11 +56951,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4771, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4797, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -61759,11 +57027,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4810 + v2 = __ccgo_ts + 4836 } else { - v2 = __ccgo_ts + 4815 + v2 = __ccgo_ts + 4841 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4836, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4862, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -61899,12 +57167,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4862 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4888 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4880, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4906, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5034, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5060, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5064, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5090, 0) doCoverageCheck = 0 goto _4 } @@ -61989,7 +57257,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5088, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5114, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -62012,7 +57280,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5112, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5138, 0) depth = d2 } } else { @@ -62089,7 +57357,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5137, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5163, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -62103,7 +57371,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5174, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5200, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -62194,7 +57462,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 5226 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 5252 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -62218,11 +57486,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+5237, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+5263, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5282, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+5308, 0) } } } @@ -62259,10 +57527,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+5337, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5363, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5357, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5383, libc.VaList(bp+248, i)) } goto _3 _3: @@ -62392,14 +57660,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -62610,45 +57878,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -62701,7 +57930,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3864, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -62711,7 +57940,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5389, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5415, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -62740,7 +57969,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5409, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5435, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -62770,7 +57999,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5440, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5466, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -63446,7 +58675,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5480, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5506, libc.VaList(bp+40, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -63584,9 +58813,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -63761,20 +58987,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) - libc.X__builtin___memset_chk(tls, bp+56, 0, uint64(56), ^t__predefined_size_t(0)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp+48, 0, uint64(56), ^t__predefined_size_t(0)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.X__builtin___memcpy_chk(tls, pMem, bp+56, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pMem, bp+48, uint64(56), ^t__predefined_size_t(0)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -63789,10 +59015,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -64251,7 +59477,7 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) @@ -64264,8 +59490,8 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -64424,7 +59650,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -64466,11 +59692,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -64480,7 +59706,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -64502,12 +59728,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -64546,7 +59772,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -64658,8 +59884,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -64710,7 +59936,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -64718,8 +59945,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -64776,14 +60003,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -64797,7 +60024,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -64822,14 +60049,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3864, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -64929,7 +60156,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5487 + zNeg = __ccgo_ts + 5513 } } } @@ -64944,7 +60171,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5489, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5515, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -65248,7 +60475,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -65264,7 +60491,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -65274,7 +60501,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -65325,9 +60552,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -65401,7 +60628,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.X__builtin___memset_chk(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136), ^t__predefined_size_t(0)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -65735,12 +60962,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -65914,7 +61140,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -65931,7 +61157,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -65999,8 +61225,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -66013,11 +61239,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -66054,13 +61280,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -66091,7 +61320,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -66593,7 +61822,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5494, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5520, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -66606,39 +61835,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1665 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5499) == 0 { - zColl = __ccgo_ts + 5506 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5525) == 0 { + zColl = __ccgo_ts + 5532 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5487 + v3 = __ccgo_ts + 5513 } else { v3 = __ccgo_ts + 1665 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5508 + v4 = __ccgo_ts + 5534 } else { v4 = __ccgo_ts + 1665 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5511, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5537, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5545, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5535, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5561, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5544, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5570, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5544, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5570, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1426, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5551, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5577, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1393, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -66655,14 +61884,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1666 } else { - zP4 = __ccgo_ts + 5554 + zP4 = __ccgo_ts + 5580 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5561, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5587, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -66677,20 +61906,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5569, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5595, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5574, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5600, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5576 + zP4 = __ccgo_ts + 5602 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5584, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5610, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -66704,10 +61933,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5521, - 1: __ccgo_ts + 5523, - 2: __ccgo_ts + 5525, - 3: __ccgo_ts + 5530, + 0: __ccgo_ts + 5547, + 1: __ccgo_ts + 5549, + 2: __ccgo_ts + 5551, + 3: __ccgo_ts + 5556, } // C documentation @@ -67504,7 +62733,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -67523,7 +62752,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -67531,7 +62760,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -67658,7 +62887,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5600, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5626, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -67666,18 +62895,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5612, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5638, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5626, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5652, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5641, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5667, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -67908,7 +63137,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -69296,7 +64525,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -69331,7 +64560,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -69385,7 +64614,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -69517,7 +64746,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -69669,7 +64898,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -69700,7 +64929,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -69851,15 +65080,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5684 + zContext = __ccgo_ts + 5710 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5703 + zContext = __ccgo_ts + 5729 } else { - zContext = __ccgo_ts + 5722 + zContext = __ccgo_ts + 5748 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5731, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5757, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -69954,10 +65183,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -69966,9 +65196,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -70048,7 +65278,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5767, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5793, 0) return int32(1) } else { return 0 @@ -70058,7 +65288,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5812, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5838, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -70116,7 +65346,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -70443,12 +65673,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -70465,29 +65695,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -70517,13 +65751,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -70535,11 +65771,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -70547,23 +65787,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -70619,7 +65865,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5852, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5878, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -70820,7 +66066,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -70950,7 +66196,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -71119,6 +66365,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -71132,7 +66380,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -71170,13 +66418,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -71410,18 +66658,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5875, - 1: __ccgo_ts + 5880, - 2: __ccgo_ts + 5887, - 3: __ccgo_ts + 5890, - 4: __ccgo_ts + 5893, - 5: __ccgo_ts + 5896, - 6: __ccgo_ts + 5899, - 7: __ccgo_ts + 5902, - 8: __ccgo_ts + 5910, - 9: __ccgo_ts + 5913, - 10: __ccgo_ts + 5920, - 11: __ccgo_ts + 5928, + 0: __ccgo_ts + 5901, + 1: __ccgo_ts + 5906, + 2: __ccgo_ts + 5913, + 3: __ccgo_ts + 5916, + 4: __ccgo_ts + 5919, + 5: __ccgo_ts + 5922, + 6: __ccgo_ts + 5925, + 7: __ccgo_ts + 5928, + 8: __ccgo_ts + 5936, + 9: __ccgo_ts + 5939, + 10: __ccgo_ts + 5946, + 11: __ccgo_ts + 5954, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -71676,14 +66924,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5935, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5961, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -71721,7 +66969,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -71731,7 +66979,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -71742,24 +66990,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -71807,7 +67059,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -71815,32 +67069,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -72257,11 +67517,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -72270,7 +67530,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -72284,7 +67544,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -72319,7 +67579,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -72354,7 +67614,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -72420,11 +67680,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -72447,7 +67707,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -72469,7 +67729,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -72596,7 +67856,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5975, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6001, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -72634,7 +67894,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1426, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5480, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5506, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -72649,28 +67909,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5979, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6005, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5986, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6012, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5999, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6025, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6002, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6028, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6007, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6033, int32(1)) } } } @@ -72834,9 +68094,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -72862,12 +68122,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -72876,28 +68134,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.X__builtin___memset_chk(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40), ^t__predefined_size_t(0)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -73288,12 +68546,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -73310,7 +68568,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -73328,7 +68586,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -74042,19 +69300,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+6043, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+6069, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+6064, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+6090, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+6071, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+6097, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -75268,7 +70526,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -75284,6 +70542,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -75777,7 +71041,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -75880,7 +71144,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+6095, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6119, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+6209, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6233, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -76476,7 +71740,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+6263, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6287, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -76506,12 +71770,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 6318 + v250 = __ccgo_ts + 6342 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6366 + v251 = __ccgo_ts + 6390 } else { - v251 = __ccgo_ts + 6409 + v251 = __ccgo_ts + 6433 } v250 = v251 } @@ -76603,7 +71867,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6450) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6474) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -77687,7 +72951,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, int8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -77714,7 +72978,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -78173,7 +73437,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -78606,7 +73870,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -78936,7 +74200,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -78967,13 +74231,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6495 + zSchema = __ccgo_ts + 6519 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6509, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6533, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -78988,7 +74252,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -79225,7 +74489,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6552, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6576, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -79242,15 +74506,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -79331,11 +74595,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -79547,7 +74811,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -79597,7 +74861,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -79653,7 +74917,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -79732,11 +74996,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6589 + v286 = __ccgo_ts + 6613 } else { - v286 = __ccgo_ts + 6594 + v286 = __ccgo_ts + 6618 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6601, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6625, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -79889,7 +75153,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6653, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6677, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -80051,7 +75315,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6682, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6706, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -80131,12 +75395,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.X__builtin___memset_chk(tls, bp+800, 0, uint64(56), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp+800, 0, uint64(48), ^t__predefined_size_t(0)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -80147,7 +75411,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -80241,7 +75505,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -80269,11 +75533,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -80401,7 +75665,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -80552,7 +75816,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6692, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6716, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -80639,15 +75903,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -81113,11 +76356,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3864 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -81196,14 +76439,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81222,11 +76465,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -81302,7 +76545,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -81316,7 +76559,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3864 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -81583,108 +76826,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -82048,7 +77026,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -82374,8 +77352,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -82389,9 +77367,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -82539,8 +77517,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -82589,18 +77567,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -82734,7 +77713,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -82888,6 +77867,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -84383,57 +79365,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -84730,7 +79661,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -85433,25 +80364,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6999, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+7024, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+7007+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7026+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+7032+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7051+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6495+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6519+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7045+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7070+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7045+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7070+7) == 0 { return int32(1) } } @@ -85490,23 +80421,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -85538,7 +80468,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+7059, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+7084, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -85632,7 +80562,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+7064) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+7089) != 0 { goto _2 } } @@ -85654,57 +80584,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -85749,11 +80666,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7066, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7091, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7070, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7095, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -85762,36 +80679,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7074, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+7099, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -85820,18 +80726,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -85878,15 +80784,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7083, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7108, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7114, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7139, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -85897,8 +80803,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -85938,7 +80844,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+7169, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+7194, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.X__builtin___memset_chk(tls, pExpr+64, 0, uint64(8), ^t__predefined_size_t(0)) return int32(WRC_Prune) @@ -85958,7 +80864,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -85967,7 +80873,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 7204 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 7229 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -85977,26 +80883,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 7213 + v8 = __ccgo_ts + 7238 } else { - v10 = __ccgo_ts + 7228 + v8 = __ccgo_ts + 7253 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7250, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7275, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7263, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7288, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7273, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7298, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7334, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7359, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -86045,8 +80951,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -86120,19 +81026,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 7341 + zIn = __ccgo_ts + 7366 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7369 + zIn = __ccgo_ts + 7394 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7387 + zIn = __ccgo_ts + 7412 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7405 + zIn = __ccgo_ts + 7430 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7448, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -86158,7 +81064,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -86304,7 +81210,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7443, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7468, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -86359,7 +81265,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7460, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7485, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -86383,7 +81289,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7524, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -86397,13 +81303,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -86423,16 +81329,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7560, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7585, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -86443,35 +81346,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7588, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7613, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7631 + zType = __ccgo_ts + 7656 } else { - zType = __ccgo_ts + 7638 + zType = __ccgo_ts + 7663 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7648, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7673, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7676, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7701, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7698, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7723, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7742, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7767, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -86556,7 +81462,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7790, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7815, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -86568,7 +81474,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7801, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7826, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -86614,7 +81520,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -86739,7 +81645,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7812, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7837, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -86774,7 +81680,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7868, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7893, 0) return int32(1) } i = 0 @@ -86812,7 +81718,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7902, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7927, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -86882,7 +81788,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7908, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7933, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -86916,7 +81822,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7969, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7994, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -87229,7 +82135,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8000, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8025, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -87296,7 +82202,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7902) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7927) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -87307,7 +82213,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+8039) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+8064) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -87317,7 +82223,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8045, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8070, 0) return int32(WRC_Abort) } goto _6 @@ -87539,33 +82445,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.X__builtin___memset_chk(tls, bp+88, 0, uint64(56), ^t__predefined_size_t(0)) - libc.X__builtin___memset_chk(tls, bp, 0, uint64(88), ^t__predefined_size_t(0)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.X__builtin___memset_chk(tls, bp, 0, uint64(56), ^t__predefined_size_t(0)) + pSrc = bp + 56 + libc.X__builtin___memset_chk(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80), ^t__predefined_size_t(0)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -87617,7 +82525,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -87825,7 +82733,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -88300,7 +83208,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -88379,7 +83287,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8104, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8129, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -88566,7 +83474,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.X__builtin___memset_chk(tls, pNew, 0, uint64(72), ^t__predefined_size_t(0)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -88724,11 +83632,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 8152 + v2 = __ccgo_ts + 8177 } else { v2 = __ccgo_ts + 1665 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8154, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8179, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -88774,10 +83682,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -88805,7 +83713,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8198, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8223, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -88825,7 +83733,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8232, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8257, libc.VaList(bp+8, p)) } // C documentation @@ -88896,7 +83804,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8282, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8307, libc.VaList(bp+8, pExpr)) } } } @@ -88948,7 +83856,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8302, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8327, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -88981,7 +83889,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8345, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8370, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -89217,12 +84125,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -89364,7 +84266,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -89504,7 +84406,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -89525,27 +84426,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -89591,9 +84485,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -89603,8 +84497,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -89618,7 +84512,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -89669,7 +84563,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -89750,7 +84644,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -89768,7 +84662,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -89849,7 +84743,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8368, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8393, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -89978,7 +84872,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8398, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8423, libc.VaList(bp+8, zObject)) } } @@ -90076,10 +84970,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8421) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8446) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8426) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8451) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -90757,13 +85651,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8432) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8457) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8440) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8465) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8446) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8471) == 0 { return int32(1) } return 0 @@ -90778,32 +85672,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8432, - 1: __ccgo_ts + 8440, - 2: __ccgo_ts + 8446, + 0: __ccgo_ts + 8457, + 1: __ccgo_ts + 8465, + 2: __ccgo_ts + 8471, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -91012,7 +85893,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -91065,7 +85946,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8450, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8475, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -91165,12 +86046,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -91762,7 +86644,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8665) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8690) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -91858,14 +86740,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -91893,9 +86775,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -92028,7 +86910,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -92158,13 +87040,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -92944,7 +87831,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8758, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8783, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -92956,7 +87843,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -92971,7 +87858,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8785, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8810, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -93000,7 +87887,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -93076,7 +87963,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8368, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8393, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -93139,7 +88026,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7151, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -93149,7 +88036,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -93157,7 +88044,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -93170,9 +88057,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -93254,7 +88141,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8809, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8834, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -93325,17 +88212,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -93344,7 +88231,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -93356,6 +88243,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -93375,7 +88283,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -93445,7 +88353,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -93489,7 +88397,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -93562,7 +88470,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -93589,8 +88497,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -93756,7 +88664,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -93965,7 +88875,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -94672,7 +89584,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -94901,10 +89813,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -94942,7 +89854,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -94956,7 +89868,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -94970,10 +89882,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -94983,25 +89898,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8884, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -95014,7 +89933,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -95024,11 +89943,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -95048,13 +89967,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -95124,7 +90043,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -95160,6 +90079,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -95177,44 +90097,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8884, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -95294,7 +90219,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -95302,7 +90227,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -95320,7 +90245,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -95339,11 +90264,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -95461,8 +90386,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8859, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8913, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -95480,10 +90405,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8887, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8941, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9062, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9116, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -95499,9 +90424,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9236, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9290, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9383, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9437, 0) } } @@ -95557,7 +90482,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9534, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9588, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -95566,11 +90491,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9593, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9647, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9599, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9653, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -95600,21 +90525,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9626, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9680, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9810, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9864, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+10115, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10131, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+10169, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10185, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10189, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10243, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -95622,7 +90547,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -95630,7 +90555,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10454, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10508, 0) goto exit_rename_table exit_rename_table: ; @@ -95647,7 +90572,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10467, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10521, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -95687,11 +90612,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10505, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10559, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10537, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10591, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -95707,10 +90632,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10564) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10618) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10623) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10677) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -95722,13 +90647,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10676) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10730) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10722) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10776) } } /* Modify the CREATE TABLE statement. */ @@ -95742,7 +90667,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10749, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10803, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -95770,7 +90695,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10895, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10949, libc.VaList(bp+16, zTab, zDb)) } } } @@ -95808,12 +90733,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11248, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11302, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11282, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11336, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -95828,7 +90753,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -95836,8 +90761,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11312, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11366, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -95898,18 +90823,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 11331 + zType = __ccgo_ts + 11385 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11336 + zType = __ccgo_ts + 11390 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11350 + v1 = __ccgo_ts + 11404 } else { - v1 = __ccgo_ts + 11367 + v1 = __ccgo_ts + 11421 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11385, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11439, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -95956,21 +90881,9 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11403, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11457, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -95986,11 +90899,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11424, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11606, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11478, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11660, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10454, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10508, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -96000,31 +90913,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -96041,16 +90929,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -96353,9 +91231,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -96466,11 +91344,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11737 + v1 = __ccgo_ts + 11791 } else { v1 = __ccgo_ts + 1665 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11739, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11793, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -96541,30 +91419,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11762, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11816, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -96585,9 +91467,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -96603,15 +91484,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11770, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11824, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -96622,16 +91503,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.X__builtin___memcpy_chk(tls, zOut, zSql, libc.Uint64FromInt64(nSql), ^t__predefined_size_t(0)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -96648,21 +91529,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11737 + v1 = __ccgo_ts + 11791 } else { v1 = __ccgo_ts + 1665 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11776, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11830, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.X__builtin___memmove_chk(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)), ^t__predefined_size_t(0)) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.X__builtin___memmove_chk(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)), ^t__predefined_size_t(0)) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.X__builtin___memcpy_chk(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace), ^t__predefined_size_t(0)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -96688,7 +91569,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -96998,7 +91879,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -97265,7 +92146,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.X__builtin___memset_chk(tls, bp+504, 0, uint64(56), ^t__predefined_size_t(0)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -97448,7 +92329,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -97532,8 +92413,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -97549,12 +92431,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.X__builtin___memset_chk(tls, bp+424, 0, uint64(56), ^t__predefined_size_t(0)) @@ -97628,7 +92510,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -97645,7 +92527,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11781, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11835, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -97700,23 +92582,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11403, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11457, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11788 + v1 = __ccgo_ts + 11842 } else { - v1 = __ccgo_ts + 6018 + v1 = __ccgo_ts + 6044 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11800, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11854, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11828, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11882, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -97728,31 +92610,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1665, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11876, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11997, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+12051, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -97766,7 +92648,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -97777,8 +92659,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -97839,27 +92721,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12015, + FzName: __ccgo_ts + 12069, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12036, + FzName: __ccgo_ts + 12090, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12056, + FzName: __ccgo_ts + 12110, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12075, + FzName: __ccgo_ts + 12129, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12094, + FzName: __ccgo_ts + 12148, }, } @@ -98070,8 +92952,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12197, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12251, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -98081,10 +92968,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12220, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12274, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12250, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12304, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -98116,15 +93003,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 12117, - FzCols: __ccgo_ts + 12130, + FzName: __ccgo_ts + 12171, + FzCols: __ccgo_ts + 12184, }, 1: { - FzName: __ccgo_ts + 12143, - FzCols: __ccgo_ts + 12156, + FzName: __ccgo_ts + 12197, + FzCols: __ccgo_ts + 12210, }, 2: { - FzName: __ccgo_ts + 12184, + FzName: __ccgo_ts + 12238, }, } @@ -98177,44 +93064,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -98338,7 +93187,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -98354,12 +93204,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -98367,7 +93217,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -98426,7 +93276,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12268, + FzName: __ccgo_ts + 12322, } func init() { @@ -98800,7 +93650,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12278, + FzName: __ccgo_ts + 12332, } func init() { @@ -98850,7 +93700,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12288, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12342, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -98861,7 +93711,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12293, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12347, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -98900,7 +93750,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12299, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12353, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -98918,7 +93768,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12305, + FzName: __ccgo_ts + 12359, } func init() { @@ -98984,7 +93834,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+12314, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12368, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -98993,12 +93843,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.X__builtin___memcpy_chk(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+12117, uint64(13), ^t__predefined_size_t(0)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.X__builtin___memcpy_chk(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+12171, uint64(13), ^t__predefined_size_t(0)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -99120,7 +93970,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -99200,7 +94050,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -99231,7 +94081,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12324, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12378, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -99322,7 +94172,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12324, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12378, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -99359,7 +94209,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -99392,11 +94242,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12328) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12382) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12332) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12386) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -99504,13 +94354,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -99560,17 +94403,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+12336, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12390, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12347, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12401, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12357, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12411, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -99582,13 +94425,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -99639,7 +94475,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -99842,8 +94678,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -99949,11 +94785,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+12143, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+12197, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12369, __ccgo_ts+12438, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12423, __ccgo_ts+12492, zDb) } return rc } @@ -100019,10 +94855,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+12117, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+12171, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12490, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12544, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -100135,7 +94971,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+7059, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+7084, zName) == 0) } // C documentation @@ -100187,11 +95023,11 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4380) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4406) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12531, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12585, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -100222,7 +95058,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12534, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12588, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -100231,7 +95067,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12571, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12625, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -100243,13 +95079,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.X__builtin___memcpy_chk(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2), ^t__predefined_size_t(0)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -100287,7 +95123,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12601, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12655, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -100295,7 +95131,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12630, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12684, 0) rc = int32(SQLITE_ERROR) } } @@ -100342,7 +95178,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1635, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12698, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12752, libc.VaList(bp+56, zFile)) } } } @@ -100404,15 +95240,15 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { i++ } if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12726, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12780, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12747, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12801, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12773, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12827, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -100507,7 +95343,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12795, + FzName: __ccgo_ts + 12849, } func init() { @@ -100529,7 +95365,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12809, + FzName: __ccgo_ts + 12863, } func init() { @@ -100555,7 +95391,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12823, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12877, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -100589,7 +95425,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12847, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12901, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -100716,6 +95552,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -100788,9 +95626,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -100806,7 +95644,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12893, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12947, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -100834,11 +95672,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12916, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12970, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12922, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12976, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12928, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12982, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -100898,7 +95736,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8440 + zCol = __ccgo_ts + 8465 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -100933,7 +95771,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12955, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13009, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -100970,47 +95808,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -101051,7 +95848,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -101149,7 +95946,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -101227,7 +96026,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -101241,7 +96040,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -101354,21 +96155,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+7059) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+7084) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7026+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7045+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6495+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7007) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7051+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7070+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6519+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7032) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7045+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6495) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7070+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6519) } } } @@ -101398,12 +96199,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7045+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6495) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7070+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6519) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7026+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7007) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7051+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7032) } } } @@ -101441,7 +96242,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12970, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+13024, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -101451,7 +96252,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -101459,15 +96260,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12978 + v1 = __ccgo_ts + 13032 } else { - v1 = __ccgo_ts + 12991 + v1 = __ccgo_ts + 13045 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7263, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7288, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7334, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7359, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -101505,12 +96306,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6495+7) == 0 { - return __ccgo_ts + 7045 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6519+7) == 0 { + return __ccgo_ts + 7070 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7007+7) == 0 { - return __ccgo_ts + 7026 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7032+7) == 0 { + return __ccgo_ts + 7051 } } return zName @@ -101634,9 +96435,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -102035,7 +96836,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6495) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6519) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -102067,7 +96868,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+7059, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+7084, zName) { break } goto _1 @@ -102125,13 +96926,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13005, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13059, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13022, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13076, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -102179,8 +96980,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6999, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13042, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7024, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13096, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -102216,23 +97017,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -102352,7 +97155,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -102395,9 +97198,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -102410,7 +97213,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13084, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13138, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -102426,9 +97229,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 11331 + v2 = __ccgo_ts + 11385 } else { - v2 = __ccgo_ts + 9593 + v2 = __ccgo_ts + 9647 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -102438,9 +97241,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 7007 + v3 = __ccgo_ts + 7032 } else { - v3 = __ccgo_ts + 6495 + v3 = __ccgo_ts + 6519 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -102464,11 +97267,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 11331 + v4 = __ccgo_ts + 11385 } else { - v4 = __ccgo_ts + 9593 + v4 = __ccgo_ts + 9647 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13125, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13179, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -102476,11 +97279,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13146, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13200, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -102512,19 +97315,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -102544,15 +97357,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -102567,7 +97385,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -102628,7 +97446,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13181, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13235, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -102637,14 +97455,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+13215, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+13269, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -102676,11 +97496,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -102691,7 +97511,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13235, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13289, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -102701,12 +97521,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+13258, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+13312, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+13265, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+13319, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -102748,21 +97568,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.X__builtin___memcpy_chk(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn), ^t__predefined_size_t(0)) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13275, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13329, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -102773,7 +97582,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.X__builtin___memset_chk(tls, pCol, 0, uint64(16), ^t__predefined_size_t(0)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -102786,12 +97595,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -102963,10 +97781,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13301, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13355, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13346, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13400, 0) } else { libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -103024,7 +97842,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13387, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13441, 0) } } @@ -103052,8 +97870,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -103061,7 +97879,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13439, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13493, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -103080,21 +97898,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -103117,7 +97924,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13480, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13534, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -103145,8 +97952,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -103233,17 +98045,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13590, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13579, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13633, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13587, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13641, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -103275,7 +98087,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13594, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13648, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -103416,9 +98228,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -103429,31 +98242,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { zSep = __ccgo_ts + 1665 - zSep2 = __ccgo_ts + 13625 - zEnd = __ccgo_ts + 5519 + zSep2 = __ccgo_ts + 13679 + zEnd = __ccgo_ts + 5545 } else { - zSep = __ccgo_ts + 13627 - zSep2 = __ccgo_ts + 13631 - zEnd = __ccgo_ts + 13636 + zSep = __ccgo_ts + 13681 + zSep2 = __ccgo_ts + 13685 + zEnd = __ccgo_ts + 13690 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13639, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.X__builtin___memcpy_chk(tls, zStmt, __ccgo_ts+13693, uint64(13), ^t__predefined_size_t(0)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -103464,8 +98277,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.X__builtin___memcpy_chk(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1), ^t__predefined_size_t(0)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -103478,17 +98292,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3864, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.X__builtin___memcpy_chk(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1)), ^t__predefined_size_t(0)) return zStmt } var _azType1 = [6]uintptr{ 0: __ccgo_ts + 1665, - 1: __ccgo_ts + 13653, - 2: __ccgo_ts + 13659, - 3: __ccgo_ts + 13664, - 4: __ccgo_ts + 13669, - 5: __ccgo_ts + 13659, + 1: __ccgo_ts + 13707, + 2: __ccgo_ts + 13713, + 3: __ccgo_ts + 13718, + 4: __ccgo_ts + 13723, + 5: __ccgo_ts + 13713, } // C documentation @@ -103497,15 +98312,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -103520,7 +98336,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.X__builtin___memcpy_chk(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn), ^t__predefined_size_t(0)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -103753,8 +98569,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -103854,7 +98680,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -103867,8 +98693,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -103898,7 +98724,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -104117,9 +98943,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13675, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13729, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13708, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13762, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -104140,11 +98966,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13735, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13789, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13785, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13839, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -104191,7 +99017,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13817, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13871, 0) return } } @@ -104225,16 +99051,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9593 - zType2 = __ccgo_ts + 13861 + zType = __ccgo_ts + 9647 + zType2 = __ccgo_ts + 13915 } else { /* A view */ - zType = __ccgo_ts + 11331 - zType2 = __ccgo_ts + 13867 + zType = __ccgo_ts + 11385 + zType2 = __ccgo_ts + 13921 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -104251,24 +99077,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -104316,13 +99147,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13872, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13926, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13887, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13941, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -104331,15 +99172,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13985, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14039, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14027, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14081, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+14061, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+14115, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -104357,7 +99198,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+10115) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+10169) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -104390,7 +99231,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14082, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14136, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -104407,7 +99248,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11331, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11385, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -104504,7 +99345,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14118, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14172, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -104688,7 +99529,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14148, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14202, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -104701,7 +99542,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14163, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14217, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -104784,9 +99625,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+14230, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+14284, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12220, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12274, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -104827,7 +99668,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14244, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14298, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -104836,7 +99677,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14289, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14343, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -104871,11 +99712,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3485, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3511, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7801, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7826, int32(10)) == 0 { return 0 } return int32(1) @@ -104930,9 +99771,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -104965,18 +99806,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14356, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14410, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14438, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14418, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14472, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -104986,7 +99827,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12332, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12386, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -105034,19 +99875,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14450, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14504, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14513, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14567, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -105103,7 +99944,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14607, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14661, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -105218,11 +100059,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -105244,7 +100085,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -105289,13 +100130,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -105318,23 +100159,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -105363,11 +100204,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14653 + v2 = __ccgo_ts + 14707 } else { - v2 = __ccgo_ts + 14659 + v2 = __ccgo_ts + 14713 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14664, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14718, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -105445,7 +100286,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14692, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14746, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -105455,7 +100296,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14698, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14752, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -105469,16 +100310,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14748, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14776, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14830, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14801, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14855, 0) goto exit_create_index } /* @@ -105499,19 +100340,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14692, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14746, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14835, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14889, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14869, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14923, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -105532,7 +100373,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14893, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14947, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -105550,9 +100391,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7007 + v2 = __ccgo_ts + 7032 } else { - v2 = __ccgo_ts + 6495 + v2 = __ccgo_ts + 6519 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -105580,7 +100421,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14692) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14746) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -105612,7 +100453,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -105664,7 +100505,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14916, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14970, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -105674,7 +100515,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -105684,8 +100525,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -105763,7 +100604,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -105811,7 +100652,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14977, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15031, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -105841,8 +100682,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15019, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15073, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -105855,7 +100696,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -105884,9 +100725,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1665 } else { - v13 = __ccgo_ts + 15036 + v13 = __ccgo_ts + 15090 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+15044, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+15098, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -105894,7 +100735,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15064, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15118, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -105902,7 +100743,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15123, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15177, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -106065,16 +100906,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15150, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15204, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15168, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15222, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -106082,9 +100923,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -106100,8 +100941,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15241, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12328, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15295, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12382, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -106174,12 +101015,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -106291,13 +101132,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15301, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -106378,7 +101219,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -106428,7 +101269,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -106599,11 +101440,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 15337 + v1 = __ccgo_ts + 15391 } else { - v1 = __ccgo_ts + 15340 + v1 = __ccgo_ts + 15394 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15346, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15400, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -106802,7 +101643,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15382, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15436, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -106849,9 +101690,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15388 + v1 = __ccgo_ts + 15442 } else { - v1 = __ccgo_ts + 15397 + v1 = __ccgo_ts + 15451 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -106883,9 +101724,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15382, - 1: __ccgo_ts + 15404, - 2: __ccgo_ts + 15388, + 0: __ccgo_ts + 15436, + 1: __ccgo_ts + 15458, + 2: __ccgo_ts + 15442, } // C documentation @@ -106905,7 +101746,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15412, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15466, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -106930,7 +101771,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12970, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -107361,7 +102202,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15612, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -108243,11 +103082,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15645, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15699, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15674, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15728, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -108351,7 +103190,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -108408,7 +103247,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15748, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15802, -int32(1)) return } if argc == int32(3) { @@ -110127,7 +104971,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15781, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15835, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -110209,7 +105053,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -110281,28 +105125,28 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15826, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15880, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15834, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15888, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -110334,13 +105178,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15842, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15896 + } else { + v2 = __ccgo_ts + 15900 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1666, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.X__builtin___memmove_chk(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n), ^t__predefined_size_t(0)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15903, -int32(1)) + return +} + // C documentation // // /* @@ -110352,6 +105332,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -110362,7 +105346,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -110797,7 +105781,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -110886,7 +105870,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11737, + 0: __ccgo_ts + 11791, } // C documentation @@ -110898,8 +105882,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -110914,7 +105898,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -110926,16 +105910,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.X__builtin___memcpy_chk(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep), ^t__predefined_size_t(0)) j += int64(nSep) } - libc.X__builtin___memcpy_chk(tls, z+uintptr(j), v, libc.Uint64FromInt64(k), ^t__predefined_size_t(0)) - j += k + libc.X__builtin___memcpy_chk(tls, z+uintptr(j), v, libc.Uint64FromInt32(k), ^t__predefined_size_t(0)) + j += int64(k) } } goto _2 @@ -111046,7 +106030,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15845, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15926, int32(4), libc.UintptrFromInt32(0)) } } @@ -111107,7 +106091,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12955, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+13009, -int32(1)) return } if argc == int32(2) { @@ -111138,17 +106122,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -111217,7 +106190,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -111299,7 +106272,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15725, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15779, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -111362,12 +106335,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -111531,7 +106498,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -111542,7 +106509,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -111649,7 +106616,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15850, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15931, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -111678,8 +106645,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15856, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15856, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15937, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15937, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -111859,11 +106826,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -111967,7 +106934,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -111980,542 +106947,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15861, + FzName: __ccgo_ts + 15942, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15881, + FzName: __ccgo_ts + 15962, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15894, + FzName: __ccgo_ts + 15975, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15912, + FzName: __ccgo_ts + 15993, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15921, + FzName: __ccgo_ts + 16002, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15929, + FzName: __ccgo_ts + 16010, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15929, + FzName: __ccgo_ts + 16010, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15944, + FzName: __ccgo_ts + 16025, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15970, + FzName: __ccgo_ts + 16051, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15995, + FzName: __ccgo_ts + 16076, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 16004, + FzName: __ccgo_ts + 16085, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 16015, + FzName: __ccgo_ts + 16096, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 16022, + FzName: __ccgo_ts + 16103, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16036, + FzName: __ccgo_ts + 16117, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16036, + FzName: __ccgo_ts + 16117, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16042, + FzName: __ccgo_ts + 16123, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16042, + FzName: __ccgo_ts + 16123, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 16048, + FzName: __ccgo_ts + 16129, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 16048, + FzName: __ccgo_ts + 16129, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16053, + FzName: __ccgo_ts + 16134, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16053, + FzName: __ccgo_ts + 16134, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16057, + FzName: __ccgo_ts + 16138, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16057, + FzName: __ccgo_ts + 16138, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 16061, + FzName: __ccgo_ts + 16142, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 16068, + FzName: __ccgo_ts + 16149, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 16076, + FzName: __ccgo_ts + 16157, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 16083, + FzName: __ccgo_ts + 16164, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16096, + FzName: __ccgo_ts + 16177, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16102, + FzName: __ccgo_ts + 16183, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16109, + FzName: __ccgo_ts + 16190, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16116, + FzName: __ccgo_ts + 16197, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16124, + FzName: __ccgo_ts + 16205, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16129, + FzName: __ccgo_ts + 16210, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16133, + FzName: __ccgo_ts + 16214, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16133, + FzName: __ccgo_ts + 16214, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16139, + FzName: __ccgo_ts + 16220, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16145, + FzName: __ccgo_ts + 16226, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16151, + FzName: __ccgo_ts + 16232, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16155, + FzName: __ccgo_ts + 16236, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16155, + FzName: __ccgo_ts + 16236, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16161, + FzName: __ccgo_ts + 16242, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16168, + FzName: __ccgo_ts + 16249, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16178, + FzName: __ccgo_ts + 16259, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16185, + FzName: __ccgo_ts + 16266, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16192, + FzName: __ccgo_ts + 16273, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16203, + FzName: __ccgo_ts + 16284, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16210, + FzName: __ccgo_ts + 16291, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16225, + FzName: __ccgo_ts + 16306, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16242, + FzName: __ccgo_ts + 16323, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16253, + FzName: __ccgo_ts + 16334, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16259, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16341, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16277, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16347, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16285, + FzName: __ccgo_ts + 16360, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16299, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16378, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16307, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16386, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16316, + FzName: __ccgo_ts + 16400, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16316, + FzName: __ccgo_ts + 16408, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16323, + FzName: __ccgo_ts + 16417, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16323, + FzName: __ccgo_ts + 16417, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16424, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16424, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16333, + FzName: __ccgo_ts + 16434, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16337, + FzName: __ccgo_ts + 16438, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16343, + FzName: __ccgo_ts + 16444, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16347, + FzName: __ccgo_ts + 16448, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16347, + FzName: __ccgo_ts + 16448, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16353, + FzName: __ccgo_ts + 16454, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16353, + FzName: __ccgo_ts + 16454, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16366, + FzName: __ccgo_ts + 16467, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16377, + FzName: __ccgo_ts + 16478, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15856, + FzName: __ccgo_ts + 15937, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15856, + FzName: __ccgo_ts + 15937, }, - 70: { + 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16382, + FzName: __ccgo_ts + 16483, }, - 71: { + 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1238, }, - 72: { + 74: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1246, }, - 73: { + 75: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16387, + FzName: __ccgo_ts + 16488, }, - 74: { + 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16393, + FzName: __ccgo_ts + 16494, }, - 75: { + 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16396, + FzName: __ccgo_ts + 16497, }, - 76: { + 78: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16400, + FzName: __ccgo_ts + 16501, }, - 77: { + 79: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16406, - }, - 78: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16396, - }, - 79: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16411, + FzName: __ccgo_ts + 16507, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16415, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16497, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16419, + FzName: __ccgo_ts + 16512, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16425, + FzName: __ccgo_ts + 16516, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16429, + FzName: __ccgo_ts + 16520, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16434, + FzName: __ccgo_ts + 16526, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16439, + FzName: __ccgo_ts + 16530, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16444, + FzName: __ccgo_ts + 16535, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16450, + FzName: __ccgo_ts + 16540, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16454, + FzName: __ccgo_ts + 16545, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16458, + FzName: __ccgo_ts + 16551, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16462, + FzName: __ccgo_ts + 16555, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16467, + FzName: __ccgo_ts + 16559, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16472, + FzName: __ccgo_ts + 16563, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16477, + FzName: __ccgo_ts + 16568, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16483, + FzName: __ccgo_ts + 16573, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16489, + FzName: __ccgo_ts + 16578, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16495, + FzName: __ccgo_ts + 16584, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16500, + FzName: __ccgo_ts + 16590, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16508, + FzName: __ccgo_ts + 16596, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16516, + FzName: __ccgo_ts + 16601, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16519, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16609, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16617, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16620, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 7204, + FzName: __ccgo_ts + 7229, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16524, + FzName: __ccgo_ts + 16625, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16528, + FzName: __ccgo_ts + 16629, }, } @@ -112574,109 +107552,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -112900,7 +107880,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -112993,7 +107973,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16531, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16632, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -113817,7 +108797,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -114104,11 +109084,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 7070, + Fz: __ccgo_ts + 7095, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 7066, + Fz: __ccgo_ts + 7091, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -114172,7 +109152,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5654) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5680) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -114188,7 +109168,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -114636,7 +109616,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -114754,7 +109734,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8697, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8722, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -114820,11 +109800,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -115149,7 +110129,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -115163,7 +110143,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -115198,7 +110178,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -115211,7 +110191,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -115338,27 +110318,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -115439,7 +110419,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -115466,7 +110446,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -115475,44 +110455,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16576, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16677, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16617, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16718, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -115534,31 +110498,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16649, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16750, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -115582,10 +110546,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -115626,8 +110590,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -115644,34 +110608,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16657, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16758, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16709, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16810, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -115778,18 +110742,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -115799,13 +110763,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -115816,14 +110780,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -115840,16 +110804,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -115960,11 +110924,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -116023,7 +110987,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16801) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16902) } goto insert_cleanup insert_cleanup: @@ -116146,33 +111110,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -116419,7 +111356,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12916, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12970, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -118653,7 +113270,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16853, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16954, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -118673,19 +113290,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.X__builtin___memcpy_chk(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16857, uint64(6), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16958, uint64(6), ^t__predefined_size_t(0)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16863, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16964, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -118700,14 +113317,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16906, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+17007, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -118731,7 +113348,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16938, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17039, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -118740,7 +113357,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16815, + 0: __ccgo_ts + 16916, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -118809,14 +113426,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -118831,7 +113443,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -118849,7 +113461,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -118864,7 +113476,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -118874,6 +113486,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -118885,7 +113499,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -118897,7 +113511,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -118973,7 +113587,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16975, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+17076, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -119027,63 +113641,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5910, - 1: __ccgo_ts + 17014, - 2: __ccgo_ts + 9593, - 3: __ccgo_ts + 17018, - 4: __ccgo_ts + 17023, - 5: __ccgo_ts + 17026, - 6: __ccgo_ts + 17036, - 7: __ccgo_ts + 17046, - 8: __ccgo_ts + 17052, - 9: __ccgo_ts + 17056, - 10: __ccgo_ts + 17061, - 11: __ccgo_ts + 17066, - 12: __ccgo_ts + 17074, - 13: __ccgo_ts + 17085, - 14: __ccgo_ts + 17088, - 15: __ccgo_ts + 17095, - 16: __ccgo_ts + 17056, - 17: __ccgo_ts + 17061, - 18: __ccgo_ts + 17102, - 19: __ccgo_ts + 17107, - 20: __ccgo_ts + 17110, - 21: __ccgo_ts + 17117, - 22: __ccgo_ts + 17052, - 23: __ccgo_ts + 17056, - 24: __ccgo_ts + 17123, - 25: __ccgo_ts + 17128, - 26: __ccgo_ts + 17133, - 27: __ccgo_ts + 17056, - 28: __ccgo_ts + 17137, - 29: __ccgo_ts + 17061, - 30: __ccgo_ts + 17145, - 31: __ccgo_ts + 17149, - 32: __ccgo_ts + 17154, - 33: __ccgo_ts + 12332, - 34: __ccgo_ts + 12328, - 35: __ccgo_ts + 17160, - 36: __ccgo_ts + 17165, - 37: __ccgo_ts + 17170, - 38: __ccgo_ts + 17014, - 39: __ccgo_ts + 17056, - 40: __ccgo_ts + 17175, - 41: __ccgo_ts + 17182, - 42: __ccgo_ts + 17189, - 43: __ccgo_ts + 9593, - 44: __ccgo_ts + 17197, - 45: __ccgo_ts + 5913, - 46: __ccgo_ts + 17203, - 47: __ccgo_ts + 17014, - 48: __ccgo_ts + 17056, - 49: __ccgo_ts + 17208, - 50: __ccgo_ts + 17213, - 51: __ccgo_ts + 16396, - 52: __ccgo_ts + 17218, - 53: __ccgo_ts + 17231, - 54: __ccgo_ts + 17240, - 55: __ccgo_ts + 17247, - 56: __ccgo_ts + 17258, + 0: __ccgo_ts + 5936, + 1: __ccgo_ts + 17115, + 2: __ccgo_ts + 9647, + 3: __ccgo_ts + 17119, + 4: __ccgo_ts + 17124, + 5: __ccgo_ts + 17127, + 6: __ccgo_ts + 17137, + 7: __ccgo_ts + 17147, + 8: __ccgo_ts + 17153, + 9: __ccgo_ts + 17157, + 10: __ccgo_ts + 17162, + 11: __ccgo_ts + 17167, + 12: __ccgo_ts + 17175, + 13: __ccgo_ts + 17186, + 14: __ccgo_ts + 17189, + 15: __ccgo_ts + 17157, + 16: __ccgo_ts + 17196, + 17: __ccgo_ts + 17162, + 18: __ccgo_ts + 17204, + 19: __ccgo_ts + 17208, + 20: __ccgo_ts + 17213, + 21: __ccgo_ts + 17219, + 22: __ccgo_ts + 17157, + 23: __ccgo_ts + 17162, + 24: __ccgo_ts + 17226, + 25: __ccgo_ts + 17231, + 26: __ccgo_ts + 17234, + 27: __ccgo_ts + 17241, + 28: __ccgo_ts + 17153, + 29: __ccgo_ts + 17157, + 30: __ccgo_ts + 17247, + 31: __ccgo_ts + 17252, + 32: __ccgo_ts + 17257, + 33: __ccgo_ts + 17115, + 34: __ccgo_ts + 17157, + 35: __ccgo_ts + 17261, + 36: __ccgo_ts + 17268, + 37: __ccgo_ts + 17275, + 38: __ccgo_ts + 12386, + 39: __ccgo_ts + 12382, + 40: __ccgo_ts + 17283, + 41: __ccgo_ts + 17288, + 42: __ccgo_ts + 17293, + 43: __ccgo_ts + 9647, + 44: __ccgo_ts + 17298, + 45: __ccgo_ts + 5939, + 46: __ccgo_ts + 17304, + 47: __ccgo_ts + 17309, + 48: __ccgo_ts + 16497, + 49: __ccgo_ts + 17314, + 50: __ccgo_ts + 17115, + 51: __ccgo_ts + 17157, + 52: __ccgo_ts + 17327, + 53: __ccgo_ts + 17332, + 54: __ccgo_ts + 17341, + 55: __ccgo_ts + 17348, + 56: __ccgo_ts + 17359, } // C documentation @@ -119102,343 +113716,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 17266, + FzName: __ccgo_ts + 17367, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 17281, + FzName: __ccgo_ts + 17382, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 17296, + FzName: __ccgo_ts + 17397, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 17308, + FzName: __ccgo_ts + 17409, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 17324, + FzName: __ccgo_ts + 17425, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 17247, + FzName: __ccgo_ts + 17348, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 17337, + FzName: __ccgo_ts + 17438, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17349, + FzName: __ccgo_ts + 17450, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17369, + FzName: __ccgo_ts + 17470, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17385, + FzName: __ccgo_ts + 17486, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17406, + FzName: __ccgo_ts + 17507, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17421, + FzName: __ccgo_ts + 17522, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17437, + FzName: __ccgo_ts + 17538, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17451, + FzName: __ccgo_ts + 17552, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17464, + FzName: __ccgo_ts + 17565, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17478, + FzName: __ccgo_ts + 17579, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17497, + FzName: __ccgo_ts + 17598, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17516, + FzName: __ccgo_ts + 17617, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17539, + FzName: __ccgo_ts + 17640, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17548, + FzName: __ccgo_ts + 17649, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17566, + FzName: __ccgo_ts + 17667, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17583, + FzName: __ccgo_ts + 17684, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17596, + FzName: __ccgo_ts + 17697, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17611, + FzName: __ccgo_ts + 17712, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17629, + FzName: __ccgo_ts + 17730, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17639, + FzName: __ccgo_ts + 17740, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17653, + FzName: __ccgo_ts + 17754, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17770, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17694, + FzName: __ccgo_ts + 17795, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17713, + FzName: __ccgo_ts + 17814, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17724, + FzName: __ccgo_ts + 17825, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17735, + FzName: __ccgo_ts + 17836, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17747, + FzName: __ccgo_ts + 17848, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17763, + FzName: __ccgo_ts + 17864, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17776, + FzName: __ccgo_ts + 17877, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17795, + FzName: __ccgo_ts + 17896, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17814, + FzName: __ccgo_ts + 17915, FePragTyp: uint8(PragTyp_LOCK_PROXY_FILE), FmPragFlg: uint8(PragFlg_NoColumns1), }, 37: { - FzName: __ccgo_ts + 17830, + FzName: __ccgo_ts + 17931, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17843, + FzName: __ccgo_ts + 17944, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 39: { - FzName: __ccgo_ts + 17858, + FzName: __ccgo_ts + 17959, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 17868, + FzName: __ccgo_ts + 17969, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 17880, + FzName: __ccgo_ts + 17981, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 17889, + FzName: __ccgo_ts + 17990, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 43: { - FzName: __ccgo_ts + 17900, + FzName: __ccgo_ts + 18001, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 44: { - FzName: __ccgo_ts + 17910, + FzName: __ccgo_ts + 18011, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 17922, + FzName: __ccgo_ts + 18023, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 46: { - FzName: __ccgo_ts + 17933, + FzName: __ccgo_ts + 18034, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 47: { - FzName: __ccgo_ts + 17945, + FzName: __ccgo_ts + 18046, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 48: { - FzName: __ccgo_ts + 17962, + FzName: __ccgo_ts + 18063, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 49: { - FzName: __ccgo_ts + 17981, + FzName: __ccgo_ts + 18082, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 50: { - FzName: __ccgo_ts + 18007, + FzName: __ccgo_ts + 18108, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 51: { - FzName: __ccgo_ts + 18022, + FzName: __ccgo_ts + 18123, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 18036, + FzName: __ccgo_ts + 18137, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 53: { - FzName: __ccgo_ts + 18055, + FzName: __ccgo_ts + 18156, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 18069, + FzName: __ccgo_ts + 18170, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 18085, + FzName: __ccgo_ts + 18186, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 56: { - FzName: __ccgo_ts + 18097, + FzName: __ccgo_ts + 18198, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 18108, + FzName: __ccgo_ts + 18209, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 58: { - FzName: __ccgo_ts + 18119, + FzName: __ccgo_ts + 18220, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -119446,45 +114060,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 18131, + FzName: __ccgo_ts + 18232, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 18142, + FzName: __ccgo_ts + 18243, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 18163, + FzName: __ccgo_ts + 18264, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 18171, + FzName: __ccgo_ts + 18272, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 63: { - FzName: __ccgo_ts + 18186, + FzName: __ccgo_ts + 18287, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 64: { - FzName: __ccgo_ts + 18199, + FzName: __ccgo_ts + 18300, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 18218, + FzName: __ccgo_ts + 18319, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 66: { - FzName: __ccgo_ts + 18233, + FzName: __ccgo_ts + 18334, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -119502,7 +114116,7 @@ var _aPragmaName = [67]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -119610,10 +114224,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18249) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18350) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18259) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18360) { return PAGER_LOCKINGMODE_NORMAL } } @@ -119631,13 +114245,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8753) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8778) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18266) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18367) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18271) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18372) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -119660,10 +114274,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17208) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17327) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+18283) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18384) == 0 { return int32(2) } else { return 0 @@ -119685,7 +114299,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18290, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18391, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -119815,15 +114429,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 18352 + zName = __ccgo_ts + 18453 case int32(OE_SetDflt): - zName = __ccgo_ts + 18361 + zName = __ccgo_ts + 18462 case int32(OE_Cascade): - zName = __ccgo_ts + 18373 + zName = __ccgo_ts + 18474 case int32(OE_Restrict): - zName = __ccgo_ts + 18381 + zName = __ccgo_ts + 18482 default: - zName = __ccgo_ts + 18390 + zName = __ccgo_ts + 18491 break } return zName @@ -119844,12 +114458,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18400, - 1: __ccgo_ts + 18407, - 2: __ccgo_ts + 18415, - 3: __ccgo_ts + 18419, - 4: __ccgo_ts + 18283, - 5: __ccgo_ts + 18428, + 0: __ccgo_ts + 18501, + 1: __ccgo_ts + 18508, + 2: __ccgo_ts + 18516, + 3: __ccgo_ts + 18520, + 4: __ccgo_ts + 18384, + 5: __ccgo_ts + 18529, } // C documentation @@ -119911,15 +114525,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18453 + zType = __ccgo_ts + 18554 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18455 + zType = __ccgo_ts + 18556 } else { - zType = __ccgo_ts + 8152 + zType = __ccgo_ts + 8177 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18457, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18558, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -119928,9 +114542,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18432, - 2: __ccgo_ts + 18437, - 3: __ccgo_ts + 18445, + 1: __ccgo_ts + 18533, + 2: __ccgo_ts + 18538, + 3: __ccgo_ts + 18546, } // C documentation @@ -120030,7 +114644,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18464, libc.VaList(bp+184, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18565, libc.VaList(bp+184, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -120073,7 +114687,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+184, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+184, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -120118,7 +114732,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -120177,7 +114791,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18468) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18569) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -120220,7 +114834,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -120248,7 +114862,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 18259 + zRet = __ccgo_ts + 18360 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -120276,7 +114890,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 18249 + zRet = __ccgo_ts + 18350 } _returnSingleText(tls, v, zRet) break @@ -120566,7 +115180,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18473, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18574, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -120576,7 +115190,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+184, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+184, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -120608,7 +115222,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p res1 = _sqlite3OsFileControl(tls, pFile1, int32(SQLITE_FCNTL_SET_LOCKPROXYFILE), libc.UintptrFromInt32(0)) } if res1 != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18498, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18599, 0) goto pragma_out } } @@ -120628,7 +115242,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18528, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18629, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -120660,8 +115274,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18581) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18682) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -120741,9 +115356,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18587 + v14 = __ccgo_ts + 18688 } else { - v14 = __ccgo_ts + 18595 + v14 = __ccgo_ts + 18696 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -120814,7 +115429,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18602, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18703, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 88)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+88, uintptr(0)) @@ -120844,19 +115459,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 11331 + zType = __ccgo_ts + 11385 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13579 + zType = __ccgo_ts + 13633 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18618 + zType = __ccgo_ts + 18719 } else { - zType = __ccgo_ts + 9593 + zType = __ccgo_ts + 9647 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18625, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18726, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -120903,9 +115518,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18632, libc.VaList(bp+184, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18733, libc.VaList(bp+184, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18637, libc.VaList(bp+184, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18738, libc.VaList(bp+184, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -120929,11 +115544,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18642, - 1: __ccgo_ts + 18644, - 2: __ccgo_ts + 17085, + 0: __ccgo_ts + 18743, + 1: __ccgo_ts + 18745, + 2: __ccgo_ts + 17186, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18646, libc.VaList(bp+184, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18747, libc.VaList(bp+184, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -120952,7 +115567,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18652, libc.VaList(bp+184, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18753, libc.VaList(bp+184, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -120969,7 +115584,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18656, libc.VaList(bp+184, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18757, libc.VaList(bp+184, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -121019,7 +115634,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8152, libc.VaList(bp+184, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8177, libc.VaList(bp+184, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -121031,7 +115646,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1608)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8152, libc.VaList(bp+184, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+8177, libc.VaList(bp+184, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -121057,7 +115672,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18659, libc.VaList(bp+184, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18668)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18760, libc.VaList(bp+184, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18769)) goto _32 _32: ; @@ -121071,8 +115686,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -121198,7 +115813,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18673, libc.VaList(bp+184, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18774, libc.VaList(bp+184, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 104))) @@ -121294,7 +115909,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -121338,7 +115953,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -121389,7 +116004,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18677, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18778, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121400,7 +116015,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18701) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18802) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -121536,7 +116151,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 116)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18730, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18831, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -121598,7 +116213,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 116)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -121620,7 +116235,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18766, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18867, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -121633,7 +116248,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18786, libc.VaList(bp+184, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18887, libc.VaList(bp+184, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -121641,7 +116256,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18808, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18909, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -121652,10 +116267,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 116)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18831, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18932, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18833, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18934, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -121689,7 +116304,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18853, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18954, libc.VaList(bp+184, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -121713,9 +116328,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 120))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18883) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18984) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18888) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18989) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -121728,9 +116343,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 120))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18909) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19010) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18945) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19046) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -121758,9 +116373,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18883) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18984) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18956) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19057) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -121788,7 +116403,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 120))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18983) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19084) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -121885,7 +116500,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 112)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 19010 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 19111 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -121964,7 +116579,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19071, libc.VaList(bp+184, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19172, libc.VaList(bp+184, zRight)) } } } @@ -122069,13 +116684,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18266) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18367) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19096) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19197) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18419) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18520) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -122210,7 +116825,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -122240,7 +116855,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6999, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+7024, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -122302,7 +116917,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19104, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19205, libc.VaList(bp+184, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -122575,34 +117190,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19013, + FzName: __ccgo_ts + 19114, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19018, + FzName: __ccgo_ts + 19119, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19024, + FzName: __ccgo_ts + 19125, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19033, + FzName: __ccgo_ts + 19134, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19042, + FzName: __ccgo_ts + 19143, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19050, + FzName: __ccgo_ts + 19151, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19058, + FzName: __ccgo_ts + 19159, }, 7: { - FzName: __ccgo_ts + 19065, + FzName: __ccgo_ts + 19166, }, 8: {}, } @@ -122659,25 +117274,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -122698,14 +117294,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19122) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19223) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19137, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19238, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -122714,19 +117310,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19144, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19245, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19150) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19251) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19162) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19263) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5545, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -122741,7 +117337,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -122922,7 +117518,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -122934,13 +117530,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19177) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+19278) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19185, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19286, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19189, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+19290, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -122949,7 +117545,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -123075,24 +117671,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+19223, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+19324, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5521 + v1 = __ccgo_ts + 5547 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+19251, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+19352, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+19282, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+19383, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -123100,9 +117696,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 19193, - 1: __ccgo_ts + 19200, - 2: __ccgo_ts + 19212, + 0: __ccgo_ts + 19294, + 1: __ccgo_ts + 19301, + 2: __ccgo_ts + 19313, } // C documentation @@ -123178,7 +117774,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15019) + _corruptSchema(tls, pData, argv, __ccgo_ts+15073) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -123211,11 +117807,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+19290) + _corruptSchema(tls, pData, argv, __ccgo_ts+19391) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15019) + _corruptSchema(tls, pData, argv, __ccgo_ts+15073) } } } @@ -123254,18 +117850,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9593 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9647 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7007 + v2 = __ccgo_ts + 7032 } else { - v2 = __ccgo_ts + 6495 + v2 = __ccgo_ts + 6519 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8665 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19303 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8690 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19404 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -123349,7 +117945,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12630) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12684) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123375,7 +117971,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19375) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19476) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -123390,7 +117986,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19399, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19500, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -123686,7 +118282,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -123699,9 +118295,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -123719,7 +118315,7 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.X__builtin___memset_chk(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) libc.X__builtin___memset_chk(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288), ^t__predefined_size_t(0)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse @@ -123748,7 +118344,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.X__builtin___memset_chk(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8), ^t__predefined_size_t(0)) libc.X__builtin___memset_chk(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288), ^t__predefined_size_t(0)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -123808,7 +118404,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19433, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19534, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -123824,7 +118420,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19463, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19564, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -123847,10 +118443,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -123858,7 +118454,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3864, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -123888,7 +118484,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -124022,7 +118618,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -124144,15 +118740,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -124188,21 +118775,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -124282,7 +118854,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -124290,7 +118862,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -124446,15 +119018,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11737 - zSp2 = __ccgo_ts + 11737 + zSp1 = __ccgo_ts + 11791 + zSp2 = __ccgo_ts + 11791 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19482, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19583, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -124511,25 +119083,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -124661,13 +119236,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -124745,7 +119320,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19512, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19613, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -124795,12 +119370,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19562, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19663, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -124815,9 +119390,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19626, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19727, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -124827,6 +119403,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -124861,7 +119444,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 7204, + Fz: __ccgo_ts + 7229, Fn: uint32(8), } @@ -124878,13 +119461,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -124909,7 +119485,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -124954,7 +119530,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -124978,7 +119554,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -124999,7 +119575,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -125122,7 +119698,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -125249,10 +119825,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -125260,7 +119836,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -125437,7 +120013,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19663, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19764, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -125548,8 +120124,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -125557,7 +120133,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.X__builtin___memset_chk(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, p+32, 0, libc.Uint64FromInt32(nExtra), ^t__predefined_size_t(0)) } else { return _sqlite3OomFault(tls, db) } @@ -125642,13 +120218,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19683 + z = __ccgo_ts + 19784 case int32(TK_INTERSECT): - z = __ccgo_ts + 19693 + z = __ccgo_ts + 19794 case int32(TK_EXCEPT): - z = __ccgo_ts + 19703 + z = __ccgo_ts + 19804 default: - z = __ccgo_ts + 19710 + z = __ccgo_ts + 19811 break } return z @@ -125669,7 +120245,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19716, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19817, libc.VaList(bp+8, zUsage)) } /* @@ -125706,13 +120282,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19739 + v1 = __ccgo_ts + 19840 } else { v1 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19753, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19854, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19784, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19885, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -125736,11 +120312,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -125956,7 +120532,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1139 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 17197 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 17298 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -126069,7 +120645,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -126078,7 +120654,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -126102,13 +120678,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 17197 + zCol = __ccgo_ts + 17298 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12916, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12970, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -126116,7 +120692,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19830, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19931, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -126170,7 +120746,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -126208,7 +120784,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 17197 + v3 = __ccgo_ts + 17298 } zName = v3 } else { @@ -126223,7 +120799,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19830, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19931, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -126259,7 +120835,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19839, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19940, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -126378,7 +120954,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19847 + zType = __ccgo_ts + 19948 } else { zType = uintptr(0) j = int32(1) @@ -126444,7 +121020,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -126472,7 +121048,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -126522,7 +121098,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -126545,7 +121121,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -126693,7 +121269,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19851, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19952, 0) return } /* Obtain authorization to do a recursive query */ @@ -126730,7 +121306,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -126741,7 +121317,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -126755,7 +121331,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -126786,7 +121362,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19900, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20001, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -126801,7 +121377,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19942, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20043, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -126829,7 +121405,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19948, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20049, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -126884,9 +121460,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1665 } else { - v1 = __ccgo_ts + 3754 + v1 = __ccgo_ts + 3780 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19963, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20064, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -126994,8 +121570,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19986, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20001, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20087, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20102, 0) } /* Generate code for the left and right SELECT statements. */ @@ -127020,7 +121596,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19683, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19784, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127046,7 +121622,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -127072,7 +121648,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20020, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20121, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127104,11 +121680,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -127130,7 +121706,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20020, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20121, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -127237,6 +121813,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -127253,9 +121830,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20041, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20087, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20188, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -127326,7 +121903,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19663, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19764, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -127542,7 +122119,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -127574,7 +122151,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -127628,16 +122205,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7902) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7902) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7927) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7927) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -127655,32 +122232,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20169, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20270, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20180, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20281, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -127693,7 +122270,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20185, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20286, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -127903,11 +122480,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5499 + v1 = __ccgo_ts + 5525 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -128068,7 +122645,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -128258,9 +122835,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -128472,7 +123049,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -128619,7 +123196,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -128858,18 +123435,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -128909,11 +123474,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -128978,7 +123543,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -128996,12 +123561,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -129483,7 +124048,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -129529,13 +124094,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16053) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16134) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16057) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+16138) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -129623,8 +124188,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20191, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20292, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -129648,7 +124213,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -129730,7 +124295,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -129748,7 +124313,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20209, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20310, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -129896,7 +124461,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -129924,7 +124489,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20232, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20333, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -129946,12 +124511,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20252, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20353, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -129968,7 +124533,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20295 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20396 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -129999,7 +124564,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20318, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20419, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -130008,9 +124573,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20356 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20457 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20390 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20491 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -130059,7 +124624,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -130069,7 +124634,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20428, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20529, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -130165,7 +124730,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -130174,7 +124739,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -130225,7 +124790,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20432, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20533, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -130240,7 +124805,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20471, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20572, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -130255,7 +124820,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15612, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -130379,7 +124944,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 7064 + v10 = __ccgo_ts + 7089 } zSchemaName = v10 } @@ -130396,7 +124961,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20502, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20603, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -130475,7 +125040,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20507, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20608, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -130488,7 +125053,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12916, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12970, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -130508,9 +125073,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20516, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20617, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20534, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20635, 0) } } } @@ -130524,7 +125089,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20554, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -130721,14 +125286,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -130737,7 +125302,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -130769,11 +125334,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -130826,7 +125391,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -130863,12 +125428,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20585, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20686, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20636, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20737, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -130889,7 +125454,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20669, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20770, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -131028,7 +125593,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -131136,7 +125701,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -131180,7 +125745,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -131203,7 +125768,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20702 + v1 = __ccgo_ts + 20803 } else { v1 = __ccgo_ts + 1665 } @@ -131212,7 +125777,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20725, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20826, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -131244,7 +125809,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8665) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8690) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -131373,6 +125938,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -131401,7 +125967,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16347) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16448) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -131434,9 +126000,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -131446,13 +126012,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -131472,7 +126038,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -131645,8 +126211,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -131655,11 +126221,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -131675,7 +126241,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -131699,14 +126265,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20737, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20838, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -131807,7 +126373,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20791, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20892, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -132008,14 +126574,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20831, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20932, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -132047,7 +126613,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -132062,7 +126628,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20846, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20947, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -132116,7 +126682,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -132149,7 +126715,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -132208,7 +126774,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -132237,6 +126803,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -132259,10 +126832,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -132296,8 +126869,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -132312,8 +126885,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -132342,8 +126915,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -132360,7 +126933,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -132373,11 +126946,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -132411,49 +126984,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -132461,16 +127035,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -132488,11 +127062,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20862 + v47 = __ccgo_ts + 20963 } else { - v46 = __ccgo_ts + 20871 + v47 = __ccgo_ts + 20972 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19716, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19817, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -132502,12 +127076,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -132520,13 +127094,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -132537,12 +127111,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -132591,12 +127165,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -132666,9 +127244,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -132685,10 +127263,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -132715,8 +127293,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -132756,32 +127334,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -132823,7 +127401,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20862) + _explainTempTable(tls, pParse, __ccgo_ts+20963) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -132929,7 +127507,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -132945,7 +127523,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20880, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20981, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -133035,7 +127613,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -133197,7 +127775,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20945, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21046, 0) goto trigger_cleanup } iDb = int32(1) @@ -133237,7 +127815,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20991, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+21092, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -133247,11 +127825,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20999, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21100, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21040, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21141, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -133260,13 +127838,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20991, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+21092, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21080, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21181, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -133274,8 +127852,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6999, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21106, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7024, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21207, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -133283,15 +127861,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 21144 + v1 = __ccgo_ts + 21245 } else { - v1 = __ccgo_ts + 21151 + v1 = __ccgo_ts + 21252 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21157, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21258, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21194, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21295, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -133311,9 +127889,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 7007 + v3 = __ccgo_ts + 7032 } else { - v3 = __ccgo_ts + 6495 + v3 = __ccgo_ts + 6519 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -133413,7 +127991,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20991, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+21092, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -133435,7 +128013,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21240, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21341, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -133451,10 +128029,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21288, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21389, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21363, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21464, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -133722,11 +128300,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21392, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21493, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -133764,9 +128342,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7007 + v1 = __ccgo_ts + 7032 } else { - v1 = __ccgo_ts + 6495 + v1 = __ccgo_ts + 6519 } zTab = v1 if iDb == int32(1) { @@ -133781,7 +128359,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21412, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21513, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -133914,11 +128492,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21474 + v1 = __ccgo_ts + 21575 } else { - v1 = __ccgo_ts + 21481 + v1 = __ccgo_ts + 21582 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21488, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21589, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -134020,7 +128598,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21637, 0) return int32(1) } @@ -134168,12 +128746,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -134181,19 +128759,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.X__builtin___memset_chk(tls, bp, 0, uint64(128), ^t__predefined_size_t(0)) - libc.X__builtin___memset_chk(tls, bp+128, 0, uint64(88), ^t__predefined_size_t(0)) + pFrom = bp + 128 + libc.X__builtin___memset_chk(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80), ^t__predefined_size_t(0)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -134204,7 +128785,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.X__builtin___memset_chk(tls, bp+216, 0, uint64(56), ^t__predefined_size_t(0)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -134218,7 +128799,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -134286,7 +128867,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6692, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6716, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -134385,10 +128966,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21578, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21679, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -134410,7 +128993,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -134482,7 +129065,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -134898,13 +129481,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -134912,21 +129495,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -134973,7 +129556,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -135012,7 +129595,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -135056,58 +129639,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21592, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21693, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21628, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21729, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8440 + v10 = __ccgo_ts + 8465 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -135137,17 +129708,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -135159,11 +129730,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -135179,11 +129750,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -135192,18 +129763,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -135212,16 +129783,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -135239,24 +129810,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -135282,50 +129853,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -135623,8 +130194,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -135674,8 +130245,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -135722,11 +130293,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -135738,11 +130309,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -135785,7 +130356,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21647) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21748) } goto update_cleanup update_cleanup: @@ -135842,13 +130413,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -135890,11 +130461,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -136219,9 +130790,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 200)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21660, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21761, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21664, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21765, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -136310,13 +130881,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -136324,7 +130895,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+13005, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+13059, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -136406,7 +130977,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21737, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21741, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21838, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21842, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -136497,7 +131068,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -136536,17 +131107,17 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21745) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21846) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21785) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21886) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21828) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21929) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -136563,7 +131134,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21877) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21978) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -136616,7 +131187,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15382) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15436) if rc != SQLITE_OK { goto end_of_vacuum } @@ -136647,11 +131218,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21904, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22005, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22012, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22113, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -136660,7 +131231,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22066, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22167, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -136670,7 +131241,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22203, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22304, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -136761,39 +131332,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -136804,7 +131342,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -136813,7 +131351,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -136823,7 +131361,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -136848,15 +131386,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -136871,13 +131409,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -137197,7 +131737,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13235, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13289, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -137320,24 +131860,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22326, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22427, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+22350, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22451, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22449, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22550, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -137394,7 +131939,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -137421,7 +131966,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22468, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22569, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -137455,7 +132000,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -137463,9 +132008,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22510, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22611, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3864, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -137478,7 +132023,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22540 + zFormat = __ccgo_ts + 22641 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -137512,7 +132057,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+17088, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+17189, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -137593,13 +132138,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22586, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22687, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -137680,7 +132225,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22586, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22687, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -137728,7 +132273,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22605, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22706, 0) return int32(SQLITE_ERROR) } goto _1 @@ -137739,9 +132284,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -137783,7 +132328,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3864 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } @@ -138149,7 +132694,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -138239,7 +132784,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -138259,7 +132804,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -138323,7 +132868,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -138336,7 +132881,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -138596,436 +133141,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -139057,10 +133172,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22618 + return __ccgo_ts + 22719 } if i == -int32(1) { - return __ccgo_ts + 17197 + return __ccgo_ts + 17298 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -139079,10 +133194,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22625, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22726, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22631, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22732, int32(1)) } i = 0 for { @@ -139090,7 +133205,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13625, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13679, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -139099,11 +133214,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22631, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22732, int32(1)) } i = 0 for { @@ -139111,16 +133226,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13625, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13679, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5521, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5547, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } } @@ -139167,7 +133282,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22633, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22734, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -139175,12 +133290,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22625, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22726, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22636 + v2 = __ccgo_ts + 22737 } else { - v2 = __ccgo_ts + 22641 + v2 = __ccgo_ts + 22742 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -139197,7 +133312,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22649) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22750) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -139208,9 +133323,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22651) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22752) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5545, int32(1)) } // C documentation @@ -139255,11 +133370,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22653 + v2 = __ccgo_ts + 22754 } else { - v2 = __ccgo_ts + 22660 + v2 = __ccgo_ts + 22761 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22665, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22766, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -139272,37 +133387,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11788 + zFmt = __ccgo_ts + 11842 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22671 + zFmt = __ccgo_ts + 22772 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22704 + zFmt = __ccgo_ts + 22805 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22729 + zFmt = __ccgo_ts + 22830 } else { - zFmt = __ccgo_ts + 22747 + zFmt = __ccgo_ts + 22848 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22756, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22857, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 17197 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22764, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 17298 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22865, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22795, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22896, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -139312,14 +133427,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22805, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22906, libc.VaList(bp+144, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22810) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22911) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22832 + v3 = __ccgo_ts + 22933 } else { - v3 = __ccgo_ts + 22840 + v3 = __ccgo_ts + 22941 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -139340,7 +133455,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22846, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22947, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -139370,10 +133485,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -139406,14 +133521,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22857, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22958, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22636, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22737, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22878, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22979, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -139437,16 +133552,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22625, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22726, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22636, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22737, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5519, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5545, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -139651,7 +133766,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -139707,8 +133822,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -139730,7 +133845,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -139787,10 +133902,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -139845,37 +133960,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -139900,10 +134001,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -139922,24 +134023,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -139951,8 +134052,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -140010,7 +134111,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -140092,7 +134193,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -140223,7 +134324,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -140360,7 +134461,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -140505,7 +134606,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -140566,11 +134667,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -140601,6 +134702,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -140739,7 +134843,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -140819,7 +134923,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -140853,7 +134957,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -140975,7 +135079,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -141168,7 +135272,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -141182,12 +135286,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -141225,11 +135330,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -141249,7 +135354,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -141285,21 +135390,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -141317,7 +135422,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -141372,7 +135477,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22886, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22987, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -141395,7 +135500,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22901, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23002, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -141884,9 +135989,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -141895,14 +136000,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22910, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23011, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -141941,15 +136046,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.X__builtin___memcpy_chk(tls, bp+8, pTabItem, uint64(80), ^t__predefined_size_t(0)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.X__builtin___memcpy_chk(tls, pFrom+8, pTabItem, uint64(80), ^t__predefined_size_t(0)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -141961,7 +136067,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -142034,7 +136140,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -142432,19 +136538,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 17046, + FzOp: __ccgo_ts + 17147, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16377, + FzOp: __ccgo_ts + 16478, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15856, + FzOp: __ccgo_ts + 15937, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22924, + FzOp: __ccgo_ts + 23025, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -142964,37 +137070,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -143232,7 +137342,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23032, 0) return } } else { @@ -143244,10 +137354,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23032, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -143306,7 +137416,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -143328,7 +137438,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8426 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8451 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -143429,7 +137539,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22972 + v13 = __ccgo_ts + 23073 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -143960,7 +138070,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22979, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23080, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -144032,22 +138142,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -144160,7 +138258,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -145076,7 +139174,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -147327,13 +141426,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -147433,6 +141527,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -147446,12 +141541,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -147897,7 +142009,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -147948,15 +142060,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -147988,7 +142091,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -148007,7 +142110,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -148044,7 +142147,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -148052,7 +142155,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -148073,19 +142176,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.X__builtin___memset_chk(tls, bp+16, 0, uint64(48), ^t__predefined_size_t(0)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -148181,7 +142284,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -148359,7 +142462,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -148387,6 +142490,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -148463,7 +142574,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -148700,7 +142811,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23052, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23153, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -148775,7 +142886,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23052, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23153, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -148929,7 +143040,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -149365,7 +143476,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+23078, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+23179, 0) rc = SQLITE_OK } else { break @@ -149594,17 +143705,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -150573,7 +144673,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23113, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23214, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -151151,7 +145251,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -151307,7 +145407,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23131, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23232, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -151328,11 +145428,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -151380,7 +145477,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+23159, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+23260, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -151525,7 +145622,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -151559,7 +145657,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -151581,7 +145679,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -151594,7 +145692,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -151685,11 +145783,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -151716,16 +145814,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -151773,7 +145871,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -151904,7 +146002,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -152082,7 +146180,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -152111,7 +146209,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -152121,7 +146219,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23177, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23278, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -152171,7 +146269,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -152440,7 +146538,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23206, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23307, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -152622,7 +146720,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23262, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23363, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -152948,7 +147046,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23307, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23408, libc.VaList(bp+8, zName)) } return p } @@ -152999,12 +147097,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23326, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23427, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23397, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23498, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -153077,7 +147175,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8665) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8690) } break } @@ -153108,16 +147206,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -153136,17 +147224,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -153164,7 +147252,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -153188,13 +147276,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -153209,23 +147297,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.X__builtin___memset_chk(tls, pExpr, 0, uint64(72), ^t__predefined_size_t(0)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -153241,13 +147329,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -153359,7 +147447,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23460, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23561, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -153395,7 +147483,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -153410,7 +147498,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -153429,11 +147517,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -153479,11 +147567,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -153500,7 +147588,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -153522,7 +147610,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.X__builtin___memcpy_chk(tls, pTab, pTab2, uint64(104), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, pTab, pTab2, uint64(120), ^t__predefined_size_t(0)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -153646,7 +147734,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23486, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23587, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -153714,18 +147802,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23518 + zErr = __ccgo_ts + 23619 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23535 + zErr = __ccgo_ts + 23636 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23551 + zErr = __ccgo_ts + 23652 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23571, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23672, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -153749,7 +147837,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23604, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23705, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -153855,24 +147943,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -153890,12 +147978,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -153907,15 +147995,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -153967,11 +148055,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23651, - 1: __ccgo_ts + 23704, - 2: __ccgo_ts + 23206, - 3: __ccgo_ts + 23755, - 4: __ccgo_ts + 23807, + 0: __ccgo_ts + 23752, + 1: __ccgo_ts + 23805, + 2: __ccgo_ts + 23307, + 3: __ccgo_ts + 23856, + 4: __ccgo_ts + 23908, } var _aOp1 = [5]int32{ @@ -154024,87 +148112,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -154551,7 +148558,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -154647,7 +148654,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -155364,12 +149371,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -155377,13 +149384,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -155403,13 +149410,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -155436,7 +149443,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -155655,6 +149662,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -155715,7 +149726,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23857, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23958, libc.VaList(bp+8, p)) } // C documentation @@ -155729,6 +149740,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.X__builtin___memset_chk(tls, pParse+256, 0, uint64(32), ^t__predefined_size_t(0)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -155762,11 +149774,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23881 + v1 = __ccgo_ts + 23982 } else { - v1 = __ccgo_ts + 23890 + v1 = __ccgo_ts + 23991 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23896, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23997, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -155775,7 +149787,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23938, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24039, 0) } } } @@ -155881,7 +149893,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23972, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24073, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -162348,14 +156360,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -162366,16 +156370,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -162402,13 +156396,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.X__builtin___memcpy_chk(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24), ^t__predefined_size_t(0)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -163523,19 +157517,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -164338,20 +158332,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17197, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17298, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24010, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24111, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17110, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+17234, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24010, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24111, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -164392,7 +158386,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -164537,7 +158536,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -164627,9 +158631,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -164984,7 +158988,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+24037) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+24138) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -165324,23 +159328,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8446 + } else { + v347 = __ccgo_ts + 8451 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8421 - } else { - v347 = __ccgo_ts + 8426 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -165398,11 +159416,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -165412,9 +159430,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -165422,11 +159440,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -165524,11 +159542,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -165578,15 +159596,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24046, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24147, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24242, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24225, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24326, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -165728,7 +159746,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -165922,7 +159940,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24310, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24411, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -168048,7 +162066,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -168653,14 +162671,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -169522,22 +163543,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -169548,11 +163578,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -170131,7 +164161,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -170151,7 +164181,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24397, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24498, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -170276,11 +164306,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -170452,14 +164482,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24940 + zErr = __ccgo_ts + 25041 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -170471,31 +164501,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24465, - 1: __ccgo_ts + 24478, - 3: __ccgo_ts + 24494, - 4: __ccgo_ts + 24519, - 5: __ccgo_ts + 24533, - 6: __ccgo_ts + 24552, + 0: __ccgo_ts + 24566, + 1: __ccgo_ts + 24579, + 3: __ccgo_ts + 24595, + 4: __ccgo_ts + 24620, + 5: __ccgo_ts + 24634, + 6: __ccgo_ts + 24653, 7: __ccgo_ts + 1635, - 8: __ccgo_ts + 24577, - 9: __ccgo_ts + 24614, - 10: __ccgo_ts + 24626, - 11: __ccgo_ts + 24641, - 12: __ccgo_ts + 24674, - 13: __ccgo_ts + 24692, - 14: __ccgo_ts + 24717, - 15: __ccgo_ts + 24746, - 17: __ccgo_ts + 6450, - 18: __ccgo_ts + 5852, - 19: __ccgo_ts + 24763, - 20: __ccgo_ts + 24781, - 21: __ccgo_ts + 24799, - 23: __ccgo_ts + 24833, - 25: __ccgo_ts + 24854, - 26: __ccgo_ts + 24880, - 27: __ccgo_ts + 24903, - 28: __ccgo_ts + 24924, + 8: __ccgo_ts + 24678, + 9: __ccgo_ts + 24715, + 10: __ccgo_ts + 24727, + 11: __ccgo_ts + 24742, + 12: __ccgo_ts + 24775, + 13: __ccgo_ts + 24793, + 14: __ccgo_ts + 24818, + 15: __ccgo_ts + 24847, + 17: __ccgo_ts + 6474, + 18: __ccgo_ts + 5878, + 19: __ccgo_ts + 24864, + 20: __ccgo_ts + 24882, + 21: __ccgo_ts + 24900, + 23: __ccgo_ts + 24934, + 25: __ccgo_ts + 24955, + 26: __ccgo_ts + 24981, + 27: __ccgo_ts + 25004, + 28: __ccgo_ts + 25025, } // C documentation @@ -170589,15 +164619,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -170605,6 +164637,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -170612,10 +164646,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -170642,6 +164676,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -170669,12 +164717,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -170692,9 +164740,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -170717,13 +164765,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25021, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25122, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -170741,15 +164789,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -170764,27 +164812,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -170795,30 +164843,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -170843,7 +164921,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+25084, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+25185, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -170874,13 +164952,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -170891,43 +164971,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -170938,12 +165022,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -170955,6 +165039,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -170962,82 +165048,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -171081,18 +165177,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -171118,7 +165216,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -171128,7 +165226,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+25135, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+25236, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -171250,7 +165348,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -171382,7 +165480,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171392,7 +165490,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -171428,7 +165526,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -171441,7 +165539,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -171450,7 +165548,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25156, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25257, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -171485,9 +165583,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -171597,7 +165695,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+25224, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+25325, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -171627,8 +165725,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+25230, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25240, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+25331, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25341, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -171717,24 +165815,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+25268, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+25369, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+25272, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+25373, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 25272 + zModeType = __ccgo_ts + 25373 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25293, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25394, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3471 + zModeType = __ccgo_ts + 3497 } if aMode != 0 { mode = 0 @@ -171763,12 +165861,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25308, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25409, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25328, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25429, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -171792,7 +165890,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25352, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25453, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -171812,11 +165910,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25278, + Fz: __ccgo_ts + 25379, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 25285, + Fz: __ccgo_ts + 25386, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -171827,19 +165925,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 25298, + Fz: __ccgo_ts + 25399, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 25301, + Fz: __ccgo_ts + 25402, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 25304, + Fz: __ccgo_ts + 25405, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 18283, + Fz: __ccgo_ts + 18384, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -171967,8 +166065,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22972, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+25368, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+23073, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25469, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -171989,10 +166087,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4603 + zFilename = __ccgo_ts + 4629 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -172001,7 +166099,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3864 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -172028,9 +166126,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 7059 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 7084 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24370 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24471 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -172124,7 +166222,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 25374 + zFilename = __ccgo_ts + 25475 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -172143,36 +166241,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -172180,7 +166286,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -172188,31 +166294,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -172246,12 +166356,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -172284,10 +166396,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -172298,7 +166410,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -172341,20 +166453,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+25377, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25478, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25402) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25503) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25422) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25523) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25429) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25530) } // C documentation @@ -172379,9 +166491,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -172408,29 +166520,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -172485,15 +166586,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25446, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25547, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3864 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -172672,8 +166773,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -173117,7 +167218,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -173513,7 +167614,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25474, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25575, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -173661,6 +167762,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -173684,7 +167787,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -173694,7 +167797,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -173706,7 +167809,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -173722,7 +167825,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -173731,7 +167834,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25482 + v2 = __ccgo_ts + 25583 } else { v2 = uintptr(0) } @@ -173810,7 +167913,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.X__builtin___memcpy_chk(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8), ^t__predefined_size_t(0)) Xsqlite3_free(tls, aDyn) @@ -173977,7 +168080,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -174194,6 +168297,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -174506,8 +168616,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -174564,7 +168674,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -174574,7 +168684,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -174612,18 +168722,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1651, - 1: __ccgo_ts + 8421, - 2: __ccgo_ts + 8426, - 3: __ccgo_ts + 6735, - 4: __ccgo_ts + 6735, - 5: __ccgo_ts + 6730, - 6: __ccgo_ts + 6730, - 7: __ccgo_ts + 8732, - 8: __ccgo_ts + 8732, - 9: __ccgo_ts + 8732, - 10: __ccgo_ts + 8732, - 11: __ccgo_ts + 25505, - 12: __ccgo_ts + 25511, + 1: __ccgo_ts + 8446, + 2: __ccgo_ts + 8451, + 3: __ccgo_ts + 6760, + 4: __ccgo_ts + 6760, + 5: __ccgo_ts + 6755, + 6: __ccgo_ts + 6755, + 7: __ccgo_ts + 8757, + 8: __ccgo_ts + 8757, + 9: __ccgo_ts + 8757, + 10: __ccgo_ts + 8757, + 11: __ccgo_ts + 25606, + 12: __ccgo_ts + 25612, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -174931,106 +169041,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -175110,7 +169120,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -175408,8 +169418,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25518 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25518 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -175545,7 +169555,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1651, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15826, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15880, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -175559,14 +169569,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25535, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25619, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -175620,7 +169628,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25648, -int32(1)) } } } @@ -175903,8 +169911,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25579, - FzRepl: __ccgo_ts + 25583, + FzMatch: __ccgo_ts + 25663, + FzRepl: __ccgo_ts + 25667, }, 1: { Fc1: int8('i'), @@ -175912,8 +169920,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25591, - FzRepl: __ccgo_ts + 25583, + FzMatch: __ccgo_ts + 25675, + FzRepl: __ccgo_ts + 25667, }, 2: { Fc1: int8('n'), @@ -175928,7 +169936,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25600, + FzMatch: __ccgo_ts + 25684, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -175936,7 +169944,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25605, + FzMatch: __ccgo_ts + 25689, FzRepl: __ccgo_ts + 1651, }, } @@ -175952,7 +169960,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25610, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25694, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -175970,23 +169978,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -176064,7 +170072,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -176135,7 +170143,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -176410,7 +170422,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25653, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25737, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -176840,7 +170852,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -176879,7 +170891,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8421, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8446, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -176887,7 +170899,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8426, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8451, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -176964,14 +170976,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25579, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25663, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25662) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25746) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25753) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25675, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25759, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -177156,7 +171168,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25753) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -177201,7 +171213,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -177214,7 +171226,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -177263,10 +171275,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -177300,15 +171308,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -177381,11 +171389,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8421, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8446, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8426, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8451, uint32(5)) return i + uint32(1) _6: ; @@ -177434,9 +171442,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25583 + v19 = __ccgo_ts + 25667 } else { - v19 = __ccgo_ts + 12288 + v19 = __ccgo_ts + 12342 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -177472,9 +171480,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.X__builtin___memcpy_chk(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp))), ^t__predefined_size_t(0)) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -177501,7 +171512,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25681, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25765, uint32(2)) zIn2++ sz2-- continue @@ -177524,7 +171535,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25684, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25768, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -177532,12 +171543,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25691, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25775, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25696, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25780, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -177640,16 +171651,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -177717,7 +171718,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25703, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -177740,12 +171741,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25706, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25790, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25703, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -177760,50 +171761,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.X__builtin___memset_chk(tls, bp+8, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -177855,6 +171812,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -177875,6 +171910,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -177947,9 +171985,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -177992,7 +172030,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -178480,7 +172529,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -178615,7 +172664,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -178716,7 +172765,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25648, -int32(1)) return } @@ -178753,11 +172802,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25535, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25619, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -178770,7 +172816,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.X__builtin___memset_chk(tls, pParse, 0, uint64(72), ^t__predefined_size_t(0)) return int32(1) @@ -178789,10 +172835,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25669) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25753) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25662) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25746) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -178831,7 +172877,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25709, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25793, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -178847,7 +172893,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -178928,7 +172974,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -178940,34 +172986,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -179050,7 +173116,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -179110,7 +173176,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -179245,7 +173311,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25727 + v1 = __ccgo_ts + 25811 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -179255,7 +173321,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } eErr = uint8(1) @@ -179365,23 +173431,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25729, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25813, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25731, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25815, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5574, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5600, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1678, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1704, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25733, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25817, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25736, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25820, uint32(1)) } } } @@ -179421,7 +173487,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -179689,7 +173755,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -179713,7 +173779,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25738, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25822, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -179724,7 +173790,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25789, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25873, -int32(1)) _jsonStringReset(tls, bp) return } @@ -179796,7 +173862,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } goto json_remove_done @@ -179833,7 +173899,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16299) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16400) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -179864,9 +173930,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25823 + v1 = __ccgo_ts + 25907 } else { - v1 = __ccgo_ts + 25827 + v1 = __ccgo_ts + 25911 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -179914,7 +173980,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25564, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25648, -int32(1)) } } goto json_type_done @@ -179961,7 +174027,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25834 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25918 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -180035,17 +174101,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25839, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25923, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -180054,18 +174119,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -180127,9 +174191,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -180236,7 +174298,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25896, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25980, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180328,20 +174390,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -180385,7 +174449,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25899, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25983, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -180413,16 +174477,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -180441,24 +174495,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -180466,13 +174502,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -180488,7 +174517,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25902) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25986) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -180622,7 +174651,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25985, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+26069, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -180648,9 +174677,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25992, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+26076, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+26000, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+26084, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -180961,9 +174990,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.X__builtin___memset_chk(tls, p+192, 0, uint64(72), ^t__predefined_size_t(0)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -181036,7 +175064,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+26006, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+26090, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -181060,7 +175088,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25564, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25648, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -181121,186 +175149,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26008, + FzName: __ccgo_ts + 26092, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26013, + FzName: __ccgo_ts + 26097, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26019, + FzName: __ccgo_ts + 26103, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26030, + FzName: __ccgo_ts + 26114, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26042, + FzName: __ccgo_ts + 26126, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26042, + FzName: __ccgo_ts + 26126, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26060, + FzName: __ccgo_ts + 26144, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26080, + FzName: __ccgo_ts + 26164, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26093, + FzName: __ccgo_ts + 26177, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26107, + FzName: __ccgo_ts + 26191, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26110, + FzName: __ccgo_ts + 26194, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26114, + FzName: __ccgo_ts + 26198, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26126, + FzName: __ccgo_ts + 26210, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26139, + FzName: __ccgo_ts + 26223, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26151, + FzName: __ccgo_ts + 26235, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26164, + FzName: __ccgo_ts + 26248, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26175, + FzName: __ccgo_ts + 26259, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26187, + FzName: __ccgo_ts + 26271, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26187, + FzName: __ccgo_ts + 26271, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26199, + FzName: __ccgo_ts + 26283, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26210, + FzName: __ccgo_ts + 26294, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26222, + FzName: __ccgo_ts + 26306, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26235, + FzName: __ccgo_ts + 26319, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26248, + FzName: __ccgo_ts + 26332, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26262, + FzName: __ccgo_ts + 26346, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26271, + FzName: __ccgo_ts + 26355, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26281, + FzName: __ccgo_ts + 26365, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26281, + FzName: __ccgo_ts + 26365, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26291, + FzName: __ccgo_ts + 26375, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26291, + FzName: __ccgo_ts + 26375, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 26302, + FzName: __ccgo_ts + 26386, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26319, + FzName: __ccgo_ts + 26403, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 26337, + FzName: __ccgo_ts + 26421, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26355, + FzName: __ccgo_ts + 26439, }, } @@ -181383,17 +175411,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 26374, + FzName: __ccgo_ts + 26458, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26384, + FzName: __ccgo_ts + 26468, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -181443,224 +175473,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -181678,33 +175493,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -181715,79 +175524,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -181971,7 +175765,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.X__builtin___memset_chk(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize), ^t__predefined_size_t(0)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -182034,7 +175828,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26394, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26478, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -182045,7 +175839,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -182339,7 +176133,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26399, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26483, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -182880,7 +176674,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -183260,7 +177054,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26481) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26565) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -183338,7 +177132,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -183569,7 +177363,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.X__builtin___memcpy_chk(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1)), ^t__predefined_size_t(0)) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -183577,7 +177371,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -183815,7 +177609,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -184237,7 +178031,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -184746,11 +178540,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -184763,11 +178557,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -184795,7 +178589,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26495, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26579, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -184805,11 +178599,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26515, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26599, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26547, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26631, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185023,7 +178817,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26584, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26668, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -185077,9 +178871,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26729 + zFmt = __ccgo_ts + 26813 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+12117, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+12171, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -185137,9 +178931,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26785, - 1: __ccgo_ts + 5913, - 2: __ccgo_ts + 17197, + 0: __ccgo_ts + 26869, + 1: __ccgo_ts + 5939, + 2: __ccgo_ts + 17298, } var _rtreeModule = Tsqlite3_module{ @@ -185183,21 +178977,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27199, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27283, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27261, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27345, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27266, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27330, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27400, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27350, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27414, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27484, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -185227,7 +179021,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27449 + zFormat = __ccgo_ts + 27533 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -185242,31 +179036,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27557, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27641, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27602, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27686, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13625, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13679, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27629, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27713, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27651, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27735, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27659, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27743, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -185280,14 +179074,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26790, - 1: __ccgo_ts + 26843, - 2: __ccgo_ts + 26888, - 3: __ccgo_ts + 26940, - 4: __ccgo_ts + 26994, - 5: __ccgo_ts + 27039, - 6: __ccgo_ts + 27097, - 7: __ccgo_ts + 27152, + 0: __ccgo_ts + 26874, + 1: __ccgo_ts + 26927, + 2: __ccgo_ts + 26972, + 3: __ccgo_ts + 27024, + 4: __ccgo_ts + 27078, + 5: __ccgo_ts + 27123, + 6: __ccgo_ts + 27181, + 7: __ccgo_ts + 27236, } // C documentation @@ -185345,7 +179139,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27675, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27759, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -185353,17 +179147,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27695, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27779, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -185426,7 +179220,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -185440,13 +179234,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName), ^t__predefined_size_t(0)) - libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27938, uint64(6), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28022, uint64(6), ^t__predefined_size_t(0)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27944, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28028, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -185455,7 +179249,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27968, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28052, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -185469,19 +179263,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27995, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -185504,7 +179298,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -185515,7 +179309,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -185531,8 +179325,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27974, - 1: __ccgo_ts + 27985, + 0: __ccgo_ts + 28058, + 1: __ccgo_ts + 28069, } // C documentation @@ -185590,21 +179384,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11737, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11791, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27998, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28082, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28004, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28088, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+28008, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+28092, int32(1)) goto _1 _1: ; @@ -185631,7 +179425,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28010, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28094, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -185665,23 +179459,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -185734,7 +179511,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -185749,11 +179526,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4616 + v1 = __ccgo_ts + 4642 } else { v1 = __ccgo_ts + 1665 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28043, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28127, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -185787,7 +179564,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28050, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28134, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -185804,7 +179581,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28095, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28179, libc.VaList(bp+8, iNode)) } } return pRet @@ -185833,8 +179610,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 28127, - 1: __ccgo_ts + 28181, + 0: __ccgo_ts + 28211, + 1: __ccgo_ts + 28265, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -185847,21 +179624,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 28229 + v1 = __ccgo_ts + 28313 } else { - v1 = __ccgo_ts + 28237 + v1 = __ccgo_ts + 28321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28246, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28330, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 28229 + v2 = __ccgo_ts + 28313 } else { - v2 = __ccgo_ts + 28237 + v2 = __ccgo_ts + 28321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28291, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28375, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -185906,7 +179683,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28349, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28433, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -185924,7 +179701,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28397, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28481, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -185957,19 +179734,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28464, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28548, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28498, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28582, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28528, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28612, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -186014,12 +179791,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28583, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28667, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28614, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28698, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -186048,7 +179825,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28681, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28765, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -186058,11 +179835,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26495, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26579, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28709, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28793, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -186078,8 +179855,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28740, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28747, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28824, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28831, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -186106,7 +179883,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28755, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28839, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -186157,13 +179934,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28774, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28858, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 7059 + zDb = __ccgo_ts + 7084 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -186172,7 +179949,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 19010 + v1 = __ccgo_ts + 19111 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -186266,14 +180043,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -186298,16 +180067,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -186439,7 +180198,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -186484,7 +180243,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && int32(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -186546,7 +180305,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -186914,7 +180673,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -186929,9 +180688,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -187016,7 +180775,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -187090,13 +180849,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -187157,7 +180909,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -187196,7 +180948,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -187300,7 +181052,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -187331,36 +181083,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -187384,7 +181106,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -187668,7 +181390,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -187825,7 +181547,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.X__builtin___memset_chk(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)), ^t__predefined_size_t(0)) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -187837,13 +181559,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName), ^t__predefined_size_t(0)) libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName), ^t__predefined_size_t(0)) - libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27938, uint64(6), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28022, uint64(6), ^t__predefined_size_t(0)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28898, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28982, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -187852,13 +181574,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28920, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29004, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27995, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -187866,7 +181588,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -187881,7 +181603,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -188093,7 +181815,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 17197 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 17298 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -188103,7 +181825,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28924 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29008 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -188111,7 +181833,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28930 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29014 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -188231,7 +181953,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28939, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+29023, 0) } goto geopoly_update_end } @@ -188331,16 +182053,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28979) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29063) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28995) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29079) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -188410,7 +182132,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29172, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29256, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -188424,61 +182146,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29010, + FzName: __ccgo_ts + 29094, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29023, + FzName: __ccgo_ts + 29107, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29036, + FzName: __ccgo_ts + 29120, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29049, + FzName: __ccgo_ts + 29133, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28995, + FzName: __ccgo_ts + 29079, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 29061, + FzName: __ccgo_ts + 29145, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28979, + FzName: __ccgo_ts + 29063, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 29084, + FzName: __ccgo_ts + 29168, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29098, + FzName: __ccgo_ts + 29182, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 29111, + FzName: __ccgo_ts + 29195, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 29125, + FzName: __ccgo_ts + 29209, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29141, + FzName: __ccgo_ts + 29225, }, } @@ -188504,7 +182226,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 29153, + FzName: __ccgo_ts + 29237, }, } @@ -188529,20 +182251,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29180, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29264, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29190, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29274, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29201, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+29285, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28924, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29008, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29212, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29296, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -188616,7 +182338,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -188644,17 +182366,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26481, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26565, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -188662,33 +182386,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -188885,7 +182613,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -189306,248 +183034,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -189861,7 +183347,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+29222, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+29306, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -189871,7 +183357,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+29222, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+29306, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -189897,7 +183383,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -189920,7 +183406,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -190052,7 +183538,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+29243, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+29327, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -190141,7 +183627,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26394, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26478, zIn, uint64(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -190178,13 +183664,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.X__builtin___memset_chk(tls, pIter, 0, uint64(192), ^t__predefined_size_t(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29414 + v1 = __ccgo_ts + 29498 } else { v1 = __ccgo_ts + 1665 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29455, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29539, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29605) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29689) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -190351,7 +183837,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -190412,7 +183898,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29730, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29814, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -190422,7 +183908,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29849, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29933, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -190430,7 +183916,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29870, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29954, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -190442,7 +183928,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29921, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30005, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -190486,7 +183972,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.X__builtin___memcpy_chk(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol), ^t__predefined_size_t(0)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29942, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30026, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -190499,7 +183985,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.X__builtin___memset_chk(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol), ^t__predefined_size_t(0)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -190552,7 +184038,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20516, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20617, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -190563,7 +184049,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29999, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30083, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -190574,7 +184060,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+30018, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+30102, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -190582,7 +184068,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+30023, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+30107, zName) { bRbuRowid = int32(1) } } @@ -190596,17 +184082,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 30033 + v4 = __ccgo_ts + 30117 } else { - v4 = __ccgo_ts + 30046 + v4 = __ccgo_ts + 30130 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30055, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30139, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30084, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30168, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -190628,7 +184114,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30106, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30190, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -190674,8 +184160,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30217, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15547 goto _1 _1: ; @@ -190709,7 +184195,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30142, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30226, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -190757,21 +184243,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30155, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30239, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30187, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30271, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15493, __ccgo_ts+30210) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+30216, __ccgo_ts+30223, __ccgo_ts+5519) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15493, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15547, __ccgo_ts+30294) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+30300, __ccgo_ts+30307, __ccgo_ts+5545) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15547, __ccgo_ts+1665) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30231, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30315, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30273, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30357, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -190823,7 +184309,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1665 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -190845,15 +184331,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 30293 + zCol = __ccgo_ts + 30377 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30322, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30358, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15493 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+30385, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30406, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30442, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15547 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -190862,7 +184348,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30385, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30469, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { zSep = __ccgo_ts + 1665 iCol = 0 @@ -190879,15 +184365,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30433, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15493 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30517, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15547 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30440, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30524, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -190945,7 +184431,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1665 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -190954,7 +184440,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30452, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30536, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) zType = __ccgo_ts + 1665 } else { if iCid < 0 { @@ -190974,9 +184460,9 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 30293 + zCol = __ccgo_ts + 30377 } else { - zCol = __ccgo_ts + 30023 + zCol = __ccgo_ts + 30107 } } zType = __ccgo_ts + 1139 @@ -190984,24 +184470,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30474, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30558, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 30210 + v2 = __ccgo_ts + 30294 } else { v2 = __ccgo_ts + 1665 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30494, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30578, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30515, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30548, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30599, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30632, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15493 - zAnd = __ccgo_ts + 22625 + zCom = __ccgo_ts + 15547 + zAnd = __ccgo_ts + 22726 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -191055,11 +184541,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30572, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30656, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30584, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30668, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15493 + zS = __ccgo_ts + 15547 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -191071,7 +184557,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30677, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -191097,7 +184583,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30608, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30692, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { zSep = __ccgo_ts + 1665 @@ -191107,15 +184593,15 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30622, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22625 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30706, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22726 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30634, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30718, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -191125,8 +184611,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30684, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22625 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30768, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22726 } goto _2 _2: @@ -191149,7 +184635,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30697, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30781, 0) } // C documentation @@ -191191,16 +184677,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30684, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30768, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15547 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30723, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30807, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15547 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30753, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15493 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30837, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15547 } } } @@ -191284,16 +184770,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30790 + zSep = __ccgo_ts + 30874 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29942, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30026, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+17085) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+17186) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, zIdx))) } break } @@ -191304,16 +184790,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 30210 + v1 = __ccgo_ts + 30294 } else { v1 = __ccgo_ts + 1665 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30803, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15493 + z = _rbuMPrintf(tls, p, __ccgo_ts+30887, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15547 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30814, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30898, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -191359,7 +184845,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30818) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30902) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -191367,7 +184853,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29970, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30054, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -191376,21 +184862,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30868, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30952, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 30210 + v1 = __ccgo_ts + 30294 } else { v1 = __ccgo_ts + 1665 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30890, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15493 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30974, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15547 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30900, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30984, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30915, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30999, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, 0)) } } @@ -191427,7 +184913,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1665 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -191436,19 +184922,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1665 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30977 + zPk = __ccgo_ts + 31061 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30990 + v2 = __ccgo_ts + 31074 } else { v2 = __ccgo_ts + 1665 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31000, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15493 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+31084, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15547 goto _1 _1: ; @@ -191457,17 +184943,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31027, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+31111, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 31034 + v3 = __ccgo_ts + 31118 } else { v3 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31049, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31133, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, 0)) } } @@ -191493,7 +184979,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31081, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31165, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -191539,7 +185025,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+31138) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+31222) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -191708,7 +185194,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+31204, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+31288, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -191725,18 +185211,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31224, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31308, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31289, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31373, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31325, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31409, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -191751,26 +185237,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 31359 + v2 = __ccgo_ts + 31443 } else { - v2 = __ccgo_ts + 31363 + v2 = __ccgo_ts + 31447 } v1 = v2 } else { v1 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31369, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31453, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31430, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31514, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 31359 + v3 = __ccgo_ts + 31443 } else { - v3 = __ccgo_ts + 31363 + v3 = __ccgo_ts + 31447 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31491, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31575, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -191789,8 +185275,8 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7070) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7066) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7095) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+7091) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -191799,39 +185285,39 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { v4 = __ccgo_ts + 1665 } else { - v4 = __ccgo_ts + 31650 + v4 = __ccgo_ts + 31734 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31659 + v5 = __ccgo_ts + 31743 } else { v5 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31669, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31753, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31705, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31789, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { zRbuRowid = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31733 + zRbuRowid = __ccgo_ts + 31817 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31745 + v6 = __ccgo_ts + 31829 } else { v6 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31762, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31838, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31846, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31922, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32137, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32221, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -191842,9 +185328,9 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 32236 + v7 = __ccgo_ts + 32320 } else { - v7 = __ccgo_ts + 32246 + v7 = __ccgo_ts + 32330 } zRbuRowid1 = v7 } @@ -191857,14 +185343,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30293, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30377, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15493, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15547, __ccgo_ts+1665) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 32257 + v8 = __ccgo_ts + 32341 } else { v8 = __ccgo_ts + 1665 } @@ -191874,11 +185360,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1665 } if zOrder != 0 { - v10 = __ccgo_ts + 23881 + v10 = __ccgo_ts + 23982 } else { v10 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32263, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32347, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -191966,9 +185452,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31650 + zPrefix = __ccgo_ts + 31734 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32311, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32395, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -191995,7 +185481,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -192042,7 +185528,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32341, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32425, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -192101,27 +185587,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32371, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32455, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32399, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+3485, uint64(4), ^t__predefined_size_t(0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32483, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+3511, uint64(4), ^t__predefined_size_t(0)) } else { - libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+7059, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, p+48, __ccgo_ts+7084, uint64(4), ^t__predefined_size_t(0)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32417, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32501, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -192154,10 +185640,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32483, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32567, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+25224, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+25325, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -192173,14 +185659,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 32515 + v2 = __ccgo_ts + 32599 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1665 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32517, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32601, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -192191,27 +185677,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32549, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32633, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32564, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32648, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32581, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32665, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32597, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32681, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32625, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32709, 0) } } @@ -192261,7 +185747,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -192363,7 +185849,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -192393,7 +185879,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -192436,12 +185922,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -192463,21 +185949,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -192494,7 +185980,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32678, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32762, 0) } // C documentation @@ -192511,13 +185997,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7059) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+7084) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32703, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32710, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32787, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32794, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -192649,7 +186135,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24781, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24882, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -192785,7 +186271,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32717) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32801) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -192798,7 +186284,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32739, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32823, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -192825,7 +186311,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32766, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32850, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -192861,9 +186347,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32926, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+33010, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32941, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33025, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -192886,9 +186372,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32961, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33045, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32986) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33070) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -192899,10 +186385,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33094) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33178) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+33159) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+33243) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -192920,7 +186406,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33203, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33287, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -192947,8 +186433,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+18186) - _rbuCopyPragma(tls, p, __ccgo_ts+17281) + _rbuCopyPragma(tls, p, __ccgo_ts+18287) + _rbuCopyPragma(tls, p, __ccgo_ts+17382) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -192956,7 +186442,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33228, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33312, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -192978,10 +186464,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -192995,10 +186481,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -193068,7 +186554,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33256, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33340, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -193091,10 +186577,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32703, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32787, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7059, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+7084, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -193116,7 +186602,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+33281, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+33365, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -193163,7 +186649,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+33292, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+33376, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -193208,11 +186694,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33364, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33448, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33378) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33462) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -193221,7 +186707,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33435) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33519) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -193269,7 +186755,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.X__builtin___memcpy_chk(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1), ^t__predefined_size_t(0)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3864, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -193301,7 +186787,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33509, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33593, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -193323,17 +186809,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33541 + v3 = __ccgo_ts + 33625 } else { - v3 = __ccgo_ts + 33548 + v3 = __ccgo_ts + 33632 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33555, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33639, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15382, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15436, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -193345,21 +186831,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17900) - _rbuCopyPragma(tls, p, __ccgo_ts+17296) + _rbuCopyPragma(tls, p, __ccgo_ts+18001) + _rbuCopyPragma(tls, p, __ccgo_ts+17397) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33587, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33671, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+7059, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+7084, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33603, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33687, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -193437,7 +186923,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33627, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33711, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -193484,7 +186970,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31650, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31734, uint64(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -193512,16 +186998,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15397, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15451, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -193531,7 +187017,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33635, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33719, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -193632,32 +187118,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15397, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15451, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15397, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15451, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15382 + v1 = __ccgo_ts + 15436 } else { - v1 = __ccgo_ts + 33587 + v1 = __ccgo_ts + 33671 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33587, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33671, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -193683,9 +187169,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -193757,7 +187245,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -193960,7 +187448,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -194011,14 +187499,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.X__builtin___memset_chk(tls, zBuf, 0, libc.Uint64FromInt32(iAmt), ^t__predefined_size_t(0)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -195594,7 +189021,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33728, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33812, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -195617,13 +189044,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33736 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33820 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33745 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33829 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33750 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33834 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -195632,7 +189059,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -195721,12 +189148,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33760, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33844, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33915, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33999, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33929, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34013, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -195803,7 +189230,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33944, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+34028, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -195943,315 +189370,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -197004,7 +190122,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.X__builtin___memset_chk(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew)), ^t__predefined_size_t(0)) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -197097,11 +190215,11 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12117, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12171, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33951, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34035, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -197110,7 +190228,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34081, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34165, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -197136,10 +190254,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+30293)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+30377))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -197160,8 +190278,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+30293) - libc.X__builtin___memcpy_chk(tls, pAlloc, __ccgo_ts+30293, nName+uint64(1), ^t__predefined_size_t(0)) + nName = libc.Xstrlen(tls, __ccgo_ts+30377) + libc.X__builtin___memcpy_chk(tls, pAlloc, __ccgo_ts+30377, nName+uint64(1), ^t__predefined_size_t(0)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -197225,7 +190343,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -197242,6 +190360,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -197263,12 +190383,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12117, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12171, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -197558,10 +190678,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11737 + zSep = __ccgo_ts + 11791 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34111, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+34195, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -197573,8 +190693,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1666 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5489, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15493 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5515, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15547 goto _1 _1: ; @@ -197655,13 +190775,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -198153,14 +191266,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -198228,8 +191333,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34118, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22625 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34202, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22726 if zRet == uintptr(0) { break } @@ -198258,8 +191363,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34152, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 34193 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34236, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 34277 if zRet == uintptr(0) { break } @@ -198270,7 +191375,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1785, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1811, 0) } return zRet } @@ -198281,12 +191386,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 34198 + v1 = __ccgo_ts + 34282 } else { - v1 = __ccgo_ts + 7064 + v1 = __ccgo_ts + 7089 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34209, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34293, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -198347,11 +191452,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15493 + v2 = __ccgo_ts + 15547 } else { v2 = __ccgo_ts + 1665 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34288, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34372, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -198379,7 +191484,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34307, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34391, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -198408,17 +191513,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.X__builtin___memset_chk(tls, bp, 0, uint64(16), ^t__predefined_size_t(0)) @@ -198431,7 +191537,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -198442,18 +191550,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34448, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34479, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -198479,7 +191613,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34364, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34500, 0) } rc = int32(SQLITE_SCHEMA) } @@ -198527,7 +191661,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -198639,15 +191773,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -198811,7 +191947,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5551, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5577, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -199111,12 +192247,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34391, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12117, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34395, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34419, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34428, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34473, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34527, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+12171, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34531, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34555, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34564, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34609, bp) } else { i = 0 for { @@ -199124,17 +192260,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15493, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15547, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15493 + zSep = __ccgo_ts + 15547 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34487, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34623, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34491, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34627, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -199148,7 +192284,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34518, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34654, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -199269,7 +192405,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -199283,14 +192419,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34560, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34696, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -199359,8 +192495,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -199385,18 +192521,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34580, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34716, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -199420,28 +192556,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -199580,7 +192720,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -199595,9 +192735,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.X__builtin___memset_chk(tls, pRet, 0, uint64(152), ^t__predefined_size_t(0)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -199626,20 +192766,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -199651,13 +192795,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.X__builtin___memmove_chk(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove), ^t__predefined_size_t(0)) + libc.X__builtin___memmove_chk(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove), ^t__predefined_size_t(0)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -199813,7 +192958,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -199837,7 +192982,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -199852,7 +192997,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -199908,7 +193053,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -200013,7 +193158,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -200084,8 +193229,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -200119,7 +193264,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -200129,7 +193274,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -200208,7 +193353,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -200469,7 +193614,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -200546,7 +193691,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -200618,11 +193763,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -200634,8 +193779,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -200663,12 +193808,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -200676,9 +193825,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.X__builtin___memset_chk(tls, bp, 0, uint64(72), ^t__predefined_size_t(0)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -200691,14 +193840,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -200722,29 +193863,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -200821,7 +193939,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+12117) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+12171) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -200830,9 +193948,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 libc.X__builtin___memset_chk(tls, bp+8, 0, uint64(16), ^t__predefined_size_t(0)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.X__builtin___memcpy_chk(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4), ^t__predefined_size_t(0)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34598, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34734, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34611, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34747, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -200842,9 +193960,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34617, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34753, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15493 + zSep = __ccgo_ts + 15547 } goto _2 _2: @@ -200853,7 +193971,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1665 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34622, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34758, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -200862,13 +193980,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34630, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34766, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34705, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34841, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22726 } goto _3 _3: @@ -200955,9 +194073,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34711, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34847, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34622, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34758, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -200967,9 +194085,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34617, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34753, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22625 + zSep = __ccgo_ts + 22726 } goto _1 _1: @@ -200977,9 +194095,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34729, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34865, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34193, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34277, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -200989,16 +194107,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34705, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34841, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34737 + zSep = __ccgo_ts + 34873 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5519, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5545, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -201024,7 +194142,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+7059, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+7084, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -201047,16 +194165,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34742, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34878, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22631, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22732, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15493, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15547, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -201064,19 +194182,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34760, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34896, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34771, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34907, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5519, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5545, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -201099,12 +194217,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+12117, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+12171, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34775) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34911) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34888) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35024) } return rc } @@ -201148,7 +194266,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -201166,11 +194284,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -201347,7 +194465,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -201371,7 +194489,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -201386,7 +194504,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -201437,7 +194555,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -201477,10 +194595,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -201518,11 +194636,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -201545,7 +194663,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -201564,7 +194682,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -201573,7 +194691,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -201583,10 +194701,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35032, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35168, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -201596,10 +194714,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35053, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35189, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -201612,7 +194730,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -201639,7 +194757,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.X__builtin___memset_chk(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte, ^t__predefined_size_t(0)) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201667,7 +194785,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -201699,15 +194817,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35072, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35208, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35098, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35234, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -201731,9 +194849,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -201743,7 +194861,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+7059, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+7084, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -201762,18 +194880,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35128, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35264, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35172, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35308, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35243, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35379, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+12117) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+12171) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -201807,7 +194925,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -201816,7 +194934,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -201824,23 +194942,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.X__builtin___memset_chk(tls, bp+168, 0, uint64(152), ^t__predefined_size_t(0)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35303, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35439, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35333, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35469, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+35357, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+35333, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35493, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35469, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -201863,13 +194981,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -201878,11 +195000,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -201890,10 +195016,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -201901,37 +195033,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -201954,7 +195078,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -202324,7 +195448,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -202507,7 +195631,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -202542,8 +195666,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -202562,9 +195686,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -202616,7 +195740,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -202652,11 +195776,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -202669,18 +195799,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -202688,13 +195820,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -202736,12 +195870,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -202749,27 +195889,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -202924,7 +196055,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -203032,8 +196163,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -203045,9 +196176,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.X__builtin___memset_chk(tls, bp+24, 0, uint64(16), ^t__predefined_size_t(0)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -203121,21 +196252,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -203241,6 +196376,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -203286,24 +196422,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -203362,99 +196486,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -203476,14 +196507,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -203495,29 +196518,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -203573,15 +196579,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -203603,14 +196600,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -203681,7 +196670,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -203709,27 +196697,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -203760,7 +196739,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -204296,14 +197275,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -204314,16 +197285,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -204375,10 +197336,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -204484,12 +197445,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -204564,7 +197525,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35385, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35521, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -204920,7 +197881,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35413, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35549, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -205097,18 +198058,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -205191,22 +198140,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -205225,7 +198158,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35444, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35580, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -205324,7 +198257,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35451 + zErr = __ccgo_ts + 35587 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -205384,16 +198317,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -205412,7 +198335,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -205579,7 +198502,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35501 + zErr = __ccgo_ts + 35637 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -205761,15 +198684,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -205850,7 +198764,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -205942,13 +198856,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -205974,13 +198888,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35549 + z = __ccgo_ts + 35685 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35605 + z1 = __ccgo_ts + 35741 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -206013,19 +198927,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35663, + FzFunc: __ccgo_ts + 35799, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35671, + FzFunc: __ccgo_ts + 35807, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35681, + FzFunc: __ccgo_ts + 35817, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35686, + FzFunc: __ccgo_ts + 35822, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -206413,7 +199327,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -206500,21 +199414,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -206823,13 +199722,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -206889,7 +199781,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35702, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35838, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -206915,12 +199807,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35709, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35845, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35740, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35876, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -206929,7 +199821,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35773, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35909, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -206939,14 +199831,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35810, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35946, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35819, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35955, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -206973,7 +199865,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35852, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35988, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -206985,76 +199877,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35886, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36022, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35894, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35926, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36062, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35932, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36068, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35951, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36087, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35994, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36130, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35951, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36087, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36016, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36152, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36166, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36068, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36204, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36079, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36215, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36114, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36250, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36257, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5928, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5954, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8753, + FzName: __ccgo_ts + 8778, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 18266, + FzName: __ccgo_ts + 18367, }, 2: { - FzName: __ccgo_ts + 36152, + FzName: __ccgo_ts + 36288, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -207062,20 +199954,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36160, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36296, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36191, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36327, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36201, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36337, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36235, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36371, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -207136,16 +200028,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36263) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+17197) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36268, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36399) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+17298) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36404, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36298) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36434) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36308, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36444, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -207171,7 +200063,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36339, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36475, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -207179,12 +200071,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36344, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36480, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36351, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36487, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36495, 0) } } goto _1 @@ -207200,9 +200092,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36366, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36502, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36359, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36495, 0) } goto _2 _2: @@ -207265,8 +200157,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36263) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36374, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36399) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36510, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -207297,7 +200189,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36403, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36539, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -207327,7 +200219,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36423, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36559, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -207335,37 +200227,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36473, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36609, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36528, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36664, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35886 + zTail = __ccgo_ts + 36022 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35886 + zTail = __ccgo_ts + 36022 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36581 + zTail = __ccgo_ts + 36717 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36589, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36725, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+17197, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+17298, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -207434,7 +200326,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36600, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36736, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -207443,16 +200335,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 15493 + v2 = __ccgo_ts + 15547 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36616, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36752, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36623, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36263)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36759, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36399)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -207485,7 +200377,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -207495,9 +200387,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -207610,7 +200502,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36649) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36785) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -207621,7 +200513,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36654) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36790) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -207632,7 +200524,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36663) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36799) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -207646,7 +200538,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36673) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36809) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -207657,7 +200549,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36683) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36819) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -207674,7 +200566,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36695) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36831) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -207689,7 +200581,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36263) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36399) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -207704,7 +200596,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36707) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36843) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -207720,7 +200612,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36721) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36857) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -207763,7 +200655,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36731 + zSelect = __ccgo_ts + 36867 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -207783,7 +200675,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36763) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36899) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -207794,7 +200686,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36771, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36907, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -207859,112 +200751,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -208040,7 +200826,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36842, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36978, 0) return FTS5_EOF } goto _1 @@ -208051,7 +200837,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36862, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36998, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -208066,13 +200852,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36893, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37029, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36896, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37032, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31359, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31443, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -208116,7 +200902,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -208649,16 +201435,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -208683,14 +201459,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -209755,7 +202523,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -209765,7 +202533,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -209811,14 +202579,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -209871,12 +202631,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.X__builtin___memset_chk(tls, pNew, 0, uint64(72), ^t__predefined_size_t(0)) + libc.X__builtin___memset_chk(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40), ^t__predefined_size_t(0)) } v3 = pNew pPhrase = v3 @@ -210010,7 +202770,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -210050,15 +202810,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.X__builtin___memcpy_chk(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte), ^t__predefined_size_t(0)) @@ -210099,7 +202859,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -210137,8 +202897,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36900, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35413, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+37036, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35549, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -210158,10 +202918,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36905, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37041, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -210195,7 +202958,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -210245,7 +203008,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -210296,7 +203059,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21628, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21729, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -210323,7 +203086,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.X__builtin___memcpy_chk(tls, pRet, pOrig, libc.Uint64FromInt64(nByte), ^t__predefined_size_t(0)) @@ -210420,7 +203183,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36934, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37070, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -210505,7 +203268,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -210518,7 +203281,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -210592,7 +203355,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -210618,11 +203381,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36987 + v2 = __ccgo_ts + 37123 } else { - v2 = __ccgo_ts + 36900 + v2 = __ccgo_ts + 37036 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36994, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37130, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -210635,7 +203398,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37044, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37180, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -210756,14 +203519,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -210779,7 +203534,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.X__builtin___memset_chk(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase), ^t__predefined_size_t(0)) i = 0 @@ -210803,14 +203558,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -211112,7 +203859,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -211175,67 +203922,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -211373,7 +204060,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -211685,7 +204372,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -212117,9 +204804,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -212156,7 +204843,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -212229,7 +204915,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -212264,7 +204949,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -212279,149 +204963,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -212429,187 +204977,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -212789,7 +205157,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37097, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37233, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -212894,7 +205262,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+37103, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+37239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -212923,7 +205291,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+37154, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+37290, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -212957,7 +205325,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+37203, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+37339, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -213035,7 +205403,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.X__builtin___memcpy_chk(tls, pNew, p, libc.Uint64FromInt64(nByte), ^t__predefined_size_t(0)) @@ -213126,7 +205494,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+37243, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+37379, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -213137,7 +205505,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.X__builtin___memcpy_chk(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+37243, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+37379, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -213818,7 +206186,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -214063,15 +206431,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -214172,7 +206540,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -214778,7 +207146,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37271, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37407, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -214867,7 +207235,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37355, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37491, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -215514,7 +207882,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -215540,14 +207908,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -215557,15 +207917,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -215679,7 +208030,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -215700,7 +208051,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -216424,7 +208775,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -216838,7 +209189,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37437, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37573, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -217293,13 +209644,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -217344,7 +209688,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37494, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37630, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -217513,7 +209857,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -217831,7 +210175,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37555, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37691, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -218106,7 +210450,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -218141,7 +210485,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -218420,16 +210764,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -218647,7 +210981,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -218684,7 +211018,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -218695,70 +211029,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -218827,7 +211098,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -218926,14 +211197,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -218980,19 +211243,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -219071,7 +211321,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -219121,7 +211371,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -219203,15 +211453,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.X__builtin___memset_chk(tls, bp, 0, uint64(48), ^t__predefined_size_t(0)) + pTmp = bp + libc.X__builtin___memset_chk(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16), ^t__predefined_size_t(0)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1665, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -219237,11 +211490,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37606, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37742, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26394, __ccgo_ts+37614, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26478, __ccgo_ts+37750, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12328, __ccgo_ts+37649, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12382, __ccgo_ts+37785, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -219439,7 +211692,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -219694,7 +211947,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37693) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37829) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -220045,7 +212298,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -220167,7 +212420,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -220287,7 +212540,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37097, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+37233, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -220881,7 +213134,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37695, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37831, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -221112,7 +213365,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37781) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37917) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -221251,7 +213504,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -221306,87 +213558,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -221394,96 +213565,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -221734,7 +213815,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37786, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37922, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -221771,7 +213852,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5551, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5577, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -221790,7 +213871,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5551, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5577, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -222240,7 +214321,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -222268,7 +214349,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -222288,7 +214369,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -222303,7 +214384,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15493 + v1 = __ccgo_ts + 15547 } else { v1 = __ccgo_ts + 1665 } @@ -222313,11 +214394,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1665 } if bDesc != 0 { - v3 = __ccgo_ts + 37825 + v3 = __ccgo_ts + 37961 } else { - v3 = __ccgo_ts + 37830 + v3 = __ccgo_ts + 37966 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37834, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37970, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -222375,14 +214456,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37889, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+38025, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5910, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5936, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37895, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38031, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -222432,7 +214513,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37923, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38059, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -222465,7 +214546,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37933, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38069, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -222499,7 +214580,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37954, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38090, libc.VaList(bp+24, z)) } } } else { @@ -222507,7 +214588,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35681 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35817 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -222664,7 +214745,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37987, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38123, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -222864,7 +214945,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37992, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+38128, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -222997,10 +215078,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -225536,12 +217554,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39341, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39477, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39445, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39483, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39619, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -225550,7 +217568,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39521, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39657, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -225562,14 +217580,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26394, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12328, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38675, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26478, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12382, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38811, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36581, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36717, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35886, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36022, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -225589,13 +217607,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 31034 + v1 = __ccgo_ts + 31118 } else { v1 = __ccgo_ts + 1665 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39563, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39699, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39593, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39729, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -225636,7 +217654,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39637, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39773, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -225644,7 +217662,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39660, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39796, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -225659,7 +217677,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39666, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39802, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -225668,22 +217686,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35886, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36022, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39672 + zCols = __ccgo_ts + 39808 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39704 + zCols = __ccgo_ts + 39840 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36581, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36717, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38675, __ccgo_ts+39752, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38811, __ccgo_ts+39888, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36763, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36899, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -225728,14 +217746,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -225805,14 +217815,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -225840,6 +217850,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -225852,11 +217863,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -225869,6 +217893,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -226103,12 +218128,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39769, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39905, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39819, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39955, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39848, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39984, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -226116,7 +218141,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36763, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36899, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -226418,7 +218443,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39877, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+40013, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -226451,17 +218476,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -226548,7 +218562,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.X__builtin___memset_chk(tls, bp, 0, uint64(40), ^t__predefined_size_t(0)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -226650,14 +218664,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35886, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+36022, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -227309,11 +219305,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39931 + zCat = __ccgo_ts + 40067 libc.X__builtin___memset_chk(tls, p, 0, uint64(192), ^t__predefined_size_t(0)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -227323,7 +219319,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39940) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40076) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -227340,20 +219336,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39951) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40087) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*int8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39909) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40045) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39920) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40056) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39940) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40076) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -227389,7 +219385,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -227576,7 +219572,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -227604,14 +219600,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]int8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -227645,7 +219633,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39969 + zBase = __ccgo_ts + 40105 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -227689,14 +219677,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -227707,16 +219687,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -227862,64 +219832,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40115, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39982, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40118, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39987, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40123, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39992, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40128, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39995, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40131, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40134, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40003, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40139, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40008, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40144, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40012, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40148, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40018, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40154, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40023, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40159, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -227928,49 +219898,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40027, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40163, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40031, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40167, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40034, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40170, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40038, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40174, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40042, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40178, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40046, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40182, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40050, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40186, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40054, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40190, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -227987,20 +219957,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40058, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40194, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40061, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40064, uint64(3), ^t__predefined_size_t(0)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40197, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40200, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40068, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40054, uint64(3), ^t__predefined_size_t(0)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40204, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40190, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -228016,75 +219986,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40071, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40207, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40079, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40215, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40086, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40222, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40091, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40227, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39987, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40123, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40096, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40232, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39982, uint64(4), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40118, uint64(4), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40101, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40237, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40054, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40190, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40106, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40242, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16396, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16497, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40111, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40247, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40064, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40200, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40115, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40251, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40120, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40256, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40023, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40159, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40126, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40262, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40130, uint64(1), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40266, uint64(1), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40132, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40268, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40046, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40182, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -228093,48 +220063,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40138, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40274, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40054, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40190, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40146, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40282, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40152, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40288, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40038, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40174, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40157, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40293, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40163, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40299, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40050, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40186, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40171, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40307, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40179, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40315, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40183, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40319, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40046, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40182, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -228142,21 +220112,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40191, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40327, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40197, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40333, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40050, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40186, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40203, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40339, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40064, uint64(3), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+40200, uint64(3), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -228174,48 +220144,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40210, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40346, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40131, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40215, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40351, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40220, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40356, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40131, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40226, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40362, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39995, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40131, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40179, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40315, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40232, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40368, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40238, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40374, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39979, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40115, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -228231,13 +220201,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40244, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40380, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40248, uint64(2), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40384, uint64(2), ^t__predefined_size_t(0)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40251, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40387, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -228245,7 +220215,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40254, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40390, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -228342,14 +220312,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -228367,13 +220337,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -228410,14 +220373,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40258) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40394) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39951) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40087) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -228455,7 +220418,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -228583,7 +220546,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -228659,11 +220622,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -228685,7 +220648,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40273)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40409)) } // C documentation @@ -228711,7 +220674,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39969, + FzName: __ccgo_ts + 40105, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -228719,7 +220682,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 40281, + FzName: __ccgo_ts + 40417, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -228727,7 +220690,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 40273, + FzName: __ccgo_ts + 40409, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -228757,7 +220720,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40287, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40423, pApi, bp+96, uintptr(0)) } return rc } @@ -234218,39 +226181,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -234273,16 +226203,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40294) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40430) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40298) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40434) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40302) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40438) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40311, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40447, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -234345,21 +226275,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 40345, - 1: __ccgo_ts + 40385, - 2: __ccgo_ts + 40420, + 0: __ccgo_ts + 40481, + 1: __ccgo_ts + 40521, + 2: __ccgo_ts + 40556, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24370, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24471, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40463, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -234380,23 +226311,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab), ^t__predefined_size_t(0)) - libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab), ^t__predefined_size_t(0)) + libc.X__builtin___memcpy_chk(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb), ^t__predefined_size_t(0)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -234529,10 +226460,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40496, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40632, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40527, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40663, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -234551,7 +226482,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40578, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40714, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -235001,7 +226932,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40604, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40740, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -235056,15 +226987,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40614 + return __ccgo_ts + 40750 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -235229,9 +227160,7 @@ var Xsqlite3_temp_directory uintptr *===-----------------------------------------------------------------------=== */ -/* FIXME: This is using the placeholder dates Clang produces for these macros - in C2x mode; switch to the correct values once they've been published. */ -/* Versions before C2x do require the second parameter. */ +/* Versions before C23 do require the second parameter. */ /*===---- __stdarg___va_copy.h - Definition of __va_copy -------------------=== * @@ -235317,7 +227246,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -235365,11 +227294,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-16.0.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00S\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00hfs\x00ufs\x00afpfs\x00smbfs\x00webdav\x00nfs\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00msdos\x00exfat\x00SQLITE_FORCE_PROXY_LOCKING\x00:auto:\x00fsync\x00/dev/urandom\x00sqliteplocks\x00/\x00dummy\x00break\x00path error (len %d)\x00read error (len %d)\x00create failed (%d)\x00write failed (%d)\x00rename failed (%d)\x00broke stale lock on %s\n\x00failed to break stale lock on %s, %s\n\x00-conch\x00.lock\x00:auto: (not held)\x00unix\x00unix-none\x00unix-dotfile\x00unix-posix\x00unix-flock\x00unix-afp\x00unix-nfs\x00unix-proxy\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dylib\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_proxy_file\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00failed to set lock proxy file\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-17.0.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00S\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00hfs\x00ufs\x00afpfs\x00smbfs\x00webdav\x00nfs\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00msdos\x00exfat\x00SQLITE_FORCE_PROXY_LOCKING\x00:auto:\x00fsync\x00/dev/urandom\x00sqliteplocks\x00/\x00dummy\x00break\x00path error (len %d)\x00read error (len %d)\x00create failed (%d)\x00write failed (%d)\x00rename failed (%d)\x00broke stale lock on %s\n\x00failed to break stale lock on %s, %s\n\x00-conch\x00.lock\x00:auto: (not held)\x00unix\x00unix-none\x00unix-dotfile\x00unix-posix\x00unix-flock\x00unix-afp\x00unix-nfs\x00unix-proxy\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dylib\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00lock_proxy_file\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00failed to set lock proxy file\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_386.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_386.go index 3fc6a83..8d6fc99 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_386.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_386.go @@ -113738,8 +113738,8 @@ var mu mutex func init() { mu.recursive = true } func Xsqlite3_initialize(tls *libc.TLS) int32 { - mu.enter(tls.ID) - defer mu.leave(tls.ID) + mutexEnter(tls, uintptr(unsafe.Pointer(&mu))) + defer mutexLeave(tls, uintptr(unsafe.Pointer(&mu))) var pMainMtx uintptr var rc int32 diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go index a4ab7ca..ffb049e 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_amd64.go @@ -1,4 +1,4 @@ -// Code generated for freebsd/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/freebsd/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/freebsd/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/freebsd/amd64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. +// Code generated for freebsd/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/freebsd/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/freebsd/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/freebsd/amd64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. //go:build freebsd && amd64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -29,7 +31,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -83,6 +84,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -1355,6 +1357,7 @@ const SESSIONS_ROWID = "_rowid_" const SESSIONS_STRM_CHUNK_SIZE = 1024 const SESSION_MAX_BUFFER_SZ = 2147483391 const SESSION_UPDATE_CACHE_SZ = 12 +const SFBSD_NAMEDATTR = 1 const SF_APPEND = 262144 const SF_ARCHIVED = 65536 const SF_Aggregate = 8 @@ -1421,6 +1424,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1660,6 +1664,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1870,6 +1875,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -2032,6 +2038,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2040,7 +2047,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2150,8 +2157,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -2977,6 +2984,7 @@ const __DBL_MAX__ = 0 const __DBL_MIN_10_EXP__ = -307 const __DBL_MIN_EXP__ = -1021 const __DBL_MIN__ = 0 +const __DBL_NORM_MAX__ = 0 const __DECIMAL_DIG__ = 17 const __ELF__ = 1 const __EXT1_VISIBLE = 1 @@ -2996,6 +3004,7 @@ const __FLT16_MAX__ = 0 const __FLT16_MIN_10_EXP__ = -4 const __FLT16_MIN_EXP__ = -13 const __FLT16_MIN__ = 0 +const __FLT16_NORM_MAX__ = 0 const __FLT_DECIMAL_DIG__ = 9 const __FLT_DENORM_MIN__ = 0 const __FLT_DIG__ = 6 @@ -3010,6 +3019,7 @@ const __FLT_MAX__ = 0 const __FLT_MIN_10_EXP__ = -37 const __FLT_MIN_EXP__ = -125 const __FLT_MIN__ = 0 +const __FLT_NORM_MAX__ = 0 const __FLT_RADIX__ = 2 const __FPCLASS_NEGINF = 4 const __FPCLASS_NEGNORMAL = 8 @@ -3037,6 +3047,8 @@ const __GCC_ATOMIC_POINTER_LOCK_FREE = 2 const __GCC_ATOMIC_SHORT_LOCK_FREE = 2 const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1 const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2 +const __GCC_CONSTRUCTIVE_SIZE = 64 +const __GCC_DESTRUCTIVE_SIZE = 64 const __GCC_HAVE_DWARF2_CFI_ASM = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1 @@ -3122,7 +3134,7 @@ const __INT_MAX = 2147483647 const __INT_MAX__ = 2147483647 const __INT_MIN = -2147483648 const __INT_WIDTH__ = 32 -const __ISO_C_VISIBLE = 2011 +const __ISO_C_VISIBLE = 2023 const __KPRINTF_ATTRIBUTE__ = 1 const __LDBL_DECIMAL_DIG__ = 17 const __LDBL_DENORM_MIN__ = 0 @@ -3138,6 +3150,7 @@ const __LDBL_MAX__ = 0 const __LDBL_MIN_10_EXP__ = -307 const __LDBL_MIN_EXP__ = -1021 const __LDBL_MIN__ = 0 +const __LDBL_NORM_MAX__ = 0 const __LITTLE_ENDIAN__ = 1 const __LLONG_MAX = 9223372036854775807 const __LLONG_MIN = -9223372036854775808 @@ -3171,7 +3184,7 @@ const __ORDER_BIG_ENDIAN__ = 4321 const __ORDER_LITTLE_ENDIAN__ = 1234 const __ORDER_PDP_ENDIAN__ = 3412 const __POINTER_WIDTH__ = 64 -const __POSIX_VISIBLE = 200809 +const __POSIX_VISIBLE = 202405 const __PRAGMA_REDEFINE_EXTNAME = 1 const __PRETTY_FUNCTION__ = 0 const __PTRDIFF_FMTd__ = "ld" @@ -3234,6 +3247,9 @@ const __SSE_MATH__ = 1 const __SSE__ = 1 const __SSIZE_MAX = 9223372036854775807 const __SSTR = 512 +const __STDC_EMBED_EMPTY__ = 2 +const __STDC_EMBED_FOUND__ = 1 +const __STDC_EMBED_NOT_FOUND__ = 0 const __STDC_HOSTED__ = 1 const __STDC_MB_MIGHT_NEQ_WC__ = 1 const __STDC_UTF_16__ = 1 @@ -3322,7 +3338,7 @@ const __ULLONG_MAX = 18446744073709551615 const __ULONG_MAX = 18446744073709551615 const __UQUAD_MAX = 18446744073709551615 const __USHRT_MAX = 65535 -const __VERSION__ = "FreeBSD Clang 18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15a9eac9)" +const __VERSION__ = "FreeBSD Clang 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)" const __WCHAR_MAX = 2147483647 const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN = -2147483648 @@ -3332,15 +3348,15 @@ const __WINT_MAX__ = 2147483647 const __WINT_TYPE__ = 0 const __WINT_WIDTH__ = 32 const __WORD_BIT = 32 -const __XSI_VISIBLE = 700 +const __XSI_VISIBLE = 800 const __amd64 = 1 const __amd64__ = 1 const __clang__ = 1 const __clang_literal_encoding__ = "UTF-8" -const __clang_major__ = 18 +const __clang_major__ = 19 const __clang_minor__ = 1 -const __clang_patchlevel__ = 5 -const __clang_version__ = "18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15a9eac9)" +const __clang_patchlevel__ = 7 +const __clang_version__ = "19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)" const __clang_wide_literal_encoding__ = "UTF-32" const __code_model_small__ = 1 const __const = 0 @@ -3359,6 +3375,7 @@ const __tune_k8__ = 1 const __unix = 1 const __unix__ = 1 const __volatile = 0 +const __writeonly = "__unused" const __x86_64 = 1 const __x86_64__ = 1 const bBatch = 0 @@ -3368,6 +3385,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3377,9 +3397,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3984,12 +4001,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -4118,30 +4129,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - // C documentation // // /* @@ -4423,6 +4410,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4653,33 +4641,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4758,19 +4719,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4855,7 +4803,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4947,223 +4894,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
column OP expr
-** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5245,20 +4975,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5308,13 +5024,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5373,9 +5082,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5383,17 +5092,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5420,12 +5129,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
createFlag Behavior when page is not already in cache // **
0 Do not allocate a new page. Return NULL. -// **
1 Allocate a new page if it easy and convenient to do so. +// **
1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5442,7 +5151,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5460,7 +5169,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5494,24 +5203,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5535,22 +5226,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5611,7 +5286,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5691,50 +5366,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6131,340 +5762,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6474,15 +5771,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6498,14 +5786,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6531,17 +5811,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6596,11 +5865,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6974,55 +6249,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tfpos_t = int64 type fpos_t = Tfpos_t @@ -7290,6 +6521,11 @@ type _RuneLocale = T_RuneLocale ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7348,6 +6584,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7457,14 +6704,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7549,7 +6788,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7651,7 +6890,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -7710,6 +6948,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -7721,9 +6960,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -7738,7 +6977,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7787,8 +7025,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -7852,7 +7090,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7924,19 +7161,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7950,11 +7190,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7965,40 +7202,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -8016,7 +7254,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8028,6 +7266,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8176,9 +7415,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -8195,10 +7434,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -8233,6 +7468,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8413,7 +7649,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8455,7 +7690,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8628,9 +7862,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8757,53 +7991,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8907,16 +8094,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8940,38 +8117,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8984,34 +8134,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -9025,90 +8151,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -9127,187 +8169,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9317,913 +8178,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10248,611 +8202,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10862,317 +8211,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11258,228 +8296,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -12562,7 +9378,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12640,72 +9455,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12751,164 +9504,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - -/* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - /* -** Clear any existing type flags from a Mem and replace them with f +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -12934,18 +9534,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12962,100 +9550,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -13077,13 +9571,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -13103,14 +9590,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -13189,7 +9669,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13361,7 +9841,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13419,7 +9899,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13554,24 +10034,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13748,7 +10210,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -13819,10 +10281,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -13958,7 +10420,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -14055,7 +10517,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -14196,10 +10658,10 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = 0 _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1210, -int32(1)) @@ -14210,7 +10672,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -14288,7 +10750,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -14436,7 +10898,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14739,7 +11201,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -14896,7 +11358,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -14944,7 +11406,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -15049,7 +11511,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -15565,28 +12027,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15594,19 +12056,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15623,12 +12085,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15636,7 +12098,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15649,34 +12111,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15778,7 +12240,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -15989,14 +12451,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -16011,9 +12466,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -16427,7 +12882,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16757,6 +13216,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16764,8 +13225,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17752,17 +14213,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -17959,22 +14420,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -18223,11 +14685,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18255,7 +14717,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18277,7 +14739,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18704,29 +15166,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint32(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18841,25 +15281,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1666 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1666 } else { - v98 = __ccgo_ts + 1671 + v97 = __ccgo_ts + 1671 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18867,15 +15311,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -18886,13 +15330,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18906,35 +15383,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1678, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if libc.Int32FromUint8(libc.Uint8FromInt8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -18959,9 +15499,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18975,7 +15515,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1678, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1704, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18985,21 +15525,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1680, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1706, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1690, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1716, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1711, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1737, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -19238,7 +15778,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -19537,6 +16077,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19554,11 +16096,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -19992,63 +16534,10 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr _ = p *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -20057,11 +16546,11 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui return int32(SQLITE_NOMEM) } if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn } else { (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -20192,6 +16681,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = libc.Int8FromUint8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20942,7 +17462,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -21117,7 +17637,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1725, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1751, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21329,11 +17849,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -21569,7 +18089,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -21659,7 +18179,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1750 + pow63 = __ccgo_ts + 1776 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21886,7 +18406,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1769)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1795)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22046,7 +18566,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1785 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1811 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -22155,7 +18675,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22566,7 +19086,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1787, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1813, libc.VaList(bp+8, zType)) } // C documentation @@ -22595,7 +19115,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1832) + _logBadConnection(tls, __ccgo_ts+1858) } return 0 } else { @@ -22609,7 +19129,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1841) + _logBadConnection(tls, __ccgo_ts+1867) return 0 } else { return int32(1) @@ -22694,7 +19214,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -23049,23 +19569,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -23120,8 +19638,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -23154,9 +19672,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -23176,13 +19693,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -23190,7 +19706,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -23206,7 +19722,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -23218,7 +19734,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -23267,7 +19783,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -23277,20 +19793,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -23309,196 +19824,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1849, - 1: __ccgo_ts + 1859, - 2: __ccgo_ts + 1870, - 3: __ccgo_ts + 1882, - 4: __ccgo_ts + 1893, - 5: __ccgo_ts + 1905, - 6: __ccgo_ts + 1912, - 7: __ccgo_ts + 1920, - 8: __ccgo_ts + 1928, - 9: __ccgo_ts + 1933, - 10: __ccgo_ts + 1938, - 11: __ccgo_ts + 1944, - 12: __ccgo_ts + 1958, - 13: __ccgo_ts + 1964, - 14: __ccgo_ts + 1974, - 15: __ccgo_ts + 1979, - 16: __ccgo_ts + 1984, - 17: __ccgo_ts + 1987, - 18: __ccgo_ts + 1993, - 19: __ccgo_ts + 2000, - 20: __ccgo_ts + 2004, - 21: __ccgo_ts + 2014, - 22: __ccgo_ts + 2021, - 23: __ccgo_ts + 2028, - 24: __ccgo_ts + 2035, - 25: __ccgo_ts + 2042, - 26: __ccgo_ts + 2052, - 27: __ccgo_ts + 2061, - 28: __ccgo_ts + 2072, - 29: __ccgo_ts + 2081, - 30: __ccgo_ts + 2087, - 31: __ccgo_ts + 2097, - 32: __ccgo_ts + 2107, - 33: __ccgo_ts + 2112, - 34: __ccgo_ts + 2126, - 35: __ccgo_ts + 2137, - 36: __ccgo_ts + 2142, - 37: __ccgo_ts + 2149, - 38: __ccgo_ts + 2160, - 39: __ccgo_ts + 2165, - 40: __ccgo_ts + 2170, - 41: __ccgo_ts + 2176, - 42: __ccgo_ts + 2182, - 43: __ccgo_ts + 2188, - 44: __ccgo_ts + 2191, - 45: __ccgo_ts + 2195, - 46: __ccgo_ts + 2201, - 47: __ccgo_ts + 2212, - 48: __ccgo_ts + 2223, - 49: __ccgo_ts + 2231, - 50: __ccgo_ts + 2240, - 51: __ccgo_ts + 2246, - 52: __ccgo_ts + 2253, - 53: __ccgo_ts + 2261, - 54: __ccgo_ts + 2264, - 55: __ccgo_ts + 2267, - 56: __ccgo_ts + 2270, - 57: __ccgo_ts + 2273, - 58: __ccgo_ts + 2276, - 59: __ccgo_ts + 2279, - 60: __ccgo_ts + 2286, - 61: __ccgo_ts + 2296, - 62: __ccgo_ts + 2309, - 63: __ccgo_ts + 2320, - 64: __ccgo_ts + 2326, - 65: __ccgo_ts + 2333, - 66: __ccgo_ts + 2342, - 67: __ccgo_ts + 2351, - 68: __ccgo_ts + 2358, - 69: __ccgo_ts + 2371, - 70: __ccgo_ts + 2382, - 71: __ccgo_ts + 2387, - 72: __ccgo_ts + 2395, - 73: __ccgo_ts + 2401, - 74: __ccgo_ts + 2408, - 75: __ccgo_ts + 2420, - 76: __ccgo_ts + 2425, - 77: __ccgo_ts + 2434, - 78: __ccgo_ts + 2439, - 79: __ccgo_ts + 2448, - 80: __ccgo_ts + 2453, - 81: __ccgo_ts + 2458, - 82: __ccgo_ts + 2464, - 83: __ccgo_ts + 2472, - 84: __ccgo_ts + 2480, - 85: __ccgo_ts + 2490, - 86: __ccgo_ts + 2498, - 87: __ccgo_ts + 2505, - 88: __ccgo_ts + 2518, - 89: __ccgo_ts + 2523, - 90: __ccgo_ts + 2535, - 91: __ccgo_ts + 2543, - 92: __ccgo_ts + 2550, - 93: __ccgo_ts + 2561, - 94: __ccgo_ts + 2568, - 95: __ccgo_ts + 2575, - 96: __ccgo_ts + 2585, - 97: __ccgo_ts + 2594, - 98: __ccgo_ts + 2605, - 99: __ccgo_ts + 2611, - 100: __ccgo_ts + 2622, - 101: __ccgo_ts + 2632, - 102: __ccgo_ts + 2642, - 103: __ccgo_ts + 2651, - 104: __ccgo_ts + 2658, - 105: __ccgo_ts + 2664, - 106: __ccgo_ts + 2674, - 107: __ccgo_ts + 2685, - 108: __ccgo_ts + 2689, - 109: __ccgo_ts + 2698, - 110: __ccgo_ts + 2707, - 111: __ccgo_ts + 2714, - 112: __ccgo_ts + 2724, - 113: __ccgo_ts + 2731, - 114: __ccgo_ts + 2741, - 115: __ccgo_ts + 2749, - 116: __ccgo_ts + 2756, - 117: __ccgo_ts + 2770, - 118: __ccgo_ts + 2784, - 119: __ccgo_ts + 2792, - 120: __ccgo_ts + 2803, - 121: __ccgo_ts + 2816, - 122: __ccgo_ts + 2827, - 123: __ccgo_ts + 2833, - 124: __ccgo_ts + 2845, - 125: __ccgo_ts + 2854, - 126: __ccgo_ts + 2862, - 127: __ccgo_ts + 2871, - 128: __ccgo_ts + 2880, - 129: __ccgo_ts + 2887, - 130: __ccgo_ts + 2895, - 131: __ccgo_ts + 2902, - 132: __ccgo_ts + 2913, - 133: __ccgo_ts + 2927, - 134: __ccgo_ts + 2938, - 135: __ccgo_ts + 2946, - 136: __ccgo_ts + 2952, - 137: __ccgo_ts + 2960, - 138: __ccgo_ts + 2968, - 139: __ccgo_ts + 2978, - 140: __ccgo_ts + 2991, - 141: __ccgo_ts + 3001, - 142: __ccgo_ts + 3014, - 143: __ccgo_ts + 3023, - 144: __ccgo_ts + 3034, - 145: __ccgo_ts + 3042, - 146: __ccgo_ts + 3048, - 147: __ccgo_ts + 3060, - 148: __ccgo_ts + 3072, - 149: __ccgo_ts + 3080, - 150: __ccgo_ts + 3092, - 151: __ccgo_ts + 3105, - 152: __ccgo_ts + 3115, - 153: __ccgo_ts + 3125, - 154: __ccgo_ts + 3137, - 155: __ccgo_ts + 3142, - 156: __ccgo_ts + 3154, - 157: __ccgo_ts + 3164, - 158: __ccgo_ts + 3170, - 159: __ccgo_ts + 3180, - 160: __ccgo_ts + 3187, - 161: __ccgo_ts + 3199, - 162: __ccgo_ts + 3210, - 163: __ccgo_ts + 3218, - 164: __ccgo_ts + 3227, - 165: __ccgo_ts + 3236, - 166: __ccgo_ts + 3245, - 167: __ccgo_ts + 3252, - 168: __ccgo_ts + 3263, - 169: __ccgo_ts + 3276, - 170: __ccgo_ts + 3286, - 171: __ccgo_ts + 3293, - 172: __ccgo_ts + 3301, - 173: __ccgo_ts + 3310, - 174: __ccgo_ts + 3316, - 175: __ccgo_ts + 3323, - 176: __ccgo_ts + 3331, - 177: __ccgo_ts + 3339, - 178: __ccgo_ts + 3347, - 179: __ccgo_ts + 3357, - 180: __ccgo_ts + 3366, - 181: __ccgo_ts + 3377, - 182: __ccgo_ts + 3388, - 183: __ccgo_ts + 3399, - 184: __ccgo_ts + 3409, - 185: __ccgo_ts + 3415, - 186: __ccgo_ts + 3426, - 187: __ccgo_ts + 3437, - 188: __ccgo_ts + 3442, - 189: __ccgo_ts + 3450, + 0: __ccgo_ts + 1875, + 1: __ccgo_ts + 1885, + 2: __ccgo_ts + 1896, + 3: __ccgo_ts + 1908, + 4: __ccgo_ts + 1919, + 5: __ccgo_ts + 1931, + 6: __ccgo_ts + 1938, + 7: __ccgo_ts + 1946, + 8: __ccgo_ts + 1954, + 9: __ccgo_ts + 1959, + 10: __ccgo_ts + 1964, + 11: __ccgo_ts + 1970, + 12: __ccgo_ts + 1984, + 13: __ccgo_ts + 1990, + 14: __ccgo_ts + 2000, + 15: __ccgo_ts + 2005, + 16: __ccgo_ts + 2010, + 17: __ccgo_ts + 2013, + 18: __ccgo_ts + 2019, + 19: __ccgo_ts + 2026, + 20: __ccgo_ts + 2030, + 21: __ccgo_ts + 2040, + 22: __ccgo_ts + 2047, + 23: __ccgo_ts + 2054, + 24: __ccgo_ts + 2061, + 25: __ccgo_ts + 2068, + 26: __ccgo_ts + 2078, + 27: __ccgo_ts + 2087, + 28: __ccgo_ts + 2098, + 29: __ccgo_ts + 2107, + 30: __ccgo_ts + 2113, + 31: __ccgo_ts + 2123, + 32: __ccgo_ts + 2133, + 33: __ccgo_ts + 2138, + 34: __ccgo_ts + 2152, + 35: __ccgo_ts + 2163, + 36: __ccgo_ts + 2168, + 37: __ccgo_ts + 2175, + 38: __ccgo_ts + 2186, + 39: __ccgo_ts + 2191, + 40: __ccgo_ts + 2196, + 41: __ccgo_ts + 2202, + 42: __ccgo_ts + 2208, + 43: __ccgo_ts + 2214, + 44: __ccgo_ts + 2217, + 45: __ccgo_ts + 2221, + 46: __ccgo_ts + 2227, + 47: __ccgo_ts + 2238, + 48: __ccgo_ts + 2249, + 49: __ccgo_ts + 2257, + 50: __ccgo_ts + 2266, + 51: __ccgo_ts + 2272, + 52: __ccgo_ts + 2279, + 53: __ccgo_ts + 2287, + 54: __ccgo_ts + 2290, + 55: __ccgo_ts + 2293, + 56: __ccgo_ts + 2296, + 57: __ccgo_ts + 2299, + 58: __ccgo_ts + 2302, + 59: __ccgo_ts + 2305, + 60: __ccgo_ts + 2312, + 61: __ccgo_ts + 2322, + 62: __ccgo_ts + 2335, + 63: __ccgo_ts + 2346, + 64: __ccgo_ts + 2352, + 65: __ccgo_ts + 2359, + 66: __ccgo_ts + 2368, + 67: __ccgo_ts + 2377, + 68: __ccgo_ts + 2384, + 69: __ccgo_ts + 2397, + 70: __ccgo_ts + 2408, + 71: __ccgo_ts + 2413, + 72: __ccgo_ts + 2421, + 73: __ccgo_ts + 2427, + 74: __ccgo_ts + 2434, + 75: __ccgo_ts + 2446, + 76: __ccgo_ts + 2451, + 77: __ccgo_ts + 2460, + 78: __ccgo_ts + 2465, + 79: __ccgo_ts + 2474, + 80: __ccgo_ts + 2479, + 81: __ccgo_ts + 2484, + 82: __ccgo_ts + 2490, + 83: __ccgo_ts + 2498, + 84: __ccgo_ts + 2506, + 85: __ccgo_ts + 2516, + 86: __ccgo_ts + 2524, + 87: __ccgo_ts + 2531, + 88: __ccgo_ts + 2544, + 89: __ccgo_ts + 2549, + 90: __ccgo_ts + 2561, + 91: __ccgo_ts + 2569, + 92: __ccgo_ts + 2576, + 93: __ccgo_ts + 2587, + 94: __ccgo_ts + 2594, + 95: __ccgo_ts + 2601, + 96: __ccgo_ts + 2611, + 97: __ccgo_ts + 2620, + 98: __ccgo_ts + 2631, + 99: __ccgo_ts + 2637, + 100: __ccgo_ts + 2648, + 101: __ccgo_ts + 2658, + 102: __ccgo_ts + 2668, + 103: __ccgo_ts + 2677, + 104: __ccgo_ts + 2684, + 105: __ccgo_ts + 2690, + 106: __ccgo_ts + 2700, + 107: __ccgo_ts + 2711, + 108: __ccgo_ts + 2715, + 109: __ccgo_ts + 2724, + 110: __ccgo_ts + 2733, + 111: __ccgo_ts + 2740, + 112: __ccgo_ts + 2750, + 113: __ccgo_ts + 2757, + 114: __ccgo_ts + 2767, + 115: __ccgo_ts + 2775, + 116: __ccgo_ts + 2782, + 117: __ccgo_ts + 2796, + 118: __ccgo_ts + 2810, + 119: __ccgo_ts + 2818, + 120: __ccgo_ts + 2829, + 121: __ccgo_ts + 2842, + 122: __ccgo_ts + 2853, + 123: __ccgo_ts + 2859, + 124: __ccgo_ts + 2871, + 125: __ccgo_ts + 2880, + 126: __ccgo_ts + 2888, + 127: __ccgo_ts + 2897, + 128: __ccgo_ts + 2906, + 129: __ccgo_ts + 2913, + 130: __ccgo_ts + 2921, + 131: __ccgo_ts + 2928, + 132: __ccgo_ts + 2939, + 133: __ccgo_ts + 2953, + 134: __ccgo_ts + 2964, + 135: __ccgo_ts + 2972, + 136: __ccgo_ts + 2978, + 137: __ccgo_ts + 2986, + 138: __ccgo_ts + 2994, + 139: __ccgo_ts + 3004, + 140: __ccgo_ts + 3017, + 141: __ccgo_ts + 3027, + 142: __ccgo_ts + 3040, + 143: __ccgo_ts + 3049, + 144: __ccgo_ts + 3060, + 145: __ccgo_ts + 3068, + 146: __ccgo_ts + 3074, + 147: __ccgo_ts + 3086, + 148: __ccgo_ts + 3098, + 149: __ccgo_ts + 3106, + 150: __ccgo_ts + 3118, + 151: __ccgo_ts + 3131, + 152: __ccgo_ts + 3141, + 153: __ccgo_ts + 3151, + 154: __ccgo_ts + 3163, + 155: __ccgo_ts + 3168, + 156: __ccgo_ts + 3180, + 157: __ccgo_ts + 3190, + 158: __ccgo_ts + 3196, + 159: __ccgo_ts + 3206, + 160: __ccgo_ts + 3213, + 161: __ccgo_ts + 3225, + 162: __ccgo_ts + 3236, + 163: __ccgo_ts + 3244, + 164: __ccgo_ts + 3253, + 165: __ccgo_ts + 3262, + 166: __ccgo_ts + 3271, + 167: __ccgo_ts + 3278, + 168: __ccgo_ts + 3289, + 169: __ccgo_ts + 3302, + 170: __ccgo_ts + 3312, + 171: __ccgo_ts + 3319, + 172: __ccgo_ts + 3327, + 173: __ccgo_ts + 3336, + 174: __ccgo_ts + 3342, + 175: __ccgo_ts + 3349, + 176: __ccgo_ts + 3357, + 177: __ccgo_ts + 3365, + 178: __ccgo_ts + 3373, + 179: __ccgo_ts + 3383, + 180: __ccgo_ts + 3392, + 181: __ccgo_ts + 3403, + 182: __ccgo_ts + 3414, + 183: __ccgo_ts + 3425, + 184: __ccgo_ts + 3435, + 185: __ccgo_ts + 3441, + 186: __ccgo_ts + 3452, + 187: __ccgo_ts + 3463, + 188: __ccgo_ts + 3468, + 189: __ccgo_ts + 3476, } type Tpthread_once = struct { @@ -23914,7 +20429,7 @@ type Tstat = struct { Fst_ino Tino_t Fst_nlink Tnlink_t Fst_mode Tmode_t - Fst_padding0 t__int16_t + Fst_bsdflags t__int16_t Fst_uid Tuid_t Fst_gid Tgid_t Fst_padding1 t__int32_t @@ -23928,7 +20443,8 @@ type Tstat = struct { Fst_blksize Tblksize_t Fst_flags Tfflags_t Fst_gen t__uint64_t - Fst_spare [10]t__uint64_t + Fst_filerev t__uint64_t + Fst_spare [9]t__uint64_t } type stat = Tstat @@ -24107,22 +20623,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -24153,30 +20653,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -24254,91 +20730,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3460, + FzName: __ccgo_ts + 3486, }, 1: { - FzName: __ccgo_ts + 3465, + FzName: __ccgo_ts + 3491, }, 2: { - FzName: __ccgo_ts + 3471, + FzName: __ccgo_ts + 3497, }, 3: { - FzName: __ccgo_ts + 3478, + FzName: __ccgo_ts + 3504, }, 4: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3511, }, 5: { - FzName: __ccgo_ts + 3490, + FzName: __ccgo_ts + 3516, }, 6: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 7: { - FzName: __ccgo_ts + 3506, + FzName: __ccgo_ts + 3532, }, 8: { - FzName: __ccgo_ts + 3512, + FzName: __ccgo_ts + 3538, }, 9: { - FzName: __ccgo_ts + 3517, + FzName: __ccgo_ts + 3543, }, 10: { - FzName: __ccgo_ts + 3523, + FzName: __ccgo_ts + 3549, }, 11: { - FzName: __ccgo_ts + 3531, + FzName: __ccgo_ts + 3557, }, 12: { - FzName: __ccgo_ts + 3537, + FzName: __ccgo_ts + 3563, }, 13: { - FzName: __ccgo_ts + 3544, + FzName: __ccgo_ts + 3570, }, 14: { - FzName: __ccgo_ts + 3553, + FzName: __ccgo_ts + 3579, }, 15: { - FzName: __ccgo_ts + 3560, + FzName: __ccgo_ts + 3586, }, 16: { - FzName: __ccgo_ts + 3570, + FzName: __ccgo_ts + 3596, }, 17: { - FzName: __ccgo_ts + 3577, + FzName: __ccgo_ts + 3603, }, 18: { - FzName: __ccgo_ts + 3591, + FzName: __ccgo_ts + 3617, }, 19: { - FzName: __ccgo_ts + 3597, + FzName: __ccgo_ts + 3623, }, 20: { - FzName: __ccgo_ts + 3603, + FzName: __ccgo_ts + 3629, }, 21: { - FzName: __ccgo_ts + 3610, + FzName: __ccgo_ts + 3636, }, 22: { - FzName: __ccgo_ts + 3618, + FzName: __ccgo_ts + 3644, }, 23: { - FzName: __ccgo_ts + 3623, + FzName: __ccgo_ts + 3649, }, 24: { - FzName: __ccgo_ts + 3630, + FzName: __ccgo_ts + 3656, }, 25: { - FzName: __ccgo_ts + 3637, + FzName: __ccgo_ts + 3663, }, 26: { - FzName: __ccgo_ts + 3649, + FzName: __ccgo_ts + 3675, }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -24396,7 +20872,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24434,10 +20910,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24573,9 +21049,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3670, libc.VaList(bp+232, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3696, libc.VaList(bp+232, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3713, O_RDONLY, libc.Int32FromUint16(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3739, O_RDONLY, libc.Int32FromUint16(m)) < 0 { break } } @@ -24811,47 +21287,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24895,7 +21330,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1665 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3723, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3749, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24923,7 +21358,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint64(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3807, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3833, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3834, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3860, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25582,7 +22017,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25937,7 +22372,7 @@ func _seekAndRead(tls *libc.TLS, id uintptr, offset Tsqlite3_int64, pBuf uintptr _, _, _ = got, newOffset, prior prior = 0 for cond := true; cond; cond = got > 0 { - newOffset = libc.Xlseek(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, offset, SEEK_SET) + newOffset = int64(libc.Xlseek(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, offset, SEEK_SET)) if newOffset < 0 { _storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) return -int32(1) @@ -26041,7 +22476,7 @@ func _seekAndWriteFd(tls *libc.TLS, fd int32, iOff Ti64, pBuf uintptr, nBuf int3 rc = 0 /* Value returned by system call */ nBuf &= int32(0x1ffff) for cond := true; cond; cond = rc < 0 && *(*int32)(unsafe.Pointer(libc.X__error(tls))) == int32(EINTR) { - iSeek = libc.Xlseek(tls, fd, iOff, SEEK_SET) + iSeek = int64(libc.Xlseek(tls, fd, iOff, SEEK_SET)) if iSeek < 0 { rc = -int32(1) break @@ -26199,7 +22634,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]int8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3862, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3888, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -26225,7 +22660,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3577, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3603, bp, int32(42579)) } // C documentation @@ -26262,7 +22697,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26810,7 +23156,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26873,7 +23219,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -27106,7 +23452,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*int32)(unsafe.Pointer(bp + 224)) = 0 if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1665, int32(1), bp+224) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27882,10 +24227,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3919, - 3: __ccgo_ts + 3928, - 4: __ccgo_ts + 3937, - 5: __ccgo_ts + 1678, + 2: __ccgo_ts + 3945, + 3: __ccgo_ts + 3954, + 4: __ccgo_ts + 3963, + 5: __ccgo_ts + 1704, } // C documentation @@ -27894,8 +24239,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3942) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3956) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3968) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3982) } // C documentation @@ -27957,7 +24302,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = 0 - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3963, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3989, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -28129,7 +24474,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3980) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4006) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -28284,7 +24629,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3460, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3486, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -28361,7 +24706,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__error(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+224, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(1026)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3649, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3675, zIn, int32(45510)) return } (*(*[1026]int8)(unsafe.Pointer(bp + 224)))[got] = 0 @@ -28559,14 +24894,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if int32(*(*int8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3478, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3504, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*int8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = 0 if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -30406,7 +26581,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -30460,7 +26641,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -30504,7 +26685,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30579,7 +26760,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30633,7 +26814,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30667,66 +26848,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30900,14 +27021,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31723,123 +27844,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31920,7 +27924,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -32014,7 +28018,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -32055,7 +28059,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -32183,7 +28187,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32203,17 +28207,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -32231,7 +28237,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -32243,7 +28249,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -32444,10 +28450,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -33033,25 +29040,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -34013,258 +30001,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -34363,7 +30099,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34592,7 +30328,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34610,7 +30346,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -35183,6 +30919,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35829,7 +31574,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -35841,7 +31587,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35862,11 +31608,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35895,7 +31642,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -36128,7 +31875,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -36265,7 +32012,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -36281,7 +32028,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -37028,10 +32775,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37932,7 +33679,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37976,7 +33723,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -38007,7 +33754,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -38058,7 +33805,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -38093,7 +33840,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4145, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4171, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -38103,7 +33850,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4154, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4180, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -38145,8 +33892,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4159, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4166, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4185, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4192, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -38229,7 +33976,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38485,7 +34232,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38660,7 +34407,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38691,7 +34438,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38763,7 +34510,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -39823,7 +35570,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -40120,7 +35867,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -40388,7 +36135,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4176, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4202, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40952,9 +36699,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -40969,227 +36716,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -41208,28 +36734,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -41288,7 +36793,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -41300,7 +36805,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -41389,6 +36894,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41656,14 +37162,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41830,7 +37328,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41918,12 +37416,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -42057,7 +37555,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42498,10 +37996,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42599,7 +38097,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42638,7 +38136,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = *(*Tu32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42651,7 +38149,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42667,7 +38165,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42688,7 +38186,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42754,7 +38252,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42804,7 +38302,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4231, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4257, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -43019,7 +38517,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -43045,7 +38550,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43768,8 +39273,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43856,7 +39361,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -44002,7 +39507,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -44029,7 +39534,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -44038,6 +39543,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -44082,6 +39588,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -44353,7 +39862,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44534,7 +40043,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44543,7 +40052,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44595,14 +40104,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45148,283 +40657,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45557,27 +40789,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45740,10 +40951,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45752,14 +40964,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -46459,11 +41671,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46637,7 +41849,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46650,12 +41862,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46699,7 +41911,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46707,7 +41919,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46895,7 +42107,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46928,7 +42140,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -47127,7 +42339,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47167,12 +42379,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -47180,21 +42392,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -47241,12 +42453,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47262,7 +42474,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -47322,7 +42534,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47339,14 +42551,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -47389,11 +42601,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47407,7 +42619,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -47460,42 +42672,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47503,70 +42713,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47612,7 +42822,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47638,7 +42848,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47677,12 +42887,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47709,7 +42919,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47740,11 +42950,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))< iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47773,11 +42983,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47786,7 +42996,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47808,15 +43018,13 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt8(int8(flags)) if flags&int32(PTF_LEAF) == 0 { @@ -47824,14 +43032,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47939,7 +43147,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48001,7 +43209,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48089,7 +43297,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4257) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4283) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48713,7 +43921,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48875,7 +44083,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4266, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4292, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48913,7 +44121,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49354,7 +44562,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49378,7 +44586,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -49387,7 +44595,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49401,7 +44609,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49431,7 +44639,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49527,7 +44735,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49565,7 +44773,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49632,7 +44840,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49675,7 +44883,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49705,7 +44913,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50171,7 +45379,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50563,7 +45771,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50573,7 +45781,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50604,7 +45812,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50630,7 +45838,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50704,7 +45912,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50839,7 +46047,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50851,7 +46059,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -50967,7 +46175,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50981,7 +46189,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -51215,7 +46423,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -51299,7 +46507,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -51311,7 +46519,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51513,7 +46721,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51546,7 +46754,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51555,7 +46763,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51684,7 +46892,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51794,7 +47002,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51882,7 +47090,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51937,7 +47145,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51963,7 +47171,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51990,7 +47198,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52061,7 +47269,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52199,7 +47407,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52250,7 +47458,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52259,7 +47467,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52349,7 +47557,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52367,7 +47575,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52390,7 +47598,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52611,10 +47819,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52905,17 +48113,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -53005,12 +48202,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -53018,7 +48215,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53113,7 +48310,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53194,7 +48391,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -53221,7 +48418,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -53261,7 +48458,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53332,7 +48529,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53377,7 +48574,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53573,10 +48770,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53699,8 +48897,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53740,7 +48938,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53763,7 +48961,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53894,7 +49092,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53937,7 +49135,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -53996,7 +49194,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -54028,7 +49226,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54258,7 +49456,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54504,7 +49702,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54577,7 +49775,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54736,7 +49934,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54767,7 +49965,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54852,7 +50050,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54944,7 +50142,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54980,7 +50178,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55010,10 +50208,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55131,12 +50329,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -55146,14 +50344,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55253,21 +50451,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx))))< _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55512,7 +50710,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55593,14 +50791,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55737,7 +50935,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56002,7 +51200,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4270, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4296, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -56050,11 +51248,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4272, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4298, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4295, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4321, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -56080,11 +51278,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4425, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4451, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -56156,11 +51354,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4464 + v2 = __ccgo_ts + 4490 } else { - v2 = __ccgo_ts + 4469 + v2 = __ccgo_ts + 4495 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4490, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4516, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -56296,12 +51494,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4516 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4542 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4534, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4560, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4688, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4714, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4718, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4744, 0) doCoverageCheck = 0 goto _4 } @@ -56386,7 +51584,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4742, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4768, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -56409,7 +51607,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4766, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4792, 0) depth = d2 } } else { @@ -56486,7 +51684,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4791, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4817, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56500,7 +51698,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4828, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4854, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56591,7 +51789,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4880 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4906 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56615,11 +51813,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4891, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4917, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4936, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4962, 0) } } } @@ -56656,10 +51854,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4991, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5017, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5011, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5037, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56789,14 +51987,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -57007,45 +52205,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -57098,7 +52257,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3862, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3888, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -57108,7 +52267,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5043, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5069, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -57137,7 +52296,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5063, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5089, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -57167,7 +52326,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5094, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5120, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57843,7 +53002,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5134, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5160, libc.VaList(bp+40, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57981,9 +53140,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -58158,20 +53314,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -58186,10 +53342,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58648,7 +53804,7 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) @@ -58661,8 +53817,8 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58821,7 +53977,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58863,11 +54019,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58877,7 +54033,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58899,12 +54055,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58943,7 +54099,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59055,8 +54211,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -59107,7 +54263,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -59115,8 +54272,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -59173,14 +54330,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -59194,7 +54351,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -59219,14 +54376,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3862, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3888, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -59326,7 +54483,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5141 + zNeg = __ccgo_ts + 5167 } } } @@ -59341,7 +54498,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5143, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5169, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59645,7 +54802,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59661,7 +54818,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59671,7 +54828,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59722,9 +54879,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59798,7 +54955,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -60132,12 +55289,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -60311,7 +55467,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -60328,7 +55484,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -60396,8 +55552,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -60410,11 +55566,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -60451,13 +55607,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60488,7 +55647,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -60990,7 +56149,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5148, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5174, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -61003,39 +56162,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1665 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5153) == 0 { - zColl = __ccgo_ts + 5160 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5179) == 0 { + zColl = __ccgo_ts + 5186 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5141 + v3 = __ccgo_ts + 5167 } else { v3 = __ccgo_ts + 1665 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5162 + v4 = __ccgo_ts + 5188 } else { v4 = __ccgo_ts + 1665 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5165, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5191, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5199, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5189, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5215, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5198, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5224, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5198, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5224, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1426, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5205, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5231, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1393, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61052,14 +56211,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1666 } else { - zP4 = __ccgo_ts + 5208 + zP4 = __ccgo_ts + 5234 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5215, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5241, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -61074,20 +56233,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5223, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5249, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5228, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5254, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5230 + zP4 = __ccgo_ts + 5256 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5238, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5264, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -61101,10 +56260,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5175, - 1: __ccgo_ts + 5177, - 2: __ccgo_ts + 5179, - 3: __ccgo_ts + 5184, + 0: __ccgo_ts + 5201, + 1: __ccgo_ts + 5203, + 2: __ccgo_ts + 5205, + 3: __ccgo_ts + 5210, } // C documentation @@ -61901,7 +57060,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -61920,7 +57079,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61928,7 +57087,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -62055,7 +57214,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5254, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5280, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -62063,18 +57222,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5266, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5292, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5280, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5306, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5295, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5321, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -62305,7 +57464,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63693,7 +58852,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63728,7 +58887,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63782,7 +58941,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63914,7 +59073,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64066,7 +59225,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -64097,7 +59256,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64248,15 +59407,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5338 + zContext = __ccgo_ts + 5364 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5357 + zContext = __ccgo_ts + 5383 } else { - zContext = __ccgo_ts + 5376 + zContext = __ccgo_ts + 5402 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5385, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5411, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -64351,10 +59510,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -64363,9 +59523,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -64445,7 +59605,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5421, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5447, 0) return int32(1) } else { return 0 @@ -64455,7 +59615,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5466, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5492, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64513,7 +59673,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64840,12 +60000,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64862,29 +60022,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64914,13 +60078,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64932,11 +60098,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -64944,23 +60114,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -65016,7 +60192,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5506, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5532, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -65217,7 +60393,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65347,7 +60523,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65516,6 +60692,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65529,7 +60707,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65567,13 +60745,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65807,18 +60985,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5529, - 1: __ccgo_ts + 5534, - 2: __ccgo_ts + 5541, - 3: __ccgo_ts + 5544, - 4: __ccgo_ts + 5547, - 5: __ccgo_ts + 5550, - 6: __ccgo_ts + 5553, - 7: __ccgo_ts + 5556, - 8: __ccgo_ts + 5564, - 9: __ccgo_ts + 5567, - 10: __ccgo_ts + 5574, - 11: __ccgo_ts + 5582, + 0: __ccgo_ts + 5555, + 1: __ccgo_ts + 5560, + 2: __ccgo_ts + 5567, + 3: __ccgo_ts + 5570, + 4: __ccgo_ts + 5573, + 5: __ccgo_ts + 5576, + 6: __ccgo_ts + 5579, + 7: __ccgo_ts + 5582, + 8: __ccgo_ts + 5590, + 9: __ccgo_ts + 5593, + 10: __ccgo_ts + 5600, + 11: __ccgo_ts + 5608, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -66073,14 +61251,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5589, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5615, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66118,7 +61296,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -66128,7 +61306,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -66139,24 +61317,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -66204,7 +61386,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -66212,32 +61396,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66654,11 +61844,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66667,7 +61857,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66681,7 +61871,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66716,7 +61906,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66751,7 +61941,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66817,11 +62007,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66844,7 +62034,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66866,7 +62056,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66993,7 +62183,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5629, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5655, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -67031,7 +62221,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1426, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5134, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5160, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -67046,28 +62236,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5633, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5659, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5640, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5666, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5653, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5679, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5656, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5682, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5661, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5687, int32(1)) } } } @@ -67231,9 +62421,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -67259,12 +62449,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -67273,28 +62461,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67685,12 +62873,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67707,7 +62895,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -67725,7 +62913,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -68439,19 +63627,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5697, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5723, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5718, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5744, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5725, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5751, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69665,7 +64853,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69681,6 +64869,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -70174,7 +65368,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70277,7 +65471,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5749, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5773, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5863, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5887, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70873,7 +66067,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5917, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5941, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70903,12 +66097,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5972 + v250 = __ccgo_ts + 5996 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6020 + v251 = __ccgo_ts + 6044 } else { - v251 = __ccgo_ts + 6063 + v251 = __ccgo_ts + 6087 } v250 = v251 } @@ -71000,7 +66194,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6104) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6128) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -72084,7 +67278,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, int8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -72111,7 +67305,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72570,7 +67764,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -73003,7 +68197,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73333,7 +68527,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -73364,13 +68558,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6149 + zSchema = __ccgo_ts + 6173 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6163, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6187, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -73385,7 +68579,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73622,7 +68816,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6206, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6230, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73639,15 +68833,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73728,11 +68922,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73944,7 +69138,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -73994,7 +69188,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -74050,7 +69244,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -74129,11 +69323,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6243 + v286 = __ccgo_ts + 6267 } else { - v286 = __ccgo_ts + 6248 + v286 = __ccgo_ts + 6272 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6255, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6279, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -74286,7 +69480,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6307, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6331, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -74448,7 +69642,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6336, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6360, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74528,12 +69722,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74544,7 +69738,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74638,7 +69832,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74666,11 +69860,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74798,7 +69992,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74949,7 +70143,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6346, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6370, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -75036,15 +70230,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -75510,11 +70683,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3862 + v8 = __ccgo_ts + 3888 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75593,14 +70766,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75619,11 +70792,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75699,7 +70872,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75713,7 +70886,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3862 + v1 = __ccgo_ts + 3888 } else { v1 = libc.UintptrFromInt32(0) } @@ -75980,108 +71153,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -76445,7 +71353,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76771,8 +71679,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76786,9 +71694,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76936,8 +71844,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76986,18 +71894,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -77131,7 +72040,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -77285,6 +72194,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78780,57 +73692,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -79127,7 +73988,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79830,25 +74691,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6653, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6678, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6661+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6680+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6686+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6705+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6149+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6173+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6699+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6724+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6699+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6724+7) == 0 { return int32(1) } } @@ -79887,23 +74748,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79935,7 +74795,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6713, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6738, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -80029,7 +74889,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6718) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6743) != 0 { goto _2 } } @@ -80051,57 +74911,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -80146,11 +74993,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6720, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6745, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6724, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6749, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -80159,36 +75006,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6728, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6753, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -80217,18 +75053,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -80275,15 +75111,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6737, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6762, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6768, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6793, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80294,8 +75130,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80335,7 +75171,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6823, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6848, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -80355,7 +75191,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -80364,7 +75200,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6858 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6883 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80374,26 +75210,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6867 + v8 = __ccgo_ts + 6892 } else { - v10 = __ccgo_ts + 6882 + v8 = __ccgo_ts + 6907 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6904, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6929, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6917, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6942, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6927, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6952, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6988, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7013, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -80442,8 +75278,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80517,19 +75353,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6995 + zIn = __ccgo_ts + 7020 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7023 + zIn = __ccgo_ts + 7048 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7041 + zIn = __ccgo_ts + 7066 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7059 + zIn = __ccgo_ts + 7084 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7077, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7102, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80555,7 +75391,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80701,7 +75537,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7097, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7122, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80756,7 +75592,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7114, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7139, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80780,7 +75616,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7178, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7203, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80794,13 +75630,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80820,16 +75656,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7214, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7239, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80840,35 +75673,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7242, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7267, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7285 + zType = __ccgo_ts + 7310 } else { - zType = __ccgo_ts + 7292 + zType = __ccgo_ts + 7317 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7302, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7327, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7330, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7355, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7352, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7377, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7396, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7421, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80953,7 +75789,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7444, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7469, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -80965,7 +75801,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7455, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7480, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -81011,7 +75847,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -81136,7 +75972,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7466, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7491, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -81171,7 +76007,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7522, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7547, 0) return int32(1) } i = 0 @@ -81209,7 +76045,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7556, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7581, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -81279,7 +76115,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7562, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7587, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -81313,7 +76149,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7623, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7648, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81626,7 +76462,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7654, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7679, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81693,7 +76529,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7556) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7581) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81704,7 +76540,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7693) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7718) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81714,7 +76550,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7699, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7724, 0) return int32(WRC_Abort) } goto _6 @@ -81936,33 +76772,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -82014,7 +76852,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -82222,7 +77060,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82697,7 +77535,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82776,7 +77614,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7758, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7783, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82963,7 +77801,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -83121,11 +77959,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7806 + v2 = __ccgo_ts + 7831 } else { v2 = __ccgo_ts + 1665 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7808, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7833, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -83171,10 +78009,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -83202,7 +78040,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7852, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7877, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -83222,7 +78060,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7886, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7911, libc.VaList(bp+8, p)) } // C documentation @@ -83293,7 +78131,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7936, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7961, libc.VaList(bp+8, pExpr)) } } } @@ -83345,7 +78183,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7956, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7981, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -83378,7 +78216,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7999, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8024, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83614,12 +78452,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83761,7 +78593,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83901,7 +78733,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83922,27 +78753,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -83988,9 +78812,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -84000,8 +78824,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -84015,7 +78839,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -84066,7 +78890,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -84147,7 +78971,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -84165,7 +78989,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -84246,7 +79070,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8022, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8047, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -84375,7 +79199,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8052, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8077, libc.VaList(bp+8, zObject)) } } @@ -84473,10 +79297,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8075) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8100) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8080) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8105) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -85154,13 +79978,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8086) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8111) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8094) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8119) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8100) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8125) == 0 { return int32(1) } return 0 @@ -85175,32 +79999,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8086, - 1: __ccgo_ts + 8094, - 2: __ccgo_ts + 8100, + 0: __ccgo_ts + 8111, + 1: __ccgo_ts + 8119, + 2: __ccgo_ts + 8125, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -85409,7 +80220,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -85462,7 +80273,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8104, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8129, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85562,12 +80373,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -86159,7 +80971,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8319) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8344) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -86255,14 +81067,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -86290,9 +81102,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -86425,7 +81237,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86555,13 +81367,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -87341,7 +82158,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8412, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8437, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -87353,7 +82170,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -87368,7 +82185,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8464, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -87397,7 +82214,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87473,7 +82290,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8022, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8047, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87536,7 +82353,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87546,7 +82363,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87554,7 +82371,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87567,9 +82384,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87651,7 +82468,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8463, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8488, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87722,17 +82539,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87741,7 +82558,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87753,6 +82570,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87772,7 +82610,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87842,7 +82680,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87886,7 +82724,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87959,7 +82797,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -87986,8 +82824,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -88153,7 +82991,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88362,7 +83202,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -89069,7 +83911,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -89298,10 +84140,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -89339,7 +84181,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89353,7 +84195,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89367,10 +84209,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -89380,25 +84225,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8538, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -89411,7 +84260,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -89421,11 +84270,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -89445,13 +84294,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89521,7 +84370,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89557,6 +84406,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89574,44 +84424,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8538, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89691,7 +84546,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89699,7 +84554,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -89717,7 +84572,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -89736,11 +84591,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -89858,8 +84713,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8513, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8567, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89877,10 +84732,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8541, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8595, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8716, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8770, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89896,9 +84751,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8890, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8944, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9037, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9091, 0) } } @@ -89954,7 +84809,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9188, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9242, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89963,11 +84818,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9247, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9301, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9253, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9307, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89997,21 +84852,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9280, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9334, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9464, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9518, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9769, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9785, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9823, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9839, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9843, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9897, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -90019,7 +84874,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -90027,7 +84882,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10108, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10162, 0) goto exit_rename_table exit_rename_table: ; @@ -90044,7 +84899,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10121, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10175, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90084,11 +84939,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10159, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10213, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10191, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10245, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90104,10 +84959,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10218) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10272) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10277) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10331) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90119,13 +84974,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10330) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10384) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10376) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10430) } } /* Modify the CREATE TABLE statement. */ @@ -90139,7 +84994,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10403, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10457, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90167,7 +85022,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10549, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10603, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90205,12 +85060,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10902, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10956, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10936, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10990, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90225,7 +85080,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -90233,8 +85088,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10966, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11020, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -90295,18 +85150,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10985 + zType = __ccgo_ts + 11039 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10990 + zType = __ccgo_ts + 11044 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11004 + v1 = __ccgo_ts + 11058 } else { - v1 = __ccgo_ts + 11021 + v1 = __ccgo_ts + 11075 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11039, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11093, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90353,21 +85208,9 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11057, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11111, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90383,11 +85226,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11078, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11260, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11132, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11314, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10108, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10162, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90397,31 +85240,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -90438,16 +85256,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90750,9 +85558,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90863,11 +85671,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11391 + v1 = __ccgo_ts + 11445 } else { v1 = __ccgo_ts + 1665 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11393, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11447, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90938,30 +85746,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11416, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11470, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90982,9 +85794,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -91000,15 +85811,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11424, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11478, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -91019,16 +85830,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -91045,21 +85856,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11391 + v1 = __ccgo_ts + 11445 } else { v1 = __ccgo_ts + 1665 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11430, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11484, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -91085,7 +85896,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -91395,7 +86206,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91662,7 +86473,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -91845,7 +86656,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91929,8 +86740,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -91946,12 +86758,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -92025,7 +86837,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92042,7 +86854,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11435, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11489, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -92097,23 +86909,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11057, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11111, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11442 + v1 = __ccgo_ts + 11496 } else { - v1 = __ccgo_ts + 5672 + v1 = __ccgo_ts + 5698 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11454, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11508, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11482, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11536, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92125,31 +86937,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1665, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11530, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11584, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11651, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11705, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -92163,7 +86975,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -92174,8 +86986,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -92236,27 +87048,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11669, + FzName: __ccgo_ts + 11723, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11690, + FzName: __ccgo_ts + 11744, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11710, + FzName: __ccgo_ts + 11764, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11729, + FzName: __ccgo_ts + 11783, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11748, + FzName: __ccgo_ts + 11802, }, } @@ -92467,8 +87279,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11851, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11905, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92478,10 +87295,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11874, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11928, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11904, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11958, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92513,15 +87330,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11771, - FzCols: __ccgo_ts + 11784, + FzName: __ccgo_ts + 11825, + FzCols: __ccgo_ts + 11838, }, 1: { - FzName: __ccgo_ts + 11797, - FzCols: __ccgo_ts + 11810, + FzName: __ccgo_ts + 11851, + FzCols: __ccgo_ts + 11864, }, 2: { - FzName: __ccgo_ts + 11838, + FzName: __ccgo_ts + 11892, }, } @@ -92574,44 +87391,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92735,7 +87514,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92751,12 +87531,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92764,7 +87544,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92823,7 +87603,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11922, + FzName: __ccgo_ts + 11976, } func init() { @@ -93197,7 +87977,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11932, + FzName: __ccgo_ts + 11986, } func init() { @@ -93247,7 +88027,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11942, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11996, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93258,7 +88038,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11947, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12001, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93297,7 +88077,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11953, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12007, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93315,7 +88095,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11959, + FzName: __ccgo_ts + 12013, } func init() { @@ -93381,7 +88161,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11968, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12022, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93390,12 +88170,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11771, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11825, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93517,7 +88297,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93597,7 +88377,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93628,7 +88408,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11978, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12032, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93719,7 +88499,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11978, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12032, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93756,7 +88536,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93789,11 +88569,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11982) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12036) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11986) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12040) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93901,13 +88681,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93957,17 +88730,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11990, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12044, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12001, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12055, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12011, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12065, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93979,13 +88752,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -94036,7 +88802,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -94239,8 +89005,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -94346,11 +89112,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11797, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11851, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12023, __ccgo_ts+12092, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12077, __ccgo_ts+12146, zDb) } return rc } @@ -94416,10 +89182,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11771, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11825, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12144, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12198, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94532,7 +89298,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6713, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6738, zName) == 0) } // C documentation @@ -94584,11 +89350,11 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4034) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4060) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12185, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12239, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94619,7 +89385,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12188, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12242, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94628,7 +89394,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12225, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12279, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94640,13 +89406,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94684,7 +89450,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12255, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12309, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94692,7 +89458,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12284, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12338, 0) rc = int32(SQLITE_ERROR) } } @@ -94739,7 +89505,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1635, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12352, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12406, libc.VaList(bp+56, zFile)) } } } @@ -94801,15 +89567,15 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { i++ } if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12380, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12434, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12401, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12455, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12427, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12481, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94904,7 +89670,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12449, + FzName: __ccgo_ts + 12503, } func init() { @@ -94926,7 +89692,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12463, + FzName: __ccgo_ts + 12517, } func init() { @@ -94952,7 +89718,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12477, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12531, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94986,7 +89752,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12501, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12555, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -95113,6 +89879,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -95185,9 +89953,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -95203,7 +89971,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12547, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12601, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95231,11 +89999,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12570, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12624, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12576, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12630, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12582, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12636, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95295,7 +90063,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8094 + zCol = __ccgo_ts + 8119 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95330,7 +90098,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12609, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12663, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95367,47 +90135,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -95448,7 +90175,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95546,7 +90273,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95624,7 +90353,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95638,7 +90367,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95751,21 +90482,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6713) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6738) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6680+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6699+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6149+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6661) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6705+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6724+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6173+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6686) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6699+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6149) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6724+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6173) } } } @@ -95795,12 +90526,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6699+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6149) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6724+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6173) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6680+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6661) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6705+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6686) } } } @@ -95838,7 +90569,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12624, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12678, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95848,7 +90579,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95856,15 +90587,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12632 + v1 = __ccgo_ts + 12686 } else { - v1 = __ccgo_ts + 12645 + v1 = __ccgo_ts + 12699 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6917, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6942, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6988, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7013, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95902,12 +90633,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6149+7) == 0 { - return __ccgo_ts + 6699 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6173+7) == 0 { + return __ccgo_ts + 6724 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6661+7) == 0 { - return __ccgo_ts + 6680 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6686+7) == 0 { + return __ccgo_ts + 6705 } } return zName @@ -96031,9 +90762,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -96432,7 +91163,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6149) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6173) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96464,7 +91195,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6713, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6738, zName) { break } goto _1 @@ -96522,13 +91253,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12659, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12713, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12676, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12730, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96576,8 +91307,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12696, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12750, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96613,23 +91344,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96749,7 +91482,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96792,9 +91525,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96807,7 +91540,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12738, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12792, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96823,9 +91556,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10985 + v2 = __ccgo_ts + 11039 } else { - v2 = __ccgo_ts + 9247 + v2 = __ccgo_ts + 9301 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96835,9 +91568,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6661 + v3 = __ccgo_ts + 6686 } else { - v3 = __ccgo_ts + 6149 + v3 = __ccgo_ts + 6173 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96861,11 +91594,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10985 + v4 = __ccgo_ts + 11039 } else { - v4 = __ccgo_ts + 9247 + v4 = __ccgo_ts + 9301 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12779, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12833, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96873,11 +91606,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12800, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12854, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96909,19 +91642,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96941,15 +91684,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96964,7 +91712,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -97025,7 +91773,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12889, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97034,14 +91782,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12869, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12923, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -97073,11 +91823,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -97088,7 +91838,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12889, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12943, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97098,12 +91848,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12912, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12966, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12919, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12973, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -97145,21 +91895,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12929, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12983, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -97170,7 +91909,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -97183,12 +91922,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -97360,10 +92108,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12955, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13009, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13000, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13054, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97421,7 +92169,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13041, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13095, 0) } } @@ -97449,8 +92197,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -97458,7 +92206,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13093, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13147, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97477,21 +92225,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97514,7 +92251,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13134, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13188, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97542,8 +92279,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97630,17 +92372,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13244, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13233, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13287, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13241, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13295, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97672,7 +92414,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13248, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13302, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97813,9 +92555,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97826,31 +92569,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { zSep = __ccgo_ts + 1665 - zSep2 = __ccgo_ts + 13279 - zEnd = __ccgo_ts + 5173 + zSep2 = __ccgo_ts + 13333 + zEnd = __ccgo_ts + 5199 } else { - zSep = __ccgo_ts + 13281 - zSep2 = __ccgo_ts + 13285 - zEnd = __ccgo_ts + 13290 + zSep = __ccgo_ts + 13335 + zSep2 = __ccgo_ts + 13339 + zEnd = __ccgo_ts + 13344 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13293, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13347, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97861,8 +92604,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97875,17 +92619,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3862, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ 0: __ccgo_ts + 1665, - 1: __ccgo_ts + 13307, - 2: __ccgo_ts + 13313, - 3: __ccgo_ts + 13318, - 4: __ccgo_ts + 13323, - 5: __ccgo_ts + 13313, + 1: __ccgo_ts + 13361, + 2: __ccgo_ts + 13367, + 3: __ccgo_ts + 13372, + 4: __ccgo_ts + 13377, + 5: __ccgo_ts + 13367, } // C documentation @@ -97894,15 +92639,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97917,7 +92663,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -98150,8 +92896,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -98251,7 +93007,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -98264,8 +93020,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -98295,7 +93051,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98514,9 +93270,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13329, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13383, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13362, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13416, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98537,11 +93293,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13389, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13443, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13439, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13493, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98588,7 +93344,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13471, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13525, 0) return } } @@ -98622,16 +93378,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9247 - zType2 = __ccgo_ts + 13515 + zType = __ccgo_ts + 9301 + zType2 = __ccgo_ts + 13569 } else { /* A view */ - zType = __ccgo_ts + 10985 - zType2 = __ccgo_ts + 13521 + zType = __ccgo_ts + 11039 + zType2 = __ccgo_ts + 13575 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98648,24 +93404,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98713,13 +93474,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13526, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13580, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13541, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13595, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98728,15 +93499,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13639, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13693, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13681, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13735, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13715, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13769, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98754,7 +93525,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9769) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9823) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98787,7 +93558,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13736, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13790, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98804,7 +93575,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10985, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11039, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98901,7 +93672,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13772, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13826, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -99085,7 +93856,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13802, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13856, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99098,7 +93869,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13817, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13871, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -99181,9 +93952,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13884, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13938, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11874, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11928, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99224,7 +93995,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13898, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13952, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -99233,7 +94004,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13943, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13997, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -99268,11 +94039,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3485, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3511, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7455, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7480, int32(10)) == 0 { return 0 } return int32(1) @@ -99327,9 +94098,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -99362,18 +94133,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14010, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14064, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14038, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14092, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14072, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14126, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99383,7 +94154,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11986, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12040, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99431,19 +94202,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14104, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14158, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14167, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14221, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -99500,7 +94271,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14261, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14315, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99615,11 +94386,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99641,7 +94412,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99686,13 +94457,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99715,23 +94486,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99760,11 +94531,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14307 + v2 = __ccgo_ts + 14361 } else { - v2 = __ccgo_ts + 14313 + v2 = __ccgo_ts + 14367 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14318, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14372, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99842,7 +94613,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14346, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14400, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99852,7 +94623,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14352, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14406, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99866,16 +94637,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14402, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14456, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14430, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14484, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14455, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14509, 0) goto exit_create_index } /* @@ -99896,19 +94667,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14346, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14400, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14489, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14543, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14523, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14577, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99929,7 +94700,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14547, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14601, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99947,9 +94718,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6661 + v2 = __ccgo_ts + 6686 } else { - v2 = __ccgo_ts + 6149 + v2 = __ccgo_ts + 6173 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99977,7 +94748,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14346) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14400) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100009,7 +94780,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -100061,7 +94832,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14570, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14624, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100071,7 +94842,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -100081,8 +94852,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -100160,7 +94931,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -100208,7 +94979,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14631, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14685, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -100238,8 +95009,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14673, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14727, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -100252,7 +95023,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -100281,9 +95052,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1665 } else { - v13 = __ccgo_ts + 14690 + v13 = __ccgo_ts + 14744 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14698, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14752, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -100291,7 +95062,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14718, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14772, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -100299,7 +95070,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14777, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14831, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -100462,16 +95233,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14804, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14858, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14822, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14876, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100479,9 +95250,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100497,8 +95268,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14895, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11982, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14949, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12036, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100571,12 +95342,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100688,13 +95459,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14955, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15009, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -100775,7 +95546,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -100825,7 +95596,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -100996,11 +95767,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14991 + v1 = __ccgo_ts + 15045 } else { - v1 = __ccgo_ts + 14994 + v1 = __ccgo_ts + 15048 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15000, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15054, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101199,7 +95970,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15036, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15090, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101246,9 +96017,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15042 + v1 = __ccgo_ts + 15096 } else { - v1 = __ccgo_ts + 15051 + v1 = __ccgo_ts + 15105 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101280,9 +96051,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15036, - 1: __ccgo_ts + 15058, - 2: __ccgo_ts + 15042, + 0: __ccgo_ts + 15090, + 1: __ccgo_ts + 15112, + 2: __ccgo_ts + 15096, } // C documentation @@ -101302,7 +96073,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15066, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15120, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101327,7 +96098,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12570, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12624, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101758,7 +96529,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15266, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15320, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102640,11 +97409,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15299, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15353, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15328, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15382, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102748,7 +97517,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102805,7 +97574,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15402, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15456, -int32(1)) return } if argc == int32(3) { @@ -104524,7 +99298,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15489, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104606,7 +99380,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104678,28 +99452,28 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15480, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15534, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15488, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15542, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104731,13 +99505,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15496, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15550 + } else { + v2 = __ccgo_ts + 15554 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1666, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15557, -int32(1)) + return +} + // C documentation // // /* @@ -104749,6 +99659,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104759,7 +99673,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -105194,7 +100108,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -105283,7 +100197,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11391, + 0: __ccgo_ts + 11445, } // C documentation @@ -105295,8 +100209,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -105311,7 +100225,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -105323,16 +100237,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -105443,7 +100357,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15499, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15580, int32(4), libc.UintptrFromInt32(0)) } } @@ -105504,7 +100418,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12609, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12663, -int32(1)) return } if argc == int32(2) { @@ -105535,17 +100449,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105614,7 +100517,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105696,7 +100599,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15379, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15433, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105759,12 +100662,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105928,7 +100825,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -105939,7 +100836,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -106046,7 +100943,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15504, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15585, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106075,8 +100972,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15510, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15510, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15591, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15591, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -106256,11 +101153,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -106364,7 +101261,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -106377,542 +101274,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15515, + FzName: __ccgo_ts + 15596, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15535, + FzName: __ccgo_ts + 15616, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15548, + FzName: __ccgo_ts + 15629, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15566, + FzName: __ccgo_ts + 15647, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15575, + FzName: __ccgo_ts + 15656, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15583, + FzName: __ccgo_ts + 15664, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15583, + FzName: __ccgo_ts + 15664, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15598, + FzName: __ccgo_ts + 15679, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15624, + FzName: __ccgo_ts + 15705, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15649, + FzName: __ccgo_ts + 15730, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15658, + FzName: __ccgo_ts + 15739, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15669, + FzName: __ccgo_ts + 15750, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15676, + FzName: __ccgo_ts + 15757, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15690, + FzName: __ccgo_ts + 15771, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15690, + FzName: __ccgo_ts + 15771, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15696, + FzName: __ccgo_ts + 15777, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15696, + FzName: __ccgo_ts + 15777, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15702, + FzName: __ccgo_ts + 15783, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15702, + FzName: __ccgo_ts + 15783, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15707, + FzName: __ccgo_ts + 15788, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15707, + FzName: __ccgo_ts + 15788, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15711, + FzName: __ccgo_ts + 15792, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15711, + FzName: __ccgo_ts + 15792, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15715, + FzName: __ccgo_ts + 15796, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15722, + FzName: __ccgo_ts + 15803, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15730, + FzName: __ccgo_ts + 15811, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15737, + FzName: __ccgo_ts + 15818, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15750, + FzName: __ccgo_ts + 15831, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15756, + FzName: __ccgo_ts + 15837, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15763, + FzName: __ccgo_ts + 15844, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15770, + FzName: __ccgo_ts + 15851, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15778, + FzName: __ccgo_ts + 15859, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15783, + FzName: __ccgo_ts + 15864, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15787, + FzName: __ccgo_ts + 15868, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15787, + FzName: __ccgo_ts + 15868, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15793, + FzName: __ccgo_ts + 15874, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15799, + FzName: __ccgo_ts + 15880, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15805, + FzName: __ccgo_ts + 15886, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15809, + FzName: __ccgo_ts + 15890, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15809, + FzName: __ccgo_ts + 15890, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15815, + FzName: __ccgo_ts + 15896, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15822, + FzName: __ccgo_ts + 15903, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15832, + FzName: __ccgo_ts + 15913, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15839, + FzName: __ccgo_ts + 15920, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15846, + FzName: __ccgo_ts + 15927, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15857, + FzName: __ccgo_ts + 15938, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15864, + FzName: __ccgo_ts + 15945, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15879, + FzName: __ccgo_ts + 15960, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15896, + FzName: __ccgo_ts + 15977, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15907, + FzName: __ccgo_ts + 15988, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15913, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15995, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15931, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16001, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15939, + FzName: __ccgo_ts + 16014, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15953, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16032, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15961, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16040, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15970, + FzName: __ccgo_ts + 16054, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15970, + FzName: __ccgo_ts + 16062, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16071, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16071, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16078, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16078, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15987, + FzName: __ccgo_ts + 16088, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15991, + FzName: __ccgo_ts + 16092, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15997, + FzName: __ccgo_ts + 16098, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16001, + FzName: __ccgo_ts + 16102, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16001, + FzName: __ccgo_ts + 16102, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16007, + FzName: __ccgo_ts + 16108, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16007, + FzName: __ccgo_ts + 16108, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16020, + FzName: __ccgo_ts + 16121, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16031, + FzName: __ccgo_ts + 16132, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15510, + FzName: __ccgo_ts + 15591, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15510, + FzName: __ccgo_ts + 15591, }, - 70: { + 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16036, + FzName: __ccgo_ts + 16137, }, - 71: { + 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1238, }, - 72: { + 74: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1246, }, - 73: { + 75: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16041, + FzName: __ccgo_ts + 16142, }, - 74: { + 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16047, + FzName: __ccgo_ts + 16148, }, - 75: { + 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16050, + FzName: __ccgo_ts + 16151, }, - 76: { + 78: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16054, + FzName: __ccgo_ts + 16155, }, - 77: { + 79: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16060, - }, - 78: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16050, - }, - 79: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16065, + FzName: __ccgo_ts + 16161, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16069, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16151, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16073, + FzName: __ccgo_ts + 16166, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16079, + FzName: __ccgo_ts + 16170, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16083, + FzName: __ccgo_ts + 16174, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16088, + FzName: __ccgo_ts + 16180, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16093, + FzName: __ccgo_ts + 16184, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16098, + FzName: __ccgo_ts + 16189, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16104, + FzName: __ccgo_ts + 16194, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16108, + FzName: __ccgo_ts + 16199, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16112, + FzName: __ccgo_ts + 16205, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16116, + FzName: __ccgo_ts + 16209, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16121, + FzName: __ccgo_ts + 16213, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16126, + FzName: __ccgo_ts + 16217, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16131, + FzName: __ccgo_ts + 16222, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16137, + FzName: __ccgo_ts + 16227, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16143, + FzName: __ccgo_ts + 16232, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16149, + FzName: __ccgo_ts + 16238, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16154, + FzName: __ccgo_ts + 16244, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16162, + FzName: __ccgo_ts + 16250, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16170, + FzName: __ccgo_ts + 16255, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16173, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16263, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16271, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16274, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6858, + FzName: __ccgo_ts + 6883, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16178, + FzName: __ccgo_ts + 16279, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16182, + FzName: __ccgo_ts + 16283, }, } @@ -106971,109 +101879,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -107297,7 +102207,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -107390,7 +102300,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16185, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16286, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -108214,7 +103124,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108501,11 +103411,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6724, + Fz: __ccgo_ts + 6749, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6720, + Fz: __ccgo_ts + 6745, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108569,7 +103479,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5308) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5334) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -108585,7 +103495,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -109033,7 +103943,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -109151,7 +104061,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8351, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8376, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -109217,11 +104127,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109546,7 +104456,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109560,7 +104470,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109595,7 +104505,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109608,7 +104518,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109735,27 +104645,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109836,7 +104746,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109863,7 +104773,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -109872,44 +104782,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16230, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16331, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16271, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16372, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109931,31 +104825,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16303, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16404, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109979,10 +104873,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -110023,8 +104917,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -110041,34 +104935,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16311, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16412, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16363, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16464, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -110175,18 +105069,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -110196,13 +105090,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -110213,14 +105107,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -110237,16 +105131,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -110357,11 +105251,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -110420,7 +105314,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16455) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16556) } goto insert_cleanup insert_cleanup: @@ -110543,33 +105437,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110816,7 +105683,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12570, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12624, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -113050,7 +107597,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16504, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16605, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113070,19 +107617,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16508, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16609, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16514, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16615, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113097,14 +107644,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16557, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16658, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -113128,7 +107675,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16589, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16690, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113137,7 +107684,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16469, + 0: __ccgo_ts + 16570, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113206,14 +107753,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -113228,7 +107770,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -113246,7 +107788,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -113261,7 +107803,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -113271,6 +107813,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -113282,7 +107826,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -113294,7 +107838,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -113370,7 +107914,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16626, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16727, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113424,63 +107968,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5564, - 1: __ccgo_ts + 16665, - 2: __ccgo_ts + 9247, - 3: __ccgo_ts + 16669, - 4: __ccgo_ts + 16674, - 5: __ccgo_ts + 16677, - 6: __ccgo_ts + 16687, - 7: __ccgo_ts + 16697, - 8: __ccgo_ts + 16703, - 9: __ccgo_ts + 16707, - 10: __ccgo_ts + 16712, - 11: __ccgo_ts + 16717, - 12: __ccgo_ts + 16725, - 13: __ccgo_ts + 16736, - 14: __ccgo_ts + 16739, - 15: __ccgo_ts + 16746, - 16: __ccgo_ts + 16707, - 17: __ccgo_ts + 16712, - 18: __ccgo_ts + 16753, - 19: __ccgo_ts + 16758, - 20: __ccgo_ts + 16761, - 21: __ccgo_ts + 16768, - 22: __ccgo_ts + 16703, - 23: __ccgo_ts + 16707, - 24: __ccgo_ts + 16774, - 25: __ccgo_ts + 16779, - 26: __ccgo_ts + 16784, - 27: __ccgo_ts + 16707, - 28: __ccgo_ts + 16788, - 29: __ccgo_ts + 16712, - 30: __ccgo_ts + 16796, - 31: __ccgo_ts + 16800, - 32: __ccgo_ts + 16805, - 33: __ccgo_ts + 11986, - 34: __ccgo_ts + 11982, - 35: __ccgo_ts + 16811, - 36: __ccgo_ts + 16816, - 37: __ccgo_ts + 16821, - 38: __ccgo_ts + 16665, - 39: __ccgo_ts + 16707, - 40: __ccgo_ts + 16826, - 41: __ccgo_ts + 16833, - 42: __ccgo_ts + 16840, - 43: __ccgo_ts + 9247, - 44: __ccgo_ts + 16848, - 45: __ccgo_ts + 5567, - 46: __ccgo_ts + 16854, - 47: __ccgo_ts + 16665, - 48: __ccgo_ts + 16707, - 49: __ccgo_ts + 16859, - 50: __ccgo_ts + 16864, - 51: __ccgo_ts + 16050, - 52: __ccgo_ts + 16869, - 53: __ccgo_ts + 16882, - 54: __ccgo_ts + 16891, - 55: __ccgo_ts + 16898, - 56: __ccgo_ts + 16909, + 0: __ccgo_ts + 5590, + 1: __ccgo_ts + 16766, + 2: __ccgo_ts + 9301, + 3: __ccgo_ts + 16770, + 4: __ccgo_ts + 16775, + 5: __ccgo_ts + 16778, + 6: __ccgo_ts + 16788, + 7: __ccgo_ts + 16798, + 8: __ccgo_ts + 16804, + 9: __ccgo_ts + 16808, + 10: __ccgo_ts + 16813, + 11: __ccgo_ts + 16818, + 12: __ccgo_ts + 16826, + 13: __ccgo_ts + 16837, + 14: __ccgo_ts + 16840, + 15: __ccgo_ts + 16808, + 16: __ccgo_ts + 16847, + 17: __ccgo_ts + 16813, + 18: __ccgo_ts + 16855, + 19: __ccgo_ts + 16859, + 20: __ccgo_ts + 16864, + 21: __ccgo_ts + 16870, + 22: __ccgo_ts + 16808, + 23: __ccgo_ts + 16813, + 24: __ccgo_ts + 16877, + 25: __ccgo_ts + 16882, + 26: __ccgo_ts + 16885, + 27: __ccgo_ts + 16892, + 28: __ccgo_ts + 16804, + 29: __ccgo_ts + 16808, + 30: __ccgo_ts + 16898, + 31: __ccgo_ts + 16903, + 32: __ccgo_ts + 16908, + 33: __ccgo_ts + 16766, + 34: __ccgo_ts + 16808, + 35: __ccgo_ts + 16912, + 36: __ccgo_ts + 16919, + 37: __ccgo_ts + 16926, + 38: __ccgo_ts + 12040, + 39: __ccgo_ts + 12036, + 40: __ccgo_ts + 16934, + 41: __ccgo_ts + 16939, + 42: __ccgo_ts + 16944, + 43: __ccgo_ts + 9301, + 44: __ccgo_ts + 16949, + 45: __ccgo_ts + 5593, + 46: __ccgo_ts + 16955, + 47: __ccgo_ts + 16960, + 48: __ccgo_ts + 16151, + 49: __ccgo_ts + 16965, + 50: __ccgo_ts + 16766, + 51: __ccgo_ts + 16808, + 52: __ccgo_ts + 16978, + 53: __ccgo_ts + 16983, + 54: __ccgo_ts + 16992, + 55: __ccgo_ts + 16999, + 56: __ccgo_ts + 17010, } // C documentation @@ -113499,338 +108043,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16917, + FzName: __ccgo_ts + 17018, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16932, + FzName: __ccgo_ts + 17033, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16947, + FzName: __ccgo_ts + 17048, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16959, + FzName: __ccgo_ts + 17060, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16975, + FzName: __ccgo_ts + 17076, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16898, + FzName: __ccgo_ts + 16999, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16988, + FzName: __ccgo_ts + 17089, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17000, + FzName: __ccgo_ts + 17101, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17020, + FzName: __ccgo_ts + 17121, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17036, + FzName: __ccgo_ts + 17137, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17057, + FzName: __ccgo_ts + 17158, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17072, + FzName: __ccgo_ts + 17173, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17088, + FzName: __ccgo_ts + 17189, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17102, + FzName: __ccgo_ts + 17203, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17115, + FzName: __ccgo_ts + 17216, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17129, + FzName: __ccgo_ts + 17230, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17148, + FzName: __ccgo_ts + 17249, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17167, + FzName: __ccgo_ts + 17268, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17190, + FzName: __ccgo_ts + 17291, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17199, + FzName: __ccgo_ts + 17300, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17217, + FzName: __ccgo_ts + 17318, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17234, + FzName: __ccgo_ts + 17335, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17247, + FzName: __ccgo_ts + 17348, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17262, + FzName: __ccgo_ts + 17363, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17280, + FzName: __ccgo_ts + 17381, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17290, + FzName: __ccgo_ts + 17391, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17304, + FzName: __ccgo_ts + 17405, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17320, + FzName: __ccgo_ts + 17421, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17345, + FzName: __ccgo_ts + 17446, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17364, + FzName: __ccgo_ts + 17465, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17375, + FzName: __ccgo_ts + 17476, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17386, + FzName: __ccgo_ts + 17487, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17398, + FzName: __ccgo_ts + 17499, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17414, + FzName: __ccgo_ts + 17515, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17427, + FzName: __ccgo_ts + 17528, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17446, + FzName: __ccgo_ts + 17547, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17465, + FzName: __ccgo_ts + 17566, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17478, + FzName: __ccgo_ts + 17579, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17493, + FzName: __ccgo_ts + 17594, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17503, + FzName: __ccgo_ts + 17604, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17515, + FzName: __ccgo_ts + 17616, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17524, + FzName: __ccgo_ts + 17625, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17535, + FzName: __ccgo_ts + 17636, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17545, + FzName: __ccgo_ts + 17646, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17557, + FzName: __ccgo_ts + 17658, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17568, + FzName: __ccgo_ts + 17669, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17580, + FzName: __ccgo_ts + 17681, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17597, + FzName: __ccgo_ts + 17698, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17616, + FzName: __ccgo_ts + 17717, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17642, + FzName: __ccgo_ts + 17743, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17657, + FzName: __ccgo_ts + 17758, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17671, + FzName: __ccgo_ts + 17772, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17690, + FzName: __ccgo_ts + 17791, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17704, + FzName: __ccgo_ts + 17805, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17720, + FzName: __ccgo_ts + 17821, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17732, + FzName: __ccgo_ts + 17833, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17743, + FzName: __ccgo_ts + 17844, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17754, + FzName: __ccgo_ts + 17855, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113838,45 +108382,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17766, + FzName: __ccgo_ts + 17867, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17777, + FzName: __ccgo_ts + 17878, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17798, + FzName: __ccgo_ts + 17899, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17806, + FzName: __ccgo_ts + 17907, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17821, + FzName: __ccgo_ts + 17922, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17834, + FzName: __ccgo_ts + 17935, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17853, + FzName: __ccgo_ts + 17954, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17868, + FzName: __ccgo_ts + 17969, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113894,7 +108438,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -114002,10 +108546,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17884) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17985) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17894) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17995) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114023,13 +108567,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8407) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8432) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17901) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18002) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17906) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18007) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114052,10 +108596,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16859) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16978) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17918) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18019) == 0 { return int32(2) } else { return 0 @@ -114077,7 +108621,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17925, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18026, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114207,15 +108751,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17987 + zName = __ccgo_ts + 18088 case int32(OE_SetDflt): - zName = __ccgo_ts + 17996 + zName = __ccgo_ts + 18097 case int32(OE_Cascade): - zName = __ccgo_ts + 18008 + zName = __ccgo_ts + 18109 case int32(OE_Restrict): - zName = __ccgo_ts + 18016 + zName = __ccgo_ts + 18117 default: - zName = __ccgo_ts + 18025 + zName = __ccgo_ts + 18126 break } return zName @@ -114236,12 +108780,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18035, - 1: __ccgo_ts + 18042, - 2: __ccgo_ts + 18050, - 3: __ccgo_ts + 18054, - 4: __ccgo_ts + 17918, - 5: __ccgo_ts + 18063, + 0: __ccgo_ts + 18136, + 1: __ccgo_ts + 18143, + 2: __ccgo_ts + 18151, + 3: __ccgo_ts + 18155, + 4: __ccgo_ts + 18019, + 5: __ccgo_ts + 18164, } // C documentation @@ -114303,15 +108847,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18088 + zType = __ccgo_ts + 18189 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18090 + zType = __ccgo_ts + 18191 } else { - zType = __ccgo_ts + 7806 + zType = __ccgo_ts + 7831 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18092, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18193, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -114320,9 +108864,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18067, - 2: __ccgo_ts + 18072, - 3: __ccgo_ts + 18080, + 1: __ccgo_ts + 18168, + 2: __ccgo_ts + 18173, + 3: __ccgo_ts + 18181, } // C documentation @@ -114421,7 +108965,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18099, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18200, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114464,7 +109008,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3862, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3888, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114509,7 +109053,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114568,7 +109112,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18103) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18204) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114611,7 +109155,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114639,7 +109183,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17894 + zRet = __ccgo_ts + 17995 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114667,7 +109211,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17884 + zRet = __ccgo_ts + 17985 } _returnSingleText(tls, v, zRet) break @@ -114957,7 +109501,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18108, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18209, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114967,7 +109511,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -114989,7 +109533,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18133, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18234, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115021,8 +109565,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18186) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18287) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -115102,9 +109647,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18192 + v14 = __ccgo_ts + 18293 } else { - v14 = __ccgo_ts + 18200 + v14 = __ccgo_ts + 18301 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115175,7 +109720,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18207, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18308, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -115205,19 +109750,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10985 + zType = __ccgo_ts + 11039 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13233 + zType = __ccgo_ts + 13287 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18223 + zType = __ccgo_ts + 18324 } else { - zType = __ccgo_ts + 9247 + zType = __ccgo_ts + 9301 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18230, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18331, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -115264,9 +109809,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18237, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18338, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18242, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18343, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -115290,11 +109835,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18247, - 1: __ccgo_ts + 18249, - 2: __ccgo_ts + 16736, + 0: __ccgo_ts + 18348, + 1: __ccgo_ts + 18350, + 2: __ccgo_ts + 16837, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18251, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18352, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -115313,7 +109858,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18257, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18358, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -115330,7 +109875,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18261, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18362, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115380,7 +109925,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7806, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7831, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -115392,7 +109937,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7806, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7831, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -115418,7 +109963,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18264, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18273)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18365, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18374)) goto _32 _32: ; @@ -115432,8 +109977,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115559,7 +110104,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18278, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18379, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115655,7 +110200,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115699,7 +110244,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -115750,7 +110295,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18282, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18383, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115761,7 +110306,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18306) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18407) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115897,7 +110442,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18335, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18436, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115959,7 +110504,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115981,7 +110526,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18371, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18472, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -115994,7 +110539,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18391, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18492, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -116002,7 +110547,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18413, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18514, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -116013,10 +110558,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18436, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18537, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18539, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -116050,7 +110595,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18458, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18559, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -116074,9 +110619,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18488) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18589) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18493) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18594) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -116089,9 +110634,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18514) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18615) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18550) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18651) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116119,9 +110664,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18488) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18589) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18561) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18662) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116149,7 +110694,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18588) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18689) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116246,7 +110791,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18615 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18716 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116325,7 +110870,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18676, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18777, libc.VaList(bp+176, zRight)) } } } @@ -116430,13 +110975,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17901) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18002) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18701) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18802) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18054) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18155) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116571,7 +111116,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116601,7 +111146,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6653, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6678, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116663,7 +111208,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18709, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18810, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116936,34 +111481,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18618, + FzName: __ccgo_ts + 18719, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18623, + FzName: __ccgo_ts + 18724, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18629, + FzName: __ccgo_ts + 18730, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18638, + FzName: __ccgo_ts + 18739, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18647, + FzName: __ccgo_ts + 18748, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18655, + FzName: __ccgo_ts + 18756, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18663, + FzName: __ccgo_ts + 18764, }, 7: { - FzName: __ccgo_ts + 18670, + FzName: __ccgo_ts + 18771, }, 8: {}, } @@ -117020,25 +111565,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -117059,14 +111585,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18727) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18828) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18742, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18843, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -117075,19 +111601,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18749, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18850, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18755) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18856) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18767) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18868) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5199, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -117102,7 +111628,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -117283,7 +111809,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -117295,13 +111821,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18782) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18883) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18790, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18891, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18794, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18895, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117310,7 +111836,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117436,24 +111962,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18828, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18929, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5175 + v1 = __ccgo_ts + 5201 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18856, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18957, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18887, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18988, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -117461,9 +111987,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18798, - 1: __ccgo_ts + 18805, - 2: __ccgo_ts + 18817, + 0: __ccgo_ts + 18899, + 1: __ccgo_ts + 18906, + 2: __ccgo_ts + 18918, } // C documentation @@ -117539,7 +112065,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14673) + _corruptSchema(tls, pData, argv, __ccgo_ts+14727) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117572,11 +112098,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18895) + _corruptSchema(tls, pData, argv, __ccgo_ts+18996) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14673) + _corruptSchema(tls, pData, argv, __ccgo_ts+14727) } } } @@ -117615,18 +112141,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9247 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9301 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6661 + v2 = __ccgo_ts + 6686 } else { - v2 = __ccgo_ts + 6149 + v2 = __ccgo_ts + 6173 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8319 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18908 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8344 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19009 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117710,7 +112236,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12284) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12338) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117736,7 +112262,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18980) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19081) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117751,7 +112277,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19004, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19105, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -118047,7 +112573,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -118060,9 +112586,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -118080,7 +112606,7 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse @@ -118109,7 +112635,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -118169,7 +112695,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19038, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19139, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118185,7 +112711,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19068, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19169, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118208,10 +112734,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -118219,7 +112745,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3862, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3888, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -118249,7 +112775,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118383,7 +112909,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118505,15 +113031,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118549,21 +113066,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118643,7 +113145,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118651,7 +113153,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118807,15 +113309,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11391 - zSp2 = __ccgo_ts + 11391 + zSp1 = __ccgo_ts + 11445 + zSp2 = __ccgo_ts + 11445 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19087, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19188, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118872,25 +113374,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -119022,13 +113527,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -119106,7 +113611,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19117, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19218, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119156,12 +113661,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19167, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19268, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -119176,9 +113681,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19231, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19332, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119188,6 +113694,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -119222,7 +113735,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6858, + Fz: __ccgo_ts + 6883, Fn: uint32(8), } @@ -119239,13 +113752,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -119270,7 +113776,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -119315,7 +113821,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -119339,7 +113845,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -119360,7 +113866,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119483,7 +113989,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119610,10 +114116,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119621,7 +114127,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119798,7 +114304,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19268, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19369, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119909,8 +114415,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119918,7 +114424,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -120003,13 +114509,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19288 + z = __ccgo_ts + 19389 case int32(TK_INTERSECT): - z = __ccgo_ts + 19298 + z = __ccgo_ts + 19399 case int32(TK_EXCEPT): - z = __ccgo_ts + 19308 + z = __ccgo_ts + 19409 default: - z = __ccgo_ts + 19315 + z = __ccgo_ts + 19416 break } return z @@ -120030,7 +114536,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19321, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19422, libc.VaList(bp+8, zUsage)) } /* @@ -120067,13 +114573,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19344 + v1 = __ccgo_ts + 19445 } else { v1 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19358, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19459, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19389, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19490, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -120097,11 +114603,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -120317,7 +114823,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1139 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16848 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16949 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -120430,7 +114936,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -120439,7 +114945,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -120463,13 +114969,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16848 + zCol = __ccgo_ts + 16949 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12570, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12624, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120477,7 +114983,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19435, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19536, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120531,7 +115037,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120569,7 +115075,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16848 + v3 = __ccgo_ts + 16949 } zName = v3 } else { @@ -120584,7 +115090,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19435, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19536, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120620,7 +115126,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19444, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19545, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120739,7 +115245,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19452 + zType = __ccgo_ts + 19553 } else { zType = uintptr(0) j = int32(1) @@ -120805,7 +115311,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -120833,7 +115339,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120883,7 +115389,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120906,7 +115412,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -121054,7 +115560,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19456, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19557, 0) return } /* Obtain authorization to do a recursive query */ @@ -121091,7 +115597,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -121102,7 +115608,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -121116,7 +115622,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -121147,7 +115653,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19505, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19606, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121162,7 +115668,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19547, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19648, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121190,7 +115696,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19553, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19654, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121245,9 +115751,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1665 } else { - v1 = __ccgo_ts + 19568 + v1 = __ccgo_ts + 19669 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19570, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19671, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -121355,8 +115861,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19593, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19608, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19694, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19709, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121381,7 +115887,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19288, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19389, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121407,7 +115913,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -121433,7 +115939,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19627, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19728, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121465,11 +115971,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121491,7 +115997,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19627, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19728, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121598,6 +116104,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121614,9 +116121,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19648, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19749, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19694, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19795, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121687,7 +116194,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19268, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19369, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121903,7 +116410,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -121935,7 +116442,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -121989,16 +116496,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7556) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7556) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7581) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7581) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -122016,32 +116523,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19776, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19877, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19787, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19888, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122054,7 +116561,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19792, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19893, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122264,11 +116771,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5153 + v1 = __ccgo_ts + 5179 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -122429,7 +116936,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122619,9 +117126,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122833,7 +117340,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122980,7 +117487,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -123219,18 +117726,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -123270,11 +117765,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -123339,7 +117834,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -123357,12 +117852,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123844,7 +118339,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123890,13 +118385,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15707) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15788) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15711) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15792) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123984,8 +118479,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19798, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19899, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -124009,7 +118504,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -124091,7 +118586,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -124109,7 +118604,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19816, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19917, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124257,7 +118752,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -124285,7 +118780,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19839, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19940, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124307,12 +118802,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19859, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19960, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -124329,7 +118824,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19902 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20003 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -124360,7 +118855,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19925, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20026, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -124369,9 +118864,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19963 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20064 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19997 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20098 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124420,7 +118915,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -124430,7 +118925,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20035, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20136, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124526,7 +119021,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124535,7 +119030,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124586,7 +119081,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20039, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20140, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124601,7 +119096,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20078, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20179, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124616,7 +119111,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15266, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15320, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124740,7 +119235,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6718 + v10 = __ccgo_ts + 6743 } zSchemaName = v10 } @@ -124757,7 +119252,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20109, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20210, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124836,7 +119331,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20114, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20215, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124849,7 +119344,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12570, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12624, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124869,9 +119364,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20123, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20224, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20242, 0) } } } @@ -124885,7 +119380,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20161, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20262, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125082,14 +119577,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -125098,7 +119593,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -125130,11 +119625,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125187,7 +119682,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -125224,12 +119719,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20192, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20293, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20243, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20344, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125250,7 +119745,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20276, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20377, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125389,7 +119884,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125497,7 +119992,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125541,7 +120036,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125564,7 +120059,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20309 + v1 = __ccgo_ts + 20410 } else { v1 = __ccgo_ts + 1665 } @@ -125573,7 +120068,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20332, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20433, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125605,7 +120100,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8319) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8344) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125734,6 +120229,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125762,7 +120258,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16001) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16102) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125795,9 +120291,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125807,13 +120303,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125833,7 +120329,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -126006,8 +120502,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -126016,11 +120512,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -126036,7 +120532,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -126060,14 +120556,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20344, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20445, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -126168,7 +120664,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20398, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20499, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -126369,14 +120865,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20438, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20539, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -126408,7 +120904,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -126423,7 +120919,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20453, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20554, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126477,7 +120973,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126510,7 +121006,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126569,7 +121065,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126598,6 +121094,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126620,10 +121123,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126657,8 +121160,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126673,8 +121176,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126703,8 +121206,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126721,7 +121224,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126734,11 +121237,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126772,49 +121275,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126822,16 +121326,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126849,11 +121353,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20469 + v47 = __ccgo_ts + 20570 } else { - v46 = __ccgo_ts + 20478 + v47 = __ccgo_ts + 20579 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19321, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19422, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126863,12 +121367,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126881,13 +121385,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126898,12 +121402,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126952,12 +121456,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -127027,9 +121535,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -127046,10 +121554,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -127076,8 +121584,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -127117,32 +121625,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -127184,7 +121692,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20469) + _explainTempTable(tls, pParse, __ccgo_ts+20570) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -127290,7 +121798,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -127306,7 +121814,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20487, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20588, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127396,7 +121904,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127558,7 +122066,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20552, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20653, 0) goto trigger_cleanup } iDb = int32(1) @@ -127598,7 +122106,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20598, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20699, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127608,11 +122116,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20606, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20707, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20647, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20748, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127621,13 +122129,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20598, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20699, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20687, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20788, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127635,8 +122143,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20713, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20814, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127644,15 +122152,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20751 + v1 = __ccgo_ts + 20852 } else { - v1 = __ccgo_ts + 20758 + v1 = __ccgo_ts + 20859 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20764, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20865, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20801, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20902, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127672,9 +122180,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6661 + v3 = __ccgo_ts + 6686 } else { - v3 = __ccgo_ts + 6149 + v3 = __ccgo_ts + 6173 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127774,7 +122282,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20598, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20699, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127796,7 +122304,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20847, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20948, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127812,10 +122320,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20895, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20996, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20970, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21071, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128083,11 +122591,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20999, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21100, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -128125,9 +122633,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zTab = v1 if iDb == int32(1) { @@ -128142,7 +122650,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21019, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21120, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -128275,11 +122783,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21081 + v1 = __ccgo_ts + 21182 } else { - v1 = __ccgo_ts + 21088 + v1 = __ccgo_ts + 21189 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21095, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21196, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128381,7 +122889,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21244, 0) return int32(1) } @@ -128529,12 +123037,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128542,19 +123050,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128565,7 +123076,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128579,7 +123090,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128647,7 +123158,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6346, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6370, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128746,10 +123257,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21185, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21286, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128771,7 +123284,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -128843,7 +123356,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -129259,13 +123772,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -129273,21 +123786,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -129334,7 +123847,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -129373,7 +123886,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -129417,58 +123930,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21199, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21300, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21235, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21336, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8094 + v10 = __ccgo_ts + 8119 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129498,17 +123999,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129520,11 +124021,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129540,11 +124041,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129553,18 +124054,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129573,16 +124074,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129600,24 +124101,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129643,50 +124144,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -129984,8 +124485,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130035,8 +124536,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -130083,11 +124584,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -130099,11 +124600,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -130146,7 +124647,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21254) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21355) } goto update_cleanup update_cleanup: @@ -130203,13 +124704,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -130251,11 +124752,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130580,9 +125081,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 200)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21267, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21368, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21271, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21372, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130671,13 +125172,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130685,7 +125186,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12659, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12713, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130767,7 +125268,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21344, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21348, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21445, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21449, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130858,7 +125359,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130897,17 +125398,17 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21352) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21453) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21392) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21493) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21435) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21536) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -130924,7 +125425,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21484) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21585) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130977,7 +125478,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15036) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15090) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131008,11 +125509,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21511, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21612, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21619, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21720, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131021,7 +125522,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21673, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21774, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -131031,7 +125532,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21810, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21911, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131122,39 +125623,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -131165,7 +125633,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -131174,7 +125642,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -131184,7 +125652,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -131209,15 +125677,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -131232,13 +125700,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131558,7 +126028,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12889, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12943, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131681,24 +126151,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21933, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22034, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21957, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22058, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22056, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22157, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131755,7 +126230,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131782,7 +126257,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22075, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22176, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131816,7 +126291,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131824,9 +126299,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22117, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22218, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3862, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3888, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -131839,7 +126314,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22147 + zFormat = __ccgo_ts + 22248 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131873,7 +126348,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16739, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16840, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131954,13 +126429,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22193, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22294, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3862, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3888, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -132041,7 +126516,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22193, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22294, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -132089,7 +126564,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22212, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22313, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132100,9 +126575,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132144,7 +126619,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3862 + v3 = __ccgo_ts + 3888 } else { v3 = uintptr(0) } @@ -132510,7 +126985,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132600,7 +127075,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132620,7 +127095,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3862, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3888, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132684,7 +127159,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132697,7 +127172,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132957,436 +127432,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -133418,10 +127463,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22225 + return __ccgo_ts + 22326 } if i == -int32(1) { - return __ccgo_ts + 16848 + return __ccgo_ts + 16949 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133440,10 +127485,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22232, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22333, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22339, int32(1)) } i = 0 for { @@ -133451,7 +127496,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13279, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13333, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133460,11 +127505,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22339, int32(1)) } i = 0 for { @@ -133472,16 +127517,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13279, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13333, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } } @@ -133528,7 +127573,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133536,12 +127581,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22232, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22333, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22243 + v2 = __ccgo_ts + 22344 } else { - v2 = __ccgo_ts + 22248 + v2 = __ccgo_ts + 22349 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133558,7 +127603,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22256) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22357) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133569,9 +127614,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22258) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22359) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } // C documentation @@ -133616,11 +127661,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22260 + v2 = __ccgo_ts + 22361 } else { - v2 = __ccgo_ts + 22267 + v2 = __ccgo_ts + 22368 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22272, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22373, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133633,37 +127678,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11442 + zFmt = __ccgo_ts + 11496 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22278 + zFmt = __ccgo_ts + 22379 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22311 + zFmt = __ccgo_ts + 22412 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22336 + zFmt = __ccgo_ts + 22437 } else { - zFmt = __ccgo_ts + 22354 + zFmt = __ccgo_ts + 22455 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22363, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22464, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16848 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22371, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16949 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22472, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22402, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22503, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133673,14 +127718,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22412, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22513, libc.VaList(bp+144, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22417) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22518) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22439 + v3 = __ccgo_ts + 22540 } else { - v3 = __ccgo_ts + 22447 + v3 = __ccgo_ts + 22548 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133701,7 +127746,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22453, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22554, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133731,10 +127776,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133767,14 +127812,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22464, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22565, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22243, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22344, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22485, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22586, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133798,16 +127843,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22232, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22333, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22243, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22344, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5199, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -134012,7 +128057,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -134068,8 +128113,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -134091,7 +128136,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -134148,10 +128193,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -134206,37 +128251,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -134261,10 +128292,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -134283,24 +128314,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -134312,8 +128343,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -134371,7 +128402,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -134453,7 +128484,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134584,7 +128615,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -134721,7 +128752,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134866,7 +128897,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134927,11 +128958,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134962,6 +128993,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -135100,7 +129134,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -135180,7 +129214,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -135214,7 +129248,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -135336,7 +129370,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135529,7 +129563,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135543,12 +129577,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135586,11 +129621,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135610,7 +129645,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135646,21 +129681,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135678,7 +129713,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135733,7 +129768,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22493, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22594, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135756,7 +129791,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22508, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22609, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -136245,9 +130280,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -136256,14 +130291,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22517, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22618, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -136302,15 +130337,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -136322,7 +130358,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -136395,7 +130431,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -136793,19 +130829,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16697, + FzOp: __ccgo_ts + 16798, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16031, + FzOp: __ccgo_ts + 16132, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15510, + FzOp: __ccgo_ts + 15591, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22531, + FzOp: __ccgo_ts + 22632, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137325,37 +131361,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137593,7 +131633,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22538, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22639, 0) return } } else { @@ -137605,10 +131645,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22538, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22639, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137667,7 +131707,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137689,7 +131729,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8080 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8105 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137790,7 +131830,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22579 + v13 = __ccgo_ts + 22680 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138321,7 +132361,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22586, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22687, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -138393,22 +132433,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138521,7 +132549,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -139437,7 +133465,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141688,13 +135717,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141794,6 +135818,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141807,12 +135832,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -142258,7 +136300,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -142309,15 +136351,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -142349,7 +136382,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -142368,7 +136401,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -142405,7 +136438,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -142413,7 +136446,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -142434,19 +136467,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142542,7 +136575,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142720,7 +136753,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142748,6 +136781,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142824,7 +136865,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -143061,7 +137102,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22659, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22760, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143136,7 +137177,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22659, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22760, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143290,7 +137331,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143726,7 +137767,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22685, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22786, 0) rc = SQLITE_OK } else { break @@ -143955,17 +137996,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144934,7 +138964,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22720, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22821, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145512,7 +139542,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145668,7 +139698,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22738, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22839, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145689,11 +139719,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -145741,7 +139768,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22766, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22867, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145886,7 +139913,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -145920,7 +139948,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145942,7 +139970,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145955,7 +139983,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -146046,11 +140074,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -146077,16 +140105,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -146134,7 +140162,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -146265,7 +140293,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -146443,7 +140471,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146472,7 +140500,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146482,7 +140510,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22784, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22885, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146532,7 +140560,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146801,7 +140829,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22813, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22914, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146983,7 +141011,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22869, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22970, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147309,7 +141337,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22914, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23015, libc.VaList(bp+8, zName)) } return p } @@ -147360,12 +141388,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22933, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23034, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23004, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23105, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147438,7 +141466,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8319) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8344) } break } @@ -147469,16 +141497,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147497,17 +141515,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -147525,7 +141543,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147549,13 +141567,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147570,23 +141588,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147602,13 +141620,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147720,7 +141738,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23067, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23168, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147756,7 +141774,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147771,7 +141789,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147790,11 +141808,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147840,11 +141858,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147861,7 +141879,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147883,7 +141901,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -148007,7 +142025,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23093, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23194, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148075,18 +142093,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23125 + zErr = __ccgo_ts + 23226 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23142 + zErr = __ccgo_ts + 23243 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23158 + zErr = __ccgo_ts + 23259 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23178, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23279, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -148110,7 +142128,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23211, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23312, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148216,24 +142234,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -148251,12 +142269,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -148268,15 +142286,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -148328,11 +142346,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23258, - 1: __ccgo_ts + 23311, - 2: __ccgo_ts + 22813, - 3: __ccgo_ts + 23362, - 4: __ccgo_ts + 23414, + 0: __ccgo_ts + 23359, + 1: __ccgo_ts + 23412, + 2: __ccgo_ts + 22914, + 3: __ccgo_ts + 23463, + 4: __ccgo_ts + 23515, } var _aOp1 = [5]int32{ @@ -148385,87 +142403,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148912,7 +142849,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -149008,7 +142945,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -149725,12 +143662,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149738,13 +143675,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149764,13 +143701,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149797,7 +143734,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -150016,6 +143953,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -150076,7 +144017,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23464, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23565, libc.VaList(bp+8, p)) } // C documentation @@ -150090,6 +144031,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -150123,11 +144065,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23488 + v1 = __ccgo_ts + 23589 } else { - v1 = __ccgo_ts + 23497 + v1 = __ccgo_ts + 23598 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23503, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23604, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150136,7 +144078,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23646, 0) } } } @@ -150242,7 +144184,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23579, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23680, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156709,14 +150651,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156727,16 +150661,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -156763,13 +150687,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -157884,19 +151808,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158699,20 +152623,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16848, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16949, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23617, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23718, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16761, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16885, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23617, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23718, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158753,7 +152677,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158898,7 +152827,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -158988,9 +152922,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -159345,7 +153279,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23644) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23745) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159685,23 +153619,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8100 + } else { + v347 = __ccgo_ts + 8105 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8075 - } else { - v347 = __ccgo_ts + 8080 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -159759,11 +153707,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -159773,9 +153721,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -159783,11 +153731,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -159885,11 +153833,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159939,15 +153887,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23653, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23754, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23748, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23849, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23832, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23933, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160089,7 +154037,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -160283,7 +154231,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23917, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24018, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -162409,7 +156357,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -163014,14 +156962,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163883,22 +157834,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163909,11 +157869,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164492,7 +158452,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164512,7 +158472,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24004, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24105, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164637,11 +158597,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164813,14 +158773,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24547 + zErr = __ccgo_ts + 24648 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164832,31 +158792,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24072, - 1: __ccgo_ts + 24085, - 3: __ccgo_ts + 24101, - 4: __ccgo_ts + 24126, - 5: __ccgo_ts + 24140, - 6: __ccgo_ts + 24159, + 0: __ccgo_ts + 24173, + 1: __ccgo_ts + 24186, + 3: __ccgo_ts + 24202, + 4: __ccgo_ts + 24227, + 5: __ccgo_ts + 24241, + 6: __ccgo_ts + 24260, 7: __ccgo_ts + 1635, - 8: __ccgo_ts + 24184, - 9: __ccgo_ts + 24221, - 10: __ccgo_ts + 24233, - 11: __ccgo_ts + 24248, - 12: __ccgo_ts + 24281, - 13: __ccgo_ts + 24299, - 14: __ccgo_ts + 24324, - 15: __ccgo_ts + 24353, - 17: __ccgo_ts + 6104, - 18: __ccgo_ts + 5506, - 19: __ccgo_ts + 24370, - 20: __ccgo_ts + 24388, - 21: __ccgo_ts + 24406, - 23: __ccgo_ts + 24440, - 25: __ccgo_ts + 24461, - 26: __ccgo_ts + 24487, - 27: __ccgo_ts + 24510, - 28: __ccgo_ts + 24531, + 8: __ccgo_ts + 24285, + 9: __ccgo_ts + 24322, + 10: __ccgo_ts + 24334, + 11: __ccgo_ts + 24349, + 12: __ccgo_ts + 24382, + 13: __ccgo_ts + 24400, + 14: __ccgo_ts + 24425, + 15: __ccgo_ts + 24454, + 17: __ccgo_ts + 6128, + 18: __ccgo_ts + 5532, + 19: __ccgo_ts + 24471, + 20: __ccgo_ts + 24489, + 21: __ccgo_ts + 24507, + 23: __ccgo_ts + 24541, + 25: __ccgo_ts + 24562, + 26: __ccgo_ts + 24588, + 27: __ccgo_ts + 24611, + 28: __ccgo_ts + 24632, } // C documentation @@ -164950,15 +158910,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164966,6 +158928,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164973,10 +158937,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -165003,6 +158967,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -165030,12 +159008,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -165053,9 +159031,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -165078,13 +159056,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24628, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24729, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -165102,15 +159080,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -165125,27 +159103,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -165156,30 +159134,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -165204,7 +159212,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24691, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24792, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165235,13 +159243,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -165252,43 +159262,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -165299,12 +159313,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -165316,6 +159330,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -165323,82 +159339,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -165442,18 +159468,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165479,7 +159507,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165489,7 +159517,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24742, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24843, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165611,7 +159639,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165743,7 +159771,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165753,7 +159781,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165789,7 +159817,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165802,7 +159830,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165811,7 +159839,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24763, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24864, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165846,9 +159874,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165958,7 +159986,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24831, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24932, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -165988,8 +160016,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24837, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24847, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24938, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24948, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166078,24 +160106,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24875, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24976, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24879, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24980, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24879 + zModeType = __ccgo_ts + 24980 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24900, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25001, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3471 + zModeType = __ccgo_ts + 3497 } if aMode != 0 { mode = 0 @@ -166124,12 +160152,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24915, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25016, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24935, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25036, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166153,7 +160181,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24959, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25060, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166173,11 +160201,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24885, + Fz: __ccgo_ts + 24986, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24892, + Fz: __ccgo_ts + 24993, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166188,19 +160216,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24905, + Fz: __ccgo_ts + 25006, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24908, + Fz: __ccgo_ts + 25009, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24911, + Fz: __ccgo_ts + 25012, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17918, + Fz: __ccgo_ts + 18019, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166328,8 +160356,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22579, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24975, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22680, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25076, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166350,10 +160378,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4257 + zFilename = __ccgo_ts + 4283 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -166362,7 +160390,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3862 + v2 = __ccgo_ts + 3888 } else { v2 = uintptr(0) } @@ -166389,9 +160417,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6713 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6738 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23977 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24078 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166485,7 +160513,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24981 + zFilename = __ccgo_ts + 25082 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166504,36 +160532,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166541,7 +160577,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166549,31 +160585,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166607,12 +160647,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166645,10 +160687,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166659,7 +160701,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166702,20 +160744,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24984, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25085, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25009) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25110) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25029) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25130) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25036) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25137) } // C documentation @@ -166740,9 +160782,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166769,29 +160811,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166846,15 +160877,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25053, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25154, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3862 + v2 = __ccgo_ts + 3888 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -167033,8 +161064,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167478,7 +161509,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -167874,7 +161905,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25081, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25182, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168022,6 +162053,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -168045,7 +162078,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -168055,7 +162088,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -168067,7 +162100,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -168083,7 +162116,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -168092,7 +162125,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25089 + v2 = __ccgo_ts + 25190 } else { v2 = uintptr(0) } @@ -168171,7 +162204,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -168338,7 +162371,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168555,6 +162588,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168867,8 +162907,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168925,7 +162965,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168935,7 +162975,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168973,18 +163013,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1651, - 1: __ccgo_ts + 8075, - 2: __ccgo_ts + 8080, - 3: __ccgo_ts + 6389, - 4: __ccgo_ts + 6389, - 5: __ccgo_ts + 6384, - 6: __ccgo_ts + 6384, - 7: __ccgo_ts + 8386, - 8: __ccgo_ts + 8386, - 9: __ccgo_ts + 8386, - 10: __ccgo_ts + 8386, - 11: __ccgo_ts + 25112, - 12: __ccgo_ts + 25118, + 1: __ccgo_ts + 8100, + 2: __ccgo_ts + 8105, + 3: __ccgo_ts + 6414, + 4: __ccgo_ts + 6414, + 5: __ccgo_ts + 6409, + 6: __ccgo_ts + 6409, + 7: __ccgo_ts + 8411, + 8: __ccgo_ts + 8411, + 9: __ccgo_ts + 8411, + 10: __ccgo_ts + 8411, + 11: __ccgo_ts + 25213, + 12: __ccgo_ts + 25219, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -169292,106 +163332,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169471,7 +163411,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169769,8 +163709,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25125 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25125 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -169906,7 +163846,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1651, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15480, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15534, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169920,14 +163860,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25142, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25226, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169981,7 +163919,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25255, -int32(1)) } } } @@ -170264,8 +164202,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25186, - FzRepl: __ccgo_ts + 25190, + FzMatch: __ccgo_ts + 25270, + FzRepl: __ccgo_ts + 25274, }, 1: { Fc1: int8('i'), @@ -170273,8 +164211,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25198, - FzRepl: __ccgo_ts + 25190, + FzMatch: __ccgo_ts + 25282, + FzRepl: __ccgo_ts + 25274, }, 2: { Fc1: int8('n'), @@ -170289,7 +164227,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25207, + FzMatch: __ccgo_ts + 25291, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -170297,7 +164235,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25212, + FzMatch: __ccgo_ts + 25296, FzRepl: __ccgo_ts + 1651, }, } @@ -170313,7 +164251,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25217, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25301, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170331,23 +164269,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -170425,7 +164363,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170496,7 +164434,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170771,7 +164713,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25260, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25344, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -171201,7 +165143,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -171240,7 +165182,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8075, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8100, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171248,7 +165190,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8080, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8105, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -171325,14 +165267,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25186, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25270, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25269) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25353) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25360) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25282, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25366, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171517,7 +165459,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25360) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171562,7 +165504,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171575,7 +165517,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171624,10 +165566,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171661,15 +165599,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171742,11 +165680,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8075, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8100, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8080, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8105, uint32(5)) return i + uint32(1) _6: ; @@ -171795,9 +165733,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25190 + v19 = __ccgo_ts + 25274 } else { - v19 = __ccgo_ts + 11942 + v19 = __ccgo_ts + 11996 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171833,9 +165771,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171862,7 +165803,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25288, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25372, uint32(2)) zIn2++ sz2-- continue @@ -171885,7 +165826,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25291, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25375, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171893,12 +165834,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25298, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25382, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25303, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25387, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172001,16 +165942,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -172078,7 +166009,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25394, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172101,12 +166032,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25313, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25397, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25394, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172121,50 +166052,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -172216,6 +166103,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -172236,6 +166201,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -172308,9 +166276,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -172353,7 +166321,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172841,7 +166820,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172976,7 +166955,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -173077,7 +167056,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) return } @@ -173114,11 +167093,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25142, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25226, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173131,7 +167107,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173150,10 +167126,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25360) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25269) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25353) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173192,7 +167168,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25316, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25400, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173208,7 +167184,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -173289,7 +167265,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173301,34 +167277,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -173411,7 +167407,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173471,7 +167467,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173606,7 +167602,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25334 + v1 = __ccgo_ts + 25418 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173616,7 +167612,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } eErr = uint8(1) @@ -173726,23 +167722,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25336, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25420, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5228, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5254, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1678, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1704, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25343, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25427, uint32(1)) } } } @@ -173782,7 +167778,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174050,7 +168046,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174074,7 +168070,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25345, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25429, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174085,7 +168081,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25396, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25480, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174157,7 +168153,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } goto json_remove_done @@ -174194,7 +168190,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15953) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16054) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174225,9 +168221,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25430 + v1 = __ccgo_ts + 25514 } else { - v1 = __ccgo_ts + 25434 + v1 = __ccgo_ts + 25518 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174275,7 +168271,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } goto json_type_done @@ -174322,7 +168318,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25441 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25525 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -174396,17 +168392,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25446, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25530, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174415,18 +168410,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174488,9 +168482,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174597,7 +168589,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25503, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25587, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174689,20 +168681,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -174746,7 +168740,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25506, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25590, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174774,16 +168768,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -174802,24 +168786,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174827,13 +168793,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174849,7 +168808,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25509) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25593) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174983,7 +168942,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25592, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25676, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -175009,9 +168968,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25599, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25683, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25607, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25691, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175322,9 +169281,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -175397,7 +169355,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25613, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25697, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175421,7 +169379,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25171, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25255, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175482,186 +169440,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25615, + FzName: __ccgo_ts + 25699, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25620, + FzName: __ccgo_ts + 25704, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25626, + FzName: __ccgo_ts + 25710, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25637, + FzName: __ccgo_ts + 25721, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25649, + FzName: __ccgo_ts + 25733, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25649, + FzName: __ccgo_ts + 25733, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25667, + FzName: __ccgo_ts + 25751, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25687, + FzName: __ccgo_ts + 25771, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25700, + FzName: __ccgo_ts + 25784, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25714, + FzName: __ccgo_ts + 25798, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25717, + FzName: __ccgo_ts + 25801, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25721, + FzName: __ccgo_ts + 25805, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25733, + FzName: __ccgo_ts + 25817, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25746, + FzName: __ccgo_ts + 25830, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25758, + FzName: __ccgo_ts + 25842, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25771, + FzName: __ccgo_ts + 25855, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25782, + FzName: __ccgo_ts + 25866, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25794, + FzName: __ccgo_ts + 25878, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25794, + FzName: __ccgo_ts + 25878, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25806, + FzName: __ccgo_ts + 25890, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25817, + FzName: __ccgo_ts + 25901, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25829, + FzName: __ccgo_ts + 25913, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25842, + FzName: __ccgo_ts + 25926, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25855, + FzName: __ccgo_ts + 25939, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25869, + FzName: __ccgo_ts + 25953, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25878, + FzName: __ccgo_ts + 25962, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25888, + FzName: __ccgo_ts + 25972, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25888, + FzName: __ccgo_ts + 25972, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25898, + FzName: __ccgo_ts + 25982, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25898, + FzName: __ccgo_ts + 25982, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25909, + FzName: __ccgo_ts + 25993, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25926, + FzName: __ccgo_ts + 26010, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25944, + FzName: __ccgo_ts + 26028, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25962, + FzName: __ccgo_ts + 26046, }, } @@ -175744,17 +169702,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25981, + FzName: __ccgo_ts + 26065, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25991, + FzName: __ccgo_ts + 26075, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175804,224 +169764,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -176039,33 +169784,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -176076,79 +169815,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -176332,7 +170056,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -176395,7 +170119,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26001, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26085, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176406,7 +170130,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176700,7 +170424,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26006, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26090, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -177242,7 +170966,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177622,7 +171346,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26088) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26172) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177700,7 +171424,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -177931,7 +171655,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -177939,7 +171663,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -178177,7 +171901,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178599,7 +172323,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -179108,11 +172832,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179125,11 +172849,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179157,7 +172881,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26102, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26186, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -179167,11 +172891,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26122, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26206, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26154, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26238, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179385,7 +173109,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26191, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26275, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -179439,9 +173163,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26336 + zFmt = __ccgo_ts + 26420 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11771, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11825, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179499,9 +173223,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26392, - 1: __ccgo_ts + 5567, - 2: __ccgo_ts + 16848, + 0: __ccgo_ts + 26476, + 1: __ccgo_ts + 5593, + 2: __ccgo_ts + 16949, } var _rtreeModule = Tsqlite3_module{ @@ -179545,21 +173269,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26806, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26890, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26868, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26952, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26873, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26937, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27007, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26957, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27021, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27091, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179589,7 +173313,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27056 + zFormat = __ccgo_ts + 27140 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179604,31 +173328,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27164, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27248, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27209, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27293, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13279, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13333, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27236, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27320, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27258, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27342, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27266, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27350, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179642,14 +173366,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26397, - 1: __ccgo_ts + 26450, - 2: __ccgo_ts + 26495, - 3: __ccgo_ts + 26547, - 4: __ccgo_ts + 26601, - 5: __ccgo_ts + 26646, - 6: __ccgo_ts + 26704, - 7: __ccgo_ts + 26759, + 0: __ccgo_ts + 26481, + 1: __ccgo_ts + 26534, + 2: __ccgo_ts + 26579, + 3: __ccgo_ts + 26631, + 4: __ccgo_ts + 26685, + 5: __ccgo_ts + 26730, + 6: __ccgo_ts + 26788, + 7: __ccgo_ts + 26843, } // C documentation @@ -179707,7 +173431,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27282, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27366, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179715,17 +173439,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27302, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27386, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179788,7 +173512,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -179802,13 +173526,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27545, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27629, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27551, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27635, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -179817,7 +173541,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27575, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27659, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179831,19 +173555,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27602, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27686, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179866,7 +173590,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179877,7 +173601,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179893,8 +173617,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27581, - 1: __ccgo_ts + 27592, + 0: __ccgo_ts + 27665, + 1: __ccgo_ts + 27676, } // C documentation @@ -179952,21 +173676,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11391, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11445, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27605, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27689, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27611, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27695, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27615, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27699, int32(1)) goto _1 _1: ; @@ -179993,7 +173717,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27617, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27701, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180027,23 +173751,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -180096,7 +173803,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -180111,11 +173818,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4270 + v1 = __ccgo_ts + 4296 } else { v1 = __ccgo_ts + 1665 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27650, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27734, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -180149,7 +173856,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27657, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27741, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -180166,7 +173873,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27702, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27786, libc.VaList(bp+8, iNode)) } } return pRet @@ -180195,8 +173902,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27734, - 1: __ccgo_ts + 27788, + 0: __ccgo_ts + 27818, + 1: __ccgo_ts + 27872, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -180209,21 +173916,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27836 + v1 = __ccgo_ts + 27920 } else { - v1 = __ccgo_ts + 27844 + v1 = __ccgo_ts + 27928 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27853, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27937, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27836 + v2 = __ccgo_ts + 27920 } else { - v2 = __ccgo_ts + 27844 + v2 = __ccgo_ts + 27928 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27898, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27982, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180268,7 +173975,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27956, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28040, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180286,7 +173993,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28004, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28088, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180319,19 +174026,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28071, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28155, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28105, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28189, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28135, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180376,12 +174083,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28190, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28274, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28305, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180410,7 +174117,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28288, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28372, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180420,11 +174127,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26102, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26186, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28316, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28400, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -180440,8 +174147,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28347, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28354, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28431, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28438, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180468,7 +174175,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28362, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28446, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180519,13 +174226,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28381, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28465, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6713 + zDb = __ccgo_ts + 6738 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180534,7 +174241,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18615 + v1 = __ccgo_ts + 18716 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180628,14 +174335,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180660,16 +174359,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180801,7 +174490,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -180846,7 +174535,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && int32(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -180908,7 +174597,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -181276,7 +174965,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -181291,9 +174980,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -181378,7 +175067,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -181452,13 +175141,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181519,7 +175201,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181558,7 +175240,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181662,7 +175344,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181693,36 +175375,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181746,7 +175398,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -182030,7 +175682,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -182187,7 +175839,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -182199,13 +175851,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27545, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27629, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28505, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28589, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -182214,13 +175866,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28527, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28611, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27602, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27686, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182228,7 +175880,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -182243,7 +175895,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182455,7 +176107,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16848 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16949 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -182465,7 +176117,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28531 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28615 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182473,7 +176125,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28537 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28621 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182593,7 +176245,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28546, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28630, 0) } goto geopoly_update_end } @@ -182693,16 +176345,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28586) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28670) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28602) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28686) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182772,7 +176424,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28779, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28863, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182786,61 +176438,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28617, + FzName: __ccgo_ts + 28701, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28630, + FzName: __ccgo_ts + 28714, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28643, + FzName: __ccgo_ts + 28727, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28656, + FzName: __ccgo_ts + 28740, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28602, + FzName: __ccgo_ts + 28686, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28668, + FzName: __ccgo_ts + 28752, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28586, + FzName: __ccgo_ts + 28670, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28691, + FzName: __ccgo_ts + 28775, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28705, + FzName: __ccgo_ts + 28789, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28718, + FzName: __ccgo_ts + 28802, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28732, + FzName: __ccgo_ts + 28816, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28748, + FzName: __ccgo_ts + 28832, }, } @@ -182866,7 +176518,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28760, + FzName: __ccgo_ts + 28844, }, } @@ -182891,20 +176543,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28787, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28871, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28797, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28881, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28808, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28892, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28531, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28615, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28819, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28903, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182978,7 +176630,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -183006,17 +176658,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26088, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26172, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -183024,33 +176678,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -183247,7 +176905,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183668,248 +177326,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -184223,7 +177639,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28829, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28913, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184233,7 +177649,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28829, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28913, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184259,7 +177675,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -184282,7 +177698,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -184414,7 +177830,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28850, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28934, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184503,7 +177919,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26001, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26085, zIn, uint64(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184540,13 +177956,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29021 + v1 = __ccgo_ts + 29105 } else { v1 = __ccgo_ts + 1665 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29062, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29146, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29212) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29296) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184713,7 +178129,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184774,7 +178190,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29337, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29421, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184784,7 +178200,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29456, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29540, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184792,7 +178208,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29477, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29561, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184804,7 +178220,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29528, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29612, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184848,7 +178264,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29549, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29633, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184861,7 +178277,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -184914,7 +178330,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20123, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20224, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184925,7 +178341,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29606, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29690, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184936,7 +178352,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29625, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29709, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -184944,7 +178360,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29630, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29714, zName) { bRbuRowid = int32(1) } } @@ -184958,17 +178374,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29640 + v4 = __ccgo_ts + 29724 } else { - v4 = __ccgo_ts + 29653 + v4 = __ccgo_ts + 29737 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29662, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29746, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29691, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29775, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184990,7 +178406,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29713, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29797, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -185036,8 +178452,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29740, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29824, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15201 goto _1 _1: ; @@ -185071,7 +178487,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29749, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29833, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185119,21 +178535,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29762, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29846, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29794, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29878, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15147, __ccgo_ts+29817) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29823, __ccgo_ts+29830, __ccgo_ts+5173) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15147, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15201, __ccgo_ts+29901) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29907, __ccgo_ts+29914, __ccgo_ts+5199) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15201, __ccgo_ts+1665) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29838, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29922, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29964, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185185,7 +178601,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1665 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -185207,15 +178623,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29900 + zCol = __ccgo_ts + 29984 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29908, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29929, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29965, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15147 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29992, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30013, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30049, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15201 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185224,7 +178640,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29992, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30076, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { zSep = __ccgo_ts + 1665 iCol = 0 @@ -185241,15 +178657,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30040, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15147 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30124, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15201 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30047, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30131, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185307,7 +178723,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1665 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185316,7 +178732,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30059, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30143, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) zType = __ccgo_ts + 1665 } else { if iCid < 0 { @@ -185336,9 +178752,9 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29900 + zCol = __ccgo_ts + 29984 } else { - zCol = __ccgo_ts + 29630 + zCol = __ccgo_ts + 29714 } } zType = __ccgo_ts + 1139 @@ -185346,24 +178762,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30081, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30165, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29817 + v2 = __ccgo_ts + 29901 } else { v2 = __ccgo_ts + 1665 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30101, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30185, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30122, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30155, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30206, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30239, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15147 - zAnd = __ccgo_ts + 22232 + zCom = __ccgo_ts + 15201 + zAnd = __ccgo_ts + 22333 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185417,11 +178833,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30179, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30263, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30191, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30275, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15147 + zS = __ccgo_ts + 15201 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185433,7 +178849,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30200, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30284, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185459,7 +178875,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30215, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30299, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { zSep = __ccgo_ts + 1665 @@ -185469,15 +178885,15 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30229, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22232 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30313, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22333 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30241, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30325, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -185487,8 +178903,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30291, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22232 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30375, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22333 } goto _2 _2: @@ -185511,7 +178927,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30304, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30388, 0) } // C documentation @@ -185553,16 +178969,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30291, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30375, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15201 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30330, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30414, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15201 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30360, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30444, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15201 } } } @@ -185646,16 +179062,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30397 + zSep = __ccgo_ts + 30481 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29549, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29633, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16736) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16837) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, zIdx))) } break } @@ -185666,16 +179082,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29817 + v1 = __ccgo_ts + 29901 } else { v1 = __ccgo_ts + 1665 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30410, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15147 + z = _rbuMPrintf(tls, p, __ccgo_ts+30494, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15201 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30421, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185721,7 +179137,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30425) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30509) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185729,7 +179145,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -185738,21 +179154,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30475, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30559, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29817 + v1 = __ccgo_ts + 29901 } else { v1 = __ccgo_ts + 1665 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30497, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15147 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30581, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15201 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30591, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30522, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30606, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, 0)) } } @@ -185789,7 +179205,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1665 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185798,19 +179214,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1665 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30584 + zPk = __ccgo_ts + 30668 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30597 + v2 = __ccgo_ts + 30681 } else { v2 = __ccgo_ts + 1665 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30607, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15147 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30691, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15201 goto _1 _1: ; @@ -185819,17 +179235,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30634, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30718, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30641 + v3 = __ccgo_ts + 30725 } else { v3 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30656, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30740, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, 0)) } } @@ -185855,7 +179271,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30688, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30772, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185901,7 +179317,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30745) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30829) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -186070,7 +179486,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30811, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30895, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186087,18 +179503,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30831, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30915, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30896, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30980, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30932, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31016, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186113,26 +179529,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30966 + v2 = __ccgo_ts + 31050 } else { - v2 = __ccgo_ts + 30970 + v2 = __ccgo_ts + 31054 } v1 = v2 } else { v1 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30976, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31060, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31037, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31121, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30966 + v3 = __ccgo_ts + 31050 } else { - v3 = __ccgo_ts + 30970 + v3 = __ccgo_ts + 31054 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31098, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31182, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186151,8 +179567,8 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6724) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6720) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6749) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6745) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -186161,39 +179577,39 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { v4 = __ccgo_ts + 1665 } else { - v4 = __ccgo_ts + 31257 + v4 = __ccgo_ts + 31341 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31266 + v5 = __ccgo_ts + 31350 } else { v5 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31276, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31360, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31312, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31396, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { zRbuRowid = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31340 + zRbuRowid = __ccgo_ts + 31424 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31352 + v6 = __ccgo_ts + 31436 } else { v6 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31369, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31445, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31453, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31529, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31744, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31828, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186204,9 +179620,9 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31843 + v7 = __ccgo_ts + 31927 } else { - v7 = __ccgo_ts + 31853 + v7 = __ccgo_ts + 31937 } zRbuRowid1 = v7 } @@ -186219,14 +179635,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29900, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29984, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15147, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15201, __ccgo_ts+1665) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31864 + v8 = __ccgo_ts + 31948 } else { v8 = __ccgo_ts + 1665 } @@ -186236,11 +179652,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1665 } if zOrder != 0 { - v10 = __ccgo_ts + 23488 + v10 = __ccgo_ts + 23589 } else { v10 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31870, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31954, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186328,9 +179744,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31257 + zPrefix = __ccgo_ts + 31341 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31918, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32002, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -186357,7 +179773,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -186404,7 +179820,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31948, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32032, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -186463,27 +179879,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31978, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32062, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32006, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3485, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32090, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3511, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6713, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6738, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32024, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32108, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186516,10 +179932,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32090, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32174, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24831, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24932, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186535,14 +179951,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 32122 + v2 = __ccgo_ts + 32206 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1665 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32124, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32208, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186553,27 +179969,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32156, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32240, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32171, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32255, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32188, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32272, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32204, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32288, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32232, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32316, 0) } } @@ -186623,7 +180039,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186725,7 +180141,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186755,7 +180171,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -186798,12 +180214,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186825,21 +180241,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186856,7 +180272,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32285, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32369, 0) } // C documentation @@ -186873,13 +180289,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32310, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32317, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32394, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32401, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187011,7 +180427,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24388, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24489, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187147,7 +180563,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32324) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32408) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -187160,7 +180576,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32346, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32430, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187187,7 +180603,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32373, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32457, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -187223,9 +180639,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32533, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32617, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32548, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32632, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187248,9 +180664,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32568, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32652, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32593) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32677) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187261,10 +180677,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32701) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32785) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32766) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32850) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187282,7 +180698,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32810, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32894, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187309,8 +180725,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17821) - _rbuCopyPragma(tls, p, __ccgo_ts+16932) + _rbuCopyPragma(tls, p, __ccgo_ts+17922) + _rbuCopyPragma(tls, p, __ccgo_ts+17033) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187318,7 +180734,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32835, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32919, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187340,10 +180756,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187357,10 +180773,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -187430,7 +180846,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32863, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32947, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187453,10 +180869,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32310, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32394, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187478,7 +180894,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32888, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32972, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187525,7 +180941,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32899, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32983, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187570,11 +180986,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32971, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33055, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32985) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33069) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187583,7 +180999,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33042) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33126) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187631,7 +181047,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3862, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3888, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187663,7 +181079,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33116, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33200, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187685,17 +181101,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33148 + v3 = __ccgo_ts + 33232 } else { - v3 = __ccgo_ts + 33155 + v3 = __ccgo_ts + 33239 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33162, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33246, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15036, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15090, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187707,21 +181123,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17535) - _rbuCopyPragma(tls, p, __ccgo_ts+16947) + _rbuCopyPragma(tls, p, __ccgo_ts+17636) + _rbuCopyPragma(tls, p, __ccgo_ts+17048) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33194, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33278, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33210, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33294, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187799,7 +181215,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33234, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33318, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187846,7 +181262,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31257, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31341, uint64(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187874,16 +181290,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187893,7 +181309,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33242, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33326, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187994,32 +181410,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15051, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15105, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15051, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15105, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15036 + v1 = __ccgo_ts + 15090 } else { - v1 = __ccgo_ts + 33194 + v1 = __ccgo_ts + 33278 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33194, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33278, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188045,9 +181461,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -188119,7 +181537,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -188322,7 +181740,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -188373,14 +181791,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189956,7 +183313,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33337, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33421, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -189979,13 +183336,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33345 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33429 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33354 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33438 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33359 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33443 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189994,7 +183351,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -190083,12 +183440,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33369, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33453, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33524, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33608, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33538, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33622, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190165,7 +183522,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33553, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33637, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -190305,315 +183662,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -191366,7 +184414,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -191459,11 +184507,11 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11771, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11825, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33560, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33644, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -191472,7 +184520,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33690, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33774, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191498,10 +184546,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29900)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29984))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -191522,8 +184570,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29900) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29900, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29984) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29984, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191587,7 +184635,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191604,6 +184652,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191625,12 +184675,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11771, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11825, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -191920,10 +184970,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11391 + zSep = __ccgo_ts + 11445 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33720, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33804, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191935,8 +184985,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1666 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5143, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15147 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5169, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15201 goto _1 _1: ; @@ -192017,13 +185067,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -192515,14 +185558,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192590,8 +185625,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33727, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22232 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33811, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22333 if zRet == uintptr(0) { break } @@ -192620,8 +185655,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33761, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33802 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33845, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33886 if zRet == uintptr(0) { break } @@ -192632,7 +185667,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1785, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1811, 0) } return zRet } @@ -192643,12 +185678,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33807 + v1 = __ccgo_ts + 33891 } else { - v1 = __ccgo_ts + 6718 + v1 = __ccgo_ts + 6743 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33818, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33902, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192709,11 +185744,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15147 + v2 = __ccgo_ts + 15201 } else { v2 = __ccgo_ts + 1665 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33897, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33981, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -192741,7 +185776,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33916, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34000, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192770,17 +185805,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -192793,7 +185829,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -192804,18 +185842,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34057, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34088, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192841,7 +185905,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33973, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34109, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192889,7 +185953,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -193001,15 +186065,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -193173,7 +186239,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5205, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5231, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193473,12 +186539,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34000, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11771, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34004, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34028, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34037, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34082, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34136, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11825, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34140, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34164, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34173, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34218, bp) } else { i = 0 for { @@ -193486,17 +186552,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15147, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15201, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15147 + zSep = __ccgo_ts + 15201 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34096, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34232, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34100, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34236, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193510,7 +186576,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34127, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34263, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193631,7 +186697,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193645,14 +186711,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34169, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34305, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193721,8 +186787,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193747,18 +186813,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34189, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34325, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193782,28 +186848,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193942,7 +187012,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193957,9 +187027,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -193988,20 +187058,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -194013,13 +187087,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -194175,7 +187250,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194199,7 +187274,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194214,7 +187289,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194270,7 +187345,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194375,7 +187450,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194446,8 +187521,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194481,7 +187556,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194491,7 +187566,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194570,7 +187645,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194831,7 +187906,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194908,7 +187983,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -194980,11 +188055,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -194996,8 +188071,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -195025,12 +188100,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -195038,9 +188117,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -195053,14 +188132,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -195084,29 +188155,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -195183,7 +188231,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11771) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11825) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195192,9 +188240,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34207, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34343, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34220, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34356, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195204,9 +188252,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34226, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34362, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15147 + zSep = __ccgo_ts + 15201 } goto _2 _2: @@ -195215,7 +188263,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1665 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34367, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195224,13 +188272,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34239, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34375, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34314, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34450, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22333 } goto _3 _3: @@ -195317,9 +188365,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34320, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34456, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34367, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195329,9 +188377,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34226, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34362, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22333 } goto _1 _1: @@ -195339,9 +188387,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34338, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34474, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33802, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+33886, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -195351,16 +188399,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34314, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34450, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34346 + zSep = __ccgo_ts + 34482 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5173, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5199, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -195386,7 +188434,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6713, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6738, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -195409,16 +188457,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34351, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34487, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22238, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22339, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15147, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15201, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195426,19 +188474,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34505, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34380, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34516, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5173, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5199, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -195461,12 +188509,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11771, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11825, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34384) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34520) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34497) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34633) } return rc } @@ -195510,7 +188558,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195528,11 +188576,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195709,7 +188757,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -195733,7 +188781,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195748,7 +188796,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195799,7 +188847,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -195839,10 +188887,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195880,11 +188928,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195907,7 +188955,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195926,7 +188974,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195935,7 +188983,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195945,10 +188993,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34641, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34777, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195958,10 +189006,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34662, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34798, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195974,7 +189022,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -196001,7 +189049,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -196029,7 +189077,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -196061,15 +189109,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34681, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34817, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34707, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34843, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -196093,9 +189141,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -196105,7 +189153,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6713, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6738, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -196124,18 +189172,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34737, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34873, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34781, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34917, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34852, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34988, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11771) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11825) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196169,7 +189217,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -196178,7 +189226,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -196186,23 +189234,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34912, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35048, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34942, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35078, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34966, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34942, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35102, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35078, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196225,13 +189273,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -196240,11 +189292,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196252,10 +189308,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196263,37 +189325,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -196316,7 +189370,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196686,7 +189740,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -196869,7 +189923,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -196904,8 +189958,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -196924,9 +189978,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -196978,7 +190032,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -197014,11 +190068,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -197031,18 +190091,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -197050,13 +190112,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -197098,12 +190162,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -197111,27 +190181,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -197286,7 +190347,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -197394,8 +190455,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -197407,9 +190468,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -197483,21 +190544,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197603,6 +190668,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197648,24 +190714,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197724,99 +190778,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -197838,14 +190799,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -197857,29 +190810,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197935,15 +190871,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197965,14 +190892,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -198043,7 +190962,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198071,27 +190989,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -198122,7 +191031,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198658,14 +191567,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198676,16 +191577,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198737,10 +191628,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198846,12 +191737,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198926,7 +191817,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34994, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35130, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199282,7 +192173,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35022, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35158, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -199452,18 +192343,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199546,22 +192425,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199580,7 +192443,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35053, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35189, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199679,7 +192542,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35060 + zErr = __ccgo_ts + 35196 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199739,16 +192602,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199767,7 +192620,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -199934,7 +192787,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35110 + zErr = __ccgo_ts + 35246 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200116,15 +192969,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -200205,7 +193049,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -200297,13 +193141,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -200329,13 +193173,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35158 + z = __ccgo_ts + 35294 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35214 + z1 = __ccgo_ts + 35350 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200368,19 +193212,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35272, + FzFunc: __ccgo_ts + 35408, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35280, + FzFunc: __ccgo_ts + 35416, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35290, + FzFunc: __ccgo_ts + 35426, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35295, + FzFunc: __ccgo_ts + 35431, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200768,7 +193612,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -200855,21 +193699,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -201178,13 +194007,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -201244,7 +194066,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35311, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35447, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -201270,12 +194092,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35318, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35454, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35349, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35485, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201284,7 +194106,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35382, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35518, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201294,14 +194116,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35419, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35555, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35428, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35564, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201328,7 +194150,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35461, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35597, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201340,76 +194162,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35495, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35631, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35503, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35639, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35535, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35671, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35541, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35677, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35560, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35696, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35603, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35739, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35560, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35696, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35625, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35761, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35639, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35775, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35677, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35813, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35688, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35824, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35723, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35859, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35730, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35866, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5582, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5608, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8407, + FzName: __ccgo_ts + 8432, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17901, + FzName: __ccgo_ts + 18002, }, 2: { - FzName: __ccgo_ts + 35761, + FzName: __ccgo_ts + 35897, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201417,20 +194239,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35769, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35905, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35800, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35936, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35810, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35946, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35844, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35980, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201491,16 +194313,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35872) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16848) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35877, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36008) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16949) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36013, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35907) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36043) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35917, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36053, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201526,7 +194348,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35948, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36084, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201534,12 +194356,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35953, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36089, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35960, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36096, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36104, 0) } } goto _1 @@ -201555,9 +194377,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35975, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36111, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36104, 0) } goto _2 _2: @@ -201620,8 +194442,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35872) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35983, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36008) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36119, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201652,7 +194474,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36012, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36148, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201682,7 +194504,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36032, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36168, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201690,37 +194512,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36082, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36218, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36137, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36273, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35495 + zTail = __ccgo_ts + 35631 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35495 + zTail = __ccgo_ts + 35631 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36190 + zTail = __ccgo_ts + 36326 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36198, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36334, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16848, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16949, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201789,7 +194611,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36209, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36345, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201798,16 +194620,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 15147 + v2 = __ccgo_ts + 15201 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36225, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36361, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36232, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35872)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36368, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36008)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201840,7 +194662,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201850,9 +194672,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201965,7 +194787,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36258) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36394) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201976,7 +194798,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36263) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36399) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201987,7 +194809,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36272) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36408) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202001,7 +194823,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36282) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36418) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202012,7 +194834,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36292) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36428) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202029,7 +194851,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36304) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36440) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202044,7 +194866,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35872) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36008) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202059,7 +194881,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36316) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36452) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202075,7 +194897,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36330) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36466) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202118,7 +194940,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36340 + zSelect = __ccgo_ts + 36476 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202138,7 +194960,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36372) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36508) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202149,7 +194971,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36380, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36516, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202214,112 +195036,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -202395,7 +195111,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36451, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36587, 0) return FTS5_EOF } goto _1 @@ -202406,7 +195122,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36471, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36607, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202421,13 +195137,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36502, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36638, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36505, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36641, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30966, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31050, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202471,7 +195187,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -203004,16 +195720,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -203038,14 +195744,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -204110,7 +196808,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204120,7 +196818,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204166,14 +196864,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -204226,12 +196916,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -204365,7 +197055,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -204405,15 +197095,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -204454,7 +197144,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -204492,8 +197182,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36509, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35022, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36645, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35158, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204513,10 +197203,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36514, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36650, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204550,7 +197243,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204600,7 +197293,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204651,7 +197344,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21235, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21336, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204678,7 +197371,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -204775,7 +197468,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36543, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36679, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204860,7 +197553,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204873,7 +197566,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204947,7 +197640,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204973,11 +197666,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36596 + v2 = __ccgo_ts + 36732 } else { - v2 = __ccgo_ts + 36509 + v2 = __ccgo_ts + 36645 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36603, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36739, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204990,7 +197683,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36653, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36789, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205111,14 +197804,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -205134,7 +197819,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -205158,14 +197843,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -205467,7 +198144,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205530,67 +198207,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205728,7 +198345,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -206040,7 +198657,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -206472,9 +199089,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -206511,7 +199128,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206584,7 +199200,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206619,7 +199234,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206634,149 +199248,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206784,187 +199262,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -207144,7 +199442,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36706, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36842, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -207249,7 +199547,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36712, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36848, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207278,7 +199576,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36763, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36899, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207312,7 +199610,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36812, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36948, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -207390,7 +199688,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -207481,7 +199779,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36852, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36988, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207492,7 +199790,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36852, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36988, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -208173,7 +200471,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -208418,15 +200716,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208527,7 +200825,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -209133,7 +201431,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36880, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37016, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209222,7 +201520,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36964, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37100, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209869,7 +202167,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -209895,14 +202193,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209912,15 +202202,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -210034,7 +202315,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -210055,7 +202336,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210779,7 +203060,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -211193,7 +203474,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37046, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37182, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211648,13 +203929,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211699,7 +203973,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37103, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211868,7 +204142,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -212186,7 +204460,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37164, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37300, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -212461,7 +204735,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212496,7 +204770,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -212775,16 +205049,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -213002,7 +205266,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -213039,7 +205303,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -213050,70 +205314,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -213182,7 +205383,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -213281,14 +205482,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -213335,19 +205528,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -213426,7 +205606,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -213476,7 +205656,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213558,15 +205738,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1665, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213592,11 +205775,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37215, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37351, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26001, __ccgo_ts+37223, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26085, __ccgo_ts+37359, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11982, __ccgo_ts+37258, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12036, __ccgo_ts+37394, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213794,7 +205977,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -214049,7 +206232,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37302) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37438) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214400,7 +206583,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214522,7 +206705,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214642,7 +206825,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36706, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36842, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -215236,7 +207419,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37304, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37440, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -215467,7 +207650,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37390) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37526) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215606,7 +207789,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215661,87 +207843,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215749,96 +207850,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -216089,7 +208100,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37395, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37531, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216126,7 +208137,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5205, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5231, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -216145,7 +208156,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5205, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5231, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216595,7 +208606,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216623,7 +208634,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216643,7 +208654,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216658,7 +208669,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15147 + v1 = __ccgo_ts + 15201 } else { v1 = __ccgo_ts + 1665 } @@ -216668,11 +208679,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1665 } if bDesc != 0 { - v3 = __ccgo_ts + 37434 + v3 = __ccgo_ts + 37570 } else { - v3 = __ccgo_ts + 37439 + v3 = __ccgo_ts + 37575 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37443, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37579, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216730,14 +208741,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37498, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37634, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5564, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5590, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37504, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37640, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216787,7 +208798,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37532, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37668, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -216820,7 +208831,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37542, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37678, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216854,7 +208865,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37563, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37699, libc.VaList(bp+24, z)) } } } else { @@ -216862,7 +208873,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35290 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35426 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217019,7 +209030,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37596, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37732, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -217219,7 +209230,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37601, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37737, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -217352,10 +209363,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219891,12 +211839,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39086, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39054, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39190, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39092, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39228, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219905,7 +211853,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39130, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39266, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219917,14 +211865,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26001, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11982, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38284, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26085, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12036, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38420, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36190, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36326, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35495, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35631, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219944,13 +211892,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30641 + v1 = __ccgo_ts + 30725 } else { v1 = __ccgo_ts + 1665 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39172, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39308, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39202, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39338, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -219991,7 +211939,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39246, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39382, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -219999,7 +211947,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39269, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39405, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220014,7 +211962,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39275, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39411, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220023,22 +211971,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35495, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35631, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39281 + zCols = __ccgo_ts + 39417 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39313 + zCols = __ccgo_ts + 39449 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36190, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36326, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38284, __ccgo_ts+39361, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38420, __ccgo_ts+39497, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36372, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36508, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220083,14 +212031,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -220160,14 +212100,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -220195,6 +212135,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -220207,11 +212148,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -220224,6 +212178,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -220458,12 +212413,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39378, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39514, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39428, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39564, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39457, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39593, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -220471,7 +212426,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36372, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36508, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220773,7 +212728,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39486, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39622, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220806,17 +212761,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -220903,7 +212847,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -221005,14 +212949,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35495, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35631, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221664,11 +213590,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39540 + zCat = __ccgo_ts + 39676 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221678,7 +213604,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39549) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39685) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221695,20 +213621,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39560) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39696) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*int8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39518) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39654) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39529) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39665) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39549) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39685) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -221744,7 +213670,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -221931,7 +213857,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -221959,14 +213885,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]int8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -222000,7 +213918,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39578 + zBase = __ccgo_ts + 39714 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222044,14 +213962,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -222062,16 +213972,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -222217,64 +214117,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39588, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39724, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39591, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39596, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39732, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39601, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39737, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39604, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39740, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39607, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39743, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39612, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39748, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39617, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39753, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39621, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39757, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39627, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39763, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39632, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39768, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222283,49 +214183,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39636, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39640, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39776, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39643, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39779, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39647, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39783, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39651, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39787, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39655, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39791, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39659, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39795, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39663, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39799, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222342,20 +214242,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39667, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39647, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39803, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39670, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39673, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39806, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39809, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39677, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39663, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39813, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39799, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222371,75 +214271,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39680, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39816, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39647, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39688, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39824, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39695, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39831, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39700, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39836, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39596, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39732, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39705, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39841, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39591, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39727, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39710, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39846, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39663, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39799, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39715, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39851, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16050, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16151, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39720, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39856, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39673, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39809, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39724, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39860, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39865, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39632, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39768, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39735, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39871, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39739, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39875, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39741, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39877, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39655, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222448,48 +214348,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39747, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39883, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39663, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39799, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39891, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39647, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39761, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39897, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39647, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39766, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39902, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39908, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39659, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39795, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39780, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39916, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39788, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39924, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39792, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39928, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39655, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222497,21 +214397,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39800, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39936, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39806, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39942, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39659, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39795, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39812, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39948, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39673, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39809, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222529,48 +214429,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39819, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39955, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39740, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39824, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39960, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39829, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39965, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39740, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39835, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39971, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39740, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39788, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39924, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39841, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39977, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39847, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39983, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222586,13 +214486,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39989, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39857, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39993, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39860, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39996, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222600,7 +214500,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39863, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39999, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222697,14 +214597,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222722,13 +214622,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222765,14 +214658,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39867) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40003) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39560) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39696) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222810,7 +214703,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222938,7 +214831,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -223014,11 +214907,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -223040,7 +214933,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39882)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40018)) } // C documentation @@ -223066,7 +214959,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39578, + FzName: __ccgo_ts + 39714, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223074,7 +214967,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39890, + FzName: __ccgo_ts + 40026, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223082,7 +214975,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39882, + FzName: __ccgo_ts + 40018, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223112,7 +215005,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39896, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40032, pApi, bp+96, uintptr(0)) } return rc } @@ -228573,39 +220466,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228628,16 +220488,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39903) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40039) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39907) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40043) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39911) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40047) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39920, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40056, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228700,21 +220560,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39954, - 1: __ccgo_ts + 39994, - 2: __ccgo_ts + 40029, + 0: __ccgo_ts + 40090, + 1: __ccgo_ts + 40130, + 2: __ccgo_ts + 40165, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23977, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24078, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40072, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40208, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228735,23 +220596,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228884,10 +220745,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40105, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40241, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40136, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40272, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -228906,7 +220767,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40187, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40323, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229356,7 +221217,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40213, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40349, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229411,15 +221272,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40223 + return __ccgo_ts + 40359 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229641,7 +221502,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229689,11 +221550,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-18.1.5\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-19.1.7\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm.go index fd1930a..ca50c9f 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm.go @@ -113799,8 +113799,8 @@ var mu mutex func init() { mu.recursive = true } func Xsqlite3_initialize(tls *libc.TLS) int32 { - mu.enter(tls.ID) - defer mu.leave(tls.ID) + mutexEnter(tls, uintptr(unsafe.Pointer(&mu))) + defer mutexLeave(tls, uintptr(unsafe.Pointer(&mu))) var pMainMtx uintptr var rc int32 diff --git a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go index d144325..e32db26 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_freebsd_arm64.go @@ -1,4 +1,4 @@ -// Code generated for freebsd/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/freebsd/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/freebsd/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/freebsd/arm64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. +// Code generated for freebsd/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/freebsd/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/freebsd/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/freebsd/arm64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -ltcl8.6 -eval-all-macros', DO NOT EDIT. //go:build freebsd && arm64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -29,7 +31,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -83,6 +84,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -1355,6 +1357,7 @@ const SESSIONS_ROWID = "_rowid_" const SESSIONS_STRM_CHUNK_SIZE = 1024 const SESSION_MAX_BUFFER_SZ = 2147483391 const SESSION_UPDATE_CACHE_SZ = 12 +const SFBSD_NAMEDATTR = 1 const SF_APPEND = 262144 const SF_ARCHIVED = 65536 const SF_Aggregate = 8 @@ -1421,6 +1424,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1660,6 +1664,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1870,6 +1875,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -2032,6 +2038,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2040,7 +2047,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2150,8 +2157,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3004,6 +3011,7 @@ const __DBL_MAX__ = 0 const __DBL_MIN_10_EXP__ = -307 const __DBL_MIN_EXP__ = -1021 const __DBL_MIN__ = 0 +const __DBL_NORM_MAX__ = 0 const __DECIMAL_DIG__ = 36 const __ELF__ = 1 const __EXT1_VISIBLE = 1 @@ -3022,6 +3030,7 @@ const __FLT16_MAX__ = 0 const __FLT16_MIN_10_EXP__ = -4 const __FLT16_MIN_EXP__ = -13 const __FLT16_MIN__ = 0 +const __FLT16_NORM_MAX__ = 0 const __FLT_DECIMAL_DIG__ = 9 const __FLT_DENORM_MIN__ = 0 const __FLT_DIG__ = 6 @@ -3036,6 +3045,7 @@ const __FLT_MAX__ = 0 const __FLT_MIN_10_EXP__ = -37 const __FLT_MIN_EXP__ = -125 const __FLT_MIN__ = 0 +const __FLT_NORM_MAX__ = 0 const __FLT_RADIX__ = 2 const __FPCLASS_NEGINF = 4 const __FPCLASS_NEGNORMAL = 8 @@ -3064,6 +3074,8 @@ const __GCC_ATOMIC_POINTER_LOCK_FREE = 2 const __GCC_ATOMIC_SHORT_LOCK_FREE = 2 const __GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1 const __GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2 +const __GCC_CONSTRUCTIVE_SIZE = 64 +const __GCC_DESTRUCTIVE_SIZE = 64 const __GCC_HAVE_DWARF2_CFI_ASM = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 = 1 @@ -3151,7 +3163,7 @@ const __INT_MAX = 2147483647 const __INT_MAX__ = 2147483647 const __INT_MIN = -2147483648 const __INT_WIDTH__ = 32 -const __ISO_C_VISIBLE = 2011 +const __ISO_C_VISIBLE = 2023 const __KPRINTF_ATTRIBUTE__ = 1 const __LDBL_DECIMAL_DIG__ = 36 const __LDBL_DENORM_MIN__ = 0 @@ -3167,6 +3179,7 @@ const __LDBL_MAX__ = 0 const __LDBL_MIN_10_EXP__ = -4931 const __LDBL_MIN_EXP__ = -16381 const __LDBL_MIN__ = 0 +const __LDBL_NORM_MAX__ = 0 const __LITTLE_ENDIAN__ = 1 const __LLONG_MAX = 9223372036854775807 const __LLONG_MIN = -9223372036854775808 @@ -3198,7 +3211,7 @@ const __ORDER_BIG_ENDIAN__ = 4321 const __ORDER_LITTLE_ENDIAN__ = 1234 const __ORDER_PDP_ENDIAN__ = 3412 const __POINTER_WIDTH__ = 64 -const __POSIX_VISIBLE = 200809 +const __POSIX_VISIBLE = 202405 const __PRAGMA_REDEFINE_EXTNAME = 1 const __PRETTY_FUNCTION__ = 0 const __PTRDIFF_FMTd__ = "ld" @@ -3254,6 +3267,9 @@ const __SRD = 4 const __SRW = 16 const __SSIZE_MAX = 9223372036854775807 const __SSTR = 512 +const __STDC_EMBED_EMPTY__ = 2 +const __STDC_EMBED_FOUND__ = 1 +const __STDC_EMBED_NOT_FOUND__ = 0 const __STDC_HOSTED__ = 1 const __STDC_MB_MIGHT_NEQ_WC__ = 1 const __STDC_UTF_16__ = 1 @@ -3342,7 +3358,7 @@ const __ULLONG_MAX = 18446744073709551615 const __ULONG_MAX = 18446744073709551615 const __UQUAD_MAX = 18446744073709551615 const __USHRT_MAX = 65535 -const __VERSION__ = "FreeBSD Clang 18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15a9eac9)" +const __VERSION__ = "FreeBSD Clang 19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)" const __WCHAR_MAX = 4294967295 const __WCHAR_MAX__ = 4294967295 const __WCHAR_MIN = 0 @@ -3352,14 +3368,14 @@ const __WINT_MAX__ = 2147483647 const __WINT_TYPE__ = 0 const __WINT_WIDTH__ = 32 const __WORD_BIT = 32 -const __XSI_VISIBLE = 700 +const __XSI_VISIBLE = 800 const __aarch64__ = 1 const __clang__ = 1 const __clang_literal_encoding__ = "UTF-8" -const __clang_major__ = 18 +const __clang_major__ = 19 const __clang_minor__ = 1 -const __clang_patchlevel__ = 5 -const __clang_version__ = "18.1.5 (https://github.com/llvm/llvm-project.git llvmorg-18.1.5-0-g617a15a9eac9)" +const __clang_patchlevel__ = 7 +const __clang_version__ = "19.1.7 (https://github.com/llvm/llvm-project.git llvmorg-19.1.7-0-gcd708029e0b2)" const __clang_wide_literal_encoding__ = "UTF-32" const __const = 0 const __has_extension = 0 @@ -3374,6 +3390,7 @@ const __signed = 0 const __unix = 1 const __unix__ = 1 const __volatile = 0 +const __writeonly = "__unused" const bBatch = 0 const cume_distFinalizeFunc = 0 const errno = 0 @@ -3381,6 +3398,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3390,9 +3410,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3997,12 +4014,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -4131,30 +4142,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - // C documentation // // /* @@ -4436,6 +4423,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4666,33 +4654,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4771,19 +4732,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4868,7 +4816,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4960,223 +4907,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
column OP expr
-** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5258,20 +4988,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5321,13 +5037,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5386,9 +5095,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5396,17 +5105,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5433,12 +5142,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
createFlag Behavior when page is not already in cache // **
0 Do not allocate a new page. Return NULL. -// **
1 Allocate a new page if it easy and convenient to do so. +// **
1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5455,7 +5164,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5473,7 +5182,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5507,24 +5216,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5548,22 +5239,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5624,7 +5299,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5704,50 +5379,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6144,340 +5775,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6487,15 +5784,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6511,14 +5799,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6544,17 +5824,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6609,11 +5878,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6987,55 +6262,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tfpos_t = int64 type fpos_t = Tfpos_t @@ -7303,6 +6534,11 @@ type _RuneLocale = T_RuneLocale ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7361,6 +6597,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7470,14 +6717,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7562,7 +6801,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7664,7 +6903,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7723,6 +6961,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -7734,9 +6973,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -7751,7 +6990,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7800,8 +7038,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -7865,7 +7103,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7937,19 +7174,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7963,11 +7203,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7978,40 +7215,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -8029,7 +7267,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8041,6 +7279,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8189,9 +7428,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -8208,10 +7447,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -8246,6 +7481,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8426,7 +7662,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8468,7 +7703,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8641,9 +7875,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8770,53 +8004,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8920,16 +8107,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8953,38 +8130,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8997,34 +8147,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -9038,90 +8164,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -9140,187 +8182,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9330,913 +8191,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity uint8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10261,611 +8215,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr uint8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10875,317 +8224,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]uint8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11271,228 +8309,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]uint8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign uint8 - FisSpecial uint8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]uint8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -12575,7 +9391,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12653,72 +9468,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12764,164 +9517,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - -/* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - /* -** Clear any existing type flags from a Mem and replace them with f +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -12947,18 +9547,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12975,100 +9563,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]uint8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -13090,13 +9584,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -13116,14 +9603,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -13202,7 +9682,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13374,7 +9854,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13432,7 +9912,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13567,24 +10047,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD uint8 - FvalidYMD uint8 - FvalidHMS uint8 - FnFloor uint8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -14209,10 +10671,10 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = uint8(0) _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1210, -int32(1)) @@ -15062,7 +11524,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -15578,28 +12040,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15607,19 +12069,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15636,12 +12098,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15649,7 +12111,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15662,34 +12124,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -16002,14 +12464,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -16024,9 +12479,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -16440,7 +12895,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16770,6 +13229,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16777,8 +13238,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17765,17 +14226,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: uint8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: uint8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: uint8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: uint8('c'), @@ -17972,22 +14433,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 uint8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 uint8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]uint8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -18236,11 +14698,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18268,7 +14730,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18290,7 +14752,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18717,29 +15179,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = uint8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(3)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18854,25 +15294,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = libc.Uint8FromInt32(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1666 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1666 } else { - v98 = __ccgo_ts + 1671 + v97 = __ccgo_ts + 1671 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = uint8('"') + flag_alternateform = uint8(0) + } else { + q = uint8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18880,15 +15324,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && libc.Int32FromUint8(v101) != 0) { + if !(v101 && libc.Int32FromUint8(v100) != 0) { break } if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { @@ -18899,13 +15343,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18919,35 +15396,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1678, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = uint8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v108 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if libc.Int32FromUint8(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = uint8('\\') + } else { + if libc.Int32FromUint8(ch1) <= int32(0x1f) { + *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = uint8('\\') + v110 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v110))) = uint8('u') + v111 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v111))) = uint8('0') + v112 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v112))) = uint8('0') + v113 = j1 + j1++ + if libc.Int32FromUint8(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v113))) = libc.Uint8FromInt32(v114) + v115 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v119 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v120))) = uint8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v121))) = uint8(')') + } } *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1))) = uint8(0) length = int32(j1) @@ -18972,9 +15512,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18988,7 +15528,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1678, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1704, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18998,21 +15538,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1680, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1706, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1690, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1716, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1711, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1737, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -19251,7 +15791,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -19550,6 +16090,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19567,11 +16109,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]uint8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]uint8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -20005,63 +16547,10 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr _ = p *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -20070,11 +16559,11 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui return int32(SQLITE_NOMEM) } if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn } else { (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -20205,6 +16694,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*uint8)(unsafe.Pointer(zOut)) = uint8(v & libc.Uint32FromInt32(0xff)) + return int32(1) + } + if v < uint32(0x00800) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 3)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20955,7 +17475,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -21130,7 +17650,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1725, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1751, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21672,7 +18192,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1750 + pow63 = __ccgo_ts + 1776 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21899,7 +18419,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1769)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1795)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22059,7 +18579,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1785 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1811 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -22168,7 +18688,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22579,7 +19099,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1787, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1813, libc.VaList(bp+8, zType)) } // C documentation @@ -22608,7 +19128,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1832) + _logBadConnection(tls, __ccgo_ts+1858) } return 0 } else { @@ -22622,7 +19142,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1841) + _logBadConnection(tls, __ccgo_ts+1867) return 0 } else { return int32(1) @@ -22707,7 +19227,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -23062,23 +19582,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = *(*uint8)(unsafe.Pointer(v2)) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*uint8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))) h *= uint32(0x9e3779b1) } return h @@ -23133,8 +19651,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -23167,9 +19685,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -23189,13 +19706,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -23203,7 +19719,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -23219,7 +19735,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -23231,7 +19747,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -23280,7 +19796,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -23290,20 +19806,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -23322,196 +19837,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1849, - 1: __ccgo_ts + 1859, - 2: __ccgo_ts + 1870, - 3: __ccgo_ts + 1882, - 4: __ccgo_ts + 1893, - 5: __ccgo_ts + 1905, - 6: __ccgo_ts + 1912, - 7: __ccgo_ts + 1920, - 8: __ccgo_ts + 1928, - 9: __ccgo_ts + 1933, - 10: __ccgo_ts + 1938, - 11: __ccgo_ts + 1944, - 12: __ccgo_ts + 1958, - 13: __ccgo_ts + 1964, - 14: __ccgo_ts + 1974, - 15: __ccgo_ts + 1979, - 16: __ccgo_ts + 1984, - 17: __ccgo_ts + 1987, - 18: __ccgo_ts + 1993, - 19: __ccgo_ts + 2000, - 20: __ccgo_ts + 2004, - 21: __ccgo_ts + 2014, - 22: __ccgo_ts + 2021, - 23: __ccgo_ts + 2028, - 24: __ccgo_ts + 2035, - 25: __ccgo_ts + 2042, - 26: __ccgo_ts + 2052, - 27: __ccgo_ts + 2061, - 28: __ccgo_ts + 2072, - 29: __ccgo_ts + 2081, - 30: __ccgo_ts + 2087, - 31: __ccgo_ts + 2097, - 32: __ccgo_ts + 2107, - 33: __ccgo_ts + 2112, - 34: __ccgo_ts + 2126, - 35: __ccgo_ts + 2137, - 36: __ccgo_ts + 2142, - 37: __ccgo_ts + 2149, - 38: __ccgo_ts + 2160, - 39: __ccgo_ts + 2165, - 40: __ccgo_ts + 2170, - 41: __ccgo_ts + 2176, - 42: __ccgo_ts + 2182, - 43: __ccgo_ts + 2188, - 44: __ccgo_ts + 2191, - 45: __ccgo_ts + 2195, - 46: __ccgo_ts + 2201, - 47: __ccgo_ts + 2212, - 48: __ccgo_ts + 2223, - 49: __ccgo_ts + 2231, - 50: __ccgo_ts + 2240, - 51: __ccgo_ts + 2246, - 52: __ccgo_ts + 2253, - 53: __ccgo_ts + 2261, - 54: __ccgo_ts + 2264, - 55: __ccgo_ts + 2267, - 56: __ccgo_ts + 2270, - 57: __ccgo_ts + 2273, - 58: __ccgo_ts + 2276, - 59: __ccgo_ts + 2279, - 60: __ccgo_ts + 2286, - 61: __ccgo_ts + 2296, - 62: __ccgo_ts + 2309, - 63: __ccgo_ts + 2320, - 64: __ccgo_ts + 2326, - 65: __ccgo_ts + 2333, - 66: __ccgo_ts + 2342, - 67: __ccgo_ts + 2351, - 68: __ccgo_ts + 2358, - 69: __ccgo_ts + 2371, - 70: __ccgo_ts + 2382, - 71: __ccgo_ts + 2387, - 72: __ccgo_ts + 2395, - 73: __ccgo_ts + 2401, - 74: __ccgo_ts + 2408, - 75: __ccgo_ts + 2420, - 76: __ccgo_ts + 2425, - 77: __ccgo_ts + 2434, - 78: __ccgo_ts + 2439, - 79: __ccgo_ts + 2448, - 80: __ccgo_ts + 2453, - 81: __ccgo_ts + 2458, - 82: __ccgo_ts + 2464, - 83: __ccgo_ts + 2472, - 84: __ccgo_ts + 2480, - 85: __ccgo_ts + 2490, - 86: __ccgo_ts + 2498, - 87: __ccgo_ts + 2505, - 88: __ccgo_ts + 2518, - 89: __ccgo_ts + 2523, - 90: __ccgo_ts + 2535, - 91: __ccgo_ts + 2543, - 92: __ccgo_ts + 2550, - 93: __ccgo_ts + 2561, - 94: __ccgo_ts + 2568, - 95: __ccgo_ts + 2575, - 96: __ccgo_ts + 2585, - 97: __ccgo_ts + 2594, - 98: __ccgo_ts + 2605, - 99: __ccgo_ts + 2611, - 100: __ccgo_ts + 2622, - 101: __ccgo_ts + 2632, - 102: __ccgo_ts + 2642, - 103: __ccgo_ts + 2651, - 104: __ccgo_ts + 2658, - 105: __ccgo_ts + 2664, - 106: __ccgo_ts + 2674, - 107: __ccgo_ts + 2685, - 108: __ccgo_ts + 2689, - 109: __ccgo_ts + 2698, - 110: __ccgo_ts + 2707, - 111: __ccgo_ts + 2714, - 112: __ccgo_ts + 2724, - 113: __ccgo_ts + 2731, - 114: __ccgo_ts + 2741, - 115: __ccgo_ts + 2749, - 116: __ccgo_ts + 2756, - 117: __ccgo_ts + 2770, - 118: __ccgo_ts + 2784, - 119: __ccgo_ts + 2792, - 120: __ccgo_ts + 2803, - 121: __ccgo_ts + 2816, - 122: __ccgo_ts + 2827, - 123: __ccgo_ts + 2833, - 124: __ccgo_ts + 2845, - 125: __ccgo_ts + 2854, - 126: __ccgo_ts + 2862, - 127: __ccgo_ts + 2871, - 128: __ccgo_ts + 2880, - 129: __ccgo_ts + 2887, - 130: __ccgo_ts + 2895, - 131: __ccgo_ts + 2902, - 132: __ccgo_ts + 2913, - 133: __ccgo_ts + 2927, - 134: __ccgo_ts + 2938, - 135: __ccgo_ts + 2946, - 136: __ccgo_ts + 2952, - 137: __ccgo_ts + 2960, - 138: __ccgo_ts + 2968, - 139: __ccgo_ts + 2978, - 140: __ccgo_ts + 2991, - 141: __ccgo_ts + 3001, - 142: __ccgo_ts + 3014, - 143: __ccgo_ts + 3023, - 144: __ccgo_ts + 3034, - 145: __ccgo_ts + 3042, - 146: __ccgo_ts + 3048, - 147: __ccgo_ts + 3060, - 148: __ccgo_ts + 3072, - 149: __ccgo_ts + 3080, - 150: __ccgo_ts + 3092, - 151: __ccgo_ts + 3105, - 152: __ccgo_ts + 3115, - 153: __ccgo_ts + 3125, - 154: __ccgo_ts + 3137, - 155: __ccgo_ts + 3142, - 156: __ccgo_ts + 3154, - 157: __ccgo_ts + 3164, - 158: __ccgo_ts + 3170, - 159: __ccgo_ts + 3180, - 160: __ccgo_ts + 3187, - 161: __ccgo_ts + 3199, - 162: __ccgo_ts + 3210, - 163: __ccgo_ts + 3218, - 164: __ccgo_ts + 3227, - 165: __ccgo_ts + 3236, - 166: __ccgo_ts + 3245, - 167: __ccgo_ts + 3252, - 168: __ccgo_ts + 3263, - 169: __ccgo_ts + 3276, - 170: __ccgo_ts + 3286, - 171: __ccgo_ts + 3293, - 172: __ccgo_ts + 3301, - 173: __ccgo_ts + 3310, - 174: __ccgo_ts + 3316, - 175: __ccgo_ts + 3323, - 176: __ccgo_ts + 3331, - 177: __ccgo_ts + 3339, - 178: __ccgo_ts + 3347, - 179: __ccgo_ts + 3357, - 180: __ccgo_ts + 3366, - 181: __ccgo_ts + 3377, - 182: __ccgo_ts + 3388, - 183: __ccgo_ts + 3399, - 184: __ccgo_ts + 3409, - 185: __ccgo_ts + 3415, - 186: __ccgo_ts + 3426, - 187: __ccgo_ts + 3437, - 188: __ccgo_ts + 3442, - 189: __ccgo_ts + 3450, + 0: __ccgo_ts + 1875, + 1: __ccgo_ts + 1885, + 2: __ccgo_ts + 1896, + 3: __ccgo_ts + 1908, + 4: __ccgo_ts + 1919, + 5: __ccgo_ts + 1931, + 6: __ccgo_ts + 1938, + 7: __ccgo_ts + 1946, + 8: __ccgo_ts + 1954, + 9: __ccgo_ts + 1959, + 10: __ccgo_ts + 1964, + 11: __ccgo_ts + 1970, + 12: __ccgo_ts + 1984, + 13: __ccgo_ts + 1990, + 14: __ccgo_ts + 2000, + 15: __ccgo_ts + 2005, + 16: __ccgo_ts + 2010, + 17: __ccgo_ts + 2013, + 18: __ccgo_ts + 2019, + 19: __ccgo_ts + 2026, + 20: __ccgo_ts + 2030, + 21: __ccgo_ts + 2040, + 22: __ccgo_ts + 2047, + 23: __ccgo_ts + 2054, + 24: __ccgo_ts + 2061, + 25: __ccgo_ts + 2068, + 26: __ccgo_ts + 2078, + 27: __ccgo_ts + 2087, + 28: __ccgo_ts + 2098, + 29: __ccgo_ts + 2107, + 30: __ccgo_ts + 2113, + 31: __ccgo_ts + 2123, + 32: __ccgo_ts + 2133, + 33: __ccgo_ts + 2138, + 34: __ccgo_ts + 2152, + 35: __ccgo_ts + 2163, + 36: __ccgo_ts + 2168, + 37: __ccgo_ts + 2175, + 38: __ccgo_ts + 2186, + 39: __ccgo_ts + 2191, + 40: __ccgo_ts + 2196, + 41: __ccgo_ts + 2202, + 42: __ccgo_ts + 2208, + 43: __ccgo_ts + 2214, + 44: __ccgo_ts + 2217, + 45: __ccgo_ts + 2221, + 46: __ccgo_ts + 2227, + 47: __ccgo_ts + 2238, + 48: __ccgo_ts + 2249, + 49: __ccgo_ts + 2257, + 50: __ccgo_ts + 2266, + 51: __ccgo_ts + 2272, + 52: __ccgo_ts + 2279, + 53: __ccgo_ts + 2287, + 54: __ccgo_ts + 2290, + 55: __ccgo_ts + 2293, + 56: __ccgo_ts + 2296, + 57: __ccgo_ts + 2299, + 58: __ccgo_ts + 2302, + 59: __ccgo_ts + 2305, + 60: __ccgo_ts + 2312, + 61: __ccgo_ts + 2322, + 62: __ccgo_ts + 2335, + 63: __ccgo_ts + 2346, + 64: __ccgo_ts + 2352, + 65: __ccgo_ts + 2359, + 66: __ccgo_ts + 2368, + 67: __ccgo_ts + 2377, + 68: __ccgo_ts + 2384, + 69: __ccgo_ts + 2397, + 70: __ccgo_ts + 2408, + 71: __ccgo_ts + 2413, + 72: __ccgo_ts + 2421, + 73: __ccgo_ts + 2427, + 74: __ccgo_ts + 2434, + 75: __ccgo_ts + 2446, + 76: __ccgo_ts + 2451, + 77: __ccgo_ts + 2460, + 78: __ccgo_ts + 2465, + 79: __ccgo_ts + 2474, + 80: __ccgo_ts + 2479, + 81: __ccgo_ts + 2484, + 82: __ccgo_ts + 2490, + 83: __ccgo_ts + 2498, + 84: __ccgo_ts + 2506, + 85: __ccgo_ts + 2516, + 86: __ccgo_ts + 2524, + 87: __ccgo_ts + 2531, + 88: __ccgo_ts + 2544, + 89: __ccgo_ts + 2549, + 90: __ccgo_ts + 2561, + 91: __ccgo_ts + 2569, + 92: __ccgo_ts + 2576, + 93: __ccgo_ts + 2587, + 94: __ccgo_ts + 2594, + 95: __ccgo_ts + 2601, + 96: __ccgo_ts + 2611, + 97: __ccgo_ts + 2620, + 98: __ccgo_ts + 2631, + 99: __ccgo_ts + 2637, + 100: __ccgo_ts + 2648, + 101: __ccgo_ts + 2658, + 102: __ccgo_ts + 2668, + 103: __ccgo_ts + 2677, + 104: __ccgo_ts + 2684, + 105: __ccgo_ts + 2690, + 106: __ccgo_ts + 2700, + 107: __ccgo_ts + 2711, + 108: __ccgo_ts + 2715, + 109: __ccgo_ts + 2724, + 110: __ccgo_ts + 2733, + 111: __ccgo_ts + 2740, + 112: __ccgo_ts + 2750, + 113: __ccgo_ts + 2757, + 114: __ccgo_ts + 2767, + 115: __ccgo_ts + 2775, + 116: __ccgo_ts + 2782, + 117: __ccgo_ts + 2796, + 118: __ccgo_ts + 2810, + 119: __ccgo_ts + 2818, + 120: __ccgo_ts + 2829, + 121: __ccgo_ts + 2842, + 122: __ccgo_ts + 2853, + 123: __ccgo_ts + 2859, + 124: __ccgo_ts + 2871, + 125: __ccgo_ts + 2880, + 126: __ccgo_ts + 2888, + 127: __ccgo_ts + 2897, + 128: __ccgo_ts + 2906, + 129: __ccgo_ts + 2913, + 130: __ccgo_ts + 2921, + 131: __ccgo_ts + 2928, + 132: __ccgo_ts + 2939, + 133: __ccgo_ts + 2953, + 134: __ccgo_ts + 2964, + 135: __ccgo_ts + 2972, + 136: __ccgo_ts + 2978, + 137: __ccgo_ts + 2986, + 138: __ccgo_ts + 2994, + 139: __ccgo_ts + 3004, + 140: __ccgo_ts + 3017, + 141: __ccgo_ts + 3027, + 142: __ccgo_ts + 3040, + 143: __ccgo_ts + 3049, + 144: __ccgo_ts + 3060, + 145: __ccgo_ts + 3068, + 146: __ccgo_ts + 3074, + 147: __ccgo_ts + 3086, + 148: __ccgo_ts + 3098, + 149: __ccgo_ts + 3106, + 150: __ccgo_ts + 3118, + 151: __ccgo_ts + 3131, + 152: __ccgo_ts + 3141, + 153: __ccgo_ts + 3151, + 154: __ccgo_ts + 3163, + 155: __ccgo_ts + 3168, + 156: __ccgo_ts + 3180, + 157: __ccgo_ts + 3190, + 158: __ccgo_ts + 3196, + 159: __ccgo_ts + 3206, + 160: __ccgo_ts + 3213, + 161: __ccgo_ts + 3225, + 162: __ccgo_ts + 3236, + 163: __ccgo_ts + 3244, + 164: __ccgo_ts + 3253, + 165: __ccgo_ts + 3262, + 166: __ccgo_ts + 3271, + 167: __ccgo_ts + 3278, + 168: __ccgo_ts + 3289, + 169: __ccgo_ts + 3302, + 170: __ccgo_ts + 3312, + 171: __ccgo_ts + 3319, + 172: __ccgo_ts + 3327, + 173: __ccgo_ts + 3336, + 174: __ccgo_ts + 3342, + 175: __ccgo_ts + 3349, + 176: __ccgo_ts + 3357, + 177: __ccgo_ts + 3365, + 178: __ccgo_ts + 3373, + 179: __ccgo_ts + 3383, + 180: __ccgo_ts + 3392, + 181: __ccgo_ts + 3403, + 182: __ccgo_ts + 3414, + 183: __ccgo_ts + 3425, + 184: __ccgo_ts + 3435, + 185: __ccgo_ts + 3441, + 186: __ccgo_ts + 3452, + 187: __ccgo_ts + 3463, + 188: __ccgo_ts + 3468, + 189: __ccgo_ts + 3476, } type Tpthread_once = struct { @@ -23927,7 +20442,7 @@ type Tstat = struct { Fst_ino Tino_t Fst_nlink Tnlink_t Fst_mode Tmode_t - Fst_padding0 t__int16_t + Fst_bsdflags t__int16_t Fst_uid Tuid_t Fst_gid Tgid_t Fst_padding1 t__int32_t @@ -23941,7 +20456,8 @@ type Tstat = struct { Fst_blksize Tblksize_t Fst_flags Tfflags_t Fst_gen t__uint64_t - Fst_spare [10]t__uint64_t + Fst_filerev t__uint64_t + Fst_spare [9]t__uint64_t } type stat = Tstat @@ -24120,22 +20636,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -24166,30 +20666,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -24267,91 +20743,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3460, + FzName: __ccgo_ts + 3486, }, 1: { - FzName: __ccgo_ts + 3465, + FzName: __ccgo_ts + 3491, }, 2: { - FzName: __ccgo_ts + 3471, + FzName: __ccgo_ts + 3497, }, 3: { - FzName: __ccgo_ts + 3478, + FzName: __ccgo_ts + 3504, }, 4: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3511, }, 5: { - FzName: __ccgo_ts + 3490, + FzName: __ccgo_ts + 3516, }, 6: { - FzName: __ccgo_ts + 3496, + FzName: __ccgo_ts + 3522, }, 7: { - FzName: __ccgo_ts + 3506, + FzName: __ccgo_ts + 3532, }, 8: { - FzName: __ccgo_ts + 3512, + FzName: __ccgo_ts + 3538, }, 9: { - FzName: __ccgo_ts + 3517, + FzName: __ccgo_ts + 3543, }, 10: { - FzName: __ccgo_ts + 3523, + FzName: __ccgo_ts + 3549, }, 11: { - FzName: __ccgo_ts + 3531, + FzName: __ccgo_ts + 3557, }, 12: { - FzName: __ccgo_ts + 3537, + FzName: __ccgo_ts + 3563, }, 13: { - FzName: __ccgo_ts + 3544, + FzName: __ccgo_ts + 3570, }, 14: { - FzName: __ccgo_ts + 3553, + FzName: __ccgo_ts + 3579, }, 15: { - FzName: __ccgo_ts + 3560, + FzName: __ccgo_ts + 3586, }, 16: { - FzName: __ccgo_ts + 3570, + FzName: __ccgo_ts + 3596, }, 17: { - FzName: __ccgo_ts + 3577, + FzName: __ccgo_ts + 3603, }, 18: { - FzName: __ccgo_ts + 3591, + FzName: __ccgo_ts + 3617, }, 19: { - FzName: __ccgo_ts + 3597, + FzName: __ccgo_ts + 3623, }, 20: { - FzName: __ccgo_ts + 3603, + FzName: __ccgo_ts + 3629, }, 21: { - FzName: __ccgo_ts + 3610, + FzName: __ccgo_ts + 3636, }, 22: { - FzName: __ccgo_ts + 3618, + FzName: __ccgo_ts + 3644, }, 23: { - FzName: __ccgo_ts + 3623, + FzName: __ccgo_ts + 3649, }, 24: { - FzName: __ccgo_ts + 3630, + FzName: __ccgo_ts + 3656, }, 25: { - FzName: __ccgo_ts + 3637, + FzName: __ccgo_ts + 3663, }, 26: { - FzName: __ccgo_ts + 3649, + FzName: __ccgo_ts + 3675, }, 27: { - FzName: __ccgo_ts + 3658, + FzName: __ccgo_ts + 3684, }, 28: { - FzName: __ccgo_ts + 3664, + FzName: __ccgo_ts + 3690, }, } @@ -24409,7 +20885,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24447,10 +20923,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24586,9 +21062,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3670, libc.VaList(bp+232, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3696, libc.VaList(bp+232, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3713, O_RDONLY, libc.Int32FromUint16(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3739, O_RDONLY, libc.Int32FromUint16(m)) < 0 { break } } @@ -24824,47 +21300,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24908,7 +21343,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1665 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3723, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3749, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24936,7 +21371,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint64(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3807, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3833, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3834, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3860, libc.VaList(bp+232, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25595,7 +22030,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25950,7 +22385,7 @@ func _seekAndRead(tls *libc.TLS, id uintptr, offset Tsqlite3_int64, pBuf uintptr _, _, _ = got, newOffset, prior prior = 0 for cond := true; cond; cond = got > 0 { - newOffset = libc.Xlseek(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, offset, SEEK_SET) + newOffset = int64(libc.Xlseek(tls, (*TunixFile)(unsafe.Pointer(id)).Fh, offset, SEEK_SET)) if newOffset < 0 { _storeLastErrno(tls, id, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) return -int32(1) @@ -26054,7 +22489,7 @@ func _seekAndWriteFd(tls *libc.TLS, fd int32, iOff Ti64, pBuf uintptr, nBuf int3 rc = 0 /* Value returned by system call */ nBuf &= int32(0x1ffff) for cond := true; cond; cond = rc < 0 && *(*int32)(unsafe.Pointer(libc.X__error(tls))) == int32(EINTR) { - iSeek = libc.Xlseek(tls, fd, iOff, SEEK_SET) + iSeek = int64(libc.Xlseek(tls, fd, iOff, SEEK_SET)) if iSeek < 0 { rc = -int32(1) break @@ -26212,7 +22647,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]uint8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3862, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3888, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -26238,7 +22673,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3577, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3603, bp, int32(42579)) } // C documentation @@ -26275,7 +22710,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__error(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26823,7 +23169,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26886,7 +23232,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -27119,7 +23465,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*int32)(unsafe.Pointer(bp + 224)) = 0 if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1665, int32(1), bp+224) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27895,10 +24240,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3919, - 3: __ccgo_ts + 3928, - 4: __ccgo_ts + 3937, - 5: __ccgo_ts + 1678, + 2: __ccgo_ts + 3945, + 3: __ccgo_ts + 3954, + 4: __ccgo_ts + 3963, + 5: __ccgo_ts + 1704, } // C documentation @@ -27907,8 +24252,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3942) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3956) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3968) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3982) } // C documentation @@ -27970,7 +24315,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = uint8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3963, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3989, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -28142,7 +24487,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3980) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4006) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -28297,7 +24642,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3460, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3486, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -28374,7 +24719,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__error(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+224, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(1026)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3649, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3675, zIn, int32(45510)) return } (*(*[1026]uint8)(unsafe.Pointer(bp + 224)))[got] = uint8(0) @@ -28572,14 +24907,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(1026)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3478, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3504, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*uint8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = uint8(0) if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -30419,7 +26594,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -30473,7 +26654,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -30517,7 +26698,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30592,7 +26773,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30646,7 +26827,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30680,66 +26861,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30913,14 +27034,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31736,123 +27857,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31933,7 +27937,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0)) for { v4 = n n-- @@ -32027,7 +28031,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -32068,7 +28072,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStorePInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -32196,7 +28200,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadPInt32(uintptr(unsafe.Pointer(&_pcache1_g)) + 140) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32216,17 +28220,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -32244,7 +28250,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -32256,7 +28262,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -32457,10 +28463,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -33046,25 +29053,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -34026,258 +30014,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]uint8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -34376,7 +30112,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34605,7 +30341,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34623,7 +30359,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -35196,6 +30932,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35842,7 +31587,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 uint8 var _ /* exists at bp+8 */ int32 @@ -35854,7 +31600,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35875,11 +31621,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Uint8FromInt32(0) *(*uint8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35908,7 +31655,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -36141,7 +31888,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -36278,7 +32025,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -36294,7 +32041,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -37041,10 +32788,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37945,7 +33692,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37989,7 +33736,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -38020,7 +33767,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -38071,7 +33818,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -38106,7 +33853,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4145, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4171, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -38116,7 +33863,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4154, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4180, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -38158,8 +33905,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4159, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4166, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4185, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4192, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -38242,7 +33989,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38498,7 +34245,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38673,7 +34420,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38704,7 +34451,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38776,7 +34523,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -39836,7 +35583,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -40133,7 +35880,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -40401,7 +36148,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4176, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4202, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40965,9 +36712,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -40982,227 +36729,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -41221,28 +36747,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -41301,7 +36806,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -41313,7 +36818,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -41402,6 +36907,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41669,14 +37175,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41843,7 +37341,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41931,12 +37429,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -42070,7 +37568,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42511,10 +38009,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42612,7 +38110,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42651,7 +38149,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = *(*Tu32)(unsafe.Pointer(pInfo + 4 + uintptr(i)*4)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42664,7 +38162,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42680,7 +38178,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42701,7 +38199,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42767,7 +38265,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42817,7 +38315,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4231, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4257, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -43032,7 +38530,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -43058,7 +38563,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43781,8 +39286,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43869,7 +39374,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -44015,7 +39520,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -44042,7 +39547,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -44051,6 +39556,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -44095,6 +39601,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -44366,7 +39875,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44547,7 +40056,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44556,7 +40065,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44608,14 +40117,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45161,283 +40670,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45570,27 +40802,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45753,10 +40964,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45765,14 +40977,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -46472,11 +41684,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46650,7 +41862,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46663,12 +41875,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46712,7 +41924,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46720,7 +41932,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46908,7 +42120,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46941,7 +42153,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -47140,7 +42352,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47180,12 +42392,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -47193,21 +42405,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -47254,12 +42466,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47275,7 +42487,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -47335,7 +42547,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47352,14 +42564,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -47402,11 +42614,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47420,7 +42632,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -47473,42 +42685,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47516,70 +42726,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47625,7 +42835,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47651,7 +42861,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47690,12 +42900,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47722,7 +42932,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47753,11 +42963,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))< iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47786,11 +42996,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47799,7 +43009,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47821,30 +43031,28 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt32(flags) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(libc.Uint8FromInt32(flags)) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47952,7 +43160,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48014,7 +43222,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48102,7 +43310,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4257) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4283) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48726,7 +43934,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48888,7 +44096,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4266, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4292, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48926,7 +44134,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49367,7 +44575,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49391,7 +44599,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -49400,7 +44608,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49414,7 +44622,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49444,7 +44652,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49540,7 +44748,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49578,7 +44786,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49645,7 +44853,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49688,7 +44896,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49718,7 +44926,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50184,7 +45392,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50576,7 +45784,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50586,7 +45794,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50617,7 +45825,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50643,7 +45851,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50717,7 +45925,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50852,7 +46060,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50864,7 +46072,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -50980,7 +46188,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50994,7 +46202,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -51228,7 +46436,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -51312,7 +46520,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -51324,7 +46532,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51526,7 +46734,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51559,7 +46767,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51568,7 +46776,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51697,7 +46905,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51807,7 +47015,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51895,7 +47103,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51950,7 +47158,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51976,7 +47184,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52003,7 +47211,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52074,7 +47282,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52212,7 +47420,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52263,7 +47471,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52272,7 +47480,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52362,7 +47570,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52380,7 +47588,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52403,7 +47611,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52624,10 +47832,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52918,17 +48126,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -53018,12 +48215,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -53031,7 +48228,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53126,7 +48323,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53207,7 +48404,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -53234,7 +48431,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -53274,7 +48471,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53345,7 +48542,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53390,7 +48587,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53586,10 +48783,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53712,8 +48910,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53753,7 +48951,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53776,7 +48974,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53907,7 +49105,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53950,7 +49148,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -54009,7 +49207,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -54041,7 +49239,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54271,7 +49469,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54517,7 +49715,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54590,7 +49788,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54749,7 +49947,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54780,7 +49978,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54865,7 +50063,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54957,7 +50155,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54993,7 +50191,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55023,10 +50221,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55144,12 +50342,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -55159,14 +50357,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55266,21 +50464,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx))))< _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55525,7 +50723,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55606,14 +50804,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55750,7 +50948,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56015,7 +51213,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4270, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4296, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -56063,11 +51261,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4272, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4298, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4295, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4321, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -56093,11 +51291,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4425, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4451, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -56169,11 +51367,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4464 + v2 = __ccgo_ts + 4490 } else { - v2 = __ccgo_ts + 4469 + v2 = __ccgo_ts + 4495 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4490, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4516, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -56309,12 +51507,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4516 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4542 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4534, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4560, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4688, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4714, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4718, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4744, 0) doCoverageCheck = 0 goto _4 } @@ -56399,7 +51597,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4742, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4768, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -56422,7 +51620,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4766, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4792, 0) depth = d2 } } else { @@ -56499,7 +51697,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4791, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4817, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56513,7 +51711,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4828, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4854, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56604,7 +51802,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4880 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4906 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56628,11 +51826,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4891, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4917, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4936, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4962, 0) } } } @@ -56669,10 +51867,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4991, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5017, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5011, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5037, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56802,14 +52000,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -57020,45 +52218,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -57111,7 +52270,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3862, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3888, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -57121,7 +52280,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5043, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5069, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -57150,7 +52309,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5063, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5089, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -57180,7 +52339,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5094, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5120, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57856,7 +53015,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5134, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5160, libc.VaList(bp+40, v1)) *(*uint8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = uint8(0) /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57994,9 +53153,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = uint8(0) @@ -58171,20 +53327,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -58199,10 +53355,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58661,7 +53817,7 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) @@ -58674,8 +53830,8 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58834,7 +53990,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58876,11 +54032,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58890,7 +54046,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58912,12 +54068,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58956,7 +54112,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59068,8 +54224,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -59120,7 +54276,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -59128,8 +54285,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -59186,14 +54343,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -59207,7 +54364,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -59232,14 +54389,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3862, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3888, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -59339,7 +54496,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5141 + zNeg = __ccgo_ts + 5167 } } } @@ -59354,7 +54511,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5143, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5169, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59658,7 +54815,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59674,7 +54831,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59684,7 +54841,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59735,9 +54892,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59811,7 +54968,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -60145,12 +55302,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -60324,7 +55480,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -60341,7 +55497,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -60409,8 +55565,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -60423,11 +55579,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -60464,13 +55620,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60501,7 +55660,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -61003,7 +56162,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5148, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5174, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -61016,39 +56175,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1665 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5153) == 0 { - zColl = __ccgo_ts + 5160 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5179) == 0 { + zColl = __ccgo_ts + 5186 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5141 + v3 = __ccgo_ts + 5167 } else { v3 = __ccgo_ts + 1665 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5162 + v4 = __ccgo_ts + 5188 } else { v4 = __ccgo_ts + 1665 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5165, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5191, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5199, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5189, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5215, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5198, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5224, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5198, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5224, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1426, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5205, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5231, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1393, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61065,14 +56224,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1666 } else { - zP4 = __ccgo_ts + 5208 + zP4 = __ccgo_ts + 5234 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5215, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5241, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -61087,20 +56246,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5223, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5249, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5228, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5254, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5230 + zP4 = __ccgo_ts + 5256 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5238, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5264, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -61114,10 +56273,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5175, - 1: __ccgo_ts + 5177, - 2: __ccgo_ts + 5179, - 3: __ccgo_ts + 5184, + 0: __ccgo_ts + 5201, + 1: __ccgo_ts + 5203, + 2: __ccgo_ts + 5205, + 3: __ccgo_ts + 5210, } // C documentation @@ -61914,7 +57073,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -61933,7 +57092,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61941,7 +57100,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -62068,7 +57227,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5254, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5280, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -62076,18 +57235,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5266, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5292, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5280, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5306, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5295, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5321, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -62318,7 +57477,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63706,7 +58865,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63741,7 +58900,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63795,7 +58954,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63927,7 +59086,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64079,7 +59238,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -64110,7 +59269,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64261,15 +59420,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5338 + zContext = __ccgo_ts + 5364 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5357 + zContext = __ccgo_ts + 5383 } else { - zContext = __ccgo_ts + 5376 + zContext = __ccgo_ts + 5402 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5385, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5411, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -64364,10 +59523,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -64376,9 +59536,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -64458,7 +59618,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5421, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5447, 0) return int32(1) } else { return 0 @@ -64468,7 +59628,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5466, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5492, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64526,7 +59686,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64853,12 +60013,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64875,29 +60035,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64927,13 +60091,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64945,11 +60111,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -64957,23 +60127,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -65029,7 +60205,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5506, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5532, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -65230,7 +60406,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65360,7 +60536,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65529,6 +60705,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65542,7 +60720,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65580,13 +60758,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65820,18 +60998,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5529, - 1: __ccgo_ts + 5534, - 2: __ccgo_ts + 5541, - 3: __ccgo_ts + 5544, - 4: __ccgo_ts + 5547, - 5: __ccgo_ts + 5550, - 6: __ccgo_ts + 5553, - 7: __ccgo_ts + 5556, - 8: __ccgo_ts + 5564, - 9: __ccgo_ts + 5567, - 10: __ccgo_ts + 5574, - 11: __ccgo_ts + 5582, + 0: __ccgo_ts + 5555, + 1: __ccgo_ts + 5560, + 2: __ccgo_ts + 5567, + 3: __ccgo_ts + 5570, + 4: __ccgo_ts + 5573, + 5: __ccgo_ts + 5576, + 6: __ccgo_ts + 5579, + 7: __ccgo_ts + 5582, + 8: __ccgo_ts + 5590, + 9: __ccgo_ts + 5593, + 10: __ccgo_ts + 5600, + 11: __ccgo_ts + 5608, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -66086,14 +61264,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5589, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5615, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66131,7 +61309,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -66141,7 +61319,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -66152,24 +61330,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -66217,7 +61399,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -66225,32 +61409,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66667,11 +61857,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66680,7 +61870,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66694,7 +61884,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66729,7 +61919,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, (*TColumn)(unsafe.Pointer(pCol)).Faffinity, bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66764,7 +61954,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66830,11 +62020,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66857,7 +62047,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66879,7 +62069,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -67006,7 +62196,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5629, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5655, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -67044,7 +62234,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1426, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5134, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5160, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -67059,28 +62249,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5633, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5659, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5640, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5666, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5653, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5679, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5656, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5682, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5661, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5687, int32(1)) } } } @@ -67244,9 +62434,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -67272,12 +62462,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -67286,28 +62474,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67698,12 +62886,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity uint8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67720,7 +62908,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -67738,7 +62926,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -68452,19 +63640,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5697, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5723, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5718, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5744, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5725, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5751, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69678,7 +64866,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69694,6 +64882,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -70187,7 +65381,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70290,7 +65484,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5749, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5773, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5863, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5887, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70886,7 +66080,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5917, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5941, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70916,12 +66110,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5972 + v250 = __ccgo_ts + 5996 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6020 + v251 = __ccgo_ts + 6044 } else { - v251 = __ccgo_ts + 6063 + v251 = __ccgo_ts + 6087 } v250 = v251 } @@ -71013,7 +66207,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6104) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6128) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -72097,7 +67291,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, uint8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -72124,7 +67318,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72583,7 +67777,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -73016,7 +68210,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73346,7 +68540,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -73377,13 +68571,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6149 + zSchema = __ccgo_ts + 6173 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6163, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6187, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -73398,7 +68592,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73635,7 +68829,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6206, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6230, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73652,15 +68846,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73741,11 +68935,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73957,7 +69151,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -74007,7 +69201,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -74063,7 +69257,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -74142,11 +69336,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6243 + v286 = __ccgo_ts + 6267 } else { - v286 = __ccgo_ts + 6248 + v286 = __ccgo_ts + 6272 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6255, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6279, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -74299,7 +69493,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6307, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6331, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -74461,7 +69655,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6336, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6360, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74541,12 +69735,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74557,7 +69751,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74651,7 +69845,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74679,11 +69873,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74811,7 +70005,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3862, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3888, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74962,7 +70156,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6346, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6370, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -75049,15 +70243,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -75523,11 +70696,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3862 + v8 = __ccgo_ts + 3888 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75606,14 +70779,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75632,11 +70805,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75712,7 +70885,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75726,7 +70899,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3862 + v1 = __ccgo_ts + 3888 } else { v1 = libc.UintptrFromInt32(0) } @@ -75993,108 +71166,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -76458,7 +71366,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76784,8 +71692,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76799,9 +71707,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76949,8 +71857,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76999,18 +71907,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -77144,7 +72053,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -77298,6 +72207,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78793,57 +73705,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -79140,7 +74001,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79843,25 +74704,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6653, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6678, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6661+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6680+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6686+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6705+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6149+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6173+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6699+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6724+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6699+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6724+7) == 0 { return int32(1) } } @@ -79900,23 +74761,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79948,7 +74808,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6713, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6738, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -80042,7 +74902,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6718) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6743) != 0 { goto _2 } } @@ -80064,57 +74924,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -80159,11 +75006,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6720, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6745, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6724, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6749, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -80172,36 +75019,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6728, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6753, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -80230,18 +75066,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -80288,15 +75124,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6737, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6762, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6768, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6793, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80307,8 +75143,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80348,7 +75184,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6823, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6848, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -80368,7 +75204,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -80377,7 +75213,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6858 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6883 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80387,26 +75223,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6867 + v8 = __ccgo_ts + 6892 } else { - v10 = __ccgo_ts + 6882 + v8 = __ccgo_ts + 6907 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6904, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6929, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6917, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6942, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6927, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6952, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6988, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7013, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -80455,8 +75291,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80530,19 +75366,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6995 + zIn = __ccgo_ts + 7020 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7023 + zIn = __ccgo_ts + 7048 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7041 + zIn = __ccgo_ts + 7066 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7059 + zIn = __ccgo_ts + 7084 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7077, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7102, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80714,7 +75550,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7097, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7122, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80769,7 +75605,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7114, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7139, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80793,7 +75629,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7178, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7203, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80807,13 +75643,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80833,16 +75669,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7214, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7239, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80853,35 +75686,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7242, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7267, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7285 + zType = __ccgo_ts + 7310 } else { - zType = __ccgo_ts + 7292 + zType = __ccgo_ts + 7317 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7302, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7327, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7330, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7355, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7352, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7377, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7396, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7421, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80966,7 +75802,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7444, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7469, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -80978,7 +75814,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7455, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7480, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -81024,7 +75860,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -81149,7 +75985,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7466, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7491, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -81184,7 +76020,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7522, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7547, 0) return int32(1) } i = 0 @@ -81222,7 +76058,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7556, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7581, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -81292,7 +76128,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7562, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7587, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -81326,7 +76162,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7623, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7648, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81639,7 +76475,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7654, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7679, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81706,7 +76542,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7556) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7581) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81717,7 +76553,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7693) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7718) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81727,7 +76563,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7699, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7724, 0) return int32(WRC_Abort) } goto _6 @@ -81949,33 +76785,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -82027,7 +76865,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -82235,7 +77073,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82710,7 +77548,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82789,7 +77627,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7758, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7783, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82976,7 +77814,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -83134,11 +77972,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7806 + v2 = __ccgo_ts + 7831 } else { v2 = __ccgo_ts + 1665 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7808, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7833, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -83184,10 +78022,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -83215,7 +78053,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7852, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7877, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -83235,7 +78073,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7886, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7911, libc.VaList(bp+8, p)) } // C documentation @@ -83306,7 +78144,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7936, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7961, libc.VaList(bp+8, pExpr)) } } } @@ -83358,7 +78196,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7956, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7981, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -83391,7 +78229,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7999, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8024, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83627,12 +78465,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83774,7 +78606,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83914,7 +78746,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83935,27 +78766,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -84001,9 +78825,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -84013,8 +78837,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -84028,7 +78852,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -84079,7 +78903,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -84160,7 +78984,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -84178,7 +79002,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -84259,7 +79083,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8022, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8047, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -84388,7 +79212,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8052, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8077, libc.VaList(bp+8, zObject)) } } @@ -84486,10 +79310,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8075) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8100) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8080) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8105) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -85167,13 +79991,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) (r i // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8086) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8111) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8094) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8119) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8100) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8125) == 0 { return int32(1) } return 0 @@ -85188,32 +80012,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8086, - 1: __ccgo_ts + 8094, - 2: __ccgo_ts + 8100, + 0: __ccgo_ts + 8111, + 1: __ccgo_ts + 8119, + 2: __ccgo_ts + 8125, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -85422,7 +80233,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -85475,7 +80286,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8104, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8129, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85575,12 +80386,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -86172,7 +80984,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8319) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8344) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -86268,14 +81080,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -86303,9 +81115,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -86438,7 +81250,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86568,13 +81380,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -87354,7 +82171,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8412, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8437, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -87366,7 +82183,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -87381,7 +82198,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8464, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -87410,7 +82227,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87486,7 +82303,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8022, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8047, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87549,7 +82366,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6805, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6830, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87559,7 +82376,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87567,7 +82384,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87580,9 +82397,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87664,7 +82481,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8463, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8488, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87735,17 +82552,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87754,7 +82571,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87766,6 +82583,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87785,7 +82623,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87855,7 +82693,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87899,7 +82737,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87972,7 +82810,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -87999,8 +82837,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -88166,7 +83004,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88375,7 +83215,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -89082,7 +83924,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -89311,10 +84153,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -89352,7 +84194,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89366,7 +84208,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89380,10 +84222,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -89393,25 +84238,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8538, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -89424,7 +84273,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -89434,11 +84283,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -89458,13 +84307,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89534,7 +84383,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89570,6 +84419,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89587,44 +84437,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8538, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89704,7 +84559,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89712,7 +84567,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -89730,7 +84585,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -89749,11 +84604,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -89871,8 +84726,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8513, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8567, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89890,10 +84745,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8541, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8595, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8716, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8770, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89909,9 +84764,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8890, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8944, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9037, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9091, 0) } } @@ -89967,7 +84822,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9188, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9242, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89976,11 +84831,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9247, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9301, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9253, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9307, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90010,21 +84865,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9280, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9334, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9464, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9518, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9769, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9785, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9823, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9839, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9843, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9897, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -90032,7 +84887,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -90040,7 +84895,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10108, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10162, 0) goto exit_rename_table exit_rename_table: ; @@ -90057,7 +84912,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10121, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10175, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90097,11 +84952,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10159, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10213, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10191, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10245, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90117,10 +84972,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10218) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10272) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10277) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10331) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90132,13 +84987,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10330) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10384) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10376) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10430) } } /* Modify the CREATE TABLE statement. */ @@ -90152,7 +85007,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10403, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10457, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90180,7 +85035,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10549, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10603, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90218,12 +85073,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10902, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10956, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10936, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10990, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90238,7 +85093,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -90246,8 +85101,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10966, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11020, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -90308,18 +85163,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10985 + zType = __ccgo_ts + 11039 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10990 + zType = __ccgo_ts + 11044 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11004 + v1 = __ccgo_ts + 11058 } else { - v1 = __ccgo_ts + 11021 + v1 = __ccgo_ts + 11075 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11039, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11093, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90366,21 +85221,9 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11057, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11111, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90396,11 +85239,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11078, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11260, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11132, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11314, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10108, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10162, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90410,31 +85253,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -90451,16 +85269,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90763,9 +85571,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90876,11 +85684,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*uint8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11391 + v1 = __ccgo_ts + 11445 } else { v1 = __ccgo_ts + 1665 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11393, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11447, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90951,30 +85759,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11416, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11470, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90995,9 +85807,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -91013,15 +85824,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11424, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11478, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -91032,16 +85843,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, *(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -91058,21 +85869,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0) _sqlite3Dequote(tls, zBuf1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11391 + v1 = __ccgo_ts + 11445 } else { v1 = __ccgo_ts + 1665 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11430, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11484, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -91098,7 +85909,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -91408,7 +86219,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91675,7 +86486,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -91858,7 +86669,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91942,8 +86753,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -91959,12 +86771,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -92038,7 +86850,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92055,7 +86867,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11435, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11489, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -92110,23 +86922,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11057, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11111, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11442 + v1 = __ccgo_ts + 11496 } else { - v1 = __ccgo_ts + 5672 + v1 = __ccgo_ts + 5698 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11454, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11508, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11482, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11536, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92138,31 +86950,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1665, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11530, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11584, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11651, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11705, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -92176,7 +86988,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -92187,8 +86999,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -92249,27 +87061,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11669, + FzName: __ccgo_ts + 11723, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11690, + FzName: __ccgo_ts + 11744, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11710, + FzName: __ccgo_ts + 11764, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11729, + FzName: __ccgo_ts + 11783, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11748, + FzName: __ccgo_ts + 11802, }, } @@ -92480,8 +87292,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11851, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11905, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92491,10 +87308,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11874, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11928, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11904, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11958, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92526,15 +87343,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11771, - FzCols: __ccgo_ts + 11784, + FzName: __ccgo_ts + 11825, + FzCols: __ccgo_ts + 11838, }, 1: { - FzName: __ccgo_ts + 11797, - FzCols: __ccgo_ts + 11810, + FzName: __ccgo_ts + 11851, + FzCols: __ccgo_ts + 11864, }, 2: { - FzName: __ccgo_ts + 11838, + FzName: __ccgo_ts + 11892, }, } @@ -92587,44 +87404,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92748,7 +87527,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92764,12 +87544,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92777,7 +87557,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92836,7 +87616,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11922, + FzName: __ccgo_ts + 11976, } func init() { @@ -93210,7 +87990,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11932, + FzName: __ccgo_ts + 11986, } func init() { @@ -93260,7 +88040,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11942, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11996, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93271,7 +88051,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11947, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12001, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93310,7 +88090,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11953, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12007, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93328,7 +88108,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11959, + FzName: __ccgo_ts + 12013, } func init() { @@ -93394,7 +88174,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11968, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12022, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93403,12 +88183,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11771, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11825, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93530,7 +88310,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93610,7 +88390,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93641,7 +88421,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11978, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12032, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93732,7 +88512,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11978, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12032, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93769,7 +88549,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93802,11 +88582,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11982) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12036) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11986) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12040) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93914,13 +88694,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93970,17 +88743,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*uint8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11990, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12044, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12001, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12055, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12011, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12065, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93992,13 +88765,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -94049,7 +88815,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -94252,8 +89018,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -94359,11 +89125,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11797, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11851, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12023, __ccgo_ts+12092, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12077, __ccgo_ts+12146, zDb) } return rc } @@ -94429,10 +89195,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11771, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11825, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12144, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12198, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94545,7 +89311,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6713, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6738, zName) == 0) } // C documentation @@ -94597,11 +89363,11 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4034) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4060) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12185, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12239, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94632,7 +89398,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12188, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12242, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94641,7 +89407,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12225, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12279, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94653,13 +89419,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94697,7 +89463,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12255, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12309, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94705,7 +89471,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12284, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12338, 0) rc = int32(SQLITE_ERROR) } } @@ -94752,7 +89518,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1635, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12352, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12406, libc.VaList(bp+56, zFile)) } } } @@ -94814,15 +89580,15 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { i++ } if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12380, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12434, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12401, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12455, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12427, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12481, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94917,7 +89683,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12449, + FzName: __ccgo_ts + 12503, } func init() { @@ -94939,7 +89705,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12463, + FzName: __ccgo_ts + 12517, } func init() { @@ -94965,7 +89731,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12477, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12531, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94999,7 +89765,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12501, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12555, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -95126,6 +89892,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -95198,9 +89966,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -95216,7 +89984,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12547, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12601, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95244,11 +90012,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12570, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12624, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12576, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12630, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12582, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12636, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95308,7 +90076,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8094 + zCol = __ccgo_ts + 8119 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95343,7 +90111,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12609, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12663, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95380,47 +90148,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -95461,7 +90188,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95559,7 +90286,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95637,7 +90366,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95651,7 +90380,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95764,21 +90495,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6713) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6738) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6680+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6699+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6149+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6661) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6705+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6724+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6173+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6686) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6699+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6149) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6724+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6173) } } } @@ -95808,12 +90539,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6699+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6149) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6724+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6173) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6680+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6661) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6705+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6686) } } } @@ -95851,7 +90582,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12624, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12678, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95861,7 +90592,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95869,15 +90600,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12632 + v1 = __ccgo_ts + 12686 } else { - v1 = __ccgo_ts + 12645 + v1 = __ccgo_ts + 12699 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6917, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6942, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6988, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7013, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95915,12 +90646,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6149+7) == 0 { - return __ccgo_ts + 6699 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6173+7) == 0 { + return __ccgo_ts + 6724 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6661+7) == 0 { - return __ccgo_ts + 6680 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6686+7) == 0 { + return __ccgo_ts + 6705 } } return zName @@ -96044,9 +90775,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -96445,7 +91176,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6149) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6173) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96477,7 +91208,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6713, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6738, zName) { break } goto _1 @@ -96535,13 +91266,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12659, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12713, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12676, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12730, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96589,8 +91320,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6653, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12696, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6678, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12750, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96626,23 +91357,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96762,7 +91495,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96805,9 +91538,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96820,7 +91553,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12738, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12792, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96836,9 +91569,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10985 + v2 = __ccgo_ts + 11039 } else { - v2 = __ccgo_ts + 9247 + v2 = __ccgo_ts + 9301 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96848,9 +91581,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6661 + v3 = __ccgo_ts + 6686 } else { - v3 = __ccgo_ts + 6149 + v3 = __ccgo_ts + 6173 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96874,11 +91607,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10985 + v4 = __ccgo_ts + 11039 } else { - v4 = __ccgo_ts + 9247 + v4 = __ccgo_ts + 9301 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12779, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12833, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96886,11 +91619,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12800, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12854, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96922,19 +91655,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96954,15 +91697,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96977,7 +91725,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -97038,7 +91786,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12889, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97047,14 +91795,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12869, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12923, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -97086,11 +91836,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity uint8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -97101,7 +91851,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12889, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12943, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97111,12 +91861,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12912, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12966, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12919, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12973, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -97158,21 +91908,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*uint8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = uint8(0) _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12929, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12983, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -97183,7 +91922,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -97196,12 +91935,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*uint8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = uint8(0) _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -97373,10 +92121,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12955, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13009, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13000, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13054, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97434,7 +92182,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13041, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13095, 0) } } @@ -97462,8 +92210,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -97471,7 +92219,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13093, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13147, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97490,21 +92238,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97527,7 +92264,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13134, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13188, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97555,8 +92292,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97643,17 +92385,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13244, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13233, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13287, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13241, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13295, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97685,7 +92427,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13248, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13302, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97826,9 +92568,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97839,31 +92582,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { zSep = __ccgo_ts + 1665 - zSep2 = __ccgo_ts + 13279 - zEnd = __ccgo_ts + 5173 + zSep2 = __ccgo_ts + 13333 + zEnd = __ccgo_ts + 5199 } else { - zSep = __ccgo_ts + 13281 - zSep2 = __ccgo_ts + 13285 - zEnd = __ccgo_ts + 13290 + zSep = __ccgo_ts + 13335 + zSep2 = __ccgo_ts + 13339 + zEnd = __ccgo_ts + 13344 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13293, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13347, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97874,8 +92617,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97888,17 +92632,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3862, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ 0: __ccgo_ts + 1665, - 1: __ccgo_ts + 13307, - 2: __ccgo_ts + 13313, - 3: __ccgo_ts + 13318, - 4: __ccgo_ts + 13323, - 5: __ccgo_ts + 13313, + 1: __ccgo_ts + 13361, + 2: __ccgo_ts + 13367, + 3: __ccgo_ts + 13372, + 4: __ccgo_ts + 13377, + 5: __ccgo_ts + 13367, } // C documentation @@ -97907,15 +92652,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97930,7 +92676,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -98163,8 +92909,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -98264,7 +93020,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -98277,8 +93033,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -98308,7 +93064,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98527,9 +93283,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13329, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13383, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1665))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13362, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13416, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98550,11 +93306,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13389, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13443, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13439, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13493, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98601,7 +93357,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13471, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13525, 0) return } } @@ -98635,16 +93391,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9247 - zType2 = __ccgo_ts + 13515 + zType = __ccgo_ts + 9301 + zType2 = __ccgo_ts + 13569 } else { /* A view */ - zType = __ccgo_ts + 10985 - zType2 = __ccgo_ts + 13521 + zType = __ccgo_ts + 11039 + zType2 = __ccgo_ts + 13575 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98661,24 +93417,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98726,13 +93487,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13526, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13580, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13541, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13595, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98741,15 +93512,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13639, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13693, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13681, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13735, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13715, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13769, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98767,7 +93538,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9769) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9823) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98800,7 +93571,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13736, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13790, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98817,7 +93588,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10985, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11039, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98914,7 +93685,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13772, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13826, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -99098,7 +93869,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13802, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13856, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99111,7 +93882,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13817, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13871, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -99194,9 +93965,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13884, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13938, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11874, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11928, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99237,7 +94008,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13898, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13952, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -99246,7 +94017,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13943, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13997, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -99281,11 +94052,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3485, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3511, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7455, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7480, int32(10)) == 0 { return 0 } return int32(1) @@ -99340,9 +94111,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -99375,18 +94146,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14010, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14064, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14038, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14092, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14072, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14126, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99396,7 +94167,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11986, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12040, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99444,19 +94215,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14104, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14158, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14167, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14221, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -99513,7 +94284,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14261, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14315, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99628,11 +94399,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99654,7 +94425,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99699,13 +94470,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99728,23 +94499,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99773,11 +94544,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14307 + v2 = __ccgo_ts + 14361 } else { - v2 = __ccgo_ts + 14313 + v2 = __ccgo_ts + 14367 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14318, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14372, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99855,7 +94626,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14346, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14400, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99865,7 +94636,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14352, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14406, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99879,16 +94650,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14402, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14456, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14430, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14484, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14455, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14509, 0) goto exit_create_index } /* @@ -99909,19 +94680,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14346, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14400, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14489, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14543, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14523, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14577, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99942,7 +94713,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14547, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14601, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99960,9 +94731,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6661 + v2 = __ccgo_ts + 6686 } else { - v2 = __ccgo_ts + 6149 + v2 = __ccgo_ts + 6173 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99990,7 +94761,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14346) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14400) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100022,7 +94793,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -100074,7 +94845,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14570, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14624, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100084,7 +94855,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -100094,8 +94865,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -100173,7 +94944,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -100221,7 +94992,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14631, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14685, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -100251,8 +95022,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14673, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14727, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -100265,7 +95036,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -100294,9 +95065,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1665 } else { - v13 = __ccgo_ts + 14690 + v13 = __ccgo_ts + 14744 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14698, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14752, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -100304,7 +95075,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14718, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14772, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -100312,7 +95083,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14777, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14831, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -100475,16 +95246,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14804, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14858, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14822, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14876, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100492,9 +95263,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100510,8 +95281,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14895, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11982, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14949, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12036, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100584,12 +95355,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100701,13 +95472,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14955, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15009, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -100788,7 +95559,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -100838,7 +95609,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -101009,11 +95780,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14991 + v1 = __ccgo_ts + 15045 } else { - v1 = __ccgo_ts + 14994 + v1 = __ccgo_ts + 15048 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15000, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15054, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101212,7 +95983,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15036, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15090, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101259,9 +96030,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15042 + v1 = __ccgo_ts + 15096 } else { - v1 = __ccgo_ts + 15051 + v1 = __ccgo_ts + 15105 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101293,9 +96064,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15036, - 1: __ccgo_ts + 15058, - 2: __ccgo_ts + 15042, + 0: __ccgo_ts + 15090, + 1: __ccgo_ts + 15112, + 2: __ccgo_ts + 15096, } // C documentation @@ -101315,7 +96086,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15066, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15120, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101340,7 +96111,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12570, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12624, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101771,7 +96542,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15266, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15320, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102653,11 +97422,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15299, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15353, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15328, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15382, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102761,7 +97530,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102818,7 +97587,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15402, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15456, -int32(1)) return } if argc == int32(3) { @@ -104537,7 +99311,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15489, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104619,7 +99393,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104691,28 +99465,28 @@ var _hexdigits = [16]uint8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15480, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15534, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15488, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15542, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104744,13 +99518,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15496, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15550 + } else { + v2 = __ccgo_ts + 15554 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1666, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*uint8)(unsafe.Pointer(zOut + uintptr(v2))) = uint8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0) + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15557, -int32(1)) + return +} + // C documentation // // /* @@ -104762,6 +99672,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104772,7 +99686,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -105207,7 +100121,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -105296,7 +100210,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11391, + 0: __ccgo_ts + 11445, } // C documentation @@ -105308,8 +100222,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -105324,7 +100238,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -105336,16 +100250,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -105456,7 +100370,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15499, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15580, int32(4), libc.UintptrFromInt32(0)) } } @@ -105517,7 +100431,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12609, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12663, -int32(1)) return } if argc == int32(2) { @@ -105548,17 +100462,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105627,7 +100530,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105709,7 +100612,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15379, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15433, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105772,12 +100675,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105941,7 +100838,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -105952,7 +100849,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -106059,7 +100956,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15504, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15585, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106088,8 +100985,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15510, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15510, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15591, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15591, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -106377,7 +101274,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -106390,542 +101287,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15515, + FzName: __ccgo_ts + 15596, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15535, + FzName: __ccgo_ts + 15616, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15548, + FzName: __ccgo_ts + 15629, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15566, + FzName: __ccgo_ts + 15647, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15575, + FzName: __ccgo_ts + 15656, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15583, + FzName: __ccgo_ts + 15664, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15583, + FzName: __ccgo_ts + 15664, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15598, + FzName: __ccgo_ts + 15679, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15624, + FzName: __ccgo_ts + 15705, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15649, + FzName: __ccgo_ts + 15730, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15658, + FzName: __ccgo_ts + 15739, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15669, + FzName: __ccgo_ts + 15750, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15676, + FzName: __ccgo_ts + 15757, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15690, + FzName: __ccgo_ts + 15771, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15690, + FzName: __ccgo_ts + 15771, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15696, + FzName: __ccgo_ts + 15777, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15696, + FzName: __ccgo_ts + 15777, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15702, + FzName: __ccgo_ts + 15783, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15702, + FzName: __ccgo_ts + 15783, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15707, + FzName: __ccgo_ts + 15788, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15707, + FzName: __ccgo_ts + 15788, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15711, + FzName: __ccgo_ts + 15792, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15711, + FzName: __ccgo_ts + 15792, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15715, + FzName: __ccgo_ts + 15796, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15722, + FzName: __ccgo_ts + 15803, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15730, + FzName: __ccgo_ts + 15811, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15737, + FzName: __ccgo_ts + 15818, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15750, + FzName: __ccgo_ts + 15831, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15756, + FzName: __ccgo_ts + 15837, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15763, + FzName: __ccgo_ts + 15844, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15770, + FzName: __ccgo_ts + 15851, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15778, + FzName: __ccgo_ts + 15859, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15783, + FzName: __ccgo_ts + 15864, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15787, + FzName: __ccgo_ts + 15868, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15787, + FzName: __ccgo_ts + 15868, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15793, + FzName: __ccgo_ts + 15874, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15799, + FzName: __ccgo_ts + 15880, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15805, + FzName: __ccgo_ts + 15886, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15809, + FzName: __ccgo_ts + 15890, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15809, + FzName: __ccgo_ts + 15890, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15815, + FzName: __ccgo_ts + 15896, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15822, + FzName: __ccgo_ts + 15903, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15832, + FzName: __ccgo_ts + 15913, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15839, + FzName: __ccgo_ts + 15920, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15846, + FzName: __ccgo_ts + 15927, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15857, + FzName: __ccgo_ts + 15938, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15864, + FzName: __ccgo_ts + 15945, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15879, + FzName: __ccgo_ts + 15960, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15896, + FzName: __ccgo_ts + 15977, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15907, + FzName: __ccgo_ts + 15988, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15913, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15995, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15931, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16001, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15939, + FzName: __ccgo_ts + 16014, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15953, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16032, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15961, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16040, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15970, + FzName: __ccgo_ts + 16054, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15970, + FzName: __ccgo_ts + 16062, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16071, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16071, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16078, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16078, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15987, + FzName: __ccgo_ts + 16088, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15991, + FzName: __ccgo_ts + 16092, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15997, + FzName: __ccgo_ts + 16098, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16001, + FzName: __ccgo_ts + 16102, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16001, + FzName: __ccgo_ts + 16102, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16007, + FzName: __ccgo_ts + 16108, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16007, + FzName: __ccgo_ts + 16108, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16020, + FzName: __ccgo_ts + 16121, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16031, + FzName: __ccgo_ts + 16132, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15510, + FzName: __ccgo_ts + 15591, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15510, + FzName: __ccgo_ts + 15591, }, - 70: { + 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16036, + FzName: __ccgo_ts + 16137, }, - 71: { + 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1238, }, - 72: { + 74: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1246, }, - 73: { + 75: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16041, + FzName: __ccgo_ts + 16142, }, - 74: { + 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16047, + FzName: __ccgo_ts + 16148, }, - 75: { + 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16050, + FzName: __ccgo_ts + 16151, }, - 76: { + 78: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16054, + FzName: __ccgo_ts + 16155, }, - 77: { + 79: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16060, - }, - 78: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16050, - }, - 79: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16065, + FzName: __ccgo_ts + 16161, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16069, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16151, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16073, + FzName: __ccgo_ts + 16166, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16079, + FzName: __ccgo_ts + 16170, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16083, + FzName: __ccgo_ts + 16174, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16088, + FzName: __ccgo_ts + 16180, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16093, + FzName: __ccgo_ts + 16184, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16098, + FzName: __ccgo_ts + 16189, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16104, + FzName: __ccgo_ts + 16194, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16108, + FzName: __ccgo_ts + 16199, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16112, + FzName: __ccgo_ts + 16205, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16116, + FzName: __ccgo_ts + 16209, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16121, + FzName: __ccgo_ts + 16213, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16126, + FzName: __ccgo_ts + 16217, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16131, + FzName: __ccgo_ts + 16222, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16137, + FzName: __ccgo_ts + 16227, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16143, + FzName: __ccgo_ts + 16232, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16149, + FzName: __ccgo_ts + 16238, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16154, + FzName: __ccgo_ts + 16244, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16162, + FzName: __ccgo_ts + 16250, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16170, + FzName: __ccgo_ts + 16255, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16173, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16263, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16271, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16274, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6858, + FzName: __ccgo_ts + 6883, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16178, + FzName: __ccgo_ts + 16279, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16182, + FzName: __ccgo_ts + 16283, }, } @@ -106984,109 +101892,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -107310,7 +102220,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -107403,7 +102313,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16185, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16286, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -108227,7 +103137,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108514,11 +103424,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6724, + Fz: __ccgo_ts + 6749, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6720, + Fz: __ccgo_ts + 6745, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108582,7 +103492,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5308) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5334) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108598,7 +103508,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -109046,7 +103956,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -109164,7 +104074,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8351, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8376, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -109230,11 +104140,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109559,7 +104469,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109573,7 +104483,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109608,7 +104518,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109621,7 +104531,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109748,27 +104658,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109849,7 +104759,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109876,7 +104786,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -109885,44 +104795,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16230, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16331, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16271, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16372, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109944,31 +104838,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16303, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16404, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109992,10 +104886,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -110036,8 +104930,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -110054,34 +104948,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16311, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16412, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16363, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16464, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -110188,18 +105082,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -110209,13 +105103,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -110226,14 +105120,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -110250,16 +105144,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -110370,11 +105264,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -110433,7 +105327,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16455) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16556) } goto insert_cleanup insert_cleanup: @@ -110556,33 +105450,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110829,7 +105696,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12570, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12624, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -113063,7 +107610,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16504, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16605, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113083,19 +107630,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16508, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16609, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16514, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16615, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113110,14 +107657,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16557, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16658, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -113141,7 +107688,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16589, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16690, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113150,7 +107697,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16469, + 0: __ccgo_ts + 16570, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113219,14 +107766,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -113241,7 +107783,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -113259,7 +107801,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -113274,7 +107816,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -113284,6 +107826,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -113295,7 +107839,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -113307,7 +107851,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -113383,7 +107927,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16626, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16727, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113437,63 +107981,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5564, - 1: __ccgo_ts + 16665, - 2: __ccgo_ts + 9247, - 3: __ccgo_ts + 16669, - 4: __ccgo_ts + 16674, - 5: __ccgo_ts + 16677, - 6: __ccgo_ts + 16687, - 7: __ccgo_ts + 16697, - 8: __ccgo_ts + 16703, - 9: __ccgo_ts + 16707, - 10: __ccgo_ts + 16712, - 11: __ccgo_ts + 16717, - 12: __ccgo_ts + 16725, - 13: __ccgo_ts + 16736, - 14: __ccgo_ts + 16739, - 15: __ccgo_ts + 16746, - 16: __ccgo_ts + 16707, - 17: __ccgo_ts + 16712, - 18: __ccgo_ts + 16753, - 19: __ccgo_ts + 16758, - 20: __ccgo_ts + 16761, - 21: __ccgo_ts + 16768, - 22: __ccgo_ts + 16703, - 23: __ccgo_ts + 16707, - 24: __ccgo_ts + 16774, - 25: __ccgo_ts + 16779, - 26: __ccgo_ts + 16784, - 27: __ccgo_ts + 16707, - 28: __ccgo_ts + 16788, - 29: __ccgo_ts + 16712, - 30: __ccgo_ts + 16796, - 31: __ccgo_ts + 16800, - 32: __ccgo_ts + 16805, - 33: __ccgo_ts + 11986, - 34: __ccgo_ts + 11982, - 35: __ccgo_ts + 16811, - 36: __ccgo_ts + 16816, - 37: __ccgo_ts + 16821, - 38: __ccgo_ts + 16665, - 39: __ccgo_ts + 16707, - 40: __ccgo_ts + 16826, - 41: __ccgo_ts + 16833, - 42: __ccgo_ts + 16840, - 43: __ccgo_ts + 9247, - 44: __ccgo_ts + 16848, - 45: __ccgo_ts + 5567, - 46: __ccgo_ts + 16854, - 47: __ccgo_ts + 16665, - 48: __ccgo_ts + 16707, - 49: __ccgo_ts + 16859, - 50: __ccgo_ts + 16864, - 51: __ccgo_ts + 16050, - 52: __ccgo_ts + 16869, - 53: __ccgo_ts + 16882, - 54: __ccgo_ts + 16891, - 55: __ccgo_ts + 16898, - 56: __ccgo_ts + 16909, + 0: __ccgo_ts + 5590, + 1: __ccgo_ts + 16766, + 2: __ccgo_ts + 9301, + 3: __ccgo_ts + 16770, + 4: __ccgo_ts + 16775, + 5: __ccgo_ts + 16778, + 6: __ccgo_ts + 16788, + 7: __ccgo_ts + 16798, + 8: __ccgo_ts + 16804, + 9: __ccgo_ts + 16808, + 10: __ccgo_ts + 16813, + 11: __ccgo_ts + 16818, + 12: __ccgo_ts + 16826, + 13: __ccgo_ts + 16837, + 14: __ccgo_ts + 16840, + 15: __ccgo_ts + 16808, + 16: __ccgo_ts + 16847, + 17: __ccgo_ts + 16813, + 18: __ccgo_ts + 16855, + 19: __ccgo_ts + 16859, + 20: __ccgo_ts + 16864, + 21: __ccgo_ts + 16870, + 22: __ccgo_ts + 16808, + 23: __ccgo_ts + 16813, + 24: __ccgo_ts + 16877, + 25: __ccgo_ts + 16882, + 26: __ccgo_ts + 16885, + 27: __ccgo_ts + 16892, + 28: __ccgo_ts + 16804, + 29: __ccgo_ts + 16808, + 30: __ccgo_ts + 16898, + 31: __ccgo_ts + 16903, + 32: __ccgo_ts + 16908, + 33: __ccgo_ts + 16766, + 34: __ccgo_ts + 16808, + 35: __ccgo_ts + 16912, + 36: __ccgo_ts + 16919, + 37: __ccgo_ts + 16926, + 38: __ccgo_ts + 12040, + 39: __ccgo_ts + 12036, + 40: __ccgo_ts + 16934, + 41: __ccgo_ts + 16939, + 42: __ccgo_ts + 16944, + 43: __ccgo_ts + 9301, + 44: __ccgo_ts + 16949, + 45: __ccgo_ts + 5593, + 46: __ccgo_ts + 16955, + 47: __ccgo_ts + 16960, + 48: __ccgo_ts + 16151, + 49: __ccgo_ts + 16965, + 50: __ccgo_ts + 16766, + 51: __ccgo_ts + 16808, + 52: __ccgo_ts + 16978, + 53: __ccgo_ts + 16983, + 54: __ccgo_ts + 16992, + 55: __ccgo_ts + 16999, + 56: __ccgo_ts + 17010, } // C documentation @@ -113512,338 +108056,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16917, + FzName: __ccgo_ts + 17018, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16932, + FzName: __ccgo_ts + 17033, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16947, + FzName: __ccgo_ts + 17048, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16959, + FzName: __ccgo_ts + 17060, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16975, + FzName: __ccgo_ts + 17076, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16898, + FzName: __ccgo_ts + 16999, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16988, + FzName: __ccgo_ts + 17089, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17000, + FzName: __ccgo_ts + 17101, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17020, + FzName: __ccgo_ts + 17121, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17036, + FzName: __ccgo_ts + 17137, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17057, + FzName: __ccgo_ts + 17158, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17072, + FzName: __ccgo_ts + 17173, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17088, + FzName: __ccgo_ts + 17189, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17102, + FzName: __ccgo_ts + 17203, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17115, + FzName: __ccgo_ts + 17216, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17129, + FzName: __ccgo_ts + 17230, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17148, + FzName: __ccgo_ts + 17249, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17167, + FzName: __ccgo_ts + 17268, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17190, + FzName: __ccgo_ts + 17291, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17199, + FzName: __ccgo_ts + 17300, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17217, + FzName: __ccgo_ts + 17318, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17234, + FzName: __ccgo_ts + 17335, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17247, + FzName: __ccgo_ts + 17348, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17262, + FzName: __ccgo_ts + 17363, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17280, + FzName: __ccgo_ts + 17381, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17290, + FzName: __ccgo_ts + 17391, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17304, + FzName: __ccgo_ts + 17405, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17320, + FzName: __ccgo_ts + 17421, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17345, + FzName: __ccgo_ts + 17446, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17364, + FzName: __ccgo_ts + 17465, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17375, + FzName: __ccgo_ts + 17476, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17386, + FzName: __ccgo_ts + 17487, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17398, + FzName: __ccgo_ts + 17499, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17414, + FzName: __ccgo_ts + 17515, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17427, + FzName: __ccgo_ts + 17528, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17446, + FzName: __ccgo_ts + 17547, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17465, + FzName: __ccgo_ts + 17566, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17478, + FzName: __ccgo_ts + 17579, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17493, + FzName: __ccgo_ts + 17594, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17503, + FzName: __ccgo_ts + 17604, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17515, + FzName: __ccgo_ts + 17616, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17524, + FzName: __ccgo_ts + 17625, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17535, + FzName: __ccgo_ts + 17636, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17545, + FzName: __ccgo_ts + 17646, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17557, + FzName: __ccgo_ts + 17658, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17568, + FzName: __ccgo_ts + 17669, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17580, + FzName: __ccgo_ts + 17681, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17597, + FzName: __ccgo_ts + 17698, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17616, + FzName: __ccgo_ts + 17717, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17642, + FzName: __ccgo_ts + 17743, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17657, + FzName: __ccgo_ts + 17758, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17671, + FzName: __ccgo_ts + 17772, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17690, + FzName: __ccgo_ts + 17791, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17704, + FzName: __ccgo_ts + 17805, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17720, + FzName: __ccgo_ts + 17821, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17732, + FzName: __ccgo_ts + 17833, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17743, + FzName: __ccgo_ts + 17844, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17754, + FzName: __ccgo_ts + 17855, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113851,45 +108395,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17766, + FzName: __ccgo_ts + 17867, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17777, + FzName: __ccgo_ts + 17878, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17798, + FzName: __ccgo_ts + 17899, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17806, + FzName: __ccgo_ts + 17907, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17821, + FzName: __ccgo_ts + 17922, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17834, + FzName: __ccgo_ts + 17935, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17853, + FzName: __ccgo_ts + 17954, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17868, + FzName: __ccgo_ts + 17969, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113907,7 +108451,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -114015,10 +108559,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17884) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17985) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17894) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17995) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114036,13 +108580,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8407) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8432) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17901) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18002) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17906) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18007) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114065,10 +108609,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) <= int32('2') { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16859) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16978) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17918) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18019) == 0 { return int32(2) } else { return 0 @@ -114090,7 +108634,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17925, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18026, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114220,15 +108764,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17987 + zName = __ccgo_ts + 18088 case int32(OE_SetDflt): - zName = __ccgo_ts + 17996 + zName = __ccgo_ts + 18097 case int32(OE_Cascade): - zName = __ccgo_ts + 18008 + zName = __ccgo_ts + 18109 case int32(OE_Restrict): - zName = __ccgo_ts + 18016 + zName = __ccgo_ts + 18117 default: - zName = __ccgo_ts + 18025 + zName = __ccgo_ts + 18126 break } return zName @@ -114249,12 +108793,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18035, - 1: __ccgo_ts + 18042, - 2: __ccgo_ts + 18050, - 3: __ccgo_ts + 18054, - 4: __ccgo_ts + 17918, - 5: __ccgo_ts + 18063, + 0: __ccgo_ts + 18136, + 1: __ccgo_ts + 18143, + 2: __ccgo_ts + 18151, + 3: __ccgo_ts + 18155, + 4: __ccgo_ts + 18019, + 5: __ccgo_ts + 18164, } // C documentation @@ -114316,15 +108860,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18088 + zType = __ccgo_ts + 18189 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18090 + zType = __ccgo_ts + 18191 } else { - zType = __ccgo_ts + 7806 + zType = __ccgo_ts + 7831 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18092, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18193, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -114333,9 +108877,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18067, - 2: __ccgo_ts + 18072, - 3: __ccgo_ts + 18080, + 1: __ccgo_ts + 18168, + 2: __ccgo_ts + 18173, + 3: __ccgo_ts + 18181, } // C documentation @@ -114434,7 +108978,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18099, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18200, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114477,7 +109021,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3862, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3888, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114522,7 +109066,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114581,7 +109125,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18103) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18204) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114624,7 +109168,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114652,7 +109196,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17894 + zRet = __ccgo_ts + 17995 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114680,7 +109224,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17884 + zRet = __ccgo_ts + 17985 } _returnSingleText(tls, v, zRet) break @@ -114970,7 +109514,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uint8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18108, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18209, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114980,7 +109524,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*uint8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -115002,7 +109546,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18133, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18234, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115034,8 +109578,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18186) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18287) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -115115,9 +109660,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18192 + v14 = __ccgo_ts + 18293 } else { - v14 = __ccgo_ts + 18200 + v14 = __ccgo_ts + 18301 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115188,7 +109733,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18207, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18308, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -115218,19 +109763,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10985 + zType = __ccgo_ts + 11039 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13233 + zType = __ccgo_ts + 13287 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18223 + zType = __ccgo_ts + 18324 } else { - zType = __ccgo_ts + 9247 + zType = __ccgo_ts + 9301 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18230, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18331, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -115277,9 +109822,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18237, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18338, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18242, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18343, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -115303,11 +109848,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18247, - 1: __ccgo_ts + 18249, - 2: __ccgo_ts + 16736, + 0: __ccgo_ts + 18348, + 1: __ccgo_ts + 18350, + 2: __ccgo_ts + 16837, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18251, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18352, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -115326,7 +109871,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18257, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18358, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -115343,7 +109888,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18261, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18362, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115393,7 +109938,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7806, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7831, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -115405,7 +109950,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7806, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7831, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -115431,7 +109976,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18264, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18273)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18365, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18374)) goto _32 _32: ; @@ -115445,8 +109990,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115572,7 +110117,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18278, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18379, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115668,7 +110213,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115712,7 +110257,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -115763,7 +110308,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18282, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18383, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115774,7 +110319,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18306) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18407) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115910,7 +110455,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18335, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18436, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115972,7 +110517,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115994,7 +110539,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18371, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18472, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -116007,7 +110552,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18391, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18492, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -116015,7 +110560,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18413, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18514, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -116026,10 +110571,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18436, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18537, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18539, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -116063,7 +110608,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18458, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18559, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -116087,9 +110632,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18488) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18589) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18493) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18594) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -116102,9 +110647,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18514) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18615) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18550) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18651) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116132,9 +110677,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18488) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18589) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18561) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18662) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116162,7 +110707,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18588) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18689) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116259,7 +110804,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18615 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18716 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116338,7 +110883,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18676, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18777, libc.VaList(bp+176, zRight)) } } } @@ -116443,13 +110988,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17901) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18002) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18701) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18802) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18054) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18155) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116584,7 +111129,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116614,7 +111159,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6653, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6678, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116676,7 +111221,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18709, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18810, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116949,34 +111494,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18618, + FzName: __ccgo_ts + 18719, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18623, + FzName: __ccgo_ts + 18724, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18629, + FzName: __ccgo_ts + 18730, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18638, + FzName: __ccgo_ts + 18739, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18647, + FzName: __ccgo_ts + 18748, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18655, + FzName: __ccgo_ts + 18756, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18663, + FzName: __ccgo_ts + 18764, }, 7: { - FzName: __ccgo_ts + 18670, + FzName: __ccgo_ts + 18771, }, 8: {}, } @@ -117033,25 +111578,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -117072,14 +111598,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18727) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18828) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18742, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18843, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -117088,19 +111614,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18749, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18850, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18755) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18856) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18767) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18868) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5199, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -117115,7 +111641,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -117296,7 +111822,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -117308,13 +111834,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18782) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18883) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18790, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18891, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18794, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18895, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117323,7 +111849,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117449,24 +111975,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18828, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18929, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5175 + v1 = __ccgo_ts + 5201 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18856, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18957, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18887, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18988, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -117474,9 +112000,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18798, - 1: __ccgo_ts + 18805, - 2: __ccgo_ts + 18817, + 0: __ccgo_ts + 18899, + 1: __ccgo_ts + 18906, + 2: __ccgo_ts + 18918, } // C documentation @@ -117552,7 +112078,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14673) + _corruptSchema(tls, pData, argv, __ccgo_ts+14727) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117585,11 +112111,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18895) + _corruptSchema(tls, pData, argv, __ccgo_ts+18996) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14673) + _corruptSchema(tls, pData, argv, __ccgo_ts+14727) } } } @@ -117628,18 +112154,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9247 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9301 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6661 + v2 = __ccgo_ts + 6686 } else { - v2 = __ccgo_ts + 6149 + v2 = __ccgo_ts + 6173 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8319 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18908 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8344 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19009 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117723,7 +112249,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12284) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12338) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117749,7 +112275,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18980) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19081) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117764,7 +112290,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19004, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19105, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -118060,7 +112586,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -118073,9 +112599,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -118093,7 +112619,7 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse @@ -118122,7 +112648,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -118182,7 +112708,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19038, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19139, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118198,7 +112724,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19068, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19169, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118221,10 +112747,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -118232,7 +112758,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3862, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3888, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -118262,7 +112788,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118396,7 +112922,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118518,15 +113044,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118562,21 +113079,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118656,7 +113158,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118664,7 +113166,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118820,15 +113322,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11391 - zSp2 = __ccgo_ts + 11391 + zSp1 = __ccgo_ts + 11445 + zSp2 = __ccgo_ts + 11445 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19087, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19188, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118885,25 +113387,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -119035,13 +113540,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -119119,7 +113624,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19117, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19218, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119169,12 +113674,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19167, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19268, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -119189,9 +113694,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19231, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19332, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119201,6 +113707,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = uint8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -119235,7 +113748,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6858, + Fz: __ccgo_ts + 6883, Fn: uint32(8), } @@ -119252,13 +113765,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -119283,7 +113789,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -119328,7 +113834,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -119352,7 +113858,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -119373,7 +113879,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119496,7 +114002,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119623,10 +114129,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119634,7 +114140,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119811,7 +114317,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19268, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19369, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119922,8 +114428,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119931,7 +114437,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -120016,13 +114522,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19288 + z = __ccgo_ts + 19389 case int32(TK_INTERSECT): - z = __ccgo_ts + 19298 + z = __ccgo_ts + 19399 case int32(TK_EXCEPT): - z = __ccgo_ts + 19308 + z = __ccgo_ts + 19409 default: - z = __ccgo_ts + 19315 + z = __ccgo_ts + 19416 break } return z @@ -120043,7 +114549,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19321, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19422, libc.VaList(bp+8, zUsage)) } /* @@ -120080,13 +114586,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19344 + v1 = __ccgo_ts + 19445 } else { v1 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19358, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19459, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19389, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19490, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -120110,11 +114616,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -120330,7 +114836,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1139 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16848 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16949 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -120443,7 +114949,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -120452,7 +114958,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -120476,13 +114982,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16848 + zCol = __ccgo_ts + 16949 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12570, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12624, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120490,7 +114996,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19435, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19536, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120544,7 +115050,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120582,7 +115088,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16848 + v3 = __ccgo_ts + 16949 } zName = v3 } else { @@ -120597,7 +115103,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19435, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19536, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120633,7 +115139,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19444, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19545, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120752,7 +115258,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != libc.Int32FromUint8(_sqlite3AffinityType(tls, zType, uintptr(0))) { if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19452 + zType = __ccgo_ts + 19553 } else { zType = uintptr(0) j = int32(1) @@ -120818,7 +115324,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -120846,7 +115352,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120896,7 +115402,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120919,7 +115425,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -121067,7 +115573,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19456, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19557, 0) return } /* Obtain authorization to do a recursive query */ @@ -121104,7 +115610,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -121115,7 +115621,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -121129,7 +115635,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -121160,7 +115666,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19505, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19606, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121175,7 +115681,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19547, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19648, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121203,7 +115709,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19553, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19654, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121258,9 +115764,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1665 } else { - v1 = __ccgo_ts + 19568 + v1 = __ccgo_ts + 19669 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19570, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19671, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -121368,8 +115874,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19593, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19608, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19694, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19709, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121394,7 +115900,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19288, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19389, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121420,7 +115926,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -121446,7 +115952,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19627, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19728, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121478,11 +115984,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121504,7 +116010,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19627, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19728, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121611,6 +116117,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121627,9 +116134,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19648, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19749, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19694, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19795, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121700,7 +116207,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19268, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19369, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121916,7 +116423,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -121948,7 +116455,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -122002,16 +116509,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7556) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7556) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7581) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7581) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -122029,32 +116536,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19776, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19877, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19787, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19888, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122067,7 +116574,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19792, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19893, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122277,11 +116784,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5153 + v1 = __ccgo_ts + 5179 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -122442,7 +116949,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122632,9 +117139,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122846,7 +117353,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122993,7 +117500,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -123232,18 +117739,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -123283,11 +117778,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -123352,7 +117847,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -123370,12 +117865,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123857,7 +118352,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123903,13 +118398,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15707) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15788) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15711) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15792) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123997,8 +118492,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19798, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19899, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -124022,7 +118517,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -124104,7 +118599,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -124122,7 +118617,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19816, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19917, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124270,7 +118765,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -124298,7 +118793,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19839, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19940, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124320,12 +118815,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19859, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19960, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -124342,7 +118837,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19902 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20003 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -124373,7 +118868,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19925, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20026, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -124382,9 +118877,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19963 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20064 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19997 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20098 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124433,7 +118928,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -124443,7 +118938,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20035, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20136, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124539,7 +119034,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124548,7 +119043,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124599,7 +119094,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20039, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20140, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124614,7 +119109,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20078, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20179, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124629,7 +119124,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15266, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15320, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124753,7 +119248,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6718 + v10 = __ccgo_ts + 6743 } zSchemaName = v10 } @@ -124770,7 +119265,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20109, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20210, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124849,7 +119344,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20114, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20215, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124862,7 +119357,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12570, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12624, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124882,9 +119377,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20123, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20224, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20242, 0) } } } @@ -124898,7 +119393,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20161, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20262, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125095,14 +119590,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -125111,7 +119606,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -125143,11 +119638,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125200,7 +119695,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -125237,12 +119732,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20192, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20293, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20243, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20344, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125263,7 +119758,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20276, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20377, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125402,7 +119897,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125510,7 +120005,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125554,7 +120049,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125577,7 +120072,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20309 + v1 = __ccgo_ts + 20410 } else { v1 = __ccgo_ts + 1665 } @@ -125586,7 +120081,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1665 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20332, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20433, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125618,7 +120113,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8319) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8344) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125747,6 +120242,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125775,7 +120271,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16001) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16102) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125808,9 +120304,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125820,13 +120316,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125846,7 +120342,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -126019,8 +120515,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -126029,11 +120525,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -126049,7 +120545,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -126073,14 +120569,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20344, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20445, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -126181,7 +120677,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20398, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20499, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -126382,14 +120878,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20438, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20539, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -126421,7 +120917,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -126436,7 +120932,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20453, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20554, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126490,7 +120986,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126523,7 +121019,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126582,7 +121078,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126611,6 +121107,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126633,10 +121136,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126670,8 +121173,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126686,8 +121189,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126716,8 +121219,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126734,7 +121237,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126747,11 +121250,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126785,49 +121288,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126835,16 +121339,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126862,11 +121366,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20469 + v47 = __ccgo_ts + 20570 } else { - v46 = __ccgo_ts + 20478 + v47 = __ccgo_ts + 20579 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19321, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19422, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126876,12 +121380,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126894,13 +121398,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126911,12 +121415,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126965,12 +121469,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -127040,9 +121548,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -127059,10 +121567,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -127089,8 +121597,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -127130,32 +121638,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -127197,7 +121705,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20469) + _explainTempTable(tls, pParse, __ccgo_ts+20570) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -127303,7 +121811,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -127319,7 +121827,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20487, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20588, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127409,7 +121917,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127571,7 +122079,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20552, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20653, 0) goto trigger_cleanup } iDb = int32(1) @@ -127611,7 +122119,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20598, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20699, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127621,11 +122129,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20606, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20707, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20647, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20748, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127634,13 +122142,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20598, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20699, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20687, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20788, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127648,8 +122156,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6653, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20713, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6678, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20814, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127657,15 +122165,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20751 + v1 = __ccgo_ts + 20852 } else { - v1 = __ccgo_ts + 20758 + v1 = __ccgo_ts + 20859 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20764, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20865, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20801, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20902, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127685,9 +122193,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6661 + v3 = __ccgo_ts + 6686 } else { - v3 = __ccgo_ts + 6149 + v3 = __ccgo_ts + 6173 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127787,7 +122295,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20598, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20699, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127809,7 +122317,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20847, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20948, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127825,10 +122333,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20895, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20996, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20970, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21071, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128096,11 +122604,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20999, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21100, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -128138,9 +122646,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6661 + v1 = __ccgo_ts + 6686 } else { - v1 = __ccgo_ts + 6149 + v1 = __ccgo_ts + 6173 } zTab = v1 if iDb == int32(1) { @@ -128155,7 +122663,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21019, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21120, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -128288,11 +122796,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21081 + v1 = __ccgo_ts + 21182 } else { - v1 = __ccgo_ts + 21088 + v1 = __ccgo_ts + 21189 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21095, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21196, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128394,7 +122902,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21244, 0) return int32(1) } @@ -128542,12 +123050,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128555,19 +123063,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128578,7 +123089,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128592,7 +123103,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128660,7 +123171,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6346, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6370, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128759,10 +123270,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21185, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21286, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128784,7 +123297,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -128856,7 +123369,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -129272,13 +123785,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -129286,21 +123799,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -129347,7 +123860,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -129386,7 +123899,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -129430,58 +123943,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21199, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21300, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21235, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21336, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8094 + v10 = __ccgo_ts + 8119 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129511,17 +124012,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129533,11 +124034,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129553,11 +124054,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129566,18 +124067,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129586,16 +124087,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129613,24 +124114,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129656,50 +124157,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -129997,8 +124498,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130048,8 +124549,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -130096,11 +124597,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -130112,11 +124613,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -130159,7 +124660,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21254) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21355) } goto update_cleanup update_cleanup: @@ -130216,13 +124717,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -130264,11 +124765,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130593,9 +125094,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]uint8)(unsafe.Pointer(bp + 200)))[0] = uint8(0) } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21267, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21368, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21271, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21372, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130684,13 +125185,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130698,7 +125199,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12659, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12713, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130780,7 +125281,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21344, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21348, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21445, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21449, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130871,7 +125372,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130910,17 +125411,17 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21352) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21453) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21392) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21493) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21435) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21536) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -130937,7 +125438,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21484) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21585) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130990,7 +125491,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15036) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15090) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131021,11 +125522,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21511, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21612, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21619, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21720, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131034,7 +125535,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21673, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21774, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -131044,7 +125545,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21810, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21911, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131135,39 +125636,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -131178,7 +125646,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -131187,7 +125655,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -131197,7 +125665,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -131222,15 +125690,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -131245,13 +125713,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131571,7 +126041,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12889, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12943, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131694,24 +126164,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21933, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22034, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21957, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22058, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22056, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22157, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131768,7 +126243,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131795,7 +126270,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22075, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22176, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131829,7 +126304,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131837,9 +126312,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22117, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22218, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3862, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3888, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -131852,7 +126327,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22147 + zFormat = __ccgo_ts + 22248 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131886,7 +126361,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16739, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16840, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131967,13 +126442,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22193, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22294, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3862, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3888, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -132054,7 +126529,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22193, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22294, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -132102,7 +126577,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22212, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22313, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132113,9 +126588,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132157,7 +126632,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3862 + v3 = __ccgo_ts + 3888 } else { v3 = uintptr(0) } @@ -132523,7 +126998,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132613,7 +127088,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132633,7 +127108,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3862, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3888, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132697,7 +127172,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132710,7 +127185,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132970,436 +127445,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff uint8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -133431,10 +127476,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22225 + return __ccgo_ts + 22326 } if i == -int32(1) { - return __ccgo_ts + 16848 + return __ccgo_ts + 16949 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133453,10 +127498,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22232, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22333, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22339, int32(1)) } i = 0 for { @@ -133464,7 +127509,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13279, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13333, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133473,11 +127518,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22339, int32(1)) } i = 0 for { @@ -133485,16 +127530,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13279, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13333, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } } @@ -133541,7 +127586,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133549,12 +127594,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22232, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22333, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22243 + v2 = __ccgo_ts + 22344 } else { - v2 = __ccgo_ts + 22248 + v2 = __ccgo_ts + 22349 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133571,7 +127616,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22256) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22357) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133582,9 +127627,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22258) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22359) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5199, int32(1)) } // C documentation @@ -133629,11 +127674,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22260 + v2 = __ccgo_ts + 22361 } else { - v2 = __ccgo_ts + 22267 + v2 = __ccgo_ts + 22368 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22272, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22373, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133646,37 +127691,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11442 + zFmt = __ccgo_ts + 11496 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22278 + zFmt = __ccgo_ts + 22379 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22311 + zFmt = __ccgo_ts + 22412 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22336 + zFmt = __ccgo_ts + 22437 } else { - zFmt = __ccgo_ts + 22354 + zFmt = __ccgo_ts + 22455 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22363, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22464, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16848 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22371, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16949 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22472, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = uint8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22402, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22503, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133686,14 +127731,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22412, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22513, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22417) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22518) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22439 + v3 = __ccgo_ts + 22540 } else { - v3 = __ccgo_ts + 22447 + v3 = __ccgo_ts + 22548 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133714,7 +127759,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22453, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22554, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133744,10 +127789,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133780,14 +127825,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22464, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22565, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22243, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22344, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22485, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22586, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133811,16 +127856,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22232, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22333, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22243, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22344, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5199, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -134025,7 +128070,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -134081,8 +128126,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -134104,7 +128149,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -134161,10 +128206,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -134219,37 +128264,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -134274,10 +128305,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -134296,24 +128327,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -134325,8 +128356,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -134384,7 +128415,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -134466,7 +128497,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134597,7 +128628,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -134734,7 +128765,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134879,7 +128910,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134940,11 +128971,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134975,6 +129006,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -135113,7 +129147,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -135193,7 +129227,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -135227,7 +129261,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -135349,7 +129383,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135542,7 +129576,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135556,12 +129590,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135599,11 +129634,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135623,7 +129658,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135659,21 +129694,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135691,7 +129726,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135746,7 +129781,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22493, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22594, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135769,7 +129804,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22508, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22609, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -136258,9 +130293,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -136269,14 +130304,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22517, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22618, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -136315,15 +130350,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -136335,7 +130371,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -136408,7 +130444,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -136806,19 +130842,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16697, + FzOp: __ccgo_ts + 16798, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16031, + FzOp: __ccgo_ts + 16132, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15510, + FzOp: __ccgo_ts + 15591, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22531, + FzOp: __ccgo_ts + 22632, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137338,37 +131374,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 uint8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if libc.Int32FromUint8(aff1) != libc.Int32FromUint8(aff2) && (!(libc.Int32FromUint8(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(libc.Int32FromUint8(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137606,7 +131646,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22538, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22639, 0) return } } else { @@ -137618,10 +131658,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22538, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22639, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137680,7 +131720,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137702,7 +131742,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8080 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8105 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137803,7 +131843,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22579 + v13 = __ccgo_ts + 22680 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138334,7 +132374,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22586, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22687, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -138406,22 +132446,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138534,7 +132562,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -139450,7 +133478,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141701,13 +135730,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141807,6 +135831,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141820,12 +135845,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -142271,7 +136313,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -142322,15 +136364,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -142362,7 +136395,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -142381,7 +136414,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -142418,7 +136451,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -142426,7 +136459,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -142447,19 +136480,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142555,7 +136588,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142733,7 +136766,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142761,6 +136794,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142837,7 +136878,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -143074,7 +137115,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22659, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22760, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143149,7 +137190,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22659, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22760, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143303,7 +137344,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143739,7 +137780,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22685, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22786, 0) rc = SQLITE_OK } else { break @@ -143968,17 +138009,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144947,7 +138977,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22720, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22821, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145525,7 +139555,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145681,7 +139711,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22738, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22839, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145702,11 +139732,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -145754,7 +139781,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22766, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22867, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145899,7 +139926,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -145933,7 +139961,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145955,7 +139983,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145968,7 +139996,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -146059,11 +140087,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -146090,16 +140118,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -146147,7 +140175,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -146278,7 +140306,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -146456,7 +140484,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146485,7 +140513,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146495,7 +140523,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22784, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22885, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146545,7 +140573,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146814,7 +140842,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22813, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22914, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146996,7 +141024,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22869, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22970, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147322,7 +141350,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22914, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23015, libc.VaList(bp+8, zName)) } return p } @@ -147373,12 +141401,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22933, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23034, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23004, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23105, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147451,7 +141479,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8319) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8344) } break } @@ -147482,16 +141510,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147510,17 +141528,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -147538,7 +141556,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147562,13 +141580,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147583,23 +141601,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147615,13 +141633,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147733,7 +141751,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23067, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23168, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147769,7 +141787,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147784,7 +141802,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147803,11 +141821,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147853,11 +141871,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147874,7 +141892,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1785)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1811)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147896,7 +141914,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -148020,7 +142038,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23093, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23194, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148088,18 +142106,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23125 + zErr = __ccgo_ts + 23226 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23142 + zErr = __ccgo_ts + 23243 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23158 + zErr = __ccgo_ts + 23259 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23178, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23279, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -148123,7 +142141,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23211, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23312, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148229,24 +142247,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -148264,12 +142282,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -148281,15 +142299,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -148341,11 +142359,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23258, - 1: __ccgo_ts + 23311, - 2: __ccgo_ts + 22813, - 3: __ccgo_ts + 23362, - 4: __ccgo_ts + 23414, + 0: __ccgo_ts + 23359, + 1: __ccgo_ts + 23412, + 2: __ccgo_ts + 22914, + 3: __ccgo_ts + 23463, + 4: __ccgo_ts + 23515, } var _aOp1 = [5]int32{ @@ -148398,87 +142416,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148925,7 +142862,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -149021,7 +142958,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -149738,12 +143675,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149751,13 +143688,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149777,13 +143714,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149810,7 +143747,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -150029,6 +143966,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -150089,7 +144030,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23464, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23565, libc.VaList(bp+8, p)) } // C documentation @@ -150103,6 +144044,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -150136,11 +144078,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23488 + v1 = __ccgo_ts + 23589 } else { - v1 = __ccgo_ts + 23497 + v1 = __ccgo_ts + 23598 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23503, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23604, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150149,7 +144091,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23646, 0) } } } @@ -150255,7 +144197,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23579, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23680, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156722,14 +150664,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156740,16 +150674,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -156776,13 +150700,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -157897,19 +151821,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158712,20 +152636,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16848, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16949, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23617, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23718, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16761, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16885, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23617, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23718, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158766,7 +152690,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158911,7 +152840,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -159001,9 +152935,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -159358,7 +153292,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23644) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23745) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159698,23 +153632,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8100 + } else { + v347 = __ccgo_ts + 8105 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8075 - } else { - v347 = __ccgo_ts + 8080 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -159772,11 +153720,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -159786,9 +153734,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -159796,11 +153744,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -159898,11 +153846,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159952,15 +153900,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23653, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23754, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23748, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23849, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23832, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23933, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160102,7 +154050,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -160296,7 +154244,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23917, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24018, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -162422,7 +156370,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -163027,14 +156975,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163896,22 +157847,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163922,11 +157882,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164505,7 +158465,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164525,7 +158485,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24004, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24105, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164650,11 +158610,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164826,14 +158786,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24547 + zErr = __ccgo_ts + 24648 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164845,31 +158805,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24072, - 1: __ccgo_ts + 24085, - 3: __ccgo_ts + 24101, - 4: __ccgo_ts + 24126, - 5: __ccgo_ts + 24140, - 6: __ccgo_ts + 24159, + 0: __ccgo_ts + 24173, + 1: __ccgo_ts + 24186, + 3: __ccgo_ts + 24202, + 4: __ccgo_ts + 24227, + 5: __ccgo_ts + 24241, + 6: __ccgo_ts + 24260, 7: __ccgo_ts + 1635, - 8: __ccgo_ts + 24184, - 9: __ccgo_ts + 24221, - 10: __ccgo_ts + 24233, - 11: __ccgo_ts + 24248, - 12: __ccgo_ts + 24281, - 13: __ccgo_ts + 24299, - 14: __ccgo_ts + 24324, - 15: __ccgo_ts + 24353, - 17: __ccgo_ts + 6104, - 18: __ccgo_ts + 5506, - 19: __ccgo_ts + 24370, - 20: __ccgo_ts + 24388, - 21: __ccgo_ts + 24406, - 23: __ccgo_ts + 24440, - 25: __ccgo_ts + 24461, - 26: __ccgo_ts + 24487, - 27: __ccgo_ts + 24510, - 28: __ccgo_ts + 24531, + 8: __ccgo_ts + 24285, + 9: __ccgo_ts + 24322, + 10: __ccgo_ts + 24334, + 11: __ccgo_ts + 24349, + 12: __ccgo_ts + 24382, + 13: __ccgo_ts + 24400, + 14: __ccgo_ts + 24425, + 15: __ccgo_ts + 24454, + 17: __ccgo_ts + 6128, + 18: __ccgo_ts + 5532, + 19: __ccgo_ts + 24471, + 20: __ccgo_ts + 24489, + 21: __ccgo_ts + 24507, + 23: __ccgo_ts + 24541, + 25: __ccgo_ts + 24562, + 26: __ccgo_ts + 24588, + 27: __ccgo_ts + 24611, + 28: __ccgo_ts + 24632, } // C documentation @@ -164963,15 +158923,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164979,6 +158941,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164986,10 +158950,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -165016,6 +158980,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -165043,12 +159021,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -165066,9 +159044,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -165091,13 +159069,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24628, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24729, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -165115,15 +159093,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -165138,27 +159116,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -165169,30 +159147,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -165217,7 +159225,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24691, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24792, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165248,13 +159256,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -165265,43 +159275,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -165312,12 +159326,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -165329,6 +159343,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -165336,82 +159352,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -165455,18 +159481,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165492,7 +159520,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165502,7 +159530,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24742, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24843, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165624,7 +159652,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165756,7 +159784,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165766,7 +159794,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165802,7 +159830,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165815,7 +159843,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165824,7 +159852,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24763, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24864, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165859,9 +159887,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165971,7 +159999,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24831, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || *(*Tu8)(unsafe.Pointer(uintptr(unsafe.Pointer(&_sqlite3Config)) + 6)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24932, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -166001,8 +160029,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24837, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24847, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24938, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24948, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166091,24 +160119,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24875, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24976, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24879, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24980, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24879 + zModeType = __ccgo_ts + 24980 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24900, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25001, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3471 + zModeType = __ccgo_ts + 3497 } if aMode != 0 { mode = 0 @@ -166137,12 +160165,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24915, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25016, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24935, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25036, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166166,7 +160194,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24959, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25060, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166186,11 +160214,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24885, + Fz: __ccgo_ts + 24986, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24892, + Fz: __ccgo_ts + 24993, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166201,19 +160229,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24905, + Fz: __ccgo_ts + 25006, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24908, + Fz: __ccgo_ts + 25009, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24911, + Fz: __ccgo_ts + 25012, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17918, + Fz: __ccgo_ts + 18019, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166341,8 +160369,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22579, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24975, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22680, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25076, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166363,10 +160391,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4257 + zFilename = __ccgo_ts + 4283 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -166375,7 +160403,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3862 + v2 = __ccgo_ts + 3888 } else { v2 = uintptr(0) } @@ -166402,9 +160430,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6713 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6738 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23977 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24078 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166498,7 +160526,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24981 + zFilename = __ccgo_ts + 25082 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166517,36 +160545,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166554,7 +160590,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166562,31 +160598,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166620,12 +160660,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166658,10 +160700,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166672,7 +160714,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166715,20 +160757,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24984, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25085, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25009) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25110) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25029) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25130) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25036) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25137) } // C documentation @@ -166753,9 +160795,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166782,29 +160824,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166859,15 +160890,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25053, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25154, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3862 + v2 = __ccgo_ts + 3888 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -167046,8 +161077,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167491,7 +161522,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -167887,7 +161918,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25081, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25182, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168035,6 +162066,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -168058,7 +162091,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -168068,7 +162101,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -168080,7 +162113,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -168096,7 +162129,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -168105,7 +162138,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25089 + v2 = __ccgo_ts + 25190 } else { v2 = uintptr(0) } @@ -168184,7 +162217,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -168351,7 +162384,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168568,6 +162601,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168880,8 +162920,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168938,7 +162978,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168948,7 +162988,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168986,18 +163026,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1651, - 1: __ccgo_ts + 8075, - 2: __ccgo_ts + 8080, - 3: __ccgo_ts + 6389, - 4: __ccgo_ts + 6389, - 5: __ccgo_ts + 6384, - 6: __ccgo_ts + 6384, - 7: __ccgo_ts + 8386, - 8: __ccgo_ts + 8386, - 9: __ccgo_ts + 8386, - 10: __ccgo_ts + 8386, - 11: __ccgo_ts + 25112, - 12: __ccgo_ts + 25118, + 1: __ccgo_ts + 8100, + 2: __ccgo_ts + 8105, + 3: __ccgo_ts + 6414, + 4: __ccgo_ts + 6414, + 5: __ccgo_ts + 6409, + 6: __ccgo_ts + 6409, + 7: __ccgo_ts + 8411, + 8: __ccgo_ts + 8411, + 9: __ccgo_ts + 8411, + 10: __ccgo_ts + 8411, + 11: __ccgo_ts + 25213, + 12: __ccgo_ts + 25219, 13: __ccgo_ts + 1665, 14: __ccgo_ts + 1665, 15: __ccgo_ts + 1665, @@ -169305,106 +163345,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]uint8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169484,7 +163424,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169782,8 +163722,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = uint8('u') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = uint8('0') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = uint8('0') - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25125 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25125 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1687 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -169919,7 +163859,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1651, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15480, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15534, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169933,14 +163873,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25142, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25226, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169994,7 +163932,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25255, -int32(1)) } } } @@ -170277,8 +164215,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25186, - FzRepl: __ccgo_ts + 25190, + FzMatch: __ccgo_ts + 25270, + FzRepl: __ccgo_ts + 25274, }, 1: { Fc1: uint8('i'), @@ -170286,8 +164224,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25198, - FzRepl: __ccgo_ts + 25190, + FzMatch: __ccgo_ts + 25282, + FzRepl: __ccgo_ts + 25274, }, 2: { Fc1: uint8('n'), @@ -170302,7 +164240,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25207, + FzMatch: __ccgo_ts + 25291, FzRepl: __ccgo_ts + 1651, }, 4: { @@ -170310,7 +164248,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25212, + FzMatch: __ccgo_ts + 25296, FzRepl: __ccgo_ts + 1651, }, } @@ -170326,7 +164264,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25217, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25301, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170344,23 +164282,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -170438,7 +164376,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170509,7 +164447,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170784,7 +164726,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25260, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25344, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -171214,7 +165156,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('0') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || libc.Int32FromUint8(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -171253,7 +165195,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8075, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8100, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171261,7 +165203,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8080, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8105, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -171338,14 +165280,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25186, int32(3)) == 0 { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25270, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25269) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25353) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25360) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25282, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25366, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171530,7 +165472,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25360) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171575,7 +165517,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*uint8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171588,7 +165530,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171637,10 +165579,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171674,15 +165612,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171755,11 +165693,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8075, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8100, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8080, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8105, uint32(5)) return i + uint32(1) _6: ; @@ -171808,9 +165746,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25190 + v19 = __ccgo_ts + 25274 } else { - v19 = __ccgo_ts + 11942 + v19 = __ccgo_ts + 11996 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171846,9 +165784,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, uint8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, uint8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = uint8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = uint8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171875,7 +165816,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25288, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25372, uint32(2)) zIn2++ sz2-- continue @@ -171898,7 +165839,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25291, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25375, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171906,12 +165847,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25298, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25382, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25303, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25387, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172014,16 +165955,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -172091,7 +166022,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25394, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172114,12 +166045,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25313, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25397, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25394, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172134,50 +166065,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -172229,6 +166116,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -172249,6 +166214,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -172321,9 +166289,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -172366,7 +166334,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172854,7 +166833,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172989,7 +166968,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -173090,7 +167069,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25255, -int32(1)) return } @@ -173127,11 +167106,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25142, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25226, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173144,7 +167120,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173163,10 +167139,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25360) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25269) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25353) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173205,7 +167181,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25316, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25400, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173221,7 +167197,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -173302,7 +167278,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173314,34 +167290,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -173424,7 +167420,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173484,7 +167480,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173619,7 +167615,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25334 + v1 = __ccgo_ts + 25418 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173629,7 +167625,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } eErr = uint8(1) @@ -173739,23 +167735,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25336, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25420, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5228, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5254, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1678, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1704, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25343, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25427, uint32(1)) } } } @@ -173795,7 +167791,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174063,7 +168059,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174087,7 +168083,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25345, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25429, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174098,7 +168094,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25396, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25480, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174170,7 +168166,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } goto json_remove_done @@ -174207,7 +168203,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15953) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16054) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174238,9 +168234,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25430 + v1 = __ccgo_ts + 25514 } else { - v1 = __ccgo_ts + 25434 + v1 = __ccgo_ts + 25518 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174288,7 +168284,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25171, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25255, -int32(1)) } } goto json_type_done @@ -174335,7 +168331,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25441 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25525 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -174409,17 +168405,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25446, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25530, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174428,18 +168423,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174501,9 +168495,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174610,7 +168602,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25503, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25587, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174702,20 +168694,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, uint8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, uint8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, uint8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, uint8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -174759,7 +168753,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25506, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25590, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174787,16 +168781,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -174815,24 +168799,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174840,13 +168806,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174862,7 +168821,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25509) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25593) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174996,7 +168955,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25592, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25676, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -175022,9 +168981,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25599, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25683, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25607, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25691, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175335,9 +169294,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -175410,7 +169368,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25613, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25697, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175434,7 +169392,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25171, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25255, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175495,186 +169453,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25615, + FzName: __ccgo_ts + 25699, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25620, + FzName: __ccgo_ts + 25704, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25626, + FzName: __ccgo_ts + 25710, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25637, + FzName: __ccgo_ts + 25721, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25649, + FzName: __ccgo_ts + 25733, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25649, + FzName: __ccgo_ts + 25733, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25667, + FzName: __ccgo_ts + 25751, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25687, + FzName: __ccgo_ts + 25771, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25700, + FzName: __ccgo_ts + 25784, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25714, + FzName: __ccgo_ts + 25798, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25717, + FzName: __ccgo_ts + 25801, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25721, + FzName: __ccgo_ts + 25805, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25733, + FzName: __ccgo_ts + 25817, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25746, + FzName: __ccgo_ts + 25830, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25758, + FzName: __ccgo_ts + 25842, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25771, + FzName: __ccgo_ts + 25855, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25782, + FzName: __ccgo_ts + 25866, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25794, + FzName: __ccgo_ts + 25878, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25794, + FzName: __ccgo_ts + 25878, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25806, + FzName: __ccgo_ts + 25890, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25817, + FzName: __ccgo_ts + 25901, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25829, + FzName: __ccgo_ts + 25913, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25842, + FzName: __ccgo_ts + 25926, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25855, + FzName: __ccgo_ts + 25939, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25869, + FzName: __ccgo_ts + 25953, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25878, + FzName: __ccgo_ts + 25962, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25888, + FzName: __ccgo_ts + 25972, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25888, + FzName: __ccgo_ts + 25972, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25898, + FzName: __ccgo_ts + 25982, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25898, + FzName: __ccgo_ts + 25982, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25909, + FzName: __ccgo_ts + 25993, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25926, + FzName: __ccgo_ts + 26010, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25944, + FzName: __ccgo_ts + 26028, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25962, + FzName: __ccgo_ts + 26046, }, } @@ -175757,17 +169715,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25981, + FzName: __ccgo_ts + 26065, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25991, + FzName: __ccgo_ts + 26075, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175817,224 +169777,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -176052,33 +169797,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -176089,79 +169828,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -176345,7 +170069,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -176408,7 +170132,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26001, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26085, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176419,7 +170143,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176713,7 +170437,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26006, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26090, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -177255,7 +170979,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177635,7 +171359,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26088) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26172) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177713,7 +171437,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -177952,7 +171676,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -178612,7 +172336,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -179121,9 +172845,9 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } f = float32(d * v1) } @@ -179138,9 +172862,9 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } f = float32(d * v1) } @@ -179170,7 +172894,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26102, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26186, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -179180,11 +172904,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26122, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26206, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26154, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26238, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179398,7 +173122,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26191, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26275, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -179452,9 +173176,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26336 + zFmt = __ccgo_ts + 26420 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11771, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11825, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179512,9 +173236,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26392, - 1: __ccgo_ts + 5567, - 2: __ccgo_ts + 16848, + 0: __ccgo_ts + 26476, + 1: __ccgo_ts + 5593, + 2: __ccgo_ts + 16949, } var _rtreeModule = Tsqlite3_module{ @@ -179558,21 +173282,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26806, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26890, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26868, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26952, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26873, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26937, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27007, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26957, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27021, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27091, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179602,7 +173326,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27056 + zFormat = __ccgo_ts + 27140 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179617,31 +173341,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27164, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27248, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27209, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27293, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13279, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13333, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27236, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27320, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27258, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27342, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27266, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27350, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179655,14 +173379,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26397, - 1: __ccgo_ts + 26450, - 2: __ccgo_ts + 26495, - 3: __ccgo_ts + 26547, - 4: __ccgo_ts + 26601, - 5: __ccgo_ts + 26646, - 6: __ccgo_ts + 26704, - 7: __ccgo_ts + 26759, + 0: __ccgo_ts + 26481, + 1: __ccgo_ts + 26534, + 2: __ccgo_ts + 26579, + 3: __ccgo_ts + 26631, + 4: __ccgo_ts + 26685, + 5: __ccgo_ts + 26730, + 6: __ccgo_ts + 26788, + 7: __ccgo_ts + 26843, } // C documentation @@ -179720,7 +173444,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27282, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27366, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179728,17 +173452,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27302, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27386, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179801,7 +173525,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -179815,13 +173539,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27545, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27629, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27551, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27635, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -179830,7 +173554,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27575, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27659, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179844,19 +173568,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27602, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27686, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179879,7 +173603,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179890,7 +173614,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179906,8 +173630,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27581, - 1: __ccgo_ts + 27592, + 0: __ccgo_ts + 27665, + 1: __ccgo_ts + 27676, } // C documentation @@ -179965,21 +173689,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11391, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11445, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27605, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27689, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27611, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27695, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27615, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27699, int32(1)) goto _1 _1: ; @@ -180006,7 +173730,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27617, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27701, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180040,23 +173764,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -180109,7 +173816,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -180124,11 +173831,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4270 + v1 = __ccgo_ts + 4296 } else { v1 = __ccgo_ts + 1665 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27650, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27734, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -180162,7 +173869,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27657, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27741, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -180179,7 +173886,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27702, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27786, libc.VaList(bp+8, iNode)) } } return pRet @@ -180208,8 +173915,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27734, - 1: __ccgo_ts + 27788, + 0: __ccgo_ts + 27818, + 1: __ccgo_ts + 27872, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -180222,21 +173929,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27836 + v1 = __ccgo_ts + 27920 } else { - v1 = __ccgo_ts + 27844 + v1 = __ccgo_ts + 27928 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27853, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27937, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27836 + v2 = __ccgo_ts + 27920 } else { - v2 = __ccgo_ts + 27844 + v2 = __ccgo_ts + 27928 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27898, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27982, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180281,7 +173988,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27956, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28040, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180299,7 +174006,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28004, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28088, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180332,19 +174039,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28071, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28155, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28105, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28189, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28135, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180389,12 +174096,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28190, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28274, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28305, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180423,7 +174130,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28288, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28372, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180433,11 +174140,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26102, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26186, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28316, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28400, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -180453,8 +174160,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28347, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28354, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28431, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28438, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180481,7 +174188,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28362, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28446, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180532,13 +174239,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28381, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28465, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6713 + zDb = __ccgo_ts + 6738 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180547,7 +174254,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18615 + v1 = __ccgo_ts + 18716 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180641,14 +174348,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180673,16 +174372,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180814,7 +174503,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -180859,7 +174548,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && libc.Int32FromUint8(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -180921,7 +174610,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))< int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -181391,7 +175080,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -181465,13 +175154,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181532,7 +175214,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181675,7 +175357,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181706,36 +175388,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -182200,7 +175852,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -182212,13 +175864,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27545, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27629, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28505, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28589, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -182227,13 +175879,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28527, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28611, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27602, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27686, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182241,7 +175893,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -182256,7 +175908,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182468,7 +176120,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16848 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16949 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -182478,7 +176130,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28531 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28615 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182486,7 +176138,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28537 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28621 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182606,7 +176258,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28546, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28630, 0) } goto geopoly_update_end } @@ -182706,16 +176358,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28586) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28670) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28602) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28686) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182785,7 +176437,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28779, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28863, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182799,61 +176451,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28617, + FzName: __ccgo_ts + 28701, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28630, + FzName: __ccgo_ts + 28714, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28643, + FzName: __ccgo_ts + 28727, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28656, + FzName: __ccgo_ts + 28740, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28602, + FzName: __ccgo_ts + 28686, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28668, + FzName: __ccgo_ts + 28752, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28586, + FzName: __ccgo_ts + 28670, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28691, + FzName: __ccgo_ts + 28775, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28705, + FzName: __ccgo_ts + 28789, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28718, + FzName: __ccgo_ts + 28802, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28732, + FzName: __ccgo_ts + 28816, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28748, + FzName: __ccgo_ts + 28832, }, } @@ -182879,7 +176531,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28760, + FzName: __ccgo_ts + 28844, }, } @@ -182904,20 +176556,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28787, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28871, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28797, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28881, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28808, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28892, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28531, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28615, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28819, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28903, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182991,7 +176643,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -183019,17 +176671,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26088, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26172, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -183037,33 +176691,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -183260,7 +176918,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183681,248 +177339,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]uint8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -184236,7 +177652,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28829, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28913, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184246,7 +177662,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28829, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28913, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184272,7 +177688,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -184295,7 +177711,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -184427,7 +177843,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28850, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28934, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184516,7 +177932,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26001, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26085, zIn, uint64(4)) == 0 { i = int32(4) for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184553,13 +177969,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29021 + v1 = __ccgo_ts + 29105 } else { v1 = __ccgo_ts + 1665 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29062, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29146, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29212) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29296) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184726,7 +178142,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184787,7 +178203,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29337, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29421, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184797,7 +178213,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29456, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29540, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184805,7 +178221,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29477, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29561, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184817,7 +178233,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29528, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29612, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184861,7 +178277,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29549, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29633, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184874,7 +178290,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -184927,7 +178343,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20123, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20224, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184938,7 +178354,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29606, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29690, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184949,7 +178365,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29625, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29709, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -184957,7 +178373,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29630, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29714, zName) { bRbuRowid = int32(1) } } @@ -184971,17 +178387,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29640 + v4 = __ccgo_ts + 29724 } else { - v4 = __ccgo_ts + 29653 + v4 = __ccgo_ts + 29737 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29662, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29746, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29691, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29775, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185003,7 +178419,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29713, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29797, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -185049,8 +178465,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29740, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29824, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15201 goto _1 _1: ; @@ -185084,7 +178500,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29749, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29833, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185132,21 +178548,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29762, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29846, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29794, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29878, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15147, __ccgo_ts+29817) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29823, __ccgo_ts+29830, __ccgo_ts+5173) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15147, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15201, __ccgo_ts+29901) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29907, __ccgo_ts+29914, __ccgo_ts+5199) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15201, __ccgo_ts+1665) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29838, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29922, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29964, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185198,7 +178614,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1665 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -185220,15 +178636,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29900 + zCol = __ccgo_ts + 29984 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29908, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29929, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29965, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15147 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29992, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30013, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30049, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15201 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185237,7 +178653,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29992, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30076, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { zSep = __ccgo_ts + 1665 iCol = 0 @@ -185254,15 +178670,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30040, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15147 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30124, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15201 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30047, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30131, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185320,7 +178736,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1665 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185329,7 +178745,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30059, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30143, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) zType = __ccgo_ts + 1665 } else { if iCid < 0 { @@ -185349,9 +178765,9 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29900 + zCol = __ccgo_ts + 29984 } else { - zCol = __ccgo_ts + 29630 + zCol = __ccgo_ts + 29714 } } zType = __ccgo_ts + 1139 @@ -185359,24 +178775,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30081, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30165, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29817 + v2 = __ccgo_ts + 29901 } else { v2 = __ccgo_ts + 1665 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30101, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30185, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30122, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30155, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30206, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30239, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15147 - zAnd = __ccgo_ts + 22232 + zCom = __ccgo_ts + 15201 + zAnd = __ccgo_ts + 22333 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185430,11 +178846,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30179, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30263, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30191, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30275, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15147 + zS = __ccgo_ts + 15201 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185446,7 +178862,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30200, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30284, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185472,7 +178888,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30215, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30299, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { zSep = __ccgo_ts + 1665 @@ -185482,15 +178898,15 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30229, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22232 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30313, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22333 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30241, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30325, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1665 i1 = 0 @@ -185500,8 +178916,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30291, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22232 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30375, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22333 } goto _2 _2: @@ -185524,7 +178940,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30304, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30388, 0) } // C documentation @@ -185566,16 +178982,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if libc.Int32FromUint8(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30291, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30375, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15201 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30330, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30414, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15201 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30360, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15147 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30444, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15201 } } } @@ -185659,16 +179075,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30397 + zSep = __ccgo_ts + 30481 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29549, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29633, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16736) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16837) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, zIdx))) } break } @@ -185679,16 +179095,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29817 + v1 = __ccgo_ts + 29901 } else { v1 = __ccgo_ts + 1665 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30410, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15147 + z = _rbuMPrintf(tls, p, __ccgo_ts+30494, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15201 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30421, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185734,7 +179150,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30425) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30509) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185742,7 +179158,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29577, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29661, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -185751,21 +179167,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30475, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30559, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29817 + v1 = __ccgo_ts + 29901 } else { v1 = __ccgo_ts + 1665 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30497, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15147 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30581, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15201 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30591, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30522, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30606, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, 0)) } } @@ -185802,7 +179218,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1665 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185811,19 +179227,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1665 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30584 + zPk = __ccgo_ts + 30668 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30597 + v2 = __ccgo_ts + 30681 } else { v2 = __ccgo_ts + 1665 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30607, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15147 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30691, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15201 goto _1 _1: ; @@ -185832,17 +179248,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30634, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30718, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30641 + v3 = __ccgo_ts + 30725 } else { v3 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30656, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30740, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, 0)) } } @@ -185868,7 +179284,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30688, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30772, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185914,7 +179330,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30745) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30829) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -186083,7 +179499,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30811, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30895, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186100,18 +179516,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30831, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30915, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30896, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30980, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30932, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31016, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186126,26 +179542,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30966 + v2 = __ccgo_ts + 31050 } else { - v2 = __ccgo_ts + 30970 + v2 = __ccgo_ts + 31054 } v1 = v2 } else { v1 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30976, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31060, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31037, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31121, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30966 + v3 = __ccgo_ts + 31050 } else { - v3 = __ccgo_ts + 30970 + v3 = __ccgo_ts + 31054 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31098, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31182, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186164,8 +179580,8 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6724) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6720) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6749) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6745) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -186174,39 +179590,39 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { v4 = __ccgo_ts + 1665 } else { - v4 = __ccgo_ts + 31257 + v4 = __ccgo_ts + 31341 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31266 + v5 = __ccgo_ts + 31350 } else { v5 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31276, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31360, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31312, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31396, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { zRbuRowid = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31340 + zRbuRowid = __ccgo_ts + 31424 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31352 + v6 = __ccgo_ts + 31436 } else { v6 = __ccgo_ts + 1665 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31369, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31445, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31453, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31529, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31744, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31828, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186217,9 +179633,9 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31843 + v7 = __ccgo_ts + 31927 } else { - v7 = __ccgo_ts + 31853 + v7 = __ccgo_ts + 31937 } zRbuRowid1 = v7 } @@ -186232,14 +179648,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29900, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29984, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15147, __ccgo_ts+1665) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1665, __ccgo_ts+15201, __ccgo_ts+1665) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31864 + v8 = __ccgo_ts + 31948 } else { v8 = __ccgo_ts + 1665 } @@ -186249,11 +179665,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1665 } if zOrder != 0 { - v10 = __ccgo_ts + 23488 + v10 = __ccgo_ts + 23589 } else { v10 = __ccgo_ts + 1665 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31870, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31954, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186341,9 +179757,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1665 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31257 + zPrefix = __ccgo_ts + 31341 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31918, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32002, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -186370,7 +179786,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -186417,7 +179833,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31948, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32032, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -186476,27 +179892,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31978, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32062, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32006, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3485, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32090, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3511, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6713, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6738, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32024, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32108, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186529,10 +179945,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32090, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32174, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24831, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24932, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186548,14 +179964,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 32122 + v2 = __ccgo_ts + 32206 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1665 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32124, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32208, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186566,27 +179982,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32156, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32240, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32171, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32255, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32188, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32272, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32204, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32288, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32232, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32316, 0) } } @@ -186636,7 +180052,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186738,7 +180154,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186768,7 +180184,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -186811,12 +180227,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186838,21 +180254,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186869,7 +180285,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32285, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32369, 0) } // C documentation @@ -186886,13 +180302,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6713) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6738) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32310, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32317, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32394, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32401, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187024,7 +180440,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24388, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24489, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187160,7 +180576,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32324) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32408) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -187173,7 +180589,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32346, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32430, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187200,7 +180616,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32373, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32457, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -187236,9 +180652,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32533, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32617, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32548, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32632, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187261,9 +180677,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32568, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32652, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32593) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32677) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187274,10 +180690,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32701) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32785) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32766) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32850) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187295,7 +180711,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32810, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32894, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187322,8 +180738,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17821) - _rbuCopyPragma(tls, p, __ccgo_ts+16932) + _rbuCopyPragma(tls, p, __ccgo_ts+17922) + _rbuCopyPragma(tls, p, __ccgo_ts+17033) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187331,7 +180747,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32835, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32919, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187353,10 +180769,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187370,10 +180786,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -187443,7 +180859,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32863, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32947, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187466,10 +180882,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32310, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32394, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6713, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6738, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187491,7 +180907,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]uint8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32888, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32972, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187538,7 +180954,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32899, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32983, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187583,11 +180999,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32971, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33055, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32985) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33069) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187596,7 +181012,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33042) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33126) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187644,7 +181060,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3862, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3888, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187676,7 +181092,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33116, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33200, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187698,17 +181114,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33148 + v3 = __ccgo_ts + 33232 } else { - v3 = __ccgo_ts + 33155 + v3 = __ccgo_ts + 33239 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33162, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33246, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15036, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15090, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187720,21 +181136,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17535) - _rbuCopyPragma(tls, p, __ccgo_ts+16947) + _rbuCopyPragma(tls, p, __ccgo_ts+17636) + _rbuCopyPragma(tls, p, __ccgo_ts+17048) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33194, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33278, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6713, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6738, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33210, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33294, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187812,7 +181228,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33234, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33318, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187859,7 +181275,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31257, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31341, uint64(8)) == 0 { nDel = int32(8) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187887,16 +181303,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15051, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15105, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187906,7 +181322,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33242, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33326, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188007,32 +181423,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15051, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15105, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15051, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15105, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15036 + v1 = __ccgo_ts + 15090 } else { - v1 = __ccgo_ts + 33194 + v1 = __ccgo_ts + 33278 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33194, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33278, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188058,9 +181474,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -188132,7 +181550,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -188335,7 +181753,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -188386,14 +181804,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189969,7 +183326,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33337, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33421, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -189992,13 +183349,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33345 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33429 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33354 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33438 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33359 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33443 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190007,7 +183364,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -190096,12 +183453,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33369, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33453, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33524, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33608, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33538, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33622, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190178,7 +183535,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33553, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33637, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -190318,315 +183675,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -191379,7 +184427,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -191472,11 +184520,11 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11771, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11825, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33560, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33644, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1665, 0) @@ -191485,7 +184533,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33690, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33774, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191511,10 +184559,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29900)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29984))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -191535,8 +184583,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29900) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29900, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29984) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29984, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191600,7 +184648,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191617,6 +184665,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191638,12 +184688,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11771, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11825, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -191933,10 +184983,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11391 + zSep = __ccgo_ts + 11445 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33720, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33804, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191948,8 +184998,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1666 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5143, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15147 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5169, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15201 goto _1 _1: ; @@ -192030,13 +185080,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -192528,14 +185571,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192603,8 +185638,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33727, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22232 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33811, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22333 if zRet == uintptr(0) { break } @@ -192633,8 +185668,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33761, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33802 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33845, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33886 if zRet == uintptr(0) { break } @@ -192645,7 +185680,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1785, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1811, 0) } return zRet } @@ -192656,12 +185691,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33807 + v1 = __ccgo_ts + 33891 } else { - v1 = __ccgo_ts + 6718 + v1 = __ccgo_ts + 6743 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33818, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33902, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192722,11 +185757,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15147 + v2 = __ccgo_ts + 15201 } else { v2 = __ccgo_ts + 1665 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33897, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33981, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -192754,7 +185789,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33916, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34000, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192783,17 +185818,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -192806,7 +185842,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -192817,18 +185855,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34057, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34088, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192854,7 +185918,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33973, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34109, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192902,7 +185966,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -193014,15 +186078,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -193186,7 +186252,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]uint8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5205, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5231, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193486,12 +186552,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34000, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11771, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34004, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34028, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34037, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34082, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34136, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11825, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34140, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34164, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34173, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34218, bp) } else { i = 0 for { @@ -193499,17 +186565,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15147, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15201, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15147 + zSep = __ccgo_ts + 15201 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34096, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34232, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34100, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34236, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193523,7 +186589,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1665 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34127, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34263, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193644,7 +186710,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193658,14 +186724,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34169, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34305, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193734,8 +186800,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193760,18 +186826,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34189, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34325, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193795,28 +186861,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193955,7 +187025,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193970,9 +187040,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -194001,20 +187071,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -194026,13 +187100,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -194188,7 +187263,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194212,7 +187287,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194227,7 +187302,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194283,7 +187358,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194388,7 +187463,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194459,8 +187534,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194494,7 +187569,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194504,7 +187579,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194583,7 +187658,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194844,7 +187919,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194921,7 +187996,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -194993,11 +188068,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -195009,8 +188084,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -195038,12 +188113,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -195051,9 +188130,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -195066,14 +188145,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -195097,29 +188168,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -195196,7 +188244,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11771) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11825) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195205,9 +188253,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34207, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34343, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34220, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34356, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195217,9 +188265,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34226, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34362, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15147 + zSep = __ccgo_ts + 15201 } goto _2 _2: @@ -195228,7 +188276,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1665 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34367, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195237,13 +188285,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34239, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34375, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34314, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34450, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22333 } goto _3 _3: @@ -195330,9 +188378,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34320, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34456, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34231, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34367, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195342,9 +188390,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34226, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34362, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22232 + zSep = __ccgo_ts + 22333 } goto _1 _1: @@ -195352,9 +188400,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34338, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34474, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33802, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+33886, bp) zSep = __ccgo_ts + 1665 i = 0 for { @@ -195364,16 +188412,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34314, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34450, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34346 + zSep = __ccgo_ts + 34482 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5173, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5199, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -195399,7 +188447,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6713, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6738, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -195422,16 +188470,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34351, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34487, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22238, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22339, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15147, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15201, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195439,19 +188487,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34505, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34380, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34516, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5173, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5199, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -195474,12 +188522,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11771, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11825, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34384) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34520) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34497) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34633) } return rc } @@ -195523,7 +188571,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195541,11 +188589,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195722,7 +188770,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -195746,7 +188794,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195761,7 +188809,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195812,7 +188860,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -195852,10 +188900,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195893,11 +188941,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195920,7 +188968,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195939,7 +188987,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195948,7 +188996,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195958,10 +189006,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34641, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34777, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195971,10 +189019,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34662, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34798, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195987,7 +189035,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -196014,7 +189062,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -196042,7 +189090,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -196074,15 +189122,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34681, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34817, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34707, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34843, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -196106,9 +189154,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -196118,7 +189166,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6713, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6738, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -196137,18 +189185,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34737, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34873, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34781, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34917, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34852, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34988, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11771) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11825) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196182,7 +189230,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -196191,7 +189239,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -196199,23 +189247,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34912, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35048, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34942, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35078, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34966, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34942, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35102, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35078, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196238,13 +189286,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -196253,11 +189305,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196265,10 +189321,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196276,37 +189338,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -196329,7 +189383,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196699,7 +189753,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -196882,7 +189936,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -196917,8 +189971,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -196937,9 +189991,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -196991,7 +190045,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -197027,11 +190081,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -197044,18 +190104,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -197063,13 +190125,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -197111,12 +190175,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -197124,27 +190194,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -197299,7 +190360,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -197407,8 +190468,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -197420,9 +190481,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -197496,21 +190557,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197616,6 +190681,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197661,24 +190727,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197737,99 +190791,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -197851,14 +190812,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -197870,29 +190823,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197948,15 +190884,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197978,14 +190905,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -198056,7 +190975,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198084,27 +191002,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -198135,7 +191044,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198671,14 +191580,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198689,16 +191590,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198750,10 +191641,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198859,12 +191750,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198939,7 +191830,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34994, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35130, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199295,7 +192186,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35022, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35158, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -199465,18 +192356,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199559,22 +192438,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199593,7 +192456,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35053, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35189, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199692,7 +192555,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35060 + zErr = __ccgo_ts + 35196 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199752,16 +192615,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199780,7 +192633,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -199947,7 +192800,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35110 + zErr = __ccgo_ts + 35246 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200129,15 +192982,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -200218,7 +193062,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -200342,13 +193186,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35158 + z = __ccgo_ts + 35294 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35214 + z1 = __ccgo_ts + 35350 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200381,19 +193225,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35272, + FzFunc: __ccgo_ts + 35408, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35280, + FzFunc: __ccgo_ts + 35416, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35290, + FzFunc: __ccgo_ts + 35426, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35295, + FzFunc: __ccgo_ts + 35431, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200781,7 +193625,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) (r int32) { var aBareword [128]Tu8 @@ -200868,21 +193712,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -201191,13 +194020,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -201257,7 +194079,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35311, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35447, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -201283,12 +194105,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32('0') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35318, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35454, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35349, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35485, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201297,7 +194119,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35382, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35518, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201307,14 +194129,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35419, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35555, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35428, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35564, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201341,7 +194163,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35461, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35597, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201353,76 +194175,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35495, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35631, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35503, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35639, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*uint8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35535, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35671, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35541, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35677, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35560, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35696, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35603, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35739, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35560, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35696, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35625, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35761, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35639, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35775, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35677, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35813, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35688, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35824, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35723, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35859, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35730, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35866, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5582, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5608, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8407, + FzName: __ccgo_ts + 8432, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17901, + FzName: __ccgo_ts + 18002, }, 2: { - FzName: __ccgo_ts + 35761, + FzName: __ccgo_ts + 35897, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201430,20 +194252,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35769, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35905, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35800, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35936, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35810, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35946, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35844, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35980, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201504,16 +194326,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35872) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16848) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35877, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36008) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16949) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36013, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35907) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36043) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35917, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36053, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201539,7 +194361,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35948, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36084, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201547,12 +194369,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35953, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36089, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35960, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36096, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36104, 0) } } goto _1 @@ -201568,9 +194390,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35975, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36111, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35968, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36104, 0) } goto _2 _2: @@ -201633,8 +194455,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35872) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35983, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36008) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36119, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201665,7 +194487,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36012, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36148, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201695,7 +194517,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36032, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36168, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201703,37 +194525,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36082, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36218, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36137, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36273, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35495 + zTail = __ccgo_ts + 35631 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35495 + zTail = __ccgo_ts + 35631 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36190 + zTail = __ccgo_ts + 36326 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36198, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36334, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16848, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16949, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201802,7 +194624,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36209, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36345, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201811,16 +194633,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1665 } else { - v2 = __ccgo_ts + 15147 + v2 = __ccgo_ts + 15201 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36225, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36361, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36232, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35872)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36368, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36008)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201853,7 +194675,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201863,9 +194685,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201978,7 +194800,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36258) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36394) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201989,7 +194811,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36263) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36399) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202000,7 +194822,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36272) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36408) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202014,7 +194836,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36282) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36418) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202025,7 +194847,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36292) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36428) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202042,7 +194864,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36304) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36440) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202057,7 +194879,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35872) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36008) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202072,7 +194894,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36316) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36452) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202088,7 +194910,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36330) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36466) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202131,7 +194953,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36340 + zSelect = __ccgo_ts + 36476 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202151,7 +194973,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36372) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36508) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202162,7 +194984,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36380, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36516, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202227,112 +195049,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -202408,7 +195124,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36451, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36587, 0) return FTS5_EOF } goto _1 @@ -202419,7 +195135,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36471, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36607, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202434,13 +195150,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36502, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36638, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36505, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36641, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30966, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31050, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202484,7 +195200,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -203017,16 +195733,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -203051,14 +195757,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -204123,7 +196821,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204133,7 +196831,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204179,14 +196877,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -204239,12 +196929,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -204378,7 +197068,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -204418,15 +197108,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -204467,7 +197157,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -204505,8 +197195,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36509, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35022, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36645, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35158, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204526,10 +197216,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if libc.Int32FromUint8(c) < int32('0') || libc.Int32FromUint8(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36514, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36650, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204563,7 +197256,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204613,7 +197306,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204664,7 +197357,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21235, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21336, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204691,7 +197384,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -204788,7 +197481,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36543, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36679, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204873,7 +197566,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204886,7 +197579,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204960,7 +197653,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204986,11 +197679,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36596 + v2 = __ccgo_ts + 36732 } else { - v2 = __ccgo_ts + 36509 + v2 = __ccgo_ts + 36645 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36603, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36739, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205003,7 +197696,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36653, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36789, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205124,14 +197817,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -205147,7 +197832,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -205171,14 +197856,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -205480,7 +198157,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205543,67 +198220,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205741,7 +198358,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -206053,7 +198670,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -206485,9 +199102,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -206524,7 +199141,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206597,7 +199213,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206632,7 +199247,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206647,149 +199261,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206797,187 +199275,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -207157,7 +199455,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36706, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36842, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -207262,7 +199560,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36712, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36848, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207291,7 +199589,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36763, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36899, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207325,7 +199623,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36812, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36948, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -207403,7 +199701,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -207494,7 +199792,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36852, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36988, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207505,7 +199803,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36852, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36988, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -208186,7 +200484,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -208431,15 +200729,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208540,7 +200838,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -209146,7 +201444,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36880, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37016, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209235,7 +201533,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36964, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37100, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209882,7 +202180,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -209908,14 +202206,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209925,15 +202215,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -210047,7 +202328,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -210068,7 +202349,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210792,7 +203073,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -211206,7 +203487,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37046, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37182, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211661,13 +203942,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211712,7 +203986,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37103, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37239, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211881,7 +204155,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -212199,7 +204473,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37164, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37300, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -212474,7 +204748,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212509,7 +204783,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -212788,16 +205062,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -213015,7 +205279,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -213052,7 +205316,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -213063,70 +205327,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -213195,7 +205396,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -213294,14 +205495,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -213348,19 +205541,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -213439,7 +205619,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -213489,7 +205669,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213571,15 +205751,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1665, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213605,11 +205788,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37215, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37351, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26001, __ccgo_ts+37223, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26085, __ccgo_ts+37359, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11982, __ccgo_ts+37258, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12036, __ccgo_ts+37394, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213807,7 +205990,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -214062,7 +206245,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37302) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37438) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214413,7 +206596,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214535,7 +206718,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214655,7 +206838,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36706, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36842, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -215249,7 +207432,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37304, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37440, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -215480,7 +207663,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37390) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37526) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215619,7 +207802,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215674,87 +207856,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215762,96 +207863,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -216102,7 +208113,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37395, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37531, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216139,7 +208150,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5205, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5231, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -216158,7 +208169,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*uint8)(unsafe.Pointer(idxStr + uintptr(v5))) = libc.Uint8FromInt32(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5205, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5231, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216608,7 +208619,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216636,7 +208647,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3862, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3888, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216656,7 +208667,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216671,7 +208682,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15147 + v1 = __ccgo_ts + 15201 } else { v1 = __ccgo_ts + 1665 } @@ -216681,11 +208692,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1665 } if bDesc != 0 { - v3 = __ccgo_ts + 37434 + v3 = __ccgo_ts + 37570 } else { - v3 = __ccgo_ts + 37439 + v3 = __ccgo_ts + 37575 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37443, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37579, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216743,14 +208754,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37498, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37634, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5564, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5590, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37504, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37640, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216800,7 +208811,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37532, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37668, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -216833,7 +208844,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37542, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37678, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216867,7 +208878,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37563, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37699, libc.VaList(bp+24, z)) } } } else { @@ -216875,7 +208886,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35290 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35426 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217032,7 +209043,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37596, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37732, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -217232,7 +209243,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37601, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37737, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -217365,10 +209376,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219904,12 +211852,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39086, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39054, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39190, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39092, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39228, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219918,7 +211866,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39130, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39266, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219930,14 +211878,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26001, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11982, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38284, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26085, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12036, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38420, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36190, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36326, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35495, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35631, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219957,13 +211905,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30641 + v1 = __ccgo_ts + 30725 } else { v1 = __ccgo_ts + 1665 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39172, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39308, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39202, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39338, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220004,7 +211952,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39246, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39382, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220012,7 +211960,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39269, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39405, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220027,7 +211975,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39275, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39411, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220036,22 +211984,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35495, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35631, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39281 + zCols = __ccgo_ts + 39417 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39313 + zCols = __ccgo_ts + 39449 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36190, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36326, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38284, __ccgo_ts+39361, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38420, __ccgo_ts+39497, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36372, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36508, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220096,14 +212044,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -220173,14 +212113,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -220208,6 +212148,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -220220,11 +212161,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -220237,6 +212191,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -220471,12 +212426,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39378, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39514, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39428, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39564, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39457, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39593, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -220484,7 +212439,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36372, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36508, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220786,7 +212741,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39486, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39622, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220819,17 +212774,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -220916,7 +212860,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -221018,14 +212962,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35495, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35631, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221677,11 +213603,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39540 + zCat = __ccgo_ts + 39676 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221691,7 +213617,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39549) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39685) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221708,20 +213634,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39560) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39696) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39518) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39654) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39529) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39665) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39549) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39685) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -221757,7 +213683,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -221944,7 +213870,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -221972,14 +213898,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]uint8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -222013,7 +213931,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39578 + zBase = __ccgo_ts + 39714 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222057,14 +213975,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -222075,16 +213985,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) (r int32) { return libc.BoolInt32(libc.Int32FromUint8(c) == int32('a') || libc.Int32FromUint8(c) == int32('e') || libc.Int32FromUint8(c) == int32('i') || libc.Int32FromUint8(c) == int32('o') || libc.Int32FromUint8(c) == int32('u') || bYIsVowel != 0 && libc.Int32FromUint8(c) == int32('y')) } @@ -222230,64 +214130,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39588, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39724, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39591, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39596, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39732, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39601, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39737, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39604, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39740, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39607, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39743, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39612, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39748, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39617, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39753, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39621, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39757, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39627, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39763, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39632, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39768, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222296,49 +214196,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39636, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39640, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39776, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39643, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39779, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39647, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39783, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39651, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39787, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39655, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39791, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39659, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39795, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39663, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39799, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222355,20 +214255,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39667, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39647, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39803, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39670, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39673, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39806, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39809, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39677, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39663, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39813, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39799, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222384,75 +214284,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39680, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39816, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39647, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39688, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39824, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39695, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39831, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39700, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39836, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39596, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39732, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39705, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39841, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39591, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39727, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39710, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39846, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39663, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39799, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39715, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39851, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16050, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16151, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39720, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39856, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39673, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39809, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39724, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39860, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39865, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39632, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39768, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39735, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39871, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39739, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39875, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39741, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39877, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39655, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222461,48 +214361,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39747, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39883, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39663, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39799, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39891, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39647, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39761, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39897, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39647, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39783, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39766, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39902, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39772, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39908, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39659, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39795, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39780, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39916, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39788, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39924, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39792, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39928, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39655, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39791, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222510,21 +214410,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39800, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39936, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39806, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39942, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39659, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39795, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39812, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39948, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39673, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39809, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222542,48 +214442,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39819, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39955, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39740, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39824, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39960, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39829, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39965, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39740, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39835, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39971, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39604, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39740, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39788, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39924, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39841, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39977, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39847, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39983, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39588, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39724, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222599,13 +214499,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39989, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39857, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39993, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39860, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39996, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222613,7 +214513,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39863, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39999, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222710,14 +214610,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222735,13 +214635,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222778,14 +214671,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39867) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40003) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39560) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39696) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222823,7 +214716,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222951,7 +214844,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -223027,11 +214920,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -223053,7 +214946,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39882)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40018)) } // C documentation @@ -223079,7 +214972,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39578, + FzName: __ccgo_ts + 39714, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223087,7 +214980,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39890, + FzName: __ccgo_ts + 40026, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223095,7 +214988,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39882, + FzName: __ccgo_ts + 40018, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223125,7 +215018,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39896, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40032, pApi, bp+96, uintptr(0)) } return rc } @@ -228586,39 +220479,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228641,16 +220501,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39903) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40039) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39907) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40043) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39911) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40047) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39920, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40056, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228713,21 +220573,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39954, - 1: __ccgo_ts + 39994, - 2: __ccgo_ts + 40029, + 0: __ccgo_ts + 40090, + 1: __ccgo_ts + 40130, + 2: __ccgo_ts + 40165, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23977, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24078, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40072, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40208, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228748,23 +220609,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228897,10 +220758,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40105, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40241, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40136, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40272, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -228919,7 +220780,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40187, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40323, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229369,7 +221230,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40213, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40349, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229424,15 +221285,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40223 + return __ccgo_ts + 40359 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229654,7 +221515,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229702,11 +221563,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-18.1.5\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=0\x00COMPILER=clang-19.1.7\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go index a76581f..8b34111 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_386.go @@ -1,4 +1,4 @@ -// Code generated for linux/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/386 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/386 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && 386 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -135,6 +137,31 @@ const CLOCK_REALTIME_COARSE = 5 const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 +const CLONE_CHILD_CLEARTID = 2097152 +const CLONE_CHILD_SETTID = 16777216 +const CLONE_DETACHED = 4194304 +const CLONE_FILES = 1024 +const CLONE_FS = 512 +const CLONE_IO = 2147483648 +const CLONE_NEWCGROUP = 33554432 +const CLONE_NEWIPC = 134217728 +const CLONE_NEWNET = 1073741824 +const CLONE_NEWNS = 131072 +const CLONE_NEWPID = 536870912 +const CLONE_NEWTIME = 128 +const CLONE_NEWUSER = 268435456 +const CLONE_NEWUTS = 67108864 +const CLONE_PARENT = 32768 +const CLONE_PARENT_SETTID = 1048576 +const CLONE_PIDFD = 4096 +const CLONE_PTRACE = 8192 +const CLONE_SETTLS = 524288 +const CLONE_SIGHAND = 2048 +const CLONE_SYSVSEM = 262144 +const CLONE_THREAD = 65536 +const CLONE_UNTRACED = 8388608 +const CLONE_VFORK = 16384 +const CLONE_VM = 256 const COLFLAG_BUSY = 256 const COLFLAG_GENERATED = 96 const COLFLAG_HASCOLL = 512 @@ -161,6 +188,8 @@ const COLTYPE_INT = 3 const COLTYPE_INTEGER = 4 const COLTYPE_REAL = 5 const COLTYPE_TEXT = 6 +const CPU_SETSIZE = 1024 +const CSIGNAL = 255 const CURSOR_FAULT = 4 const CURSOR_INVALID = 1 const CURSOR_REQUIRESEEK = 3 @@ -1242,6 +1271,31 @@ const PTF_INTKEY = 1 const PTF_LEAF = 8 const PTF_LEAFDATA = 4 const PTF_ZERODATA = 2 +const PTHREAD_BARRIER_SERIAL_THREAD = -1 +const PTHREAD_CANCELED = -1 +const PTHREAD_CANCEL_ASYNCHRONOUS = 1 +const PTHREAD_CANCEL_DEFERRED = 0 +const PTHREAD_CANCEL_DISABLE = 1 +const PTHREAD_CANCEL_ENABLE = 0 +const PTHREAD_CANCEL_MASKED = 2 +const PTHREAD_CREATE_DETACHED = 1 +const PTHREAD_CREATE_JOINABLE = 0 +const PTHREAD_EXPLICIT_SCHED = 1 +const PTHREAD_INHERIT_SCHED = 0 +const PTHREAD_MUTEX_DEFAULT = 0 +const PTHREAD_MUTEX_ERRORCHECK = 2 +const PTHREAD_MUTEX_NORMAL = 0 +const PTHREAD_MUTEX_RECURSIVE = 1 +const PTHREAD_MUTEX_ROBUST = 1 +const PTHREAD_MUTEX_STALLED = 0 +const PTHREAD_ONCE_INIT = 0 +const PTHREAD_PRIO_INHERIT = 1 +const PTHREAD_PRIO_NONE = 0 +const PTHREAD_PRIO_PROTECT = 2 +const PTHREAD_PROCESS_PRIVATE = 0 +const PTHREAD_PROCESS_SHARED = 1 +const PTHREAD_SCOPE_PROCESS = 1 +const PTHREAD_SCOPE_SYSTEM = 0 const PTRMAP_BTREE = 5 const PTRMAP_FREEPAGE = 2 const PTRMAP_OVERFLOW1 = 3 @@ -1382,6 +1436,13 @@ const R_OK = 4 const SAVEPOINT_BEGIN = 0 const SAVEPOINT_RELEASE = 1 const SAVEPOINT_ROLLBACK = 2 +const SCHED_BATCH = 3 +const SCHED_DEADLINE = 6 +const SCHED_FIFO = 1 +const SCHED_IDLE = 5 +const SCHED_OTHER = 0 +const SCHED_RESET_ON_FORK = 1073741824 +const SCHED_RR = 2 const SCHEMA_ROOT = 1 const SEEK_DATA = 3 const SEEK_HOLE = 4 @@ -1501,6 +1562,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1740,6 +1802,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1950,6 +2013,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -1973,7 +2037,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 -const SQLITE_MUTEX_NOOP = 1 +const SQLITE_MUTEX_NREF = 0 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -2112,6 +2176,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2120,7 +2185,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2205,6 +2270,7 @@ const SQLITE_TESTCTRL_USELONGDOUBLE = 34 const SQLITE_TESTCTRL_VDBE_COVERAGE = 21 const SQLITE_TEXT = 3 const SQLITE_THREADSAFE = 1 +const SQLITE_THREADS_IMPLEMENTED = 1 const SQLITE_TOKEN_KEYWORD = 2 const SQLITE_TOKEN_QUOTED = 1 const SQLITE_TOOBIG = 18 @@ -2230,8 +2296,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3397,6 +3463,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3406,9 +3475,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3857,12 +3923,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -3991,29 +4051,380 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
    +**
  • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. +** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. +** +**
  • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
  • [[SQLITE_FCNTL_SIZE_LIMIT]] +** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that +** implements [sqlite3_deserialize()] to set an upper bound on the size +** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. +** If the integer pointed to is negative, then it is filled in with the +** current limit. Otherwise the limit is set to the larger of the value +** of the integer pointed to and the current database size. The integer +** pointed to is set to the new limit. +** +**
  • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
  • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
  • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
  • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
  • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions super-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
  • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
  • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
  • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log ([WAL file]) and shared memory +** files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
  • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
  • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
  • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
  • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
  • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
  • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connection's busy-handler callback. The argument is of type (void**) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connection's +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
  • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
  • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
  • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
  • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
  • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
  • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
  • [[SQLITE_FCNTL_NULL_IO]] +** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor +** or file handle for the [sqlite3_file] object such that it will no longer +** read or write to the database file. +** +**
  • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
  • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
  • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
  • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
  • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
  • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
  • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS +** to block for up to M milliseconds before failing when attempting to +** obtain a file lock using the xLock or xShmLock methods of the VFS. +** The parameter is a pointer to a 32-bit signed integer that contains +** the value that M is to be set to. Before returning, the 32-bit signed +** integer is overwritten with the previous value of M. +** +**
  • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** +**
  • [[SQLITE_FCNTL_DATA_VERSION]] +** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +** a database file. The argument is a pointer to a 32-bit unsigned integer. +** The "data version" for the pager is written into the pointer. The +** "data version" changes whenever any change occurs to the corresponding +** database file, either through SQL statements on the same database +** connection or through transactions committed by separate database +** connections possibly in other processes. The [sqlite3_total_changes()] +** interface can be used to find if any database on the connection has changed, +** but that interface responds to changes on TEMP as well as MAIN and does +** not provide a mechanism to detect changes to MAIN only. Also, the +** [sqlite3_total_changes()] interface responds to internal changes only and +** omits changes made by other database connections. The +** [PRAGMA data_version] command provides a mechanism to detect changes to +** a single attached database that occur due to other database connections, +** but omits changes implemented by the database connection on which it is +** called. This file control is the only mechanism to detect changes that +** happen either internally or externally and that are associated with +** a particular attached database. +** +**
  • [[SQLITE_FCNTL_CKPT_START]] +** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint +** in wal mode before the client starts to copy pages from the wal +** file to the database file. +** +**
  • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. +** +**
  • [[SQLITE_FCNTL_EXTERNAL_READER]] +** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect +** whether or not there is a database client in another process with a wal-mode +** transaction open on the database or not. It is only available on unix.The +** (void*) argument passed with this file-control should be a pointer to a +** value of type (int). The integer value is set to 1 if the database is a wal +** mode database and there exists at least one client in another process that +** currently has an SQL transaction open on the database. It is set to 0 if +** the database is not a wal-mode db, or if there is no such connection in any +** other process. This opcode cannot be used to detect transactions opened +** by clients within the current process, only within other processes. +** +**
  • [[SQLITE_FCNTL_CKSM_FILE]] +** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the +** [checksum VFS shim] only. +** +**
  • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control +** purges the contents of the in-memory page cache. If there is an open +** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. +**
+ */ + +/* deprecated names */ + +// C documentation +// +// /* +// ** CAPI3REF: Mutex Handle +// ** +// ** The mutex module within SQLite defines [sqlite3_mutex] to be an +// ** abstract type for a mutex object. The SQLite core never looks +// ** at the internal representation of an [sqlite3_mutex]. It only +// ** deals with pointers to the [sqlite3_mutex] object. +// ** +// ** Mutexes are created using [sqlite3_mutex_alloc()]. +// */ +type Tsqlite3_mutex = struct { + Fmutex Tpthread_mutex_t +} + +type sqlite3_mutex = Tsqlite3_mutex // C documentation // @@ -4296,6 +4707,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4526,33 +4938,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4631,19 +5016,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4728,7 +5100,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4820,223 +5191,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
column OP expr
-** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5118,20 +5272,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5181,13 +5321,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5246,9 +5379,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5256,17 +5389,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5293,12 +5426,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
createFlag Behavior when page is not already in cache // **
0 Do not allocate a new page. Return NULL. -// **
1 Allocate a new page if it easy and convenient to do so. +// **
1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5315,7 +5448,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5333,7 +5466,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5367,24 +5500,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5408,22 +5523,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5484,7 +5583,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5564,50 +5663,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6004,340 +6059,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6347,15 +6068,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6371,14 +6083,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6404,17 +6108,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6469,11 +6162,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6847,55 +6546,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint32 type size_t = Tsize_t @@ -7042,6 +6697,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7100,6 +6760,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7209,14 +6880,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7301,7 +6964,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7403,7 +7066,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -7462,12 +7124,13 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 } FpTab uintptr - F__ccgo_pad3 [4]byte + F__ccgo_pad4 [4]byte } } @@ -7476,7 +7139,6 @@ type Expr = TExpr type TExprList = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList = TExprList @@ -7491,7 +7153,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7541,7 +7202,6 @@ type FuncDefHash = TFuncDefHash type TIdList = struct { FnId int32 - Fa [1]TIdList_item } type IdList = TIdList @@ -7605,7 +7265,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7677,19 +7336,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo32 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7703,11 +7365,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7718,39 +7377,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -7768,7 +7429,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -7780,6 +7441,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [20]Tu8 } type PreUpdate = TPreUpdate @@ -7867,9 +7529,11 @@ type TSelect = struct { type Select = TSelect type TSQLiteThread = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr + Ftid Tpthread_t + Fdone int32 + FpOut uintptr + FxTask uintptr + FpIn uintptr } type SQLiteThread = TSQLiteThread @@ -7930,7 +7594,6 @@ type SrcItem = TSrcItem type TSrcList = struct { FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList = TSrcList @@ -7947,10 +7610,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -7985,6 +7644,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8166,7 +7826,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8208,7 +7867,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8381,9 +8039,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8510,53 +8168,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8660,16 +8271,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8693,38 +8294,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8737,34 +8311,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -8778,90 +8328,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -8880,187 +8346,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9070,914 +8355,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo4 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - F__ccgo_pad2 [4]byte - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo56 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10002,612 +8379,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - F__ccgo_pad3 [4]byte - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10617,316 +8388,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11012,228 +8473,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -11377,10 +8616,10 @@ var _sqlite3azCompileOpt = [54]uintptr{ 47: __ccgo_ts + 1022, 48: __ccgo_ts + 1044, 49: __ccgo_ts + 1065, - 50: __ccgo_ts + 1076, - 51: __ccgo_ts + 1084, - 52: __ccgo_ts + 1098, - 53: __ccgo_ts + 1111, + 50: __ccgo_ts + 1080, + 51: __ccgo_ts + 1088, + 52: __ccgo_ts + 1102, + 53: __ccgo_ts + 1115, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -12211,12 +9450,12 @@ var _sqlite3StdTypeAffinity = [6]int8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1124, - 1: __ccgo_ts + 1128, - 2: __ccgo_ts + 1133, - 3: __ccgo_ts + 1137, - 4: __ccgo_ts + 1145, - 5: __ccgo_ts + 1150, + 0: __ccgo_ts + 1128, + 1: __ccgo_ts + 1132, + 2: __ccgo_ts + 1137, + 3: __ccgo_ts + 1141, + 4: __ccgo_ts + 1149, + 5: __ccgo_ts + 1154, } /************** End of global.c **********************************************/ @@ -12316,7 +9555,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12394,72 +9632,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12505,164 +9681,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - /* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -12688,18 +9711,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12716,100 +9727,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo144 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -12831,13 +9748,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -12857,14 +9767,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -12943,7 +9846,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint32(libc.Uint32FromInt64(40)/libc.Uint32FromInt64(4)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13115,7 +10018,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*16))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(16)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(20)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13173,7 +10076,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13309,24 +10212,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13457,7 +10342,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1155, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1159, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -13489,13 +10374,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1163, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1167, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if int32(*(*int8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1171, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -13503,7 +10388,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -13574,10 +10459,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -13645,7 +10530,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1179, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -13713,7 +10598,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -13746,14 +10631,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1187) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1198) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1195) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -13810,7 +10695,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -13957,7 +10842,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1208, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1212, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -13965,7 +10850,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -14043,7 +10928,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -14112,7 +10997,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1231) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1235) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -14127,7 +11012,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1236) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -14140,7 +11025,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1244) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1248) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(int32((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -14155,7 +11040,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1250) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -14170,7 +11055,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1260) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1264) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -14187,11 +11072,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1270) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1274) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14200,7 +11085,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1280) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1284) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -14247,7 +11132,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1284, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1288, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -14277,8 +11162,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1293, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1191) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1198) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1297, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1195) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -14297,16 +11182,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1303) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1307) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1309) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1314) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { rc = 0 } } @@ -14348,10 +11233,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1318, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -14372,11 +11257,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1330, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1338, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1342, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -14414,7 +11299,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1163, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1167, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -14494,7 +11379,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -14651,7 +11536,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -14699,7 +11584,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -14804,7 +11689,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -14891,9 +11776,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if int32(cf) == int32('d') { - v3 = __ccgo_ts + 1350 + v3 = __ccgo_ts + 1354 } else { - v3 = __ccgo_ts + 1355 + v3 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -14901,9 +11786,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+176, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1363, libc.VaList(bp+176, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1366, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -14913,17 +11798,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 72))).FvalidYMD = 0 _computeYMD(tls, bp+72) if int32(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY)) } case int32('H'): fallthrough case int32('k'): if int32(cf) == int32('H') { - v4 = __ccgo_ts + 1350 + v4 = __ccgo_ts + 1354 } else { - v4 = __ccgo_ts + 1355 + v4 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -14937,50 +11822,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if int32(cf) == int32('I') { - v5 = __ccgo_ts + 1350 + v5 = __ccgo_ts + 1354 } else { - v5 = __ccgo_ts + 1355 + v5 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+176, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1386, libc.VaList(bp+176, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+176, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if int32(cf) == int32('p') { - v6 = __ccgo_ts + 1397 + v6 = __ccgo_ts + 1401 } else { - v6 = __ccgo_ts + 1400 + v6 = __ccgo_ts + 1404 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if int32(cf) == int32('p') { - v7 = __ccgo_ts + 1403 + v7 = __ccgo_ts + 1407 } else { - v7 = __ccgo_ts + 1406 + v7 = __ccgo_ts + 1410 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1409, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1413, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1419, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1423, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1424, libc.VaList(bp+176, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+176, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1429, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -14990,18 +11875,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 120)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 120))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 120))).FvalidYMD = 0 _computeYMD(tls, bp+120) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, _daysAfterJan01(tls, bp+120)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, _daysAfterJan01(tls, bp+120)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), int8('%')) default: @@ -15157,7 +12042,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1444, libc.VaList(bp+128, int32(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1448, libc.VaList(bp+128, int32(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15190,55 +12075,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1250, + FzName: __ccgo_ts + 1254, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1270, + FzName: __ccgo_ts + 1274, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1478, + FzName: __ccgo_ts + 1482, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1483, + FzName: __ccgo_ts + 1487, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1488, + FzName: __ccgo_ts + 1492, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1497, + FzName: __ccgo_ts + 1501, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1506, + FzName: __ccgo_ts + 1510, }, 7: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1515, + FzName: __ccgo_ts + 1519, }, 8: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1528, + FzName: __ccgo_ts + 1532, }, 9: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1546, + FzName: __ccgo_ts + 1550, }, } @@ -15320,28 +12205,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15349,19 +12234,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15378,12 +12263,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15391,7 +12276,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15404,34 +12289,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15533,7 +12418,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -15744,14 +12629,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -15766,9 +12644,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -15909,7 +12787,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1559, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1563, libc.VaList(bp+8, nByte)) } return p } @@ -15971,7 +12849,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1597, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1601, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -16182,7 +13060,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16202,9 +13084,11 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld + _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) + _sqlite3MemoryBarrier(tls) return rc } @@ -16387,40 +13271,318 @@ func init() { *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_noopMutexLeave) } +type Tpthread_t = uintptr + +type pthread_t = Tpthread_t + +type Tpthread_once_t = int32 + +type pthread_once_t = Tpthread_once_t + +type Tpthread_key_t = uint32 + +type pthread_key_t = Tpthread_key_t + +type Tpthread_spinlock_t = int32 + +type pthread_spinlock_t = Tpthread_spinlock_t + +type Tpthread_mutexattr_t = struct { + F__attr uint32 +} + +type pthread_mutexattr_t = Tpthread_mutexattr_t + +type Tpthread_condattr_t = struct { + F__attr uint32 +} + +type pthread_condattr_t = Tpthread_condattr_t + +type Tpthread_barrierattr_t = struct { + F__attr uint32 +} + +type pthread_barrierattr_t = Tpthread_barrierattr_t + +type Tpthread_rwlockattr_t = struct { + F__attr [2]uint32 +} + +type pthread_rwlockattr_t = Tpthread_rwlockattr_t + +type Tsigset_t = struct { + F__bits [32]uint32 +} + +type sigset_t = Tsigset_t + +type t__sigset_t = Tsigset_t + +type Tpthread_attr_t = struct { + F__u struct { + F__vi [0][9]int32 + F__s [0][9]uint32 + F__i [9]int32 + } +} + +type pthread_attr_t = Tpthread_attr_t + +type Tpthread_mutex_t = struct { + F__u struct { + F__vi [0][6]int32 + F__p [0][6]uintptr + F__i [6]int32 + } + F__ccgo_room int32 +} + +type pthread_mutex_t = Tpthread_mutex_t + +type Tpthread_cond_t = struct { + F__u struct { + F__vi [0][12]int32 + F__p [0][12]uintptr + F__i [12]int32 + } +} + +type pthread_cond_t = Tpthread_cond_t + +type Tpthread_rwlock_t = struct { + F__u struct { + F__vi [0][8]int32 + F__p [0][8]uintptr + F__i [8]int32 + } +} + +type pthread_rwlock_t = Tpthread_rwlock_t + +type Tpthread_barrier_t = struct { + F__u struct { + F__vi [0][5]int32 + F__p [0][5]uintptr + F__i [5]int32 + } +} + +type pthread_barrier_t = Tpthread_barrier_t + +type Tsched_param = struct { + Fsched_priority int32 + F__reserved1 int32 + F__reserved2 [4]int32 + F__reserved3 int32 +} + +type sched_param = Tsched_param + +type Tcpu_set_t = struct { + F__bits [32]uint32 +} + +type cpu_set_t = Tcpu_set_t + +type t__ptcb = struct { + F__f uintptr + F__x uintptr + F__next uintptr +} + +/* +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +** intended for use only inside assert() statements. On some platforms, +** there might be race conditions that can cause these routines to +** deliver incorrect results. In particular, if pthread_equal() is +** not an atomic operation, then these routines might delivery +** incorrect results. On most platforms, pthread_equal() is a +** comparison of two integers and is therefore atomic. But we are +** told that HPUX is not such a platform. If so, then these routines +** will not always work correctly on HPUX. +** +** On those platforms where pthread_equal() is not atomic, SQLite +** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to +** make sure no assert() statements are evaluated and hence these +** routines are never called. + */ + +// C documentation +// +// /* +// ** Try to provide a memory barrier operation, needed for initialization +// ** and also for the implementation of xShmBarrier in the VFS in cases +// ** where SQLite is compiled without mutexes. +// */ +func _sqlite3MemoryBarrier(tls *libc.TLS) { + libc.X__sync_synchronize(tls) +} + +// C documentation +// +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ +func _pthreadMutexInit(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +func _pthreadMutexEnd(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. SQLite +// ** will unwind its stack and return an error. The argument +// ** to sqlite3_mutex_alloc() is one of these integer constants: +// ** +// **
    +// **
  • SQLITE_MUTEX_FAST +// **
  • SQLITE_MUTEX_RECURSIVE +// **
  • SQLITE_MUTEX_STATIC_MAIN +// **
  • SQLITE_MUTEX_STATIC_MEM +// **
  • SQLITE_MUTEX_STATIC_OPEN +// **
  • SQLITE_MUTEX_STATIC_PRNG +// **
  • SQLITE_MUTEX_STATIC_LRU +// **
  • SQLITE_MUTEX_STATIC_PMEM +// **
  • SQLITE_MUTEX_STATIC_APP1 +// **
  • SQLITE_MUTEX_STATIC_APP2 +// **
  • SQLITE_MUTEX_STATIC_APP3 +// **
  • SQLITE_MUTEX_STATIC_VFS1 +// **
  • SQLITE_MUTEX_STATIC_VFS2 +// **
  • SQLITE_MUTEX_STATIC_VFS3 +// **
+// ** +// ** The first two constants cause sqlite3_mutex_alloc() to create +// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +// ** The mutex implementation does not need to make a distinction +// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +// ** not want to. But SQLite will only request a recursive mutex in +// ** cases where it really needs one. If a faster non-recursive mutex +// ** implementation is available on the host platform, the mutex subsystem +// ** might return such a mutex in response to SQLITE_MUTEX_FAST. +// ** +// ** The other allowed parameters to sqlite3_mutex_alloc() each return +// ** a pointer to a static preexisting mutex. Six static mutexes are +// ** used by the current version of SQLite. Future versions of SQLite +// ** may add additional static mutexes. Static mutexes are for internal +// ** use by SQLite only. Applications that use SQLite mutexes should +// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +// ** SQLITE_MUTEX_RECURSIVE. +// ** +// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +// ** returns a different mutex on every call. But for the static +// ** mutex types, the same mutex is returned on every call that has +// ** the same type number. +// */ +func _pthreadMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + var p uintptr + var _ /* recursiveAttr at bp+0 */ Tpthread_mutexattr_t + _ = p + switch iType { + case int32(SQLITE_MUTEX_RECURSIVE): + p = _sqlite3MallocZero(tls, uint64(28)) + if p != 0 { + libc.Xpthread_mutexattr_init(tls, bp) + libc.Xpthread_mutexattr_settype(tls, bp, int32(PTHREAD_MUTEX_RECURSIVE)) + libc.Xpthread_mutex_init(tls, p, bp) + libc.Xpthread_mutexattr_destroy(tls, bp) + } + case SQLITE_MUTEX_FAST: + p = _sqlite3MallocZero(tls, uint64(28)) + if p != 0 { + libc.Xpthread_mutex_init(tls, p, uintptr(0)) + } + default: + p = uintptr(unsafe.Pointer(&_staticMutexes)) + uintptr(iType-int32(2))*28 + break + } + return p +} + +var _staticMutexes = [12]Tsqlite3_mutex{} + +// C documentation +// +// /* +// ** This routine deallocates a previously +// ** allocated mutex. SQLite is careful to deallocate every +// ** mutex that it allocates. +// */ +func _pthreadMutexFree(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_destroy(tls, p) + Xsqlite3_free(tls, p) +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ +func _pthreadMutexEnter(tls *libc.TLS, p uintptr) { + /* Use the built-in recursive mutexes if they are available. + */ + libc.Xpthread_mutex_lock(tls, p) +} + +func _pthreadMutexTry(tls *libc.TLS, p uintptr) (r int32) { + var rc int32 + _ = rc + /* Use the built-in recursive mutexes if they are available. + */ + if libc.Xpthread_mutex_trylock(tls, p) == 0 { + rc = SQLITE_OK + } else { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* -// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation -// ** is used regardless of the run-time threadsafety setting. +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. // */ +func _pthreadMutexLeave(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_unlock(tls, p) +} + func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return _sqlite3NoopMutex(tls) + return uintptr(unsafe.Pointer(&_sMutex1)) } -/************** End of mutex_noop.c ******************************************/ -/************** Begin file mutex_unix.c **************************************/ -/* -** 2007 August 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement mutexes for pthreads - */ -/* #include "sqliteInt.h" */ +var _sMutex1 = Tsqlite3_mutex_methods{} -/* -** The code in this file is only used if we are compiling threadsafe -** under unix with pthreads. -** -** Note that this implementation requires a version of pthreads that -** supports recursive mutexes. - */ +func init() { + p := unsafe.Pointer(&_sMutex1) + *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_pthreadMutexInit) + *(*uintptr)(unsafe.Add(p, 4)) = __ccgo_fp(_pthreadMutexEnd) + *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_pthreadMutexAlloc) + *(*uintptr)(unsafe.Add(p, 12)) = __ccgo_fp(_pthreadMutexFree) + *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_pthreadMutexEnter) + *(*uintptr)(unsafe.Add(p, 20)) = __ccgo_fp(_pthreadMutexTry) + *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_pthreadMutexLeave) +} /************** End of mutex_unix.c ******************************************/ /************** Begin file mutex_w32.c ***************************************/ @@ -16512,6 +13674,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16519,8 +13683,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17339,7 +14503,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -17507,17 +14671,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -17714,22 +14878,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(128) defer tls.Free(128) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -17761,7 +14926,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = int32(*(*int8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1647, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1651, int32(1)) break } /* Find out what flags are present */ @@ -17978,11 +15143,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18176,9 +15341,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1649 + v57 = __ccgo_ts + 1653 } else { - v57 = __ccgo_ts + 1654 + v57 = __ccgo_ts + 1658 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -18189,7 +15354,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1658, uint32(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1662, uint32(5)) bufpt = bp if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -18459,29 +15624,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint32(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18522,7 +15665,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1663 + bufpt = __ccgo_ts + 1667 } else { if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -18596,25 +15739,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1664 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1668 } else { - v98 = __ccgo_ts + 1669 + v97 = __ccgo_ts + 1673 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18622,15 +15769,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -18641,13 +15788,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18661,35 +15841,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1680, uint32(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if libc.Int32FromUint8(libc.Uint8FromInt8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -18714,9 +15957,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18730,7 +15973,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 44)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 44))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1676, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18740,21 +15983,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 44)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1678, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1688, libc.VaList(bp+120, *(*Tu32)(unsafe.Pointer(pItem + 32)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+120, *(*Tu32)(unsafe.Pointer(pItem + 32)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1709, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1739, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -18993,7 +16236,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, (*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1)) p1 = p + 21 @@ -19029,7 +16272,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -19292,6 +16535,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19309,11 +16554,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(240) - defer tls.Free(240) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+24 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(210), 0) + var _ /* zMsg at bp+24 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -19747,76 +16992,34 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint32(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr - _ = p + var rc int32 + _, _ = p, rc + /* This routine is never used in single-threaded mode */ *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) - p = _sqlite3Malloc(tls, uint64(12)) + p = _sqlite3Malloc(tls, uint64(20)) if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if int32(p)/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask - (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + libc.Xmemset(tls, p, 0, uint32(20)) + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + ** function that returns SQLITE_ERROR when passed the argument 200, that + ** forces worker threads to run sequentially and deterministically + ** for testing purposes. */ + if _sqlite3FaultSim(tls, int32(200)) != 0 { + rc = int32(1) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) + } + if rc != 0 { + (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -19826,18 +17029,32 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui // // /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) (r int32) { + var rc, v1 int32 + _, _ = rc, v1 if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask != 0 { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TSQLiteThread)(unsafe.Pointer(p)).FxTask})))(tls, (*TSQLiteThread)(unsafe.Pointer(p)).FpIn) + if (*TSQLiteThread)(unsafe.Pointer(p)).Fdone != 0 { + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpOut + rc = SQLITE_OK } else { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpResult + if libc.Xpthread_join(tls, (*TSQLiteThread)(unsafe.Pointer(p)).Ftid, ppOut) != 0 { + v1 = int32(SQLITE_ERROR) + } else { + v1 = SQLITE_OK + } + rc = v1 } Xsqlite3_free(tls, p) - return SQLITE_OK + return rc } +/******************************** End Unix Pthreads *************************/ + +/********************************* Win32 Threads ****************************/ +/******************************** End Win32 Threads *************************/ + +/********************************* Single-Threaded **************************/ /****************************** End Single-Threaded *************************/ /************** End of threads.c *********************************************/ @@ -19947,6 +17164,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = libc.Int8FromUint8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20697,7 +17945,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 116 + v2 = p + 104 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -20872,7 +18120,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1723, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1753, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21084,11 +18332,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint32(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -21324,7 +18572,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -21414,7 +18662,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1748 + pow63 = __ccgo_ts + 1778 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21641,7 +18889,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1767)) + n = libc.Int32FromUint32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -21801,7 +19049,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1783 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -21910,7 +19158,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 16 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22326,7 +19574,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1785, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1815, libc.VaList(bp+8, zType)) } // C documentation @@ -22349,13 +19597,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1664) + _logBadConnection(tls, __ccgo_ts+1668) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1830) + _logBadConnection(tls, __ccgo_ts+1860) } return 0 } else { @@ -22369,7 +19617,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1839) + _logBadConnection(tls, __ccgo_ts+1869) return 0 } else { return int32(1) @@ -22400,7 +19648,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -22751,23 +19999,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -22822,8 +20068,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if new_size*uint32(8) > uint32(SQLITE_MALLOC_SOFT_LIMIT) { new_size = libc.Uint32FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint32FromInt64(8) } @@ -22856,9 +20102,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*8, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*8, elem) goto _2 _2: ; @@ -22878,13 +20123,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -22892,7 +20136,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -22908,7 +20152,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -22920,7 +20164,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -22969,7 +20213,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -22979,20 +20223,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(16)) + new_elem = _sqlite3Malloc(tls, uint64(20)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*8 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 } else { v1 = uintptr(0) } @@ -23011,196 +20254,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1847, - 1: __ccgo_ts + 1857, - 2: __ccgo_ts + 1868, - 3: __ccgo_ts + 1880, - 4: __ccgo_ts + 1891, - 5: __ccgo_ts + 1903, - 6: __ccgo_ts + 1910, - 7: __ccgo_ts + 1918, - 8: __ccgo_ts + 1926, - 9: __ccgo_ts + 1931, - 10: __ccgo_ts + 1936, - 11: __ccgo_ts + 1942, - 12: __ccgo_ts + 1956, - 13: __ccgo_ts + 1962, - 14: __ccgo_ts + 1972, - 15: __ccgo_ts + 1977, - 16: __ccgo_ts + 1982, - 17: __ccgo_ts + 1985, - 18: __ccgo_ts + 1991, - 19: __ccgo_ts + 1998, - 20: __ccgo_ts + 2002, - 21: __ccgo_ts + 2012, - 22: __ccgo_ts + 2019, - 23: __ccgo_ts + 2026, - 24: __ccgo_ts + 2033, - 25: __ccgo_ts + 2040, - 26: __ccgo_ts + 2050, - 27: __ccgo_ts + 2059, - 28: __ccgo_ts + 2070, - 29: __ccgo_ts + 2079, - 30: __ccgo_ts + 2085, - 31: __ccgo_ts + 2095, - 32: __ccgo_ts + 2105, - 33: __ccgo_ts + 2110, - 34: __ccgo_ts + 2124, - 35: __ccgo_ts + 2135, - 36: __ccgo_ts + 2140, - 37: __ccgo_ts + 2147, - 38: __ccgo_ts + 2158, - 39: __ccgo_ts + 2163, - 40: __ccgo_ts + 2168, - 41: __ccgo_ts + 2174, - 42: __ccgo_ts + 2180, - 43: __ccgo_ts + 2186, - 44: __ccgo_ts + 2189, - 45: __ccgo_ts + 2193, - 46: __ccgo_ts + 2199, - 47: __ccgo_ts + 2210, - 48: __ccgo_ts + 2221, - 49: __ccgo_ts + 2229, - 50: __ccgo_ts + 2238, - 51: __ccgo_ts + 2244, - 52: __ccgo_ts + 2251, - 53: __ccgo_ts + 2259, - 54: __ccgo_ts + 2262, - 55: __ccgo_ts + 2265, - 56: __ccgo_ts + 2268, - 57: __ccgo_ts + 2271, - 58: __ccgo_ts + 2274, - 59: __ccgo_ts + 2277, - 60: __ccgo_ts + 2284, - 61: __ccgo_ts + 2294, - 62: __ccgo_ts + 2307, - 63: __ccgo_ts + 2318, - 64: __ccgo_ts + 2324, - 65: __ccgo_ts + 2331, - 66: __ccgo_ts + 2340, - 67: __ccgo_ts + 2349, - 68: __ccgo_ts + 2356, - 69: __ccgo_ts + 2369, - 70: __ccgo_ts + 2380, - 71: __ccgo_ts + 2385, - 72: __ccgo_ts + 2393, - 73: __ccgo_ts + 2399, - 74: __ccgo_ts + 2406, - 75: __ccgo_ts + 2418, - 76: __ccgo_ts + 2423, - 77: __ccgo_ts + 2432, - 78: __ccgo_ts + 2437, - 79: __ccgo_ts + 2446, - 80: __ccgo_ts + 2451, - 81: __ccgo_ts + 2456, - 82: __ccgo_ts + 2462, - 83: __ccgo_ts + 2470, - 84: __ccgo_ts + 2478, - 85: __ccgo_ts + 2488, - 86: __ccgo_ts + 2496, - 87: __ccgo_ts + 2503, - 88: __ccgo_ts + 2516, - 89: __ccgo_ts + 2521, - 90: __ccgo_ts + 2533, - 91: __ccgo_ts + 2541, - 92: __ccgo_ts + 2548, - 93: __ccgo_ts + 2559, - 94: __ccgo_ts + 2566, - 95: __ccgo_ts + 2573, - 96: __ccgo_ts + 2583, - 97: __ccgo_ts + 2592, - 98: __ccgo_ts + 2603, - 99: __ccgo_ts + 2609, - 100: __ccgo_ts + 2620, - 101: __ccgo_ts + 2630, - 102: __ccgo_ts + 2640, - 103: __ccgo_ts + 2649, - 104: __ccgo_ts + 2656, - 105: __ccgo_ts + 2662, - 106: __ccgo_ts + 2672, - 107: __ccgo_ts + 2683, - 108: __ccgo_ts + 2687, - 109: __ccgo_ts + 2696, - 110: __ccgo_ts + 2705, - 111: __ccgo_ts + 2712, - 112: __ccgo_ts + 2722, - 113: __ccgo_ts + 2729, - 114: __ccgo_ts + 2739, - 115: __ccgo_ts + 2747, - 116: __ccgo_ts + 2754, - 117: __ccgo_ts + 2768, - 118: __ccgo_ts + 2782, - 119: __ccgo_ts + 2790, - 120: __ccgo_ts + 2801, - 121: __ccgo_ts + 2814, - 122: __ccgo_ts + 2825, - 123: __ccgo_ts + 2831, - 124: __ccgo_ts + 2843, - 125: __ccgo_ts + 2852, - 126: __ccgo_ts + 2860, - 127: __ccgo_ts + 2869, - 128: __ccgo_ts + 2878, - 129: __ccgo_ts + 2885, - 130: __ccgo_ts + 2893, - 131: __ccgo_ts + 2900, - 132: __ccgo_ts + 2911, - 133: __ccgo_ts + 2925, - 134: __ccgo_ts + 2936, - 135: __ccgo_ts + 2944, - 136: __ccgo_ts + 2950, - 137: __ccgo_ts + 2958, - 138: __ccgo_ts + 2966, - 139: __ccgo_ts + 2976, - 140: __ccgo_ts + 2989, - 141: __ccgo_ts + 2999, - 142: __ccgo_ts + 3012, - 143: __ccgo_ts + 3021, - 144: __ccgo_ts + 3032, - 145: __ccgo_ts + 3040, - 146: __ccgo_ts + 3046, - 147: __ccgo_ts + 3058, - 148: __ccgo_ts + 3070, - 149: __ccgo_ts + 3078, - 150: __ccgo_ts + 3090, - 151: __ccgo_ts + 3103, - 152: __ccgo_ts + 3113, - 153: __ccgo_ts + 3123, - 154: __ccgo_ts + 3135, - 155: __ccgo_ts + 3140, - 156: __ccgo_ts + 3152, - 157: __ccgo_ts + 3162, - 158: __ccgo_ts + 3168, - 159: __ccgo_ts + 3178, - 160: __ccgo_ts + 3185, - 161: __ccgo_ts + 3197, - 162: __ccgo_ts + 3208, - 163: __ccgo_ts + 3216, - 164: __ccgo_ts + 3225, - 165: __ccgo_ts + 3234, - 166: __ccgo_ts + 3243, - 167: __ccgo_ts + 3250, - 168: __ccgo_ts + 3261, - 169: __ccgo_ts + 3274, - 170: __ccgo_ts + 3284, - 171: __ccgo_ts + 3291, - 172: __ccgo_ts + 3299, - 173: __ccgo_ts + 3308, - 174: __ccgo_ts + 3314, - 175: __ccgo_ts + 3321, - 176: __ccgo_ts + 3329, - 177: __ccgo_ts + 3337, - 178: __ccgo_ts + 3345, - 179: __ccgo_ts + 3355, - 180: __ccgo_ts + 3364, - 181: __ccgo_ts + 3375, - 182: __ccgo_ts + 3386, - 183: __ccgo_ts + 3397, - 184: __ccgo_ts + 3407, - 185: __ccgo_ts + 3413, - 186: __ccgo_ts + 3424, - 187: __ccgo_ts + 3435, - 188: __ccgo_ts + 3440, - 189: __ccgo_ts + 3448, + 0: __ccgo_ts + 1877, + 1: __ccgo_ts + 1887, + 2: __ccgo_ts + 1898, + 3: __ccgo_ts + 1910, + 4: __ccgo_ts + 1921, + 5: __ccgo_ts + 1933, + 6: __ccgo_ts + 1940, + 7: __ccgo_ts + 1948, + 8: __ccgo_ts + 1956, + 9: __ccgo_ts + 1961, + 10: __ccgo_ts + 1966, + 11: __ccgo_ts + 1972, + 12: __ccgo_ts + 1986, + 13: __ccgo_ts + 1992, + 14: __ccgo_ts + 2002, + 15: __ccgo_ts + 2007, + 16: __ccgo_ts + 2012, + 17: __ccgo_ts + 2015, + 18: __ccgo_ts + 2021, + 19: __ccgo_ts + 2028, + 20: __ccgo_ts + 2032, + 21: __ccgo_ts + 2042, + 22: __ccgo_ts + 2049, + 23: __ccgo_ts + 2056, + 24: __ccgo_ts + 2063, + 25: __ccgo_ts + 2070, + 26: __ccgo_ts + 2080, + 27: __ccgo_ts + 2089, + 28: __ccgo_ts + 2100, + 29: __ccgo_ts + 2109, + 30: __ccgo_ts + 2115, + 31: __ccgo_ts + 2125, + 32: __ccgo_ts + 2135, + 33: __ccgo_ts + 2140, + 34: __ccgo_ts + 2154, + 35: __ccgo_ts + 2165, + 36: __ccgo_ts + 2170, + 37: __ccgo_ts + 2177, + 38: __ccgo_ts + 2188, + 39: __ccgo_ts + 2193, + 40: __ccgo_ts + 2198, + 41: __ccgo_ts + 2204, + 42: __ccgo_ts + 2210, + 43: __ccgo_ts + 2216, + 44: __ccgo_ts + 2219, + 45: __ccgo_ts + 2223, + 46: __ccgo_ts + 2229, + 47: __ccgo_ts + 2240, + 48: __ccgo_ts + 2251, + 49: __ccgo_ts + 2259, + 50: __ccgo_ts + 2268, + 51: __ccgo_ts + 2274, + 52: __ccgo_ts + 2281, + 53: __ccgo_ts + 2289, + 54: __ccgo_ts + 2292, + 55: __ccgo_ts + 2295, + 56: __ccgo_ts + 2298, + 57: __ccgo_ts + 2301, + 58: __ccgo_ts + 2304, + 59: __ccgo_ts + 2307, + 60: __ccgo_ts + 2314, + 61: __ccgo_ts + 2324, + 62: __ccgo_ts + 2337, + 63: __ccgo_ts + 2348, + 64: __ccgo_ts + 2354, + 65: __ccgo_ts + 2361, + 66: __ccgo_ts + 2370, + 67: __ccgo_ts + 2379, + 68: __ccgo_ts + 2386, + 69: __ccgo_ts + 2399, + 70: __ccgo_ts + 2410, + 71: __ccgo_ts + 2415, + 72: __ccgo_ts + 2423, + 73: __ccgo_ts + 2429, + 74: __ccgo_ts + 2436, + 75: __ccgo_ts + 2448, + 76: __ccgo_ts + 2453, + 77: __ccgo_ts + 2462, + 78: __ccgo_ts + 2467, + 79: __ccgo_ts + 2476, + 80: __ccgo_ts + 2481, + 81: __ccgo_ts + 2486, + 82: __ccgo_ts + 2492, + 83: __ccgo_ts + 2500, + 84: __ccgo_ts + 2508, + 85: __ccgo_ts + 2518, + 86: __ccgo_ts + 2526, + 87: __ccgo_ts + 2533, + 88: __ccgo_ts + 2546, + 89: __ccgo_ts + 2551, + 90: __ccgo_ts + 2563, + 91: __ccgo_ts + 2571, + 92: __ccgo_ts + 2578, + 93: __ccgo_ts + 2589, + 94: __ccgo_ts + 2596, + 95: __ccgo_ts + 2603, + 96: __ccgo_ts + 2613, + 97: __ccgo_ts + 2622, + 98: __ccgo_ts + 2633, + 99: __ccgo_ts + 2639, + 100: __ccgo_ts + 2650, + 101: __ccgo_ts + 2660, + 102: __ccgo_ts + 2670, + 103: __ccgo_ts + 2679, + 104: __ccgo_ts + 2686, + 105: __ccgo_ts + 2692, + 106: __ccgo_ts + 2702, + 107: __ccgo_ts + 2713, + 108: __ccgo_ts + 2717, + 109: __ccgo_ts + 2726, + 110: __ccgo_ts + 2735, + 111: __ccgo_ts + 2742, + 112: __ccgo_ts + 2752, + 113: __ccgo_ts + 2759, + 114: __ccgo_ts + 2769, + 115: __ccgo_ts + 2777, + 116: __ccgo_ts + 2784, + 117: __ccgo_ts + 2798, + 118: __ccgo_ts + 2812, + 119: __ccgo_ts + 2820, + 120: __ccgo_ts + 2831, + 121: __ccgo_ts + 2844, + 122: __ccgo_ts + 2855, + 123: __ccgo_ts + 2861, + 124: __ccgo_ts + 2873, + 125: __ccgo_ts + 2882, + 126: __ccgo_ts + 2890, + 127: __ccgo_ts + 2899, + 128: __ccgo_ts + 2908, + 129: __ccgo_ts + 2915, + 130: __ccgo_ts + 2923, + 131: __ccgo_ts + 2930, + 132: __ccgo_ts + 2941, + 133: __ccgo_ts + 2955, + 134: __ccgo_ts + 2966, + 135: __ccgo_ts + 2974, + 136: __ccgo_ts + 2980, + 137: __ccgo_ts + 2988, + 138: __ccgo_ts + 2996, + 139: __ccgo_ts + 3006, + 140: __ccgo_ts + 3019, + 141: __ccgo_ts + 3029, + 142: __ccgo_ts + 3042, + 143: __ccgo_ts + 3051, + 144: __ccgo_ts + 3062, + 145: __ccgo_ts + 3070, + 146: __ccgo_ts + 3076, + 147: __ccgo_ts + 3088, + 148: __ccgo_ts + 3100, + 149: __ccgo_ts + 3108, + 150: __ccgo_ts + 3120, + 151: __ccgo_ts + 3133, + 152: __ccgo_ts + 3143, + 153: __ccgo_ts + 3153, + 154: __ccgo_ts + 3165, + 155: __ccgo_ts + 3170, + 156: __ccgo_ts + 3182, + 157: __ccgo_ts + 3192, + 158: __ccgo_ts + 3198, + 159: __ccgo_ts + 3208, + 160: __ccgo_ts + 3215, + 161: __ccgo_ts + 3227, + 162: __ccgo_ts + 3238, + 163: __ccgo_ts + 3246, + 164: __ccgo_ts + 3255, + 165: __ccgo_ts + 3264, + 166: __ccgo_ts + 3273, + 167: __ccgo_ts + 3280, + 168: __ccgo_ts + 3291, + 169: __ccgo_ts + 3304, + 170: __ccgo_ts + 3314, + 171: __ccgo_ts + 3321, + 172: __ccgo_ts + 3329, + 173: __ccgo_ts + 3338, + 174: __ccgo_ts + 3344, + 175: __ccgo_ts + 3351, + 176: __ccgo_ts + 3359, + 177: __ccgo_ts + 3367, + 178: __ccgo_ts + 3375, + 179: __ccgo_ts + 3385, + 180: __ccgo_ts + 3394, + 181: __ccgo_ts + 3405, + 182: __ccgo_ts + 3416, + 183: __ccgo_ts + 3427, + 184: __ccgo_ts + 3437, + 185: __ccgo_ts + 3443, + 186: __ccgo_ts + 3454, + 187: __ccgo_ts + 3465, + 188: __ccgo_ts + 3470, + 189: __ccgo_ts + 3478, } type Tregister_t = int32 @@ -23283,97 +20526,6 @@ type Tuseconds_t = uint32 type useconds_t = Tuseconds_t -type Tpthread_t = uintptr - -type pthread_t = Tpthread_t - -type Tpthread_once_t = int32 - -type pthread_once_t = Tpthread_once_t - -type Tpthread_key_t = uint32 - -type pthread_key_t = Tpthread_key_t - -type Tpthread_spinlock_t = int32 - -type pthread_spinlock_t = Tpthread_spinlock_t - -type Tpthread_mutexattr_t = struct { - F__attr uint32 -} - -type pthread_mutexattr_t = Tpthread_mutexattr_t - -type Tpthread_condattr_t = struct { - F__attr uint32 -} - -type pthread_condattr_t = Tpthread_condattr_t - -type Tpthread_barrierattr_t = struct { - F__attr uint32 -} - -type pthread_barrierattr_t = Tpthread_barrierattr_t - -type Tpthread_rwlockattr_t = struct { - F__attr [2]uint32 -} - -type pthread_rwlockattr_t = Tpthread_rwlockattr_t - -type Tpthread_attr_t = struct { - F__u struct { - F__vi [0][9]int32 - F__s [0][9]uint32 - F__i [9]int32 - } -} - -type pthread_attr_t = Tpthread_attr_t - -type Tpthread_mutex_t = struct { - F__u struct { - F__vi [0][6]int32 - F__p [0][6]uintptr - F__i [6]int32 - } - F__ccgo_room int32 -} - -type pthread_mutex_t = Tpthread_mutex_t - -type Tpthread_cond_t = struct { - F__u struct { - F__vi [0][12]int32 - F__p [0][12]uintptr - F__i [12]int32 - } -} - -type pthread_cond_t = Tpthread_cond_t - -type Tpthread_rwlock_t = struct { - F__u struct { - F__vi [0][8]int32 - F__p [0][8]uintptr - F__i [8]int32 - } -} - -type pthread_rwlock_t = Tpthread_rwlock_t - -type Tpthread_barrier_t = struct { - F__u struct { - F__vi [0][5]int32 - F__p [0][5]uintptr - F__i [5]int32 - } -} - -type pthread_barrier_t = Tpthread_barrier_t - type Tu_int8_t = uint8 type u_int8_t = Tu_int8_t @@ -23445,14 +20597,6 @@ type Ttimeval = struct { type timeval = Ttimeval -type Tsigset_t = struct { - F__bits [32]uint32 -} - -type sigset_t = Tsigset_t - -type t__sigset_t = Tsigset_t - type Tfd_mask = uint32 type fd_mask = Tfd_mask @@ -23697,22 +20841,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -23743,30 +20871,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -23848,91 +20952,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3458, + FzName: __ccgo_ts + 3488, }, 1: { - FzName: __ccgo_ts + 3463, + FzName: __ccgo_ts + 3493, }, 2: { - FzName: __ccgo_ts + 3469, + FzName: __ccgo_ts + 3499, }, 3: { - FzName: __ccgo_ts + 3476, + FzName: __ccgo_ts + 3506, }, 4: { - FzName: __ccgo_ts + 3483, + FzName: __ccgo_ts + 3513, }, 5: { - FzName: __ccgo_ts + 3488, + FzName: __ccgo_ts + 3518, }, 6: { - FzName: __ccgo_ts + 3494, + FzName: __ccgo_ts + 3524, }, 7: { - FzName: __ccgo_ts + 3504, + FzName: __ccgo_ts + 3534, }, 8: { - FzName: __ccgo_ts + 3510, + FzName: __ccgo_ts + 3540, }, 9: { - FzName: __ccgo_ts + 3515, + FzName: __ccgo_ts + 3545, }, 10: { - FzName: __ccgo_ts + 3521, + FzName: __ccgo_ts + 3551, }, 11: { - FzName: __ccgo_ts + 3529, + FzName: __ccgo_ts + 3559, }, 12: { - FzName: __ccgo_ts + 3535, + FzName: __ccgo_ts + 3565, }, 13: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3572, }, 14: { - FzName: __ccgo_ts + 3551, + FzName: __ccgo_ts + 3581, }, 15: { - FzName: __ccgo_ts + 3558, + FzName: __ccgo_ts + 3588, }, 16: { - FzName: __ccgo_ts + 3568, + FzName: __ccgo_ts + 3598, }, 17: { - FzName: __ccgo_ts + 3575, + FzName: __ccgo_ts + 3605, }, 18: { - FzName: __ccgo_ts + 3589, + FzName: __ccgo_ts + 3619, }, 19: { - FzName: __ccgo_ts + 3595, + FzName: __ccgo_ts + 3625, }, 20: { - FzName: __ccgo_ts + 3601, + FzName: __ccgo_ts + 3631, }, 21: { - FzName: __ccgo_ts + 3608, + FzName: __ccgo_ts + 3638, }, 22: { - FzName: __ccgo_ts + 3616, + FzName: __ccgo_ts + 3646, }, 23: { - FzName: __ccgo_ts + 3621, + FzName: __ccgo_ts + 3651, }, 24: { - FzName: __ccgo_ts + 3628, + FzName: __ccgo_ts + 3658, }, 25: { - FzName: __ccgo_ts + 3635, + FzName: __ccgo_ts + 3665, }, 26: { - FzName: __ccgo_ts + 3647, + FzName: __ccgo_ts + 3677, }, 27: { - FzName: __ccgo_ts + 3656, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3662, + FzName: __ccgo_ts + 3692, }, } @@ -23993,7 +21097,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24031,10 +21135,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24171,9 +21275,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3668, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3698, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3711, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3741, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -24409,47 +21513,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24489,11 +21552,11 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint ** equivalent to errno. Otherwise, use strerror_r(). */ /* This is a threadsafe build, but strerror_r() is not available. */ - zErr = __ccgo_ts + 1663 + zErr = __ccgo_ts + 1667 if zPath == uintptr(0) { - zPath = __ccgo_ts + 1663 + zPath = __ccgo_ts + 1667 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3721, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3751, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24521,7 +21584,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3805, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3832, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25180,7 +22243,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25785,7 +22848,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]int8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3860, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3890, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint32(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -25811,7 +22874,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3575, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3605, bp, int32(42579)) } // C documentation @@ -25848,7 +22911,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<= nSize { iWrite = nSize - int64(1) } - nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1663, int32(1)) + nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1667, int32(1)) if nWrite != int32(1) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(3)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26396,7 +23370,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26459,7 +23433,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -26690,9 +23664,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte break } *(*int32)(unsafe.Pointer(bp + 144)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1663, int32(1), bp+144) != int32(1) { + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1667, int32(1), bp+144) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27460,10 +24433,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3917, - 3: __ccgo_ts + 3926, - 4: __ccgo_ts + 3935, - 5: __ccgo_ts + 1676, + 2: __ccgo_ts + 3947, + 3: __ccgo_ts + 3956, + 4: __ccgo_ts + 3965, + 5: __ccgo_ts + 1706, } // C documentation @@ -27472,8 +24445,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3940) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3954) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3970) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3984) } // C documentation @@ -27535,7 +24508,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = 0 - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3961, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3991, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -27707,7 +24680,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3978) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4008) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -27862,7 +24835,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3458, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3488, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -27939,7 +24912,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+144, libc.Uint32FromInt64(4098)-libc.Uint32FromInt32(2)) if got <= 0 || got >= libc.Int32FromInt64(4098)-libc.Int32FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3647, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3677, zIn, int32(45510)) return } (*(*[4098]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -28137,14 +25100,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if int32(*(*int8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+20, libc.Uint32FromInt64(4098)-libc.Uint32FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3476, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3506, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+20) } _appendAllPathElements(tls, bp, zPath) *(*int8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = 0 if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][125]Tu32 - FapSub [0][125]uintptr - FaBitmap [500]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -29949,7 +26752,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+12, uint32(500)) libc.Xmemset(tls, p+12, 0, uint32(500)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = ((*TBitvec)(unsafe.Pointer(p)).FiSize + (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4) - uint32(1)) / ((libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(4)) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / ((libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(4)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%((libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if (*TBitvec)(unsafe.Pointer(p)).FiDivisor < (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(1) * libc.Uint32FromInt32(BITVEC_SZELEM) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -30003,7 +26812,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if (*TBitvec)(unsafe.Pointer(p)).FiSize <= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { p1 = p + 12 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+12, uint32(500)) @@ -30122,7 +26931,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30176,7 +26985,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30210,66 +27019,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30443,14 +27192,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint32(52)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31266,123 +28015,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31463,7 +28095,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -31557,7 +28189,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -31598,7 +28230,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -31726,7 +28358,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -31746,17 +28378,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(uint32(4)*nNew)) + apNew = _sqlite3MallocZero(tls, uint64(4)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -31774,7 +28408,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4)) = pPage @@ -31786,7 +28420,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -31987,10 +28621,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint32(uint32(68) + uint32(52)*libc.Uint32FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint32(uint32(68) + uint32(52)*libc.Uint32FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*68 @@ -32576,25 +29211,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -33556,258 +30172,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -33906,7 +30270,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34135,7 +30499,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34153,7 +30517,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -34726,6 +31090,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35372,7 +31745,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -35384,7 +31758,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35405,11 +31779,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35438,7 +31813,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -35671,7 +32046,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -35808,7 +32183,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -35824,7 +32199,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -36571,10 +32946,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 184 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37475,7 +33850,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37519,7 +33894,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -37550,7 +33925,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -37601,7 +33976,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(232)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(journalFileSize*int32(2))+uint32(__SIZEOF_POINTER__)+uint32(4)+libc.Uint32FromInt32(nPathname)+uint32(1)+libc.Uint32FromInt32(nUriByte)+libc.Uint32FromInt32(nPathname)+uint32(8)+uint32(1)+libc.Uint32FromInt32(nPathname)+uint32(4)+uint32(1)+uint32(3))) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(232)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -37636,7 +34011,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint32FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4143, uint32(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4173, uint32(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -37646,7 +34021,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint32FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4152, uint32(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4182, uint32(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -37688,8 +34063,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4157, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4164, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4187, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4194, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -37772,7 +34147,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38028,7 +34403,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38203,7 +34578,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38234,7 +34609,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38306,7 +34681,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+4) @@ -39663,7 +36038,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 28 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -39931,7 +36306,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4174, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4204, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40497,7 +36872,6 @@ type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { FiPrior Tu32 FnSegment int32 - FaSegment [1]TWalSegment } type WalIterator = TWalIterator @@ -40512,227 +36886,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -40751,28 +36904,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -40831,7 +36963,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint32(uint32(4) * libc.Uint32FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = int64(4) * (int64(1) + int64(iPage)) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -40932,6 +37064,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41199,14 +37332,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41373,7 +37498,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41461,7 +37586,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ @@ -41600,7 +37725,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42041,10 +38166,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42142,7 +38267,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42181,7 +38306,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42194,7 +38319,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42210,7 +38335,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42231,7 +38356,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42297,7 +38422,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42347,7 +38472,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4229, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4259, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -42562,7 +38687,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -42588,7 +38720,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43311,8 +39443,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43399,7 +39531,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -43545,7 +39677,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -43572,7 +39704,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -43581,6 +39713,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -43625,6 +39758,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -43896,7 +40032,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44077,7 +40213,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44086,7 +40222,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44138,14 +40274,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -44691,283 +40827,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45100,27 +40959,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45283,10 +41121,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45295,14 +41134,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -46002,11 +41841,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46180,7 +42019,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46193,12 +42032,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46242,7 +42081,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46250,7 +42089,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46438,7 +42277,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46471,7 +42310,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46670,7 +42509,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint32(pCell) < uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint32(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -46710,12 +42549,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -46723,21 +42562,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint32FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -46784,12 +42623,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -46805,7 +42644,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -46865,7 +42704,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -46882,14 +42721,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -46932,11 +42771,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -46950,7 +42789,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -47003,42 +42842,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47046,70 +42883,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47155,7 +42992,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47181,7 +43018,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47220,12 +43057,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47252,7 +43089,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47283,11 +43120,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47316,11 +43153,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47329,7 +43166,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47351,15 +43188,13 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr)) + libc.Xmemset(tls, data+uintptr(hdr), 0, (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt8(int8(flags)) if flags&int32(PTF_LEAF) == 0 { @@ -47367,14 +43202,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint32(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint32(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47482,7 +43317,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -47544,7 +43379,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -47632,7 +43467,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4255) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4285) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48256,7 +44091,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48418,7 +44253,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4264, uint32(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4294, uint32(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48456,7 +44291,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 4)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 4)) @@ -48897,7 +44732,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -48921,7 +44756,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -48930,7 +44765,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -48944,7 +44779,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -48974,7 +44809,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49070,7 +44905,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49108,7 +44943,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) if *(*TPgno)(unsafe.Pointer(bp + 16)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 20))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 20)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 16)), bCommit) @@ -49175,7 +45010,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49218,7 +45053,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49248,7 +45083,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49714,7 +45549,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50106,7 +45941,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50116,7 +45951,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50173,7 +46008,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50247,7 +46082,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50382,7 +46217,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50394,7 +46229,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+108, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 60 @@ -50510,7 +46345,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50524,7 +46359,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -50758,7 +46593,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -50842,7 +46677,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -50854,7 +46689,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51056,7 +46891,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51089,7 +46924,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51098,7 +46933,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+108, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 60 @@ -51227,7 +47062,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51337,7 +47172,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51425,7 +47260,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51480,7 +47315,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51506,7 +47341,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51533,7 +47368,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+8, 0) @@ -51604,7 +47439,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51742,7 +47577,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = pMemPage @@ -51793,7 +47628,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 8)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -51802,7 +47637,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -51892,7 +47727,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -51910,7 +47745,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+4, bp) @@ -51933,7 +47768,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 4)), ovflPgno) } @@ -52154,10 +47989,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52448,17 +48283,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -52548,12 +48372,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint32(pCell) >= uint32(aData+uintptr(j)) && uint32(pCell) < uint32(pEnd) { if uint32(pCell+uintptr(sz)) > uint32(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int32(pCell)-int32(aData)) } else { if uint32(pCell+uintptr(sz)) > uint32(pSrcEnd) && uint32(pCell) < uint32(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -52561,7 +48385,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt32(int32(pData) - int32(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint32(sz)) i++ @@ -52656,7 +48480,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))+uintptr(sz)) > uint32(pEnd) && uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))) < uint32(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), libc.Uint32FromInt32(sz)) @@ -52737,7 +48561,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -52764,7 +48588,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -52804,7 +48628,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint32FromInt32(nCell*int32(2))) nCell -= nShift @@ -52875,7 +48699,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -52920,7 +48744,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53116,10 +48940,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+60 */ [5]Tu8 @@ -53242,8 +49067,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint32(libc.Uint32FromInt32(nMaxCells)*uint32(4) + libc.Uint32FromInt32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint32FromInt32(nMaxCells)*uint32(4) + libc.Uint32FromInt32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53283,7 +49108,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53306,7 +49131,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2, 0, uint32(2)*libc.Uint32FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53437,7 +49262,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 36)))[k-int32(1)] = 0 @@ -53480,7 +49305,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -53539,7 +49364,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -53571,7 +49396,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -53801,7 +49626,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 68 + 16 + uintptr(k)*4)) if uint32(pCell1) < uint32(pSrcEnd) && uint32(pCell1+uintptr(sz2)) > uint32(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54047,7 +49872,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54120,7 +49945,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 112 + uintptr(iPage-int32(1))*4)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 64 + uintptr(iPage-int32(1))*2))) @@ -54279,7 +50104,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54310,7 +50135,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54395,7 +50220,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54487,7 +50312,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54523,7 +50348,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -54553,10 +50378,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -54674,7 +50499,7 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { @@ -54689,14 +50514,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut + libc.Uint32FromInt32(int32(aOut)-int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + (int32(aOut) - int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 88)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -54796,21 +50621,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -54904,7 +50729,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -55014,7 +50839,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+4) if *(*TPgno)(unsafe.Pointer(bp + 4)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 4))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55055,7 +50880,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 8)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4)), bp+20, bp+24) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55136,14 +50961,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+4 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 4)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { return *(*int32)(unsafe.Pointer(bp + 4)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55280,7 +51105,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55545,7 +51370,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+48, __ccgo_ts+4268, int32(1)) + Xsqlite3_str_append(tls, pCheck+48, __ccgo_ts+4298, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+48, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -55593,11 +51418,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4270, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4300, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4293, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4323, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -55623,11 +51448,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4423, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4453, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -55699,11 +51524,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4462 + v2 = __ccgo_ts + 4492 } else { - v2 = __ccgo_ts + 4467 + v2 = __ccgo_ts + 4497 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4488, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4518, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -55839,12 +51664,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4514 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4544 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4532, libc.VaList(bp+48, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4562, libc.VaList(bp+48, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4686, libc.VaList(bp+48, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, libc.VaList(bp+48, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+16) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -55929,7 +51754,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4740, libc.VaList(bp+48, (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+48, (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -55952,7 +51777,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4764, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4794, 0) depth = d2 } } else { @@ -56029,7 +51854,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+12) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4789, libc.VaList(bp+48, *(*Tu32)(unsafe.Pointer(bp + 12))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4819, libc.VaList(bp+48, *(*Tu32)(unsafe.Pointer(bp + 12))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56043,7 +51868,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4826, libc.VaList(bp+48, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4856, libc.VaList(bp+48, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56134,7 +51959,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4878 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4908 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56158,11 +51983,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4889, libc.VaList(bp+208, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4919, libc.VaList(bp+208, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4934, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56199,10 +52024,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4989, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5019, libc.VaList(bp+208, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5009, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+208, i)) } goto _3 _3: @@ -56332,14 +52157,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -56550,45 +52375,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -56641,7 +52427,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3860, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -56651,7 +52437,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5041, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5071, libc.VaList(bp+296, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*16))).FpBt @@ -56680,7 +52466,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5061, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -56710,7 +52496,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5092, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5122, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57388,7 +53174,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5132, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+40, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57526,9 +53312,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -57703,20 +53486,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(80) defer tls.Free(80) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+32 */ TMem - libc.Xmemset(tls, bp, 0, uint32(32)) - libc.Xmemset(tls, bp+32, 0, uint32(40)) - (*(*TMem)(unsafe.Pointer(bp + 32))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 32))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 32 + var _ /* t at bp+28 */ TMem + libc.Xmemset(tls, bp, 0, uint32(28)) + libc.Xmemset(tls, bp+28, 0, uint32(40)) + (*(*TMem)(unsafe.Pointer(bp + 28))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 28))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 28 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 32))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 28))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+32, uint32(40)) + libc.Xmemcpy(tls, pMem, bp+28, uint32(40)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -57734,7 +53517,7 @@ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc bp := tls.Alloc(32) defer tls.Free(32) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58193,21 +53976,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58366,7 +54149,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58408,11 +54191,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58422,7 +54205,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58444,12 +54227,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58488,7 +54271,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -58600,8 +54383,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -58652,7 +54435,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -58660,8 +54444,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint32(uint32(40)*libc.Uint32FromInt32(nCol) + (libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint32(uint32(40)*libc.Uint32FromInt32(nCol) + (libc.Uint32FromInt64(28)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -58725,7 +54509,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -58764,14 +54548,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3860, libc.VaList(bp+40, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -58829,7 +54613,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1663 + zNeg = __ccgo_ts + 1667 rc = SQLITE_OK for { v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -58871,7 +54655,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5139 + zNeg = __ccgo_ts + 5169 } } } @@ -58886,7 +54670,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5141, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5171, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59190,7 +54974,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59206,7 +54990,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59216,7 +55000,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59267,9 +55051,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59343,7 +55127,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+100, 0, libc.Uint32FromInt64(224)-uint32(libc.UintptrFromInt32(0)+100)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 8 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 8 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 4 @@ -59677,12 +55461,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint32(uint32(32) + libc.Uint32FromInt32(nArg-libc.Int32FromInt32(1))*uint32(4)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+28)+libc.Uint32FromInt32(nArg)*libc.Uint32FromInt64(4))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -59856,7 +55639,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -59941,8 +55724,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -59955,11 +55738,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -59996,13 +55779,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*20))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60033,7 +55819,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -60535,7 +56321,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5146, libc.VaList(bp+32, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+32, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -60545,66 +56331,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5151) == 0 { - zColl = __ccgo_ts + 5158 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5181) == 0 { + zColl = __ccgo_ts + 5188 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5139 + v3 = __ccgo_ts + 5169 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5160 + v4 = __ccgo_ts + 5190 } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5163, libc.VaList(bp+32, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5193, libc.VaList(bp+32, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5187, libc.VaList(bp+32, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+32, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5203, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pOp + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5233, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pOp + 16)))) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1664 + zP4 = __ccgo_ts + 1668 } else { - zP4 = __ccgo_ts + 5206 + zP4 = __ccgo_ts + 5236 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5213, libc.VaList(bp+32, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5243, libc.VaList(bp+32, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -60619,20 +56405,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5221, libc.VaList(bp+32, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5251, libc.VaList(bp+32, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5226, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5256, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5228 + zP4 = __ccgo_ts + 5258 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5236, libc.VaList(bp+32, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5266, libc.VaList(bp+32, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -60646,10 +56432,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5173, - 1: __ccgo_ts + 5175, - 2: __ccgo_ts + 5177, - 3: __ccgo_ts + 5182, + 0: __ccgo_ts + 5203, + 1: __ccgo_ts + 5205, + 2: __ccgo_ts + 5207, + 3: __ccgo_ts + 5212, } // C documentation @@ -61465,7 +57251,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61473,7 +57259,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*40 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -61600,7 +57386,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5252, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5282, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -61608,18 +57394,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 4)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5264, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5294, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5278, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5308, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+8) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5293, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5323, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+4) @@ -61850,7 +57636,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63238,7 +59024,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 { @@ -63273,7 +59059,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 48)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63327,7 +59113,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 48))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63459,7 +59245,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -63611,7 +59397,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -63642,7 +59428,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -63793,15 +59579,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*20 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5336 + zContext = __ccgo_ts + 5366 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5355 + zContext = __ccgo_ts + 5385 } else { - zContext = __ccgo_ts + 5374 + zContext = __ccgo_ts + 5404 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5383, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5413, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -63896,10 +59682,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 108 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -63908,9 +59695,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+72) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+52) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -63990,7 +59777,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5419, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5449, 0) return int32(1) } else { return 0 @@ -64000,7 +59787,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5464, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5494, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64058,7 +59845,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64385,12 +60172,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64407,29 +60194,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64459,13 +60250,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64477,11 +60270,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -64489,23 +60286,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -64561,7 +60364,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5504, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5534, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -64762,7 +60565,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -64892,7 +60695,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65061,6 +60864,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65074,7 +60879,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65112,13 +60917,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65352,18 +61157,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5527, - 1: __ccgo_ts + 5532, - 2: __ccgo_ts + 5539, - 3: __ccgo_ts + 5542, - 4: __ccgo_ts + 5545, - 5: __ccgo_ts + 5548, - 6: __ccgo_ts + 5551, - 7: __ccgo_ts + 5554, - 8: __ccgo_ts + 5562, - 9: __ccgo_ts + 5565, - 10: __ccgo_ts + 5572, - 11: __ccgo_ts + 5580, + 0: __ccgo_ts + 5557, + 1: __ccgo_ts + 5562, + 2: __ccgo_ts + 5569, + 3: __ccgo_ts + 5572, + 4: __ccgo_ts + 5575, + 5: __ccgo_ts + 5578, + 6: __ccgo_ts + 5581, + 7: __ccgo_ts + 5584, + 8: __ccgo_ts + 5592, + 9: __ccgo_ts + 5595, + 10: __ccgo_ts + 5602, + 11: __ccgo_ts + 5610, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -65618,14 +61423,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5587, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5617, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -65663,7 +61468,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -65673,7 +61478,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*40 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -65684,24 +61489,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -65749,7 +61558,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -65757,32 +61568,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66199,11 +62016,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66212,7 +62029,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 72 + v1 = p + 52 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66226,7 +62043,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 36)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+16, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66261,7 +62078,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 44))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*4)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66296,7 +62113,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66362,11 +62179,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66389,7 +62206,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+16, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66538,7 +62355,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5627, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5657, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(zRawSql)-int32(zStart)) } } else { @@ -66570,13 +62387,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*40 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1668, int32(4)) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1424, libc.VaList(bp+80, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1428, libc.VaList(bp+80, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5132, libc.VaList(bp+80, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5162, libc.VaList(bp+80, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -66591,28 +62408,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 32 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5631, libc.VaList(bp+80, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5661, libc.VaList(bp+80, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+32) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5638, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5668, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5651, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5681, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5654, libc.VaList(bp+80, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5684, libc.VaList(bp+80, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5659, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -66776,9 +62593,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*40 } else { @@ -66804,12 +62621,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint32((uint32(libc.UintptrFromInt32(0)+84)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint32FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nField) + libc.Uint32FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = uintptr(0) @@ -66818,28 +62633,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = v3 libc.Xmemset(tls, pCx, 0, uint32(libc.UintptrFromInt32(0)+32)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 84 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint32(libc.UintptrFromInt32(0)+84)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint32FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 36))) } return pCx @@ -67212,11 +63027,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1133, - 1: __ccgo_ts + 1145, - 2: __ccgo_ts + 1150, - 3: __ccgo_ts + 1128, - 4: __ccgo_ts + 1664, + 0: __ccgo_ts + 1137, + 1: __ccgo_ts + 1149, + 2: __ccgo_ts + 1154, + 3: __ccgo_ts + 1132, + 4: __ccgo_ts + 1668, } // C documentation @@ -67230,12 +63045,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(704) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67252,7 +63067,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+448 */ Ti64 var _ /* nEntry at bp+80 */ Ti64 var _ /* nErr at bp+492 */ int32 - var _ /* nullFunc at bp+612 */ TFuncDef + var _ /* nullFunc at bp+608 */ TFuncDef var _ /* pVCur at bp+572 */ uintptr var _ /* pgno at bp+456 */ TPgno var _ /* r at bp+100 */ TUnpackedRecord @@ -67270,7 +63085,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+332 */ int32 var _ /* res at bp+96 */ int32 var _ /* rowid at bp+368 */ Ti64 - var _ /* rowid at bp+656 */ Tsqlite_int64 + var _ /* rowid at bp+648 */ Tsqlite_int64 var _ /* sContext at bp+580 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+532 */ TMem @@ -67984,19 +63799,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+672, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+664, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5695, libc.VaList(bp+672, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5725, libc.VaList(bp+664, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5716, libc.VaList(bp+672, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5746, libc.VaList(bp+664, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+672, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+664, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = (int32(pOp) - int32(aOp)) / 20 - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5723, libc.VaList(bp+672, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5753, libc.VaList(bp+664, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69210,7 +65025,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69226,6 +65041,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -69719,7 +65540,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*20 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -69822,7 +65643,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5747, libc.VaList(bp+672, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5775, libc.VaList(bp+664, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5861, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5889, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70418,7 +66239,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5915, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5943, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70448,12 +66269,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5970 + v250 = __ccgo_ts + 5998 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6018 + v251 = __ccgo_ts + 6046 } else { - v251 = __ccgo_ts + 6061 + v251 = __ccgo_ts + 6089 } v250 = v251 } @@ -70545,7 +66366,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6102) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6130) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -70863,7 +66684,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fz = __ccgo_ts + 1663 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fz = __ccgo_ts + 1667 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -71629,7 +67450,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 192)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 192)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+192, int8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 192))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -71656,7 +67477,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 188)) if *(*int32)(unsafe.Pointer(bp + 188)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72115,7 +67936,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -72548,7 +68369,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+404, db, uint16(0)) @@ -72878,7 +68699,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 460)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+672, *(*uintptr)(unsafe.Pointer(bp + 460)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+664, *(*uintptr)(unsafe.Pointer(bp + 460)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 460))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -72909,13 +68730,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+144, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6147 + zSchema = __ccgo_ts + 6175 (*(*TInitData)(unsafe.Pointer(bp + 464))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 464))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 464))).FpzErrMsg = p + 120 (*(*TInitData)(unsafe.Pointer(bp + 464))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 464))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6161, libc.VaList(bp+672, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6189, libc.VaList(bp+664, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -72930,7 +68751,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73167,7 +68988,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 116 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6204, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6232, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73184,15 +69005,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint32((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(nMem)*uint32(40) + libc.Uint32FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4) + libc.Uint32FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint32((libc.Uint32FromInt64(80)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(nMem)*uint32(40)+libc.Uint32FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4)) + (int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73273,11 +69094,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 528)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 520)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 520)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 528)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 60)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73489,7 +69310,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = uint64((libc.Uint32FromInt64(32) + libc.Uint32FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint32FromInt64(4) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + nAlloc = uint64((uint32(libc.UintptrFromInt32(0)+28) + libc.Uint32FromInt32(n4)*libc.Uint32FromInt64(4) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(40)) if pCtx == uintptr(0) { goto no_mem @@ -73539,7 +69360,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+672, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+664, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -73595,7 +69416,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+672, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+664, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -73674,11 +69495,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6241 + v286 = __ccgo_ts + 6269 } else { - v286 = __ccgo_ts + 6246 + v286 = __ccgo_ts + 6274 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6253, libc.VaList(bp+672, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6281, libc.VaList(bp+664, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -73831,7 +69652,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6305, libc.VaList(bp+672, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+664, z1)) } goto abort_due_to_error } @@ -73993,7 +69814,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6334, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6362, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74073,12 +69894,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 36)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+580, 0, uint32(32)) + libc.Xmemset(tls, bp+580, 0, uint32(28)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 612))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 612))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FpFunc = bp + 612 + (*(*TFuncDef)(unsafe.Pointer(bp + 608))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 608))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FpFunc = bp + 608 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74089,7 +69910,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 36)), bp+580, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+672, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+664, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 580))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74183,7 +70004,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 656)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 648)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74211,11 +70032,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+656) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+648) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 656)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 648)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74343,7 +70164,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+672, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+664, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+220, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74494,7 +70315,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+672, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+664, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -74581,15 +70402,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+4) @@ -75055,11 +70855,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3860 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+304, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+296, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+4) rc = _sqlite3ApiExit(tls, db, rc) @@ -75138,14 +70938,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75164,11 +70964,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75244,7 +71044,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75258,7 +71058,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3860 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -75525,108 +71325,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -75990,7 +71525,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76316,8 +71851,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76331,9 +71866,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint32(uint32(24) + libc.Uint32FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint32(4)) - sz = libc.Int32FromUint32(uint32(132) + libc.Uint32FromInt32(nWorker)*uint32(64)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+20) + uint32((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint32FromInt64(4)) + sz = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+68) + libc.Uint32FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint32FromInt64(64)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 36)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76481,8 +72016,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76531,18 +72066,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint32(uint32(16) + libc.Uint32FromInt32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(52))) + nByte = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(52))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -76676,7 +72212,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+12 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 12)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+12) @@ -76830,6 +72366,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78325,57 +73864,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -78672,7 +74160,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79375,25 +74863,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6651, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6680, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6659+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6678+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6688+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6707+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6147+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6175+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } @@ -79432,23 +74920,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+4 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79480,7 +74967,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6711, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6740, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -79574,7 +75061,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6716) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6745) != 0 { goto _2 } } @@ -79596,57 +75083,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+44) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 40)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 40)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 12 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -79691,11 +75165,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6718, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6747, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6722, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6751, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -79704,36 +75178,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 8)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6726, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6755, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 12 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -79762,18 +75225,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 152)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 180)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 156)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 184)) |= v6 } } } @@ -79820,15 +75283,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*20 + 8 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*20))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6735, libc.VaList(bp+16, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6764, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6766, libc.VaList(bp+16, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6795, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -79839,8 +75302,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -79880,7 +75343,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6821, libc.VaList(bp+16, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6850, libc.VaList(bp+16, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+44, 0, uint32(8)) return int32(WRC_Prune) @@ -79900,7 +75363,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -79909,7 +75372,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6856 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6885 *(*uintptr)(unsafe.Pointer(pExpr + 20)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -79919,26 +75382,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6865 + v8 = __ccgo_ts + 6894 } else { - v10 = __ccgo_ts + 6880 + v8 = __ccgo_ts + 6909 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6902, libc.VaList(bp+16, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6931, libc.VaList(bp+16, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+16, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+16, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6925, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+16, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+16, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -79987,8 +75450,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80062,19 +75525,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6993 + zIn = __ccgo_ts + 7022 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7021 + zIn = __ccgo_ts + 7050 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7039 + zIn = __ccgo_ts + 7068 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7057 + zIn = __ccgo_ts + 7086 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7075, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7104, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80100,7 +75563,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80246,7 +75709,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7095, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7124, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80301,7 +75764,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*20))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7112, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80325,7 +75788,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7205, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80339,13 +75802,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*20))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*20))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80365,16 +75828,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7212, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7241, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80385,35 +75845,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7240, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7269, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7283 + zType = __ccgo_ts + 7312 } else { - zType = __ccgo_ts + 7290 + zType = __ccgo_ts + 7319 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7300, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7329, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7328, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7350, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7379, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7394, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80498,7 +75961,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7442, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7471, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) } @@ -80510,7 +75973,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7453, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7482, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -80556,7 +76019,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -80681,7 +76144,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7464, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7493, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -80716,7 +76179,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 116 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7520, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -80754,7 +76217,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7554, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7583, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -80824,7 +76287,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20 + 8 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7560, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7589, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -80858,7 +76321,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 116 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7621, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7650, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81171,7 +76634,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7652, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7681, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81238,7 +76701,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81249,7 +76712,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7691) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7720) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81259,7 +76722,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7697, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7726, 0) return int32(WRC_Abort) } goto _6 @@ -81361,12 +76824,12 @@ func _sqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) (r int3 (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback = v1 (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback2 = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = pNC - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { return int32(SQLITE_ERROR) } _sqlite3WalkExprNN(tls, bp, pExpr) - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) *(*int32)(unsafe.Pointer(pNC + 24)) |= savedHasAgg return libc.BoolInt32((*TNameContext)(unsafe.Pointer(pNC)).FnNcErr > 0 || (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnErr > 0) @@ -81409,12 +76872,12 @@ func _sqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) (r if pExpr == uintptr(0) { goto _1 } - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { return int32(SQLITE_ERROR) } _sqlite3WalkExprNN(tls, bp, pExpr) - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_HasAgg)|libc.Int32FromInt32(NC_MinMaxAgg)|libc.Int32FromInt32(NC_HasWin)|libc.Int32FromInt32(NC_OrderAgg)) != 0 { *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) savedHasAgg |= (*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_MinMaxAgg) | libc.Int32FromInt32(NC_HasWin) | libc.Int32FromInt32(NC_OrderAgg)) @@ -81481,33 +76944,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+56 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+56, 0, uint32(36)) - libc.Xmemset(tls, bp, 0, uint32(56)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+36 */ [56]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint32(36)) + pSrc = bp + 36 + libc.Xmemset(tls, pSrc, 0, uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*16))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+56, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+56, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -81559,7 +77024,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*20))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -81767,7 +77232,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8))).FpExpr continue } @@ -82242,7 +77707,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82321,7 +77786,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 116 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7756, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82666,11 +78131,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7804 + v2 = __ccgo_ts + 7833 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7806, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7835, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 20)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -82716,10 +78181,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -82747,7 +78212,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 36)) = int32((*TToken)(unsafe.Pointer(pToken)).Fz) - int32((*TParse)(unsafe.Pointer(pParse)).FzTail) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 116 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7850, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7879, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 20)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -82767,7 +78232,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7884, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7913, libc.VaList(bp+8, p)) } // C documentation @@ -82838,7 +78303,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7934, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+8, pExpr)) } } } @@ -82876,7 +78341,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) if int32(*(*int8)(unsafe.Pointer(z + 1))) == 0 { /* Wildcard of the form "?". Assign the next variable number */ - v2 = pParse + 220 + v2 = pParse + 216 *(*TynVar)(unsafe.Pointer(v2))++ v1 = *(*TynVar)(unsafe.Pointer(v2)) x = v1 @@ -82890,7 +78355,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 116 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7954, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 116 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7983, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 116 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -82910,7 +78375,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n */ x = int16(_sqlite3VListNameToNum(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, libc.Int32FromUint32(n))) if int32(x) == 0 { - v4 = pParse + 220 + v4 = pParse + 216 *(*TynVar)(unsafe.Pointer(v4))++ v3 = *(*TynVar)(unsafe.Pointer(v4)) x = v3 @@ -82923,7 +78388,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 116 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7997, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83159,12 +78624,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83306,7 +78765,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint32(uint32(36) + uint32(24)*libc.Uint32FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12) + libc.Uint32FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint32FromInt64(24)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83446,7 +78905,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+8+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83467,27 +78925,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint32 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint32(48) * libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint32(0) - } - nByte = libc.Int32FromUint32(uint32(56) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint32FromInt64(48))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -83533,9 +78984,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 12 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 36)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -83545,8 +78996,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 40)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 40)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -83560,7 +79011,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(8)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint32(4))) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+4)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint32FromInt64(4))) if pNew == uintptr(0) { return uintptr(0) } @@ -83611,7 +79062,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -83692,7 +79143,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint32FromInt64(28)+libc.Uint32FromInt64(20)*libc.Uint32FromInt32(4))) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32(libc.Int32FromInt32(4))*libc.Uint32FromInt64(20))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -83710,7 +79161,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(28)+libc.Uint32FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint32(20))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint32FromInt64(20))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -83791,7 +79242,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -83920,7 +79371,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 116 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8050, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84018,10 +79469,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8073) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8102) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8078) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8107) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -84699,13 +80150,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8084) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8113) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8092) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8121) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8098) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8127) == 0 { return int32(1) } return 0 @@ -84720,32 +80171,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8084, - 1: __ccgo_ts + 8092, - 2: __ccgo_ts + 8098, + 0: __ccgo_ts + 8113, + 1: __ccgo_ts + 8121, + 2: __ccgo_ts + 8127, } ii = 0 for { if !(ii < libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -84954,7 +80392,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -85007,7 +80445,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8102, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8131, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85107,12 +80545,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -85704,7 +81143,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8317) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8346) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -85800,7 +81239,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return @@ -85835,9 +81274,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -85970,7 +81409,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 44))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86100,13 +81539,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -86886,7 +82330,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8410, libc.VaList(bp+120, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+120, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -86898,7 +82342,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -86913,7 +82357,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8437, libc.VaList(bp+120, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8466, libc.VaList(bp+120, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -86942,7 +82386,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 52)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87018,7 +82462,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+120, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+120, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87081,7 +82525,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87091,7 +82535,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87099,7 +82543,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*20))).FiSorterColumn, target) inReg = target break } @@ -87112,9 +82556,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87196,7 +82640,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8461, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8490, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87267,17 +82711,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87286,7 +82730,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*20 libc.SetBitFieldPtr16Uint32(pItem1+8+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87298,6 +82742,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(64) + defer tls.Free(64) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint32(52)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 44)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87317,7 +82782,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87387,7 +82852,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87431,7 +82896,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87504,7 +82969,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(160) defer tls.Free(160) var db, pDel uintptr @@ -87531,8 +82996,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 104))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 104))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+156)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -87698,7 +83163,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -87907,7 +83374,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88614,7 +84083,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -88843,10 +84312,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*16))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*20))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*16))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*20))).FpCExpr = pExpr } } } else { @@ -88884,7 +84353,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(16), pInfo+24, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(20), pInfo+28, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88898,7 +84367,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(24), pInfo+36, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(24), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88912,10 +84381,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 116 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -88925,25 +84397,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 16 + pCol += 20 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*16 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*20 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -88956,7 +84432,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -88966,11 +84442,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 20 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -88990,13 +84466,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(80) + defer tls.Free(80) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89066,7 +84542,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*16))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*20))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89102,6 +84578,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 116 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89119,44 +84596,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 24 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 44 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+64, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 48 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 48 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 44 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89236,7 +84718,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89244,7 +84726,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 19 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 168 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 136 + uintptr(v3)*4)) } // C documentation @@ -89262,7 +84744,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 19 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 168 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 136 + uintptr(v1)*4)) = iReg } } } @@ -89281,11 +84763,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 36)) += nReg - *(*int32)(unsafe.Pointer(pParse + 32)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 40)) += nReg + *(*int32)(unsafe.Pointer(pParse + 36)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg } return i } @@ -89403,8 +84885,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8511, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8569, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89422,10 +84904,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8539, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8714, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8772, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89441,9 +84923,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8888, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8946, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9035, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9093, 0) } } @@ -89499,7 +84981,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9186, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9244, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89508,11 +84990,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9245, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9303, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9251, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9309, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89542,21 +85024,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9278, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9336, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9462, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9520, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9767, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9783, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9825, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9899, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -89564,7 +85046,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -89572,7 +85054,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10106, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10164, 0) goto exit_rename_table exit_rename_table: ; @@ -89589,7 +85071,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10119, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10177, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -89629,11 +85111,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10157, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10215, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10189, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10247, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -89649,10 +85131,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 44))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10216) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10274) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10275) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10333) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -89664,13 +85146,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10328) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10386) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10374) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10432) } } /* Modify the CREATE TABLE statement. */ @@ -89684,7 +85166,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10401, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10459, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -89712,7 +85194,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10547, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10605, libc.VaList(bp+16, zTab, zDb)) } } } @@ -89750,12 +85232,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10900, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10958, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10934, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10992, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -89770,7 +85252,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(64)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(80)) if !(pNew != 0) { goto exit_begin_add_column } @@ -89779,7 +85261,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(uint32(12)*libc.Uint32FromInt32(nAlloc))) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10964, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11022, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -89840,18 +85322,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10988 + zType = __ccgo_ts + 11046 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11002 + v1 = __ccgo_ts + 11060 } else { - v1 = __ccgo_ts + 11019 + v1 = __ccgo_ts + 11077 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11037, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11095, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89898,25 +85380,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -89928,11 +85398,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11076, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11258, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11134, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11316, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10106, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10164, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -89942,31 +85412,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -89983,16 +85428,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90286,7 +85721,7 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) if pPtr == uintptr(0) { return uintptr(0) } - pp = pParse + 284 + pp = pParse + 280 for { if !(*(*uintptr)(unsafe.Pointer(pp)) != 0) { break @@ -90295,9 +85730,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90408,11 +85843,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11391, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11449, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90483,30 +85918,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11414, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11472, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90527,9 +85966,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -90545,15 +85983,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11422, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11480, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -90564,16 +86002,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint32FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -90590,21 +86028,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11428, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11486, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int32(zSql) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint32FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, nReplace) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint32FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -90630,7 +86068,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -90885,7 +86323,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp var xAuth Tsqlite3_xauth var _ /* sCtx at bp+0 */ TRenameCtx var _ /* sParse at bp+20 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bFKOnly, bQuote, bTemp, db, i, iCol, pExpr, pFKey, pIdx, pSelect, pStep, pTab, pTarget, pUpsertSet, rc, xAuth, zDb, zNew, zOld, zSql, zTable, v1, v2 db = Xsqlite3_context_db_handle(tls, context) zSql = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -90926,11 +86364,11 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = _renameParseSql(tls, bp+20, zDb, db, zSql, bTemp) /* Find tokens that need to be replaced. */ - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp + 20 - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameColumnExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + 20 + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameColumnExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp (*(*TRenameCtx)(unsafe.Pointer(bp))).FpTab = pTab if rc != SQLITE_OK { goto renameColumnFunc_done @@ -90940,7 +86378,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 20))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+20, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -90950,7 +86388,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } rc = v2 if rc == SQLITE_OK { - _sqlite3WalkSelect(tls, bp+308, pSelect) + _sqlite3WalkSelect(tls, bp+304, pSelect) } if rc != SQLITE_OK { goto renameColumnFunc_done @@ -90967,13 +86405,13 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp if (*(*TRenameCtx)(unsafe.Pointer(bp))).FiCol < 0 { _renameTokenFind(tls, bp+20, bp, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable+32) } - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpCheck) pIdx = (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpIndex for { if !(pIdx != 0) { break } - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) goto _3 _3: ; @@ -90984,7 +86422,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp if !(pIdx != 0) { break } - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) goto _4 _4: ; @@ -90996,7 +86434,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp break } pExpr = _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FaCol+uintptr(i)*12) - _sqlite3WalkExpr(tls, bp+308, pExpr) + _sqlite3WalkExpr(tls, bp+304, pExpr) goto _5 _5: ; @@ -91037,8 +86475,8 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } else { if (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex != 0 { - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FaColExpr) - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FaColExpr) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FpPartIdxWhere) } else { rc = _renameResolveTrigger(tls, bp+20) if rc != SQLITE_OK { @@ -91070,7 +86508,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp _renameColumnIdlistNames(tls, bp+20, bp, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger)).FpColumns, zOld) } /* Find tokens to edit in various expressions and selects */ - _renameWalkTrigger(tls, bp+308, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger) + _renameWalkTrigger(tls, bp+304, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger) } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) @@ -91082,7 +86520,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 20))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91166,15 +86604,15 @@ func _renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r in // ** -> 'CREATE TABLE t1(a REFERENCES t3)' // */ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { - bp := tls.Alloc(384) - defer tls.Free(384) + bp := tls.Alloc(368) + defer tls.Free(368) var bQuote, bTemp, i, isLegacy, rc int32 var db, pFKey, pItem, pSelect, pStep, pTab, pTrigger, zDb, zInput, zNew, zOld uintptr var xAuth Tsqlite3_xauth - var _ /* sCtx at bp+288 */ TRenameCtx - var _ /* sNC at bp+336 */ TNameContext + var _ /* sCtx at bp+284 */ TRenameCtx + var _ /* sNC at bp+332 */ TNameContext var _ /* sParse at bp+0 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bQuote, bTemp, db, i, isLegacy, pFKey, pItem, pSelect, pStep, pTab, pTrigger, rc, xAuth, zDb, zInput, zNew, zOld db = Xsqlite3_context_db_handle(tls, context) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -91188,13 +86626,13 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _sqlite3BtreeEnterAll(tls, db) - libc.Xmemset(tls, bp+288, 0, uint32(20)) - (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab = _sqlite3FindTable(tls, db, zOld, zDb) - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameTableExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameTableSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + 288 + libc.Xmemset(tls, bp+284, 0, uint32(20)) + (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab = _sqlite3FindTable(tls, db, zOld, zDb) + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameTableExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameTableSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) if rc == SQLITE_OK { isLegacy = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) @@ -91205,16 +86643,16 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect - libc.Xmemset(tls, bp+336, 0, uint32(36)) - (*(*TNameContext)(unsafe.Pointer(bp + 336))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + libc.Xmemset(tls, bp+332, 0, uint32(36)) + (*(*TNameContext)(unsafe.Pointer(bp + 332))).FpParse = bp + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr - })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+336) + })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+332) if (*(*TParse)(unsafe.Pointer(bp))).FnErr != 0 { rc = (*(*TParse)(unsafe.Pointer(bp))).Frc } else { - _sqlite3WalkSelect(tls, bp+308, (*(*struct { + _sqlite3WalkSelect(tls, bp+304, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect) } @@ -91232,7 +86670,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt break } if Xsqlite3_stricmp(tls, (*TFKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 { - _renameTokenFind(tls, bp, bp+288, (*TFKey)(unsafe.Pointer(pFKey)).FzTo) + _renameTokenFind(tls, bp, bp+284, (*TFKey)(unsafe.Pointer(pFKey)).FzTo) } goto _1 _1: @@ -91244,35 +86682,35 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt ** expressions. Also update the name that appears right after the ** "CREATE [VIRTUAL] TABLE" bit. */ if Xsqlite3_stricmp(tls, zOld, (*TTable)(unsafe.Pointer(pTab)).FzName) == 0 { - (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab = pTab + (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab = pTab if isLegacy == 0 { - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer(pTab)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer(pTab)).FpCheck) } - _renameTokenFind(tls, bp, bp+288, (*TTable)(unsafe.Pointer(pTab)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TTable)(unsafe.Pointer(pTab)).FzName) } } } else { if (*(*TParse)(unsafe.Pointer(bp))).FpNewIndex != 0 { - _renameTokenFind(tls, bp, bp+288, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FzName) if isLegacy == 0 { - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) } } else { pTrigger = (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger - if 0 == Xsqlite3_stricmp(tls, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable, zOld) && (*TTable)(unsafe.Pointer((*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab)).FpSchema == (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema { - _renameTokenFind(tls, bp, bp+288, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable) + if 0 == Xsqlite3_stricmp(tls, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable, zOld) && (*TTable)(unsafe.Pointer((*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab)).FpSchema == (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema { + _renameTokenFind(tls, bp, bp+284, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable) } if isLegacy == 0 { rc = _renameResolveTrigger(tls, bp) if rc == SQLITE_OK { - _renameWalkTrigger(tls, bp+308, pTrigger) + _renameWalkTrigger(tls, bp+304, pTrigger) pStep = (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list for { if !(pStep != 0) { break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0 && 0 == Xsqlite3_stricmp(tls, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget, zOld) { - _renameTokenFind(tls, bp, bp+288, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) + _renameTokenFind(tls, bp, bp+284, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) } if (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { i = 0 @@ -91282,7 +86720,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } pItem = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*48 if 0 == Xsqlite3_stricmp(tls, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, zOld) { - _renameTokenFind(tls, bp, bp+288, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } goto _3 _3: @@ -91301,21 +86739,21 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } } if rc == SQLITE_OK { - rc = _renameEditSql(tls, context, bp+288, zInput, zNew, bQuote) + rc = _renameEditSql(tls, context, bp+284, zInput, zNew, bQuote) } if rc != SQLITE_OK { if rc == int32(SQLITE_ERROR) && _sqlite3WritableSchema(tls, db) != 0 { Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*4))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } } } _renameParseCleanup(tls, bp) - _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpList) + _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpList) _sqlite3BtreeLeaveAll(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth } @@ -91364,9 +86802,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin var db, pSelect, zDb, zInput uintptr var i, rc, v1 int32 var xAuth Tsqlite3_xauth - var _ /* sCtx at bp+288 */ TRenameCtx + var _ /* sCtx at bp+284 */ TRenameCtx var _ /* sParse at bp+0 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _ = db, i, pSelect, rc, xAuth, zDb, zInput, v1 db = Xsqlite3_context_db_handle(tls, context) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -91379,18 +86817,18 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin rc = _renameParseSql(tls, bp, zDb, db, zInput, 0) if rc == SQLITE_OK { /* Walker to find tokens that need to be replaced. */ - libc.Xmemset(tls, bp+288, 0, uint32(20)) - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameQuotefixExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + 288 + libc.Xmemset(tls, bp+284, 0, uint32(20)) + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameQuotefixExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 if (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 { if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91400,16 +86838,16 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin } rc = v1 if rc == SQLITE_OK { - _sqlite3WalkSelect(tls, bp+308, pSelect) + _sqlite3WalkSelect(tls, bp+304, pSelect) } } else { - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FpCheck) i = 0 for { if !(i < int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FnCol)) { break } - _sqlite3WalkExpr(tls, bp+308, _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FaCol+uintptr(i)*12)) + _sqlite3WalkExpr(tls, bp+304, _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FaCol+uintptr(i)*12)) goto _2 _2: ; @@ -91418,19 +86856,19 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin } } else { if (*(*TParse)(unsafe.Pointer(bp))).FpNewIndex != 0 { - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FaColExpr) - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FaColExpr) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) } else { rc = _renameResolveTrigger(tls, bp) if rc == SQLITE_OK { - _renameWalkTrigger(tls, bp+308, (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger) + _renameWalkTrigger(tls, bp+304, (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger) } } } if rc == SQLITE_OK { - rc = _renameEditSql(tls, context, bp+288, zInput, uintptr(0), 0) + rc = _renameEditSql(tls, context, bp+284, zInput, uintptr(0), 0) } - _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpList) + _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpList) } if rc != SQLITE_OK { if _sqlite3WritableSchema(tls, db) != 0 && rc == int32(SQLITE_ERROR) { @@ -91472,12 +86910,13 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin // ** C. Otherwise return NULL. // */ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { - bp := tls.Alloc(336) - defer tls.Free(336) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + bp := tls.Alloc(320) + defer tls.Free(320) + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth - var _ /* sNC at bp+288 */ TNameContext + var _ /* sNC at bp+284 */ TNameContext var _ /* sParse at bp+0 */ TParse _, _, _, _, _, _, _, _, _, _, _, _ = bNoDQS, bTemp, db, flags, i1, i2, isLegacy, rc, xAuth, zDb, zInput, zWhen db = Xsqlite3_context_db_handle(tls, context) @@ -91491,19 +86930,19 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 28)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { - libc.Xmemset(tls, bp+288, 0, uint32(36)) - (*(*TNameContext)(unsafe.Pointer(bp + 288))).FpParse = bp + libc.Xmemset(tls, bp+284, 0, uint32(36)) + (*(*TNameContext)(unsafe.Pointer(bp + 284))).FpParse = bp _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr - })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect, bp+288) + })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect, bp+284) if (*(*TParse)(unsafe.Pointer(bp))).FnErr != 0 { rc = (*(*TParse)(unsafe.Pointer(bp))).Frc } @@ -91570,7 +87009,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) @@ -91587,7 +87026,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11433, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11491, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -91642,23 +87081,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11440 + v1 = __ccgo_ts + 11498 } else { - v1 = __ccgo_ts + 5670 + v1 = __ccgo_ts + 5700 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11452, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11510, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11480, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -91668,33 +87107,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11528, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11586, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11649, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11707, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 48)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 52)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -91708,7 +87147,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -91719,8 +87158,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -91781,27 +87220,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11667, + FzName: __ccgo_ts + 11725, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11688, + FzName: __ccgo_ts + 11746, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11708, + FzName: __ccgo_ts + 11766, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11727, + FzName: __ccgo_ts + 11785, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11746, + FzName: __ccgo_ts + 11804, }, } @@ -92012,8 +87451,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11849, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11907, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92023,10 +87467,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11902, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11960, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92058,15 +87502,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11769, - FzCols: __ccgo_ts + 11782, + FzName: __ccgo_ts + 11827, + FzCols: __ccgo_ts + 11840, }, 1: { - FzName: __ccgo_ts + 11795, - FzCols: __ccgo_ts + 11808, + FzName: __ccgo_ts + 11853, + FzCols: __ccgo_ts + 11866, }, 2: { - FzName: __ccgo_ts + 11836, + FzName: __ccgo_ts + 11894, }, } @@ -92119,44 +87563,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92280,7 +87686,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92296,12 +87703,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint32(uint32(112) + uint32(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint32(n) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint32(uint32(112) + uint32(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anDLt */ + n += libc.Int64FromUint32(uint32(8) * libc.Uint32FromInt32(nColUp)) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint32(n) + (libc.Uint32FromInt64(8)*libc.Uint32FromInt32(nColUp) + libc.Uint32FromInt64(36)*libc.Uint32FromInt32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*libc.Uint32FromInt32(nColUp)*libc.Uint32FromInt32(nCol+mxSample))) + n += libc.Int64FromUint32(uint32(8)*libc.Uint32FromInt32(nColUp) + uint32(36)*libc.Uint32FromInt32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*libc.Uint32FromInt32(nColUp)*libc.Uint32FromInt32(nCol+mxSample)) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92309,7 +87716,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92368,7 +87775,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11920, + FzName: __ccgo_ts + 11978, } func init() { @@ -92742,7 +88149,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11930, + FzName: __ccgo_ts + 11988, } func init() { @@ -92792,7 +88199,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11940, libc.VaList(bp+56, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11998, libc.VaList(bp+56, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -92803,7 +88210,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11945, libc.VaList(bp+56, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12003, libc.VaList(bp+56, iVal)) goto _2 _2: ; @@ -92842,7 +88249,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+11951, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+12009, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -92860,7 +88267,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11957, + FzName: __ccgo_ts + 12015, } func init() { @@ -92926,7 +88333,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11966, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12024, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -92935,12 +88342,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(64)+libc.Uint32FromInt32(13))) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(80)+libc.Uint32FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*64 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11769, uint32(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*80 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11827, uint32(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93142,7 +88549,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93173,7 +88580,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93264,7 +88671,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93301,7 +88708,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93334,11 +88741,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11980) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12038) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11984) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12042) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93446,13 +88853,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93467,7 +88867,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1663 + z = __ccgo_ts + 1667 } i = 0 for { @@ -93502,17 +88902,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11988, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12046, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+11999, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12057, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12009, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12067, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93524,13 +88924,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -93891,11 +89284,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11795, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11853, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12021, __ccgo_ts+12090, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12079, __ccgo_ts+12148, zDb) } return rc } @@ -93961,10 +89354,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11769, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12142, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12200, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94077,7 +89470,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6711, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6740, zName) == 0) } // C documentation @@ -94119,21 +89512,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1663 + zFile = __ccgo_ts + 1667 } if zName == uintptr(0) { - zName = __ccgo_ts + 1663 + zName = __ccgo_ts + 1667 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 168 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 20)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4032) + *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4062) if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+12183, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+12241, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 20))) if pNewSchema != 0 { @@ -94164,7 +89557,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 116 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12186, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 116 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12244, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 116 + 7*4)))) goto attach_error } i = 0 @@ -94173,7 +89566,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12223, libc.VaList(bp+32, zName)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12281, libc.VaList(bp+32, zName)) goto attach_error } goto _1 @@ -94191,7 +89584,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint32FromInt64(16)*libc.Uint32FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(uint32(16)*libc.Uint32FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1)))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(int64(16)*(int64(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb)))) if aNew == uintptr(0) { return } @@ -94229,7 +89622,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12253, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94237,7 +89630,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12282, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12340, 0) rc = int32(SQLITE_ERROR) } } @@ -94281,10 +89674,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12378, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12436, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12399, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12425, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12483, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94449,7 +89842,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12447, + FzName: __ccgo_ts + 12505, } func init() { @@ -94471,7 +89864,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12461, + FzName: __ccgo_ts + 12519, } func init() { @@ -94497,7 +89890,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12475, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12533, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94531,7 +89924,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 44)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 44))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12499, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 44)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12557, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 44)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 44))) @@ -94658,6 +90051,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -94730,9 +90125,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -94748,7 +90143,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12603, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -94776,11 +90171,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12568, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12626, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12574, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12632, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12580, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12638, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -94840,7 +90235,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName } else { - zCol = __ccgo_ts + 8092 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -94875,7 +90270,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12607, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12665, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -94912,47 +90307,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -94993,7 +90347,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint32(uint32(16) * libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 120 + v4 = pToplevel + 108 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*16 @@ -95091,7 +90445,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95169,7 +90525,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95183,7 +90539,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95249,13 +90607,13 @@ func _sqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint return } (*TParse)(unsafe.Pointer(pParse)).Fnested++ - libc.Xmemcpy(tls, bp, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemcpy(tls, bp, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_PreferBuiltin) _sqlite3RunParser(tls, pParse, zSql) (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags _sqlite3DbFree(tls, db, zSql) - libc.Xmemcpy(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), bp, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemcpy(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), bp, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*TParse)(unsafe.Pointer(pParse)).Fnested-- } @@ -95296,21 +90654,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6711) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6740) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6688) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, __ccgo_ts+6147) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95340,12 +90698,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6147) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6175) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6688) } } } @@ -95383,7 +90741,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+396, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12622, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12680, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95393,7 +90751,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95401,15 +90759,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12630 + v1 = __ccgo_ts + 12688 } else { - v1 = __ccgo_ts + 12643 + v1 = __ccgo_ts + 12701 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95447,12 +90805,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - return __ccgo_ts + 6697 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + return __ccgo_ts + 6726 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6659+7) == 0 { - return __ccgo_ts + 6678 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6688+7) == 0 { + return __ccgo_ts + 6707 } } return zName @@ -95576,9 +90934,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -95977,7 +91335,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6147) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6175) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96009,7 +91367,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6711, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6740, zName) { break } goto _1 @@ -96067,13 +91425,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12657, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12674, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96117,12 +91475,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*4))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*4))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12694, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12752, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96158,23 +91516,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96294,7 +91654,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96337,9 +91697,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96352,7 +91712,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12736, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12794, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96368,9 +91728,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10983 + v2 = __ccgo_ts + 11041 } else { - v2 = __ccgo_ts + 9245 + v2 = __ccgo_ts + 9303 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96380,9 +91740,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96406,11 +91766,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10983 + v4 = __ccgo_ts + 11041 } else { - v4 = __ccgo_ts + 9245 + v4 = __ccgo_ts + 9303 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12777, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96418,11 +91778,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12798, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12856, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96454,19 +91814,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 48 + v9 = pParse + 52 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid = v7 reg1 = v7 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot = v10 reg2 = v10 - v14 = pParse + 48 + v14 = pParse + 52 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96486,15 +91856,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - *(*int32)(unsafe.Pointer(pParse + 148)) = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96509,7 +91884,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -96570,7 +91945,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12833, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -96579,14 +91954,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 148)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+12867, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+12925, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 104 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -96618,11 +91995,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(32) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 8)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -96633,7 +92010,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 116 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -96643,12 +92020,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12910, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12968, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12917, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12975, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- @@ -96690,21 +92067,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, (*(*TToken)(unsafe.Pointer(bp))).Fn) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12927, libc.VaList(bp+24, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+24, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64((int64((*TTable)(unsafe.Pointer(p)).FnCol)+int64(1))*int64(12))) if aNew == uintptr(0) { @@ -96715,7 +92081,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*12 libc.Xmemset(tls, pCol, 0, uint32(12)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -96728,12 +92094,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 10 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 10 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint32((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint32(16)) + *(*Tu8)(unsafe.Pointer(p + 64 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn = uint32(0) } // C documentation @@ -96905,10 +92280,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*12 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13011, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12998, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13056, 0) } else { libc.Xmemset(tls, bp, 0, uint32(52)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -96966,7 +92341,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 10 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13039, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13097, 0) } } @@ -96994,8 +92369,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -97003,7 +92378,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13091, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13149, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_HasPrimaryKey) @@ -97022,21 +92397,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97059,7 +92423,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13132, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97087,8 +92451,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*16))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+84, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+188+12, int32(1)) } else { zStart++ for { @@ -97175,17 +92544,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*12 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13188, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13231, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13289, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13239, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13297, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97217,7 +92586,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13304, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97358,9 +92727,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97371,31 +92741,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 12 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1663 - zSep2 = __ccgo_ts + 13277 - zEnd = __ccgo_ts + 5171 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1667 + zSep2 = __ccgo_ts + 13335 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13279 - zSep2 = __ccgo_ts + 13283 - zEnd = __ccgo_ts + 13288 + zSep = __ccgo_ts + 13337 + zSep2 = __ccgo_ts + 13341 + zEnd = __ccgo_ts + 13346 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13291, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13349, uint32(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97406,8 +92776,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint32FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97420,17 +92791,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 12 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3860, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint32FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1663, - 1: __ccgo_ts + 13305, - 2: __ccgo_ts + 13311, - 3: __ccgo_ts + 13316, - 4: __ccgo_ts + 13321, - 5: __ccgo_ts + 13311, + 0: __ccgo_ts + 1667, + 1: __ccgo_ts + 13363, + 2: __ccgo_ts + 13369, + 3: __ccgo_ts + 13374, + 4: __ccgo_ts + 13379, + 5: __ccgo_ts + 13369, } // C documentation @@ -97439,15 +92811,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint32((libc.Uint32FromInt64(4) + libc.Uint32FromInt64(2) + libc.Uint32FromInt64(2) + libc.Uint32FromInt32(1)) * libc.Uint32FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(2)+libc.Uint32FromInt64(2)+libc.Uint32FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97462,7 +92835,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint32(2) * libc.Uint32FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -97695,8 +93068,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if *(*int32)(unsafe.Pointer(pParse + 148)) != 0 { - _sqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 148)), int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -97796,7 +93179,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -97809,8 +93192,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*4)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -97840,7 +93223,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98032,7 +93415,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -98059,9 +93442,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*12 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13327, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13385, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13360, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13418, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98082,11 +93465,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13387, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13445, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13437, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13495, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 28)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98133,7 +93516,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13469, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13527, 0) return } } @@ -98167,16 +93550,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9245 - zType2 = __ccgo_ts + 13513 + zType = __ccgo_ts + 9303 + zType2 = __ccgo_ts + 13571 } else { /* A view */ - zType = __ccgo_ts + 10983 - zType2 = __ccgo_ts + 13519 + zType = __ccgo_ts + 11041 + zType2 = __ccgo_ts + 13577 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98193,24 +93576,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 44 + v5 = pParse + 48 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 48 + v7 = pParse + 52 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 48 + v9 = pParse + 52 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 48 + v11 = pParse + 52 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98249,7 +93637,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr zStmt = _createTableStmt(tls, db, p) } else { if tabOpts != 0 { - v13 = pParse + 212 + v13 = pParse + 208 } else { v13 = pEnd } @@ -98258,13 +93646,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13524, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13539, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13597, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98273,15 +93671,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13637, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13695, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13679, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13737, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13713, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13771, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98299,7 +93697,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9767) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9825) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98332,7 +93730,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 60)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13734, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13792, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98349,7 +93747,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+60) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+10983, *(*uintptr)(unsafe.Pointer(bp + 60))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+11041, *(*uintptr)(unsafe.Pointer(bp + 60))) if _sqlite3FixSelect(tls, bp+8, pSelect) != 0 { goto create_view_fail } @@ -98446,7 +93844,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13770, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13828, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -98630,7 +94028,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13800, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13858, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -98643,7 +94041,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13815, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*16))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13873, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*16))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -98726,9 +94124,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13882, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13940, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -98769,7 +94167,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13896, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -98778,7 +94176,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13941, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13999, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -98813,11 +94211,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3483, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3513, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7453, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7482, int32(10)) == 0 { return 0 } return int32(1) @@ -98872,9 +94270,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName @@ -98907,18 +94305,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14008, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14066, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14036, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14070, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14128, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -98928,7 +94326,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12042, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -98976,19 +94374,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14102, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*12))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14160, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*12))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14165, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint32(uint32(44) + libc.Uint32FromInt32(nCol-libc.Int32FromInt32(1))*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+36) + libc.Uint32FromInt32(nCol)*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) if pToCol != 0 { i = 0 for { @@ -99045,7 +94443,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14259, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14317, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99160,11 +94558,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99186,7 +94584,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 44 + v6 = pParse + 48 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99231,13 +94629,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99260,23 +94658,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint32((libc.Uint32FromInt64(100)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(4)*libc.Uint32FromInt16(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(2)*libc.Uint32FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint32(2)*libc.Uint32FromInt16(nCol)+uint32(1)*libc.Uint32FromInt16(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint32((libc.Uint32FromInt64(100)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(4)*libc.Uint32FromInt32(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(2)*libc.Uint32FromInt32(nCol+libc.Int32FromInt32(1))+uint32(2)*libc.Uint32FromInt32(nCol)+uint32(1)*libc.Uint32FromInt32(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint32FromInt64(100)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint32FromInt64(4)*libc.Uint32FromInt16(nCol) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nCol) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint32(2) * libc.Uint32FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint32(2) * libc.Uint32FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint32(2) * libc.Uint32FromInt16(nCol)) + pExtra += uintptr(uint32(2) * libc.Uint32FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99305,11 +94703,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 8 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14305 + v2 = __ccgo_ts + 14363 } else { - v2 = __ccgo_ts + 14311 + v2 = __ccgo_ts + 14369 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14316, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14374, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99387,7 +94785,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14344, *(*uintptr)(unsafe.Pointer(bp + 52))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14402, *(*uintptr)(unsafe.Pointer(bp + 52))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99397,7 +94795,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14350, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14408, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99411,16 +94809,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14400, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14458, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14428, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14453, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14511, 0) goto exit_create_index } /* @@ -99441,19 +94839,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14344, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14402, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14487, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14545, libc.VaList(bp+80, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14521, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14579, libc.VaList(bp+80, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99474,7 +94872,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14545, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14603, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99492,9 +94890,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99522,7 +94920,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14344) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14402) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -99554,7 +94952,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+56) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+56) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -99606,7 +95004,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14568, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14626, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -99616,7 +95014,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -99626,8 +95024,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -99705,7 +95103,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 5, 0x20) @@ -99753,7 +95151,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14629, libc.VaList(bp+80, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14687, libc.VaList(bp+80, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -99783,8 +95181,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14671, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14729, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -99797,7 +95195,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -99824,11 +95222,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1663 + v13 = __ccgo_ts + 1667 } else { - v13 = __ccgo_ts + 14688 + v13 = __ccgo_ts + 14746 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14696, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14754, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -99836,7 +95234,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14716, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14774, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -99844,7 +95242,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14775, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -100007,16 +95405,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 44))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14860, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 44))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14820, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14878, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100024,9 +95422,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100042,8 +95440,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14893, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11980, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14951, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12038, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100116,12 +95514,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(8)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+4)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(8)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint32(4))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(libc.UintptrFromInt32(0)+4)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100233,13 +95631,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14953, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, libc.Uint64FromInt64(int64(56)+(nAlloc-int64(1))*int64(48))) + pNew = _sqlite3DbRealloc(tls, db, pSrc, libc.Uint64FromInt64(libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+8))+nAlloc*libc.Int64FromInt64(48))) if pNew == uintptr(0) { return uintptr(0) } @@ -100320,7 +95718,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(48))) if pList == uintptr(0) { return uintptr(0) } @@ -100370,7 +95768,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -100541,11 +95939,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14989 + v1 = __ccgo_ts + 15047 } else { - v1 = __ccgo_ts + 14992 + v1 = __ccgo_ts + 15050 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14998, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15056, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -100744,7 +96142,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15034, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15092, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -100791,9 +96189,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15040 + v1 = __ccgo_ts + 15098 } else { - v1 = __ccgo_ts + 15049 + v1 = __ccgo_ts + 15107 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -100825,9 +96223,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15034, - 1: __ccgo_ts + 15056, - 2: __ccgo_ts + 15040, + 0: __ccgo_ts + 15092, + 1: __ccgo_ts + 15114, + 2: __ccgo_ts + 15098, } // C documentation @@ -100847,7 +96245,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15064, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15122, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -100872,7 +96270,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101303,7 +96701,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102185,11 +97581,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15297, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15326, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102293,7 +97689,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102350,7 +97746,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 116 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15400, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15458, -int32(1)) return } if argc == int32(3) { @@ -104069,7 +99470,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15433, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15491, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+4) @@ -104151,7 +99552,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))) } // C documentation @@ -104223,32 +99624,32 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15478, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15536, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15486, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15544, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1424, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1428, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -104276,13 +99677,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15494, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15552 + } else { + v2 = __ccgo_ts + 15556 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1668, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint32FromInt32(n)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15559, -int32(1)) + return +} + // C documentation // // /* @@ -104294,6 +99831,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104304,7 +99845,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 116))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(Xsqlite3_user_data(tls, context))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -104515,7 +100056,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1663 + zPass = __ccgo_ts + 1667 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104828,7 +100369,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11389, + 0: __ccgo_ts + 11447, } // C documentation @@ -104840,8 +100381,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -104856,7 +100397,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -104868,16 +100409,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint32FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint32FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint32FromInt32(k)) + j += int64(k) } } goto _2 @@ -104896,7 +100437,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1663) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1667) } // C documentation @@ -104942,7 +100483,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1663 + zIn = __ccgo_ts + 1667 } i = 0 for { @@ -104988,7 +100529,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15497, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15582, int32(4), libc.UintptrFromInt32(0)) } } @@ -105049,7 +100590,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12607, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12665, -int32(1)) return } if argc == int32(2) { @@ -105080,17 +100621,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105159,7 +100689,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105241,7 +100771,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15377, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105304,12 +100834,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105571,7 +101095,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1663, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1667, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -105591,7 +101115,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15502, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15587, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -105620,8 +101144,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15508, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15508, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15593, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15593, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -105801,11 +101325,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -105909,7 +101433,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint32(libc.Uint32FromInt64(4160)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint32(libc.Uint32FromInt64(4240)/libc.Uint32FromInt64(40))) } /* @@ -105922,542 +101446,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row)), - FzName: __ccgo_ts + 15513, + FzName: __ccgo_ts + 15598, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_compare)), - FzName: __ccgo_ts + 15533, + FzName: __ccgo_ts + 15618, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr)), - FzName: __ccgo_ts + 15546, + FzName: __ccgo_ts + 15631, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_affinity)), - FzName: __ccgo_ts + 15564, + FzName: __ccgo_ts + 15649, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15573, + FzName: __ccgo_ts + 15658, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15596, + FzName: __ccgo_ts + 15681, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15622, + FzName: __ccgo_ts + 15707, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 15647, + FzName: __ccgo_ts + 15732, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 15656, + FzName: __ccgo_ts + 15741, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 15667, + FzName: __ccgo_ts + 15752, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_sqlite_offset)), - FzName: __ccgo_ts + 15674, + FzName: __ccgo_ts + 15759, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15713, + FzName: __ccgo_ts + 15798, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15720, + FzName: __ccgo_ts + 15805, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15728, + FzName: __ccgo_ts + 15813, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15735, + FzName: __ccgo_ts + 15820, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15748, + FzName: __ccgo_ts + 15833, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15754, + FzName: __ccgo_ts + 15839, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15761, + FzName: __ccgo_ts + 15846, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15768, + FzName: __ccgo_ts + 15853, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15776, + FzName: __ccgo_ts + 15861, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15781, + FzName: __ccgo_ts + 15866, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15791, + FzName: __ccgo_ts + 15876, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15797, + FzName: __ccgo_ts + 15882, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15803, + FzName: __ccgo_ts + 15888, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15813, + FzName: __ccgo_ts + 15898, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15820, + FzName: __ccgo_ts + 15905, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15830, + FzName: __ccgo_ts + 15915, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15837, + FzName: __ccgo_ts + 15922, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15844, + FzName: __ccgo_ts + 15929, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15855, + FzName: __ccgo_ts + 15940, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15862, + FzName: __ccgo_ts + 15947, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15877, + FzName: __ccgo_ts + 15962, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15894, + FzName: __ccgo_ts + 15979, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15905, + FzName: __ccgo_ts + 15990, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15911, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15997, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15929, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16003, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15937, + FzName: __ccgo_ts + 16016, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15951, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16034, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15959, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16042, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16056, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16064, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15985, + FzName: __ccgo_ts + 16090, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15989, + FzName: __ccgo_ts + 16094, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15995, + FzName: __ccgo_ts + 16100, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16018, + FzName: __ccgo_ts + 16123, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16029, + FzName: __ccgo_ts + 16134, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, + FzName: __ccgo_ts + 15593, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16034, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1236, + FzName: __ccgo_ts + 15593, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1244, + FzName: __ccgo_ts + 16139, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16039, + FzName: __ccgo_ts + 1240, }, 74: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16045, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1248, }, 75: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 16048, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16144, }, 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 16150, }, 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 16058, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16153, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16048, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16157, }, 79: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16063, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(libc.Int32FromInt32(2)), + FzName: __ccgo_ts + 16163, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16067, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16153, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16071, + FzName: __ccgo_ts + 16168, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16077, + FzName: __ccgo_ts + 16172, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16081, + FzName: __ccgo_ts + 16176, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16086, + FzName: __ccgo_ts + 16182, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16091, + FzName: __ccgo_ts + 16186, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16096, + FzName: __ccgo_ts + 16191, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16102, + FzName: __ccgo_ts + 16196, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16106, + FzName: __ccgo_ts + 16201, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, + FzName: __ccgo_ts + 16207, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16114, + FzName: __ccgo_ts + 16211, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, + FzName: __ccgo_ts + 16215, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16124, + FzName: __ccgo_ts + 16219, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16129, + FzName: __ccgo_ts + 16224, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16135, + FzName: __ccgo_ts + 16229, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16141, + FzName: __ccgo_ts + 16234, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16147, + FzName: __ccgo_ts + 16240, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16152, + FzName: __ccgo_ts + 16246, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16160, + FzName: __ccgo_ts + 16252, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16168, + FzName: __ccgo_ts + 16257, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16171, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16265, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16273, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16276, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6856, + FzName: __ccgo_ts + 6885, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_iif)), - FzName: __ccgo_ts + 16176, + FzName: __ccgo_ts + 16281, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_iif)), - FzName: __ccgo_ts + 16180, + FzName: __ccgo_ts + 16285, }, } @@ -106516,109 +102051,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 1856)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 1896)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 1936)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 2016)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 2056)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 2096)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 2136)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 2176)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 2216)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 2016)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 2056)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 2096)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 2136)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 2176)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 2216)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 2296)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 2336)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 2376)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2380)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 2384)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 2388)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 2416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2420)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 2424)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 2428)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2376)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 2416)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 2456)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2460)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 2464)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2460)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 2464)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 2468)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 2496)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 2500)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2508)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 2536)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 2540)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2548)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 2576)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 2580)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 2584)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 2588)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 2620)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 2624)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 2628)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 2496)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 2500)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 2504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 2508)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2536)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 2540)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2548)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2576)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 2580)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2584)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2588)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 2620)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2624)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2628)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 2656)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 2660)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 2664)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 2668)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 2696)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 2736)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2696)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 2700)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 2704)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 2708)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 2736)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 2740)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 2744)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 2748)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 2776)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 2808)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 2816)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2848)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 2856)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2888)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 2816)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2856)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2888)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 2896)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2928)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 2928)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 2936)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 3016)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 2968)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 3008)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 3016)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 3056)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 3096)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 3136)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 3168)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 3176)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3208)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 3216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3248)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 3256)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3288)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 3176)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 3216)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 3248)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 3256)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 3288)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 3296)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3328)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3368)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 3376)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 3328)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3368)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 3376)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 3416)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3448)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 3456)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3488)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 3448)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 3456)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 3488)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 3496)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3528)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 3536)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3568)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 3528)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 3536)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3568)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 3576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3608)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 3608)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 3616)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3648)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 3648)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 3656)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3688)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 3688)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3728)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 3728)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 3736)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 3776)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3808)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 3808)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 3816)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3848)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 3848)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 3856)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3888)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 3888)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 3896)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3928)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 3928)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 3936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3976)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 4016)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 4096)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 3968)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 3976)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 4008)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 4016)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 4096)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 4136)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 4176)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 4216)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -106935,7 +102472,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16183, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16288, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -107759,7 +103296,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 44 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108046,11 +103583,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 8)) = TToken{ - Fz: __ccgo_ts + 6722, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6718, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -108114,7 +103651,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5306) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5336) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -108578,7 +104115,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 20 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) } return WRC_Continue } @@ -108696,7 +104233,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8349, libc.VaList(bp+40, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8378, libc.VaList(bp+40, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -108762,11 +104299,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 48 + v3 = pToplevel + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 48)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 52)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109091,7 +104628,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109105,7 +104642,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109140,7 +104677,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 44)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109153,7 +104690,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109280,27 +104817,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(112) defer tls.Free(112) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+76 */ int32 var _ /* sNC at bp+40 */ TNameContext var _ /* tmask at bp+36 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109381,7 +104918,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109417,44 +104954,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16228, libc.VaList(bp+88, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16333, libc.VaList(bp+88, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16269, libc.VaList(bp+88, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16374, libc.VaList(bp+88, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109476,31 +104997,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16301, libc.VaList(bp+88, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16406, libc.VaList(bp+88, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 48 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 52 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109524,10 +105045,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 44 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 48 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -109568,8 +105089,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -109586,28 +105107,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16309, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16414, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16361, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16466, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -109720,18 +105241,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -109741,13 +105262,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 36))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } } } @@ -109758,14 +105279,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -109782,16 +105303,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -109902,11 +105423,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 76)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -109965,7 +105486,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16453) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16558) } goto insert_cleanup insert_cleanup: @@ -110088,33 +105609,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [4]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110361,7 +105855,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -112595,7 +107769,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16502, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16607, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -112615,7 +107789,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16506, uint32(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16611, uint32(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -112627,7 +107801,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16512, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16617, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112642,7 +107816,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16555, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16660, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -112673,7 +107847,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16587, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16692, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112682,7 +107856,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16467, + 0: __ccgo_ts + 16572, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -112751,14 +107925,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -112773,7 +107942,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -112791,7 +107960,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == __ccgo_fp_xInit { break } goto _1 @@ -112806,7 +107975,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -112816,6 +107985,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -112827,7 +107998,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -112839,7 +108010,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) n++ @@ -112915,7 +108086,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16624, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16729, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -112969,63 +108140,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5562, - 1: __ccgo_ts + 16663, - 2: __ccgo_ts + 9245, - 3: __ccgo_ts + 16667, - 4: __ccgo_ts + 16672, - 5: __ccgo_ts + 16675, - 6: __ccgo_ts + 16685, - 7: __ccgo_ts + 16695, - 8: __ccgo_ts + 16701, - 9: __ccgo_ts + 16705, - 10: __ccgo_ts + 16710, - 11: __ccgo_ts + 16715, - 12: __ccgo_ts + 16723, - 13: __ccgo_ts + 16734, - 14: __ccgo_ts + 16737, - 15: __ccgo_ts + 16744, - 16: __ccgo_ts + 16705, - 17: __ccgo_ts + 16710, - 18: __ccgo_ts + 16751, - 19: __ccgo_ts + 16756, - 20: __ccgo_ts + 16759, - 21: __ccgo_ts + 16766, - 22: __ccgo_ts + 16701, - 23: __ccgo_ts + 16705, - 24: __ccgo_ts + 16772, - 25: __ccgo_ts + 16777, - 26: __ccgo_ts + 16782, - 27: __ccgo_ts + 16705, - 28: __ccgo_ts + 16786, - 29: __ccgo_ts + 16710, - 30: __ccgo_ts + 16794, - 31: __ccgo_ts + 16798, - 32: __ccgo_ts + 16803, - 33: __ccgo_ts + 11984, - 34: __ccgo_ts + 11980, - 35: __ccgo_ts + 16809, - 36: __ccgo_ts + 16814, - 37: __ccgo_ts + 16819, - 38: __ccgo_ts + 16663, - 39: __ccgo_ts + 16705, - 40: __ccgo_ts + 16824, - 41: __ccgo_ts + 16831, - 42: __ccgo_ts + 16838, - 43: __ccgo_ts + 9245, - 44: __ccgo_ts + 16846, - 45: __ccgo_ts + 5565, - 46: __ccgo_ts + 16852, - 47: __ccgo_ts + 16663, - 48: __ccgo_ts + 16705, - 49: __ccgo_ts + 16857, - 50: __ccgo_ts + 16862, - 51: __ccgo_ts + 16048, - 52: __ccgo_ts + 16867, - 53: __ccgo_ts + 16880, - 54: __ccgo_ts + 16889, - 55: __ccgo_ts + 16896, - 56: __ccgo_ts + 16907, + 0: __ccgo_ts + 5592, + 1: __ccgo_ts + 16768, + 2: __ccgo_ts + 9303, + 3: __ccgo_ts + 16772, + 4: __ccgo_ts + 16777, + 5: __ccgo_ts + 16780, + 6: __ccgo_ts + 16790, + 7: __ccgo_ts + 16800, + 8: __ccgo_ts + 16806, + 9: __ccgo_ts + 16810, + 10: __ccgo_ts + 16815, + 11: __ccgo_ts + 16820, + 12: __ccgo_ts + 16828, + 13: __ccgo_ts + 16839, + 14: __ccgo_ts + 16842, + 15: __ccgo_ts + 16810, + 16: __ccgo_ts + 16849, + 17: __ccgo_ts + 16815, + 18: __ccgo_ts + 16857, + 19: __ccgo_ts + 16861, + 20: __ccgo_ts + 16866, + 21: __ccgo_ts + 16872, + 22: __ccgo_ts + 16810, + 23: __ccgo_ts + 16815, + 24: __ccgo_ts + 16879, + 25: __ccgo_ts + 16884, + 26: __ccgo_ts + 16887, + 27: __ccgo_ts + 16894, + 28: __ccgo_ts + 16806, + 29: __ccgo_ts + 16810, + 30: __ccgo_ts + 16900, + 31: __ccgo_ts + 16905, + 32: __ccgo_ts + 16910, + 33: __ccgo_ts + 16768, + 34: __ccgo_ts + 16810, + 35: __ccgo_ts + 16914, + 36: __ccgo_ts + 16921, + 37: __ccgo_ts + 16928, + 38: __ccgo_ts + 12042, + 39: __ccgo_ts + 12038, + 40: __ccgo_ts + 16936, + 41: __ccgo_ts + 16941, + 42: __ccgo_ts + 16946, + 43: __ccgo_ts + 9303, + 44: __ccgo_ts + 16951, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16957, + 47: __ccgo_ts + 16962, + 48: __ccgo_ts + 16153, + 49: __ccgo_ts + 16967, + 50: __ccgo_ts + 16768, + 51: __ccgo_ts + 16810, + 52: __ccgo_ts + 16980, + 53: __ccgo_ts + 16985, + 54: __ccgo_ts + 16994, + 55: __ccgo_ts + 17001, + 56: __ccgo_ts + 17012, } // C documentation @@ -113044,338 +108215,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16915, + FzName: __ccgo_ts + 17020, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16930, + FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16945, + FzName: __ccgo_ts + 17050, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16957, + FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16973, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16896, + FzName: __ccgo_ts + 17001, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16986, + FzName: __ccgo_ts + 17091, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 16998, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17018, + FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17034, + FzName: __ccgo_ts + 17139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17055, + FzName: __ccgo_ts + 17160, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17070, + FzName: __ccgo_ts + 17175, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17086, + FzName: __ccgo_ts + 17191, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17100, + FzName: __ccgo_ts + 17205, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17113, + FzName: __ccgo_ts + 17218, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17127, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17146, + FzName: __ccgo_ts + 17251, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17165, + FzName: __ccgo_ts + 17270, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17188, + FzName: __ccgo_ts + 17293, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17197, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17215, + FzName: __ccgo_ts + 17320, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17232, + FzName: __ccgo_ts + 17337, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17245, + FzName: __ccgo_ts + 17350, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17260, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17278, + FzName: __ccgo_ts + 17383, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17288, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17302, + FzName: __ccgo_ts + 17407, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17318, + FzName: __ccgo_ts + 17423, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17343, + FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17362, + FzName: __ccgo_ts + 17467, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17373, + FzName: __ccgo_ts + 17478, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17384, + FzName: __ccgo_ts + 17489, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17396, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17412, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17425, + FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17444, + FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17463, + FzName: __ccgo_ts + 17568, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17476, + FzName: __ccgo_ts + 17581, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17491, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17501, + FzName: __ccgo_ts + 17606, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17513, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17522, + FzName: __ccgo_ts + 17627, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17533, + FzName: __ccgo_ts + 17638, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17543, + FzName: __ccgo_ts + 17648, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17555, + FzName: __ccgo_ts + 17660, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17566, + FzName: __ccgo_ts + 17671, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17578, + FzName: __ccgo_ts + 17683, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17595, + FzName: __ccgo_ts + 17700, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17614, + FzName: __ccgo_ts + 17719, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17640, + FzName: __ccgo_ts + 17745, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17655, + FzName: __ccgo_ts + 17760, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17774, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17688, + FzName: __ccgo_ts + 17793, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17702, + FzName: __ccgo_ts + 17807, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17718, + FzName: __ccgo_ts + 17823, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17730, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17741, + FzName: __ccgo_ts + 17846, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17752, + FzName: __ccgo_ts + 17857, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113383,45 +108554,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17764, + FzName: __ccgo_ts + 17869, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17775, + FzName: __ccgo_ts + 17880, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17796, + FzName: __ccgo_ts + 17901, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17804, + FzName: __ccgo_ts + 17909, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17819, + FzName: __ccgo_ts + 17924, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17832, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17851, + FzName: __ccgo_ts + 17956, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17866, + FzName: __ccgo_ts + 17971, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113439,7 +108610,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -113547,10 +108718,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17882) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17987) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17892) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17997) { return PAGER_LOCKINGMODE_NORMAL } } @@ -113568,13 +108739,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8405) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8434) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17899) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18004) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17904) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18009) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -113597,10 +108768,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16857) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16980) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17916) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18021) == 0 { return int32(2) } else { return 0 @@ -113622,7 +108793,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17923, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18028, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) @@ -113752,15 +108923,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17985 + zName = __ccgo_ts + 18090 case int32(OE_SetDflt): - zName = __ccgo_ts + 17994 + zName = __ccgo_ts + 18099 case int32(OE_Cascade): - zName = __ccgo_ts + 18006 + zName = __ccgo_ts + 18111 case int32(OE_Restrict): - zName = __ccgo_ts + 18014 + zName = __ccgo_ts + 18119 default: - zName = __ccgo_ts + 18023 + zName = __ccgo_ts + 18128 break } return zName @@ -113781,12 +108952,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18033, - 1: __ccgo_ts + 18040, - 2: __ccgo_ts + 18048, - 3: __ccgo_ts + 18052, - 4: __ccgo_ts + 17916, - 5: __ccgo_ts + 18061, + 0: __ccgo_ts + 18138, + 1: __ccgo_ts + 18145, + 2: __ccgo_ts + 18153, + 3: __ccgo_ts + 18157, + 4: __ccgo_ts + 18021, + 5: __ccgo_ts + 18166, } // C documentation @@ -113848,15 +109019,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18086 + zType = __ccgo_ts + 18191 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18088 + zType = __ccgo_ts + 18193 } else { - zType = __ccgo_ts + 7804 + zType = __ccgo_ts + 7833 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18090, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18195, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -113865,9 +109036,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18065, - 2: __ccgo_ts + 18070, - 3: __ccgo_ts + 18078, + 1: __ccgo_ts + 18170, + 2: __ccgo_ts + 18175, + 3: __ccgo_ts + 18183, } // C documentation @@ -113966,7 +109137,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18097, libc.VaList(bp+136, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18202, libc.VaList(bp+136, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114009,7 +109180,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+136, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+136, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114054,7 +109225,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(36)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114113,7 +109284,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18101) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18206) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114156,7 +109327,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 24)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114184,7 +109355,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17892 + zRet = __ccgo_ts + 17997 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114212,7 +109383,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17882 + zRet = __ccgo_ts + 17987 } _returnSingleText(tls, v, zRet) break @@ -114502,7 +109673,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+56) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 56)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18106, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18211, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114512,7 +109683,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+136, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+136, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -114534,7 +109705,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18131, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18236, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -114566,8 +109737,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 28)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18184) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18289) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -114647,9 +109819,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18190 + v14 = __ccgo_ts + 18295 } else { - v14 = __ccgo_ts + 18198 + v14 = __ccgo_ts + 18303 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 { v15 = int32(1) @@ -114661,7 +109833,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+136, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+136, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667), v15, v16, k, isHidden)) goto _12 _12: ; @@ -114720,7 +109892,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18205, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18310, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 60)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+60, uintptr(0)) @@ -114728,7 +109900,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FpSchema + 8 @@ -114750,19 +109922,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13231 + zType = __ccgo_ts + 13289 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18221 + zType = __ccgo_ts + 18326 } else { - zType = __ccgo_ts + 9245 + zType = __ccgo_ts + 9303 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18228, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18333, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -114809,9 +109981,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*12))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18235, libc.VaList(bp+136, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18340, libc.VaList(bp+136, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18240, libc.VaList(bp+136, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18345, libc.VaList(bp+136, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -114835,11 +110007,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18245, - 1: __ccgo_ts + 18247, - 2: __ccgo_ts + 16734, + 0: __ccgo_ts + 18350, + 1: __ccgo_ts + 18352, + 2: __ccgo_ts + 16839, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18249, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18354, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -114858,7 +110030,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18255, libc.VaList(bp+136, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18360, libc.VaList(bp+136, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt))) goto _24 _24: ; @@ -114875,7 +110047,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18259, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18364, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -114925,7 +110097,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+136, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+136, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -114937,7 +110109,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint32(libc.Uint32FromInt64(1056)/libc.Uint32FromInt64(16))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+136, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+136, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -114963,7 +110135,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18262, libc.VaList(bp+136, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FiFrom)*12))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25))), __ccgo_ts+18271)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18367, libc.VaList(bp+136, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FiFrom)*12))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25))), __ccgo_ts+18376)) goto _32 _32: ; @@ -114977,8 +110149,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(4) - v34 = pParse + 48 + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(4) + v34 = pParse + 52 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115104,7 +110276,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18276, libc.VaList(bp+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18381, libc.VaList(bp+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 68))) @@ -115200,7 +110372,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115295,7 +110467,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18280, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18385, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115306,7 +110478,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18304) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18409) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115442,7 +110614,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 76)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18333, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115504,7 +110676,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 76)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115526,7 +110698,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18369, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18474, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -115539,7 +110711,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18389, libc.VaList(bp+136, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18494, libc.VaList(bp+136, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -115547,7 +110719,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18411, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18516, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -115558,10 +110730,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 76)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18434, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18539, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18436, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -115595,7 +110767,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18456, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18561, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -115619,9 +110791,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 80))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18491) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18596) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -115634,9 +110806,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 80))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18512) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18617) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18548) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18653) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -115664,9 +110836,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18559) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18664) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -115694,7 +110866,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 80))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18586) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18691) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -115791,7 +110963,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 72)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*20))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 18613 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 18718 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*20))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -115870,7 +111042,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18674, libc.VaList(bp+136, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18779, libc.VaList(bp+136, zRight)) } } } @@ -115975,13 +111147,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17899) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18004) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18699) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18804) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18052) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18157) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116116,7 +111288,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 44 + v70 = pParse + 48 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116146,7 +111318,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6651, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6680, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116208,7 +111380,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18707, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18812, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116481,34 +111653,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18616, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18621, + FzName: __ccgo_ts + 18726, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18627, + FzName: __ccgo_ts + 18732, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18636, + FzName: __ccgo_ts + 18741, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18645, + FzName: __ccgo_ts + 18750, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18653, + FzName: __ccgo_ts + 18758, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18661, + FzName: __ccgo_ts + 18766, }, 7: { - FzName: __ccgo_ts + 18668, + FzName: __ccgo_ts + 18773, }, 8: {}, } @@ -116565,25 +111737,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -116604,14 +111757,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18725) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18830) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18740, libc.VaList(bp+232, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18845, libc.VaList(bp+232, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -116620,19 +111773,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18747, libc.VaList(bp+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18852, libc.VaList(bp+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18753) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18765) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18870) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+24) if rc == SQLITE_OK { @@ -116647,7 +111800,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+232, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+232, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -116828,7 +111981,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+32, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+32, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -116840,13 +111993,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 116 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18780) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18885) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18788, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18893, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 16)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18897, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -116855,7 +112008,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+4, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+32, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+32, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -116981,24 +112134,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18826, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18931, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*4)) } else { - v1 = __ccgo_ts + 5173 + v1 = __ccgo_ts + 5203 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18854, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18885, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18990, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -117006,9 +112159,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18796, - 1: __ccgo_ts + 18803, - 2: __ccgo_ts + 18815, + 0: __ccgo_ts + 18901, + 1: __ccgo_ts + 18908, + 2: __ccgo_ts + 18920, } // C documentation @@ -117084,7 +112237,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), db+168) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } libc.SetBitFieldPtr8Uint32(db+168+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117117,11 +112270,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18893) + _corruptSchema(tls, pData, argv, __ccgo_ts+18998) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), pIndex+44) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } } @@ -117160,18 +112313,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9245 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9303 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8317 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18906 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8346 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19011 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 44))).FiDb = iDb @@ -117255,7 +112408,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12282) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12340) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117281,7 +112434,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18978) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19083) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117296,7 +112449,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 44))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19002, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19107, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+44, uintptr(0)) @@ -117592,7 +112745,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -117605,9 +112758,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -117625,13 +112778,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+168)-uint32(libc.UintptrFromInt32(0)+4)) - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+136)-uint32(libc.UintptrFromInt32(0)+4)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1637, 0) } } @@ -117654,8 +112807,8 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+168)-uint32(libc.UintptrFromInt32(0)+4)) - libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+136)-uint32(libc.UintptrFromInt32(0)+4)) + libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp (*(*TParse)(unsafe.Pointer(bp))).Fdb = db @@ -117665,7 +112818,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1637, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -117714,7 +112867,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19036, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19141, libc.VaList(bp+296, zDb)) goto end_prepare } } @@ -117730,7 +112883,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 116 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19066, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19171, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -117753,10 +112906,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+32, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 32))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -117764,7 +112917,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3860, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -117794,7 +112947,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -117928,7 +113081,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118050,15 +113203,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118094,21 +113238,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118188,7 +113317,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 112 + v3 = pParse + 100 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118196,7 +113325,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118352,15 +113481,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11389 - zSp2 = __ccgo_ts + 11389 + zSp1 = __ccgo_ts + 11447 + zSp2 = __ccgo_ts + 11447 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19085, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19190, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118417,25 +113546,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 64 + uintptr(uint32(h)%uint32(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 12 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -118567,13 +113699,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 36)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 { @@ -118651,7 +113783,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 40)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19115, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19220, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -118701,12 +113833,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 4 + uintptr(j)*4))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19165, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19270, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*48, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -118721,9 +113853,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*48 + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*48 + 40)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19229, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19334, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -118733,6 +113866,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*48))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -118767,7 +113907,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6856, + Fz: __ccgo_ts + 6885, Fn: uint32(8), } @@ -118784,13 +113924,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -118815,7 +113948,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -118860,7 +113993,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nBase + *(*int32)(unsafe.Pointer(pParse + 52)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -118884,7 +114017,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -118905,7 +114038,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119028,7 +114161,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119155,10 +114288,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 48)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119166,7 +114299,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119343,7 +114476,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119454,8 +114587,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint32(libc.Uint32FromInt32(N+X)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(1)) - uint32(4)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(24)+libc.Uint32FromInt32(nExtra))) + nExtra = libc.Int32FromUint32(libc.Uint32FromInt32(N+X) * (libc.Uint32FromInt64(4) + libc.Uint32FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(0))*libc.Uint32FromInt64(4)+libc.Uint32FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 20 + uintptr(N+X)*4 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119463,7 +114596,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*24, 0, libc.Uint32FromInt32(nExtra)) + libc.Xmemset(tls, p+20, 0, libc.Uint32FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -119548,13 +114681,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19286 + z = __ccgo_ts + 19391 case int32(TK_INTERSECT): - z = __ccgo_ts + 19296 + z = __ccgo_ts + 19401 case int32(TK_EXCEPT): - z = __ccgo_ts + 19306 + z = __ccgo_ts + 19411 default: - z = __ccgo_ts + 19313 + z = __ccgo_ts + 19418 break } return z @@ -119575,7 +114708,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+8, zUsage)) } /* @@ -119612,13 +114745,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19342 + v1 = __ccgo_ts + 19447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19356, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19461, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19387, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19492, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -119642,11 +114775,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 44 + v5 = pParse + 48 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -119861,8 +114994,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1137 - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16846 + zType = __ccgo_ts + 1141 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16951 } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, uintptr(0)) @@ -119975,7 +115108,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -119984,7 +115117,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -120008,13 +115141,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16846 + zCol = __ccgo_ts + 16951 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120022,7 +115155,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120114,7 +115247,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName } else { - v3 = __ccgo_ts + 16846 + v3 = __ccgo_ts + 16951 } zName = v3 } else { @@ -120129,7 +115262,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+32, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+32, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120165,7 +115298,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+32, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19547, libc.VaList(bp+32, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120284,7 +115417,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19450 + zType = __ccgo_ts + 19555 } else { zType = uintptr(0) j = int32(1) @@ -120350,7 +115483,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return uintptr(0) } @@ -120378,7 +115511,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120428,7 +115561,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120451,7 +115584,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -120599,7 +115732,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19454, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19559, 0) return } /* Obtain authorization to do a recursive query */ @@ -120636,7 +115769,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -120647,7 +115780,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 44 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -120661,7 +115794,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -120692,7 +115825,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19503, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19608, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -120707,7 +115840,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19545, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19650, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -120735,7 +115868,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19551, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19656, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -120788,11 +115921,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } else { - v1 = __ccgo_ts + 19566 + v1 = __ccgo_ts + 19671 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19568, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19673, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -120900,8 +116033,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19591, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19606, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19696, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19711, 0) } /* Generate code for the left and right SELECT statements. */ @@ -120926,7 +116059,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19286, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19391, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120952,7 +116085,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -120978,7 +116111,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 32))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+32) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121010,11 +116143,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 44 + v6 = pParse + 48 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121036,7 +116169,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 60))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+60) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121143,6 +116276,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121159,9 +116293,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19646, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19751, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19692, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19797, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121232,7 +116366,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121480,7 +116614,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -121534,16 +116668,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7554) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7583) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -121561,32 +116695,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 48 + v16 = pParse + 52 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 48 + v18 = pParse + 52 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 48 + v20 = pParse + 52 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 48 + v22 = pParse + 52 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+28, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19774, libc.VaList(bp+64, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19879, libc.VaList(bp+64, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19785, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19890, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121599,7 +116733,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19790, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19895, 0) _sqlite3Select(tls, pParse, p, bp+28) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -121809,11 +116943,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5151 + v1 = __ccgo_ts + 5181 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 36)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -121974,7 +117108,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122164,9 +117298,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122378,7 +117512,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122525,7 +117659,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 112 + v5 = pParse + 100 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -122764,18 +117898,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -122815,7 +117937,7 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ @@ -122884,7 +118006,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -122902,12 +118024,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*4)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123389,7 +118511,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123435,13 +118557,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15705) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15790) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15709) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15794) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123529,8 +118651,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19796, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19901, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 36)) = pIdx @@ -123554,7 +118676,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -123636,7 +118758,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -123654,7 +118776,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 12 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19814, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19919, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -123802,7 +118924,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return int32(2) } @@ -123830,7 +118952,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 44)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 12 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19837, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+12+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -123852,12 +118974,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+12+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19857, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19962, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -123874,7 +118996,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19900 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20005 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -123905,7 +119027,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19923, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20028, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -123914,9 +119036,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+34, pTab+4) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19961 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20066 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19995 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20100 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -123965,7 +119087,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 44)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(64)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(80)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -123975,7 +119097,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20033, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20138, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124071,7 +119193,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 112 + v2 = pParse + 100 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124080,7 +119202,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(36)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+12)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124131,7 +119253,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20037, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124146,7 +119268,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20076, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20181, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124161,7 +119283,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 44))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124285,7 +119407,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName } else { - v10 = __ccgo_ts + 6716 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124302,7 +119424,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20107, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124381,7 +119503,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*20))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20112, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20217, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124394,7 +119516,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+8+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124414,9 +119536,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20121, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20226, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20139, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) } } } @@ -124430,7 +119552,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 116 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20159, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20264, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -124627,14 +119749,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*16))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*20))).FiSorterColumn if k > mx { mx = k } @@ -124643,7 +119765,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -124675,11 +119797,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*20 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -124732,7 +119854,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -124769,12 +119891,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 20)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 20)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20190, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20295, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 20)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20241, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20346, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -124795,7 +119917,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20274, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20379, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -124934,7 +120056,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125042,7 +120164,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125086,7 +120208,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 16 + pC += 20 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125109,16 +120231,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20307 + v1 = __ccgo_ts + 20412 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20330, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20435, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125150,7 +120272,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125279,6 +120401,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125307,7 +120430,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+15999) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16104) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { @@ -125340,9 +120463,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125352,13 +120475,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125378,7 +120501,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -125551,8 +120674,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(160) defer tls.Free(160) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -125561,11 +120684,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+84 */ TNameContext var _ /* sSort at bp+12 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 52)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 52)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -125581,7 +120704,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -125605,14 +120728,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20342, libc.VaList(bp+128, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20447, libc.VaList(bp+128, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -125713,7 +120836,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20396, libc.VaList(bp+128, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20501, libc.VaList(bp+128, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -125871,7 +120994,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 44)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1663, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1667, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -125891,7 +121014,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** more conservative than necessary, but much easier than enforcing ** an exact limit. */ - *(*int32)(unsafe.Pointer(pParse + 232)) += _sqlite3SelectExprHeight(tls, p) + *(*int32)(unsafe.Pointer(pParse + 228)) += _sqlite3SelectExprHeight(tls, p) /* Make copies of constant WHERE-clause terms in the outer query down ** inside the subquery. This can help the subquery to run more efficiently. ** This is the "predicate push-down optimization". tag-select-0420 @@ -125914,14 +121037,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 48 + v13 = pParse + 52 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+56, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20436, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20541, libc.VaList(bp+128, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+56) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+12+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -125953,7 +121076,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 48 + v16 = pParse + 52 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -125968,7 +121091,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+56, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20451, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20556, libc.VaList(bp+128, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+56) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -125990,7 +121113,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto select_end } - *(*int32)(unsafe.Pointer(pParse + 232)) -= _sqlite3SelectExprHeight(tls, p) + *(*int32)(unsafe.Pointer(pParse + 228)) -= _sqlite3SelectExprHeight(tls, p) (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext goto _11 _11: @@ -126022,7 +121145,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126055,7 +121178,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 44 + v20 = pParse + 48 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FiECursor = v19 @@ -126114,7 +121237,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 44 + v25 = pParse + 48 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126143,6 +121266,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126165,10 +121295,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 48 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 52 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126202,8 +121332,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 16))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 20 @@ -126218,8 +121348,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 16))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 20 @@ -126248,8 +121378,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126266,7 +121396,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(44)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(48)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126279,11 +121409,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 84))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 84 + 8)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+84, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+84, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy) @@ -126317,49 +121447,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 44 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 48 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 48 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 48 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 48 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 52 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 52 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 52 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 48 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 52 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126367,16 +121498,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126394,11 +121525,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20467 + v47 = __ccgo_ts + 20572 } else { - v46 = __ccgo_ts + 20476 + v47 = __ccgo_ts + 20581 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+128, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+128, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126408,12 +121539,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*16))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126426,13 +121557,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*16 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126443,12 +121574,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 44 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 48 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126497,12 +121628,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*20))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -126572,9 +121707,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -126591,10 +121726,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 44 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 48 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -126621,8 +121756,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -126662,32 +121797,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 48 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 52 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 20)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -126729,7 +121864,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20467) + _explainTempTable(tls, pParse, __ccgo_ts+20572) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -126835,7 +121970,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4)))) if z == uintptr(0) { goto malloc_failed } @@ -126851,7 +121986,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20485, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20590, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -126941,7 +122076,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127103,7 +122238,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20550, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) goto trigger_cleanup } iDb = int32(1) @@ -127143,7 +122278,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+20596, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+20701, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+4, pTableName) != 0 { goto trigger_cleanup } @@ -127153,11 +122288,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20604, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20709, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20645, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20750, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127166,13 +122301,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20596, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20701, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema+40, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20685, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20790, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127180,8 +122315,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20711, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20816, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127189,15 +122324,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20749 + v1 = __ccgo_ts + 20854 } else { - v1 = __ccgo_ts + 20756 + v1 = __ccgo_ts + 20861 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20762, libc.VaList(bp+64, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20867, libc.VaList(bp+64, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20799, libc.VaList(bp+64, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20904, libc.VaList(bp+64, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127217,9 +122352,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127319,7 +122454,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+56, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20596, bp+56) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20701, bp+56) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127341,7 +122476,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20845, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20950, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127357,10 +122492,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20893, libc.VaList(bp+72, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20998, libc.VaList(bp+72, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20968, libc.VaList(bp+72, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21073, libc.VaList(bp+72, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -127628,11 +122763,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20997, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -127670,9 +122805,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -127687,7 +122822,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21017, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -127820,11 +122955,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21079 + v1 = __ccgo_ts + 21184 } else { - v1 = __ccgo_ts + 21086 + v1 = __ccgo_ts + 21191 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21093, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21198, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -127926,7 +123061,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21246, 0) return int32(1) } @@ -128074,12 +123209,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(176) defer tls.Free(176) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+76 */ TSrcList + var _ /* fromSpace at bp+76 */ [56]Tu8 var _ /* sNC at bp+132 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128087,19 +123222,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+8 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint32(76)) - libc.Xmemset(tls, bp+76, 0, uint32(56)) + pFrom = bp + 76 + libc.Xmemset(tls, pFrom, 0, uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 76 - (*(*TSrcList)(unsafe.Pointer(bp + 76))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 76 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 76 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 76 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128110,7 +123248,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+132, 0, uint32(36)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128124,7 +123262,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 48)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128192,7 +123330,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+40, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+40, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128243,8 +123381,8 @@ func _transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** implementing trigger pTrigger with ON CONFLICT policy orconf. // */ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) (r uintptr) { - bp := tls.Alloc(352) - defer tls.Free(352) + bp := tls.Alloc(336) + defer tls.Free(336) var db, pPrg, pProgram, pTop, pWhen, v, v1, v2 uintptr var iEndTrigger int32 var _ /* sNC at bp+0 */ TNameContext @@ -128291,10 +123429,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 36))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 36))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 36))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 36))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 36))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+36) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21183, libc.VaList(bp+336, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21288, libc.VaList(bp+328, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128316,7 +123456,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+36) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+108) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+96) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 36))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 36))).FnTab @@ -128388,7 +123528,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -128804,13 +123944,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(96) defer tls.Free(96) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+48 */ [2]int32 var _ /* bReplace at bp+56 */ int32 var _ /* iNotUsed1 at bp+60 */ int32 @@ -128818,21 +123958,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+8 */ TNameContext var _ /* tmask at bp+44 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -128879,7 +124019,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -128962,58 +124102,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+8, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21197, libc.VaList(bp+80, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21302, libc.VaList(bp+80, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+80, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+80, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8092 + v10 = __ccgo_ts + 8121 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129043,17 +124171,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129065,11 +124193,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129085,11 +124213,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 48 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 48)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 52 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 52)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129098,18 +124226,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 48 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 48)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 52 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 52)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 56)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129118,16 +124246,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 48 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 52 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 56)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129145,24 +124273,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 48 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 52 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 48 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 52 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129188,50 +124316,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*20))).FpExpr, k) @@ -129529,8 +124657,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -129580,8 +124708,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -129628,11 +124756,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -129644,11 +124772,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -129691,7 +124819,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21252) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21357) } goto update_cleanup update_cleanup: @@ -129748,13 +124876,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nArg + *(*int32)(unsafe.Pointer(pParse + 52)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -129796,11 +124924,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 48 + v7 = pParse + 52 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130125,9 +125253,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 140)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+21265, libc.VaList(bp+168, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+21370, libc.VaList(bp+168, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21269, libc.VaList(bp+168, bp+140)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21374, libc.VaList(bp+168, bp+140)) return int32(SQLITE_ERROR) } goto _1 @@ -130216,13 +125344,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPk + *(*int32)(unsafe.Pointer(pParse + 52)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130230,7 +125358,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12657, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12715, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130312,7 +125440,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21342, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21346, uint32(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21447, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21451, uint32(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130403,7 +125531,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130442,24 +125570,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21350) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21455) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21390) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21495) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21433) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21538) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 56)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 56)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1663 + zOut = __ccgo_ts + 1667 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -130469,7 +125597,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 28)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21482) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21587) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_VacuumInto) @@ -130522,7 +125650,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15034) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15092) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130553,11 +125681,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21509, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21614, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21617, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21722, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130566,7 +125694,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21671, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21776, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -130576,7 +125704,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21808, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21913, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -130667,39 +125795,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -130710,7 +125805,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -130729,7 +125824,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -130754,15 +125849,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -130777,13 +125872,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131103,7 +126200,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 44))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 116 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131226,24 +126323,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32((*TToken)(unsafe.Pointer(pEnd)).Fz)-int32((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21931, libc.VaList(bp+8, pParse+204)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22036, libc.VaList(bp+8, pParse+172)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21955, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22060, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22054, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131284,7 +126386,7 @@ func _sqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { var pArg uintptr _ = pArg - pArg = pParse + 268 + pArg = pParse + 264 if (*TToken)(unsafe.Pointer(pArg)).Fz == uintptr(0) { (*TToken)(unsafe.Pointer(pArg)).Fz = (*TToken)(unsafe.Pointer(p)).Fz (*TToken)(unsafe.Pointer(pArg)).Fn = (*TToken)(unsafe.Pointer(p)).Fn @@ -131300,7 +126402,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131327,7 +126429,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22073, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22178, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131361,7 +126463,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8, bp+16) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8, bp+16) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131369,9 +126471,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22115, libc.VaList(bp+32, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22220, libc.VaList(bp+32, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3860, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 16)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 16)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } _sqlite3DbFree(tls, db, pVTable) @@ -131384,7 +126486,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22145 + zFormat = __ccgo_ts + 22250 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+32, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131410,7 +126512,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, __ccgo_ts+1663) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, __ccgo_ts+1667) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -131418,7 +126520,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16737, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16842, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131499,13 +126601,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 44))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22191, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22296, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -131586,7 +126688,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22191, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22296, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -131610,13 +126712,13 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, // ** virtual table module. // */ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r int32) { - bp := tls.Alloc(320) - defer tls.Free(320) + bp := tls.Alloc(304) + defer tls.Free(304) var i, initBusy, rc int32 var pCtx, pIdx, pNew, pTab, z, v3 uintptr var v2 Ti16 var _ /* sParse at bp+0 */ TParse - var _ /* tokenType at bp+288 */ int32 + var _ /* tokenType at bp+284 */ int32 _, _, _, _, _, _, _, _, _, _ = i, initBusy, pCtx, pIdx, pNew, pTab, rc, z, v2, v3 rc = SQLITE_OK /* Verify that the first two keywords in the CREATE TABLE statement @@ -131629,12 +126731,12 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i if !(_aKeyword1[i] != 0) { break } - *(*int32)(unsafe.Pointer(bp + 288)) = 0 - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 288)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp + 288)) == int32(TK_COMMENT) { - z += uintptr(_sqlite3GetToken(tls, z, bp+288)) + *(*int32)(unsafe.Pointer(bp + 284)) = 0 + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 284)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp + 284)) == int32(TK_COMMENT) { + z += uintptr(_sqlite3GetToken(tls, z, bp+284)) } - if *(*int32)(unsafe.Pointer(bp + 288)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22210, 0) + if *(*int32)(unsafe.Pointer(bp + 284)) != libc.Int32FromUint8(_aKeyword1[i]) { + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22315, 0) return int32(SQLITE_ERROR) } goto _1 @@ -131645,9 +126747,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -131689,11 +126791,11 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3860 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), v3, libc.VaList(bp+304, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), v3, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) rc = int32(SQLITE_ERROR) } @@ -132103,7 +127205,7 @@ func _sqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { apVtabLock = _sqlite3Realloc(tls, (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock, libc.Uint64FromInt32(n)) if apVtabLock != 0 { (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock - v4 = pToplevel + 228 + v4 = pToplevel + 224 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ *(*uintptr)(unsafe.Pointer((*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock + uintptr(v3)*4)) = pTab @@ -132145,7 +127247,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return 0 } @@ -132165,7 +127267,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132229,7 +127331,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132242,7 +127344,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132402,271 +127504,9 @@ type TWhereLoop = struct { FaLTermSpace [3]uintptr } -type WhereLoop = TWhereLoop - -type TWherePath = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath = TWherePath - -type TWhereTerm = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm = TWhereTerm - -type TWhereLoopBuilder = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder = TWhereLoopBuilder - -type TWhereScan = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan = TWhereScan - -type TWhereOrCost = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost = TWhereOrCost - -type TWhereOrSet = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet = TWhereOrSet - -type TWhereMemBlock = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock = TWhereMemBlock - -type TWhereRightJoin = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin = TWhereRightJoin - -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 +type WhereLoop = TWhereLoop -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { +type TWherePath = struct { FmaskLoop TBitmask FrevLoop TBitmask FnRow TLogEst @@ -132676,60 +127516,9 @@ type TWherePath1 = struct { FaLoop uintptr } -type WherePath1 = TWherePath1 +type WherePath = TWherePath -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { +type TWhereTerm = struct { FpExpr uintptr FpWC uintptr FtruthProb TLogEst @@ -132751,17 +127540,23 @@ type TWhereTerm1 = struct { FprereqAll TBitmask } -type WhereTerm1 = TWhereTerm1 +type WhereTerm = TWhereTerm -/* -** Allowed values of WhereTerm.wtFlags - */ +type TWhereLoopBuilder = struct { + FpWInfo uintptr + FpWC uintptr + FpNew uintptr + FpOrSet uintptr + FpRec uintptr + FnRecValid int32 + FbldFlags1 uint8 + FbldFlags2 uint8 + FiPlanLimit uint32 +} -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { +type WhereLoopBuilder = TWhereLoopBuilder + +type TWhereScan = struct { FpOrigWC uintptr FpWC uintptr FzCollName uintptr @@ -132775,162 +127570,39 @@ type TWhereScan1 = struct { FaiColumn [11]Ti16 } -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 +type WhereScan = TWhereScan -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause +type TWhereOrCost = struct { + Fprereq TBitmask + FrRun TLogEst + FnOut TLogEst } -type WhereAndInfo1 = TWhereAndInfo1 +type WhereOrCost = TWhereOrCost -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 +type TWhereOrSet = struct { + Fn Tu16 + Fa [3]TWhereOrCost } -type WhereMaskSet1 = TWhereMaskSet1 +type WhereOrSet = TWhereOrSet -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 +type TWhereMemBlock = struct { + FpNext uintptr + Fsz Tu64 } -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ +type WhereMemBlock = TWhereMemBlock -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo48 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel +type TWhereRightJoin = struct { + FiMatch int32 + FregBloom int32 + FregReturn int32 + FaddrSubrtn int32 + FendSubrtn int32 } -type WhereInfo1 = TWhereInfo1 +type WhereRightJoin = TWhereRightJoin /* ** Bitmasks for the operators on WhereTerm objects. These are all @@ -132963,10 +127635,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22223 + return __ccgo_ts + 22328 } if i == -int32(1) { - return __ccgo_ts + 16846 + return __ccgo_ts + 16951 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*12))).FzCnName } @@ -132985,10 +127657,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -132996,7 +127668,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133005,11 +127677,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133017,16 +127689,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } } @@ -133073,7 +127745,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22343, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133081,12 +127753,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22241 + v2 = __ccgo_ts + 22346 } else { - v2 = __ccgo_ts + 22246 + v2 = __ccgo_ts + 22351 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133103,7 +127775,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22254) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22359) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133114,9 +127786,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22256) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22361) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133161,11 +127833,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+24, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22258 + v2 = __ccgo_ts + 22363 } else { - v2 = __ccgo_ts + 22265 + v2 = __ccgo_ts + 22370 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22270, libc.VaList(bp+136, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22375, libc.VaList(bp+136, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133178,37 +127850,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11440 + zFmt = __ccgo_ts + 11498 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22276 + zFmt = __ccgo_ts + 22381 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22309 + zFmt = __ccgo_ts + 22414 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22334 + zFmt = __ccgo_ts + 22439 } else { - zFmt = __ccgo_ts + 22352 + zFmt = __ccgo_ts + 22457 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22361, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22466, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16846 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22369, libc.VaList(bp+136, zRowid)) + zRowid = __ccgo_ts + 16951 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22474, libc.VaList(bp+136, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22400, libc.VaList(bp+136, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22505, libc.VaList(bp+136, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133218,14 +127890,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22410, libc.VaList(bp+136, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, libc.VaList(bp+136, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22415) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22520) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22437 + v3 = __ccgo_ts + 22542 } else { - v3 = __ccgo_ts + 22445 + v3 = __ccgo_ts + 22550 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+136, (*(*struct { FidxNum int32 @@ -133246,7 +127918,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22451, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22556, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133276,10 +127948,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133312,14 +127984,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+24, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22462, libc.VaList(bp+136, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22567, libc.VaList(bp+136, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+136, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+136, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22483, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22588, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133343,16 +128015,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22335, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+136, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+136, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -133557,7 +128229,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -133613,8 +128285,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)) + 24))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr = uintptr(0) if pRhs != 0 { @@ -133636,7 +128308,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 20)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 112 + v4 = pParse + 100 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -133693,10 +128365,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -133751,37 +128423,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*libc.Uint32FromInt32(nEq))) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*libc.Uint32FromInt32(v3))) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -133828,24 +128486,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -133857,8 +128515,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -133916,7 +128574,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -133998,7 +128656,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134266,7 +128924,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134411,7 +129069,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134472,11 +129130,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 44 + v10 = pParse + 48 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134507,6 +129165,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -134645,7 +129306,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 48 + v21 = pParse + 52 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -134725,7 +129386,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 48 + v28 = pParse + 52 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -134759,7 +129420,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 48 + v33 = pParse + 52 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -134881,7 +129542,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 48 + v40 = pParse + 52 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135074,7 +129735,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135088,12 +129749,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135131,11 +129793,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 44 + v45 = pParse + 48 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 48 + v47 = pParse + 52 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135155,7 +129817,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(56)+libc.Uint32FromInt32(nNotReady)*uint32(48))) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint32FromInt64(48))) if pOrTab == uintptr(0) { return notReady } @@ -135191,21 +129853,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 48 + v50 = pParse + 52 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 44 + v52 = pParse + 48 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 48 + v54 = pParse + 52 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135223,7 +129885,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135278,7 +129940,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22491, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22596, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135301,7 +129963,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22506, libc.VaList(bp+72, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22611, libc.VaList(bp+72, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+752, uint16(0)) @@ -135790,9 +130452,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(80) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [56]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -135801,14 +130463,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*48 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22515, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22620, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(k)*84))).FiFrom)*48 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(k)*84))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752 + uintptr(k)*84))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 44)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -135847,15 +130509,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint32(48)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint32(48)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -135867,7 +130530,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -136338,19 +131001,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16695, + FzOp: __ccgo_ts + 16800, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16029, + FzOp: __ccgo_ts + 16134, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15508, + FzOp: __ccgo_ts + 15593, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22529, + FzOp: __ccgo_ts + 22634, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -136870,37 +131533,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137138,7 +131805,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } } else { @@ -137150,10 +131817,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137212,7 +131879,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 p5 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 12 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137234,7 +131901,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8078 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8107 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137335,7 +132002,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { - v13 = __ccgo_ts + 22577 + v13 = __ccgo_ts + 22682 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -137866,7 +132533,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22584, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -137938,22 +132605,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138066,7 +132721,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 752 + uintptr(i)*84 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -138982,7 +133637,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141233,13 +135889,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 12 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141339,6 +135990,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141352,12 +136004,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) + 24))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 24))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -141803,7 +136472,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -141854,15 +136523,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -141894,7 +136554,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -141913,7 +136573,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -141950,7 +136610,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(48) defer tls.Free(48) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+12 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -141958,7 +136618,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -141979,19 +136639,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+12, 0, uint32(28)) (*(*TWalker)(unsafe.Pointer(bp + 12))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 12))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 12 + 24)) = bp _sqlite3WalkSelect(tls, bp+12, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142087,7 +136747,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 80 + pArg = pParse + 84 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142265,7 +136925,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142293,6 +136953,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142369,7 +137037,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+112, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -142606,7 +137274,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142681,7 +137349,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142835,7 +137503,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 20 + uintptr(iCons)*4)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143271,7 +137939,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22683, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22788, 0) rc = SQLITE_OK } else { break @@ -143500,17 +138168,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*48))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144479,7 +139136,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22718, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22823, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145057,7 +139714,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 76 + pArg = pParse + 80 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145213,7 +139870,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22736, libc.VaList(bp+40, libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22841, libc.VaList(bp+40, libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145234,10 +139891,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint32((libc.Uint32FromInt64(836) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint32((libc.Uint32FromInt32(nByteWInfo) + libc.Uint32FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint32FromInt64(84) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) - } + nByteWInfo = libc.Int32FromUint32((uint32(libc.UintptrFromInt32(0)+752) + libc.Uint32FromInt32(nTabList)*libc.Uint32FromInt64(84) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint32FromInt32(nByteWInfo)+uint32(72))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) @@ -145286,7 +139940,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22764, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22869, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145431,7 +140085,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 50 @@ -145465,7 +140120,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 160 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 16 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145487,7 +140142,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145500,7 +140155,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 752))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -145591,11 +140246,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 44 + v17 = pParse + 48 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -145622,16 +140277,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 44 + v21 = pParse + 48 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 48 + v23 = pParse + 52 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 48 + v25 = pParse + 52 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -145679,7 +140334,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 752 + uintptr(ii)*84 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*48 if int32(*(*uint32)(unsafe.Pointer(pSrc + 12 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -145810,7 +140465,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 48)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -145988,7 +140643,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146017,7 +140672,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146027,7 +140682,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22782, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22887, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146077,7 +140732,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 26 + p12 = pParse + 25 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146346,7 +141001,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22811, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22916, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146528,7 +141183,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22867, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22972, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -146854,7 +141509,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22912, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23017, libc.VaList(bp+8, zName)) } return p } @@ -146905,12 +141560,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23036, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23107, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -146983,7 +141638,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) } break } @@ -147014,16 +141669,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147042,17 +141687,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*48))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*48))).FiCursor { break } goto _1 @@ -147070,7 +141715,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147094,13 +141739,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*20))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*20))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147115,23 +141760,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint32(52)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147147,13 +141792,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147265,7 +141910,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23065, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23170, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147301,7 +141946,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147316,7 +141961,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147335,11 +141980,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147385,11 +142030,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147406,7 +142051,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147428,7 +142073,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint32(64)) + libc.Xmemcpy(tls, pTab, pTab2, uint32(80)) *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -147552,7 +142197,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23091, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23196, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(100)) @@ -147620,18 +142265,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23123 + zErr = __ccgo_ts + 23228 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23140 + zErr = __ccgo_ts + 23245 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23156 + zErr = __ccgo_ts + 23261 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23176, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -147655,7 +142300,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23209, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23314, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -147761,24 +142406,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 44 + v8 = pParse + 48 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -147796,12 +142441,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 44 + v11 = pParse + 48 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -147813,15 +142458,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 44 + v13 = pParse + 48 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 44 + v15 = pParse + 48 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -147854,7 +142499,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -147873,11 +142518,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23256, - 1: __ccgo_ts + 23309, - 2: __ccgo_ts + 22811, - 3: __ccgo_ts + 23360, - 4: __ccgo_ts + 23412, + 0: __ccgo_ts + 23361, + 1: __ccgo_ts + 23414, + 2: __ccgo_ts + 22916, + 3: __ccgo_ts + 23465, + 4: __ccgo_ts + 23517, } var _aOp1 = [5]int32{ @@ -147930,87 +142575,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148457,7 +143021,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nArg + *(*int32)(unsafe.Pointer(pParse + 52)) += nArg return regArg } @@ -148553,7 +143117,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -148629,7 +143193,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -149270,12 +143834,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nInput - v2 = pParse + 48 + *(*int32)(unsafe.Pointer(pParse + 52)) += nInput + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149283,13 +143847,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149309,13 +143873,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149342,7 +143906,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -149561,6 +144125,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -149621,7 +144189,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23462, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23567, libc.VaList(bp+8, p)) } // C documentation @@ -149635,6 +144203,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+188, 0, uint32(20)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -149668,11 +144237,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23486 + v1 = __ccgo_ts + 23591 } else { - v1 = __ccgo_ts + 23495 + v1 = __ccgo_ts + 23600 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23501, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23606, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -149681,7 +144250,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23543, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23648, 0) } } } @@ -149787,7 +144356,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23577, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23682, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156254,14 +150823,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156272,16 +150833,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -157429,19 +151980,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(96) defer tls.Free(96) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+64 */ TToken var _ /* as at bp+48 */ TToken var _ /* dest at bp+8 */ TSelectDest var _ /* t at bp+56 */ TToken var _ /* x at bp+40 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158244,20 +152795,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16846, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16951, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16759, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16887, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } *(*Tu32)(unsafe.Pointer(yymsp + 4)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158298,7 +152849,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 4)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 4)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158443,7 +152999,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -158533,9 +153094,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -158890,7 +153451,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), yymsp+uintptr(-libc.Int32FromInt32(4))*12+4) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23642) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23747) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159230,23 +153791,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { + v347 = __ccgo_ts + 8102 + } else { + v347 = __ccgo_ts + 8107 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { - v347 = __ccgo_ts + 8073 - } else { - v347 = __ccgo_ts + 8078 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) + 8))).FpExpr @@ -159304,11 +153879,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 4)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 4))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 4))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), pSelect) @@ -159318,9 +153893,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) goto _346 _242: @@ -159328,11 +153903,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 20)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 20)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4))) @@ -159430,11 +154005,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*12+4, yymsp+uintptr(-libc.Int32FromInt32(6))*12+4, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4 + 4)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159484,15 +154059,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) = *(*TToken)(unsafe.Pointer(yymsp + 4)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23651, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23756, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23746, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23935, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -159634,7 +154209,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -159828,7 +154403,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23915, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24020, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -161954,7 +156529,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -162559,14 +157134,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163428,22 +158008,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(4) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163454,11 +158043,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164037,7 +158626,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164057,7 +158646,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24002, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24107, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164182,11 +158771,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164358,14 +158947,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24545 + zErr = __ccgo_ts + 24650 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { @@ -164377,31 +158966,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24070, - 1: __ccgo_ts + 24083, - 3: __ccgo_ts + 24099, - 4: __ccgo_ts + 24124, - 5: __ccgo_ts + 24138, - 6: __ccgo_ts + 24157, - 7: __ccgo_ts + 1633, - 8: __ccgo_ts + 24182, - 9: __ccgo_ts + 24219, - 10: __ccgo_ts + 24231, - 11: __ccgo_ts + 24246, - 12: __ccgo_ts + 24279, - 13: __ccgo_ts + 24297, - 14: __ccgo_ts + 24322, - 15: __ccgo_ts + 24351, - 17: __ccgo_ts + 6102, - 18: __ccgo_ts + 5504, - 19: __ccgo_ts + 24368, - 20: __ccgo_ts + 24386, - 21: __ccgo_ts + 24404, - 23: __ccgo_ts + 24438, - 25: __ccgo_ts + 24459, - 26: __ccgo_ts + 24485, - 27: __ccgo_ts + 24508, - 28: __ccgo_ts + 24529, + 0: __ccgo_ts + 24175, + 1: __ccgo_ts + 24188, + 3: __ccgo_ts + 24204, + 4: __ccgo_ts + 24229, + 5: __ccgo_ts + 24243, + 6: __ccgo_ts + 24262, + 7: __ccgo_ts + 1637, + 8: __ccgo_ts + 24287, + 9: __ccgo_ts + 24324, + 10: __ccgo_ts + 24336, + 11: __ccgo_ts + 24351, + 12: __ccgo_ts + 24384, + 13: __ccgo_ts + 24402, + 14: __ccgo_ts + 24427, + 15: __ccgo_ts + 24456, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24473, + 20: __ccgo_ts + 24491, + 21: __ccgo_ts + 24509, + 23: __ccgo_ts + 24543, + 25: __ccgo_ts + 24564, + 26: __ccgo_ts + 24590, + 27: __ccgo_ts + 24613, + 28: __ccgo_ts + 24634, } // C documentation @@ -164495,15 +159084,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164511,6 +159102,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164518,10 +159111,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -164548,6 +159141,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -164575,12 +159182,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -164598,9 +159205,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -164623,13 +159230,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24626, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24731, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -164647,15 +159254,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 36)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -164670,27 +159277,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(12)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -164701,30 +159308,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -164749,7 +159386,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24689, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24794, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -164780,13 +159417,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -164797,43 +159436,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 212)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 212)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 212)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 212)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -164844,12 +159487,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 90 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -164861,6 +159504,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164868,82 +159513,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -164987,18 +159642,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165024,7 +159681,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165034,7 +159691,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24740, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24845, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165156,7 +159813,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165288,7 +159945,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165298,7 +159955,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165334,7 +159991,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165347,7 +160004,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165356,7 +160013,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24761, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24866, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165391,9 +160048,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165503,7 +160160,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24829, uint32(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24934, uint32(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -165533,8 +160190,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24835, zUri+7, uint32(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24845, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24940, zUri+7, uint32(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24950, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -165623,24 +160280,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24873, zOpt, uint32(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24978, zOpt, uint32(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24877, zOpt, uint32(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24982, zOpt, uint32(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24877 + zModeType = __ccgo_ts + 24982 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24898, zOpt, uint32(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25003, zOpt, uint32(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3469 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -165669,12 +160326,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24913, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25018, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24933, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25038, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -165698,7 +160355,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24957, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25062, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -165718,11 +160375,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24883, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24890, + Fz: __ccgo_ts + 24995, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -165733,19 +160390,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24903, + Fz: __ccgo_ts + 25008, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24906, + Fz: __ccgo_ts + 25011, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24909, + Fz: __ccgo_ts + 25014, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17916, + Fz: __ccgo_ts + 18021, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -165873,8 +160530,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22577, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24973, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22682, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25078, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -165895,10 +160552,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4255 + zFilename = __ccgo_ts + 4285 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+4, bp+8) } @@ -165907,7 +160564,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { - v2 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -165934,9 +160591,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6711 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6740 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 23975 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 24080 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166030,7 +160687,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24979 + zFilename = __ccgo_ts + 25084 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166049,36 +160706,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166086,7 +160751,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166094,31 +160759,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166152,12 +160821,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166190,10 +160861,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(uint32(16)+n+uint32(1))) + p = Xsqlite3_malloc64(tls, uint64(uint32(libc.UintptrFromInt32(0)+12)+(n+libc.Uint32FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166204,7 +160875,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166247,20 +160918,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24982, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25087, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25007) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25112) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25027) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25132) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25034) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25139) } // C documentation @@ -166285,9 +160956,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166314,29 +160985,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166360,7 +161020,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1137 + zDataType = __ccgo_ts + 1141 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -166391,15 +161051,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25051, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25156, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -166578,8 +161238,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167419,7 +162079,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25079, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25184, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -167567,6 +162227,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -167590,7 +162252,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -167600,7 +162262,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -167612,7 +162274,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -167628,7 +162290,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -167637,7 +162299,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25087 + v2 = __ccgo_ts + 25192 } else { v2 = uintptr(0) } @@ -167883,7 +162545,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168100,6 +162762,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168412,8 +163081,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168470,7 +163139,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168480,7 +163149,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168517,23 +163186,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1649, - 1: __ccgo_ts + 8073, - 2: __ccgo_ts + 8078, - 3: __ccgo_ts + 6387, - 4: __ccgo_ts + 6387, - 5: __ccgo_ts + 6382, - 6: __ccgo_ts + 6382, - 7: __ccgo_ts + 8384, - 8: __ccgo_ts + 8384, - 9: __ccgo_ts + 8384, - 10: __ccgo_ts + 8384, - 11: __ccgo_ts + 25110, - 12: __ccgo_ts + 25116, - 13: __ccgo_ts + 1663, - 14: __ccgo_ts + 1663, - 15: __ccgo_ts + 1663, - 16: __ccgo_ts + 1663, + 0: __ccgo_ts + 1653, + 1: __ccgo_ts + 8102, + 2: __ccgo_ts + 8107, + 3: __ccgo_ts + 6416, + 4: __ccgo_ts + 6416, + 5: __ccgo_ts + 6411, + 6: __ccgo_ts + 6411, + 7: __ccgo_ts + 8413, + 8: __ccgo_ts + 8413, + 9: __ccgo_ts + 8413, + 10: __ccgo_ts + 8413, + 11: __ccgo_ts + 25215, + 12: __ccgo_ts + 25221, + 13: __ccgo_ts + 1667, + 14: __ccgo_ts + 1667, + 15: __ccgo_ts + 1667, + 16: __ccgo_ts + 1667, } // C documentation @@ -168837,106 +163506,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169016,7 +163585,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169314,8 +163883,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 16)) += uint64(6) } } @@ -169449,9 +164018,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1653, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15478, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15536, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169465,14 +164034,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint32(56)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25140, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25228, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169526,7 +164093,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25257, -int32(1)) } } } @@ -169809,8 +164376,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25184, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25272, + FzRepl: __ccgo_ts + 25276, }, 1: { Fc1: int8('i'), @@ -169818,32 +164385,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25196, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25284, + FzRepl: __ccgo_ts + 25276, }, 2: { Fc1: int8('n'), Fc2: int8('N'), Fn: int8(3), FnRepl: int8(4), - FzMatch: __ccgo_ts + 1654, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 1658, + FzRepl: __ccgo_ts + 1653, }, 3: { Fc1: int8('q'), Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25205, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25293, + FzRepl: __ccgo_ts + 1653, }, 4: { Fc1: int8('s'), Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25210, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25298, + FzRepl: __ccgo_ts + 1653, }, } @@ -169858,7 +164425,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25215, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25303, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -169876,23 +164443,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -169970,7 +164537,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170041,7 +164608,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170316,7 +164887,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25258, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25346, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -170746,7 +165317,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -170785,7 +165356,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8073, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8102, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -170793,7 +165364,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8078, uint32(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8107, uint32(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -170870,14 +165441,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25184, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25272, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25280, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25368, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171038,7 +165609,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1649, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1653, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171062,7 +165633,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171107,7 +165678,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171120,7 +165691,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171169,10 +165740,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171206,15 +165773,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171283,15 +165850,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1653, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8073, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8102, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8078, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8107, uint32(5)) return i + uint32(1) _6: ; @@ -171340,9 +165907,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25188 + v19 = __ccgo_ts + 25276 } else { - v19 = __ccgo_ts + 11940 + v19 = __ccgo_ts + 11998 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171378,9 +165945,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 16)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171407,7 +165977,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25286, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25374, uint32(2)) zIn2++ sz2-- continue @@ -171430,7 +166000,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25289, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25377, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 25 @@ -171438,12 +166008,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25296, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25384, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25301, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25389, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -171546,16 +166116,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -171623,7 +166183,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171646,12 +166206,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25311, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25399, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171666,50 +166226,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+4 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+4, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+4, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -171761,6 +166277,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 40)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -171781,6 +166375,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -171853,9 +166450,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -171898,7 +166495,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172386,7 +166994,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172521,7 +167129,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -172622,7 +167230,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } @@ -172659,11 +167267,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25140, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25228, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -172676,7 +167281,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint32(56)) return int32(1) @@ -172695,10 +167300,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -172737,7 +167342,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25314, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25402, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -172753,7 +167358,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -172834,7 +167439,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -172846,34 +167451,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -172956,7 +167581,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173016,7 +167641,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173151,7 +167776,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25332 + v1 = __ccgo_ts + 25420 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173161,7 +167786,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } eErr = uint8(1) @@ -173271,23 +167896,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25334, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25336, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5226, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5256, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1676, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1706, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25426, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25341, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25429, uint32(1)) } } } @@ -173323,11 +167948,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1653, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -173595,7 +168220,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -173619,7 +168244,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25343, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25431, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -173630,7 +168255,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25394, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25482, -int32(1)) _jsonStringReset(tls, bp) return } @@ -173702,7 +168327,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_remove_done @@ -173739,7 +168364,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15951) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16056) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -173770,9 +168395,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25428 + v1 = __ccgo_ts + 25516 } else { - v1 = __ccgo_ts + 25432 + v1 = __ccgo_ts + 25520 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -173820,7 +168445,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_type_done @@ -173867,7 +168492,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25439 + (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25527 (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent) @@ -173941,17 +168566,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(112) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+56 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25444, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25532, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -173960,18 +168584,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint32(56)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174033,9 +168656,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174142,7 +168763,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25501, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25589, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174234,20 +168855,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(128)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*4))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*4))) + } } } @@ -174291,7 +168914,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25504, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25592, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174319,16 +168942,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -174347,24 +168960,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174372,13 +168967,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174394,7 +168982,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25507) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25595) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(16)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174528,7 +169116,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+25590, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+25678, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -174554,9 +169142,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25597, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25685, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25605, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25693, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -174867,9 +169455,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+168, 0, uint32(56)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+168) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174942,7 +169529,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+40, __ccgo_ts+25611, uint32(1)) + _jsonAppendRaw(tls, p+40, __ccgo_ts+25699, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+168, i, bp) @@ -174966,7 +169553,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25169, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25257, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175027,186 +169614,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25613, + FzName: __ccgo_ts + 25701, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25618, + FzName: __ccgo_ts + 25706, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25624, + FzName: __ccgo_ts + 25712, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25635, + FzName: __ccgo_ts + 25723, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25665, + FzName: __ccgo_ts + 25753, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25685, + FzName: __ccgo_ts + 25773, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25698, + FzName: __ccgo_ts + 25786, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25712, + FzName: __ccgo_ts + 25800, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25715, + FzName: __ccgo_ts + 25803, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25719, + FzName: __ccgo_ts + 25807, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25731, + FzName: __ccgo_ts + 25819, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25744, + FzName: __ccgo_ts + 25832, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25756, + FzName: __ccgo_ts + 25844, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25769, + FzName: __ccgo_ts + 25857, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25780, + FzName: __ccgo_ts + 25868, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25804, + FzName: __ccgo_ts + 25892, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25815, + FzName: __ccgo_ts + 25903, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25827, + FzName: __ccgo_ts + 25915, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25840, + FzName: __ccgo_ts + 25928, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25853, + FzName: __ccgo_ts + 25941, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25867, + FzName: __ccgo_ts + 25955, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25876, + FzName: __ccgo_ts + 25964, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25907, + FzName: __ccgo_ts + 25995, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25924, + FzName: __ccgo_ts + 26012, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25942, + FzName: __ccgo_ts + 26030, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25960, + FzName: __ccgo_ts + 26048, }, } @@ -175289,17 +169876,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25979, + FzName: __ccgo_ts + 26067, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25989, + FzName: __ccgo_ts + 26077, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175349,224 +169938,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -175584,33 +169958,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -175621,79 +169989,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 +} + +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -175939,7 +170292,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25999, iNode, 0, pRtree+72) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26087, iNode, 0, pRtree+72) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176244,7 +170597,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26004, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26092, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -177161,7 +171514,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26086) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26174) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177470,7 +171823,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint32FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -177478,7 +171831,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -177716,7 +172069,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178647,11 +173000,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178664,11 +173017,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178696,7 +173049,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26100, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -178706,11 +173059,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26120, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26208, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26152, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26240, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -178924,7 +173277,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26189, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -178978,9 +173331,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26334 + zFmt = __ccgo_ts + 26422 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11769, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11827, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179038,9 +173391,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26390, - 1: __ccgo_ts + 5565, - 2: __ccgo_ts + 16846, + 0: __ccgo_ts + 26478, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16951, } var _rtreeModule = Tsqlite3_module{ @@ -179084,21 +173437,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26804, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26892, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26866, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26954, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26871, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26935, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27005, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26959, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27023, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27093, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179128,7 +173481,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27054 + zFormat = __ccgo_ts + 27142 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179143,31 +173496,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27162, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27250, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27207, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27295, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13335, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27234, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27322, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27256, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27344, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27264, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27352, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179181,14 +173534,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26395, - 1: __ccgo_ts + 26448, - 2: __ccgo_ts + 26493, - 3: __ccgo_ts + 26545, - 4: __ccgo_ts + 26599, - 5: __ccgo_ts + 26644, - 6: __ccgo_ts + 26702, - 7: __ccgo_ts + 26757, + 0: __ccgo_ts + 26483, + 1: __ccgo_ts + 26536, + 2: __ccgo_ts + 26581, + 3: __ccgo_ts + 26633, + 4: __ccgo_ts + 26687, + 5: __ccgo_ts + 26732, + 6: __ccgo_ts + 26790, + 7: __ccgo_ts + 26845, } // C documentation @@ -179246,7 +173599,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27280, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179254,17 +173607,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27300, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27388, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+16) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179341,13 +173694,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), libc.Uint32FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27549, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27637, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) ii = int32(4) for { if !(ii < argc) { @@ -179356,7 +173709,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27573, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27661, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179370,19 +173723,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179405,7 +173758,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179416,7 +173769,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179432,8 +173785,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27579, - 1: __ccgo_ts + 27590, + 0: __ccgo_ts + 27667, + 1: __ccgo_ts + 27678, } // C documentation @@ -179491,21 +173844,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+28, bp, ii, bp+528) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11389, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11447, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27603, libc.VaList(bp+584, (*(*TRtreeCell)(unsafe.Pointer(bp + 528))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27691, libc.VaList(bp+584, (*(*TRtreeCell)(unsafe.Pointer(bp + 528))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 28))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27609, libc.VaList(bp+584, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 528 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27697, libc.VaList(bp+584, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 528 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27613, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27701, int32(1)) goto _1 _1: ; @@ -179532,7 +173885,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27615, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27703, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -179566,23 +173919,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -179635,7 +173971,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -179650,11 +173986,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4268 + v1 = __ccgo_ts + 4298 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27648, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27736, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -179688,7 +174024,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27655, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27743, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -179705,7 +174041,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27700, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27788, libc.VaList(bp+8, iNode)) } } return pRet @@ -179734,8 +174070,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27732, - 1: __ccgo_ts + 27786, + 0: __ccgo_ts + 27820, + 1: __ccgo_ts + 27874, } if *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -179748,21 +174084,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27834 + v1 = __ccgo_ts + 27922 } else { - v1 = __ccgo_ts + 27842 + v1 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27851, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27939, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27834 + v2 = __ccgo_ts + 27922 } else { - v2 = __ccgo_ts + 27842 + v2 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27896, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27984, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -179807,7 +174143,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27954, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28042, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -179825,7 +174161,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28002, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28090, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -179858,19 +174194,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28069, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28157, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28103, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28191, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28133, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -179915,12 +174251,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28188, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28276, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28307, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -179949,7 +174285,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28286, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28374, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -179959,11 +174295,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26100, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26188, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28314, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28402, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -179979,8 +174315,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28345, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28352, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28433, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28440, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180007,7 +174343,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28360, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28448, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180058,13 +174394,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28379, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28467, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6711 + zDb = __ccgo_ts + 6740 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4))) } @@ -180073,7 +174409,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18613 + v1 = __ccgo_ts + 18718 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180167,14 +174503,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180199,16 +174527,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180540,19 +174858,19 @@ func _geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if p != 0 { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) - Xsqlite3_str_append(tls, x, __ccgo_ts+25334, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+25422, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28430, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28518, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28441, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28529, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -180581,20 +174899,20 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) cSep = int8('\'') - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28452, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28540, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28470, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28558, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) cSep = int8(' ') goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28478, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28566, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) i = int32(1) for { if !(i < argc) { @@ -180602,14 +174920,14 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if z != 0 && *(*int8)(unsafe.Pointer(z)) != 0 { - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28486, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28574, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28490, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28578, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -180655,8 +174973,8 @@ func _geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } x0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) y0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) - x1 = float32(A*float64(x0) + B*float64(y0) + E) - y1 = float32(C*float64(x0) + D*float64(y0) + F) + x1 = float32(float64(A*float64(x0)) + float64(B*float64(y0)) + E) + y1 = float32(float64(C*float64(x0)) + float64(D*float64(y0)) + F) *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) = x1 *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) = y1 goto _1 @@ -180688,13 +175006,13 @@ func _geopolyArea(tls *libc.TLS, p uintptr) (r float64) { if !(ii < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex-int32(1)) { break } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5)) goto _1 _1: ; ii++ } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5)) return rArea } @@ -180774,16 +175092,16 @@ func _geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { func _geopolySine(tls *libc.TLS, r float64) (r1 float64) { var r2, r3, r5 float64 _, _, _ = r2, r3, r5 - if r >= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -180830,9 +175148,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -180991,13 +175309,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181058,7 +175369,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181097,7 +175408,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181201,7 +175512,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181232,36 +175543,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181285,7 +175566,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*40 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -181569,7 +175850,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -181738,13 +176019,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), libc.Uint32FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28503, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28591, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -181753,13 +176034,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28525, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28613, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -181767,7 +176048,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -181782,7 +176063,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -181994,7 +176275,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16846 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16951 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -182004,7 +176285,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28529 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28617 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182012,7 +176293,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28535 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28623 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182132,7 +176413,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp+4+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28544, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28632, 0) } goto geopoly_update_end } @@ -182232,16 +176513,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28584) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28672) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28600) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28688) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182311,7 +176592,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28777, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28865, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182325,61 +176606,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28615, + FzName: __ccgo_ts + 28703, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28628, + FzName: __ccgo_ts + 28716, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28641, + FzName: __ccgo_ts + 28729, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28654, + FzName: __ccgo_ts + 28742, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28600, + FzName: __ccgo_ts + 28688, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28666, + FzName: __ccgo_ts + 28754, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28584, + FzName: __ccgo_ts + 28672, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28689, + FzName: __ccgo_ts + 28777, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28703, + FzName: __ccgo_ts + 28791, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28716, + FzName: __ccgo_ts + 28804, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28730, + FzName: __ccgo_ts + 28818, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28746, + FzName: __ccgo_ts + 28834, }, } @@ -182405,7 +176686,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28758, + FzName: __ccgo_ts + 28846, }, } @@ -182430,20 +176711,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28785, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28873, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28795, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28883, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28806, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28894, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28529, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28617, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28817, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28905, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182517,7 +176798,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint32(uint32(36) + libc.Uint32FromInt32(nArg-libc.Int32FromInt32(1))*uint32(8) + libc.Uint32FromInt32(nArg)*uint32(4)) + nBlob = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+28) + libc.Uint32FromInt32(nArg)*uint32(8) + libc.Uint32FromInt32(nArg)*uint32(4)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -182545,17 +176826,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26086, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26174, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -182563,33 +176846,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(16)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -182786,7 +177073,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183207,248 +177494,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -183762,7 +177807,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -183772,7 +177817,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -183798,7 +177843,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -183821,7 +177866,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -183953,7 +177998,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28848, uintptr(0), uintptr(0), p+36) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28936, uintptr(0), uintptr(0), p+36) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184042,7 +178087,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+25999, zIn, uint32(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+26087, zIn, uint32(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184079,13 +178124,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint32(108)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29019 + v1 = __ccgo_ts + 29107 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29060, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29148, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29210) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29298) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184252,7 +178297,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184313,7 +178358,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29335, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29423, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184323,7 +178368,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29454, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29542, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184331,7 +178376,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29475, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29563, libc.VaList(bp+24, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184343,7 +178388,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29526, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29614, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184387,7 +178432,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint32(1)*libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184400,7 +178445,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint32(1)*libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) if iCid >= 0 { @@ -184453,7 +178498,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+36, bp+4, pIter+60) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20121, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20226, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184464,7 +178509,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29604, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184475,7 +178520,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29623, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29711, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+32) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 8 @@ -184483,7 +178528,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*4)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29628, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29716, zName) { bRbuRowid = int32(1) } } @@ -184497,17 +178542,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29638 + v4 = __ccgo_ts + 29726 } else { - v4 = __ccgo_ts + 29651 + v4 = __ccgo_ts + 29739 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29660, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29748, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29689, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29777, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184529,7 +178574,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29711, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29799, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -184568,15 +178613,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29738, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29826, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -184601,7 +178646,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 for int32(1) != 0 { i = 0 for { @@ -184610,7 +178655,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29747, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29835, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -184658,21 +178703,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29760, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29848, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29792, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+29815) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29821, __ccgo_ts+29828, __ccgo_ts+5171) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+29903) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29909, __ccgo_ts+29916, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29836, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29924, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29878, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29966, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -184721,10 +178766,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -184746,15 +178791,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29906, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29927, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29963, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15145 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30015, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15203 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -184763,9 +178808,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29990, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30078, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -184780,15 +178825,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30038, libc.VaList(bp+16, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15145 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30126, libc.VaList(bp+16, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15203 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30045, libc.VaList(bp+16, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+16, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -184842,11 +178887,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1663 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1663 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1667 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1667 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184855,8 +178900,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30057, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) - zType = __ccgo_ts + 1663 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30145, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) + zType = __ccgo_ts + 1667 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -184875,34 +178920,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } else { - zCol = __ccgo_ts + 29628 + zCol = __ccgo_ts + 29716 } } - zType = __ccgo_ts + 1137 + zType = __ccgo_ts + 1141 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30079, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29815 + v2 = __ccgo_ts + 29903 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30099, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30187, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30120, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30153, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30208, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30241, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15145 - zAnd = __ccgo_ts + 22230 + zCom = __ccgo_ts + 15203 + zAnd = __ccgo_ts + 22335 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -184948,7 +178993,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1663 + zS = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -184956,11 +179001,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30177, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30265, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30189, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30277, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15145 + zS = __ccgo_ts + 15203 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -184972,7 +179017,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30198, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30286, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -184998,27 +179043,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30213, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30227, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30315, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22335 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30239, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30327, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1663 + zSep1 = __ccgo_ts + 1667 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185026,8 +179071,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22335 } goto _2 _2: @@ -185050,7 +179095,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30302, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30390, 0) } // C documentation @@ -185084,7 +179129,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if libc.Int32FromUint32(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185092,16 +179137,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30328, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30416, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30358, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30446, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15203 } } } @@ -185185,16 +179230,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30395 + zSep = __ccgo_ts + 30483 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16734) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16839) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, zIdx))) } break } @@ -185205,16 +179250,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30408, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15145 + z = _rbuMPrintf(tls, p, __ccgo_ts+30496, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15203 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30419, libc.VaList(bp+16, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+16, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } return z @@ -185254,13 +179299,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30423) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30511) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185268,7 +179313,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { @@ -185277,21 +179322,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30473, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30561, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30495, libc.VaList(bp+16, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15145 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30583, libc.VaList(bp+16, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15203 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+16, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+16, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30520, libc.VaList(bp+16, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30608, libc.VaList(bp+16, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185326,30 +179371,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1663 + zPk = __ccgo_ts + 1667 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*4)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30582 + zPk = __ccgo_ts + 30670 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30595 + v2 = __ccgo_ts + 30683 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30605, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15145 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30693, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15203 goto _1 _1: ; @@ -185358,17 +179403,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30632, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30720, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30639 + v3 = __ccgo_ts + 30727 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30654, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30742, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185394,7 +179439,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30686, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30774, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185440,7 +179485,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30743) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30831) } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 4)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -185609,7 +179654,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30809, libc.VaList(bp+24, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30897, libc.VaList(bp+24, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -185626,18 +179671,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+4, bp+8, bp+12) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 12))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30829, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30917, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 12)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30894, libc.VaList(bp+24, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30982, libc.VaList(bp+24, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30930, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31018, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185652,26 +179697,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30964 + v2 = __ccgo_ts + 31052 } else { - v2 = __ccgo_ts + 30968 + v2 = __ccgo_ts + 31056 } v1 = v2 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30974, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31062, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31035, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31123, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30964 + v3 = __ccgo_ts + 31052 } else { - v3 = __ccgo_ts + 30968 + v3 = __ccgo_ts + 31056 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31096, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31184, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185690,62 +179735,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6722) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6718) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6751) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6747) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } else { - v4 = __ccgo_ts + 31255 + v4 = __ccgo_ts + 31343 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31264 + v5 = __ccgo_ts + 31352 } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31274, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31362, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31310, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31398, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1663 + zRbuRowid = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31338 + zRbuRowid = __ccgo_ts + 31426 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31350 + v6 = __ccgo_ts + 31438 } else { - v6 = __ccgo_ts + 1663 + v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31367, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31443, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31455, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31531, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31742, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31830, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1663 + zRbuRowid1 = __ccgo_ts + 1667 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31841 + v7 = __ccgo_ts + 31929 } else { - v7 = __ccgo_ts + 31851 + v7 = __ccgo_ts + 31939 } zRbuRowid1 = v7 } @@ -185758,28 +179803,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29898, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31862 + v8 = __ccgo_ts + 31950 } else { - v8 = __ccgo_ts + 1663 + v8 = __ccgo_ts + 1667 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1663 + v9 = __ccgo_ts + 1667 } if zOrder != 0 { - v10 = __ccgo_ts + 23486 + v10 = __ccgo_ts + 23591 } else { - v10 = __ccgo_ts + 1663 + v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31868, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31956, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -185865,11 +179910,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1663 + zPrefix = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31255 + zPrefix = __ccgo_ts + 31343 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31916, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32004, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+4, p+36, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -185896,7 +179941,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -185943,7 +179988,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31946, libc.VaList(bp+16, p+24))) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32034, libc.VaList(bp+16, p+24))) for *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -186002,27 +180047,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31976, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32064, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32004, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+24, __ccgo_ts+3483, uint32(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32092, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+24, __ccgo_ts+3513, uint32(4)) } else { - libc.Xmemcpy(tls, p+24, __ccgo_ts+6711, uint32(4)) + libc.Xmemcpy(tls, p+24, __ccgo_ts+6740, uint32(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32022, libc.VaList(bp+8, p+24)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32110, libc.VaList(bp+8, p+24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186055,10 +180100,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32088, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32176, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24829, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24934, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186072,16 +180117,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 32120 + v2 = __ccgo_ts + 32208 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32122, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32210, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186092,27 +180137,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32154, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32242, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32169, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32257, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32186, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32274, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32202, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32290, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32230, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32318, 0) } } @@ -186162,7 +180207,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186264,7 +180309,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186337,12 +180382,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186364,21 +180409,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186395,7 +180440,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32283, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32371, 0) } // C documentation @@ -186412,13 +180457,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32308, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32315, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32396, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -186550,7 +180595,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24386, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24491, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -186686,7 +180731,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32322) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32410) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -186699,7 +180744,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32344, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -186726,7 +180771,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32371, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32459, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -186762,9 +180807,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32531, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32619, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32546, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -186787,9 +180832,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32566, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32654, uintptr(0), uintptr(0), p+36) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32591) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -186800,10 +180845,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32699) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32787) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32764) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32852) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -186821,7 +180866,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32808, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32896, uintptr(0), uintptr(0), p+36) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -186848,8 +180893,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17819) - _rbuCopyPragma(tls, p, __ccgo_ts+16930) + _rbuCopyPragma(tls, p, __ccgo_ts+17924) + _rbuCopyPragma(tls, p, __ccgo_ts+17035) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -186857,7 +180902,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32833, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32921, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -186879,10 +180924,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -186896,10 +180941,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -186969,7 +181014,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32861, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32949, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -186992,10 +181037,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32308, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32396, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187017,7 +181062,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32886, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32974, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187064,7 +181109,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32897, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32985, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 4)), -int32(1)) } else { @@ -187109,11 +181154,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32969, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33057, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32983) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33071) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187122,7 +181167,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33040) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33128) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187170,7 +181215,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint32(1)) pCsr += uintptr(nRbu + uint32(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3860, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187202,7 +181247,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33114, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33202, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187224,17 +181269,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33146 + v3 = __ccgo_ts + 33234 } else { - v3 = __ccgo_ts + 33153 + v3 = __ccgo_ts + 33241 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33160, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33248, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15034, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15092, uintptr(0), uintptr(0), p+36) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+52) @@ -187246,21 +181291,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17533) - _rbuCopyPragma(tls, p, __ccgo_ts+16945) + _rbuCopyPragma(tls, p, __ccgo_ts+17638) + _rbuCopyPragma(tls, p, __ccgo_ts+17050) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33192, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33280, uintptr(0), uintptr(0), p+36) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33208, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33296, uintptr(0), uintptr(0), p+36) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187338,7 +181383,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33232, zState+uintptr(n-uint32(7)), uint32(7)) { + if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33320, zState+uintptr(n-uint32(7)), uint32(7)) { return _rbuMisuseError(tls) } } @@ -187385,7 +181430,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(i < nErrmsg-uint32(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31255, uint32(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31343, uint32(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187413,16 +181458,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+52) @@ -187432,7 +181477,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33240, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33328, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187533,32 +181578,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15034 + v1 = __ccgo_ts + 15092 } else { - v1 = __ccgo_ts + 33192 + v1 = __ccgo_ts + 33280 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33192, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33280, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -187584,9 +181629,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -187658,7 +181705,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -187861,7 +181908,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -187912,14 +181959,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint32FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189495,7 +183481,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33335, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33423, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FzPath = v4 if z == uintptr(0) { @@ -189518,13 +183504,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33343 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33431 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33352 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33440 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33357 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33445 break } *(*int32)(unsafe.Pointer(pCsr + 1320)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189533,7 +183519,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -189622,12 +183608,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33367, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33455, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33522, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33610, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33536, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33624, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -189704,7 +183690,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33551, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33639, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -189844,315 +183830,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -190998,20 +184675,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33558, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33646, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1663, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33688, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33776, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191037,7 +184714,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29898)) + nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29986)) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { nByte += libc.Int64FromUint32(libc.Uint32FromInt32(nDbCol) * (libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2) + libc.Uint32FromInt64(4) + libc.Uint32FromInt64(1) + libc.Uint32FromInt32(1) + libc.Uint32FromInt32(1))) @@ -191061,8 +184738,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29898) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29898, nName+uint32(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29986) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29986, nName+uint32(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName + uint32(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191126,7 +184803,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191143,6 +184820,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _ = i, rc, v1 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 20 } else { @@ -191164,7 +184843,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -191458,10 +185137,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 12)) = SQLITE_OK - zSep = __ccgo_ts + 11389 + zSep = __ccgo_ts + 11447 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33718, 0) + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33806, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191470,11 +185149,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*4)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*4)) } else { - v2 = __ccgo_ts + 1664 + v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5141, libc.VaList(bp+24, zSep, zDflt)) - zSep = __ccgo_ts + 15145 + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5171, libc.VaList(bp+24, zSep, zDflt)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -191555,13 +185234,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -191793,7 +185465,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1663, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1667, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -192053,14 +185725,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192120,7 +185784,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) i = 0 for { @@ -192128,8 +185792,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33725, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 22230 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33813, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zSep = __ccgo_ts + 22335 if zRet == uintptr(0) { break } @@ -192148,7 +185812,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) bHave = 0 i = 0 @@ -192158,8 +185822,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33759, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 33800 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33847, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zSep = __ccgo_ts + 33888 if zRet == uintptr(0) { break } @@ -192170,7 +185834,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1783, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1813, 0) } return zRet } @@ -192181,12 +185845,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33805 + v1 = __ccgo_ts + 33893 } else { - v1 = __ccgo_ts + 6716 + v1 = __ccgo_ts + 6745 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33816, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192247,11 +185911,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33895, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33983, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) if !(zRet != 0) { break } @@ -192279,7 +185943,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33914, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34002, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192308,17 +185972,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(32) - defer tls.Free(32) + bp := tls.Alloc(64) + defer tls.Free(64) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+24 */ uintptr var _ /* azCol at bp+28 */ uintptr var _ /* bRowid at bp+20 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+16 */ int32 + var _ /* pDbExists at bp+32 */ uintptr var _ /* pTo at bp+12 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint32(12)) @@ -192331,7 +185996,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+12) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0) { goto diff_out } @@ -192342,18 +186009,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 16)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 20)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 28)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 20 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34059, libc.VaList(bp+48, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+32, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 16)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 16)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 20 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+16, uintptr(0), uintptr(0), bp+28, uintptr(0), uintptr(0), bp+24, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+16, uintptr(0), uintptr(0), bp+28, uintptr(0), uintptr(0), bp+24, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FnCol != *(*int32)(unsafe.Pointer(bp + 16)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 16)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34090, libc.VaList(bp+48, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192379,7 +186072,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 28))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33971, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34111, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192539,15 +186232,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -192711,7 +186406,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, libc.Int32FromUint32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+5203, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+5233, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193005,18 +186700,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 16)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 28)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+16, __ccgo_ts+33998, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zTab) { - _sessionAppendStr(tls, bp+16, __ccgo_ts+34002, bp) - _sessionAppendStr(tls, bp+28, __ccgo_ts+34026, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34035, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34080, bp) + _sessionAppendStr(tls, bp+16, __ccgo_ts+34138, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zTab) { + _sessionAppendStr(tls, bp+16, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+28, __ccgo_ts+34166, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34175, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34220, bp) } else { i = 0 for { @@ -193024,17 +186719,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+28, zSep, bp) _sessionAppendStr(tls, bp+40, zSep, bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 _sessionAppendIdent(tls, bp+28, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) - _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34094, libc.VaList(bp+64, i+int32(1))) + _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34234, libc.VaList(bp+64, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+34098, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+34238, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) } goto _1 _1: @@ -193046,9 +186741,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34125, libc.VaList(bp+64, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34265, libc.VaList(bp+64, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193169,7 +186864,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193183,14 +186878,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34167, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -193259,8 +186954,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193285,18 +186980,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34187, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34327, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -193320,28 +187015,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193480,7 +187179,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193495,9 +187194,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint32(100)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -193526,20 +187225,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -193551,13 +187254,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint32FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint32FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -193713,7 +187417,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -193737,7 +187441,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -193752,7 +187456,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -193808,7 +187512,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -193913,7 +187617,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+44, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -193984,8 +187688,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194019,7 +187723,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194029,7 +187733,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194108,7 +187812,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194369,7 +188073,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194518,11 +188222,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -194534,8 +188238,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } goto finished_invert @@ -194563,12 +188267,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var rc int32 @@ -194576,9 +188284,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint32(44)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -194591,14 +188299,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -194622,29 +188322,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -194721,18 +188398,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint32(uint32(12) * libc.Uint32FromInt32(nU32) * uint32(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11769) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11827) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 libc.Xmemset(tls, bp+4, 0, uint32(12)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*12 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint32FromInt32(nU32)*uint32(4)) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34205, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34345, bp) _sessionAppendIdent(tls, bp+4, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34218, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34358, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -194742,9 +188419,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 } goto _2 _2: @@ -194752,8 +188429,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1663 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34229, bp) + zSep = __ccgo_ts + 1667 + _sessionAppendStr(tls, bp+4, __ccgo_ts+34369, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -194762,13 +188439,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+4, __ccgo_ts+34237, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34377, bp) } else { _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _3 _3: @@ -194851,13 +188528,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+4 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34318, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34458, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34229, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194867,9 +188544,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _1 _1: @@ -194877,10 +188554,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+4, __ccgo_ts+34336, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34476, bp) _sessionAppendInteger(tls, bp+4, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+33800, bp) - zSep = __ccgo_ts + 1663 + _sessionAppendStr(tls, bp+4, __ccgo_ts+33888, bp) + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194889,16 +188566,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 34344 + zSep = __ccgo_ts + 34484 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+5201, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf, p+4, uintptr(0)) @@ -194924,7 +188601,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6711, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6740, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) } // C documentation @@ -194947,16 +188624,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+4, __ccgo_ts+34349, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34489, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+22236, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+22341, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) goto _1 @@ -194964,19 +188641,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34367, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34507, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34378, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34518, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+5201, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf, p+8, uintptr(0)) } @@ -194999,12 +188676,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11769, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11827, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34382) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34522) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34495) + rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34635) } return rc } @@ -195048,7 +188725,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195066,11 +188743,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195247,7 +188924,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var aBlob uintptr @@ -195271,7 +188948,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195286,7 +188963,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195337,7 +189014,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var abPK, pNew, pOld, v1 uintptr @@ -195377,10 +189054,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195418,11 +189095,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195445,7 +189122,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195464,7 +189141,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195473,7 +189150,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195483,10 +189160,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34639, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34779, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195496,10 +189173,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34660, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34800, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195512,7 +189189,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -195539,7 +189216,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -195567,7 +189244,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(240) defer tls.Free(240) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -195599,15 +189276,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34679, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34819, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34705, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+92, bp+84, bp+88, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 92)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -195631,9 +189308,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 92)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 92)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp + 92)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp + 92)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -195643,7 +189320,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+96, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6711, *(*uintptr)(unsafe.Pointer(bp + 92)), bp+4+16, uintptr(0), bp, bp+4+20, uintptr(0), uintptr(0), bp+4+24, bp+4+76) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6740, *(*uintptr)(unsafe.Pointer(bp + 92)), bp+4+16, uintptr(0), bp, bp+4+20, uintptr(0), uintptr(0), bp+4+24, bp+4+76) if rc != SQLITE_OK { break } @@ -195662,18 +189339,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34735, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34875, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol < *(*int32)(unsafe.Pointer(bp + 84)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34779, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34919, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) } else { if *(*int32)(unsafe.Pointer(bp + 84)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 96)), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 84)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34850, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34990, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol = *(*int32)(unsafe.Pointer(bp + 84)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11769) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11827) { v2 = _sessionStat1Sql(tls, db, bp+4) rc = v2 if v2 != 0 { @@ -195707,7 +189384,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+4, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+4, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -195716,7 +189393,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+100, bp+104, 0) @@ -195724,23 +189401,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+108, 0, uint32(100)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 108))).FnCol = *(*int32)(unsafe.Pointer(bp + 100)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+108) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+108) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34910, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35050, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34964, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35104, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase != 0 { @@ -195763,13 +189440,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -195778,11 +189459,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195790,10 +189475,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195801,37 +189492,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -196407,7 +190090,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i int32 @@ -196442,8 +190125,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf = 0 } goto _3 @@ -196462,9 +190145,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } else { if ppOut != 0 { @@ -196516,7 +190199,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -196552,11 +190235,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -196569,18 +190258,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -196588,13 +190279,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -196636,12 +190329,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -196649,27 +190348,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -196824,7 +190514,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var bDone, iHash, v2 int32 @@ -196932,8 +190622,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -196945,9 +190635,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+16, 0, uint32(12)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) } } else { if ppOut != 0 { @@ -197021,21 +190711,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197141,6 +190835,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197186,24 +190881,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197262,99 +190945,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -197376,14 +190966,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -197395,29 +190977,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197473,15 +191038,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197503,14 +191059,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -197581,7 +191129,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -197609,27 +191156,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -197660,7 +191198,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198196,14 +191734,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198214,16 +191744,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198275,10 +191795,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(1216)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(1216)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198384,12 +191904,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198464,7 +191984,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34992, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35132, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -198820,7 +192340,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -198976,18 +192496,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199070,22 +192578,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199104,7 +192596,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint32(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35051, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35191, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199203,7 +192695,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+68 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35058 + zErr = __ccgo_ts + 35198 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199214,7 +192706,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 68)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+16, bp+20) if *(*int32)(unsafe.Pointer(bp + 68)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 68)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -199263,16 +192755,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199420,7 +192902,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } return v1 } @@ -199458,7 +192940,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 76)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35108 + zErr = __ccgo_ts + 35248 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199640,15 +193122,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -199729,7 +193202,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -199821,13 +193294,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -199853,13 +193326,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35156 + z = __ccgo_ts + 35296 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35212 + z1 = __ccgo_ts + 35352 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -199892,19 +193365,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35270, + FzFunc: __ccgo_ts + 35410, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35278, + FzFunc: __ccgo_ts + 35418, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35288, + FzFunc: __ccgo_ts + 35428, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35293, + FzFunc: __ccgo_ts + 35433, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200292,7 +193765,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -200379,21 +193852,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -200564,7 +194022,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1649, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1653, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -200702,13 +194160,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -200768,7 +194219,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint32(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35309, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint32(libc.Uint32FromInt64(4) * libc.Uint32FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -200794,12 +194245,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35316, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35456, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35347, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35487, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200808,7 +194259,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35380, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35520, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200818,14 +194269,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35417, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35557, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint32(libc.Xstrlen(tls, zArg) + uint32(1)) azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(2))*nArg) if azArg != 0 { pSpace = azArg + uintptr(nArg)*4 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35426, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35566, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -200852,7 +194303,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35459, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -200864,76 +194315,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35493, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35501, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35533, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35673, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35539, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35601, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35741, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35623, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35763, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35637, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35777, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35675, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35815, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35686, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35826, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35721, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35861, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35728, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35868, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5580, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5610, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 4)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8405, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17899, + FzName: __ccgo_ts + 18004, }, 2: { - FzName: __ccgo_ts + 35759, + FzName: __ccgo_ts + 35899, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -200941,20 +194392,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+4, zArg, pConfig+68) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35767, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35798, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35938, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35808, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35948, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35842, libc.VaList(bp+48, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35982, libc.VaList(bp+48, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201015,16 +194466,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35870) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16846) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35875, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36010) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16951) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35905) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36045) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35915, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36055, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201050,7 +194501,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 4)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35946, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36086, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201058,12 +194509,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35951, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36091, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35958, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36098, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36106, 0) } } goto _1 @@ -201079,9 +194530,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35973, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36113, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36106, 0) } goto _2 _2: @@ -201144,8 +194595,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*4)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35870) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35981, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36010) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201176,19 +194627,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36010, libc.VaList(bp+32, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, libc.VaList(bp+32, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 12)) } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -201206,7 +194657,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36170, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201214,37 +194665,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36080, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36220, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36135, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36275, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36188 + zTail = __ccgo_ts + 36328 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36196, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36336, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16846, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16951, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201313,25 +194764,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36207, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36347, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36223, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36363, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36230, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35870)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36370, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36010)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201364,7 +194815,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201374,9 +194825,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201489,7 +194940,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+4 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36256) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36396) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201500,7 +194951,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36261) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36401) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201511,7 +194962,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36270) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -201525,7 +194976,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36280) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36420) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -201536,7 +194987,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36290) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36430) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -201553,7 +195004,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36302) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36442) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -201568,7 +195019,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35870) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36010) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+4) if rc == SQLITE_OK { @@ -201583,7 +195034,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36314) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36454) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -201599,7 +195050,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36328) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36468) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -201642,7 +195093,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+4 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36338 + zSelect = __ccgo_ts + 36478 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK iVersion = 0 @@ -201662,7 +195113,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36370) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36510) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -201673,7 +195124,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 4)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36378, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36518, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -201738,112 +195189,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -201919,7 +195264,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36449, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, 0) return FTS5_EOF } goto _1 @@ -201930,7 +195275,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z2) - int32(z) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36469, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36609, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -201945,13 +195290,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z21) - int32(z) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36500, uint32(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36640, uint32(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36503, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36643, uint32(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30964, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31052, uint32(3)) == 0 { tok = int32(FTS5_AND) } break @@ -201995,7 +195340,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint32(libc.Uint32FromInt64(8) * libc.Uint32FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+8, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -202528,16 +195873,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+8, p+20) != 0 { @@ -202562,14 +195897,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -203634,7 +196961,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(SZALLOC)*uint32(4)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12) + libc.Uint32FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203644,7 +196971,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(nNew)*uint32(4)) + nByte1 = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12) + libc.Uint32FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203690,14 +197017,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -203750,12 +197069,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(44)+uint32(24)*libc.Uint32FromInt32(nNew))) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint32(44)) + libc.Xmemset(tls, pNew, 0, uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24)) } v3 = pNew pPhrase = v3 @@ -203889,7 +197208,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(44)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 20 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*24))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -203929,15 +197248,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(4)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(40)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+36)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(libc.Uint32FromInt64(16)+libc.Uint32FromInt64(4))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12)+libc.Uint32FromInt32(libc.Int32FromInt32(2))*libc.Uint32FromInt64(4))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint32(uint32(8) + libc.Uint32FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt64(8) * libc.Uint32FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint32FromInt64(nByte)) @@ -203978,7 +197297,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(44)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase != 0 { @@ -204016,8 +197335,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36507, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36647, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204037,10 +197356,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36512, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204074,7 +197396,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(uint32(8)+uint32(4)*libc.Uint32FromInt32(nCol))) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint32FromInt64(8)*libc.Uint32FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204124,7 +197446,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(uint32(8)+uint32(4)*libc.Uint32FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204175,7 +197497,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204202,7 +197524,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint32(uint32(8) + libc.Uint32FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt64(8) * libc.Uint32FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint32FromInt64(nByte)) @@ -204299,7 +197621,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36541, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36681, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204384,7 +197706,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm - nByte = libc.Int32FromUint32(uint32(40) + libc.Uint32FromInt32(nTerm)*uint32(4)) + nByte = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+36) + libc.Uint32FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204397,7 +197719,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(44)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204471,7 +197793,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint32(uint32(40) + uint32(4)*libc.Uint32FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+36) + libc.Uint32FromInt32(nChild)*libc.Uint32FromInt64(4)) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204497,11 +197819,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 12)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36594 + v2 = __ccgo_ts + 36734 } else { - v2 = __ccgo_ts + 36507 + v2 = __ccgo_ts + 36647 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36601, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36741, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204514,7 +197836,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36651, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36791, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -204635,14 +197957,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -204682,14 +197996,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -204991,7 +198297,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205054,67 +198360,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205998,7 +199244,6 @@ type Fts5Data = TFts5Data type TFts5DlidxIter = struct { FnLvl int32 FiSegid int32 - FaLvl [1]TFts5DlidxLvl } type Fts5DlidxIter = TFts5DlidxIter @@ -206035,7 +199280,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206108,7 +199352,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206143,7 +199386,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206158,149 +199400,12 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206308,187 +199413,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -206668,7 +199593,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, iRowid, 0, p+48) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, iRowid, 0, p+48) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -206773,7 +199698,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+52, Xsqlite3_mprintf(tls, __ccgo_ts+36710, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+52, Xsqlite3_mprintf(tls, __ccgo_ts+36850, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -206802,7 +199727,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36761, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36901, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+56, zSql) != 0 { return } @@ -206836,7 +199761,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+36810, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+36950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -206914,7 +199839,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint32(uint32(40) + libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint32(12)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+28) + libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint32FromInt64(12)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint32FromInt64(nByte)) @@ -207005,7 +199930,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36850, uint32(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36990, uint32(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207016,7 +199941,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36850, uint32(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36990, uint32(4)) *(*int32)(unsafe.Pointer(bp + 4)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -207697,7 +200622,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint32(uint32(36) + libc.Uint32FromInt32(i)*uint32(28)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+8) + libc.Uint32FromInt32(i+libc.Int32FromInt32(1))*libc.Uint32FromInt64(28)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -207942,15 +200867,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nTomb)*uint32(4) + uint32(12)) - pNew = _sqlite3Fts5MallocZero(tls, p+40, int64(nByte)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+8)) + (nTomb+libc.Int64FromInt32(1))*libc.Int64FromInt64(4) + pNew = _sqlite3Fts5MallocZero(tls, p+40, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208657,7 +201582,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+37018, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -208746,7 +201671,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+36962, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+37102, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209393,7 +202318,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, int64(168)+int64(96)*(nSlot-int64(1))+int64(4)*nSlot) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+72))+nSlot*int64(96)+int64(4)*nSlot) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 72 + uintptr(nSlot)*96 @@ -209419,14 +202344,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209436,15 +202353,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -209558,7 +202466,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -209579,7 +202487,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210361,7 +203269,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -210716,7 +203624,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+40, pWriter+4+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+60, Xsqlite3_mprintf(tls, __ccgo_ts+37044, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+60, Xsqlite3_mprintf(tls, __ccgo_ts+37184, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211171,13 +204079,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211222,7 +204123,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+37101, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+37241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211391,7 +204292,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+40, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+40, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -211709,7 +204610,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+37162, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -211984,7 +204885,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(40) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+28) + libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(12)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212019,7 +204920,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte += libc.Int64FromUint32(libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1)) * uint32(12)) + nByte += (int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel) + int64(1)) * int64(12) pNew = _sqlite3Fts5MallocZero(tls, p+40, nByte) if pNew != 0 { nByte = libc.Int64FromUint32(libc.Uint32FromInt32(nSeg) * uint32(48)) @@ -212298,16 +205199,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -212525,7 +205416,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -212562,7 +205453,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -212573,70 +205464,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -212705,7 +205533,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -212804,14 +205632,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -212858,19 +205678,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -212949,7 +205756,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 44 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 44))).FpT = _fts5IdxMalloc(tls, p, int64(44)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 44))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(72))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -212999,7 +205806,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(12)+libc.Uint32FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint32(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, int64(12)+int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+int64(FTS5_DATA_ZERO_PADDING)) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*12 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213081,15 +205888,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [40]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint32(40)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint32(libc.UintptrFromInt32(0)+28)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(12)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1663, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1667, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213115,11 +205925,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37213, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37353, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25999, __ccgo_ts+37221, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26087, __ccgo_ts+37361, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11980, __ccgo_ts+37256, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12038, __ccgo_ts+37396, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213317,7 +206127,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nAlloc)*uint32(4) + uint32(44)) + nByte = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+40) + libc.Uint32FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint32FromInt64(72)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -213572,7 +206382,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+40, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(1), __ccgo_ts+37300) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(1), __ccgo_ts+37440) } else { _sqlite3Fts5BufferSet(tls, p+40, bp, nToken, pToken) } @@ -213923,7 +206733,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+40, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 12))).FpT = _sqlite3Fts5MallocZero(tls, p+40, int64(44)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 12))).FpT = _sqlite3Fts5MallocZero(tls, p+40, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(72))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214045,7 +206855,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+40, int64(44)) + pT = _sqlite3Fts5MallocZero(tls, p+40, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(72))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214165,7 +206975,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -214759,7 +207569,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37442, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -214990,7 +207800,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12))+72+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FaFirst + 1*4))).FiFirst)*96, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(4), __ccgo_ts+37388) + _sqlite3Fts5BufferAppendBlob(tls, p+40, bp, uint32(4), __ccgo_ts+37528) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+32, bp+24) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215129,7 +207939,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215184,87 +207993,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215272,96 +208000,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -215612,7 +208250,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37393, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37533, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -215649,7 +208287,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -215668,7 +208306,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216118,7 +208756,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 56)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216146,7 +208784,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216166,7 +208804,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint32(uint32(24) + uint32(4)*libc.Uint32FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+16) + libc.Uint32FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint32FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216181,21 +208819,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15145 + v1 = __ccgo_ts + 15203 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } if bDesc != 0 { - v3 = __ccgo_ts + 37432 + v3 = __ccgo_ts + 37572 } else { - v3 = __ccgo_ts + 37437 + v3 = __ccgo_ts + 37577 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37441, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216253,14 +208891,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37496, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37636, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5562, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5592, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37502, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37642, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216310,7 +208948,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37530, libc.VaList(bp+16, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37670, libc.VaList(bp+16, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+4, uintptr(0)) @@ -216343,7 +208981,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37540, libc.VaList(bp+16, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37680, libc.VaList(bp+16, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216377,7 +209015,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 56)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37561, libc.VaList(bp+16, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37701, libc.VaList(bp+16, z)) } } } else { @@ -216385,7 +209023,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35288 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35428 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -216542,7 +209180,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+4, bp+8, bp+12, bp+16) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37594, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37734, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 12)), *(*int32)(unsafe.Pointer(bp + 16))) } @@ -216613,7 +209251,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 4)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 4)) = __ccgo_ts + 1663 + *(*uintptr)(unsafe.Pointer(bp + 4)) = __ccgo_ts + 1667 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -216742,7 +209380,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37599, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37739, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -216875,10 +209513,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219414,12 +211989,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38948, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39088, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39052, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39192, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39090, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39230, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219428,7 +212003,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39128, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39268, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219440,14 +212015,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25999, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11980, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38282, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26087, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12038, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38422, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36188, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36328, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35493, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35633, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219467,13 +212042,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30639 + v1 = __ccgo_ts + 30727 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39170, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39310, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39200, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39340, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -219514,7 +212089,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39244, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39384, 0) iOff = libc.Int32FromUint32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -219522,7 +212097,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39267, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39407, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -219537,7 +212112,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39273, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39413, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -219546,22 +212121,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35493, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35633, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39279 + zCols = __ccgo_ts + 39419 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39311 + zCols = __ccgo_ts + 39451 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36188, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36328, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38282, __ccgo_ts+39359, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38422, __ccgo_ts+39499, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -219606,14 +212181,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -219683,14 +212250,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(32) defer tls.Free(32) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+4 */ TFts5InsertCtx var _ /* nLoc at bp+28 */ int32 var _ /* nText at bp+20 */ int32 var _ /* pLoc at bp+24 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+16 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -219718,6 +212285,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 20)) = 0 *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) @@ -219730,11 +212298,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+16, bp+20, bp+24, bp+28) } else { - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 20)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 28)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 20)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 28)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -219747,6 +212328,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -219981,12 +212563,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39376, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39516, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39426, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39566, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39455, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39595, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -219994,7 +212576,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220296,7 +212878,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39484, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39624, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220329,17 +212911,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -220528,14 +213099,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 56)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35493, bp+56) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35633, bp+56) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 56)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -221567,14 +214112,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -221585,16 +214122,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -221740,64 +214267,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39586, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39589, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39594, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39734, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39599, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39602, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39605, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39610, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39615, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39625, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39630, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221806,49 +214333,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39638, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39641, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39781, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39645, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39649, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39653, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39657, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39661, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39801, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221865,20 +214392,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39665, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39645, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39805, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39668, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39671, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39811, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39675, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39661, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39815, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39801, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -221894,75 +214421,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39678, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39645, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39686, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39693, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39833, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39698, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39594, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39734, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39703, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39589, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39729, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39708, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39661, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39801, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39713, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16048, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16153, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39718, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39671, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39811, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39630, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39733, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39873, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39737, uint32(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39877, uint32(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39653, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39793, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -221971,48 +214498,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39885, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39661, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39801, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39753, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39645, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39899, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39645, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39764, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39904, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39910, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39657, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39797, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39786, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39926, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39790, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39653, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39793, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222020,21 +214547,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39804, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39944, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39657, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39797, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39810, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39671, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39811, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222052,48 +214579,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39957, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39602, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39742, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39822, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39827, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39967, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39973, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39786, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39926, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39839, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39845, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222109,13 +214636,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39851, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39991, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39855, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39995, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222123,7 +214650,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39861, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222220,14 +214747,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 20 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222245,13 +214772,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222288,14 +214808,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*4)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39865) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+40005) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39558) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39698) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222333,7 +214853,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222461,7 +214981,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(zOut)-t__predefined_ptrdiff_t(bp), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(zOut)-t__predefined_ptrdiff_t(bp), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -222537,11 +215057,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -222563,7 +215083,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39880)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40020)) } // C documentation @@ -222589,7 +215109,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39576, + FzName: __ccgo_ts + 39716, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -222597,7 +215117,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39888, + FzName: __ccgo_ts + 40028, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -222605,7 +215125,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39880, + FzName: __ccgo_ts + 40020, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -222635,7 +215155,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39894, pApi, bp+48, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40034, pApi, bp+48, uintptr(0)) } return rc } @@ -228096,39 +220616,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228151,16 +220638,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39901) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40041) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39905) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40045) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39909) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40049) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39918, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40058, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228223,21 +220710,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39952, - 1: __ccgo_ts + 39992, - 2: __ccgo_ts + 40027, + 0: __ccgo_ts + 40092, + 1: __ccgo_ts + 40132, + 2: __ccgo_ts + 40167, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+23975, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+24080, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40070, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40210, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228258,23 +220746,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*4)) } zType = v3 - nDb = libc.Int32FromUint32(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint32(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint32(libc.Xstrlen(tls, zDb) + uint32(1)) + nTab = libc.Int64FromUint32(libc.Xstrlen(tls, zTab) + uint32(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint32(uint32(36) + libc.Uint32FromInt32(nDb) + libc.Uint32FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = int64(36) + nDb + nTab + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*36 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint32FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint32FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint32FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint32FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228407,10 +220895,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40103, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40243, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40134, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40274, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+4, uintptr(0)) } @@ -228429,7 +220917,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40185, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40325, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -228755,7 +221243,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1663 + zCopy = __ccgo_ts + 1667 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -228879,7 +221367,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40211, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40351, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -228934,15 +221422,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40221 + return __ccgo_ts + 40361 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229163,7 +221651,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229211,11 +221699,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go index 473b462..0f3932a 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_amd64.go @@ -1,4 +1,4 @@ -// Code generated for linux/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/amd64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/amd64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && amd64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -1560,6 +1562,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1799,6 +1802,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -2009,6 +2013,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -2171,6 +2176,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2179,7 +2185,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2290,8 +2296,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3476,6 +3482,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3485,9 +3494,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3935,12 +3941,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -4069,30 +4069,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - /* ** CAPI3REF: Standard File Control Opcodes ** KEYWORDS: {file control opcodes} {file control opcode} @@ -4387,6 +4363,12 @@ type sqlite3_io_methods1 = Tsqlite3_io_methods1 ** the value that M is to be set to. Before returning, the 32-bit signed ** integer is overwritten with the previous value of M. ** +**
  • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** **
  • [[SQLITE_FCNTL_DATA_VERSION]] ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to ** a database file. The argument is a pointer to a 32-bit unsigned integer. @@ -4743,6 +4725,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4973,33 +4956,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -5078,19 +5034,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -5175,7 +5118,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -5267,223 +5209,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5565,20 +5290,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5628,13 +5339,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5693,9 +5397,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5703,17 +5407,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5740,12 +5444,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5762,7 +5466,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5780,7 +5484,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5814,24 +5518,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5855,22 +5541,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5931,7 +5601,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -6011,50 +5681,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6451,340 +6077,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6794,15 +6086,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6818,14 +6101,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6851,17 +6126,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6916,11 +6180,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -7294,55 +6564,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint64 type size_t = Tsize_t @@ -7489,6 +6715,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7547,6 +6778,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7656,14 +6898,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7748,7 +6982,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7850,7 +7084,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -7909,6 +7142,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -7920,9 +7154,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -7937,7 +7171,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7986,8 +7219,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -8051,7 +7284,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8123,19 +7355,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -8149,11 +7384,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -8164,40 +7396,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -8215,7 +7448,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8227,6 +7460,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8377,9 +7611,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -8396,10 +7630,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -8434,6 +7664,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8614,7 +7845,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8656,7 +7886,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8829,9 +8058,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8958,53 +8187,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -9108,16 +8290,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -9141,38 +8313,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -9185,34 +8330,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -9226,90 +8347,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -9328,187 +8365,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9518,913 +8374,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10449,611 +8398,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -11063,317 +8407,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11459,228 +8492,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -12763,7 +9574,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12841,72 +9651,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12952,164 +9700,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - /* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -13135,18 +9730,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -13163,100 +9746,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -13278,13 +9767,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -13304,14 +9786,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -13390,7 +9865,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13562,7 +10037,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13620,7 +10095,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13755,24 +10230,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13949,7 +10406,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -14020,10 +10477,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -14159,7 +10616,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -14256,7 +10713,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -14397,10 +10854,10 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = 0 _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1212, -int32(1)) @@ -14411,7 +10868,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -14489,7 +10946,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -14637,7 +11094,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14940,7 +11397,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -15097,7 +11554,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -15145,7 +11602,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -15250,7 +11707,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -15766,28 +12223,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15795,19 +12252,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15824,12 +12281,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15837,7 +12294,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15850,34 +12307,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15979,7 +12436,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -16190,14 +12647,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -16212,9 +12662,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -16628,7 +13078,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16957,27 +13411,6 @@ type t__ptcb = struct { F__next uintptr } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - -type cpu_set_t1 = Tcpu_set_t1 - -/* -** The sqlite3_mutex.id, sqlite3_mutex.nRef, and sqlite3_mutex.owner fields -** are necessary under two conditions: (1) Debug builds and (2) using -** home-grown mutexes. Encapsulate these conditions into a single #define. - */ - -/* -** Each recursive mutex is an instance of the following structure. - */ -type Tsqlite3_mutex1 = struct { - Fmutex Tpthread_mutex_t -} - -type sqlite3_mutex1 = Tsqlite3_mutex1 - /* ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are ** intended for use only inside assert() statements. On some platforms, @@ -17261,6 +13694,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -17268,8 +13703,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -18256,17 +14691,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -18463,22 +14898,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -18727,11 +15163,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18759,7 +15195,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18781,7 +15217,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -19208,29 +15644,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint32(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -19345,25 +15759,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1668 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1668 } else { - v98 = __ccgo_ts + 1673 + v97 = __ccgo_ts + 1673 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -19371,15 +15789,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -19390,13 +15808,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -19410,35 +15861,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1680, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if libc.Int32FromUint8(libc.Uint8FromInt8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -19463,9 +15977,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -19479,7 +15993,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1680, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -19489,21 +16003,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1682, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1692, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1713, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1739, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -19742,7 +16256,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -20041,6 +16555,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -20058,11 +16574,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -20496,56 +17012,10 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ - -/* #include */ - -/* A running thread */ -type TSQLiteThread1 = struct { - Ftid Tpthread_t - Fdone int32 - FpOut uintptr - FxTask uintptr - FpIn uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -20556,7 +17026,7 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui return int32(SQLITE_NOMEM) } libc.Xmemset(tls, p, 0, uint64(40)) - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a ** function that returns SQLITE_ERROR when passed the argument 200, that @@ -20565,11 +17035,11 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui if _sqlite3FaultSim(tls, int32(200)) != 0 { rc = int32(1) } else { - rc = libc.Xpthread_create(tls, p, uintptr(0), xTask, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) } if rc != 0 { (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) - (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -20714,6 +17184,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = libc.Int8FromUint8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -21464,7 +17965,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -21639,7 +18140,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1727, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1753, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21851,11 +18352,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -22091,7 +18592,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -22181,7 +18682,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1752 + pow63 = __ccgo_ts + 1778 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -22408,7 +18909,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1771)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22568,7 +19069,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1787 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -22677,7 +19178,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -23093,7 +19594,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1789, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1815, libc.VaList(bp+8, zType)) } // C documentation @@ -23122,7 +19623,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1834) + _logBadConnection(tls, __ccgo_ts+1860) } return 0 } else { @@ -23136,7 +19637,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1843) + _logBadConnection(tls, __ccgo_ts+1869) return 0 } else { return int32(1) @@ -23167,7 +19668,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -23518,23 +20019,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -23589,8 +20088,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -23623,9 +20122,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -23645,13 +20143,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -23659,7 +20156,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -23675,7 +20172,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -23687,7 +20184,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -23736,7 +20233,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -23746,20 +20243,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -23778,196 +20274,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1851, - 1: __ccgo_ts + 1861, - 2: __ccgo_ts + 1872, - 3: __ccgo_ts + 1884, - 4: __ccgo_ts + 1895, - 5: __ccgo_ts + 1907, - 6: __ccgo_ts + 1914, - 7: __ccgo_ts + 1922, - 8: __ccgo_ts + 1930, - 9: __ccgo_ts + 1935, - 10: __ccgo_ts + 1940, - 11: __ccgo_ts + 1946, - 12: __ccgo_ts + 1960, - 13: __ccgo_ts + 1966, - 14: __ccgo_ts + 1976, - 15: __ccgo_ts + 1981, - 16: __ccgo_ts + 1986, - 17: __ccgo_ts + 1989, - 18: __ccgo_ts + 1995, - 19: __ccgo_ts + 2002, - 20: __ccgo_ts + 2006, - 21: __ccgo_ts + 2016, - 22: __ccgo_ts + 2023, - 23: __ccgo_ts + 2030, - 24: __ccgo_ts + 2037, - 25: __ccgo_ts + 2044, - 26: __ccgo_ts + 2054, - 27: __ccgo_ts + 2063, - 28: __ccgo_ts + 2074, - 29: __ccgo_ts + 2083, - 30: __ccgo_ts + 2089, - 31: __ccgo_ts + 2099, - 32: __ccgo_ts + 2109, - 33: __ccgo_ts + 2114, - 34: __ccgo_ts + 2128, - 35: __ccgo_ts + 2139, - 36: __ccgo_ts + 2144, - 37: __ccgo_ts + 2151, - 38: __ccgo_ts + 2162, - 39: __ccgo_ts + 2167, - 40: __ccgo_ts + 2172, - 41: __ccgo_ts + 2178, - 42: __ccgo_ts + 2184, - 43: __ccgo_ts + 2190, - 44: __ccgo_ts + 2193, - 45: __ccgo_ts + 2197, - 46: __ccgo_ts + 2203, - 47: __ccgo_ts + 2214, - 48: __ccgo_ts + 2225, - 49: __ccgo_ts + 2233, - 50: __ccgo_ts + 2242, - 51: __ccgo_ts + 2248, - 52: __ccgo_ts + 2255, - 53: __ccgo_ts + 2263, - 54: __ccgo_ts + 2266, - 55: __ccgo_ts + 2269, - 56: __ccgo_ts + 2272, - 57: __ccgo_ts + 2275, - 58: __ccgo_ts + 2278, - 59: __ccgo_ts + 2281, - 60: __ccgo_ts + 2288, - 61: __ccgo_ts + 2298, - 62: __ccgo_ts + 2311, - 63: __ccgo_ts + 2322, - 64: __ccgo_ts + 2328, - 65: __ccgo_ts + 2335, - 66: __ccgo_ts + 2344, - 67: __ccgo_ts + 2353, - 68: __ccgo_ts + 2360, - 69: __ccgo_ts + 2373, - 70: __ccgo_ts + 2384, - 71: __ccgo_ts + 2389, - 72: __ccgo_ts + 2397, - 73: __ccgo_ts + 2403, - 74: __ccgo_ts + 2410, - 75: __ccgo_ts + 2422, - 76: __ccgo_ts + 2427, - 77: __ccgo_ts + 2436, - 78: __ccgo_ts + 2441, - 79: __ccgo_ts + 2450, - 80: __ccgo_ts + 2455, - 81: __ccgo_ts + 2460, - 82: __ccgo_ts + 2466, - 83: __ccgo_ts + 2474, - 84: __ccgo_ts + 2482, - 85: __ccgo_ts + 2492, - 86: __ccgo_ts + 2500, - 87: __ccgo_ts + 2507, - 88: __ccgo_ts + 2520, - 89: __ccgo_ts + 2525, - 90: __ccgo_ts + 2537, - 91: __ccgo_ts + 2545, - 92: __ccgo_ts + 2552, - 93: __ccgo_ts + 2563, - 94: __ccgo_ts + 2570, - 95: __ccgo_ts + 2577, - 96: __ccgo_ts + 2587, - 97: __ccgo_ts + 2596, - 98: __ccgo_ts + 2607, - 99: __ccgo_ts + 2613, - 100: __ccgo_ts + 2624, - 101: __ccgo_ts + 2634, - 102: __ccgo_ts + 2644, - 103: __ccgo_ts + 2653, - 104: __ccgo_ts + 2660, - 105: __ccgo_ts + 2666, - 106: __ccgo_ts + 2676, - 107: __ccgo_ts + 2687, - 108: __ccgo_ts + 2691, - 109: __ccgo_ts + 2700, - 110: __ccgo_ts + 2709, - 111: __ccgo_ts + 2716, - 112: __ccgo_ts + 2726, - 113: __ccgo_ts + 2733, - 114: __ccgo_ts + 2743, - 115: __ccgo_ts + 2751, - 116: __ccgo_ts + 2758, - 117: __ccgo_ts + 2772, - 118: __ccgo_ts + 2786, - 119: __ccgo_ts + 2794, - 120: __ccgo_ts + 2805, - 121: __ccgo_ts + 2818, - 122: __ccgo_ts + 2829, - 123: __ccgo_ts + 2835, - 124: __ccgo_ts + 2847, - 125: __ccgo_ts + 2856, - 126: __ccgo_ts + 2864, - 127: __ccgo_ts + 2873, - 128: __ccgo_ts + 2882, - 129: __ccgo_ts + 2889, - 130: __ccgo_ts + 2897, - 131: __ccgo_ts + 2904, - 132: __ccgo_ts + 2915, - 133: __ccgo_ts + 2929, - 134: __ccgo_ts + 2940, - 135: __ccgo_ts + 2948, - 136: __ccgo_ts + 2954, - 137: __ccgo_ts + 2962, - 138: __ccgo_ts + 2970, - 139: __ccgo_ts + 2980, - 140: __ccgo_ts + 2993, - 141: __ccgo_ts + 3003, - 142: __ccgo_ts + 3016, - 143: __ccgo_ts + 3025, - 144: __ccgo_ts + 3036, - 145: __ccgo_ts + 3044, - 146: __ccgo_ts + 3050, - 147: __ccgo_ts + 3062, - 148: __ccgo_ts + 3074, - 149: __ccgo_ts + 3082, - 150: __ccgo_ts + 3094, - 151: __ccgo_ts + 3107, - 152: __ccgo_ts + 3117, - 153: __ccgo_ts + 3127, - 154: __ccgo_ts + 3139, - 155: __ccgo_ts + 3144, - 156: __ccgo_ts + 3156, - 157: __ccgo_ts + 3166, - 158: __ccgo_ts + 3172, - 159: __ccgo_ts + 3182, - 160: __ccgo_ts + 3189, - 161: __ccgo_ts + 3201, - 162: __ccgo_ts + 3212, - 163: __ccgo_ts + 3220, - 164: __ccgo_ts + 3229, - 165: __ccgo_ts + 3238, - 166: __ccgo_ts + 3247, - 167: __ccgo_ts + 3254, - 168: __ccgo_ts + 3265, - 169: __ccgo_ts + 3278, - 170: __ccgo_ts + 3288, - 171: __ccgo_ts + 3295, - 172: __ccgo_ts + 3303, - 173: __ccgo_ts + 3312, - 174: __ccgo_ts + 3318, - 175: __ccgo_ts + 3325, - 176: __ccgo_ts + 3333, - 177: __ccgo_ts + 3341, - 178: __ccgo_ts + 3349, - 179: __ccgo_ts + 3359, - 180: __ccgo_ts + 3368, - 181: __ccgo_ts + 3379, - 182: __ccgo_ts + 3390, - 183: __ccgo_ts + 3401, - 184: __ccgo_ts + 3411, - 185: __ccgo_ts + 3417, - 186: __ccgo_ts + 3428, - 187: __ccgo_ts + 3439, - 188: __ccgo_ts + 3444, - 189: __ccgo_ts + 3452, + 0: __ccgo_ts + 1877, + 1: __ccgo_ts + 1887, + 2: __ccgo_ts + 1898, + 3: __ccgo_ts + 1910, + 4: __ccgo_ts + 1921, + 5: __ccgo_ts + 1933, + 6: __ccgo_ts + 1940, + 7: __ccgo_ts + 1948, + 8: __ccgo_ts + 1956, + 9: __ccgo_ts + 1961, + 10: __ccgo_ts + 1966, + 11: __ccgo_ts + 1972, + 12: __ccgo_ts + 1986, + 13: __ccgo_ts + 1992, + 14: __ccgo_ts + 2002, + 15: __ccgo_ts + 2007, + 16: __ccgo_ts + 2012, + 17: __ccgo_ts + 2015, + 18: __ccgo_ts + 2021, + 19: __ccgo_ts + 2028, + 20: __ccgo_ts + 2032, + 21: __ccgo_ts + 2042, + 22: __ccgo_ts + 2049, + 23: __ccgo_ts + 2056, + 24: __ccgo_ts + 2063, + 25: __ccgo_ts + 2070, + 26: __ccgo_ts + 2080, + 27: __ccgo_ts + 2089, + 28: __ccgo_ts + 2100, + 29: __ccgo_ts + 2109, + 30: __ccgo_ts + 2115, + 31: __ccgo_ts + 2125, + 32: __ccgo_ts + 2135, + 33: __ccgo_ts + 2140, + 34: __ccgo_ts + 2154, + 35: __ccgo_ts + 2165, + 36: __ccgo_ts + 2170, + 37: __ccgo_ts + 2177, + 38: __ccgo_ts + 2188, + 39: __ccgo_ts + 2193, + 40: __ccgo_ts + 2198, + 41: __ccgo_ts + 2204, + 42: __ccgo_ts + 2210, + 43: __ccgo_ts + 2216, + 44: __ccgo_ts + 2219, + 45: __ccgo_ts + 2223, + 46: __ccgo_ts + 2229, + 47: __ccgo_ts + 2240, + 48: __ccgo_ts + 2251, + 49: __ccgo_ts + 2259, + 50: __ccgo_ts + 2268, + 51: __ccgo_ts + 2274, + 52: __ccgo_ts + 2281, + 53: __ccgo_ts + 2289, + 54: __ccgo_ts + 2292, + 55: __ccgo_ts + 2295, + 56: __ccgo_ts + 2298, + 57: __ccgo_ts + 2301, + 58: __ccgo_ts + 2304, + 59: __ccgo_ts + 2307, + 60: __ccgo_ts + 2314, + 61: __ccgo_ts + 2324, + 62: __ccgo_ts + 2337, + 63: __ccgo_ts + 2348, + 64: __ccgo_ts + 2354, + 65: __ccgo_ts + 2361, + 66: __ccgo_ts + 2370, + 67: __ccgo_ts + 2379, + 68: __ccgo_ts + 2386, + 69: __ccgo_ts + 2399, + 70: __ccgo_ts + 2410, + 71: __ccgo_ts + 2415, + 72: __ccgo_ts + 2423, + 73: __ccgo_ts + 2429, + 74: __ccgo_ts + 2436, + 75: __ccgo_ts + 2448, + 76: __ccgo_ts + 2453, + 77: __ccgo_ts + 2462, + 78: __ccgo_ts + 2467, + 79: __ccgo_ts + 2476, + 80: __ccgo_ts + 2481, + 81: __ccgo_ts + 2486, + 82: __ccgo_ts + 2492, + 83: __ccgo_ts + 2500, + 84: __ccgo_ts + 2508, + 85: __ccgo_ts + 2518, + 86: __ccgo_ts + 2526, + 87: __ccgo_ts + 2533, + 88: __ccgo_ts + 2546, + 89: __ccgo_ts + 2551, + 90: __ccgo_ts + 2563, + 91: __ccgo_ts + 2571, + 92: __ccgo_ts + 2578, + 93: __ccgo_ts + 2589, + 94: __ccgo_ts + 2596, + 95: __ccgo_ts + 2603, + 96: __ccgo_ts + 2613, + 97: __ccgo_ts + 2622, + 98: __ccgo_ts + 2633, + 99: __ccgo_ts + 2639, + 100: __ccgo_ts + 2650, + 101: __ccgo_ts + 2660, + 102: __ccgo_ts + 2670, + 103: __ccgo_ts + 2679, + 104: __ccgo_ts + 2686, + 105: __ccgo_ts + 2692, + 106: __ccgo_ts + 2702, + 107: __ccgo_ts + 2713, + 108: __ccgo_ts + 2717, + 109: __ccgo_ts + 2726, + 110: __ccgo_ts + 2735, + 111: __ccgo_ts + 2742, + 112: __ccgo_ts + 2752, + 113: __ccgo_ts + 2759, + 114: __ccgo_ts + 2769, + 115: __ccgo_ts + 2777, + 116: __ccgo_ts + 2784, + 117: __ccgo_ts + 2798, + 118: __ccgo_ts + 2812, + 119: __ccgo_ts + 2820, + 120: __ccgo_ts + 2831, + 121: __ccgo_ts + 2844, + 122: __ccgo_ts + 2855, + 123: __ccgo_ts + 2861, + 124: __ccgo_ts + 2873, + 125: __ccgo_ts + 2882, + 126: __ccgo_ts + 2890, + 127: __ccgo_ts + 2899, + 128: __ccgo_ts + 2908, + 129: __ccgo_ts + 2915, + 130: __ccgo_ts + 2923, + 131: __ccgo_ts + 2930, + 132: __ccgo_ts + 2941, + 133: __ccgo_ts + 2955, + 134: __ccgo_ts + 2966, + 135: __ccgo_ts + 2974, + 136: __ccgo_ts + 2980, + 137: __ccgo_ts + 2988, + 138: __ccgo_ts + 2996, + 139: __ccgo_ts + 3006, + 140: __ccgo_ts + 3019, + 141: __ccgo_ts + 3029, + 142: __ccgo_ts + 3042, + 143: __ccgo_ts + 3051, + 144: __ccgo_ts + 3062, + 145: __ccgo_ts + 3070, + 146: __ccgo_ts + 3076, + 147: __ccgo_ts + 3088, + 148: __ccgo_ts + 3100, + 149: __ccgo_ts + 3108, + 150: __ccgo_ts + 3120, + 151: __ccgo_ts + 3133, + 152: __ccgo_ts + 3143, + 153: __ccgo_ts + 3153, + 154: __ccgo_ts + 3165, + 155: __ccgo_ts + 3170, + 156: __ccgo_ts + 3182, + 157: __ccgo_ts + 3192, + 158: __ccgo_ts + 3198, + 159: __ccgo_ts + 3208, + 160: __ccgo_ts + 3215, + 161: __ccgo_ts + 3227, + 162: __ccgo_ts + 3238, + 163: __ccgo_ts + 3246, + 164: __ccgo_ts + 3255, + 165: __ccgo_ts + 3264, + 166: __ccgo_ts + 3273, + 167: __ccgo_ts + 3280, + 168: __ccgo_ts + 3291, + 169: __ccgo_ts + 3304, + 170: __ccgo_ts + 3314, + 171: __ccgo_ts + 3321, + 172: __ccgo_ts + 3329, + 173: __ccgo_ts + 3338, + 174: __ccgo_ts + 3344, + 175: __ccgo_ts + 3351, + 176: __ccgo_ts + 3359, + 177: __ccgo_ts + 3367, + 178: __ccgo_ts + 3375, + 179: __ccgo_ts + 3385, + 180: __ccgo_ts + 3394, + 181: __ccgo_ts + 3405, + 182: __ccgo_ts + 3416, + 183: __ccgo_ts + 3427, + 184: __ccgo_ts + 3437, + 185: __ccgo_ts + 3443, + 186: __ccgo_ts + 3454, + 187: __ccgo_ts + 3465, + 188: __ccgo_ts + 3470, + 189: __ccgo_ts + 3478, } type Tregister_t = int64 @@ -24352,22 +20848,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -24398,30 +20878,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -24503,91 +20959,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3462, + FzName: __ccgo_ts + 3488, }, 1: { - FzName: __ccgo_ts + 3467, + FzName: __ccgo_ts + 3493, }, 2: { - FzName: __ccgo_ts + 3473, + FzName: __ccgo_ts + 3499, }, 3: { - FzName: __ccgo_ts + 3480, + FzName: __ccgo_ts + 3506, }, 4: { - FzName: __ccgo_ts + 3487, + FzName: __ccgo_ts + 3513, }, 5: { - FzName: __ccgo_ts + 3492, + FzName: __ccgo_ts + 3518, }, 6: { - FzName: __ccgo_ts + 3498, + FzName: __ccgo_ts + 3524, }, 7: { - FzName: __ccgo_ts + 3508, + FzName: __ccgo_ts + 3534, }, 8: { - FzName: __ccgo_ts + 3514, + FzName: __ccgo_ts + 3540, }, 9: { - FzName: __ccgo_ts + 3519, + FzName: __ccgo_ts + 3545, }, 10: { - FzName: __ccgo_ts + 3525, + FzName: __ccgo_ts + 3551, }, 11: { - FzName: __ccgo_ts + 3533, + FzName: __ccgo_ts + 3559, }, 12: { - FzName: __ccgo_ts + 3539, + FzName: __ccgo_ts + 3565, }, 13: { - FzName: __ccgo_ts + 3546, + FzName: __ccgo_ts + 3572, }, 14: { - FzName: __ccgo_ts + 3555, + FzName: __ccgo_ts + 3581, }, 15: { - FzName: __ccgo_ts + 3562, + FzName: __ccgo_ts + 3588, }, 16: { - FzName: __ccgo_ts + 3572, + FzName: __ccgo_ts + 3598, }, 17: { - FzName: __ccgo_ts + 3579, + FzName: __ccgo_ts + 3605, }, 18: { - FzName: __ccgo_ts + 3593, + FzName: __ccgo_ts + 3619, }, 19: { - FzName: __ccgo_ts + 3599, + FzName: __ccgo_ts + 3625, }, 20: { - FzName: __ccgo_ts + 3605, + FzName: __ccgo_ts + 3631, }, 21: { - FzName: __ccgo_ts + 3612, + FzName: __ccgo_ts + 3638, }, 22: { - FzName: __ccgo_ts + 3620, + FzName: __ccgo_ts + 3646, }, 23: { - FzName: __ccgo_ts + 3625, + FzName: __ccgo_ts + 3651, }, 24: { - FzName: __ccgo_ts + 3632, + FzName: __ccgo_ts + 3658, }, 25: { - FzName: __ccgo_ts + 3639, + FzName: __ccgo_ts + 3665, }, 26: { - FzName: __ccgo_ts + 3651, + FzName: __ccgo_ts + 3677, }, 27: { - FzName: __ccgo_ts + 3660, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3666, + FzName: __ccgo_ts + 3692, }, } @@ -24648,7 +21104,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24686,10 +21142,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24826,9 +21282,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3672, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3698, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3715, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3741, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -25064,47 +21520,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -25148,7 +21563,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1667 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3725, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3751, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -25176,7 +21591,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint64(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3809, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3836, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25835,7 +22250,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26440,7 +22855,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]int8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3864, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3890, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -26466,7 +22881,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3579, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3605, bp, int32(42579)) } // C documentation @@ -26503,7 +22918,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -27051,7 +23377,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27114,7 +23440,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -27347,7 +23673,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*int32)(unsafe.Pointer(bp + 144)) = 0 if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1667, int32(1), bp+144) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28115,10 +24440,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3921, - 3: __ccgo_ts + 3930, - 4: __ccgo_ts + 3939, - 5: __ccgo_ts + 1680, + 2: __ccgo_ts + 3947, + 3: __ccgo_ts + 3956, + 4: __ccgo_ts + 3965, + 5: __ccgo_ts + 1706, } // C documentation @@ -28127,8 +24452,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3944) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3958) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3970) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3984) } // C documentation @@ -28190,7 +24515,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = 0 - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3965, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3991, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -28362,7 +24687,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3982) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4008) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -28517,7 +24842,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3462, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3488, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -28594,7 +24919,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+144, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(4098)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3651, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3677, zIn, int32(45510)) return } (*(*[4098]int8)(unsafe.Pointer(bp + 144)))[got] = 0 @@ -28792,14 +25107,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if int32(*(*int8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3480, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3506, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*int8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = 0 if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -30604,7 +26759,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -30658,7 +26819,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -30702,7 +26863,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30777,7 +26938,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30831,7 +26992,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30865,66 +27026,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -31098,14 +27199,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31921,123 +28022,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -32118,7 +28102,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32212,7 +28196,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -32253,7 +28237,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -32381,7 +28365,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32401,17 +28385,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -32429,7 +28415,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -32441,7 +28427,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -32642,10 +28628,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -33231,25 +29218,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -34211,258 +30179,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -34561,7 +30277,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34790,7 +30506,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34808,7 +30524,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -35381,6 +31097,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -36027,7 +31752,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -36039,7 +31765,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -36060,11 +31786,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -36093,7 +31820,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -36326,7 +32053,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -36463,7 +32190,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -36479,7 +32206,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -37226,10 +32953,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -38130,7 +33857,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -38174,7 +33901,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -38205,7 +33932,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -38256,7 +33983,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -38291,7 +34018,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4147, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4173, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -38301,7 +34028,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4156, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4182, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -38343,8 +34070,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4161, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4168, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4187, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4194, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -38427,7 +34154,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38683,7 +34410,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38858,7 +34585,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38889,7 +34616,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38961,7 +34688,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -40021,7 +35748,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -40318,7 +36045,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -40586,7 +36313,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4178, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4204, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -41150,9 +36877,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -41167,227 +36894,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -41406,28 +36912,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -41486,7 +36971,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -41498,7 +36983,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -41587,6 +37072,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41854,14 +37340,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -42028,7 +37506,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -42116,12 +37594,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -42255,7 +37733,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42696,10 +38174,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42797,7 +38275,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42836,7 +38314,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42849,7 +38327,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42865,7 +38343,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42886,7 +38364,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42952,7 +38430,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -43002,7 +38480,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4233, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4259, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -43217,7 +38695,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -43243,7 +38728,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43966,8 +39451,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -44054,7 +39539,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -44200,7 +39685,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -44227,7 +39712,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -44236,6 +39721,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -44280,6 +39766,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -44551,7 +40040,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44732,7 +40221,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44741,7 +40230,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44793,14 +40282,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45346,283 +40835,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45755,27 +40967,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45938,10 +41129,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45950,14 +41142,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -46657,11 +41849,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46835,7 +42027,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46848,12 +42040,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46897,7 +42089,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46905,7 +42097,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -47093,7 +42285,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -47126,7 +42318,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -47325,7 +42517,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47365,12 +42557,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -47378,21 +42570,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -47439,12 +42631,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47460,7 +42652,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -47520,7 +42712,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47537,14 +42729,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -47587,11 +42779,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47605,7 +42797,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -47658,42 +42850,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47701,70 +42891,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47810,7 +43000,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47836,7 +43026,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47875,12 +43065,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47907,7 +43097,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47938,11 +43128,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47971,11 +43161,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47984,7 +43174,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -48006,15 +43196,13 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt8(int8(flags)) if flags&int32(PTF_LEAF) == 0 { @@ -48022,14 +43210,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -48137,7 +43325,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48199,7 +43387,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48287,7 +43475,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4259) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4285) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48911,7 +44099,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -49073,7 +44261,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4268, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4294, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -49111,7 +44299,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49552,7 +44740,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49576,7 +44764,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -49585,7 +44773,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49599,7 +44787,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49629,7 +44817,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49725,7 +44913,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49763,7 +44951,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49830,7 +45018,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49873,7 +45061,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49903,7 +45091,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50369,7 +45557,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50761,7 +45949,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50771,7 +45959,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50802,7 +45990,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50828,7 +46016,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50902,7 +46090,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -51037,7 +46225,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51049,7 +46237,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -51165,7 +46353,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -51179,7 +46367,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -51413,7 +46601,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -51497,7 +46685,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -51509,7 +46697,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51711,7 +46899,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51744,7 +46932,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51753,7 +46941,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51882,7 +47070,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51992,7 +47180,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52080,7 +47268,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52135,7 +47323,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52161,7 +47349,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52188,7 +47376,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52259,7 +47447,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52397,7 +47585,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52448,7 +47636,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52457,7 +47645,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52547,7 +47735,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52565,7 +47753,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52588,7 +47776,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52809,10 +47997,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -53103,17 +48291,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -53203,12 +48380,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -53216,7 +48393,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53311,7 +48488,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53392,7 +48569,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -53419,7 +48596,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -53459,7 +48636,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53530,7 +48707,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53575,7 +48752,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53771,10 +48948,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53897,8 +49075,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53938,7 +49116,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53961,7 +49139,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54092,7 +49270,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54135,7 +49313,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -54194,7 +49372,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -54226,7 +49404,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54456,7 +49634,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54702,7 +49880,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54775,7 +49953,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54934,7 +50112,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54965,7 +50143,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55050,7 +50228,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55142,7 +50320,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55178,7 +50356,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55208,10 +50386,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55329,12 +50507,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -55344,14 +50522,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55451,21 +50629,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55559,7 +50737,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -55669,7 +50847,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55710,7 +50888,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55791,14 +50969,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55935,7 +51113,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56200,7 +51378,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4272, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4298, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -56248,11 +51426,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4274, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4300, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4297, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4323, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -56278,11 +51456,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4427, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4453, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -56354,11 +51532,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4466 + v2 = __ccgo_ts + 4492 } else { - v2 = __ccgo_ts + 4471 + v2 = __ccgo_ts + 4497 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4492, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4518, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -56494,12 +51672,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4518 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4544 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4536, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4562, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4690, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4720, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -56584,7 +51762,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4744, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -56607,7 +51785,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4768, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4794, 0) depth = d2 } } else { @@ -56684,7 +51862,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4793, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4819, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56698,7 +51876,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4830, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4856, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56789,7 +51967,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4882 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4908 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56813,11 +51991,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4893, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4919, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4938, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56854,10 +52032,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4993, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5019, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5013, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56987,14 +52165,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -57205,45 +52383,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -57296,7 +52435,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3864, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -57306,7 +52445,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5045, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5071, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -57335,7 +52474,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5065, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -57365,7 +52504,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5096, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5122, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -58043,7 +53182,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5136, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+48, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -58181,9 +53320,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -58358,20 +53494,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -58386,10 +53522,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58848,7 +53984,7 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) @@ -58861,8 +53997,8 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -59021,7 +54157,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -59063,11 +54199,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -59077,7 +54213,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -59099,12 +54235,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -59143,7 +54279,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59255,8 +54391,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -59307,7 +54443,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -59315,8 +54452,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -59373,14 +54510,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -59394,7 +54531,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -59419,14 +54556,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3864, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -59526,7 +54663,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5143 + zNeg = __ccgo_ts + 5169 } } } @@ -59541,7 +54678,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5145, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5171, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59845,7 +54982,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59861,7 +54998,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59871,7 +55008,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59922,9 +55059,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59998,7 +55135,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -60332,12 +55469,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -60511,7 +55647,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -60528,7 +55664,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -60596,8 +55732,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -60610,11 +55746,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -60651,13 +55787,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60688,7 +55827,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -61190,7 +56329,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5150, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -61203,39 +56342,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1667 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5155) == 0 { - zColl = __ccgo_ts + 5162 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5181) == 0 { + zColl = __ccgo_ts + 5188 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5143 + v3 = __ccgo_ts + 5169 } else { v3 = __ccgo_ts + 1667 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5164 + v4 = __ccgo_ts + 5190 } else { v4 = __ccgo_ts + 1667 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5167, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5193, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5191, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5200, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5200, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5207, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5233, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61252,14 +56391,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1668 } else { - zP4 = __ccgo_ts + 5210 + zP4 = __ccgo_ts + 5236 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5243, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -61274,20 +56413,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5225, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5251, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5230, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5256, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5232 + zP4 = __ccgo_ts + 5258 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5240, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5266, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -61301,10 +56440,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5177, - 1: __ccgo_ts + 5179, - 2: __ccgo_ts + 5181, - 3: __ccgo_ts + 5186, + 0: __ccgo_ts + 5203, + 1: __ccgo_ts + 5205, + 2: __ccgo_ts + 5207, + 3: __ccgo_ts + 5212, } // C documentation @@ -62101,7 +57240,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -62120,7 +57259,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -62128,7 +57267,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -62255,7 +57394,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5256, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5282, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -62263,18 +57402,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5268, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5294, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5282, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5308, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5297, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5323, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -62505,7 +57644,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63893,7 +59032,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63928,7 +59067,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63982,7 +59121,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -64114,7 +59253,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64266,7 +59405,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -64297,7 +59436,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64448,15 +59587,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5340 + zContext = __ccgo_ts + 5366 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5359 + zContext = __ccgo_ts + 5385 } else { - zContext = __ccgo_ts + 5378 + zContext = __ccgo_ts + 5404 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5387, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5413, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -64551,10 +59690,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -64563,9 +59703,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -64645,7 +59785,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5423, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5449, 0) return int32(1) } else { return 0 @@ -64655,7 +59795,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5468, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5494, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64713,7 +59853,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65040,12 +60180,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -65062,29 +60202,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -65114,13 +60258,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -65132,11 +60278,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -65144,23 +60294,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -65216,7 +60372,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5508, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5534, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -65417,7 +60573,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65547,7 +60703,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65716,6 +60872,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65729,7 +60887,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65767,13 +60925,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -66007,18 +61165,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5531, - 1: __ccgo_ts + 5536, - 2: __ccgo_ts + 5543, - 3: __ccgo_ts + 5546, - 4: __ccgo_ts + 5549, - 5: __ccgo_ts + 5552, - 6: __ccgo_ts + 5555, - 7: __ccgo_ts + 5558, - 8: __ccgo_ts + 5566, - 9: __ccgo_ts + 5569, - 10: __ccgo_ts + 5576, - 11: __ccgo_ts + 5584, + 0: __ccgo_ts + 5557, + 1: __ccgo_ts + 5562, + 2: __ccgo_ts + 5569, + 3: __ccgo_ts + 5572, + 4: __ccgo_ts + 5575, + 5: __ccgo_ts + 5578, + 6: __ccgo_ts + 5581, + 7: __ccgo_ts + 5584, + 8: __ccgo_ts + 5592, + 9: __ccgo_ts + 5595, + 10: __ccgo_ts + 5602, + 11: __ccgo_ts + 5610, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -66273,14 +61431,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5591, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5617, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66318,7 +61476,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -66328,7 +61486,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -66339,24 +61497,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -66404,7 +61566,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -66412,32 +61576,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66854,11 +62024,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66867,7 +62037,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66881,7 +62051,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66916,7 +62086,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66951,7 +62121,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -67017,11 +62187,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -67044,7 +62214,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -67066,7 +62236,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -67193,7 +62363,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5631, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5657, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -67231,7 +62401,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1428, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5136, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5162, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -67246,28 +62416,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5635, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5661, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5642, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5668, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5655, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5681, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5658, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5684, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5663, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -67431,9 +62601,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -67459,12 +62629,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -67473,28 +62641,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67885,12 +63053,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67907,7 +63075,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -67925,7 +63093,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -68639,19 +63807,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5699, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5725, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5720, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5746, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5727, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5753, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69865,7 +65033,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69881,6 +65049,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -70374,7 +65548,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70477,7 +65651,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5751, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5775, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5865, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5889, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -71073,7 +66247,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5919, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5943, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -71103,12 +66277,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5974 + v250 = __ccgo_ts + 5998 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6022 + v251 = __ccgo_ts + 6046 } else { - v251 = __ccgo_ts + 6065 + v251 = __ccgo_ts + 6089 } v250 = v251 } @@ -71200,7 +66374,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6106) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6130) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -72284,7 +67458,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, int8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -72311,7 +67485,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72770,7 +67944,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -73203,7 +68377,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73533,7 +68707,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -73564,13 +68738,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6151 + zSchema = __ccgo_ts + 6175 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6165, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6189, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -73585,7 +68759,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73822,7 +68996,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6208, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6232, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73839,15 +69013,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73928,11 +69102,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -74144,7 +69318,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -74194,7 +69368,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -74250,7 +69424,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -74329,11 +69503,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6245 + v286 = __ccgo_ts + 6269 } else { - v286 = __ccgo_ts + 6250 + v286 = __ccgo_ts + 6274 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6257, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6281, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -74486,7 +69660,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6309, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -74648,7 +69822,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6338, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6362, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74728,12 +69902,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74744,7 +69918,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74838,7 +70012,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74866,11 +70040,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74998,7 +70172,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3864, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -75149,7 +70323,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6348, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -75236,15 +70410,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -75710,11 +70863,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3864 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75793,14 +70946,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75819,11 +70972,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75899,7 +71052,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75913,7 +71066,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3864 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -76180,108 +71333,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -76645,7 +71533,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76971,8 +71859,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76986,9 +71874,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -77136,8 +72024,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -77186,18 +72074,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -77331,7 +72220,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -77485,6 +72374,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78980,57 +73872,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -79327,7 +74168,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -80030,25 +74871,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6655, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6680, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6663+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6682+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6688+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6707+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6151+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6175+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6701+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6701+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } @@ -80087,23 +74928,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -80135,7 +74975,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6715, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6740, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -80229,7 +75069,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6720) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6745) != 0 { goto _2 } } @@ -80251,57 +75091,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -80346,11 +75173,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6722, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6747, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6726, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6751, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -80359,36 +75186,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6730, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6755, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -80417,18 +75233,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -80475,15 +75291,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6739, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6764, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6770, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6795, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6807, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80494,8 +75310,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80535,7 +75351,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6825, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6850, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -80555,7 +75371,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -80564,7 +75380,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6860 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6885 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80574,26 +75390,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6869 + v8 = __ccgo_ts + 6894 } else { - v10 = __ccgo_ts + 6884 + v8 = __ccgo_ts + 6909 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6906, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6931, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6919, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6929, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6990, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -80642,8 +75458,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80717,19 +75533,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6997 + zIn = __ccgo_ts + 7022 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7025 + zIn = __ccgo_ts + 7050 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7043 + zIn = __ccgo_ts + 7068 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7061 + zIn = __ccgo_ts + 7086 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7079, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7104, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80755,7 +75571,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80901,7 +75717,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7099, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7124, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80956,7 +75772,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7116, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80980,7 +75796,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7180, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7205, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80994,13 +75810,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -81020,16 +75836,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7216, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7241, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -81040,35 +75853,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7244, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7269, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7287 + zType = __ccgo_ts + 7312 } else { - zType = __ccgo_ts + 7294 + zType = __ccgo_ts + 7319 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7304, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7329, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7332, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7354, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7379, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7398, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -81153,7 +75969,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7446, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7471, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -81165,7 +75981,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7457, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7482, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -81211,7 +76027,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6807, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -81336,7 +76152,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7468, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7493, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -81371,7 +76187,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7524, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -81409,7 +76225,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7558, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7583, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -81479,7 +76295,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7564, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7589, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -81513,7 +76329,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7625, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7650, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81826,7 +76642,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7656, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7681, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81893,7 +76709,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7558) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81904,7 +76720,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7695) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7720) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81914,7 +76730,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7701, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7726, 0) return int32(WRC_Abort) } goto _6 @@ -82136,33 +76952,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -82214,7 +77032,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -82422,7 +77240,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82897,7 +77715,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6807, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82976,7 +77794,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7760, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -83163,7 +77981,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -83321,11 +78139,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7808 + v2 = __ccgo_ts + 7833 } else { v2 = __ccgo_ts + 1667 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7810, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7835, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -83371,10 +78189,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1787) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -83402,7 +78220,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7854, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7879, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -83422,7 +78240,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7888, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7913, libc.VaList(bp+8, p)) } // C documentation @@ -83493,7 +78311,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7938, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+8, pExpr)) } } } @@ -83545,7 +78363,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7958, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7983, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -83578,7 +78396,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8001, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83814,12 +78632,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83961,7 +78773,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -84101,7 +78913,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -84122,27 +78933,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -84188,9 +78992,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -84200,8 +79004,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -84215,7 +79019,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -84266,7 +79070,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -84347,7 +79151,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -84365,7 +79169,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -84446,7 +79250,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8024, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -84575,7 +79379,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8054, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84673,10 +79477,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8077) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8102) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8082) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8107) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -85354,13 +80158,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8088) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8113) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8096) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8121) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8102) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8127) == 0 { return int32(1) } return 0 @@ -85375,32 +80179,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8088, - 1: __ccgo_ts + 8096, - 2: __ccgo_ts + 8102, + 0: __ccgo_ts + 8113, + 1: __ccgo_ts + 8121, + 2: __ccgo_ts + 8127, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -85609,7 +80400,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -85662,7 +80453,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8106, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8131, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85762,12 +80553,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1787) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -86359,7 +81151,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8321) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8346) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -86455,14 +81247,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -86490,9 +81282,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -86625,7 +81417,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86755,13 +81547,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -87541,7 +82338,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8414, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -87553,7 +82350,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -87568,7 +82365,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8441, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8466, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -87597,7 +82394,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87673,7 +82470,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8024, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87736,7 +82533,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6807, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87746,7 +82543,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87754,7 +82551,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87767,9 +82564,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87851,7 +82648,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8465, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8490, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87922,17 +82719,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87941,7 +82738,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87953,6 +82750,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87972,7 +82790,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -88042,7 +82860,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -88086,7 +82904,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -88159,7 +82977,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -88186,8 +83004,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -88353,7 +83171,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88562,7 +83382,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -89269,7 +84091,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -89498,10 +84320,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -89539,7 +84361,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89553,7 +84375,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89567,10 +84389,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -89580,25 +84405,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -89611,7 +84440,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -89621,11 +84450,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -89645,13 +84474,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89721,7 +84550,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89757,6 +84586,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89774,44 +84604,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89891,7 +84726,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89899,7 +84734,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -89917,7 +84752,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -89936,11 +84771,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -90058,8 +84893,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6655, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8515, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8569, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90077,10 +84912,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8543, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8718, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8772, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90096,9 +84931,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8892, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8946, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9039, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9093, 0) } } @@ -90154,7 +84989,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9190, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9244, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90163,11 +84998,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9249, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9303, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9255, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9309, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90197,21 +85032,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9282, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9336, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9466, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9520, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9771, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9787, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9825, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9845, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9899, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -90219,7 +85054,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -90227,7 +85062,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10110, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10164, 0) goto exit_rename_table exit_rename_table: ; @@ -90244,7 +85079,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10123, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10177, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90284,11 +85119,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10161, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10215, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10193, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10247, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90304,10 +85139,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10220) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10274) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10279) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10333) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90319,13 +85154,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10332) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10386) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10378) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10432) } } /* Modify the CREATE TABLE statement. */ @@ -90339,7 +85174,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10405, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10459, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90367,7 +85202,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10551, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10605, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90405,12 +85240,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10904, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10958, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10938, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10992, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90425,7 +85260,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -90433,8 +85268,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10968, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11022, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -90495,18 +85330,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10987 + zType = __ccgo_ts + 11041 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11046 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11006 + v1 = __ccgo_ts + 11060 } else { - v1 = __ccgo_ts + 11023 + v1 = __ccgo_ts + 11077 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11041, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11095, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90553,21 +85388,9 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11059, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90583,11 +85406,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11080, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11262, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11134, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11316, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10110, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10164, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90597,31 +85420,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -90638,16 +85436,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90950,9 +85738,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -91063,11 +85851,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11393 + v1 = __ccgo_ts + 11447 } else { v1 = __ccgo_ts + 1667 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11395, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11449, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -91138,30 +85926,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11418, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11472, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91182,9 +85974,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -91200,15 +85991,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11426, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11480, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -91219,16 +86010,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -91245,21 +86036,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11393 + v1 = __ccgo_ts + 11447 } else { v1 = __ccgo_ts + 1667 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11432, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11486, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -91285,7 +86076,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -91595,7 +86386,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91862,7 +86653,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -92045,7 +86836,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -92129,8 +86920,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -92146,12 +86938,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -92225,7 +87017,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92242,7 +87034,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11437, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11491, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -92297,23 +87089,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11059, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11444 + v1 = __ccgo_ts + 11498 } else { - v1 = __ccgo_ts + 5674 + v1 = __ccgo_ts + 5700 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11456, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11510, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11484, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92325,31 +87117,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11532, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11586, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11653, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11707, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -92363,7 +87155,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -92374,8 +87166,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -92436,27 +87228,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11671, + FzName: __ccgo_ts + 11725, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11692, + FzName: __ccgo_ts + 11746, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11712, + FzName: __ccgo_ts + 11766, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11731, + FzName: __ccgo_ts + 11785, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11750, + FzName: __ccgo_ts + 11804, }, } @@ -92667,8 +87459,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11853, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11907, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92678,10 +87475,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11876, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11906, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11960, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92713,15 +87510,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11773, - FzCols: __ccgo_ts + 11786, + FzName: __ccgo_ts + 11827, + FzCols: __ccgo_ts + 11840, }, 1: { - FzName: __ccgo_ts + 11799, - FzCols: __ccgo_ts + 11812, + FzName: __ccgo_ts + 11853, + FzCols: __ccgo_ts + 11866, }, 2: { - FzName: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11894, }, } @@ -92774,44 +87571,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92935,7 +87694,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92951,12 +87711,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92964,7 +87724,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -93023,7 +87783,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11924, + FzName: __ccgo_ts + 11978, } func init() { @@ -93397,7 +88157,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11934, + FzName: __ccgo_ts + 11988, } func init() { @@ -93447,7 +88207,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11944, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11998, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93458,7 +88218,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11949, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12003, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93497,7 +88257,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11955, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12009, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93515,7 +88275,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11961, + FzName: __ccgo_ts + 12015, } func init() { @@ -93581,7 +88341,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11970, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12024, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93590,12 +88350,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11773, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11827, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93717,7 +88477,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93797,7 +88557,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93828,7 +88588,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11980, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93919,7 +88679,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11980, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93956,7 +88716,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93989,11 +88749,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11984) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12038) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11988) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12042) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94101,13 +88861,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -94157,17 +88910,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11992, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12046, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12003, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12057, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12013, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12067, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94179,13 +88932,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -94236,7 +88982,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -94439,8 +89185,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -94546,11 +89292,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11799, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11853, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12025, __ccgo_ts+12094, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12079, __ccgo_ts+12148, zDb) } return rc } @@ -94616,10 +89362,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11773, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12146, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12200, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94732,7 +89478,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6715, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6740, zName) == 0) } // C documentation @@ -94784,11 +89530,11 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4036) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4062) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12187, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12241, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94819,7 +89565,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12190, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12244, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94828,7 +89574,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12227, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12281, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94840,13 +89586,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94884,7 +89630,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12257, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94892,7 +89638,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12286, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12340, 0) rc = int32(SQLITE_ERROR) } } @@ -94939,7 +89685,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1637, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12354, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12408, libc.VaList(bp+56, zFile)) } } } @@ -95001,15 +89747,15 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { i++ } if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12382, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12436, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12403, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12429, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12483, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95104,7 +89850,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12451, + FzName: __ccgo_ts + 12505, } func init() { @@ -95126,7 +89872,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12465, + FzName: __ccgo_ts + 12519, } func init() { @@ -95152,7 +89898,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12479, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12533, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95186,7 +89932,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12503, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12557, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -95313,6 +90059,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -95385,9 +90133,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -95403,7 +90151,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12549, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12603, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95431,11 +90179,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12572, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12626, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12578, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12632, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12584, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12638, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95495,7 +90243,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8096 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95530,7 +90278,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12611, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12665, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95567,47 +90315,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -95648,7 +90355,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95746,7 +90453,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95824,7 +90533,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95838,7 +90547,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95951,21 +90662,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6715) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6740) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6655, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6682+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6701+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6151+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6663) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6701+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6151) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95995,12 +90706,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6655, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6701+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6151) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6175) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6682+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6663) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } } @@ -96038,7 +90749,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12626, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12680, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96048,7 +90759,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -96056,15 +90767,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12634 + v1 = __ccgo_ts + 12688 } else { - v1 = __ccgo_ts + 12647 + v1 = __ccgo_ts + 12701 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6919, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6990, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -96102,12 +90813,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6655, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6151+7) == 0 { - return __ccgo_ts + 6701 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + return __ccgo_ts + 6726 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6663+7) == 0 { - return __ccgo_ts + 6682 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6688+7) == 0 { + return __ccgo_ts + 6707 } } return zName @@ -96231,9 +90942,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -96632,7 +91343,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6151) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6175) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96664,7 +91375,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6715, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6740, zName) { break } goto _1 @@ -96722,13 +91433,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12661, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12678, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96776,8 +91487,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6655, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12698, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12752, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96813,23 +91524,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96949,7 +91662,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96992,9 +91705,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6663 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6151 + v1 = __ccgo_ts + 6175 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -97007,7 +91720,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12740, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12794, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97023,9 +91736,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10987 + v2 = __ccgo_ts + 11041 } else { - v2 = __ccgo_ts + 9249 + v2 = __ccgo_ts + 9303 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97035,9 +91748,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6663 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6151 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -97061,11 +91774,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10987 + v4 = __ccgo_ts + 11041 } else { - v4 = __ccgo_ts + 9249 + v4 = __ccgo_ts + 9303 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12781, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97073,11 +91786,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12802, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12856, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -97109,19 +91822,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -97141,15 +91864,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -97164,7 +91892,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -97225,7 +91953,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12837, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97234,14 +91962,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12871, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12925, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -97273,11 +92003,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -97288,7 +92018,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97298,12 +92028,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12914, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12968, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12921, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12975, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -97345,21 +92075,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12931, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -97370,7 +92089,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -97383,12 +92102,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -97560,10 +92288,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12957, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13011, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13056, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97621,7 +92349,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13043, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13097, 0) } } @@ -97649,8 +92377,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -97658,7 +92386,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13095, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13149, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97677,21 +92405,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97714,7 +92431,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13136, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97742,8 +92459,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97830,17 +92552,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13192, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13235, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13289, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13243, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13297, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97872,7 +92594,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13250, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13304, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98013,9 +92735,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -98026,31 +92749,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { zSep = __ccgo_ts + 1667 - zSep2 = __ccgo_ts + 13281 - zEnd = __ccgo_ts + 5175 + zSep2 = __ccgo_ts + 13335 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13283 - zSep2 = __ccgo_ts + 13287 - zEnd = __ccgo_ts + 13292 + zSep = __ccgo_ts + 13337 + zSep2 = __ccgo_ts + 13341 + zEnd = __ccgo_ts + 13346 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13295, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13349, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -98061,8 +92784,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -98075,17 +92799,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3864, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ 0: __ccgo_ts + 1667, - 1: __ccgo_ts + 13309, - 2: __ccgo_ts + 13315, - 3: __ccgo_ts + 13320, - 4: __ccgo_ts + 13325, - 5: __ccgo_ts + 13315, + 1: __ccgo_ts + 13363, + 2: __ccgo_ts + 13369, + 3: __ccgo_ts + 13374, + 4: __ccgo_ts + 13379, + 5: __ccgo_ts + 13369, } // C documentation @@ -98094,15 +92819,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -98117,7 +92843,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -98350,8 +93076,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -98451,7 +93187,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -98464,8 +93200,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -98495,7 +93231,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98714,9 +93450,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13331, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13385, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13364, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13418, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98737,11 +93473,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13391, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13445, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13441, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13495, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98788,7 +93524,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13473, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13527, 0) return } } @@ -98822,16 +93558,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9249 - zType2 = __ccgo_ts + 13517 + zType = __ccgo_ts + 9303 + zType2 = __ccgo_ts + 13571 } else { /* A view */ - zType = __ccgo_ts + 10987 - zType2 = __ccgo_ts + 13523 + zType = __ccgo_ts + 11041 + zType2 = __ccgo_ts + 13577 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98848,24 +93584,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98913,13 +93654,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13528, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13543, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13597, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98928,15 +93679,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13641, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13695, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13683, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13737, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13717, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13771, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98954,7 +93705,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9771) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9825) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98987,7 +93738,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13738, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13792, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -99004,7 +93755,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10987, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11041, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99101,7 +93852,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13774, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13828, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -99285,7 +94036,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13804, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13858, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99298,7 +94049,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13819, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13873, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -99381,9 +94132,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13886, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13940, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11876, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99424,7 +94175,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13900, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -99433,7 +94184,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13945, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13999, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -99468,11 +94219,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6655, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3487, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3513, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7457, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7482, int32(10)) == 0 { return 0 } return int32(1) @@ -99527,9 +94278,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6663 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6151 + v1 = __ccgo_ts + 6175 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -99562,18 +94313,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14012, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14066, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14040, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14074, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14128, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99583,7 +94334,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11988, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12042, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99631,19 +94382,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14106, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14160, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14169, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -99700,7 +94451,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14263, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14317, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99815,11 +94566,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99841,7 +94592,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99886,13 +94637,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99915,23 +94666,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99960,11 +94711,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14309 + v2 = __ccgo_ts + 14363 } else { - v2 = __ccgo_ts + 14315 + v2 = __ccgo_ts + 14369 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14320, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14374, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100042,7 +94793,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14348, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14402, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100052,7 +94803,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14354, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14408, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -100066,16 +94817,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6655, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14404, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14458, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14432, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14457, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14511, 0) goto exit_create_index } /* @@ -100096,19 +94847,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14348, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14402, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14491, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14545, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14525, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14579, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100129,7 +94880,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14549, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14603, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100147,9 +94898,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6663 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6151 + v2 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -100177,7 +94928,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14348) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14402) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100209,7 +94960,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -100261,7 +95012,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14572, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14626, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100271,7 +95022,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -100281,8 +95032,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -100360,7 +95111,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -100408,7 +95159,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14633, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14687, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -100438,8 +95189,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14675, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14729, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -100452,7 +95203,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -100481,9 +95232,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1667 } else { - v13 = __ccgo_ts + 14692 + v13 = __ccgo_ts + 14746 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14700, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14754, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -100491,7 +95242,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14720, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14774, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -100499,7 +95250,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14779, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -100662,16 +95413,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14806, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14860, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14824, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14878, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100679,9 +95430,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6663 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6151 + v1 = __ccgo_ts + 6175 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100697,8 +95448,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14897, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14951, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12038, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100771,12 +95522,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100888,13 +95639,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14957, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -100975,7 +95726,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -101025,7 +95776,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -101196,11 +95947,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14993 + v1 = __ccgo_ts + 15047 } else { - v1 = __ccgo_ts + 14996 + v1 = __ccgo_ts + 15050 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15002, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15056, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101399,7 +96150,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15038, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15092, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101446,9 +96197,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15044 + v1 = __ccgo_ts + 15098 } else { - v1 = __ccgo_ts + 15053 + v1 = __ccgo_ts + 15107 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101480,9 +96231,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15038, - 1: __ccgo_ts + 15060, - 2: __ccgo_ts + 15044, + 0: __ccgo_ts + 15092, + 1: __ccgo_ts + 15114, + 2: __ccgo_ts + 15098, } // C documentation @@ -101502,7 +96253,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15068, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15122, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101527,7 +96278,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12572, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101958,7 +96709,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15268, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102840,11 +97589,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15301, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15330, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102948,7 +97697,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -103005,7 +97754,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15404, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15458, -int32(1)) return } if argc == int32(3) { @@ -104724,7 +99478,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15437, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15491, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104806,7 +99560,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104878,28 +99632,28 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15482, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15536, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15490, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15544, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -104931,13 +99685,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15498, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15552 + } else { + v2 = __ccgo_ts + 15556 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1668, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15559, -int32(1)) + return +} + // C documentation // // /* @@ -104949,6 +99839,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104959,7 +99853,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -105394,7 +100288,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -105483,7 +100377,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11393, + 0: __ccgo_ts + 11447, } // C documentation @@ -105495,8 +100389,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -105511,7 +100405,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -105523,16 +100417,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -105643,7 +100537,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15501, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15582, int32(4), libc.UintptrFromInt32(0)) } } @@ -105704,7 +100598,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12611, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12665, -int32(1)) return } if argc == int32(2) { @@ -105735,17 +100629,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105814,7 +100697,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105896,7 +100779,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15381, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105959,12 +100842,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -106128,7 +101005,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -106139,7 +101016,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -106246,7 +101123,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15506, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15587, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106275,8 +101152,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15512, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15512, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15593, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15593, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -106456,11 +101333,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -106564,7 +101441,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -106577,542 +101454,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15517, + FzName: __ccgo_ts + 15598, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15537, + FzName: __ccgo_ts + 15618, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15550, + FzName: __ccgo_ts + 15631, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15568, + FzName: __ccgo_ts + 15649, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15577, + FzName: __ccgo_ts + 15658, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15585, + FzName: __ccgo_ts + 15666, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15585, + FzName: __ccgo_ts + 15666, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15600, + FzName: __ccgo_ts + 15681, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15626, + FzName: __ccgo_ts + 15707, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15651, + FzName: __ccgo_ts + 15732, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15660, + FzName: __ccgo_ts + 15741, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15671, + FzName: __ccgo_ts + 15752, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15678, + FzName: __ccgo_ts + 15759, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15692, + FzName: __ccgo_ts + 15773, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15692, + FzName: __ccgo_ts + 15773, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15698, + FzName: __ccgo_ts + 15779, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15698, + FzName: __ccgo_ts + 15779, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15704, + FzName: __ccgo_ts + 15785, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15704, + FzName: __ccgo_ts + 15785, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15790, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15790, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15713, + FzName: __ccgo_ts + 15794, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15713, + FzName: __ccgo_ts + 15794, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15717, + FzName: __ccgo_ts + 15798, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15724, + FzName: __ccgo_ts + 15805, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15732, + FzName: __ccgo_ts + 15813, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15739, + FzName: __ccgo_ts + 15820, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15752, + FzName: __ccgo_ts + 15833, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15758, + FzName: __ccgo_ts + 15839, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15765, + FzName: __ccgo_ts + 15846, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15772, + FzName: __ccgo_ts + 15853, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15780, + FzName: __ccgo_ts + 15861, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15866, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15789, + FzName: __ccgo_ts + 15870, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15789, + FzName: __ccgo_ts + 15870, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15795, + FzName: __ccgo_ts + 15876, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15801, + FzName: __ccgo_ts + 15882, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15888, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15811, + FzName: __ccgo_ts + 15892, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15811, + FzName: __ccgo_ts + 15892, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15817, + FzName: __ccgo_ts + 15898, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15824, + FzName: __ccgo_ts + 15905, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15834, + FzName: __ccgo_ts + 15915, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15841, + FzName: __ccgo_ts + 15922, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15848, + FzName: __ccgo_ts + 15929, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15859, + FzName: __ccgo_ts + 15940, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15866, + FzName: __ccgo_ts + 15947, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15881, + FzName: __ccgo_ts + 15962, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15898, + FzName: __ccgo_ts + 15979, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15909, + FzName: __ccgo_ts + 15990, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15915, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15997, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15933, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16003, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15941, + FzName: __ccgo_ts + 16016, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15955, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16034, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15963, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16042, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15972, + FzName: __ccgo_ts + 16056, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15972, + FzName: __ccgo_ts + 16064, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15979, + FzName: __ccgo_ts + 16073, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15979, + FzName: __ccgo_ts + 16073, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15989, + FzName: __ccgo_ts + 16090, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15993, + FzName: __ccgo_ts + 16094, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16100, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16003, + FzName: __ccgo_ts + 16104, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16003, + FzName: __ccgo_ts + 16104, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16009, + FzName: __ccgo_ts + 16110, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16009, + FzName: __ccgo_ts + 16110, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16022, + FzName: __ccgo_ts + 16123, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16033, + FzName: __ccgo_ts + 16134, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15512, + FzName: __ccgo_ts + 15593, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15512, + FzName: __ccgo_ts + 15593, }, - 70: { + 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16038, + FzName: __ccgo_ts + 16139, }, - 71: { + 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1240, }, - 72: { + 74: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1248, }, - 73: { + 75: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16043, + FzName: __ccgo_ts + 16144, }, - 74: { + 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16049, + FzName: __ccgo_ts + 16150, }, - 75: { + 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 16153, }, - 76: { + 78: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16056, + FzName: __ccgo_ts + 16157, }, - 77: { + 79: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16062, - }, - 78: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16052, - }, - 79: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16067, + FzName: __ccgo_ts + 16163, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16071, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16153, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16075, + FzName: __ccgo_ts + 16168, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16081, + FzName: __ccgo_ts + 16172, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16085, + FzName: __ccgo_ts + 16176, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, + FzName: __ccgo_ts + 16182, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16095, + FzName: __ccgo_ts + 16186, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, + FzName: __ccgo_ts + 16191, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16106, + FzName: __ccgo_ts + 16196, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, + FzName: __ccgo_ts + 16201, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16114, + FzName: __ccgo_ts + 16207, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16118, + FzName: __ccgo_ts + 16211, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16123, + FzName: __ccgo_ts + 16215, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16128, + FzName: __ccgo_ts + 16219, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16133, + FzName: __ccgo_ts + 16224, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16139, + FzName: __ccgo_ts + 16229, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16145, + FzName: __ccgo_ts + 16234, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16151, + FzName: __ccgo_ts + 16240, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16156, + FzName: __ccgo_ts + 16246, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16164, + FzName: __ccgo_ts + 16252, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16172, + FzName: __ccgo_ts + 16257, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16175, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16265, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16273, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16276, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6860, + FzName: __ccgo_ts + 6885, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16180, + FzName: __ccgo_ts + 16281, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16184, + FzName: __ccgo_ts + 16285, }, } @@ -107171,109 +102059,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -107497,7 +102387,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -107590,7 +102480,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16187, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16288, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -108414,7 +103304,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108701,11 +103591,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6726, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6722, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108769,7 +103659,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5310) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5336) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -108785,7 +103675,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -109233,7 +104123,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -109351,7 +104241,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8353, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8378, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -109417,11 +104307,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109746,7 +104636,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109760,7 +104650,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109795,7 +104685,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109808,7 +104698,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109935,27 +104825,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -110036,7 +104926,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -110063,7 +104953,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -110072,44 +104962,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16232, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16333, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16273, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16374, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -110131,31 +105005,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16305, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16406, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -110179,10 +105053,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -110223,8 +105097,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -110241,34 +105115,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16313, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16414, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16365, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16466, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -110375,18 +105249,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -110396,13 +105270,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -110413,14 +105287,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -110437,16 +105311,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -110557,11 +105431,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -110620,7 +105494,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16457) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16558) } goto insert_cleanup insert_cleanup: @@ -110743,33 +105617,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -111016,7 +105863,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12572, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -113250,7 +107777,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16506, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16607, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113270,19 +107797,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16510, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16611, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16516, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16617, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113297,14 +107824,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16559, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16660, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -113328,7 +107855,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16591, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16692, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113337,7 +107864,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16471, + 0: __ccgo_ts + 16572, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113406,14 +107933,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -113428,7 +107950,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -113446,7 +107968,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -113461,7 +107983,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -113471,6 +107993,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -113482,7 +108006,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -113494,7 +108018,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -113570,7 +108094,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16628, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16729, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113624,63 +108148,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5566, - 1: __ccgo_ts + 16667, - 2: __ccgo_ts + 9249, - 3: __ccgo_ts + 16671, - 4: __ccgo_ts + 16676, - 5: __ccgo_ts + 16679, - 6: __ccgo_ts + 16689, - 7: __ccgo_ts + 16699, - 8: __ccgo_ts + 16705, - 9: __ccgo_ts + 16709, - 10: __ccgo_ts + 16714, - 11: __ccgo_ts + 16719, - 12: __ccgo_ts + 16727, - 13: __ccgo_ts + 16738, - 14: __ccgo_ts + 16741, - 15: __ccgo_ts + 16748, - 16: __ccgo_ts + 16709, - 17: __ccgo_ts + 16714, - 18: __ccgo_ts + 16755, - 19: __ccgo_ts + 16760, - 20: __ccgo_ts + 16763, - 21: __ccgo_ts + 16770, - 22: __ccgo_ts + 16705, - 23: __ccgo_ts + 16709, - 24: __ccgo_ts + 16776, - 25: __ccgo_ts + 16781, - 26: __ccgo_ts + 16786, - 27: __ccgo_ts + 16709, - 28: __ccgo_ts + 16790, - 29: __ccgo_ts + 16714, - 30: __ccgo_ts + 16798, - 31: __ccgo_ts + 16802, - 32: __ccgo_ts + 16807, - 33: __ccgo_ts + 11988, - 34: __ccgo_ts + 11984, - 35: __ccgo_ts + 16813, - 36: __ccgo_ts + 16818, - 37: __ccgo_ts + 16823, - 38: __ccgo_ts + 16667, - 39: __ccgo_ts + 16709, - 40: __ccgo_ts + 16828, - 41: __ccgo_ts + 16835, - 42: __ccgo_ts + 16842, - 43: __ccgo_ts + 9249, - 44: __ccgo_ts + 16850, - 45: __ccgo_ts + 5569, - 46: __ccgo_ts + 16856, - 47: __ccgo_ts + 16667, - 48: __ccgo_ts + 16709, - 49: __ccgo_ts + 16861, - 50: __ccgo_ts + 16866, - 51: __ccgo_ts + 16052, - 52: __ccgo_ts + 16871, - 53: __ccgo_ts + 16884, - 54: __ccgo_ts + 16893, - 55: __ccgo_ts + 16900, - 56: __ccgo_ts + 16911, + 0: __ccgo_ts + 5592, + 1: __ccgo_ts + 16768, + 2: __ccgo_ts + 9303, + 3: __ccgo_ts + 16772, + 4: __ccgo_ts + 16777, + 5: __ccgo_ts + 16780, + 6: __ccgo_ts + 16790, + 7: __ccgo_ts + 16800, + 8: __ccgo_ts + 16806, + 9: __ccgo_ts + 16810, + 10: __ccgo_ts + 16815, + 11: __ccgo_ts + 16820, + 12: __ccgo_ts + 16828, + 13: __ccgo_ts + 16839, + 14: __ccgo_ts + 16842, + 15: __ccgo_ts + 16810, + 16: __ccgo_ts + 16849, + 17: __ccgo_ts + 16815, + 18: __ccgo_ts + 16857, + 19: __ccgo_ts + 16861, + 20: __ccgo_ts + 16866, + 21: __ccgo_ts + 16872, + 22: __ccgo_ts + 16810, + 23: __ccgo_ts + 16815, + 24: __ccgo_ts + 16879, + 25: __ccgo_ts + 16884, + 26: __ccgo_ts + 16887, + 27: __ccgo_ts + 16894, + 28: __ccgo_ts + 16806, + 29: __ccgo_ts + 16810, + 30: __ccgo_ts + 16900, + 31: __ccgo_ts + 16905, + 32: __ccgo_ts + 16910, + 33: __ccgo_ts + 16768, + 34: __ccgo_ts + 16810, + 35: __ccgo_ts + 16914, + 36: __ccgo_ts + 16921, + 37: __ccgo_ts + 16928, + 38: __ccgo_ts + 12042, + 39: __ccgo_ts + 12038, + 40: __ccgo_ts + 16936, + 41: __ccgo_ts + 16941, + 42: __ccgo_ts + 16946, + 43: __ccgo_ts + 9303, + 44: __ccgo_ts + 16951, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16957, + 47: __ccgo_ts + 16962, + 48: __ccgo_ts + 16153, + 49: __ccgo_ts + 16967, + 50: __ccgo_ts + 16768, + 51: __ccgo_ts + 16810, + 52: __ccgo_ts + 16980, + 53: __ccgo_ts + 16985, + 54: __ccgo_ts + 16994, + 55: __ccgo_ts + 17001, + 56: __ccgo_ts + 17012, } // C documentation @@ -113699,338 +108223,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16919, + FzName: __ccgo_ts + 17020, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16934, + FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16949, + FzName: __ccgo_ts + 17050, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16961, + FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16977, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16900, + FzName: __ccgo_ts + 17001, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16990, + FzName: __ccgo_ts + 17091, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17002, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17022, + FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17038, + FzName: __ccgo_ts + 17139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17059, + FzName: __ccgo_ts + 17160, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17074, + FzName: __ccgo_ts + 17175, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17191, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17104, + FzName: __ccgo_ts + 17205, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17117, + FzName: __ccgo_ts + 17218, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17131, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17150, + FzName: __ccgo_ts + 17251, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17169, + FzName: __ccgo_ts + 17270, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17192, + FzName: __ccgo_ts + 17293, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17201, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17219, + FzName: __ccgo_ts + 17320, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17236, + FzName: __ccgo_ts + 17337, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17249, + FzName: __ccgo_ts + 17350, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17264, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17282, + FzName: __ccgo_ts + 17383, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17292, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17306, + FzName: __ccgo_ts + 17407, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17322, + FzName: __ccgo_ts + 17423, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17347, + FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17467, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17377, + FzName: __ccgo_ts + 17478, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17388, + FzName: __ccgo_ts + 17489, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17400, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17416, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17429, + FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17448, + FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17467, + FzName: __ccgo_ts + 17568, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17480, + FzName: __ccgo_ts + 17581, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17495, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17505, + FzName: __ccgo_ts + 17606, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17517, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17526, + FzName: __ccgo_ts + 17627, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17537, + FzName: __ccgo_ts + 17638, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17547, + FzName: __ccgo_ts + 17648, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17559, + FzName: __ccgo_ts + 17660, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17570, + FzName: __ccgo_ts + 17671, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17582, + FzName: __ccgo_ts + 17683, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17599, + FzName: __ccgo_ts + 17700, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17618, + FzName: __ccgo_ts + 17719, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17644, + FzName: __ccgo_ts + 17745, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17659, + FzName: __ccgo_ts + 17760, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17673, + FzName: __ccgo_ts + 17774, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17692, + FzName: __ccgo_ts + 17793, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17706, + FzName: __ccgo_ts + 17807, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17722, + FzName: __ccgo_ts + 17823, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17734, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17745, + FzName: __ccgo_ts + 17846, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17756, + FzName: __ccgo_ts + 17857, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114038,45 +108562,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17768, + FzName: __ccgo_ts + 17869, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17779, + FzName: __ccgo_ts + 17880, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17800, + FzName: __ccgo_ts + 17901, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17808, + FzName: __ccgo_ts + 17909, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17823, + FzName: __ccgo_ts + 17924, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17836, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17855, + FzName: __ccgo_ts + 17956, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17870, + FzName: __ccgo_ts + 17971, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -114094,7 +108618,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -114202,10 +108726,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17886) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17987) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17896) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17997) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114223,13 +108747,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8409) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8434) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17903) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18004) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18009) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114252,10 +108776,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16861) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16980) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17920) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18021) == 0 { return int32(2) } else { return 0 @@ -114277,7 +108801,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17927, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18028, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114407,15 +108931,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17989 + zName = __ccgo_ts + 18090 case int32(OE_SetDflt): - zName = __ccgo_ts + 17998 + zName = __ccgo_ts + 18099 case int32(OE_Cascade): - zName = __ccgo_ts + 18010 + zName = __ccgo_ts + 18111 case int32(OE_Restrict): - zName = __ccgo_ts + 18018 + zName = __ccgo_ts + 18119 default: - zName = __ccgo_ts + 18027 + zName = __ccgo_ts + 18128 break } return zName @@ -114436,12 +108960,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18037, - 1: __ccgo_ts + 18044, - 2: __ccgo_ts + 18052, - 3: __ccgo_ts + 18056, - 4: __ccgo_ts + 17920, - 5: __ccgo_ts + 18065, + 0: __ccgo_ts + 18138, + 1: __ccgo_ts + 18145, + 2: __ccgo_ts + 18153, + 3: __ccgo_ts + 18157, + 4: __ccgo_ts + 18021, + 5: __ccgo_ts + 18166, } // C documentation @@ -114503,15 +109027,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18090 + zType = __ccgo_ts + 18191 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18092 + zType = __ccgo_ts + 18193 } else { - zType = __ccgo_ts + 7808 + zType = __ccgo_ts + 7833 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18094, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18195, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -114520,9 +109044,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18069, - 2: __ccgo_ts + 18074, - 3: __ccgo_ts + 18082, + 1: __ccgo_ts + 18170, + 2: __ccgo_ts + 18175, + 3: __ccgo_ts + 18183, } // C documentation @@ -114621,7 +109145,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18101, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18202, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114664,7 +109188,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114709,7 +109233,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114768,7 +109292,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18105) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18206) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114811,7 +109335,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114839,7 +109363,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17896 + zRet = __ccgo_ts + 17997 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114867,7 +109391,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17886 + zRet = __ccgo_ts + 17987 } _returnSingleText(tls, v, zRet) break @@ -115157,7 +109681,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18110, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18211, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115167,7 +109691,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -115189,7 +109713,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18135, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18236, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115221,8 +109745,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18188) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18289) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -115302,9 +109827,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18194 + v14 = __ccgo_ts + 18295 } else { - v14 = __ccgo_ts + 18202 + v14 = __ccgo_ts + 18303 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115375,7 +109900,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18209, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18310, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -115405,19 +109930,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10987 + zType = __ccgo_ts + 11041 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13235 + zType = __ccgo_ts + 13289 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18225 + zType = __ccgo_ts + 18326 } else { - zType = __ccgo_ts + 9249 + zType = __ccgo_ts + 9303 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18232, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18333, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -115464,9 +109989,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18239, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18340, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18244, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18345, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -115490,11 +110015,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18249, - 1: __ccgo_ts + 18251, - 2: __ccgo_ts + 16738, + 0: __ccgo_ts + 18350, + 1: __ccgo_ts + 18352, + 2: __ccgo_ts + 16839, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18253, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18354, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -115513,7 +110038,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18259, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18360, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -115530,7 +110055,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18263, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18364, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115580,7 +110105,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7808, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -115592,7 +110117,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7808, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -115618,7 +110143,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18266, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18275)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18367, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18376)) goto _32 _32: ; @@ -115632,8 +110157,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115759,7 +110284,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18280, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18381, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115855,7 +110380,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115899,7 +110424,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -115950,7 +110475,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18284, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18385, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115961,7 +110486,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18308) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18409) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116097,7 +110622,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18337, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -116159,7 +110684,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -116181,7 +110706,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18373, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18474, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -116194,7 +110719,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18393, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18494, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -116202,7 +110727,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18415, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18516, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -116213,10 +110738,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18438, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18539, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18440, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -116250,7 +110775,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18460, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18561, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -116274,9 +110799,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18490) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18495) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18596) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -116289,9 +110814,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18516) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18617) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18552) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18653) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116319,9 +110844,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18490) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18563) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18664) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116349,7 +110874,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18590) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18691) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116446,7 +110971,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18617 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18718 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116525,7 +111050,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18678, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18779, libc.VaList(bp+176, zRight)) } } } @@ -116630,13 +111155,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17903) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18004) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18703) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18804) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18056) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18157) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116771,7 +111296,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116801,7 +111326,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6655, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6680, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116863,7 +111388,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18711, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18812, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -117136,34 +111661,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18620, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18726, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18631, + FzName: __ccgo_ts + 18732, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18640, + FzName: __ccgo_ts + 18741, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18649, + FzName: __ccgo_ts + 18750, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18657, + FzName: __ccgo_ts + 18758, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18665, + FzName: __ccgo_ts + 18766, }, 7: { - FzName: __ccgo_ts + 18672, + FzName: __ccgo_ts + 18773, }, 8: {}, } @@ -117220,25 +111745,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -117259,14 +111765,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18729) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18830) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18744, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18845, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -117275,19 +111781,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18751, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18852, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18757) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18769) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18870) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -117302,7 +111808,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -117483,7 +111989,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -117495,13 +112001,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18784) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18885) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18893, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18796, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18897, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117510,7 +112016,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117636,24 +112142,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18830, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18931, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5177 + v1 = __ccgo_ts + 5203 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18858, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18889, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18990, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -117661,9 +112167,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18800, - 1: __ccgo_ts + 18807, - 2: __ccgo_ts + 18819, + 0: __ccgo_ts + 18901, + 1: __ccgo_ts + 18908, + 2: __ccgo_ts + 18920, } // C documentation @@ -117739,7 +112245,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14675) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117772,11 +112278,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18897) + _corruptSchema(tls, pData, argv, __ccgo_ts+18998) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14675) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } } @@ -117815,18 +112321,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9249 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9303 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6663 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6151 + v2 = __ccgo_ts + 6175 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8321 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18910 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8346 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19011 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117910,7 +112416,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12286) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12340) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117936,7 +112442,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18982) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19083) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117951,7 +112457,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19006, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19107, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -118247,7 +112753,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -118260,9 +112766,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -118280,7 +112786,7 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse @@ -118309,7 +112815,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -118369,7 +112875,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19040, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19141, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118385,7 +112891,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19070, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19171, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118408,10 +112914,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -118419,7 +112925,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3864, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -118449,7 +112955,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118583,7 +113089,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118705,15 +113211,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118749,21 +113246,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118843,7 +113325,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118851,7 +113333,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -119007,15 +113489,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11393 - zSp2 = __ccgo_ts + 11393 + zSp1 = __ccgo_ts + 11447 + zSp2 = __ccgo_ts + 11447 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19089, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19190, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119072,25 +113554,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -119222,13 +113707,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -119306,7 +113791,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19119, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19220, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119356,12 +113841,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19169, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19270, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -119376,9 +113861,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19233, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19334, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119388,6 +113874,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -119422,7 +113915,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6860, + Fz: __ccgo_ts + 6885, Fn: uint32(8), } @@ -119439,13 +113932,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -119470,7 +113956,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -119515,7 +114001,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -119539,7 +114025,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -119560,7 +114046,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119683,7 +114169,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119810,10 +114296,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119821,7 +114307,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119998,7 +114484,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19270, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120109,8 +114595,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -120118,7 +114604,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -120203,13 +114689,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19290 + z = __ccgo_ts + 19391 case int32(TK_INTERSECT): - z = __ccgo_ts + 19300 + z = __ccgo_ts + 19401 case int32(TK_EXCEPT): - z = __ccgo_ts + 19310 + z = __ccgo_ts + 19411 default: - z = __ccgo_ts + 19317 + z = __ccgo_ts + 19418 break } return z @@ -120230,7 +114716,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19323, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+8, zUsage)) } /* @@ -120267,13 +114753,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19346 + v1 = __ccgo_ts + 19447 } else { v1 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19360, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19461, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19391, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19492, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -120297,11 +114783,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -120517,7 +115003,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1141 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16850 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16951 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -120630,7 +115116,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -120639,7 +115125,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -120663,13 +115149,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16850 + zCol = __ccgo_ts + 16951 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12572, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120677,7 +115163,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19437, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120731,7 +115217,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120769,7 +115255,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16850 + v3 = __ccgo_ts + 16951 } zName = v3 } else { @@ -120784,7 +115270,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19437, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120820,7 +115306,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19446, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19547, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120939,7 +115425,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19454 + zType = __ccgo_ts + 19555 } else { zType = uintptr(0) j = int32(1) @@ -121005,7 +115491,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -121033,7 +115519,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -121083,7 +115569,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -121106,7 +115592,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -121254,7 +115740,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19458, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19559, 0) return } /* Obtain authorization to do a recursive query */ @@ -121291,7 +115777,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -121302,7 +115788,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -121316,7 +115802,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -121347,7 +115833,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19507, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19608, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121362,7 +115848,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19549, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19650, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121390,7 +115876,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19555, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19656, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121445,9 +115931,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1667 } else { - v1 = __ccgo_ts + 19570 + v1 = __ccgo_ts + 19671 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19572, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19673, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -121555,8 +116041,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19595, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19610, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19696, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19711, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121581,7 +116067,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19290, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19391, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121607,7 +116093,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -121633,7 +116119,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19629, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121665,11 +116151,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121691,7 +116177,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19629, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121798,6 +116284,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121814,9 +116301,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19650, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19751, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19696, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19797, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121887,7 +116374,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19270, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122103,7 +116590,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -122135,7 +116622,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -122189,16 +116676,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7558) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7558) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7583) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -122216,32 +116703,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19778, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19879, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19789, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19890, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122254,7 +116741,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19794, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19895, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122464,11 +116951,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5155 + v1 = __ccgo_ts + 5181 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -122629,7 +117116,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122819,9 +117306,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -123033,7 +117520,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -123180,7 +117667,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -123419,18 +117906,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -123470,11 +117945,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -123539,7 +118014,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -123557,12 +118032,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -124044,7 +118519,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -124090,13 +118565,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15709) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15790) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15713) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15794) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124184,8 +118659,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19800, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19901, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -124209,7 +118684,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -124291,7 +118766,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -124309,7 +118784,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19818, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19919, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124457,7 +118932,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -124485,7 +118960,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19841, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124507,12 +118982,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19861, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19962, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -124529,7 +119004,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19904 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20005 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -124560,7 +119035,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19927, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20028, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -124569,9 +119044,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19965 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20066 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19999 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20100 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124620,7 +119095,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -124630,7 +119105,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20037, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20138, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124726,7 +119201,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124735,7 +119210,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124786,7 +119261,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20041, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124801,7 +119276,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20080, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20181, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124816,7 +119291,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15268, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124940,7 +119415,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6720 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124957,7 +119432,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20111, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -125036,7 +119511,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20116, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20217, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125049,7 +119524,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12572, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -125069,9 +119544,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20125, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20226, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20143, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) } } } @@ -125085,7 +119560,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20163, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20264, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125282,14 +119757,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -125298,7 +119773,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -125330,11 +119805,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125387,7 +119862,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -125424,12 +119899,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20194, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20295, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20245, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20346, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125450,7 +119925,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20278, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20379, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125589,7 +120064,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125697,7 +120172,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125741,7 +120216,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125764,7 +120239,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20311 + v1 = __ccgo_ts + 20412 } else { v1 = __ccgo_ts + 1667 } @@ -125773,7 +120248,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20334, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20435, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125805,7 +120280,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8321) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125934,6 +120409,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125962,7 +120438,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16003) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16104) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125995,9 +120471,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -126007,13 +120483,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -126033,7 +120509,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -126206,8 +120682,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -126216,11 +120692,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -126236,7 +120712,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -126260,14 +120736,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20346, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20447, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -126368,7 +120844,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20400, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20501, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -126569,14 +121045,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20440, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20541, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -126608,7 +121084,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -126623,7 +121099,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20455, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20556, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126677,7 +121153,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126710,7 +121186,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126769,7 +121245,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126798,6 +121274,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126820,10 +121303,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126857,8 +121340,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126873,8 +121356,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126903,8 +121386,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126921,7 +121404,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126934,11 +121417,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126972,49 +121455,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -127022,16 +121506,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -127049,11 +121533,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20471 + v47 = __ccgo_ts + 20572 } else { - v46 = __ccgo_ts + 20480 + v47 = __ccgo_ts + 20581 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19323, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127063,12 +121547,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127081,13 +121565,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127098,12 +121582,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -127152,12 +121636,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -127227,9 +121715,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -127246,10 +121734,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -127276,8 +121764,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -127317,32 +121805,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -127384,7 +121872,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20471) + _explainTempTable(tls, pParse, __ccgo_ts+20572) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -127490,7 +121978,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -127506,7 +121994,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20489, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20590, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127596,7 +122084,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127758,7 +122246,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20554, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) goto trigger_cleanup } iDb = int32(1) @@ -127798,7 +122286,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20600, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20701, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127808,11 +122296,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20608, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20709, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20649, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20750, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127821,13 +122309,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20600, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20701, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20689, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20790, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127835,8 +122323,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6655, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20715, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20816, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127844,15 +122332,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20753 + v1 = __ccgo_ts + 20854 } else { - v1 = __ccgo_ts + 20760 + v1 = __ccgo_ts + 20861 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20766, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20867, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20803, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20904, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127872,9 +122360,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6663 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6151 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127974,7 +122462,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20600, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20701, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127996,7 +122484,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20849, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20950, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128012,10 +122500,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20897, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20998, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20972, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21073, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128283,11 +122771,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21001, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -128325,9 +122813,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6663 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6151 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -128342,7 +122830,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21021, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -128475,11 +122963,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21083 + v1 = __ccgo_ts + 21184 } else { - v1 = __ccgo_ts + 21090 + v1 = __ccgo_ts + 21191 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21097, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21198, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128581,7 +123069,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21145, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21246, 0) return int32(1) } @@ -128729,12 +123217,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128742,19 +123230,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128765,7 +123256,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128779,7 +123270,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128847,7 +123338,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6348, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128946,10 +123437,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21187, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21288, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128971,7 +123464,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -129043,7 +123536,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -129459,13 +123952,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -129473,21 +123966,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -129534,7 +124027,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -129573,7 +124066,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -129617,58 +124110,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21201, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21302, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21237, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8096 + v10 = __ccgo_ts + 8121 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129698,17 +124179,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129720,11 +124201,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129740,11 +124221,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129753,18 +124234,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129773,16 +124254,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129800,24 +124281,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129843,50 +124324,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -130184,8 +124665,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130235,8 +124716,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -130283,11 +124764,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -130299,11 +124780,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -130346,7 +124827,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21256) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21357) } goto update_cleanup update_cleanup: @@ -130403,13 +124884,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -130451,11 +124932,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130780,9 +125261,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 200)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21269, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21370, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21273, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21374, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130871,13 +125352,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130885,7 +125366,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12661, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12715, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130967,7 +125448,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21346, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21350, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21447, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21451, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131058,7 +125539,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -131097,17 +125578,17 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21354) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21455) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21394) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21495) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21437) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21538) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131124,7 +125605,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21486) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21587) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131177,7 +125658,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15038) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15092) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131208,11 +125689,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21513, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21614, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21621, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21722, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131221,7 +125702,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21675, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21776, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -131231,7 +125712,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21812, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21913, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131322,39 +125803,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -131365,7 +125813,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -131374,7 +125822,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -131384,7 +125832,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -131409,15 +125857,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -131432,13 +125880,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131758,7 +126208,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131881,24 +126331,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21935, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22036, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21959, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22060, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22058, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131955,7 +126410,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131982,7 +126437,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22077, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22178, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132016,7 +126471,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -132024,9 +126479,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22119, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22220, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3864, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -132039,7 +126494,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22149 + zFormat = __ccgo_ts + 22250 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132073,7 +126528,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16741, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16842, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -132154,13 +126609,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22195, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22296, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -132241,7 +126696,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22195, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22296, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -132289,7 +126744,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22214, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22315, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132300,9 +126755,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132344,7 +126799,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3864 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } @@ -132710,7 +127165,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132800,7 +127255,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132820,7 +127275,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3864, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132884,7 +127339,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132897,7 +127352,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -133157,436 +127612,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -133618,10 +127643,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22227 + return __ccgo_ts + 22328 } if i == -int32(1) { - return __ccgo_ts + 16850 + return __ccgo_ts + 16951 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133640,10 +127665,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22234, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133651,7 +127676,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13281, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133660,11 +127685,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22240, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133672,16 +127697,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13281, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5177, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } } @@ -133728,7 +127753,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22242, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22343, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133736,12 +127761,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22234, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22245 + v2 = __ccgo_ts + 22346 } else { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22351 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133758,7 +127783,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22258) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22359) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133769,9 +127794,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22260) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22361) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133816,11 +127841,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22262 + v2 = __ccgo_ts + 22363 } else { - v2 = __ccgo_ts + 22269 + v2 = __ccgo_ts + 22370 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22274, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22375, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133833,37 +127858,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11444 + zFmt = __ccgo_ts + 11498 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22280 + zFmt = __ccgo_ts + 22381 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22313 + zFmt = __ccgo_ts + 22414 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22338 + zFmt = __ccgo_ts + 22439 } else { - zFmt = __ccgo_ts + 22356 + zFmt = __ccgo_ts + 22457 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22365, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22466, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16850 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22373, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16951 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22474, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22404, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22505, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133873,14 +127898,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22414, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, libc.VaList(bp+144, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22419) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22520) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22441 + v3 = __ccgo_ts + 22542 } else { - v3 = __ccgo_ts + 22449 + v3 = __ccgo_ts + 22550 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133901,7 +127926,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22455, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22556, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133931,10 +127956,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133967,14 +127992,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22466, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22567, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22245, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22487, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22588, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133998,16 +128023,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22234, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22335, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22245, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5175, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -134212,7 +128237,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -134268,8 +128293,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -134291,7 +128316,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -134348,10 +128373,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -134406,37 +128431,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -134461,10 +128472,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -134483,24 +128494,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -134512,8 +128523,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -134571,7 +128582,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -134653,7 +128664,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134784,7 +128795,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -134921,7 +128932,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -135066,7 +129077,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -135127,11 +129138,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -135162,6 +129173,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -135300,7 +129314,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -135380,7 +129394,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -135414,7 +129428,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -135536,7 +129550,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135729,7 +129743,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135743,12 +129757,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135786,11 +129801,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135810,7 +129825,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135846,21 +129861,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135878,7 +129893,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135933,7 +129948,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22495, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22596, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135956,7 +129971,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22510, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22611, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -136445,9 +130460,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -136456,14 +130471,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22519, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22620, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -136502,15 +130517,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -136522,7 +130538,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -136595,7 +130611,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -136993,19 +131009,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16699, + FzOp: __ccgo_ts + 16800, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16033, + FzOp: __ccgo_ts + 16134, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15512, + FzOp: __ccgo_ts + 15593, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22533, + FzOp: __ccgo_ts + 22634, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137525,37 +131541,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137793,7 +131813,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22540, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } } else { @@ -137805,10 +131825,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22540, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137867,7 +131887,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137889,7 +131909,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8082 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8107 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137990,7 +132010,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22581 + v13 = __ccgo_ts + 22682 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138521,7 +132541,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22588, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -138593,22 +132613,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138721,7 +132729,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -139637,7 +133645,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141888,13 +135897,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141994,6 +135998,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -142007,12 +136012,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -142458,7 +136480,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -142509,15 +136531,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -142549,7 +136562,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -142568,7 +136581,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -142605,7 +136618,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -142613,7 +136626,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -142634,19 +136647,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142742,7 +136755,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142920,7 +136933,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142948,6 +136961,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -143024,7 +137045,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -143261,7 +137282,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22661, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143336,7 +137357,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22661, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143490,7 +137511,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143926,7 +137947,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22687, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22788, 0) rc = SQLITE_OK } else { break @@ -144155,17 +138176,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -145134,7 +139144,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22722, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22823, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145712,7 +139722,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145868,7 +139878,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22740, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22841, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145889,11 +139899,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -145941,7 +139948,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22768, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22869, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146086,7 +140093,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -146120,7 +140128,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -146142,7 +140150,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -146155,7 +140163,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -146246,11 +140254,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -146277,16 +140285,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -146334,7 +140342,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -146465,7 +140473,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -146643,7 +140651,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146672,7 +140680,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146682,7 +140690,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22786, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22887, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146732,7 +140740,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -147001,7 +141009,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22815, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22916, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147183,7 +141191,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22871, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22972, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147509,7 +141517,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22916, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23017, libc.VaList(bp+8, zName)) } return p } @@ -147560,12 +141568,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22935, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23036, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23006, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23107, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147638,7 +141646,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8321) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) } break } @@ -147669,16 +141677,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147697,17 +141695,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -147725,7 +141723,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147749,13 +141747,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147770,23 +141768,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147802,13 +141800,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147920,7 +141918,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23069, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23170, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147956,7 +141954,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147971,7 +141969,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147990,11 +141988,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -148040,11 +142038,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -148061,7 +142059,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1787)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -148083,7 +142081,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -148207,7 +142205,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23095, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23196, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148275,18 +142273,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23127 + zErr = __ccgo_ts + 23228 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23144 + zErr = __ccgo_ts + 23245 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23160 + zErr = __ccgo_ts + 23261 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23180, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -148310,7 +142308,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23213, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23314, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148416,24 +142414,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -148451,12 +142449,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -148468,15 +142466,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -148528,11 +142526,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23260, - 1: __ccgo_ts + 23313, - 2: __ccgo_ts + 22815, - 3: __ccgo_ts + 23364, - 4: __ccgo_ts + 23416, + 0: __ccgo_ts + 23361, + 1: __ccgo_ts + 23414, + 2: __ccgo_ts + 22916, + 3: __ccgo_ts + 23465, + 4: __ccgo_ts + 23517, } var _aOp1 = [5]int32{ @@ -148585,87 +142583,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -149112,7 +143029,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -149208,7 +143125,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -149925,12 +143842,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149938,13 +143855,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149964,13 +143881,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149997,7 +143914,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -150216,6 +144133,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -150276,7 +144197,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23466, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23567, libc.VaList(bp+8, p)) } // C documentation @@ -150290,6 +144211,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -150323,11 +144245,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23490 + v1 = __ccgo_ts + 23591 } else { - v1 = __ccgo_ts + 23499 + v1 = __ccgo_ts + 23600 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23505, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23606, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150336,7 +144258,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23547, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23648, 0) } } } @@ -150442,7 +144364,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23581, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23682, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156909,14 +150831,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156927,16 +150841,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -156963,13 +150867,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -158084,19 +151988,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158899,20 +152803,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16850, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16951, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23619, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16763, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16887, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23619, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158953,7 +152857,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -159098,7 +153007,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -159188,9 +153102,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -159545,7 +153459,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23646) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23747) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159885,23 +153799,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8102 + } else { + v347 = __ccgo_ts + 8107 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8077 - } else { - v347 = __ccgo_ts + 8082 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -159959,11 +153887,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -159973,9 +153901,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -159983,11 +153911,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -160085,11 +154013,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -160139,15 +154067,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23655, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23756, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23750, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23834, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23935, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160289,7 +154217,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -160483,7 +154411,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23919, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24020, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -162609,7 +156537,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -163214,14 +157142,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -164085,22 +158016,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -164111,11 +158051,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164694,7 +158634,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164714,7 +158654,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24006, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24107, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164839,11 +158779,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -165015,14 +158955,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24549 + zErr = __ccgo_ts + 24650 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -165034,31 +158974,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24074, - 1: __ccgo_ts + 24087, - 3: __ccgo_ts + 24103, - 4: __ccgo_ts + 24128, - 5: __ccgo_ts + 24142, - 6: __ccgo_ts + 24161, + 0: __ccgo_ts + 24175, + 1: __ccgo_ts + 24188, + 3: __ccgo_ts + 24204, + 4: __ccgo_ts + 24229, + 5: __ccgo_ts + 24243, + 6: __ccgo_ts + 24262, 7: __ccgo_ts + 1637, - 8: __ccgo_ts + 24186, - 9: __ccgo_ts + 24223, - 10: __ccgo_ts + 24235, - 11: __ccgo_ts + 24250, - 12: __ccgo_ts + 24283, - 13: __ccgo_ts + 24301, - 14: __ccgo_ts + 24326, - 15: __ccgo_ts + 24355, - 17: __ccgo_ts + 6106, - 18: __ccgo_ts + 5508, - 19: __ccgo_ts + 24372, - 20: __ccgo_ts + 24390, - 21: __ccgo_ts + 24408, - 23: __ccgo_ts + 24442, - 25: __ccgo_ts + 24463, - 26: __ccgo_ts + 24489, - 27: __ccgo_ts + 24512, - 28: __ccgo_ts + 24533, + 8: __ccgo_ts + 24287, + 9: __ccgo_ts + 24324, + 10: __ccgo_ts + 24336, + 11: __ccgo_ts + 24351, + 12: __ccgo_ts + 24384, + 13: __ccgo_ts + 24402, + 14: __ccgo_ts + 24427, + 15: __ccgo_ts + 24456, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24473, + 20: __ccgo_ts + 24491, + 21: __ccgo_ts + 24509, + 23: __ccgo_ts + 24543, + 25: __ccgo_ts + 24564, + 26: __ccgo_ts + 24590, + 27: __ccgo_ts + 24613, + 28: __ccgo_ts + 24634, } // C documentation @@ -165152,15 +159092,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -165168,6 +159110,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -165175,10 +159119,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -165205,6 +159149,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -165232,12 +159190,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -165255,9 +159213,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -165280,13 +159238,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24630, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24731, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -165304,15 +159262,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -165327,27 +159285,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -165358,30 +159316,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -165406,7 +159394,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24693, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24794, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165437,13 +159425,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -165454,43 +159444,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -165501,12 +159495,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -165518,6 +159512,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -165525,82 +159521,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -165644,18 +159650,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165681,7 +159689,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165691,7 +159699,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24744, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24845, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165813,7 +159821,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165945,7 +159953,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165955,7 +159963,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165991,7 +159999,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -166004,7 +160012,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166013,7 +160021,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24765, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24866, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166048,9 +160056,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -166160,7 +160168,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24833, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24934, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -166190,8 +160198,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24839, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24849, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24940, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24950, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166280,24 +160288,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24877, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24978, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24881, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24982, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24881 + zModeType = __ccgo_ts + 24982 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24902, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25003, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3473 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -166326,12 +160334,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24917, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25018, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24937, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25038, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166355,7 +160363,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24961, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25062, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166375,11 +160383,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24887, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24894, + Fz: __ccgo_ts + 24995, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166390,19 +160398,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24907, + Fz: __ccgo_ts + 25008, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24910, + Fz: __ccgo_ts + 25011, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24913, + Fz: __ccgo_ts + 25014, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17920, + Fz: __ccgo_ts + 18021, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166530,8 +160538,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22581, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24977, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22682, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25078, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166552,10 +160560,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4259 + zFilename = __ccgo_ts + 4285 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -166564,7 +160572,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3864 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -166591,9 +160599,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6715 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6740 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23979 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24080 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166687,7 +160695,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24983 + zFilename = __ccgo_ts + 25084 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166706,36 +160714,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166743,7 +160759,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166751,31 +160767,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166809,12 +160829,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166847,10 +160869,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166861,7 +160883,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166904,20 +160926,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24986, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25087, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25011) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25112) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25031) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25132) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25038) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25139) } // C documentation @@ -166942,9 +160964,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166971,29 +160993,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -167048,15 +161059,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25055, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25156, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3864 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -167235,8 +161246,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167680,7 +161691,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -168076,7 +162087,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25083, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25184, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168224,6 +162235,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -168247,7 +162260,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -168257,7 +162270,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -168269,7 +162282,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -168285,7 +162298,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -168294,7 +162307,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25091 + v2 = __ccgo_ts + 25192 } else { v2 = uintptr(0) } @@ -168373,7 +162386,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -168540,7 +162553,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168757,6 +162770,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169069,8 +163089,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -169127,7 +163147,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -169137,7 +163157,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -169175,18 +163195,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1653, - 1: __ccgo_ts + 8077, - 2: __ccgo_ts + 8082, - 3: __ccgo_ts + 6391, - 4: __ccgo_ts + 6391, - 5: __ccgo_ts + 6386, - 6: __ccgo_ts + 6386, - 7: __ccgo_ts + 8388, - 8: __ccgo_ts + 8388, - 9: __ccgo_ts + 8388, - 10: __ccgo_ts + 8388, - 11: __ccgo_ts + 25114, - 12: __ccgo_ts + 25120, + 1: __ccgo_ts + 8102, + 2: __ccgo_ts + 8107, + 3: __ccgo_ts + 6416, + 4: __ccgo_ts + 6416, + 5: __ccgo_ts + 6411, + 6: __ccgo_ts + 6411, + 7: __ccgo_ts + 8413, + 8: __ccgo_ts + 8413, + 9: __ccgo_ts + 8413, + 10: __ccgo_ts + 8413, + 11: __ccgo_ts + 25215, + 12: __ccgo_ts + 25221, 13: __ccgo_ts + 1667, 14: __ccgo_ts + 1667, 15: __ccgo_ts + 1667, @@ -169494,106 +163514,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169673,7 +163593,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169971,8 +163891,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25127 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25127 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -170108,7 +164028,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1653, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15482, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15536, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -170122,14 +164042,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25144, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25228, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170183,7 +164101,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25257, -int32(1)) } } } @@ -170466,8 +164384,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25188, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25272, + FzRepl: __ccgo_ts + 25276, }, 1: { Fc1: int8('i'), @@ -170475,8 +164393,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25200, - FzRepl: __ccgo_ts + 25192, + FzMatch: __ccgo_ts + 25284, + FzRepl: __ccgo_ts + 25276, }, 2: { Fc1: int8('n'), @@ -170491,7 +164409,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25209, + FzMatch: __ccgo_ts + 25293, FzRepl: __ccgo_ts + 1653, }, 4: { @@ -170499,7 +164417,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25214, + FzMatch: __ccgo_ts + 25298, FzRepl: __ccgo_ts + 1653, }, } @@ -170515,7 +164433,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25219, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25303, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170533,23 +164451,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -170627,7 +164545,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170698,7 +164616,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170973,7 +164895,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25262, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25346, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -171403,7 +165325,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -171442,7 +165364,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8077, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8102, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171450,7 +165372,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8082, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8107, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -171527,14 +165449,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25188, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25272, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25284, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25368, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171719,7 +165641,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171764,7 +165686,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171777,7 +165699,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171826,10 +165748,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171863,15 +165781,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171944,11 +165862,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8077, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8102, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8082, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8107, uint32(5)) return i + uint32(1) _6: ; @@ -171997,9 +165915,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25192 + v19 = __ccgo_ts + 25276 } else { - v19 = __ccgo_ts + 11944 + v19 = __ccgo_ts + 11998 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172035,9 +165953,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -172064,7 +165985,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25290, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25374, uint32(2)) zIn2++ sz2-- continue @@ -172087,7 +166008,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25293, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25377, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172095,12 +166016,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25300, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25384, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25305, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25389, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172203,16 +166124,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -172280,7 +166191,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25312, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172303,12 +166214,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25315, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25399, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25312, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172323,50 +166234,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -172418,6 +166285,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -172438,6 +166383,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -172510,9 +166458,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -172555,7 +166503,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -173043,7 +167002,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173178,7 +167137,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -173279,7 +167238,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } @@ -173316,11 +167275,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25144, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25228, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173333,7 +167289,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173352,10 +167308,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25278) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25271) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173394,7 +167350,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25318, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25402, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173410,7 +167366,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -173491,7 +167447,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173503,34 +167459,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -173613,7 +167589,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173673,7 +167649,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173808,7 +167784,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25336 + v1 = __ccgo_ts + 25420 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173818,7 +167794,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } eErr = uint8(1) @@ -173928,23 +167904,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25340, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5230, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5256, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1680, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1706, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25342, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25426, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25429, uint32(1)) } } } @@ -173984,7 +167960,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174252,7 +168228,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174276,7 +168252,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25347, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25431, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174287,7 +168263,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25398, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25482, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174359,7 +168335,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_remove_done @@ -174396,7 +168372,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15955) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16056) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174427,9 +168403,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25432 + v1 = __ccgo_ts + 25516 } else { - v1 = __ccgo_ts + 25436 + v1 = __ccgo_ts + 25520 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174477,7 +168453,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25173, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_type_done @@ -174524,7 +168500,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25443 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25527 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -174598,17 +168574,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25448, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25532, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174617,18 +168592,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174690,9 +168664,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174799,7 +168771,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25505, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25589, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174891,20 +168863,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -174948,7 +168922,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25508, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25592, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174976,16 +168950,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -175004,24 +168968,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -175029,13 +168975,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -175051,7 +168990,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25511) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25595) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175185,7 +169124,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25594, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25678, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -175211,9 +169150,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25601, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25685, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25609, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25693, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175524,9 +169463,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -175599,7 +169537,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25615, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25699, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175623,7 +169561,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25173, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25257, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175684,186 +169622,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25617, + FzName: __ccgo_ts + 25701, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25622, + FzName: __ccgo_ts + 25706, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25628, + FzName: __ccgo_ts + 25712, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25639, + FzName: __ccgo_ts + 25723, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25651, + FzName: __ccgo_ts + 25735, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25651, + FzName: __ccgo_ts + 25735, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25669, + FzName: __ccgo_ts + 25753, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25689, + FzName: __ccgo_ts + 25773, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25702, + FzName: __ccgo_ts + 25786, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25716, + FzName: __ccgo_ts + 25800, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25719, + FzName: __ccgo_ts + 25803, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25723, + FzName: __ccgo_ts + 25807, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25735, + FzName: __ccgo_ts + 25819, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25748, + FzName: __ccgo_ts + 25832, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25760, + FzName: __ccgo_ts + 25844, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25773, + FzName: __ccgo_ts + 25857, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25784, + FzName: __ccgo_ts + 25868, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25796, + FzName: __ccgo_ts + 25880, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25796, + FzName: __ccgo_ts + 25880, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25808, + FzName: __ccgo_ts + 25892, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25819, + FzName: __ccgo_ts + 25903, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25831, + FzName: __ccgo_ts + 25915, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25844, + FzName: __ccgo_ts + 25928, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25857, + FzName: __ccgo_ts + 25941, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25871, + FzName: __ccgo_ts + 25955, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25880, + FzName: __ccgo_ts + 25964, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25890, + FzName: __ccgo_ts + 25974, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25890, + FzName: __ccgo_ts + 25974, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25900, + FzName: __ccgo_ts + 25984, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25900, + FzName: __ccgo_ts + 25984, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25911, + FzName: __ccgo_ts + 25995, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25928, + FzName: __ccgo_ts + 26012, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25946, + FzName: __ccgo_ts + 26030, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25964, + FzName: __ccgo_ts + 26048, }, } @@ -175946,17 +169884,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25983, + FzName: __ccgo_ts + 26067, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25993, + FzName: __ccgo_ts + 26077, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -176006,224 +169946,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -176241,33 +169966,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -176278,79 +169997,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -176427,7 +170131,7 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*Ti64)(unsafe.Pointer(bp)) = _i - *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp))))) + *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, uint64(libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp)))))) libc.Xmemcpy(tls, p, bp, uint64(8)) return int32(8) } @@ -176533,7 +170237,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -176596,7 +170300,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26003, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26087, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176607,7 +170311,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176901,7 +170605,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26008, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26092, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -177438,7 +171142,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177818,7 +171522,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26090) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26174) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177896,7 +171600,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -178127,7 +171831,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -178135,7 +171839,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -178373,7 +172077,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178795,7 +172499,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -179304,11 +173008,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179321,11 +173025,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179353,7 +173057,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26104, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -179363,11 +173067,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26124, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26208, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26156, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26240, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179581,7 +173285,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26193, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -179635,9 +173339,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26338 + zFmt = __ccgo_ts + 26422 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11773, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11827, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179695,9 +173399,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26394, - 1: __ccgo_ts + 5569, - 2: __ccgo_ts + 16850, + 0: __ccgo_ts + 26478, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16951, } var _rtreeModule = Tsqlite3_module{ @@ -179741,21 +173445,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26808, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26892, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26870, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26954, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26875, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26939, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27009, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26959, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27023, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27093, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179785,7 +173489,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27058 + zFormat = __ccgo_ts + 27142 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179800,31 +173504,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27166, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27250, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27211, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27295, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13281, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13335, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27238, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27322, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27260, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27344, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27268, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27352, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179838,14 +173542,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26399, - 1: __ccgo_ts + 26452, - 2: __ccgo_ts + 26497, - 3: __ccgo_ts + 26549, - 4: __ccgo_ts + 26603, - 5: __ccgo_ts + 26648, - 6: __ccgo_ts + 26706, - 7: __ccgo_ts + 26761, + 0: __ccgo_ts + 26483, + 1: __ccgo_ts + 26536, + 2: __ccgo_ts + 26581, + 3: __ccgo_ts + 26633, + 4: __ccgo_ts + 26687, + 5: __ccgo_ts + 26732, + 6: __ccgo_ts + 26790, + 7: __ccgo_ts + 26845, } // C documentation @@ -179903,7 +173607,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27284, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179911,17 +173615,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27304, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27388, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179984,7 +173688,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -179998,13 +173702,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27547, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27553, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27637, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -180013,7 +173717,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27577, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27661, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180027,19 +173731,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27604, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -180062,7 +173766,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -180073,7 +173777,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -180089,8 +173793,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27583, - 1: __ccgo_ts + 27594, + 0: __ccgo_ts + 27667, + 1: __ccgo_ts + 27678, } // C documentation @@ -180148,21 +173852,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11393, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11447, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27607, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27691, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27613, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27697, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27617, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27701, int32(1)) goto _1 _1: ; @@ -180189,7 +173893,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27619, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27703, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180223,23 +173927,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -180292,7 +173979,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -180307,11 +173994,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4272 + v1 = __ccgo_ts + 4298 } else { v1 = __ccgo_ts + 1667 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27652, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27736, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -180345,7 +174032,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27659, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27743, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -180362,7 +174049,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27704, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27788, libc.VaList(bp+8, iNode)) } } return pRet @@ -180391,8 +174078,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27736, - 1: __ccgo_ts + 27790, + 0: __ccgo_ts + 27820, + 1: __ccgo_ts + 27874, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -180405,21 +174092,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27838 + v1 = __ccgo_ts + 27922 } else { - v1 = __ccgo_ts + 27846 + v1 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27855, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27939, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27838 + v2 = __ccgo_ts + 27922 } else { - v2 = __ccgo_ts + 27846 + v2 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27900, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27984, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180464,7 +174151,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27958, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28042, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180482,7 +174169,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28006, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28090, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180515,19 +174202,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28073, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28157, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28107, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28191, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28137, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180572,12 +174259,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28192, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28276, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28223, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28307, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180606,7 +174293,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28290, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28374, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180616,11 +174303,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26104, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26188, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28318, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28402, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -180636,8 +174323,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28349, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28356, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28433, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28440, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180664,7 +174351,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28364, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28448, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180715,13 +174402,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28383, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28467, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6715 + zDb = __ccgo_ts + 6740 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180730,7 +174417,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18617 + v1 = __ccgo_ts + 18718 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180824,14 +174511,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180856,16 +174535,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180997,7 +174666,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -181042,7 +174711,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && int32(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -181104,7 +174773,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -181472,7 +175141,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -181487,9 +175156,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -181574,7 +175243,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -181648,13 +175317,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181715,7 +175377,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181754,7 +175416,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181858,7 +175520,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181889,36 +175551,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181942,7 +175574,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -182226,7 +175858,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -182383,7 +176015,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -182395,13 +176027,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27547, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28507, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28591, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -182410,13 +176042,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28529, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28613, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27604, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182424,7 +176056,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -182439,7 +176071,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182651,7 +176283,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16850 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16951 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -182661,7 +176293,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28533 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28617 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182669,7 +176301,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28539 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28623 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182789,7 +176421,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28548, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28632, 0) } goto geopoly_update_end } @@ -182889,16 +176521,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28588) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28672) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28604) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28688) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182968,7 +176600,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28781, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28865, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182982,61 +176614,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28619, + FzName: __ccgo_ts + 28703, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28716, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28645, + FzName: __ccgo_ts + 28729, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28658, + FzName: __ccgo_ts + 28742, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28604, + FzName: __ccgo_ts + 28688, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28670, + FzName: __ccgo_ts + 28754, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28588, + FzName: __ccgo_ts + 28672, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28693, + FzName: __ccgo_ts + 28777, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28707, + FzName: __ccgo_ts + 28791, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28720, + FzName: __ccgo_ts + 28804, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28734, + FzName: __ccgo_ts + 28818, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28750, + FzName: __ccgo_ts + 28834, }, } @@ -183062,7 +176694,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28846, }, } @@ -183087,20 +176719,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28789, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28873, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28799, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28883, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28810, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28894, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28533, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28617, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28821, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28905, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183174,7 +176806,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -183202,17 +176834,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26090, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26174, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -183220,33 +176854,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -183443,7 +177081,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183864,248 +177502,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -184419,7 +177815,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28831, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184429,7 +177825,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28831, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184455,7 +177851,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -184478,7 +177874,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -184610,7 +178006,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28852, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28936, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184699,7 +178095,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26003, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26087, zIn, uint64(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184736,13 +178132,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29023 + v1 = __ccgo_ts + 29107 } else { v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29064, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29148, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29214) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29298) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184909,7 +178305,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184970,7 +178366,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29339, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29423, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184980,7 +178376,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29458, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29542, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184988,7 +178384,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29479, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29563, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -185000,7 +178396,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29530, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29614, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -185044,7 +178440,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29551, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185057,7 +178453,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29579, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -185110,7 +178506,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20125, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20226, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185121,7 +178517,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29608, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -185132,7 +178528,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29627, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29711, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -185140,7 +178536,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29632, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29716, zName) { bRbuRowid = int32(1) } } @@ -185154,17 +178550,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29642 + v4 = __ccgo_ts + 29726 } else { - v4 = __ccgo_ts + 29655 + v4 = __ccgo_ts + 29739 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29664, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29748, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29693, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29777, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185186,7 +178582,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29715, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29799, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -185232,8 +178628,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29742, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29826, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -185267,7 +178663,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29751, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29835, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185315,21 +178711,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29764, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29848, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29796, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15149, __ccgo_ts+29819) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29825, __ccgo_ts+29832, __ccgo_ts+5175) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15149, __ccgo_ts+1667) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+29903) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29909, __ccgo_ts+29916, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29840, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29924, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29882, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29966, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185381,7 +178777,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1667 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29579, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -185403,15 +178799,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29902 + zCol = __ccgo_ts + 29986 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29910, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29931, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29967, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15149 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30015, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15203 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185420,7 +178816,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29994, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30078, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { zSep = __ccgo_ts + 1667 iCol = 0 @@ -185437,15 +178833,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30042, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15149 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30126, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15203 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30049, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185503,7 +178899,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1667 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29579, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185512,7 +178908,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30061, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30145, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) zType = __ccgo_ts + 1667 } else { if iCid < 0 { @@ -185532,9 +178928,9 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29902 + zCol = __ccgo_ts + 29986 } else { - zCol = __ccgo_ts + 29632 + zCol = __ccgo_ts + 29716 } } zType = __ccgo_ts + 1141 @@ -185542,24 +178938,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30083, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29819 + v2 = __ccgo_ts + 29903 } else { v2 = __ccgo_ts + 1667 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30103, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30187, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30124, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30157, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30208, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30241, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15149 - zAnd = __ccgo_ts + 22234 + zCom = __ccgo_ts + 15203 + zAnd = __ccgo_ts + 22335 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185613,11 +179009,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30181, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30265, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30193, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30277, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15149 + zS = __ccgo_ts + 15203 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185629,7 +179025,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30202, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30286, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185655,7 +179051,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30217, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { zSep = __ccgo_ts + 1667 @@ -185665,15 +179061,15 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30231, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22234 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30315, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22335 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30243, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30327, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1667 i1 = 0 @@ -185683,8 +179079,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30293, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22234 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22335 } goto _2 _2: @@ -185707,7 +179103,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30306, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30390, 0) } // C documentation @@ -185749,16 +179145,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30293, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30332, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30416, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30362, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15149 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30446, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } } } @@ -185842,16 +179238,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30399 + zSep = __ccgo_ts + 30483 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29551, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16738) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16839) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29579, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } break } @@ -185862,16 +179258,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29819 + v1 = __ccgo_ts + 29903 } else { v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30412, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15149 + z = _rbuMPrintf(tls, p, __ccgo_ts+30496, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15203 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30423, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185917,7 +179313,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30427) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30511) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185925,7 +179321,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29579, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -185934,21 +179330,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30477, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30561, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29819 + v1 = __ccgo_ts + 29903 } else { v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30499, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15149 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30583, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15203 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30509, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30524, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30608, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185985,7 +179381,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1667 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185994,19 +179390,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1667 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30586 + zPk = __ccgo_ts + 30670 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30599 + v2 = __ccgo_ts + 30683 } else { v2 = __ccgo_ts + 1667 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30609, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15149 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30693, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15203 goto _1 _1: ; @@ -186015,17 +179411,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30636, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30720, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30643 + v3 = __ccgo_ts + 30727 } else { v3 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30658, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30742, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -186051,7 +179447,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30690, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30774, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186097,7 +179493,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30747) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30831) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -186266,7 +179662,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30813, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30897, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186283,18 +179679,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30833, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30917, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30898, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30982, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30934, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31018, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186309,26 +179705,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30968 + v2 = __ccgo_ts + 31052 } else { - v2 = __ccgo_ts + 30972 + v2 = __ccgo_ts + 31056 } v1 = v2 } else { v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30978, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31062, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31039, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31123, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30968 + v3 = __ccgo_ts + 31052 } else { - v3 = __ccgo_ts + 30972 + v3 = __ccgo_ts + 31056 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31100, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31184, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186347,8 +179743,8 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6726) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6722) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6751) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6747) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -186357,39 +179753,39 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { v4 = __ccgo_ts + 1667 } else { - v4 = __ccgo_ts + 31259 + v4 = __ccgo_ts + 31343 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31268 + v5 = __ccgo_ts + 31352 } else { v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31278, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31362, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31314, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31398, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { zRbuRowid = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31342 + zRbuRowid = __ccgo_ts + 31426 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31354 + v6 = __ccgo_ts + 31438 } else { v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31371, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31447, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31455, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31531, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31746, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31830, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186400,9 +179796,9 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31845 + v7 = __ccgo_ts + 31929 } else { - v7 = __ccgo_ts + 31855 + v7 = __ccgo_ts + 31939 } zRbuRowid1 = v7 } @@ -186415,14 +179811,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29902, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15149, __ccgo_ts+1667) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31866 + v8 = __ccgo_ts + 31950 } else { v8 = __ccgo_ts + 1667 } @@ -186432,11 +179828,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1667 } if zOrder != 0 { - v10 = __ccgo_ts + 23490 + v10 = __ccgo_ts + 23591 } else { v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31872, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31956, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186524,9 +179920,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31259 + zPrefix = __ccgo_ts + 31343 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31920, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32004, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -186553,7 +179949,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -186600,7 +179996,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31950, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32034, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -186659,27 +180055,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6715, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6715) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31980, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32064, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32008, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3487, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32092, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3513, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6715, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6740, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32026, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32110, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6715, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186712,10 +180108,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32092, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32176, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24833, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24934, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186731,14 +180127,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 32124 + v2 = __ccgo_ts + 32208 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1667 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32126, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6715), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32210, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186749,27 +180145,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32158, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32242, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32173, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32257, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32190, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32274, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32206, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32290, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32234, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32318, 0) } } @@ -186819,7 +180215,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186921,7 +180317,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186951,7 +180347,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -186994,12 +180390,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -187021,21 +180417,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6715, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6715, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6715, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6715, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -187052,7 +180448,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32287, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32371, 0) } // C documentation @@ -187069,13 +180465,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6715) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32312, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32319, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32396, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187207,7 +180603,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24390, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24491, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187343,7 +180739,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32326) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32410) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -187356,7 +180752,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32348, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187383,7 +180779,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32375, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32459, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -187419,9 +180815,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32535, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32619, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32550, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187444,9 +180840,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32570, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32654, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32595) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187457,10 +180853,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32703) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32787) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32768) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32852) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187478,7 +180874,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32812, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32896, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187505,8 +180901,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17823) - _rbuCopyPragma(tls, p, __ccgo_ts+16934) + _rbuCopyPragma(tls, p, __ccgo_ts+17924) + _rbuCopyPragma(tls, p, __ccgo_ts+17035) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187514,7 +180910,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32837, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32921, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187536,10 +180932,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15053, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15053, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187553,10 +180949,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -187626,7 +181022,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32865, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32949, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187649,10 +181045,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32312, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32396, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6715, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187674,7 +181070,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32890, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32974, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187721,7 +181117,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32901, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32985, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187766,11 +181162,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32973, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33057, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32987) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33071) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187779,7 +181175,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33044) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33128) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187827,7 +181223,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3864, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187859,7 +181255,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33118, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33202, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187881,17 +181277,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33150 + v3 = __ccgo_ts + 33234 } else { - v3 = __ccgo_ts + 33157 + v3 = __ccgo_ts + 33241 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33164, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33248, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15038, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15092, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187903,21 +181299,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17537) - _rbuCopyPragma(tls, p, __ccgo_ts+16949) + _rbuCopyPragma(tls, p, __ccgo_ts+17638) + _rbuCopyPragma(tls, p, __ccgo_ts+17050) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33196, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33280, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6715, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33212, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33296, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187995,7 +181391,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33236, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33320, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -188042,7 +181438,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31259, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31343, uint64(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -188070,16 +181466,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15053, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15053, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188089,7 +181485,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33244, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33328, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188190,32 +181586,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15053, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15053, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15038 + v1 = __ccgo_ts + 15092 } else { - v1 = __ccgo_ts + 33196 + v1 = __ccgo_ts + 33280 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33196, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33280, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188241,9 +181637,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -188315,7 +181713,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -188518,7 +181916,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -188569,14 +181967,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190152,7 +183489,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33339, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33423, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -190175,13 +183512,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33347 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33431 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33356 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33440 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33445 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190190,7 +183527,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -190279,12 +183616,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33371, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33455, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33526, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33610, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33540, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33624, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190361,7 +183698,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33555, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33639, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -190501,315 +183838,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -191562,7 +184590,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -191655,11 +184683,11 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11773, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33562, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33646, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) @@ -191668,7 +184696,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33692, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33776, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191694,10 +184722,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29902)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29986))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -191718,8 +184746,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29902) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29902, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29986) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29986, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191783,7 +184811,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191800,6 +184828,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191821,12 +184851,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11773, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -192116,10 +185146,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11393 + zSep = __ccgo_ts + 11447 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33722, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33806, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192131,8 +185161,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5145, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15149 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5171, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -192213,13 +185243,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -192711,14 +185734,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192786,8 +185801,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33729, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22234 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33813, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22335 if zRet == uintptr(0) { break } @@ -192816,8 +185831,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33763, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33804 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33847, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33888 if zRet == uintptr(0) { break } @@ -192828,7 +185843,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1787, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1813, 0) } return zRet } @@ -192839,12 +185854,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33809 + v1 = __ccgo_ts + 33893 } else { - v1 = __ccgo_ts + 6720 + v1 = __ccgo_ts + 6745 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33820, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192905,11 +185920,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15149 + v2 = __ccgo_ts + 15203 } else { v2 = __ccgo_ts + 1667 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33899, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33983, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -192937,7 +185952,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33918, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34002, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192966,17 +185981,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -192989,7 +186005,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -193000,18 +186018,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34059, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34090, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193037,7 +186081,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33975, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34111, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193085,7 +186129,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -193197,15 +186241,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -193369,7 +186415,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5207, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5233, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193669,12 +186715,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34002, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11773, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34006, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34030, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34039, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34084, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34138, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34166, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34175, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34220, bp) } else { i = 0 for { @@ -193682,17 +186728,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15149, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15149 + zSep = __ccgo_ts + 15203 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34098, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34234, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34102, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34238, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193706,7 +186752,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34129, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34265, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193827,7 +186873,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193841,14 +186887,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34171, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193917,8 +186963,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193943,18 +186989,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34191, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34327, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193978,28 +187024,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -194138,7 +187188,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -194153,9 +187203,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -194184,20 +187234,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -194209,13 +187263,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -194371,7 +187426,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194395,7 +187450,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194410,7 +187465,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194466,7 +187521,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194571,7 +187626,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194642,8 +187697,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194677,7 +187732,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194687,7 +187742,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194766,7 +187821,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195027,7 +188082,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -195104,7 +188159,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -195176,11 +188231,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -195192,8 +188247,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -195221,12 +188276,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -195234,9 +188293,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -195249,14 +188308,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -195280,29 +188331,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -195379,7 +188407,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11773) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11827) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195388,9 +188416,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34209, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34345, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34222, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34358, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195400,9 +188428,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34228, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15149 + zSep = __ccgo_ts + 15203 } goto _2 _2: @@ -195411,7 +188439,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1667 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195420,13 +188448,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34241, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34377, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34316, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22335 } goto _3 _3: @@ -195513,9 +188541,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34322, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34458, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195525,9 +188553,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34228, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22234 + zSep = __ccgo_ts + 22335 } goto _1 _1: @@ -195535,9 +188563,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34340, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34476, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33804, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+33888, bp) zSep = __ccgo_ts + 1667 i = 0 for { @@ -195547,16 +188575,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34316, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34348 + zSep = __ccgo_ts + 34484 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5175, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -195582,7 +188610,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6715, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6740, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -195605,16 +188633,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34353, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34489, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22240, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22341, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15149, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195622,19 +188650,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34371, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34507, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34382, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34518, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5175, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -195657,12 +188685,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11773, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11827, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34386) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34522) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34499) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34635) } return rc } @@ -195706,7 +188734,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195724,11 +188752,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195905,7 +188933,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -195929,7 +188957,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195944,7 +188972,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195995,7 +189023,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -196035,10 +189063,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -196076,11 +189104,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -196103,7 +189131,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -196122,7 +189150,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -196131,7 +189159,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -196141,10 +189169,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34643, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34779, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -196154,10 +189182,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34664, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34800, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196170,7 +189198,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -196197,7 +189225,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -196225,7 +189253,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -196257,15 +189285,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34683, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34819, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34709, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -196289,9 +189317,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -196301,7 +189329,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6715, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6740, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -196320,18 +189348,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34739, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34875, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34783, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34919, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34854, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34990, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11773) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11827) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196365,7 +189393,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -196374,7 +189402,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -196382,23 +189410,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34914, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35050, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34944, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34968, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34944, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35104, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196421,13 +189449,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -196436,11 +189468,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196448,10 +189484,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196459,37 +189501,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -196512,7 +189546,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196882,7 +189916,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -197065,7 +190099,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -197100,8 +190134,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -197120,9 +190154,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -197174,7 +190208,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -197210,11 +190244,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -197227,18 +190267,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -197246,13 +190288,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -197294,12 +190338,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -197307,27 +190357,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -197482,7 +190523,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -197590,8 +190631,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -197603,9 +190644,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -197679,21 +190720,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197799,6 +190844,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197844,24 +190890,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197920,99 +190954,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -198034,14 +190975,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -198053,29 +190986,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -198131,15 +191047,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -198161,14 +191068,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -198239,7 +191138,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198267,27 +191165,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -198318,7 +191207,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198854,14 +191743,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198872,16 +191753,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198933,10 +191804,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -199042,12 +191913,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -199122,7 +191993,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34996, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35132, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199478,7 +192349,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35024, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -199634,18 +192505,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199728,22 +192587,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199762,7 +192605,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35055, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35191, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199861,7 +192704,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35062 + zErr = __ccgo_ts + 35198 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199921,16 +192764,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199949,7 +192782,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -200116,7 +192949,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35112 + zErr = __ccgo_ts + 35248 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200298,15 +193131,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -200387,7 +193211,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -200479,13 +193303,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -200511,13 +193335,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35160 + z = __ccgo_ts + 35296 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35216 + z1 = __ccgo_ts + 35352 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200550,19 +193374,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35274, + FzFunc: __ccgo_ts + 35410, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35282, + FzFunc: __ccgo_ts + 35418, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35292, + FzFunc: __ccgo_ts + 35428, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35433, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200950,7 +193774,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -201037,21 +193861,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -201360,13 +194169,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -201426,7 +194228,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35313, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -201452,12 +194254,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35320, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35456, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35351, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35487, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201466,7 +194268,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35384, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35520, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201476,14 +194278,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35421, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35557, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35430, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35566, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201510,7 +194312,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35463, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201522,76 +194324,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35497, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35505, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35537, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35673, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35543, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35605, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35741, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35562, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35627, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35763, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35777, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35815, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35690, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35826, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35725, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35861, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35732, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35868, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5584, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5610, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8409, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17903, + FzName: __ccgo_ts + 18004, }, 2: { - FzName: __ccgo_ts + 35763, + FzName: __ccgo_ts + 35899, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201599,20 +194401,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35771, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35802, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35938, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35812, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35948, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35846, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35982, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201673,16 +194475,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35874) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16850) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35879, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36010) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16951) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35909) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36045) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35919, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36055, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201708,7 +194510,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35950, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201716,12 +194518,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35955, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36091, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35962, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36098, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } } goto _1 @@ -201737,9 +194539,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35977, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36113, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35970, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } goto _2 _2: @@ -201802,8 +194604,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35874) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35985, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36010) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201834,7 +194636,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36014, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201864,7 +194666,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36034, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36170, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201872,37 +194674,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36084, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36220, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36139, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36275, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35497 + zTail = __ccgo_ts + 35633 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35497 + zTail = __ccgo_ts + 35633 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36192 + zTail = __ccgo_ts + 36328 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36200, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36336, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16850, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16951, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201971,7 +194773,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36211, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36347, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -201980,16 +194782,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 15149 + v2 = __ccgo_ts + 15203 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36227, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36363, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36234, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35874)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36370, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36010)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202022,7 +194824,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -202032,9 +194834,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -202147,7 +194949,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36260) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36396) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202158,7 +194960,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36265) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36401) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202169,7 +194971,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36274) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202183,7 +194985,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36284) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36420) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202194,7 +194996,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36294) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36430) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202211,7 +195013,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36306) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36442) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202226,7 +195028,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35874) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36010) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202241,7 +195043,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36318) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36454) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202257,7 +195059,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36332) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36468) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202300,7 +195102,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36342 + zSelect = __ccgo_ts + 36478 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202320,7 +195122,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36374) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36510) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202331,7 +195133,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36382, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36518, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202396,112 +195198,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -202577,7 +195273,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36453, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, 0) return FTS5_EOF } goto _1 @@ -202588,7 +195284,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36473, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36609, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202603,13 +195299,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36504, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36640, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36507, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36643, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30968, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31052, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202653,7 +195349,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -203186,16 +195882,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -203220,14 +195906,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -204292,7 +196970,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204302,7 +196980,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204348,14 +197026,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -204408,12 +197078,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -204547,7 +197217,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -204587,15 +197257,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -204636,7 +197306,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -204674,8 +197344,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36511, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35024, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36647, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204695,10 +197365,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36516, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204732,7 +197405,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204782,7 +197455,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204833,7 +197506,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21237, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204860,7 +197533,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -204957,7 +197630,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36545, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36681, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205042,7 +197715,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -205055,7 +197728,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -205129,7 +197802,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -205155,11 +197828,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36598 + v2 = __ccgo_ts + 36734 } else { - v2 = __ccgo_ts + 36511 + v2 = __ccgo_ts + 36647 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36605, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36741, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205172,7 +197845,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36655, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36791, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205293,14 +197966,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -205316,7 +197981,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -205340,14 +198005,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -205649,7 +198306,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205712,67 +198369,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205910,7 +198507,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -206222,7 +198819,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -206654,9 +199251,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -206693,7 +199290,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206766,7 +199362,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206801,7 +199396,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206816,149 +199410,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206966,187 +199424,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -207326,7 +199604,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36708, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -207431,7 +199709,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36714, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36850, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207460,7 +199738,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36765, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36901, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207494,7 +199772,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36814, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -207572,7 +199850,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -207663,7 +199941,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36854, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36990, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207674,7 +199952,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36854, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36990, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -208355,7 +200633,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -208600,15 +200878,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208709,7 +200987,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -209315,7 +201593,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36882, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37018, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209404,7 +201682,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36966, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37102, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210051,7 +202329,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -210077,14 +202355,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -210094,15 +202364,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -210216,7 +202477,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -210237,7 +202498,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210961,7 +203222,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -211375,7 +203636,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37048, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37184, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211830,13 +204091,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211881,7 +204135,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37105, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -212050,7 +204304,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -212368,7 +204622,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37166, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -212643,7 +204897,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212678,7 +204932,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -212957,16 +205211,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -213184,7 +205428,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -213221,7 +205465,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -213232,70 +205476,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -213364,7 +205545,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -213463,14 +205644,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -213517,19 +205690,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -213608,7 +205768,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -213658,7 +205818,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213740,15 +205900,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1667, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213774,11 +205937,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37217, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37353, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26003, __ccgo_ts+37225, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26087, __ccgo_ts+37361, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11984, __ccgo_ts+37260, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12038, __ccgo_ts+37396, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213976,7 +206139,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -214231,7 +206394,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37304) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37440) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214582,7 +206745,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214704,7 +206867,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214824,7 +206987,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36708, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -215418,7 +207581,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37306, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37442, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -215649,7 +207812,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37392) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37528) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215788,7 +207951,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215843,87 +208005,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215931,96 +208012,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -216271,7 +208262,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37397, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37533, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216308,7 +208299,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5207, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -216327,7 +208318,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5207, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216777,7 +208768,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216805,7 +208796,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3864, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216825,7 +208816,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216840,7 +208831,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15149 + v1 = __ccgo_ts + 15203 } else { v1 = __ccgo_ts + 1667 } @@ -216850,11 +208841,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1667 } if bDesc != 0 { - v3 = __ccgo_ts + 37436 + v3 = __ccgo_ts + 37572 } else { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37577 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37445, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216912,14 +208903,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37500, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37636, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5566, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5592, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37506, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37642, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216969,7 +208960,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37534, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37670, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -217002,7 +208993,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37544, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37680, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217036,7 +209027,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37565, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37701, libc.VaList(bp+24, z)) } } } else { @@ -217044,7 +209035,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35292 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35428 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217201,7 +209192,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37598, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37734, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -217401,7 +209392,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37603, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37739, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -217534,10 +209525,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -220073,12 +212001,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38952, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39088, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39056, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39192, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39094, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39230, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220087,7 +212015,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39132, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39268, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220099,14 +212027,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26003, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11984, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38286, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26087, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12038, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38422, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36192, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36328, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35497, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35633, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220126,13 +212054,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30643 + v1 = __ccgo_ts + 30727 } else { v1 = __ccgo_ts + 1667 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39174, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39310, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39204, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39340, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220173,7 +212101,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39248, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39384, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220181,7 +212109,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39271, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39407, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220196,7 +212124,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39277, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39413, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220205,22 +212133,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35497, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35633, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39283 + zCols = __ccgo_ts + 39419 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39315 + zCols = __ccgo_ts + 39451 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36192, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36328, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38286, __ccgo_ts+39363, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38422, __ccgo_ts+39499, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36374, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220265,14 +212193,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -220342,14 +212262,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -220377,6 +212297,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -220389,11 +212310,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -220406,6 +212340,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -220640,12 +212575,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39380, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39516, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39430, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39566, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39459, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39595, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -220653,7 +212588,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36374, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220955,7 +212890,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39488, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39624, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220988,17 +212923,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -221085,7 +213009,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -221187,14 +213111,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35497, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35633, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221846,11 +213752,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39542 + zCat = __ccgo_ts + 39678 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221860,7 +213766,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39551) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221877,20 +213783,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39562) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*int8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39520) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39656) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39531) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39667) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39551) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -221926,7 +213832,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -222113,7 +214019,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -222141,14 +214047,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]int8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -222182,7 +214080,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39580 + zBase = __ccgo_ts + 39716 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222226,14 +214124,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -222244,16 +214134,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -222399,64 +214279,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39590, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39593, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39598, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39734, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39603, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39606, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39609, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39614, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39623, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39629, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222465,49 +214345,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39638, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39642, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39645, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39781, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39649, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39653, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39657, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39661, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39665, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39801, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222524,20 +214404,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39669, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39649, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39805, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39672, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39675, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39679, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39665, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39815, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222553,75 +214433,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39682, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39649, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39690, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39697, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39833, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39702, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39598, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39734, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39707, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39593, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39729, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39712, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39665, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39717, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16052, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16153, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39675, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39590, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39731, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39634, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39737, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39873, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39741, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39877, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39743, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39657, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222630,48 +214510,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39749, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39885, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39665, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39757, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39649, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39763, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39899, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39649, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39768, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39904, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39590, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39910, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39661, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39782, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39790, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39926, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39794, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39657, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222679,21 +214559,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39802, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39590, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39944, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39661, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39814, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39675, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222711,48 +214591,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39821, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39957, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39831, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39967, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39837, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39973, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39606, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39790, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39926, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39849, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39590, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222768,13 +214648,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39855, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39991, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39859, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39995, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222782,7 +214662,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39865, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222879,14 +214759,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222904,13 +214784,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222947,14 +214820,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39869) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40005) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39562) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222992,7 +214865,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -223120,7 +214993,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -223196,11 +215069,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -223222,7 +215095,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39884)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40020)) } // C documentation @@ -223248,7 +215121,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39580, + FzName: __ccgo_ts + 39716, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223256,7 +215129,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39892, + FzName: __ccgo_ts + 40028, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223264,7 +215137,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39884, + FzName: __ccgo_ts + 40020, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223294,7 +215167,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39898, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40034, pApi, bp+96, uintptr(0)) } return rc } @@ -228755,39 +220628,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228810,16 +220650,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39905) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40041) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39909) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40045) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39913) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40049) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39922, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40058, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228882,21 +220722,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39956, - 1: __ccgo_ts + 39996, - 2: __ccgo_ts + 40031, + 0: __ccgo_ts + 40092, + 1: __ccgo_ts + 40132, + 2: __ccgo_ts + 40167, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23979, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24080, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40074, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40210, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228917,23 +220758,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -229066,10 +220907,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40107, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40243, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40138, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40274, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -229088,7 +220929,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40189, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40325, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229538,7 +221379,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40215, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40351, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229593,15 +221434,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40225 + return __ccgo_ts + 40361 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229823,7 +221664,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229871,11 +221712,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go index 112b4cf..17ccb37 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm.go @@ -1,4 +1,4 @@ -// Code generated for linux/arm by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/arm -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/arm -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/arm -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/arm by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/arm -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/arm -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/arm -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && arm @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -135,6 +137,31 @@ const CLOCK_REALTIME_COARSE = 5 const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 +const CLONE_CHILD_CLEARTID = 2097152 +const CLONE_CHILD_SETTID = 16777216 +const CLONE_DETACHED = 4194304 +const CLONE_FILES = 1024 +const CLONE_FS = 512 +const CLONE_IO = 2147483648 +const CLONE_NEWCGROUP = 33554432 +const CLONE_NEWIPC = 134217728 +const CLONE_NEWNET = 1073741824 +const CLONE_NEWNS = 131072 +const CLONE_NEWPID = 536870912 +const CLONE_NEWTIME = 128 +const CLONE_NEWUSER = 268435456 +const CLONE_NEWUTS = 67108864 +const CLONE_PARENT = 32768 +const CLONE_PARENT_SETTID = 1048576 +const CLONE_PIDFD = 4096 +const CLONE_PTRACE = 8192 +const CLONE_SETTLS = 524288 +const CLONE_SIGHAND = 2048 +const CLONE_SYSVSEM = 262144 +const CLONE_THREAD = 65536 +const CLONE_UNTRACED = 8388608 +const CLONE_VFORK = 16384 +const CLONE_VM = 256 const COLFLAG_BUSY = 256 const COLFLAG_GENERATED = 96 const COLFLAG_HASCOLL = 512 @@ -161,6 +188,8 @@ const COLTYPE_INT = 3 const COLTYPE_INTEGER = 4 const COLTYPE_REAL = 5 const COLTYPE_TEXT = 6 +const CPU_SETSIZE = 1024 +const CSIGNAL = 255 const CURSOR_FAULT = 4 const CURSOR_INVALID = 1 const CURSOR_REQUIRESEEK = 3 @@ -1240,6 +1269,31 @@ const PTF_INTKEY = 1 const PTF_LEAF = 8 const PTF_LEAFDATA = 4 const PTF_ZERODATA = 2 +const PTHREAD_BARRIER_SERIAL_THREAD = -1 +const PTHREAD_CANCELED = -1 +const PTHREAD_CANCEL_ASYNCHRONOUS = 1 +const PTHREAD_CANCEL_DEFERRED = 0 +const PTHREAD_CANCEL_DISABLE = 1 +const PTHREAD_CANCEL_ENABLE = 0 +const PTHREAD_CANCEL_MASKED = 2 +const PTHREAD_CREATE_DETACHED = 1 +const PTHREAD_CREATE_JOINABLE = 0 +const PTHREAD_EXPLICIT_SCHED = 1 +const PTHREAD_INHERIT_SCHED = 0 +const PTHREAD_MUTEX_DEFAULT = 0 +const PTHREAD_MUTEX_ERRORCHECK = 2 +const PTHREAD_MUTEX_NORMAL = 0 +const PTHREAD_MUTEX_RECURSIVE = 1 +const PTHREAD_MUTEX_ROBUST = 1 +const PTHREAD_MUTEX_STALLED = 0 +const PTHREAD_ONCE_INIT = 0 +const PTHREAD_PRIO_INHERIT = 1 +const PTHREAD_PRIO_NONE = 0 +const PTHREAD_PRIO_PROTECT = 2 +const PTHREAD_PROCESS_PRIVATE = 0 +const PTHREAD_PROCESS_SHARED = 1 +const PTHREAD_SCOPE_PROCESS = 1 +const PTHREAD_SCOPE_SYSTEM = 0 const PTRMAP_BTREE = 5 const PTRMAP_FREEPAGE = 2 const PTRMAP_OVERFLOW1 = 3 @@ -1380,6 +1434,13 @@ const R_OK = 4 const SAVEPOINT_BEGIN = 0 const SAVEPOINT_RELEASE = 1 const SAVEPOINT_ROLLBACK = 2 +const SCHED_BATCH = 3 +const SCHED_DEADLINE = 6 +const SCHED_FIFO = 1 +const SCHED_IDLE = 5 +const SCHED_OTHER = 0 +const SCHED_RESET_ON_FORK = 1073741824 +const SCHED_RR = 2 const SCHEMA_ROOT = 1 const SEEK_DATA = 3 const SEEK_HOLE = 4 @@ -1499,6 +1560,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1738,6 +1800,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1948,6 +2011,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -1971,7 +2035,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 -const SQLITE_MUTEX_NOOP = 1 +const SQLITE_MUTEX_NREF = 0 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -2110,6 +2174,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2118,7 +2183,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2203,6 +2268,7 @@ const SQLITE_TESTCTRL_USELONGDOUBLE = 34 const SQLITE_TESTCTRL_VDBE_COVERAGE = 21 const SQLITE_TEXT = 3 const SQLITE_THREADSAFE = 1 +const SQLITE_THREADS_IMPLEMENTED = 1 const SQLITE_TOKEN_KEYWORD = 2 const SQLITE_TOKEN_QUOTED = 1 const SQLITE_TOOBIG = 18 @@ -2228,8 +2294,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3457,6 +3523,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3466,9 +3535,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3921,12 +3987,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -4055,29 +4115,380 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
      +**
    • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. +** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. +** +**
    • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
    • [[SQLITE_FCNTL_SIZE_LIMIT]] +** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that +** implements [sqlite3_deserialize()] to set an upper bound on the size +** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. +** If the integer pointed to is negative, then it is filled in with the +** current limit. Otherwise the limit is set to the larger of the value +** of the integer pointed to and the current database size. The integer +** pointed to is set to the new limit. +** +**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
    • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
    • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
    • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions super-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
    • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log ([WAL file]) and shared memory +** files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
    • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
    • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
    • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
    • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
    • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connection's busy-handler callback. The argument is of type (void**) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connection's +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
    • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
    • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
    • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
    • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
    • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
    • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
    • [[SQLITE_FCNTL_NULL_IO]] +** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor +** or file handle for the [sqlite3_file] object such that it will no longer +** read or write to the database file. +** +**
    • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
    • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
    • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
    • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
    • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS +** to block for up to M milliseconds before failing when attempting to +** obtain a file lock using the xLock or xShmLock methods of the VFS. +** The parameter is a pointer to a 32-bit signed integer that contains +** the value that M is to be set to. Before returning, the 32-bit signed +** integer is overwritten with the previous value of M. +** +**
    • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** +**
    • [[SQLITE_FCNTL_DATA_VERSION]] +** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +** a database file. The argument is a pointer to a 32-bit unsigned integer. +** The "data version" for the pager is written into the pointer. The +** "data version" changes whenever any change occurs to the corresponding +** database file, either through SQL statements on the same database +** connection or through transactions committed by separate database +** connections possibly in other processes. The [sqlite3_total_changes()] +** interface can be used to find if any database on the connection has changed, +** but that interface responds to changes on TEMP as well as MAIN and does +** not provide a mechanism to detect changes to MAIN only. Also, the +** [sqlite3_total_changes()] interface responds to internal changes only and +** omits changes made by other database connections. The +** [PRAGMA data_version] command provides a mechanism to detect changes to +** a single attached database that occur due to other database connections, +** but omits changes implemented by the database connection on which it is +** called. This file control is the only mechanism to detect changes that +** happen either internally or externally and that are associated with +** a particular attached database. +** +**
    • [[SQLITE_FCNTL_CKPT_START]] +** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint +** in wal mode before the client starts to copy pages from the wal +** file to the database file. +** +**
    • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. +** +**
    • [[SQLITE_FCNTL_EXTERNAL_READER]] +** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect +** whether or not there is a database client in another process with a wal-mode +** transaction open on the database or not. It is only available on unix.The +** (void*) argument passed with this file-control should be a pointer to a +** value of type (int). The integer value is set to 1 if the database is a wal +** mode database and there exists at least one client in another process that +** currently has an SQL transaction open on the database. It is set to 0 if +** the database is not a wal-mode db, or if there is no such connection in any +** other process. This opcode cannot be used to detect transactions opened +** by clients within the current process, only within other processes. +** +**
    • [[SQLITE_FCNTL_CKSM_FILE]] +** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the +** [checksum VFS shim] only. +** +**
    • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control +** purges the contents of the in-memory page cache. If there is an open +** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. +**
    + */ + +/* deprecated names */ + +// C documentation +// +// /* +// ** CAPI3REF: Mutex Handle +// ** +// ** The mutex module within SQLite defines [sqlite3_mutex] to be an +// ** abstract type for a mutex object. The SQLite core never looks +// ** at the internal representation of an [sqlite3_mutex]. It only +// ** deals with pointers to the [sqlite3_mutex] object. +// ** +// ** Mutexes are created using [sqlite3_mutex_alloc()]. +// */ +type Tsqlite3_mutex = struct { + Fmutex Tpthread_mutex_t +} + +type sqlite3_mutex = Tsqlite3_mutex // C documentation // @@ -4360,6 +4771,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4590,33 +5002,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4695,19 +5080,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4793,7 +5165,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4888,226 +5259,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - F__ccgo_align [0]uint32 - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - F__ccgo_align9 [4]byte - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - F__ccgo_align12 [4]byte - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5189,20 +5340,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5252,13 +5389,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5317,9 +5447,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5327,17 +5457,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5364,12 +5494,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5386,7 +5516,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5404,7 +5534,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5438,24 +5568,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5479,22 +5591,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5555,7 +5651,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5637,52 +5733,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - F__ccgo_align [0]uint32 - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr - F__ccgo_pad16 [4]byte -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6080,340 +6130,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6423,15 +6139,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6447,14 +6154,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6480,17 +6179,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6545,11 +6233,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6923,55 +6617,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint32 type size_t = Tsize_t @@ -7121,6 +6771,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7179,6 +6834,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7288,14 +6954,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7380,7 +7038,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7482,7 +7140,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7541,12 +7198,13 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 } FpTab uintptr - F__ccgo_pad3 [4]byte + F__ccgo_pad4 [4]byte } } @@ -7555,7 +7213,6 @@ type Expr = TExpr type TExprList = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList = TExprList @@ -7570,7 +7227,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7620,7 +7276,6 @@ type FuncDefHash = TFuncDefHash type TIdList = struct { FnId int32 - Fa [1]TIdList_item } type IdList = TIdList @@ -7650,7 +7305,7 @@ type TIndex = struct { FaAvgEq uintptr FaSample uintptr FaiRowEst uintptr - F__ccgo_align34 [4]byte + F__ccgo_align33 [4]byte FnRowEst0 TtRowcnt FcolNotIdxed TBitmask } @@ -7686,7 +7341,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7758,19 +7412,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo32 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7784,11 +7441,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7799,39 +7453,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -7845,23 +7501,26 @@ type TParseCleanup = struct { type ParseCleanup = TParseCleanup type TPreUpdate = struct { - F__ccgo_align [0]uint32 - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr + F__ccgo_align [0]uint32 + Fv uintptr + FpCsr uintptr + Fop int32 + FaRecord uintptr + FpKeyinfo uintptr + FpUnpacked uintptr + FpNewUnpacked uintptr + FiNewReg int32 + FiBlobWrite int32 + F__ccgo_align9 [4]byte + FiKey1 Ti64 + FiKey2 Ti64 + Foldipk TMem + FaNew uintptr + FpTab uintptr + FpPk uintptr + FapDflt uintptr + FkeyinfoSpace [20]Tu8 + F__ccgo_pad17 [4]byte } type PreUpdate = TPreUpdate @@ -7953,9 +7612,11 @@ type TSelect = struct { type Select = TSelect type TSQLiteThread = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr + Ftid Tpthread_t + Fdone int32 + FpOut uintptr + FxTask uintptr + FpIn uintptr } type SQLiteThread = TSQLiteThread @@ -8018,7 +7679,6 @@ type TSrcList = struct { F__ccgo_align [0]uint32 FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList = TSrcList @@ -8035,10 +7695,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -8073,6 +7729,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8259,7 +7916,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8301,7 +7957,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8479,9 +8134,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8614,56 +8269,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - F__ccgo_align [0]uint32 - FpKey uintptr - F__ccgo_align1 [4]byte - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 - F__ccgo_pad7 [4]byte -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8771,16 +8376,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8804,38 +8399,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8848,34 +8416,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -8889,92 +8433,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - F__ccgo_align [0]uint32 - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - F__ccgo_align8 [2]byte - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { F__ccgo_align [0]uint32 FpDirty uintptr @@ -8995,187 +8453,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9185,927 +8462,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - F__ccgo_align [0]uint32 - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - F__ccgo_align7 [4]byte - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - F__ccgo_align67 [4]byte - Fu1 struct { - F__ccgo_align [0]uint32 - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr - F__ccgo_pad97 [4]byte -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - F__ccgo_align [0]uint32 - FzName uintptr - F__ccgo_align1 [4]byte - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr - F__ccgo_pad4 [4]byte -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo4 uint8 - Faffinity uint8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - F__ccgo_align [0]uint32 - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - F__ccgo_align [0]uint32 - Fi [0]Ti64 - Fz uintptr - F__ccgo_pad2 [4]byte - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 - F__ccgo_pad10 [5]byte -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - F__ccgo_align [0]uint32 - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo56 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - F__ccgo_align34 [4]byte - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10130,614 +8486,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr uint8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - F__ccgo_pad3 [4]byte - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - F__ccgo_align [0]uint32 - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - F__ccgo_align [0]uint32 - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10747,317 +8495,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]uint8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - F__ccgo_align [0]uint32 - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11145,228 +8582,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]uint8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign uint8 - FisSpecial uint8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]uint8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -11510,10 +8725,10 @@ var _sqlite3azCompileOpt = [54]uintptr{ 47: __ccgo_ts + 1022, 48: __ccgo_ts + 1044, 49: __ccgo_ts + 1065, - 50: __ccgo_ts + 1076, - 51: __ccgo_ts + 1084, - 52: __ccgo_ts + 1098, - 53: __ccgo_ts + 1111, + 50: __ccgo_ts + 1080, + 51: __ccgo_ts + 1088, + 52: __ccgo_ts + 1102, + 53: __ccgo_ts + 1115, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -12344,12 +9559,12 @@ var _sqlite3StdTypeAffinity = [6]uint8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1124, - 1: __ccgo_ts + 1128, - 2: __ccgo_ts + 1133, - 3: __ccgo_ts + 1137, - 4: __ccgo_ts + 1145, - 5: __ccgo_ts + 1150, + 0: __ccgo_ts + 1128, + 1: __ccgo_ts + 1132, + 2: __ccgo_ts + 1137, + 3: __ccgo_ts + 1141, + 4: __ccgo_ts + 1149, + 5: __ccgo_ts + 1154, } /************** End of global.c **********************************************/ @@ -12432,27 +9647,26 @@ type Bool = TBool // // /* Opaque type used by code in vdbesort.c */ type TVdbeSorter = struct { - F__ccgo_align [0]uint32 - FmnPmaSize int32 - FmxPmaSize int32 - FmxKeysize int32 - Fpgsz int32 - FpReader uintptr - FpMerger uintptr - Fdb uintptr - FpKeyInfo uintptr - FpUnpacked uintptr - F__ccgo_align9 [4]byte - Flist TSorterList - FiMemory int32 - FnMemory int32 - FbUsePMA Tu8 - FbUseThreads Tu8 - FiPrev Tu8 - FnTask Tu8 - FtypeMask Tu8 - F__ccgo_align17 [3]byte - FaTask [1]TSortSubtask + F__ccgo_align [0]uint32 + FmnPmaSize int32 + FmxPmaSize int32 + FmxKeysize int32 + Fpgsz int32 + FpReader uintptr + FpMerger uintptr + Fdb uintptr + FpKeyInfo uintptr + FpUnpacked uintptr + F__ccgo_align9 [4]byte + Flist TSorterList + FiMemory int32 + FnMemory int32 + FbUsePMA Tu8 + FbUseThreads Tu8 + FiPrev Tu8 + FnTask Tu8 + FtypeMask Tu8 + F__ccgo_pad18 [3]byte } type VdbeSorter = TVdbeSorter @@ -12534,76 +9748,11 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 + F__ccgo_pad29 [4]byte } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - F__ccgo_align [0]uint32 - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - F__ccgo_align [0]uint32 - FpCValue uintptr - F__ccgo_align1 [4]byte - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 - F__ccgo_pad5 [4]byte -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12652,167 +9801,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - F__ccgo_align [0]uint32 - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - F__ccgo_align7 [4]byte - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - F__ccgo_align15 [4]byte - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - /* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -12838,18 +9831,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12866,104 +9847,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]uint8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - F__ccgo_align [0]uint32 - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - F__ccgo_align12 [4]byte - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - F__ccgo_align27 [4]byte - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo152 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - F__ccgo_align [0]uint32 - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -12985,13 +9868,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -13011,14 +9887,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -13097,7 +9966,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint32(libc.Uint32FromInt64(40)/libc.Uint32FromInt64(4)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13269,7 +10138,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*16))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(16)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(20)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13327,7 +10196,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13467,26 +10336,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - F__ccgo_align [0]uint32 - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD uint8 - FvalidYMD uint8 - FvalidHMS uint8 - FnFloor uint8 - F__ccgo44 uint8 - F__ccgo_pad17 [3]byte -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13617,7 +10466,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1155, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1159, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -13649,13 +10498,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1163, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1167, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1171, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -13663,7 +10512,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -13734,10 +10583,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(0) @@ -13805,7 +10654,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1179, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -13873,7 +10722,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) } } @@ -13906,14 +10755,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1187) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1198) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1195) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -13970,7 +10819,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -14117,7 +10966,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1208, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1212, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -14125,7 +10974,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) @@ -14203,7 +11052,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) @@ -14272,7 +11121,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1231) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1235) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -14287,7 +11136,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1236) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -14300,7 +11149,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1244) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1248) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(libc.Int32FromUint8((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -14315,7 +11164,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1250) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -14330,7 +11179,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1260) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1264) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -14347,11 +11196,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1270) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1274) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14360,7 +11209,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1280) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1284) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -14407,7 +11256,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1284, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1288, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -14437,8 +11286,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1293, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1191) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1198) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1297, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1195) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -14457,16 +11306,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1303) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1307) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1309) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1314) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { rc = 0 } } @@ -14508,10 +11357,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1318, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -14532,11 +11381,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1330, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1338, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1342, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -14574,7 +11423,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1163, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1167, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -14654,7 +11503,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -14811,7 +11660,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(16)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(17)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(18)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(19)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(20)] = uint8('.') @@ -14859,7 +11708,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(4)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(5)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(6)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(7)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(8)] = uint8('.') @@ -14964,7 +11813,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -15051,9 +11900,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if libc.Int32FromUint8(cf) == int32('d') { - v3 = __ccgo_ts + 1350 + v3 = __ccgo_ts + 1354 } else { - v3 = __ccgo_ts + 1355 + v3 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -15061,9 +11910,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+176, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1363, libc.VaList(bp+176, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1366, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -15073,17 +11922,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 72))).FvalidYMD = uint8(0) _computeYMD(tls, bp+72) if libc.Int32FromUint8(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY)) } case int32('H'): fallthrough case int32('k'): if libc.Int32FromUint8(cf) == int32('H') { - v4 = __ccgo_ts + 1350 + v4 = __ccgo_ts + 1354 } else { - v4 = __ccgo_ts + 1355 + v4 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -15097,50 +11946,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if libc.Int32FromUint8(cf) == int32('I') { - v5 = __ccgo_ts + 1350 + v5 = __ccgo_ts + 1354 } else { - v5 = __ccgo_ts + 1355 + v5 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+176, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1386, libc.VaList(bp+176, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+176, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if libc.Int32FromUint8(cf) == int32('p') { - v6 = __ccgo_ts + 1397 + v6 = __ccgo_ts + 1401 } else { - v6 = __ccgo_ts + 1400 + v6 = __ccgo_ts + 1404 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if libc.Int32FromUint8(cf) == int32('p') { - v7 = __ccgo_ts + 1403 + v7 = __ccgo_ts + 1407 } else { - v7 = __ccgo_ts + 1406 + v7 = __ccgo_ts + 1410 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1409, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1413, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1419, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1423, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1424, libc.VaList(bp+176, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+176, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1429, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -15150,18 +11999,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 120)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 120))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 120))).FvalidYMD = uint8(0) _computeYMD(tls, bp+120) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, _daysAfterJan01(tls, bp+120)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, _daysAfterJan01(tls, bp+120)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), uint8('%')) default: @@ -15317,7 +12166,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1444, libc.VaList(bp+128, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1448, libc.VaList(bp+128, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15350,55 +12199,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1250, + FzName: __ccgo_ts + 1254, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1270, + FzName: __ccgo_ts + 1274, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1478, + FzName: __ccgo_ts + 1482, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1483, + FzName: __ccgo_ts + 1487, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1488, + FzName: __ccgo_ts + 1492, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1497, + FzName: __ccgo_ts + 1501, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1506, + FzName: __ccgo_ts + 1510, }, 7: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1515, + FzName: __ccgo_ts + 1519, }, 8: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1528, + FzName: __ccgo_ts + 1532, }, 9: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1546, + FzName: __ccgo_ts + 1550, }, } @@ -15480,28 +12329,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15509,19 +12358,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15538,12 +12387,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15551,7 +12400,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15564,34 +12413,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15693,7 +12542,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -15904,14 +12753,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -15926,9 +12768,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -16069,7 +12911,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1559, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1563, libc.VaList(bp+8, nByte)) } return p } @@ -16131,7 +12973,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1597, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1601, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -16342,7 +13184,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16362,9 +13208,11 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld + _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) + _sqlite3MemoryBarrier(tls) return rc } @@ -16547,40 +13395,318 @@ func init() { *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_noopMutexLeave) } +type Tpthread_t = uintptr + +type pthread_t = Tpthread_t + +type Tpthread_once_t = int32 + +type pthread_once_t = Tpthread_once_t + +type Tpthread_key_t = uint32 + +type pthread_key_t = Tpthread_key_t + +type Tpthread_spinlock_t = int32 + +type pthread_spinlock_t = Tpthread_spinlock_t + +type Tpthread_mutexattr_t = struct { + F__attr uint32 +} + +type pthread_mutexattr_t = Tpthread_mutexattr_t + +type Tpthread_condattr_t = struct { + F__attr uint32 +} + +type pthread_condattr_t = Tpthread_condattr_t + +type Tpthread_barrierattr_t = struct { + F__attr uint32 +} + +type pthread_barrierattr_t = Tpthread_barrierattr_t + +type Tpthread_rwlockattr_t = struct { + F__attr [2]uint32 +} + +type pthread_rwlockattr_t = Tpthread_rwlockattr_t + +type Tsigset_t = struct { + F__bits [32]uint32 +} + +type sigset_t = Tsigset_t + +type t__sigset_t = Tsigset_t + +type Tpthread_attr_t = struct { + F__u struct { + F__vi [0][9]int32 + F__s [0][9]uint32 + F__i [9]int32 + } +} + +type pthread_attr_t = Tpthread_attr_t + +type Tpthread_mutex_t = struct { + F__u struct { + F__vi [0][6]int32 + F__p [0][6]uintptr + F__i [6]int32 + } + F__ccgo_room int32 +} + +type pthread_mutex_t = Tpthread_mutex_t + +type Tpthread_cond_t = struct { + F__u struct { + F__vi [0][12]int32 + F__p [0][12]uintptr + F__i [12]int32 + } +} + +type pthread_cond_t = Tpthread_cond_t + +type Tpthread_rwlock_t = struct { + F__u struct { + F__vi [0][8]int32 + F__p [0][8]uintptr + F__i [8]int32 + } +} + +type pthread_rwlock_t = Tpthread_rwlock_t + +type Tpthread_barrier_t = struct { + F__u struct { + F__vi [0][5]int32 + F__p [0][5]uintptr + F__i [5]int32 + } +} + +type pthread_barrier_t = Tpthread_barrier_t + +type Tsched_param = struct { + Fsched_priority int32 + F__reserved1 int32 + F__reserved2 [4]int32 + F__reserved3 int32 +} + +type sched_param = Tsched_param + +type Tcpu_set_t = struct { + F__bits [32]uint32 +} + +type cpu_set_t = Tcpu_set_t + +type t__ptcb = struct { + F__f uintptr + F__x uintptr + F__next uintptr +} + +/* +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +** intended for use only inside assert() statements. On some platforms, +** there might be race conditions that can cause these routines to +** deliver incorrect results. In particular, if pthread_equal() is +** not an atomic operation, then these routines might delivery +** incorrect results. On most platforms, pthread_equal() is a +** comparison of two integers and is therefore atomic. But we are +** told that HPUX is not such a platform. If so, then these routines +** will not always work correctly on HPUX. +** +** On those platforms where pthread_equal() is not atomic, SQLite +** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to +** make sure no assert() statements are evaluated and hence these +** routines are never called. + */ + +// C documentation +// +// /* +// ** Try to provide a memory barrier operation, needed for initialization +// ** and also for the implementation of xShmBarrier in the VFS in cases +// ** where SQLite is compiled without mutexes. +// */ +func _sqlite3MemoryBarrier(tls *libc.TLS) { + libc.X__sync_synchronize(tls) +} + +// C documentation +// +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ +func _pthreadMutexInit(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +func _pthreadMutexEnd(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. SQLite +// ** will unwind its stack and return an error. The argument +// ** to sqlite3_mutex_alloc() is one of these integer constants: +// ** +// **
      +// **
    • SQLITE_MUTEX_FAST +// **
    • SQLITE_MUTEX_RECURSIVE +// **
    • SQLITE_MUTEX_STATIC_MAIN +// **
    • SQLITE_MUTEX_STATIC_MEM +// **
    • SQLITE_MUTEX_STATIC_OPEN +// **
    • SQLITE_MUTEX_STATIC_PRNG +// **
    • SQLITE_MUTEX_STATIC_LRU +// **
    • SQLITE_MUTEX_STATIC_PMEM +// **
    • SQLITE_MUTEX_STATIC_APP1 +// **
    • SQLITE_MUTEX_STATIC_APP2 +// **
    • SQLITE_MUTEX_STATIC_APP3 +// **
    • SQLITE_MUTEX_STATIC_VFS1 +// **
    • SQLITE_MUTEX_STATIC_VFS2 +// **
    • SQLITE_MUTEX_STATIC_VFS3 +// **
    +// ** +// ** The first two constants cause sqlite3_mutex_alloc() to create +// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +// ** The mutex implementation does not need to make a distinction +// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +// ** not want to. But SQLite will only request a recursive mutex in +// ** cases where it really needs one. If a faster non-recursive mutex +// ** implementation is available on the host platform, the mutex subsystem +// ** might return such a mutex in response to SQLITE_MUTEX_FAST. +// ** +// ** The other allowed parameters to sqlite3_mutex_alloc() each return +// ** a pointer to a static preexisting mutex. Six static mutexes are +// ** used by the current version of SQLite. Future versions of SQLite +// ** may add additional static mutexes. Static mutexes are for internal +// ** use by SQLite only. Applications that use SQLite mutexes should +// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +// ** SQLITE_MUTEX_RECURSIVE. +// ** +// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +// ** returns a different mutex on every call. But for the static +// ** mutex types, the same mutex is returned on every call that has +// ** the same type number. +// */ +func _pthreadMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + var p uintptr + var _ /* recursiveAttr at bp+0 */ Tpthread_mutexattr_t + _ = p + switch iType { + case int32(SQLITE_MUTEX_RECURSIVE): + p = _sqlite3MallocZero(tls, uint64(28)) + if p != 0 { + libc.Xpthread_mutexattr_init(tls, bp) + libc.Xpthread_mutexattr_settype(tls, bp, int32(PTHREAD_MUTEX_RECURSIVE)) + libc.Xpthread_mutex_init(tls, p, bp) + libc.Xpthread_mutexattr_destroy(tls, bp) + } + case SQLITE_MUTEX_FAST: + p = _sqlite3MallocZero(tls, uint64(28)) + if p != 0 { + libc.Xpthread_mutex_init(tls, p, uintptr(0)) + } + default: + p = uintptr(unsafe.Pointer(&_staticMutexes)) + uintptr(iType-int32(2))*28 + break + } + return p +} + +var _staticMutexes = [12]Tsqlite3_mutex{} + +// C documentation +// +// /* +// ** This routine deallocates a previously +// ** allocated mutex. SQLite is careful to deallocate every +// ** mutex that it allocates. +// */ +func _pthreadMutexFree(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_destroy(tls, p) + Xsqlite3_free(tls, p) +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ +func _pthreadMutexEnter(tls *libc.TLS, p uintptr) { + /* Use the built-in recursive mutexes if they are available. + */ + libc.Xpthread_mutex_lock(tls, p) +} + +func _pthreadMutexTry(tls *libc.TLS, p uintptr) (r int32) { + var rc int32 + _ = rc + /* Use the built-in recursive mutexes if they are available. + */ + if libc.Xpthread_mutex_trylock(tls, p) == 0 { + rc = SQLITE_OK + } else { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* -// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation -// ** is used regardless of the run-time threadsafety setting. +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. // */ +func _pthreadMutexLeave(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_unlock(tls, p) +} + func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return _sqlite3NoopMutex(tls) + return uintptr(unsafe.Pointer(&_sMutex1)) } -/************** End of mutex_noop.c ******************************************/ -/************** Begin file mutex_unix.c **************************************/ -/* -** 2007 August 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement mutexes for pthreads - */ -/* #include "sqliteInt.h" */ +var _sMutex1 = Tsqlite3_mutex_methods{} -/* -** The code in this file is only used if we are compiling threadsafe -** under unix with pthreads. -** -** Note that this implementation requires a version of pthreads that -** supports recursive mutexes. - */ +func init() { + p := unsafe.Pointer(&_sMutex1) + *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_pthreadMutexInit) + *(*uintptr)(unsafe.Add(p, 4)) = __ccgo_fp(_pthreadMutexEnd) + *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_pthreadMutexAlloc) + *(*uintptr)(unsafe.Add(p, 12)) = __ccgo_fp(_pthreadMutexFree) + *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_pthreadMutexEnter) + *(*uintptr)(unsafe.Add(p, 20)) = __ccgo_fp(_pthreadMutexTry) + *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_pthreadMutexLeave) +} /************** End of mutex_unix.c ******************************************/ /************** Begin file mutex_w32.c ***************************************/ @@ -16675,6 +13801,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16682,8 +13810,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17502,7 +14630,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -17670,17 +14798,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: uint8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: uint8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: uint8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: uint8('c'), @@ -17877,22 +15005,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(128) defer tls.Free(128) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 uint8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 uint8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]uint8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -17924,7 +15053,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1647, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1651, int32(1)) break } /* Find out what flags are present */ @@ -18141,11 +15270,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18339,9 +15468,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1649 + v57 = __ccgo_ts + 1653 } else { - v57 = __ccgo_ts + 1654 + v57 = __ccgo_ts + 1658 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -18352,7 +15481,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1658, uint32(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1662, uint32(5)) bufpt = bp if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -18622,29 +15751,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = uint8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(3)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18685,7 +15792,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1663 + bufpt = __ccgo_ts + 1667 } else { if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -18759,25 +15866,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = libc.Uint8FromInt32(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1664 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1668 } else { - v98 = __ccgo_ts + 1669 + v97 = __ccgo_ts + 1673 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = uint8('"') + flag_alternateform = uint8(0) + } else { + q = uint8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18785,15 +15896,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && libc.Int32FromUint8(v101) != 0) { + if !(v101 && libc.Int32FromUint8(v100) != 0) { break } if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { @@ -18804,13 +15915,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18824,35 +15968,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1680, uint32(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = uint8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v108 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if libc.Int32FromUint8(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = uint8('\\') + } else { + if libc.Int32FromUint8(ch1) <= int32(0x1f) { + *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = uint8('\\') + v110 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v110))) = uint8('u') + v111 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v111))) = uint8('0') + v112 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v112))) = uint8('0') + v113 = j1 + j1++ + if libc.Int32FromUint8(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v113))) = libc.Uint8FromInt32(v114) + v115 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v119 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v120))) = uint8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v121))) = uint8(')') + } } *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1))) = uint8(0) length = int32(j1) @@ -18877,9 +16084,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18893,7 +16100,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 44)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 44))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1676, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18903,21 +16110,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 44)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1678, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1688, libc.VaList(bp+120, *(*Tu32)(unsafe.Pointer(pItem + 32)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+120, *(*Tu32)(unsafe.Pointer(pItem + 32)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1709, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1739, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -19156,7 +16363,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, (*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1)) p1 = p + 21 @@ -19192,7 +16399,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -19455,6 +16662,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19472,11 +16681,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(240) - defer tls.Free(240) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+24 */ [210]uint8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(210), 0) + var _ /* zMsg at bp+24 */ [700]uint8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -19910,76 +17119,34 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint32(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr - _ = p + var rc int32 + _, _ = p, rc + /* This routine is never used in single-threaded mode */ *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) - p = _sqlite3Malloc(tls, uint64(12)) + p = _sqlite3Malloc(tls, uint64(20)) if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if int32(p)/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask - (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + libc.Xmemset(tls, p, 0, uint32(20)) + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + ** function that returns SQLITE_ERROR when passed the argument 200, that + ** forces worker threads to run sequentially and deterministically + ** for testing purposes. */ + if _sqlite3FaultSim(tls, int32(200)) != 0 { + rc = int32(1) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) + } + if rc != 0 { + (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -19989,18 +17156,32 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui // // /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) (r int32) { + var rc, v1 int32 + _, _ = rc, v1 if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask != 0 { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TSQLiteThread)(unsafe.Pointer(p)).FxTask})))(tls, (*TSQLiteThread)(unsafe.Pointer(p)).FpIn) + if (*TSQLiteThread)(unsafe.Pointer(p)).Fdone != 0 { + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpOut + rc = SQLITE_OK } else { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpResult + if libc.Xpthread_join(tls, (*TSQLiteThread)(unsafe.Pointer(p)).Ftid, ppOut) != 0 { + v1 = int32(SQLITE_ERROR) + } else { + v1 = SQLITE_OK + } + rc = v1 } Xsqlite3_free(tls, p) - return SQLITE_OK + return rc } +/******************************** End Unix Pthreads *************************/ + +/********************************* Win32 Threads ****************************/ +/******************************** End Win32 Threads *************************/ + +/********************************* Single-Threaded **************************/ /****************************** End Single-Threaded *************************/ /************** End of threads.c *********************************************/ @@ -20110,6 +17291,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*uint8)(unsafe.Pointer(zOut)) = uint8(v & libc.Uint32FromInt32(0xff)) + return int32(1) + } + if v < uint32(0x00800) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 3)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20860,7 +18072,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 116 + v2 = p + 104 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -21035,7 +18247,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1723, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1753, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21247,11 +18459,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint32(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -21487,7 +18699,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -21577,7 +18789,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1748 + pow63 = __ccgo_ts + 1778 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21804,7 +19016,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1767)) + n = libc.Int32FromUint32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -21964,7 +19176,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1783 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -22073,7 +19285,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 16 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22489,7 +19701,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1785, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1815, libc.VaList(bp+8, zType)) } // C documentation @@ -22512,13 +19724,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1664) + _logBadConnection(tls, __ccgo_ts+1668) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1830) + _logBadConnection(tls, __ccgo_ts+1860) } return 0 } else { @@ -22532,7 +19744,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1839) + _logBadConnection(tls, __ccgo_ts+1869) return 0 } else { return int32(1) @@ -22563,7 +19775,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -22914,23 +20126,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = *(*uint8)(unsafe.Pointer(v2)) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*uint8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))) h *= uint32(0x9e3779b1) } return h @@ -22985,8 +20195,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if new_size*uint32(8) > uint32(SQLITE_MALLOC_SOFT_LIMIT) { new_size = libc.Uint32FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint32FromInt64(8) } @@ -23019,9 +20229,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*8, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*8, elem) goto _2 _2: ; @@ -23041,13 +20250,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -23055,7 +20263,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -23071,7 +20279,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -23083,7 +20291,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -23132,7 +20340,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -23142,20 +20350,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(16)) + new_elem = _sqlite3Malloc(tls, uint64(20)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*8 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 } else { v1 = uintptr(0) } @@ -23174,196 +20381,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1847, - 1: __ccgo_ts + 1857, - 2: __ccgo_ts + 1868, - 3: __ccgo_ts + 1880, - 4: __ccgo_ts + 1891, - 5: __ccgo_ts + 1903, - 6: __ccgo_ts + 1910, - 7: __ccgo_ts + 1918, - 8: __ccgo_ts + 1926, - 9: __ccgo_ts + 1931, - 10: __ccgo_ts + 1936, - 11: __ccgo_ts + 1942, - 12: __ccgo_ts + 1956, - 13: __ccgo_ts + 1962, - 14: __ccgo_ts + 1972, - 15: __ccgo_ts + 1977, - 16: __ccgo_ts + 1982, - 17: __ccgo_ts + 1985, - 18: __ccgo_ts + 1991, - 19: __ccgo_ts + 1998, - 20: __ccgo_ts + 2002, - 21: __ccgo_ts + 2012, - 22: __ccgo_ts + 2019, - 23: __ccgo_ts + 2026, - 24: __ccgo_ts + 2033, - 25: __ccgo_ts + 2040, - 26: __ccgo_ts + 2050, - 27: __ccgo_ts + 2059, - 28: __ccgo_ts + 2070, - 29: __ccgo_ts + 2079, - 30: __ccgo_ts + 2085, - 31: __ccgo_ts + 2095, - 32: __ccgo_ts + 2105, - 33: __ccgo_ts + 2110, - 34: __ccgo_ts + 2124, - 35: __ccgo_ts + 2135, - 36: __ccgo_ts + 2140, - 37: __ccgo_ts + 2147, - 38: __ccgo_ts + 2158, - 39: __ccgo_ts + 2163, - 40: __ccgo_ts + 2168, - 41: __ccgo_ts + 2174, - 42: __ccgo_ts + 2180, - 43: __ccgo_ts + 2186, - 44: __ccgo_ts + 2189, - 45: __ccgo_ts + 2193, - 46: __ccgo_ts + 2199, - 47: __ccgo_ts + 2210, - 48: __ccgo_ts + 2221, - 49: __ccgo_ts + 2229, - 50: __ccgo_ts + 2238, - 51: __ccgo_ts + 2244, - 52: __ccgo_ts + 2251, - 53: __ccgo_ts + 2259, - 54: __ccgo_ts + 2262, - 55: __ccgo_ts + 2265, - 56: __ccgo_ts + 2268, - 57: __ccgo_ts + 2271, - 58: __ccgo_ts + 2274, - 59: __ccgo_ts + 2277, - 60: __ccgo_ts + 2284, - 61: __ccgo_ts + 2294, - 62: __ccgo_ts + 2307, - 63: __ccgo_ts + 2318, - 64: __ccgo_ts + 2324, - 65: __ccgo_ts + 2331, - 66: __ccgo_ts + 2340, - 67: __ccgo_ts + 2349, - 68: __ccgo_ts + 2356, - 69: __ccgo_ts + 2369, - 70: __ccgo_ts + 2380, - 71: __ccgo_ts + 2385, - 72: __ccgo_ts + 2393, - 73: __ccgo_ts + 2399, - 74: __ccgo_ts + 2406, - 75: __ccgo_ts + 2418, - 76: __ccgo_ts + 2423, - 77: __ccgo_ts + 2432, - 78: __ccgo_ts + 2437, - 79: __ccgo_ts + 2446, - 80: __ccgo_ts + 2451, - 81: __ccgo_ts + 2456, - 82: __ccgo_ts + 2462, - 83: __ccgo_ts + 2470, - 84: __ccgo_ts + 2478, - 85: __ccgo_ts + 2488, - 86: __ccgo_ts + 2496, - 87: __ccgo_ts + 2503, - 88: __ccgo_ts + 2516, - 89: __ccgo_ts + 2521, - 90: __ccgo_ts + 2533, - 91: __ccgo_ts + 2541, - 92: __ccgo_ts + 2548, - 93: __ccgo_ts + 2559, - 94: __ccgo_ts + 2566, - 95: __ccgo_ts + 2573, - 96: __ccgo_ts + 2583, - 97: __ccgo_ts + 2592, - 98: __ccgo_ts + 2603, - 99: __ccgo_ts + 2609, - 100: __ccgo_ts + 2620, - 101: __ccgo_ts + 2630, - 102: __ccgo_ts + 2640, - 103: __ccgo_ts + 2649, - 104: __ccgo_ts + 2656, - 105: __ccgo_ts + 2662, - 106: __ccgo_ts + 2672, - 107: __ccgo_ts + 2683, - 108: __ccgo_ts + 2687, - 109: __ccgo_ts + 2696, - 110: __ccgo_ts + 2705, - 111: __ccgo_ts + 2712, - 112: __ccgo_ts + 2722, - 113: __ccgo_ts + 2729, - 114: __ccgo_ts + 2739, - 115: __ccgo_ts + 2747, - 116: __ccgo_ts + 2754, - 117: __ccgo_ts + 2768, - 118: __ccgo_ts + 2782, - 119: __ccgo_ts + 2790, - 120: __ccgo_ts + 2801, - 121: __ccgo_ts + 2814, - 122: __ccgo_ts + 2825, - 123: __ccgo_ts + 2831, - 124: __ccgo_ts + 2843, - 125: __ccgo_ts + 2852, - 126: __ccgo_ts + 2860, - 127: __ccgo_ts + 2869, - 128: __ccgo_ts + 2878, - 129: __ccgo_ts + 2885, - 130: __ccgo_ts + 2893, - 131: __ccgo_ts + 2900, - 132: __ccgo_ts + 2911, - 133: __ccgo_ts + 2925, - 134: __ccgo_ts + 2936, - 135: __ccgo_ts + 2944, - 136: __ccgo_ts + 2950, - 137: __ccgo_ts + 2958, - 138: __ccgo_ts + 2966, - 139: __ccgo_ts + 2976, - 140: __ccgo_ts + 2989, - 141: __ccgo_ts + 2999, - 142: __ccgo_ts + 3012, - 143: __ccgo_ts + 3021, - 144: __ccgo_ts + 3032, - 145: __ccgo_ts + 3040, - 146: __ccgo_ts + 3046, - 147: __ccgo_ts + 3058, - 148: __ccgo_ts + 3070, - 149: __ccgo_ts + 3078, - 150: __ccgo_ts + 3090, - 151: __ccgo_ts + 3103, - 152: __ccgo_ts + 3113, - 153: __ccgo_ts + 3123, - 154: __ccgo_ts + 3135, - 155: __ccgo_ts + 3140, - 156: __ccgo_ts + 3152, - 157: __ccgo_ts + 3162, - 158: __ccgo_ts + 3168, - 159: __ccgo_ts + 3178, - 160: __ccgo_ts + 3185, - 161: __ccgo_ts + 3197, - 162: __ccgo_ts + 3208, - 163: __ccgo_ts + 3216, - 164: __ccgo_ts + 3225, - 165: __ccgo_ts + 3234, - 166: __ccgo_ts + 3243, - 167: __ccgo_ts + 3250, - 168: __ccgo_ts + 3261, - 169: __ccgo_ts + 3274, - 170: __ccgo_ts + 3284, - 171: __ccgo_ts + 3291, - 172: __ccgo_ts + 3299, - 173: __ccgo_ts + 3308, - 174: __ccgo_ts + 3314, - 175: __ccgo_ts + 3321, - 176: __ccgo_ts + 3329, - 177: __ccgo_ts + 3337, - 178: __ccgo_ts + 3345, - 179: __ccgo_ts + 3355, - 180: __ccgo_ts + 3364, - 181: __ccgo_ts + 3375, - 182: __ccgo_ts + 3386, - 183: __ccgo_ts + 3397, - 184: __ccgo_ts + 3407, - 185: __ccgo_ts + 3413, - 186: __ccgo_ts + 3424, - 187: __ccgo_ts + 3435, - 188: __ccgo_ts + 3440, - 189: __ccgo_ts + 3448, + 0: __ccgo_ts + 1877, + 1: __ccgo_ts + 1887, + 2: __ccgo_ts + 1898, + 3: __ccgo_ts + 1910, + 4: __ccgo_ts + 1921, + 5: __ccgo_ts + 1933, + 6: __ccgo_ts + 1940, + 7: __ccgo_ts + 1948, + 8: __ccgo_ts + 1956, + 9: __ccgo_ts + 1961, + 10: __ccgo_ts + 1966, + 11: __ccgo_ts + 1972, + 12: __ccgo_ts + 1986, + 13: __ccgo_ts + 1992, + 14: __ccgo_ts + 2002, + 15: __ccgo_ts + 2007, + 16: __ccgo_ts + 2012, + 17: __ccgo_ts + 2015, + 18: __ccgo_ts + 2021, + 19: __ccgo_ts + 2028, + 20: __ccgo_ts + 2032, + 21: __ccgo_ts + 2042, + 22: __ccgo_ts + 2049, + 23: __ccgo_ts + 2056, + 24: __ccgo_ts + 2063, + 25: __ccgo_ts + 2070, + 26: __ccgo_ts + 2080, + 27: __ccgo_ts + 2089, + 28: __ccgo_ts + 2100, + 29: __ccgo_ts + 2109, + 30: __ccgo_ts + 2115, + 31: __ccgo_ts + 2125, + 32: __ccgo_ts + 2135, + 33: __ccgo_ts + 2140, + 34: __ccgo_ts + 2154, + 35: __ccgo_ts + 2165, + 36: __ccgo_ts + 2170, + 37: __ccgo_ts + 2177, + 38: __ccgo_ts + 2188, + 39: __ccgo_ts + 2193, + 40: __ccgo_ts + 2198, + 41: __ccgo_ts + 2204, + 42: __ccgo_ts + 2210, + 43: __ccgo_ts + 2216, + 44: __ccgo_ts + 2219, + 45: __ccgo_ts + 2223, + 46: __ccgo_ts + 2229, + 47: __ccgo_ts + 2240, + 48: __ccgo_ts + 2251, + 49: __ccgo_ts + 2259, + 50: __ccgo_ts + 2268, + 51: __ccgo_ts + 2274, + 52: __ccgo_ts + 2281, + 53: __ccgo_ts + 2289, + 54: __ccgo_ts + 2292, + 55: __ccgo_ts + 2295, + 56: __ccgo_ts + 2298, + 57: __ccgo_ts + 2301, + 58: __ccgo_ts + 2304, + 59: __ccgo_ts + 2307, + 60: __ccgo_ts + 2314, + 61: __ccgo_ts + 2324, + 62: __ccgo_ts + 2337, + 63: __ccgo_ts + 2348, + 64: __ccgo_ts + 2354, + 65: __ccgo_ts + 2361, + 66: __ccgo_ts + 2370, + 67: __ccgo_ts + 2379, + 68: __ccgo_ts + 2386, + 69: __ccgo_ts + 2399, + 70: __ccgo_ts + 2410, + 71: __ccgo_ts + 2415, + 72: __ccgo_ts + 2423, + 73: __ccgo_ts + 2429, + 74: __ccgo_ts + 2436, + 75: __ccgo_ts + 2448, + 76: __ccgo_ts + 2453, + 77: __ccgo_ts + 2462, + 78: __ccgo_ts + 2467, + 79: __ccgo_ts + 2476, + 80: __ccgo_ts + 2481, + 81: __ccgo_ts + 2486, + 82: __ccgo_ts + 2492, + 83: __ccgo_ts + 2500, + 84: __ccgo_ts + 2508, + 85: __ccgo_ts + 2518, + 86: __ccgo_ts + 2526, + 87: __ccgo_ts + 2533, + 88: __ccgo_ts + 2546, + 89: __ccgo_ts + 2551, + 90: __ccgo_ts + 2563, + 91: __ccgo_ts + 2571, + 92: __ccgo_ts + 2578, + 93: __ccgo_ts + 2589, + 94: __ccgo_ts + 2596, + 95: __ccgo_ts + 2603, + 96: __ccgo_ts + 2613, + 97: __ccgo_ts + 2622, + 98: __ccgo_ts + 2633, + 99: __ccgo_ts + 2639, + 100: __ccgo_ts + 2650, + 101: __ccgo_ts + 2660, + 102: __ccgo_ts + 2670, + 103: __ccgo_ts + 2679, + 104: __ccgo_ts + 2686, + 105: __ccgo_ts + 2692, + 106: __ccgo_ts + 2702, + 107: __ccgo_ts + 2713, + 108: __ccgo_ts + 2717, + 109: __ccgo_ts + 2726, + 110: __ccgo_ts + 2735, + 111: __ccgo_ts + 2742, + 112: __ccgo_ts + 2752, + 113: __ccgo_ts + 2759, + 114: __ccgo_ts + 2769, + 115: __ccgo_ts + 2777, + 116: __ccgo_ts + 2784, + 117: __ccgo_ts + 2798, + 118: __ccgo_ts + 2812, + 119: __ccgo_ts + 2820, + 120: __ccgo_ts + 2831, + 121: __ccgo_ts + 2844, + 122: __ccgo_ts + 2855, + 123: __ccgo_ts + 2861, + 124: __ccgo_ts + 2873, + 125: __ccgo_ts + 2882, + 126: __ccgo_ts + 2890, + 127: __ccgo_ts + 2899, + 128: __ccgo_ts + 2908, + 129: __ccgo_ts + 2915, + 130: __ccgo_ts + 2923, + 131: __ccgo_ts + 2930, + 132: __ccgo_ts + 2941, + 133: __ccgo_ts + 2955, + 134: __ccgo_ts + 2966, + 135: __ccgo_ts + 2974, + 136: __ccgo_ts + 2980, + 137: __ccgo_ts + 2988, + 138: __ccgo_ts + 2996, + 139: __ccgo_ts + 3006, + 140: __ccgo_ts + 3019, + 141: __ccgo_ts + 3029, + 142: __ccgo_ts + 3042, + 143: __ccgo_ts + 3051, + 144: __ccgo_ts + 3062, + 145: __ccgo_ts + 3070, + 146: __ccgo_ts + 3076, + 147: __ccgo_ts + 3088, + 148: __ccgo_ts + 3100, + 149: __ccgo_ts + 3108, + 150: __ccgo_ts + 3120, + 151: __ccgo_ts + 3133, + 152: __ccgo_ts + 3143, + 153: __ccgo_ts + 3153, + 154: __ccgo_ts + 3165, + 155: __ccgo_ts + 3170, + 156: __ccgo_ts + 3182, + 157: __ccgo_ts + 3192, + 158: __ccgo_ts + 3198, + 159: __ccgo_ts + 3208, + 160: __ccgo_ts + 3215, + 161: __ccgo_ts + 3227, + 162: __ccgo_ts + 3238, + 163: __ccgo_ts + 3246, + 164: __ccgo_ts + 3255, + 165: __ccgo_ts + 3264, + 166: __ccgo_ts + 3273, + 167: __ccgo_ts + 3280, + 168: __ccgo_ts + 3291, + 169: __ccgo_ts + 3304, + 170: __ccgo_ts + 3314, + 171: __ccgo_ts + 3321, + 172: __ccgo_ts + 3329, + 173: __ccgo_ts + 3338, + 174: __ccgo_ts + 3344, + 175: __ccgo_ts + 3351, + 176: __ccgo_ts + 3359, + 177: __ccgo_ts + 3367, + 178: __ccgo_ts + 3375, + 179: __ccgo_ts + 3385, + 180: __ccgo_ts + 3394, + 181: __ccgo_ts + 3405, + 182: __ccgo_ts + 3416, + 183: __ccgo_ts + 3427, + 184: __ccgo_ts + 3437, + 185: __ccgo_ts + 3443, + 186: __ccgo_ts + 3454, + 187: __ccgo_ts + 3465, + 188: __ccgo_ts + 3470, + 189: __ccgo_ts + 3478, } type Tregister_t = int32 @@ -23446,97 +20653,6 @@ type Tuseconds_t = uint32 type useconds_t = Tuseconds_t -type Tpthread_t = uintptr - -type pthread_t = Tpthread_t - -type Tpthread_once_t = int32 - -type pthread_once_t = Tpthread_once_t - -type Tpthread_key_t = uint32 - -type pthread_key_t = Tpthread_key_t - -type Tpthread_spinlock_t = int32 - -type pthread_spinlock_t = Tpthread_spinlock_t - -type Tpthread_mutexattr_t = struct { - F__attr uint32 -} - -type pthread_mutexattr_t = Tpthread_mutexattr_t - -type Tpthread_condattr_t = struct { - F__attr uint32 -} - -type pthread_condattr_t = Tpthread_condattr_t - -type Tpthread_barrierattr_t = struct { - F__attr uint32 -} - -type pthread_barrierattr_t = Tpthread_barrierattr_t - -type Tpthread_rwlockattr_t = struct { - F__attr [2]uint32 -} - -type pthread_rwlockattr_t = Tpthread_rwlockattr_t - -type Tpthread_attr_t = struct { - F__u struct { - F__vi [0][9]int32 - F__s [0][9]uint32 - F__i [9]int32 - } -} - -type pthread_attr_t = Tpthread_attr_t - -type Tpthread_mutex_t = struct { - F__u struct { - F__vi [0][6]int32 - F__p [0][6]uintptr - F__i [6]int32 - } - F__ccgo_room int32 -} - -type pthread_mutex_t = Tpthread_mutex_t - -type Tpthread_cond_t = struct { - F__u struct { - F__vi [0][12]int32 - F__p [0][12]uintptr - F__i [12]int32 - } -} - -type pthread_cond_t = Tpthread_cond_t - -type Tpthread_rwlock_t = struct { - F__u struct { - F__vi [0][8]int32 - F__p [0][8]uintptr - F__i [8]int32 - } -} - -type pthread_rwlock_t = Tpthread_rwlock_t - -type Tpthread_barrier_t = struct { - F__u struct { - F__vi [0][5]int32 - F__p [0][5]uintptr - F__i [5]int32 - } -} - -type pthread_barrier_t = Tpthread_barrier_t - type Tu_int8_t = uint8 type u_int8_t = Tu_int8_t @@ -23609,14 +20725,6 @@ type Ttimeval = struct { type timeval = Ttimeval -type Tsigset_t = struct { - F__bits [32]uint32 -} - -type sigset_t = Tsigset_t - -type t__sigset_t = Tsigset_t - type Tfd_mask = uint32 type fd_mask = Tfd_mask @@ -23872,22 +20980,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -23920,32 +21012,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - F__ccgo_align [0]uint32 - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 - F__ccgo_pad19 [4]byte -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -24027,91 +21093,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3458, + FzName: __ccgo_ts + 3488, }, 1: { - FzName: __ccgo_ts + 3463, + FzName: __ccgo_ts + 3493, }, 2: { - FzName: __ccgo_ts + 3469, + FzName: __ccgo_ts + 3499, }, 3: { - FzName: __ccgo_ts + 3476, + FzName: __ccgo_ts + 3506, }, 4: { - FzName: __ccgo_ts + 3483, + FzName: __ccgo_ts + 3513, }, 5: { - FzName: __ccgo_ts + 3488, + FzName: __ccgo_ts + 3518, }, 6: { - FzName: __ccgo_ts + 3494, + FzName: __ccgo_ts + 3524, }, 7: { - FzName: __ccgo_ts + 3504, + FzName: __ccgo_ts + 3534, }, 8: { - FzName: __ccgo_ts + 3510, + FzName: __ccgo_ts + 3540, }, 9: { - FzName: __ccgo_ts + 3515, + FzName: __ccgo_ts + 3545, }, 10: { - FzName: __ccgo_ts + 3521, + FzName: __ccgo_ts + 3551, }, 11: { - FzName: __ccgo_ts + 3529, + FzName: __ccgo_ts + 3559, }, 12: { - FzName: __ccgo_ts + 3535, + FzName: __ccgo_ts + 3565, }, 13: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3572, }, 14: { - FzName: __ccgo_ts + 3551, + FzName: __ccgo_ts + 3581, }, 15: { - FzName: __ccgo_ts + 3558, + FzName: __ccgo_ts + 3588, }, 16: { - FzName: __ccgo_ts + 3568, + FzName: __ccgo_ts + 3598, }, 17: { - FzName: __ccgo_ts + 3575, + FzName: __ccgo_ts + 3605, }, 18: { - FzName: __ccgo_ts + 3589, + FzName: __ccgo_ts + 3619, }, 19: { - FzName: __ccgo_ts + 3595, + FzName: __ccgo_ts + 3625, }, 20: { - FzName: __ccgo_ts + 3601, + FzName: __ccgo_ts + 3631, }, 21: { - FzName: __ccgo_ts + 3608, + FzName: __ccgo_ts + 3638, }, 22: { - FzName: __ccgo_ts + 3616, + FzName: __ccgo_ts + 3646, }, 23: { - FzName: __ccgo_ts + 3621, + FzName: __ccgo_ts + 3651, }, 24: { - FzName: __ccgo_ts + 3628, + FzName: __ccgo_ts + 3658, }, 25: { - FzName: __ccgo_ts + 3635, + FzName: __ccgo_ts + 3665, }, 26: { - FzName: __ccgo_ts + 3647, + FzName: __ccgo_ts + 3677, }, 27: { - FzName: __ccgo_ts + 3656, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3662, + FzName: __ccgo_ts + 3692, }, } @@ -24172,7 +21238,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24210,10 +21276,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24350,9 +21416,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3668, libc.VaList(bp+160, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3698, libc.VaList(bp+160, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3711, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3741, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -24589,49 +21655,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - F__ccgo_align [0]uint32 - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr - F__ccgo_pad11 [4]byte -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24671,11 +21694,11 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint ** equivalent to errno. Otherwise, use strerror_r(). */ /* This is a threadsafe build, but strerror_r() is not available. */ - zErr = __ccgo_ts + 1663 + zErr = __ccgo_ts + 1667 if zPath == uintptr(0) { - zPath = __ccgo_ts + 1663 + zPath = __ccgo_ts + 1667 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3721, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3751, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24703,7 +21726,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3805, libc.VaList(bp+160, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+160, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3832, libc.VaList(bp+160, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+160, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25362,7 +22385,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25967,7 +22990,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]uint8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3860, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3890, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint32(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -25993,7 +23016,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3575, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3605, bp, int32(42579)) } // C documentation @@ -26030,7 +23053,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<= nSize { iWrite = nSize - int64(1) } - nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1663, int32(1)) + nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1667, int32(1)) if nWrite != int32(1) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(3)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 + return int32(libc.Xsysconf(tls, int32(_SC_PAGESIZE))) } -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26578,7 +23512,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26641,7 +23575,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -26872,9 +23806,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte break } *(*int32)(unsafe.Pointer(bp + 152)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1663, int32(1), bp+152) != int32(1) { + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1667, int32(1), bp+152) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27642,10 +24575,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3917, - 3: __ccgo_ts + 3926, - 4: __ccgo_ts + 3935, - 5: __ccgo_ts + 1676, + 2: __ccgo_ts + 3947, + 3: __ccgo_ts + 3956, + 4: __ccgo_ts + 3965, + 5: __ccgo_ts + 1706, } // C documentation @@ -27654,8 +24587,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3940) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3954) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3970) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3984) } // C documentation @@ -27717,7 +24650,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = uint8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3961, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3991, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -27889,7 +24822,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3978) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4008) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -28044,7 +24977,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3458, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3488, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -28121,7 +25054,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+152, libc.Uint32FromInt64(4098)-libc.Uint32FromInt32(2)) if got <= 0 || got >= libc.Int32FromInt64(4098)-libc.Int32FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3647, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3677, zIn, int32(45510)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 152)))[got] = uint8(0) @@ -28319,14 +25242,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+20, libc.Uint32FromInt64(4098)-libc.Uint32FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3476, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3506, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+20) } _appendAllPathElements(tls, bp, zPath) *(*uint8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = uint8(0) if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][125]Tu32 - FapSub [0][125]uintptr - FaBitmap [500]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -30133,7 +26895,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+12, uint32(500)) libc.Xmemset(tls, p+12, 0, uint32(500)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = ((*TBitvec)(unsafe.Pointer(p)).FiSize + (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4) - uint32(1)) / ((libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(4)) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / ((libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(4)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%((libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if (*TBitvec)(unsafe.Pointer(p)).FiDivisor < (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(1) * libc.Uint32FromInt32(BITVEC_SZELEM) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -30187,7 +26955,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if (*TBitvec)(unsafe.Pointer(p)).FiSize <= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { p1 = p + 12 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+12, uint32(500)) @@ -30306,7 +27074,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30360,7 +27128,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30394,68 +27162,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - F__ccgo_align [0]uint32 - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - F__ccgo_align3 [4]byte - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30629,14 +27335,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint32(56)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31452,123 +28158,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31649,7 +28238,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -31743,7 +28332,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -31784,7 +28373,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -31912,7 +28501,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -31932,17 +28521,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(uint32(4)*nNew)) + apNew = _sqlite3MallocZero(tls, uint64(4)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -31960,7 +28551,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4)) = pPage @@ -31972,7 +28563,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -32173,10 +28764,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint32(uint32(68) + uint32(52)*libc.Uint32FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint32(uint32(68) + uint32(52)*libc.Uint32FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*68 @@ -32765,25 +29357,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -33748,262 +30321,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - F__ccgo_align [0]uint32 - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - F__ccgo_align [0]uint32 - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - F__ccgo_align34 [4]byte - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]uint8 - FnMmapOut int32 - F__ccgo_align42 [4]byte - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -34102,7 +30419,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34331,7 +30648,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34349,7 +30666,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -34922,6 +31239,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35568,7 +31894,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 uint8 var _ /* exists at bp+8 */ int32 @@ -35580,7 +31907,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35601,11 +31928,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Uint8FromInt32(0) *(*uint8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35634,7 +31962,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -35867,7 +32195,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -36004,7 +32332,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -36020,7 +32348,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -36767,10 +33095,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 192 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37671,7 +33999,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37715,7 +34043,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -37746,7 +34074,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -37797,7 +34125,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(240)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(journalFileSize*int32(2))+uint32(__SIZEOF_POINTER__)+uint32(4)+libc.Uint32FromInt32(nPathname)+uint32(1)+libc.Uint32FromInt32(nUriByte)+libc.Uint32FromInt32(nPathname)+uint32(8)+uint32(1)+libc.Uint32FromInt32(nPathname)+uint32(4)+uint32(1)+uint32(3))) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(240)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint32FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -37832,7 +34160,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint32FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4143, uint32(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4173, uint32(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -37842,7 +34170,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint32FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4152, uint32(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4182, uint32(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -37884,8 +34212,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4157, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4164, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4187, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4194, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -37968,7 +34296,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38224,7 +34552,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38399,7 +34727,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38430,7 +34758,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38502,7 +34830,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+4) @@ -39859,7 +36187,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 28 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -40127,7 +36455,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4174, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4204, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40693,7 +37021,6 @@ type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { FiPrior Tu32 FnSegment int32 - FaSegment [1]TWalSegment } type WalIterator = TWalIterator @@ -40708,229 +37035,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - F__ccgo_align [0]uint32 - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 - F__ccgo_pad26 [4]byte -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -40949,28 +37053,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -41029,7 +37112,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint32(uint32(4) * libc.Uint32FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = int64(4) * (int64(1) + int64(iPage)) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -41130,6 +37213,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41397,14 +37481,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41571,7 +37647,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41659,7 +37735,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ @@ -41798,7 +37874,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42239,10 +38315,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42340,7 +38416,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42379,7 +38455,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42392,7 +38468,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42408,7 +38484,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42429,7 +38505,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42495,7 +38571,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42545,7 +38621,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4229, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4259, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -42760,7 +38836,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -42786,7 +38869,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43509,8 +39592,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43597,7 +39680,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -43743,7 +39826,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -43770,7 +39853,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -43779,6 +39862,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -43823,6 +39907,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -44095,7 +40182,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44276,7 +40363,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44285,7 +40372,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44337,14 +40424,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -44892,288 +40979,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - F__ccgo_align [0]uint32 - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 - F__ccgo_pad5 [4]byte -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - F__ccgo_align [0]uint32 - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - F__ccgo_align10 [4]byte - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr - F__ccgo_pad20 [4]byte -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45307,28 +41112,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - F__ccgo_align [0]uint32 - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45491,10 +41274,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45503,14 +41287,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -46210,11 +41994,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46388,7 +42172,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46401,12 +42185,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46450,7 +42234,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46458,7 +42242,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46646,7 +42430,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46679,7 +42463,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt32(int32(pIter)-int32(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46878,7 +42662,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint32(pCell) < uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint32(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -46918,12 +42702,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -46931,21 +42715,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint32FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -46992,12 +42776,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47013,7 +42797,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -47073,7 +42857,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47090,14 +42874,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -47140,11 +42924,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47158,7 +42942,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -47211,42 +42995,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47254,70 +43036,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47363,7 +43145,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47389,7 +43171,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47428,12 +43210,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47460,7 +43242,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47491,11 +43273,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47524,11 +43306,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47537,7 +43319,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47559,30 +43341,28 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr)) + libc.Xmemset(tls, data+uintptr(hdr), 0, (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr)) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt32(flags) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(libc.Uint8FromInt32(flags)) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint32(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint32(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47690,7 +43470,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -47752,7 +43532,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -47840,7 +43620,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4255) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4285) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48464,7 +44244,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48626,7 +44406,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4264, uint32(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4294, uint32(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48664,7 +44444,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 4)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 4)) @@ -49105,7 +44885,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49129,7 +44909,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -49138,7 +44918,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49152,7 +44932,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49182,7 +44962,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49278,7 +45058,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49316,7 +45096,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) if *(*TPgno)(unsafe.Pointer(bp + 16)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 20))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 20)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 16)), bCommit) @@ -49383,7 +45163,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49426,7 +45206,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49456,7 +45236,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49922,7 +45702,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50314,7 +46094,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50324,7 +46104,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50381,7 +46161,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50455,7 +46235,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50590,7 +46370,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50602,7 +46382,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+116, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 68 @@ -50718,7 +46498,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50732,7 +46512,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -50966,7 +46746,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -51050,7 +46830,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -51062,7 +46842,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51264,7 +47044,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51297,7 +47077,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 72 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51306,7 +47086,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+116, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 68 @@ -51435,7 +47215,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51545,7 +47325,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51633,7 +47413,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51688,7 +47468,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51714,7 +47494,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51741,7 +47521,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+8, 0) @@ -51812,7 +47592,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51950,7 +47730,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = pMemPage @@ -52001,7 +47781,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 8)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52010,7 +47790,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52100,7 +47880,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52118,7 +47898,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+4, bp) @@ -52141,7 +47921,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 4)), ovflPgno) } @@ -52362,10 +48142,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52656,17 +48436,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -52756,12 +48525,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint32(pCell) >= uint32(aData+uintptr(j)) && uint32(pCell) < uint32(pEnd) { if uint32(pCell+uintptr(sz)) > uint32(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int32(pCell)-int32(aData)) } else { if uint32(pCell+uintptr(sz)) > uint32(pSrcEnd) && uint32(pCell) < uint32(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -52769,7 +48538,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt32(int32(pData) - int32(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint32(sz)) i++ @@ -52864,7 +48633,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))+uintptr(sz)) > uint32(pEnd) && uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))) < uint32(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), libc.Uint32FromInt32(sz)) @@ -52945,7 +48714,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -52972,7 +48741,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -53012,7 +48781,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint32FromInt32(nCell*int32(2))) nCell -= nShift @@ -53083,7 +48852,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53128,7 +48897,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53324,10 +49093,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+60 */ [5]Tu8 @@ -53450,8 +49220,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint32(libc.Uint32FromInt32(nMaxCells)*uint32(4) + libc.Uint32FromInt32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint32FromInt32(nMaxCells)*uint32(4) + libc.Uint32FromInt32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53491,7 +49261,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53514,7 +49284,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2, 0, uint32(2)*libc.Uint32FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53645,7 +49415,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 36)))[k-int32(1)] = 0 @@ -53688,7 +49458,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -53747,7 +49517,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -53779,7 +49549,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54009,7 +49779,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 68 + 16 + uintptr(k)*4)) if uint32(pCell1) < uint32(pSrcEnd) && uint32(pCell1+uintptr(sz2)) > uint32(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54255,7 +50025,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54328,7 +50098,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(iPage-int32(1))*4)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 72 + uintptr(iPage-int32(1))*2))) @@ -54487,7 +50257,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54518,7 +50288,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54603,7 +50373,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54695,7 +50465,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54731,7 +50501,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -54761,10 +50531,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -54882,7 +50652,7 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { @@ -54897,14 +50667,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut + libc.Uint32FromInt32(int32(aOut)-int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + (int32(aOut) - int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 88)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55004,21 +50774,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55112,7 +50882,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -55222,7 +50992,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+4) if *(*TPgno)(unsafe.Pointer(bp + 4)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 4))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55263,7 +51033,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 8)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4)), bp+20, bp+24) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55344,14 +51114,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+4 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 4)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { return *(*int32)(unsafe.Pointer(bp + 4)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55488,7 +51258,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55753,7 +51523,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+48, __ccgo_ts+4268, int32(1)) + Xsqlite3_str_append(tls, pCheck+48, __ccgo_ts+4298, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+48, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -55801,11 +51571,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4270, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4300, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4293, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4323, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -55831,11 +51601,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4423, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4453, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -55907,11 +51677,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4462 + v2 = __ccgo_ts + 4492 } else { - v2 = __ccgo_ts + 4467 + v2 = __ccgo_ts + 4497 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4488, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4518, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -56047,12 +51817,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4514 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4544 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4532, libc.VaList(bp+48, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4562, libc.VaList(bp+48, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4686, libc.VaList(bp+48, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, libc.VaList(bp+48, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+16) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -56137,7 +51907,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4740, libc.VaList(bp+48, (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+48, (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -56160,7 +51930,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4764, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4794, 0) depth = d2 } } else { @@ -56237,7 +52007,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+12) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4789, libc.VaList(bp+48, *(*Tu32)(unsafe.Pointer(bp + 12))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4819, libc.VaList(bp+48, *(*Tu32)(unsafe.Pointer(bp + 12))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56251,7 +52021,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4826, libc.VaList(bp+48, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4856, libc.VaList(bp+48, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56342,7 +52112,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4878 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4908 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56366,11 +52136,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4889, libc.VaList(bp+208, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4919, libc.VaList(bp+208, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4934, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56407,10 +52177,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4989, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5019, libc.VaList(bp+208, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5009, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+208, i)) } goto _3 _3: @@ -56540,14 +52310,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -56758,45 +52528,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -56849,7 +52580,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3860, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -56859,7 +52590,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5041, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5071, libc.VaList(bp+296, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*16))).FpBt @@ -56888,7 +52619,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5061, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -56918,7 +52649,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5092, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5122, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57596,7 +53327,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5132, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+40, v1)) *(*uint8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = uint8(0) /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57734,9 +53465,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = uint8(0) @@ -57912,7 +53640,7 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 defer tls.Free(80) var _ /* ctx at bp+0 */ Tsqlite3_context var _ /* t at bp+32 */ TMem - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) libc.Xmemset(tls, bp+32, 0, uint32(40)) (*(*TMem)(unsafe.Pointer(bp + 32))).Fflags = uint16(MEM_Null) (*(*TMem)(unsafe.Pointer(bp + 32))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb @@ -57942,7 +53670,7 @@ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc bp := tls.Alloc(32) defer tls.Free(32) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58401,21 +54129,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58574,7 +54302,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58616,11 +54344,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58630,7 +54358,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58652,12 +54380,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58696,7 +54424,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -58808,8 +54536,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -58860,7 +54588,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -58868,8 +54597,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint32(uint32(40)*libc.Uint32FromInt32(nCol) + (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint32(uint32(40)*libc.Uint32FromInt32(nCol) + (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -58933,7 +54662,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -58972,14 +54701,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3860, libc.VaList(bp+40, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -59037,7 +54766,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1663 + zNeg = __ccgo_ts + 1667 rc = SQLITE_OK for { v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -59079,7 +54808,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5139 + zNeg = __ccgo_ts + 5169 } } } @@ -59094,7 +54823,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5141, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5171, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59398,7 +55127,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59414,7 +55143,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59424,7 +55153,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59475,9 +55204,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59551,7 +55280,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+104, 0, libc.Uint32FromInt64(232)-uint32(libc.UintptrFromInt32(0)+104)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 8 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 8 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 4 @@ -59885,12 +55614,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint32(uint32(32) + libc.Uint32FromInt32(nArg-libc.Int32FromInt32(1))*uint32(4)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+28)+libc.Uint32FromInt32(nArg)*libc.Uint32FromInt64(4))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -60064,7 +55792,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -60149,8 +55877,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -60163,11 +55891,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -60204,13 +55932,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*20))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60241,7 +55972,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -60743,7 +56474,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5146, libc.VaList(bp+32, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+32, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -60753,66 +56484,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5151) == 0 { - zColl = __ccgo_ts + 5158 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5181) == 0 { + zColl = __ccgo_ts + 5188 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5139 + v3 = __ccgo_ts + 5169 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5160 + v4 = __ccgo_ts + 5190 } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5163, libc.VaList(bp+32, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5193, libc.VaList(bp+32, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5187, libc.VaList(bp+32, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+32, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5203, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pOp + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5233, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pOp + 16)))) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1664 + zP4 = __ccgo_ts + 1668 } else { - zP4 = __ccgo_ts + 5206 + zP4 = __ccgo_ts + 5236 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5213, libc.VaList(bp+32, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5243, libc.VaList(bp+32, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -60827,20 +56558,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5221, libc.VaList(bp+32, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5251, libc.VaList(bp+32, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5226, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5256, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5228 + zP4 = __ccgo_ts + 5258 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5236, libc.VaList(bp+32, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5266, libc.VaList(bp+32, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -60854,10 +56585,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5173, - 1: __ccgo_ts + 5175, - 2: __ccgo_ts + 5177, - 3: __ccgo_ts + 5182, + 0: __ccgo_ts + 5203, + 1: __ccgo_ts + 5205, + 2: __ccgo_ts + 5207, + 3: __ccgo_ts + 5212, } // C documentation @@ -61675,7 +57406,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61683,7 +57414,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*40 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -61810,7 +57541,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5252, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5282, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -61818,18 +57549,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 4)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5264, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5294, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5278, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5308, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+8) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5293, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5323, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+4) @@ -62060,7 +57791,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63448,7 +59179,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 { @@ -63483,7 +59214,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 52)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63537,7 +59268,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 52))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63669,7 +59400,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -63821,7 +59552,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -63852,7 +59583,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64003,15 +59734,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*20 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5336 + zContext = __ccgo_ts + 5366 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5355 + zContext = __ccgo_ts + 5385 } else { - zContext = __ccgo_ts + 5374 + zContext = __ccgo_ts + 5404 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5383, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5413, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -64080,8 +59811,8 @@ func _vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { // ** the required value will be read from the row the cursor points to. // */ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 Ti64, iReg int32, iBlobWrite int32) { - bp := tls.Alloc(128) - defer tls.Free(128) + bp := tls.Alloc(144) + defer tls.Free(144) var db, zTbl uintptr var i, i1 int32 var iKey2, v1 Ti64 @@ -64089,7 +59820,7 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, _, _, _, _, _, _ = db, i, i1, iKey2, zTbl, v1 db = (*TVdbe)(unsafe.Pointer(v)).Fdb zTbl = (*TTable)(unsafe.Pointer(pTab)).FzName - libc.Xmemset(tls, bp, 0, uint32(128)) + libc.Xmemset(tls, bp, 0, uint32(136)) if libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0)) == 0 { v1 = libc.Int64FromInt32(0) iKey2 = v1 @@ -64106,10 +59837,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 112 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -64118,9 +59850,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+72) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+56) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -64200,7 +59932,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5419, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5449, 0) return int32(1) } else { return 0 @@ -64210,7 +59942,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5464, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5494, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64268,7 +60000,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64595,12 +60327,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64617,29 +60349,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64669,13 +60405,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64687,11 +60425,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -64699,23 +60441,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -64771,7 +60519,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5504, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5534, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -64972,7 +60720,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65102,7 +60850,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65271,6 +61019,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65284,7 +61034,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65322,13 +61072,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65562,18 +61312,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5527, - 1: __ccgo_ts + 5532, - 2: __ccgo_ts + 5539, - 3: __ccgo_ts + 5542, - 4: __ccgo_ts + 5545, - 5: __ccgo_ts + 5548, - 6: __ccgo_ts + 5551, - 7: __ccgo_ts + 5554, - 8: __ccgo_ts + 5562, - 9: __ccgo_ts + 5565, - 10: __ccgo_ts + 5572, - 11: __ccgo_ts + 5580, + 0: __ccgo_ts + 5557, + 1: __ccgo_ts + 5562, + 2: __ccgo_ts + 5569, + 3: __ccgo_ts + 5572, + 4: __ccgo_ts + 5575, + 5: __ccgo_ts + 5578, + 6: __ccgo_ts + 5581, + 7: __ccgo_ts + 5584, + 8: __ccgo_ts + 5592, + 9: __ccgo_ts + 5595, + 10: __ccgo_ts + 5602, + 11: __ccgo_ts + 5610, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -65828,14 +61578,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5587, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5617, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -65873,7 +61623,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -65883,7 +61633,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*40 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -65894,24 +61644,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -65959,7 +61713,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -65967,32 +61723,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66409,11 +62171,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66422,7 +62184,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 72 + v1 = p + 56 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66436,7 +62198,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 36)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+16, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66471,7 +62233,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 44))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, (*TColumn)(unsafe.Pointer(pCol)).Faffinity, bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*4)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66506,7 +62268,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66572,11 +62334,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66599,7 +62361,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+16, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66748,7 +62510,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5627, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5657, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(zRawSql)-int32(zStart)) } } else { @@ -66780,13 +62542,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*40 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1668, int32(4)) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1424, libc.VaList(bp+80, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1428, libc.VaList(bp+80, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5132, libc.VaList(bp+80, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5162, libc.VaList(bp+80, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -66801,28 +62563,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 32 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5631, libc.VaList(bp+80, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5661, libc.VaList(bp+80, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+32) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5638, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5668, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5651, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5681, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5654, libc.VaList(bp+80, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5684, libc.VaList(bp+80, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5659, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -66986,9 +62748,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*40 } else { @@ -67014,12 +62776,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint32((uint32(libc.UintptrFromInt32(0)+84)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint32FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nField) + libc.Uint32FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = uintptr(0) @@ -67028,28 +62788,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = v3 libc.Xmemset(tls, pCx, 0, uint32(libc.UintptrFromInt32(0)+32)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 84 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint32(libc.UintptrFromInt32(0)+84)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint32FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 36))) } return pCx @@ -67422,11 +63182,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1133, - 1: __ccgo_ts + 1145, - 2: __ccgo_ts + 1150, - 3: __ccgo_ts + 1128, - 4: __ccgo_ts + 1664, + 0: __ccgo_ts + 1137, + 1: __ccgo_ts + 1149, + 2: __ccgo_ts + 1154, + 3: __ccgo_ts + 1132, + 4: __ccgo_ts + 1668, } // C documentation @@ -67440,12 +63200,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(768) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity uint8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67462,7 +63222,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+512 */ Ti64 var _ /* nEntry at bp+80 */ Ti64 var _ /* nErr at bp+556 */ int32 - var _ /* nullFunc at bp+680 */ TFuncDef + var _ /* nullFunc at bp+676 */ TFuncDef var _ /* pVCur at bp+640 */ uintptr var _ /* pgno at bp+520 */ TPgno var _ /* r at bp+104 */ TUnpackedRecord @@ -68194,19 +63954,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+736, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+736, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5695, libc.VaList(bp+736, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5725, libc.VaList(bp+736, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5716, libc.VaList(bp+736, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5746, libc.VaList(bp+736, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = (int32(pOp) - int32(aOp)) / 20 - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5723, libc.VaList(bp+736, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5753, libc.VaList(bp+736, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69420,7 +65180,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69436,6 +65196,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -69929,7 +65695,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*20 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70032,7 +65798,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5747, libc.VaList(bp+736, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5775, libc.VaList(bp+736, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5861, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5889, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70628,7 +66394,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5915, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5943, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70658,12 +66424,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5970 + v250 = __ccgo_ts + 5998 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6018 + v251 = __ccgo_ts + 6046 } else { - v251 = __ccgo_ts + 6061 + v251 = __ccgo_ts + 6089 } v250 = v251 } @@ -70755,7 +66521,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6102) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6130) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -71073,7 +66839,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fz = __ccgo_ts + 1663 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fz = __ccgo_ts + 1667 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -71839,7 +67605,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 216)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 216)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+216, uint8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 216))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -71866,7 +67632,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 208)) if *(*int32)(unsafe.Pointer(bp + 208)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72325,7 +68091,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -72758,7 +68524,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+464, db, uint16(0)) @@ -73088,7 +68854,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 524)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(bp + 524)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(bp + 524)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 524))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -73119,13 +68885,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+152, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6147 + zSchema = __ccgo_ts + 6175 (*(*TInitData)(unsafe.Pointer(bp + 528))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 528))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 528))).FpzErrMsg = p + 124 (*(*TInitData)(unsafe.Pointer(bp + 528))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 528))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6161, libc.VaList(bp+736, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6189, libc.VaList(bp+736, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -73140,7 +68906,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73377,7 +69143,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 120 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6204, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6232, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73394,15 +69160,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(nMem)*uint32(40) + libc.Uint32FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4) + libc.Uint32FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(nMem)*uint32(40)+libc.Uint32FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4)) + (int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73483,11 +69249,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 536)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 528)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 528)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 536)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 64)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73699,7 +69465,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = uint64((libc.Uint32FromInt64(32) + libc.Uint32FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint32FromInt64(4) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + nAlloc = uint64((uint32(libc.UintptrFromInt32(0)+28) + libc.Uint32FromInt32(n4)*libc.Uint32FromInt64(4) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(40)) if pCtx == uintptr(0) { goto no_mem @@ -73749,7 +69515,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+736, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+736, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -73805,7 +69571,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+736, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+736, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -73884,11 +69650,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6241 + v286 = __ccgo_ts + 6269 } else { - v286 = __ccgo_ts + 6246 + v286 = __ccgo_ts + 6274 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6253, libc.VaList(bp+736, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6281, libc.VaList(bp+736, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -74041,7 +69807,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6305, libc.VaList(bp+736, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+736, z1)) } goto abort_due_to_error } @@ -74203,7 +69969,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6334, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6362, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74283,12 +70049,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 36)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+648, 0, uint32(32)) + libc.Xmemset(tls, bp+648, 0, uint32(28)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 680))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 680))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FpFunc = bp + 680 + (*(*TFuncDef)(unsafe.Pointer(bp + 676))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 676))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FpFunc = bp + 676 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74299,7 +70065,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 36)), bp+648, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+736, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+736, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74553,7 +70319,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+736, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+736, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+228, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74704,7 +70470,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+736, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+736, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -74791,15 +70557,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+4) @@ -75265,11 +71010,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3860 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+304, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+296, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+4) rc = _sqlite3ApiExit(tls, db, rc) @@ -75348,14 +71093,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75374,11 +71119,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75454,7 +71199,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75468,7 +71213,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3860 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -75748,111 +71493,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - F__ccgo_align [0]uint32 - FpFd uintptr - F__ccgo_align1 [4]byte - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - F__ccgo_align [0]uint32 - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - F__ccgo_align [0]uint32 - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - F__ccgo_align6 [4]byte - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - F__ccgo_align [0]uint32 - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - F__ccgo_align5 [4]byte - FiWriteOff Ti64 - FpFd uintptr - F__ccgo_pad7 [4]byte -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -76229,7 +71693,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76555,8 +72019,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76570,9 +72034,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint32(uint32(24) + libc.Uint32FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint32(4)) - sz = libc.Int32FromUint32(uint32(152) + libc.Uint32FromInt32(nWorker)*uint32(80)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+20) + uint32((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint32FromInt64(4)) + sz = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+72) + libc.Uint32FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint32FromInt64(80)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 36)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76720,8 +72184,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76770,18 +72234,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint32(uint32(16) + libc.Uint32FromInt32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(56))) + nByte = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(56))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -76915,7 +72380,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+12 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 12)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+12) @@ -77069,6 +72534,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78568,61 +74036,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - F__ccgo_align [0]uint32 - FiOffset Tsqlite3_int64 - FpChunk uintptr - F__ccgo_pad2 [4]byte -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - F__ccgo_align [0]uint32 - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr - F__ccgo_pad9 [4]byte -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -78919,7 +74332,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79622,25 +75035,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6651, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6680, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6659+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6678+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6688+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6707+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6147+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6175+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } @@ -79679,23 +75092,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+4 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79727,7 +75139,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6711, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6740, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -79821,7 +75233,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6716) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6745) != 0 { goto _2 } } @@ -79843,57 +75255,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+44) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 40)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 40)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 12 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -79938,11 +75337,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6718, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6747, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6722, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6751, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -79951,36 +75350,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 8)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6726, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6755, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 12 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -80009,18 +75397,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 152)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 180)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 156)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 184)) |= v6 } } } @@ -80067,15 +75455,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*20 + 8 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*20))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6735, libc.VaList(bp+16, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6764, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6766, libc.VaList(bp+16, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6795, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80086,8 +75474,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80127,7 +75515,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6821, libc.VaList(bp+16, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6850, libc.VaList(bp+16, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+44, 0, uint32(8)) return int32(WRC_Prune) @@ -80147,7 +75535,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -80156,7 +75544,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6856 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6885 *(*uintptr)(unsafe.Pointer(pExpr + 20)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80166,26 +75554,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6865 + v8 = __ccgo_ts + 6894 } else { - v10 = __ccgo_ts + 6880 + v8 = __ccgo_ts + 6909 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6902, libc.VaList(bp+16, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6931, libc.VaList(bp+16, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+16, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+16, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6925, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+16, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+16, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -80234,8 +75622,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80309,19 +75697,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6993 + zIn = __ccgo_ts + 7022 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7021 + zIn = __ccgo_ts + 7050 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7039 + zIn = __ccgo_ts + 7068 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7057 + zIn = __ccgo_ts + 7086 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7075, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7104, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80347,7 +75735,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80493,7 +75881,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7095, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7124, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80548,7 +75936,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*20))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7112, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80572,7 +75960,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7205, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80586,13 +75974,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*20))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*20))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80612,16 +76000,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7212, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7241, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80632,35 +76017,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7240, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7269, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7283 + zType = __ccgo_ts + 7312 } else { - zType = __ccgo_ts + 7290 + zType = __ccgo_ts + 7319 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7300, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7329, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7328, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7350, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7379, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7394, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80745,7 +76133,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7442, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7471, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) } @@ -80757,7 +76145,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7453, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7482, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -80803,7 +76191,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -80928,7 +76316,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7464, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7493, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -80963,7 +76351,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7520, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -81001,7 +76389,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7554, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7583, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -81071,7 +76459,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20 + 8 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7560, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7589, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -81105,7 +76493,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7621, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7650, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81418,7 +76806,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7652, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7681, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81485,7 +76873,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81496,7 +76884,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7691) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7720) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81506,7 +76894,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7697, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7726, 0) return int32(WRC_Abort) } goto _6 @@ -81608,12 +76996,12 @@ func _sqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) (r int3 (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback = v1 (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback2 = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = pNC - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { return int32(SQLITE_ERROR) } _sqlite3WalkExprNN(tls, bp, pExpr) - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) *(*int32)(unsafe.Pointer(pNC + 24)) |= savedHasAgg return libc.BoolInt32((*TNameContext)(unsafe.Pointer(pNC)).FnNcErr > 0 || (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnErr > 0) @@ -81656,12 +77044,12 @@ func _sqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) (r if pExpr == uintptr(0) { goto _1 } - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { return int32(SQLITE_ERROR) } _sqlite3WalkExprNN(tls, bp, pExpr) - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_HasAgg)|libc.Int32FromInt32(NC_MinMaxAgg)|libc.Int32FromInt32(NC_HasWin)|libc.Int32FromInt32(NC_OrderAgg)) != 0 { *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) savedHasAgg |= (*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_MinMaxAgg) | libc.Int32FromInt32(NC_HasWin) | libc.Int32FromInt32(NC_OrderAgg)) @@ -81728,33 +77116,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+56 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+56, 0, uint32(36)) - libc.Xmemset(tls, bp, 0, uint32(56)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+36 */ [56]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint32(36)) + pSrc = bp + 36 + libc.Xmemset(tls, pSrc, 0, uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*16))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+56, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+56, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -81806,7 +77196,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*20))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -82014,7 +77404,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8))).FpExpr continue } @@ -82489,7 +77879,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82568,7 +77958,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7756, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82913,11 +78303,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7804 + v2 = __ccgo_ts + 7833 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7806, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7835, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 20)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -82963,10 +78353,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -82994,7 +78384,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 36)) = int32((*TToken)(unsafe.Pointer(pToken)).Fz) - int32((*TParse)(unsafe.Pointer(pParse)).FzTail) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7850, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7879, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 20)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -83014,7 +78404,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7884, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7913, libc.VaList(bp+8, p)) } // C documentation @@ -83085,7 +78475,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7934, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+8, pExpr)) } } } @@ -83123,7 +78513,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == 0 { /* Wildcard of the form "?". Assign the next variable number */ - v2 = pParse + 220 + v2 = pParse + 216 *(*TynVar)(unsafe.Pointer(v2))++ v1 = *(*TynVar)(unsafe.Pointer(v2)) x = v1 @@ -83137,7 +78527,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 120 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7954, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 120 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7983, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 120 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -83157,7 +78547,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n */ x = int16(_sqlite3VListNameToNum(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, libc.Int32FromUint32(n))) if int32(x) == 0 { - v4 = pParse + 220 + v4 = pParse + 216 *(*TynVar)(unsafe.Pointer(v4))++ v3 = *(*TynVar)(unsafe.Pointer(v4)) x = v3 @@ -83170,7 +78560,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 120 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7997, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83406,12 +78796,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83553,7 +78937,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint32(uint32(36) + uint32(24)*libc.Uint32FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12) + libc.Uint32FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint32FromInt64(24)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83693,7 +79077,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+8+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83714,27 +79097,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint32 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint32(48) * libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint32(0) - } - nByte = libc.Int32FromUint32(uint32(56) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint32FromInt64(48))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -83780,9 +79156,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 12 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 36)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -83792,8 +79168,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 40)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 40)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -83807,7 +79183,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(8)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint32(4))) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+4)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint32FromInt64(4))) if pNew == uintptr(0) { return uintptr(0) } @@ -83858,7 +79234,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -83939,7 +79315,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint32FromInt64(28)+libc.Uint32FromInt64(20)*libc.Uint32FromInt32(4))) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32(libc.Int32FromInt32(4))*libc.Uint32FromInt64(20))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -83957,7 +79333,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(28)+libc.Uint32FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint32(20))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint32FromInt64(20))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -84038,7 +79414,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -84167,7 +79543,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8050, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84265,10 +79641,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8073) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8102) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8078) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8107) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -84946,13 +80322,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) (r i // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8084) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8113) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8092) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8121) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8098) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8127) == 0 { return int32(1) } return 0 @@ -84967,32 +80343,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8084, - 1: __ccgo_ts + 8092, - 2: __ccgo_ts + 8098, + 0: __ccgo_ts + 8113, + 1: __ccgo_ts + 8121, + 2: __ccgo_ts + 8127, } ii = 0 for { if !(ii < libc.Int32FromUint32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -85201,7 +80564,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -85254,7 +80617,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8102, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8131, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85354,12 +80717,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -85951,7 +81315,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8317) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8346) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -86047,7 +81411,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return @@ -86082,9 +81446,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -86217,7 +81581,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 44))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86347,13 +81711,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -87133,7 +82502,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8410, libc.VaList(bp+120, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+120, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -87145,7 +82514,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -87160,7 +82529,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8437, libc.VaList(bp+120, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8466, libc.VaList(bp+120, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -87189,7 +82558,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 52)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87265,7 +82634,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+120, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+120, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87328,7 +82697,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87338,7 +82707,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87346,7 +82715,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*20))).FiSorterColumn, target) inReg = target break } @@ -87359,9 +82728,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87443,7 +82812,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8461, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8490, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87514,17 +82883,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87533,7 +82902,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*20 libc.SetBitFieldPtr16Uint32(pItem1+8+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87545,6 +82914,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(64) + defer tls.Free(64) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint32(52)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 44)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87564,7 +82954,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87634,7 +83024,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87678,7 +83068,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87751,7 +83141,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(160) defer tls.Free(160) var db, pDel uintptr @@ -87778,8 +83168,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 104))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 104))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+156)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -87945,7 +83335,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88154,7 +83546,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88861,7 +84255,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -89092,10 +84486,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*16))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*20))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*16))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*20))).FpCExpr = pExpr } } } else { @@ -89133,7 +84527,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(16), pInfo+24, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(20), pInfo+28, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89147,7 +84541,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(24), pInfo+36, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(24), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89161,10 +84555,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -89174,25 +84571,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 16 + pCol += 20 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*16 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*20 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -89205,7 +84606,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -89215,11 +84616,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 20 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -89239,13 +84640,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(80) + defer tls.Free(80) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89315,7 +84716,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*16))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*20))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89351,6 +84752,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89368,44 +84770,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 24 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 44 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+64, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 48 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 48 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 44 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89485,7 +84892,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89493,7 +84900,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 19 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 168 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 136 + uintptr(v3)*4)) } // C documentation @@ -89511,7 +84918,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 19 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 168 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 136 + uintptr(v1)*4)) = iReg } } } @@ -89530,11 +84937,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 36)) += nReg - *(*int32)(unsafe.Pointer(pParse + 32)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 40)) += nReg + *(*int32)(unsafe.Pointer(pParse + 36)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg } return i } @@ -89652,8 +85059,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8511, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8569, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89671,10 +85078,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8539, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8714, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8772, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89690,9 +85097,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8888, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8946, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9035, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9093, 0) } } @@ -89748,7 +85155,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9186, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9244, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89757,11 +85164,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9245, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9303, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9251, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9309, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89791,21 +85198,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9278, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9336, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9462, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9520, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9767, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9783, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9825, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9899, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -89813,7 +85220,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -89821,7 +85228,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10106, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10164, 0) goto exit_rename_table exit_rename_table: ; @@ -89838,7 +85245,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10119, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10177, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -89878,11 +85285,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10157, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10215, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10189, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10247, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -89898,10 +85305,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 44))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10216) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10274) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10275) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10333) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -89913,13 +85320,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10328) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10386) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10374) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10432) } } /* Modify the CREATE TABLE statement. */ @@ -89933,7 +85340,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10401, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10459, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -89961,7 +85368,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10547, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10605, libc.VaList(bp+16, zTab, zDb)) } } } @@ -89999,12 +85406,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10900, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10958, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10934, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10992, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90019,7 +85426,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(64)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(80)) if !(pNew != 0) { goto exit_begin_add_column } @@ -90028,7 +85435,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(uint32(12)*libc.Uint32FromInt32(nAlloc))) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10964, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11022, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -90089,18 +85496,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10988 + zType = __ccgo_ts + 11046 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11002 + v1 = __ccgo_ts + 11060 } else { - v1 = __ccgo_ts + 11019 + v1 = __ccgo_ts + 11077 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11037, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11095, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90147,25 +85554,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -90177,11 +85572,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11076, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11258, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11134, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11316, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10106, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10164, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90191,31 +85586,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -90232,16 +85602,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90535,7 +85895,7 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) if pPtr == uintptr(0) { return uintptr(0) } - pp = pParse + 284 + pp = pParse + 280 for { if !(*(*uintptr)(unsafe.Pointer(pp)) != 0) { break @@ -90544,9 +85904,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90657,11 +86017,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*uint8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11391, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11449, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90732,30 +86092,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11414, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11472, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 32)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90776,9 +86140,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -90794,15 +86157,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11422, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11480, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -90813,16 +86176,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint32FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, *(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -90839,21 +86202,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0) _sqlite3Dequote(tls, zBuf1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11428, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11486, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int32(zSql) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint32FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, nReplace) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint32FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -90879,7 +86242,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -91134,7 +86497,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp var xAuth Tsqlite3_xauth var _ /* sCtx at bp+0 */ TRenameCtx var _ /* sParse at bp+20 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bFKOnly, bQuote, bTemp, db, i, iCol, pExpr, pFKey, pIdx, pSelect, pStep, pTab, pTarget, pUpsertSet, rc, xAuth, zDb, zNew, zOld, zSql, zTable, v1, v2 db = Xsqlite3_context_db_handle(tls, context) zSql = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -91175,11 +86538,11 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = _renameParseSql(tls, bp+20, zDb, db, zSql, bTemp) /* Find tokens that need to be replaced. */ - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp + 20 - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameColumnExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + 20 + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameColumnExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp (*(*TRenameCtx)(unsafe.Pointer(bp))).FpTab = pTab if rc != SQLITE_OK { goto renameColumnFunc_done @@ -91189,7 +86552,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 20))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+20, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91199,7 +86562,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } rc = v2 if rc == SQLITE_OK { - _sqlite3WalkSelect(tls, bp+308, pSelect) + _sqlite3WalkSelect(tls, bp+304, pSelect) } if rc != SQLITE_OK { goto renameColumnFunc_done @@ -91216,13 +86579,13 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp if (*(*TRenameCtx)(unsafe.Pointer(bp))).FiCol < 0 { _renameTokenFind(tls, bp+20, bp, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable+32) } - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpCheck) pIdx = (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpIndex for { if !(pIdx != 0) { break } - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) goto _3 _3: ; @@ -91233,7 +86596,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp if !(pIdx != 0) { break } - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) goto _4 _4: ; @@ -91245,7 +86608,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp break } pExpr = _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FaCol+uintptr(i)*12) - _sqlite3WalkExpr(tls, bp+308, pExpr) + _sqlite3WalkExpr(tls, bp+304, pExpr) goto _5 _5: ; @@ -91286,8 +86649,8 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } else { if (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex != 0 { - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FaColExpr) - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FaColExpr) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FpPartIdxWhere) } else { rc = _renameResolveTrigger(tls, bp+20) if rc != SQLITE_OK { @@ -91319,7 +86682,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp _renameColumnIdlistNames(tls, bp+20, bp, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger)).FpColumns, zOld) } /* Find tokens to edit in various expressions and selects */ - _renameWalkTrigger(tls, bp+308, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger) + _renameWalkTrigger(tls, bp+304, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger) } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) @@ -91331,7 +86694,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 20))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91415,15 +86778,15 @@ func _renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r in // ** -> 'CREATE TABLE t1(a REFERENCES t3)' // */ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { - bp := tls.Alloc(384) - defer tls.Free(384) + bp := tls.Alloc(368) + defer tls.Free(368) var bQuote, bTemp, i, isLegacy, rc int32 var db, pFKey, pItem, pSelect, pStep, pTab, pTrigger, zDb, zInput, zNew, zOld uintptr var xAuth Tsqlite3_xauth - var _ /* sCtx at bp+288 */ TRenameCtx - var _ /* sNC at bp+336 */ TNameContext + var _ /* sCtx at bp+284 */ TRenameCtx + var _ /* sNC at bp+332 */ TNameContext var _ /* sParse at bp+0 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bQuote, bTemp, db, i, isLegacy, pFKey, pItem, pSelect, pStep, pTab, pTrigger, rc, xAuth, zDb, zInput, zNew, zOld db = Xsqlite3_context_db_handle(tls, context) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -91437,13 +86800,13 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _sqlite3BtreeEnterAll(tls, db) - libc.Xmemset(tls, bp+288, 0, uint32(20)) - (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab = _sqlite3FindTable(tls, db, zOld, zDb) - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameTableExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameTableSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + 288 + libc.Xmemset(tls, bp+284, 0, uint32(20)) + (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab = _sqlite3FindTable(tls, db, zOld, zDb) + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameTableExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameTableSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) if rc == SQLITE_OK { isLegacy = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) @@ -91454,16 +86817,16 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect - libc.Xmemset(tls, bp+336, 0, uint32(36)) - (*(*TNameContext)(unsafe.Pointer(bp + 336))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + libc.Xmemset(tls, bp+332, 0, uint32(36)) + (*(*TNameContext)(unsafe.Pointer(bp + 332))).FpParse = bp + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr - })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+336) + })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+332) if (*(*TParse)(unsafe.Pointer(bp))).FnErr != 0 { rc = (*(*TParse)(unsafe.Pointer(bp))).Frc } else { - _sqlite3WalkSelect(tls, bp+308, (*(*struct { + _sqlite3WalkSelect(tls, bp+304, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect) } @@ -91481,7 +86844,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt break } if Xsqlite3_stricmp(tls, (*TFKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 { - _renameTokenFind(tls, bp, bp+288, (*TFKey)(unsafe.Pointer(pFKey)).FzTo) + _renameTokenFind(tls, bp, bp+284, (*TFKey)(unsafe.Pointer(pFKey)).FzTo) } goto _1 _1: @@ -91493,35 +86856,35 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt ** expressions. Also update the name that appears right after the ** "CREATE [VIRTUAL] TABLE" bit. */ if Xsqlite3_stricmp(tls, zOld, (*TTable)(unsafe.Pointer(pTab)).FzName) == 0 { - (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab = pTab + (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab = pTab if isLegacy == 0 { - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer(pTab)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer(pTab)).FpCheck) } - _renameTokenFind(tls, bp, bp+288, (*TTable)(unsafe.Pointer(pTab)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TTable)(unsafe.Pointer(pTab)).FzName) } } } else { if (*(*TParse)(unsafe.Pointer(bp))).FpNewIndex != 0 { - _renameTokenFind(tls, bp, bp+288, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FzName) if isLegacy == 0 { - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) } } else { pTrigger = (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger - if 0 == Xsqlite3_stricmp(tls, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable, zOld) && (*TTable)(unsafe.Pointer((*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab)).FpSchema == (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema { - _renameTokenFind(tls, bp, bp+288, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable) + if 0 == Xsqlite3_stricmp(tls, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable, zOld) && (*TTable)(unsafe.Pointer((*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab)).FpSchema == (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema { + _renameTokenFind(tls, bp, bp+284, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable) } if isLegacy == 0 { rc = _renameResolveTrigger(tls, bp) if rc == SQLITE_OK { - _renameWalkTrigger(tls, bp+308, pTrigger) + _renameWalkTrigger(tls, bp+304, pTrigger) pStep = (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list for { if !(pStep != 0) { break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0 && 0 == Xsqlite3_stricmp(tls, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget, zOld) { - _renameTokenFind(tls, bp, bp+288, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) + _renameTokenFind(tls, bp, bp+284, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) } if (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { i = 0 @@ -91531,7 +86894,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } pItem = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*48 if 0 == Xsqlite3_stricmp(tls, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, zOld) { - _renameTokenFind(tls, bp, bp+288, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } goto _3 _3: @@ -91550,21 +86913,21 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } } if rc == SQLITE_OK { - rc = _renameEditSql(tls, context, bp+288, zInput, zNew, bQuote) + rc = _renameEditSql(tls, context, bp+284, zInput, zNew, bQuote) } if rc != SQLITE_OK { if rc == int32(SQLITE_ERROR) && _sqlite3WritableSchema(tls, db) != 0 { Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*4))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } } } _renameParseCleanup(tls, bp) - _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpList) + _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpList) _sqlite3BtreeLeaveAll(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth } @@ -91613,9 +86976,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin var db, pSelect, zDb, zInput uintptr var i, rc, v1 int32 var xAuth Tsqlite3_xauth - var _ /* sCtx at bp+288 */ TRenameCtx + var _ /* sCtx at bp+284 */ TRenameCtx var _ /* sParse at bp+0 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _ = db, i, pSelect, rc, xAuth, zDb, zInput, v1 db = Xsqlite3_context_db_handle(tls, context) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -91628,18 +86991,18 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin rc = _renameParseSql(tls, bp, zDb, db, zInput, 0) if rc == SQLITE_OK { /* Walker to find tokens that need to be replaced. */ - libc.Xmemset(tls, bp+288, 0, uint32(20)) - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameQuotefixExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + 288 + libc.Xmemset(tls, bp+284, 0, uint32(20)) + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameQuotefixExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 if (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 { if libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91649,16 +87012,16 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin } rc = v1 if rc == SQLITE_OK { - _sqlite3WalkSelect(tls, bp+308, pSelect) + _sqlite3WalkSelect(tls, bp+304, pSelect) } } else { - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FpCheck) i = 0 for { if !(i < int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FnCol)) { break } - _sqlite3WalkExpr(tls, bp+308, _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FaCol+uintptr(i)*12)) + _sqlite3WalkExpr(tls, bp+304, _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FaCol+uintptr(i)*12)) goto _2 _2: ; @@ -91667,19 +87030,19 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin } } else { if (*(*TParse)(unsafe.Pointer(bp))).FpNewIndex != 0 { - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FaColExpr) - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FaColExpr) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) } else { rc = _renameResolveTrigger(tls, bp) if rc == SQLITE_OK { - _renameWalkTrigger(tls, bp+308, (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger) + _renameWalkTrigger(tls, bp+304, (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger) } } } if rc == SQLITE_OK { - rc = _renameEditSql(tls, context, bp+288, zInput, uintptr(0), 0) + rc = _renameEditSql(tls, context, bp+284, zInput, uintptr(0), 0) } - _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpList) + _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpList) } if rc != SQLITE_OK { if _sqlite3WritableSchema(tls, db) != 0 && rc == int32(SQLITE_ERROR) { @@ -91721,12 +87084,13 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin // ** C. Otherwise return NULL. // */ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { - bp := tls.Alloc(336) - defer tls.Free(336) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + bp := tls.Alloc(320) + defer tls.Free(320) + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth - var _ /* sNC at bp+288 */ TNameContext + var _ /* sNC at bp+284 */ TNameContext var _ /* sParse at bp+0 */ TParse _, _, _, _, _, _, _, _, _, _, _, _ = bNoDQS, bTemp, db, flags, i1, i2, isLegacy, rc, xAuth, zDb, zInput, zWhen db = Xsqlite3_context_db_handle(tls, context) @@ -91740,19 +87104,19 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 32)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 32)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { - libc.Xmemset(tls, bp+288, 0, uint32(36)) - (*(*TNameContext)(unsafe.Pointer(bp + 288))).FpParse = bp + libc.Xmemset(tls, bp+284, 0, uint32(36)) + (*(*TNameContext)(unsafe.Pointer(bp + 284))).FpParse = bp _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr - })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect, bp+288) + })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect, bp+284) if (*(*TParse)(unsafe.Pointer(bp))).FnErr != 0 { rc = (*(*TParse)(unsafe.Pointer(bp))).Frc } @@ -91819,7 +87183,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) @@ -91836,7 +87200,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11433, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11491, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -91891,23 +87255,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11440 + v1 = __ccgo_ts + 11498 } else { - v1 = __ccgo_ts + 5670 + v1 = __ccgo_ts + 5700 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11452, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11510, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11480, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -91917,33 +87281,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11528, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11586, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11649, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11707, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 48)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 52)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -91957,7 +87321,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -91968,8 +87332,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -92030,27 +87394,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11667, + FzName: __ccgo_ts + 11725, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11688, + FzName: __ccgo_ts + 11746, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11708, + FzName: __ccgo_ts + 11766, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11727, + FzName: __ccgo_ts + 11785, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11746, + FzName: __ccgo_ts + 11804, }, } @@ -92261,8 +87625,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11849, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11907, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92272,10 +87641,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11902, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11960, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92307,15 +87676,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11769, - FzCols: __ccgo_ts + 11782, + FzName: __ccgo_ts + 11827, + FzCols: __ccgo_ts + 11840, }, 1: { - FzName: __ccgo_ts + 11795, - FzCols: __ccgo_ts + 11808, + FzName: __ccgo_ts + 11853, + FzCols: __ccgo_ts + 11866, }, 2: { - FzName: __ccgo_ts + 11836, + FzName: __ccgo_ts + 11894, }, } @@ -92374,50 +87743,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - F__ccgo_align [0]uint32 - FanDLt uintptr - FanEq uintptr - FanLt uintptr - F__ccgo_align3 [4]byte - Fu struct { - F__ccgo_align [0]uint32 - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - F__ccgo_align [0]uint32 - Fdb uintptr - F__ccgo_align1 [4]byte - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - F__ccgo_align7 [3]byte - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92541,7 +87866,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92557,12 +87883,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint32(uint32(120) + uint32(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint32(n) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint32(uint32(120) + uint32(8)*libc.Uint32FromInt32(nColUp)) /* StatAccum.anDLt */ + n += libc.Int64FromUint32(uint32(8) * libc.Uint32FromInt32(nColUp)) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint32(n) + (libc.Uint32FromInt64(8)*libc.Uint32FromInt32(nColUp) + libc.Uint32FromInt64(40)*libc.Uint32FromInt32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*libc.Uint32FromInt32(nColUp)*libc.Uint32FromInt32(nCol+mxSample))) + n += libc.Int64FromUint32(uint32(8)*libc.Uint32FromInt32(nColUp) + uint32(40)*libc.Uint32FromInt32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*libc.Uint32FromInt32(nColUp)*libc.Uint32FromInt32(nCol+mxSample)) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92570,7 +87896,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92629,7 +87955,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11920, + FzName: __ccgo_ts + 11978, } func init() { @@ -93003,7 +88329,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11930, + FzName: __ccgo_ts + 11988, } func init() { @@ -93053,7 +88379,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11940, libc.VaList(bp+56, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11998, libc.VaList(bp+56, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93064,7 +88390,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11945, libc.VaList(bp+56, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12003, libc.VaList(bp+56, iVal)) goto _2 _2: ; @@ -93103,7 +88429,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+11951, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+12009, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93121,7 +88447,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11957, + FzName: __ccgo_ts + 12015, } func init() { @@ -93187,7 +88513,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11966, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12024, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93196,12 +88522,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(64)+libc.Uint32FromInt32(13))) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(80)+libc.Uint32FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*64 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11769, uint32(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*80 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11827, uint32(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93403,7 +88729,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93434,7 +88760,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93525,7 +88851,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93562,7 +88888,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93595,11 +88921,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11980) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12038) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11984) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12042) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93707,13 +89033,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93728,7 +89047,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1663 + z = __ccgo_ts + 1667 } i = 0 for { @@ -93763,17 +89082,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 6, 0x40) for *(*uint8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11988, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12046, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+11999, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12057, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12009, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12067, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93785,13 +89104,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -94152,11 +89464,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11795, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11853, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12021, __ccgo_ts+12090, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12079, __ccgo_ts+12148, zDb) } return rc } @@ -94222,10 +89534,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11769, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12142, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12200, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94338,7 +89650,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6711, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6740, zName) == 0) } // C documentation @@ -94380,21 +89692,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1663 + zFile = __ccgo_ts + 1667 } if zName == uintptr(0) { - zName = __ccgo_ts + 1663 + zName = __ccgo_ts + 1667 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 20)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4032) + *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4062) if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+12183, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+12241, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 20))) if pNewSchema != 0 { @@ -94425,7 +89737,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 120 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12186, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12244, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) goto attach_error } i = 0 @@ -94434,7 +89746,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12223, libc.VaList(bp+32, zName)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12281, libc.VaList(bp+32, zName)) goto attach_error } goto _1 @@ -94452,7 +89764,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint32FromInt64(16)*libc.Uint32FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(uint32(16)*libc.Uint32FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1)))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(int64(16)*(int64(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb)))) if aNew == uintptr(0) { return } @@ -94490,7 +89802,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12253, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94498,7 +89810,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12282, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12340, 0) rc = int32(SQLITE_ERROR) } } @@ -94542,10 +89854,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12378, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12436, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12399, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12425, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12483, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94710,7 +90022,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12447, + FzName: __ccgo_ts + 12505, } func init() { @@ -94732,7 +90044,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12461, + FzName: __ccgo_ts + 12519, } func init() { @@ -94758,7 +90070,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12475, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12533, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94792,7 +90104,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 44)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 44))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12499, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 44)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12557, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 44)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 44))) @@ -94919,6 +90231,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -94991,9 +90305,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -95009,7 +90323,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12603, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95037,11 +90351,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12568, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12626, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12574, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12632, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12580, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12638, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95101,7 +90415,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName } else { - zCol = __ccgo_ts + 8092 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95136,7 +90450,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12607, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12665, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95173,47 +90487,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -95254,7 +90527,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint32(uint32(16) * libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 120 + v4 = pToplevel + 108 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*16 @@ -95352,7 +90625,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95430,7 +90705,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95444,7 +90719,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95510,13 +90787,13 @@ func _sqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint return } (*TParse)(unsafe.Pointer(pParse)).Fnested++ - libc.Xmemcpy(tls, bp, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemcpy(tls, bp, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_PreferBuiltin) _sqlite3RunParser(tls, pParse, zSql) (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags _sqlite3DbFree(tls, db, zSql) - libc.Xmemcpy(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), bp, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemcpy(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), bp, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*TParse)(unsafe.Pointer(pParse)).Fnested-- } @@ -95557,21 +90834,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6711) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6740) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6688) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, __ccgo_ts+6147) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95601,12 +90878,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6147) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6175) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+6688) } } } @@ -95644,7 +90921,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+404, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12622, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12680, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95654,7 +90931,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95662,15 +90939,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12630 + v1 = __ccgo_ts + 12688 } else { - v1 = __ccgo_ts + 12643 + v1 = __ccgo_ts + 12701 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95708,12 +90985,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - return __ccgo_ts + 6697 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + return __ccgo_ts + 6726 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6659+7) == 0 { - return __ccgo_ts + 6678 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6688+7) == 0 { + return __ccgo_ts + 6707 } } return zName @@ -95837,9 +91114,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -96238,7 +91515,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6147) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6175) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96270,7 +91547,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6711, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6740, zName) { break } goto _1 @@ -96328,13 +91605,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12657, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12674, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96378,12 +91655,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*4))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*4))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12694, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12752, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96419,23 +91696,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96555,7 +91834,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96598,9 +91877,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96613,7 +91892,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12736, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12794, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96629,9 +91908,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10983 + v2 = __ccgo_ts + 11041 } else { - v2 = __ccgo_ts + 9245 + v2 = __ccgo_ts + 9303 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96641,9 +91920,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96667,11 +91946,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10983 + v4 = __ccgo_ts + 11041 } else { - v4 = __ccgo_ts + 9245 + v4 = __ccgo_ts + 9303 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12777, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96679,11 +91958,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12798, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12856, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96715,19 +91994,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 48 + v9 = pParse + 52 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid = v7 reg1 = v7 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot = v10 reg2 = v10 - v14 = pParse + 48 + v14 = pParse + 52 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96747,15 +92036,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - *(*int32)(unsafe.Pointer(pParse + 148)) = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96770,7 +92064,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -96831,7 +92125,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12833, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -96840,14 +92134,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 148)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+12867, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+12925, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 104 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -96879,11 +92175,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(32) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 8)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity uint8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -96894,7 +92190,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -96904,12 +92200,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12910, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12968, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12917, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12975, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- @@ -96951,21 +92247,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, (*(*TToken)(unsafe.Pointer(bp))).Fn) *(*uint8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = uint8(0) _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12927, libc.VaList(bp+24, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+24, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64((int64((*TTable)(unsafe.Pointer(p)).FnCol)+int64(1))*int64(12))) if aNew == uintptr(0) { @@ -96976,7 +92261,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*12 libc.Xmemset(tls, pCol, 0, uint32(12)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -96989,12 +92274,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*uint8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn))) = uint8(0) _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 10 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 10 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint32((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint32(16)) + *(*Tu8)(unsafe.Pointer(p + 64 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn = uint32(0) } // C documentation @@ -97166,10 +92460,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*12 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13011, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12998, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13056, 0) } else { libc.Xmemset(tls, bp, 0, uint32(52)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97227,7 +92521,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 10 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13039, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13097, 0) } } @@ -97255,8 +92549,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -97264,7 +92558,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13091, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13149, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_HasPrimaryKey) @@ -97283,21 +92577,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97320,7 +92603,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13132, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97348,8 +92631,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*16))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+84, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+188+12, int32(1)) } else { zStart++ for { @@ -97436,17 +92724,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*12 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13188, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13231, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13289, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13239, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13297, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97478,7 +92766,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13304, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97619,9 +92907,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97632,31 +92921,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 12 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1663 - zSep2 = __ccgo_ts + 13277 - zEnd = __ccgo_ts + 5171 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1667 + zSep2 = __ccgo_ts + 13335 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13279 - zSep2 = __ccgo_ts + 13283 - zEnd = __ccgo_ts + 13288 + zSep = __ccgo_ts + 13337 + zSep2 = __ccgo_ts + 13341 + zEnd = __ccgo_ts + 13346 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13291, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13349, uint32(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97667,8 +92956,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint32FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97681,17 +92971,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 12 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3860, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint32FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1663, - 1: __ccgo_ts + 13305, - 2: __ccgo_ts + 13311, - 3: __ccgo_ts + 13316, - 4: __ccgo_ts + 13321, - 5: __ccgo_ts + 13311, + 0: __ccgo_ts + 1667, + 1: __ccgo_ts + 13363, + 2: __ccgo_ts + 13369, + 3: __ccgo_ts + 13374, + 4: __ccgo_ts + 13379, + 5: __ccgo_ts + 13369, } // C documentation @@ -97700,15 +92991,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint32((libc.Uint32FromInt64(4) + libc.Uint32FromInt64(2) + libc.Uint32FromInt64(2) + libc.Uint32FromInt32(1)) * libc.Uint32FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(2)+libc.Uint32FromInt64(2)+libc.Uint32FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97723,7 +93015,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint32(2) * libc.Uint32FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -97956,8 +93248,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if *(*int32)(unsafe.Pointer(pParse + 148)) != 0 { - _sqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 148)), int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -98057,7 +93359,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -98070,8 +93372,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*4)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -98101,7 +93403,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98293,7 +93595,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -98320,9 +93622,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*12 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13327, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13385, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13360, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13418, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98343,11 +93645,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13387, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13445, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13437, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13495, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 28)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98394,7 +93696,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13469, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13527, 0) return } } @@ -98428,16 +93730,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9245 - zType2 = __ccgo_ts + 13513 + zType = __ccgo_ts + 9303 + zType2 = __ccgo_ts + 13571 } else { /* A view */ - zType = __ccgo_ts + 10983 - zType2 = __ccgo_ts + 13519 + zType = __ccgo_ts + 11041 + zType2 = __ccgo_ts + 13577 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98454,24 +93756,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 44 + v5 = pParse + 48 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 48 + v7 = pParse + 52 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 48 + v9 = pParse + 52 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 48 + v11 = pParse + 52 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98510,7 +93817,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr zStmt = _createTableStmt(tls, db, p) } else { if tabOpts != 0 { - v13 = pParse + 212 + v13 = pParse + 208 } else { v13 = pEnd } @@ -98519,13 +93826,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13524, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13539, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13597, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98534,15 +93851,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13637, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13695, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13679, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13737, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13713, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13771, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98560,7 +93877,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9767) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9825) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98593,7 +93910,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 60)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13734, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13792, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98610,7 +93927,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+60) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+10983, *(*uintptr)(unsafe.Pointer(bp + 60))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+11041, *(*uintptr)(unsafe.Pointer(bp + 60))) if _sqlite3FixSelect(tls, bp+8, pSelect) != 0 { goto create_view_fail } @@ -98707,7 +94024,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13770, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13828, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -98891,7 +94208,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13800, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13858, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -98904,7 +94221,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13815, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*16))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13873, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*16))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -98987,9 +94304,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13882, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13940, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99030,7 +94347,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13896, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -99039,7 +94356,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13941, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13999, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -99074,11 +94391,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3483, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3513, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7453, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7482, int32(10)) == 0 { return 0 } return int32(1) @@ -99133,9 +94450,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName @@ -99168,18 +94485,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14008, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14066, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14036, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14070, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14128, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99189,7 +94506,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12042, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99237,19 +94554,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14102, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*12))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14160, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*12))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14165, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint32(uint32(44) + libc.Uint32FromInt32(nCol-libc.Int32FromInt32(1))*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+36) + libc.Uint32FromInt32(nCol)*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) if pToCol != 0 { i = 0 for { @@ -99306,7 +94623,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14259, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14317, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99421,11 +94738,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99447,7 +94764,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 44 + v6 = pParse + 48 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99492,13 +94809,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99521,23 +94838,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint32((libc.Uint32FromInt64(104)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(4)*libc.Uint32FromInt16(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(2)*libc.Uint32FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint32(2)*libc.Uint32FromInt16(nCol)+uint32(1)*libc.Uint32FromInt16(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint32((libc.Uint32FromInt64(104)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(4)*libc.Uint32FromInt32(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7)) + (uint32(2)*libc.Uint32FromInt32(nCol+libc.Int32FromInt32(1))+uint32(2)*libc.Uint32FromInt32(nCol)+uint32(1)*libc.Uint32FromInt32(nCol)+uint32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint32FromInt64(104)+libc.Uint32FromInt32(7))&libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint32FromInt64(4)*libc.Uint32FromInt16(nCol) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint32FromInt64(4)*libc.Uint32FromInt32(nCol) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint32(2) * libc.Uint32FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint32(2) * libc.Uint32FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint32(2) * libc.Uint32FromInt16(nCol)) + pExtra += uintptr(uint32(2) * libc.Uint32FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99566,11 +94883,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 8 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14305 + v2 = __ccgo_ts + 14363 } else { - v2 = __ccgo_ts + 14311 + v2 = __ccgo_ts + 14369 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14316, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14374, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99648,7 +94965,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14344, *(*uintptr)(unsafe.Pointer(bp + 52))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14402, *(*uintptr)(unsafe.Pointer(bp + 52))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99658,7 +94975,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14350, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14408, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99672,16 +94989,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14400, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14458, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14428, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14453, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14511, 0) goto exit_create_index } /* @@ -99702,19 +95019,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14344, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14402, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14487, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14545, libc.VaList(bp+80, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14521, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14579, libc.VaList(bp+80, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99735,7 +95052,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14545, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14603, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99753,9 +95070,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99783,7 +95100,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14344) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14402) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -99815,7 +95132,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+56) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+56) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -99867,7 +95184,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14568, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14626, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -99877,7 +95194,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -99887,8 +95204,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -99966,7 +95283,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 5, 0x20) @@ -100014,7 +95331,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14629, libc.VaList(bp+80, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14687, libc.VaList(bp+80, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -100044,8 +95361,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14671, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14729, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -100058,7 +95375,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -100085,11 +95402,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1663 + v13 = __ccgo_ts + 1667 } else { - v13 = __ccgo_ts + 14688 + v13 = __ccgo_ts + 14746 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14696, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14754, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -100097,7 +95414,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14716, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14774, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -100105,7 +95422,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14775, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -100268,16 +95585,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 44))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14860, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 44))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14820, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14878, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100285,9 +95602,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100303,8 +95620,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14893, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11980, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14951, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12038, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100377,12 +95694,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(8)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+4)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(8)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint32(4))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(libc.UintptrFromInt32(0)+4)+libc.Uint32FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100494,13 +95811,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14953, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, libc.Uint64FromInt64(int64(56)+(nAlloc-int64(1))*int64(48))) + pNew = _sqlite3DbRealloc(tls, db, pSrc, libc.Uint64FromInt64(libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+8))+nAlloc*libc.Int64FromInt64(48))) if pNew == uintptr(0) { return uintptr(0) } @@ -100581,7 +95898,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(48))) if pList == uintptr(0) { return uintptr(0) } @@ -100631,7 +95948,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -100802,11 +96119,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14989 + v1 = __ccgo_ts + 15047 } else { - v1 = __ccgo_ts + 14992 + v1 = __ccgo_ts + 15050 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14998, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15056, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101005,7 +96322,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15034, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15092, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101052,9 +96369,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15040 + v1 = __ccgo_ts + 15098 } else { - v1 = __ccgo_ts + 15049 + v1 = __ccgo_ts + 15107 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101086,9 +96403,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15034, - 1: __ccgo_ts + 15056, - 2: __ccgo_ts + 15040, + 0: __ccgo_ts + 15092, + 1: __ccgo_ts + 15114, + 2: __ccgo_ts + 15098, } // C documentation @@ -101108,7 +96425,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15064, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15122, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101133,7 +96450,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101564,7 +96881,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102446,11 +97761,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15297, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15326, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102554,7 +97869,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102611,7 +97926,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 120 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15400, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15458, -int32(1)) return } if argc == int32(3) { @@ -104330,7 +99650,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15433, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15491, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+4) @@ -104412,7 +99732,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))) } // C documentation @@ -104484,32 +99804,32 @@ var _hexdigits = [16]uint8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15478, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15536, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15486, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15544, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1424, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1428, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -104537,13 +99857,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15494, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15552 + } else { + v2 = __ccgo_ts + 15556 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1668, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint32FromInt32(n)) + j += n + i += n + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*uint8)(unsafe.Pointer(zOut + uintptr(v2))) = uint8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0) + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15559, -int32(1)) + return +} + // C documentation // // /* @@ -104555,6 +100011,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104565,7 +100025,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 120))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(Xsqlite3_user_data(tls, context))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -104776,7 +100236,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1663 + zPass = __ccgo_ts + 1667 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -105089,7 +100549,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11389, + 0: __ccgo_ts + 11447, } // C documentation @@ -105101,8 +100561,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -105117,7 +100577,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -105129,16 +100589,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint32FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint32FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint32FromInt32(k)) + j += int64(k) } } goto _2 @@ -105157,7 +100617,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1663) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1667) } // C documentation @@ -105203,7 +100663,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1663 + zIn = __ccgo_ts + 1667 } i = 0 for { @@ -105249,7 +100709,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15497, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15582, int32(4), libc.UintptrFromInt32(0)) } } @@ -105310,7 +100770,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12607, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12665, -int32(1)) return } if argc == int32(2) { @@ -105343,19 +100803,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - F__ccgo_align [0]uint32 - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 - F__ccgo_pad6 [6]byte -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105424,7 +100871,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105506,7 +100953,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15377, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105570,13 +101017,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - F__ccgo_align [0]uint32 - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105838,7 +101278,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1663, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1667, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -105858,7 +101298,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15502, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15587, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -105887,8 +101327,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15508, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15508, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15593, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15593, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -106068,11 +101508,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -106176,7 +101616,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint32(libc.Uint32FromInt64(4160)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint32(libc.Uint32FromInt64(4240)/libc.Uint32FromInt64(40))) } /* @@ -106189,542 +101629,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row)), - FzName: __ccgo_ts + 15513, + FzName: __ccgo_ts + 15598, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_compare)), - FzName: __ccgo_ts + 15533, + FzName: __ccgo_ts + 15618, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr)), - FzName: __ccgo_ts + 15546, + FzName: __ccgo_ts + 15631, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_affinity)), - FzName: __ccgo_ts + 15564, + FzName: __ccgo_ts + 15649, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15573, + FzName: __ccgo_ts + 15658, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15596, + FzName: __ccgo_ts + 15681, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15622, + FzName: __ccgo_ts + 15707, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 15647, + FzName: __ccgo_ts + 15732, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 15656, + FzName: __ccgo_ts + 15741, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 15667, + FzName: __ccgo_ts + 15752, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_sqlite_offset)), - FzName: __ccgo_ts + 15674, + FzName: __ccgo_ts + 15759, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15713, + FzName: __ccgo_ts + 15798, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15720, + FzName: __ccgo_ts + 15805, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15728, + FzName: __ccgo_ts + 15813, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15735, + FzName: __ccgo_ts + 15820, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15748, + FzName: __ccgo_ts + 15833, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15754, + FzName: __ccgo_ts + 15839, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15761, + FzName: __ccgo_ts + 15846, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15768, + FzName: __ccgo_ts + 15853, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15776, + FzName: __ccgo_ts + 15861, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15781, + FzName: __ccgo_ts + 15866, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15791, + FzName: __ccgo_ts + 15876, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15797, + FzName: __ccgo_ts + 15882, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15803, + FzName: __ccgo_ts + 15888, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15813, + FzName: __ccgo_ts + 15898, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15820, + FzName: __ccgo_ts + 15905, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15830, + FzName: __ccgo_ts + 15915, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15837, + FzName: __ccgo_ts + 15922, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15844, + FzName: __ccgo_ts + 15929, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15855, + FzName: __ccgo_ts + 15940, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15862, + FzName: __ccgo_ts + 15947, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15877, + FzName: __ccgo_ts + 15962, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15894, + FzName: __ccgo_ts + 15979, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15905, + FzName: __ccgo_ts + 15990, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15911, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15997, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15929, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16003, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15937, + FzName: __ccgo_ts + 16016, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15951, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16034, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15959, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16042, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16056, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16064, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15985, + FzName: __ccgo_ts + 16090, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15989, + FzName: __ccgo_ts + 16094, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15995, + FzName: __ccgo_ts + 16100, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16018, + FzName: __ccgo_ts + 16123, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16029, + FzName: __ccgo_ts + 16134, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, + FzName: __ccgo_ts + 15593, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16034, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1236, + FzName: __ccgo_ts + 15593, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1244, + FzName: __ccgo_ts + 16139, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16039, + FzName: __ccgo_ts + 1240, }, 74: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16045, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1248, }, 75: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 16048, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16144, }, 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 16150, }, 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 16058, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16153, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16048, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 16157, }, 79: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16063, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(libc.Int32FromInt32(2)), + FzName: __ccgo_ts + 16163, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16067, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16153, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16071, + FzName: __ccgo_ts + 16168, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16077, + FzName: __ccgo_ts + 16172, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16081, + FzName: __ccgo_ts + 16176, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16086, + FzName: __ccgo_ts + 16182, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16091, + FzName: __ccgo_ts + 16186, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16096, + FzName: __ccgo_ts + 16191, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16102, + FzName: __ccgo_ts + 16196, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16106, + FzName: __ccgo_ts + 16201, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, + FzName: __ccgo_ts + 16207, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16114, + FzName: __ccgo_ts + 16211, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, + FzName: __ccgo_ts + 16215, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16124, + FzName: __ccgo_ts + 16219, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16129, + FzName: __ccgo_ts + 16224, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16135, + FzName: __ccgo_ts + 16229, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16141, + FzName: __ccgo_ts + 16234, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16147, + FzName: __ccgo_ts + 16240, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16152, + FzName: __ccgo_ts + 16246, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16160, + FzName: __ccgo_ts + 16252, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16168, + FzName: __ccgo_ts + 16257, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16171, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16265, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16273, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16276, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6856, + FzName: __ccgo_ts + 6885, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_iif)), - FzName: __ccgo_ts + 16176, + FzName: __ccgo_ts + 16281, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_iif)), - FzName: __ccgo_ts + 16180, + FzName: __ccgo_ts + 16285, }, } @@ -106783,109 +102234,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 1856)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 1896)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 1936)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 2016)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 2056)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 2096)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 2136)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 2176)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 2216)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 2016)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 2056)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 2096)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 2136)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 2176)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 2216)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 2296)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 2336)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 2376)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2380)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 2384)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 2388)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 2416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2420)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 2424)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 2428)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2376)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 2416)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 2456)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2460)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 2464)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2460)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 2464)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 2468)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 2496)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 2500)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2508)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 2536)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 2540)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2548)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 2576)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 2580)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 2584)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 2588)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 2620)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 2624)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 2628)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 2496)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 2500)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 2504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 2508)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2536)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 2540)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2548)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2576)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 2580)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2584)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2588)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 2620)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2624)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2628)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 2656)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 2660)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 2664)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 2668)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 2696)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 2736)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2696)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 2700)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 2704)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 2708)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 2736)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 2740)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 2744)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 2748)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 2776)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 2808)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 2816)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2848)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 2856)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2888)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 2816)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2856)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2888)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 2896)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2928)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 2928)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 2936)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 3016)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 2968)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 3008)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 3016)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 3056)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 3096)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 3136)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 3168)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 3176)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3208)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 3216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3248)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 3256)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3288)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 3176)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 3216)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 3248)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 3256)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 3288)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 3296)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3328)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3368)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 3376)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 3328)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3368)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 3376)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 3416)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3448)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 3456)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3488)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 3448)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 3456)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 3488)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 3496)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3528)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 3536)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3568)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 3528)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 3536)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3568)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 3576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3608)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 3608)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 3616)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3648)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 3648)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 3656)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3688)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 3688)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3728)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 3728)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 3736)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 3776)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3808)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 3808)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 3816)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3848)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 3848)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 3856)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3888)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 3888)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 3896)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3928)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 3928)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 3936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3976)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 4016)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 4096)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 3968)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 3976)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 4008)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 4016)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 4096)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 4136)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 4176)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 4216)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -107202,7 +102655,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16183, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16288, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -108026,7 +103479,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 44 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108313,11 +103766,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 8)) = TToken{ - Fz: __ccgo_ts + 6722, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6718, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -108381,7 +103834,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5306) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5336) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108845,7 +104298,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 20 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) } return WRC_Continue } @@ -108963,7 +104416,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8349, libc.VaList(bp+40, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8378, libc.VaList(bp+40, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -109029,11 +104482,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 48 + v3 = pToplevel + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 48)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 52)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109358,7 +104811,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109372,7 +104825,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109407,7 +104860,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 44)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109420,7 +104873,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109547,27 +105000,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(112) defer tls.Free(112) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+76 */ int32 var _ /* sNC at bp+40 */ TNameContext var _ /* tmask at bp+36 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109648,7 +105101,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109684,44 +105137,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16228, libc.VaList(bp+88, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16333, libc.VaList(bp+88, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16269, libc.VaList(bp+88, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16374, libc.VaList(bp+88, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109743,31 +105180,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16301, libc.VaList(bp+88, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16406, libc.VaList(bp+88, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 48 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 52 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109791,10 +105228,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 44 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 48 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -109835,8 +105272,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -109853,28 +105290,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16309, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16414, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16361, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16466, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -109987,18 +105424,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -110008,13 +105445,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 36))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } } } @@ -110025,14 +105462,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -110049,16 +105486,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -110169,11 +105606,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 76)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -110232,7 +105669,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16453) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16558) } goto insert_cleanup insert_cleanup: @@ -110355,33 +105792,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [4]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110628,7 +106038,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -112862,7 +107952,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16502, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16607, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -112882,7 +107972,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16506, uint32(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16611, uint32(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -112894,7 +107984,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16512, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16617, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112909,7 +107999,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16555, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16660, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -112940,7 +108030,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16587, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16692, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112949,7 +108039,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16467, + 0: __ccgo_ts + 16572, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113018,14 +108108,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -113040,7 +108125,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -113058,7 +108143,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == __ccgo_fp_xInit { break } goto _1 @@ -113073,7 +108158,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -113083,6 +108168,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -113094,7 +108181,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -113106,7 +108193,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) n++ @@ -113182,7 +108269,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16624, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16729, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113236,63 +108323,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5562, - 1: __ccgo_ts + 16663, - 2: __ccgo_ts + 9245, - 3: __ccgo_ts + 16667, - 4: __ccgo_ts + 16672, - 5: __ccgo_ts + 16675, - 6: __ccgo_ts + 16685, - 7: __ccgo_ts + 16695, - 8: __ccgo_ts + 16701, - 9: __ccgo_ts + 16705, - 10: __ccgo_ts + 16710, - 11: __ccgo_ts + 16715, - 12: __ccgo_ts + 16723, - 13: __ccgo_ts + 16734, - 14: __ccgo_ts + 16737, - 15: __ccgo_ts + 16744, - 16: __ccgo_ts + 16705, - 17: __ccgo_ts + 16710, - 18: __ccgo_ts + 16751, - 19: __ccgo_ts + 16756, - 20: __ccgo_ts + 16759, - 21: __ccgo_ts + 16766, - 22: __ccgo_ts + 16701, - 23: __ccgo_ts + 16705, - 24: __ccgo_ts + 16772, - 25: __ccgo_ts + 16777, - 26: __ccgo_ts + 16782, - 27: __ccgo_ts + 16705, - 28: __ccgo_ts + 16786, - 29: __ccgo_ts + 16710, - 30: __ccgo_ts + 16794, - 31: __ccgo_ts + 16798, - 32: __ccgo_ts + 16803, - 33: __ccgo_ts + 11984, - 34: __ccgo_ts + 11980, - 35: __ccgo_ts + 16809, - 36: __ccgo_ts + 16814, - 37: __ccgo_ts + 16819, - 38: __ccgo_ts + 16663, - 39: __ccgo_ts + 16705, - 40: __ccgo_ts + 16824, - 41: __ccgo_ts + 16831, - 42: __ccgo_ts + 16838, - 43: __ccgo_ts + 9245, - 44: __ccgo_ts + 16846, - 45: __ccgo_ts + 5565, - 46: __ccgo_ts + 16852, - 47: __ccgo_ts + 16663, - 48: __ccgo_ts + 16705, - 49: __ccgo_ts + 16857, - 50: __ccgo_ts + 16862, - 51: __ccgo_ts + 16048, - 52: __ccgo_ts + 16867, - 53: __ccgo_ts + 16880, - 54: __ccgo_ts + 16889, - 55: __ccgo_ts + 16896, - 56: __ccgo_ts + 16907, + 0: __ccgo_ts + 5592, + 1: __ccgo_ts + 16768, + 2: __ccgo_ts + 9303, + 3: __ccgo_ts + 16772, + 4: __ccgo_ts + 16777, + 5: __ccgo_ts + 16780, + 6: __ccgo_ts + 16790, + 7: __ccgo_ts + 16800, + 8: __ccgo_ts + 16806, + 9: __ccgo_ts + 16810, + 10: __ccgo_ts + 16815, + 11: __ccgo_ts + 16820, + 12: __ccgo_ts + 16828, + 13: __ccgo_ts + 16839, + 14: __ccgo_ts + 16842, + 15: __ccgo_ts + 16810, + 16: __ccgo_ts + 16849, + 17: __ccgo_ts + 16815, + 18: __ccgo_ts + 16857, + 19: __ccgo_ts + 16861, + 20: __ccgo_ts + 16866, + 21: __ccgo_ts + 16872, + 22: __ccgo_ts + 16810, + 23: __ccgo_ts + 16815, + 24: __ccgo_ts + 16879, + 25: __ccgo_ts + 16884, + 26: __ccgo_ts + 16887, + 27: __ccgo_ts + 16894, + 28: __ccgo_ts + 16806, + 29: __ccgo_ts + 16810, + 30: __ccgo_ts + 16900, + 31: __ccgo_ts + 16905, + 32: __ccgo_ts + 16910, + 33: __ccgo_ts + 16768, + 34: __ccgo_ts + 16810, + 35: __ccgo_ts + 16914, + 36: __ccgo_ts + 16921, + 37: __ccgo_ts + 16928, + 38: __ccgo_ts + 12042, + 39: __ccgo_ts + 12038, + 40: __ccgo_ts + 16936, + 41: __ccgo_ts + 16941, + 42: __ccgo_ts + 16946, + 43: __ccgo_ts + 9303, + 44: __ccgo_ts + 16951, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16957, + 47: __ccgo_ts + 16962, + 48: __ccgo_ts + 16153, + 49: __ccgo_ts + 16967, + 50: __ccgo_ts + 16768, + 51: __ccgo_ts + 16810, + 52: __ccgo_ts + 16980, + 53: __ccgo_ts + 16985, + 54: __ccgo_ts + 16994, + 55: __ccgo_ts + 17001, + 56: __ccgo_ts + 17012, } // C documentation @@ -113312,338 +108399,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16915, + FzName: __ccgo_ts + 17020, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16930, + FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16945, + FzName: __ccgo_ts + 17050, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16957, + FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16973, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16896, + FzName: __ccgo_ts + 17001, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16986, + FzName: __ccgo_ts + 17091, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 16998, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17018, + FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17034, + FzName: __ccgo_ts + 17139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17055, + FzName: __ccgo_ts + 17160, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17070, + FzName: __ccgo_ts + 17175, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17086, + FzName: __ccgo_ts + 17191, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17100, + FzName: __ccgo_ts + 17205, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17113, + FzName: __ccgo_ts + 17218, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17127, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17146, + FzName: __ccgo_ts + 17251, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17165, + FzName: __ccgo_ts + 17270, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17188, + FzName: __ccgo_ts + 17293, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17197, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17215, + FzName: __ccgo_ts + 17320, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17232, + FzName: __ccgo_ts + 17337, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17245, + FzName: __ccgo_ts + 17350, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17260, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17278, + FzName: __ccgo_ts + 17383, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17288, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17302, + FzName: __ccgo_ts + 17407, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17318, + FzName: __ccgo_ts + 17423, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17343, + FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17362, + FzName: __ccgo_ts + 17467, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17373, + FzName: __ccgo_ts + 17478, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17384, + FzName: __ccgo_ts + 17489, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17396, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17412, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17425, + FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17444, + FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17463, + FzName: __ccgo_ts + 17568, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17476, + FzName: __ccgo_ts + 17581, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17491, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17501, + FzName: __ccgo_ts + 17606, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17513, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17522, + FzName: __ccgo_ts + 17627, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17533, + FzName: __ccgo_ts + 17638, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17543, + FzName: __ccgo_ts + 17648, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17555, + FzName: __ccgo_ts + 17660, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17566, + FzName: __ccgo_ts + 17671, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17578, + FzName: __ccgo_ts + 17683, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17595, + FzName: __ccgo_ts + 17700, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17614, + FzName: __ccgo_ts + 17719, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17640, + FzName: __ccgo_ts + 17745, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17655, + FzName: __ccgo_ts + 17760, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17774, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17688, + FzName: __ccgo_ts + 17793, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17702, + FzName: __ccgo_ts + 17807, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17718, + FzName: __ccgo_ts + 17823, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17730, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17741, + FzName: __ccgo_ts + 17846, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17752, + FzName: __ccgo_ts + 17857, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113651,45 +108738,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17764, + FzName: __ccgo_ts + 17869, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17775, + FzName: __ccgo_ts + 17880, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17796, + FzName: __ccgo_ts + 17901, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17804, + FzName: __ccgo_ts + 17909, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17819, + FzName: __ccgo_ts + 17924, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17832, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17851, + FzName: __ccgo_ts + 17956, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17866, + FzName: __ccgo_ts + 17971, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113707,7 +108794,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -113815,10 +108902,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17882) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17987) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17892) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17997) { return PAGER_LOCKINGMODE_NORMAL } } @@ -113836,13 +108923,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8405) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8434) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17899) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18004) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17904) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18009) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -113865,10 +108952,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) <= int32('2') { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16857) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16980) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17916) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18021) == 0 { return int32(2) } else { return 0 @@ -113890,7 +108977,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17923, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18028, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) @@ -114020,15 +109107,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17985 + zName = __ccgo_ts + 18090 case int32(OE_SetDflt): - zName = __ccgo_ts + 17994 + zName = __ccgo_ts + 18099 case int32(OE_Cascade): - zName = __ccgo_ts + 18006 + zName = __ccgo_ts + 18111 case int32(OE_Restrict): - zName = __ccgo_ts + 18014 + zName = __ccgo_ts + 18119 default: - zName = __ccgo_ts + 18023 + zName = __ccgo_ts + 18128 break } return zName @@ -114049,12 +109136,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18033, - 1: __ccgo_ts + 18040, - 2: __ccgo_ts + 18048, - 3: __ccgo_ts + 18052, - 4: __ccgo_ts + 17916, - 5: __ccgo_ts + 18061, + 0: __ccgo_ts + 18138, + 1: __ccgo_ts + 18145, + 2: __ccgo_ts + 18153, + 3: __ccgo_ts + 18157, + 4: __ccgo_ts + 18021, + 5: __ccgo_ts + 18166, } // C documentation @@ -114116,15 +109203,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18086 + zType = __ccgo_ts + 18191 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18088 + zType = __ccgo_ts + 18193 } else { - zType = __ccgo_ts + 7804 + zType = __ccgo_ts + 7833 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18090, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18195, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -114133,9 +109220,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18065, - 2: __ccgo_ts + 18070, - 3: __ccgo_ts + 18078, + 1: __ccgo_ts + 18170, + 2: __ccgo_ts + 18175, + 3: __ccgo_ts + 18183, } // C documentation @@ -114234,7 +109321,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18097, libc.VaList(bp+136, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18202, libc.VaList(bp+136, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114277,7 +109364,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+136, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+136, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114322,7 +109409,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint32(libc.Uint32FromInt64(36)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114381,7 +109468,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18101) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18206) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114424,7 +109511,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 24)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114452,7 +109539,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17892 + zRet = __ccgo_ts + 17997 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114480,7 +109567,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17882 + zRet = __ccgo_ts + 17987 } _returnSingleText(tls, v, zRet) break @@ -114770,7 +109857,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uint8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+56) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 56)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18106, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18211, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114780,7 +109867,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*uint8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+136, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+136, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -114802,7 +109889,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18131, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18236, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -114834,8 +109921,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 32)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18184) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18289) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -114915,9 +110003,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18190 + v14 = __ccgo_ts + 18295 } else { - v14 = __ccgo_ts + 18198 + v14 = __ccgo_ts + 18303 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 { v15 = int32(1) @@ -114929,7 +110017,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+136, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+136, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667), v15, v16, k, isHidden)) goto _12 _12: ; @@ -114988,7 +110076,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18205, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18310, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 60)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+60, uintptr(0)) @@ -114996,7 +110084,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FpSchema + 8 @@ -115018,19 +110106,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13231 + zType = __ccgo_ts + 13289 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18221 + zType = __ccgo_ts + 18326 } else { - zType = __ccgo_ts + 9245 + zType = __ccgo_ts + 9303 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18228, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18333, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -115077,9 +110165,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*12))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18235, libc.VaList(bp+136, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18340, libc.VaList(bp+136, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18240, libc.VaList(bp+136, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18345, libc.VaList(bp+136, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -115103,11 +110191,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18245, - 1: __ccgo_ts + 18247, - 2: __ccgo_ts + 16734, + 0: __ccgo_ts + 18350, + 1: __ccgo_ts + 18352, + 2: __ccgo_ts + 16839, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18249, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18354, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -115126,7 +110214,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18255, libc.VaList(bp+136, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18360, libc.VaList(bp+136, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt))) goto _24 _24: ; @@ -115143,7 +110231,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18259, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18364, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115193,7 +110281,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+136, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+136, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -115205,7 +110293,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint32(libc.Uint32FromInt64(1056)/libc.Uint32FromInt64(16))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+136, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+136, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -115231,7 +110319,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18262, libc.VaList(bp+136, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FiFrom)*12))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25))), __ccgo_ts+18271)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18367, libc.VaList(bp+136, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FiFrom)*12))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25))), __ccgo_ts+18376)) goto _32 _32: ; @@ -115245,8 +110333,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(4) - v34 = pParse + 48 + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(4) + v34 = pParse + 52 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115372,7 +110460,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18276, libc.VaList(bp+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18381, libc.VaList(bp+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 68))) @@ -115468,7 +110556,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115563,7 +110651,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18280, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18385, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115574,7 +110662,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18304) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18409) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115710,7 +110798,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 76)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18333, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115772,7 +110860,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 76)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115794,7 +110882,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18369, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18474, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -115807,7 +110895,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18389, libc.VaList(bp+136, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18494, libc.VaList(bp+136, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -115815,7 +110903,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18411, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18516, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -115826,10 +110914,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 76)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18434, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18539, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18436, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -115863,7 +110951,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18456, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18561, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -115887,9 +110975,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 80))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18491) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18596) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -115902,9 +110990,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 80))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18512) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18617) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18548) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18653) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -115932,9 +111020,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18559) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18664) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -115962,7 +111050,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 80))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18586) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18691) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116059,7 +111147,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 72)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*20))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 18613 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 18718 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*20))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116138,7 +111226,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18674, libc.VaList(bp+136, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18779, libc.VaList(bp+136, zRight)) } } } @@ -116243,13 +111331,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17899) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18004) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18699) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18804) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18052) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18157) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116384,7 +111472,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 44 + v70 = pParse + 48 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116414,7 +111502,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6651, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6680, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116476,7 +111564,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18707, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18812, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116749,34 +111837,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18616, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18621, + FzName: __ccgo_ts + 18726, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18627, + FzName: __ccgo_ts + 18732, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18636, + FzName: __ccgo_ts + 18741, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18645, + FzName: __ccgo_ts + 18750, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18653, + FzName: __ccgo_ts + 18758, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18661, + FzName: __ccgo_ts + 18766, }, 7: { - FzName: __ccgo_ts + 18668, + FzName: __ccgo_ts + 18773, }, 8: {}, } @@ -116834,26 +111922,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -116874,14 +111942,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18725) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18830) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18740, libc.VaList(bp+232, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18845, libc.VaList(bp+232, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -116890,19 +111958,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18747, libc.VaList(bp+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18852, libc.VaList(bp+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18753) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18765) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18870) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+24) if rc == SQLITE_OK { @@ -116917,7 +111985,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+232, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+232, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -117098,7 +112166,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+32, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+32, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -117110,13 +112178,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 120 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18780) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18885) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18788, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18893, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 16)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18897, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117125,7 +112193,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+4, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+32, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+32, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117251,24 +112319,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18826, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18931, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*4)) } else { - v1 = __ccgo_ts + 5173 + v1 = __ccgo_ts + 5203 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18854, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18885, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18990, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -117276,9 +112344,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18796, - 1: __ccgo_ts + 18803, - 2: __ccgo_ts + 18815, + 0: __ccgo_ts + 18901, + 1: __ccgo_ts + 18908, + 2: __ccgo_ts + 18920, } // C documentation @@ -117354,7 +112422,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), db+172) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } libc.SetBitFieldPtr8Uint32(db+172+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117387,11 +112455,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18893) + _corruptSchema(tls, pData, argv, __ccgo_ts+18998) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), pIndex+44) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } } @@ -117430,18 +112498,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9245 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9303 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8317 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18906 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8346 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19011 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 44))).FiDb = iDb @@ -117525,7 +112593,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12282) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12340) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117551,7 +112619,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18978) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19083) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117566,7 +112634,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 44))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19002, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19107, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+44, uintptr(0)) @@ -117862,7 +112930,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -117875,9 +112943,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -117895,13 +112963,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+168)-uint32(libc.UintptrFromInt32(0)+4)) - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+136)-uint32(libc.UintptrFromInt32(0)+4)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1637, 0) } } @@ -117924,8 +112992,8 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+168)-uint32(libc.UintptrFromInt32(0)+4)) - libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+136)-uint32(libc.UintptrFromInt32(0)+4)) + libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp (*(*TParse)(unsafe.Pointer(bp))).Fdb = db @@ -117935,7 +113003,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1637, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -117984,7 +113052,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19036, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19141, libc.VaList(bp+296, zDb)) goto end_prepare } } @@ -118000,7 +113068,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 120 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19066, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19171, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118023,10 +113091,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+32, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 32))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -118034,7 +113102,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3860, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -118064,7 +113132,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118198,7 +113266,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118320,15 +113388,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118364,21 +113423,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118458,7 +113502,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 112 + v3 = pParse + 100 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118466,7 +113510,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118622,15 +113666,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11389 - zSp2 = __ccgo_ts + 11389 + zSp1 = __ccgo_ts + 11447 + zSp2 = __ccgo_ts + 11447 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19085, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19190, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118687,25 +113731,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 64 + uintptr(uint32(h)%uint32(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 12 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -118837,13 +113884,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 36)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 { @@ -118921,7 +113968,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 40)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19115, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19220, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -118971,12 +114018,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 4 + uintptr(j)*4))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19165, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19270, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*48, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -118991,9 +114038,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*48 + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*48 + 40)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19229, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19334, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119003,6 +114051,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = uint8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*48))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -119037,7 +114092,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6856, + Fz: __ccgo_ts + 6885, Fn: uint32(8), } @@ -119054,13 +114109,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -119085,7 +114133,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -119130,7 +114178,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nBase + *(*int32)(unsafe.Pointer(pParse + 52)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -119154,7 +114202,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -119175,7 +114223,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119298,7 +114346,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119425,10 +114473,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 48)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119436,7 +114484,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119613,7 +114661,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119724,8 +114772,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint32(libc.Uint32FromInt32(N+X)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(1)) - uint32(4)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(24)+libc.Uint32FromInt32(nExtra))) + nExtra = libc.Int32FromUint32(libc.Uint32FromInt32(N+X) * (libc.Uint32FromInt64(4) + libc.Uint32FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(0))*libc.Uint32FromInt64(4)+libc.Uint32FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 20 + uintptr(N+X)*4 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119733,7 +114781,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*24, 0, libc.Uint32FromInt32(nExtra)) + libc.Xmemset(tls, p+20, 0, libc.Uint32FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -119818,13 +114866,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19286 + z = __ccgo_ts + 19391 case int32(TK_INTERSECT): - z = __ccgo_ts + 19296 + z = __ccgo_ts + 19401 case int32(TK_EXCEPT): - z = __ccgo_ts + 19306 + z = __ccgo_ts + 19411 default: - z = __ccgo_ts + 19313 + z = __ccgo_ts + 19418 break } return z @@ -119845,7 +114893,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+8, zUsage)) } /* @@ -119882,13 +114930,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19342 + v1 = __ccgo_ts + 19447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19356, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19461, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19387, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19492, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -119912,11 +114960,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 44 + v5 = pParse + 48 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -120131,8 +115179,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1137 - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16846 + zType = __ccgo_ts + 1141 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 16951 } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, uintptr(0)) @@ -120245,7 +115293,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -120254,7 +115302,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -120278,13 +115326,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16846 + zCol = __ccgo_ts + 16951 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120292,7 +115340,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120384,7 +115432,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName } else { - v3 = __ccgo_ts + 16846 + v3 = __ccgo_ts + 16951 } zName = v3 } else { @@ -120399,7 +115447,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+32, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+32, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120435,7 +115483,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+32, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19547, libc.VaList(bp+32, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120554,7 +115602,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != libc.Int32FromUint8(_sqlite3AffinityType(tls, zType, uintptr(0))) { if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19450 + zType = __ccgo_ts + 19555 } else { zType = uintptr(0) j = int32(1) @@ -120620,7 +115668,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return uintptr(0) } @@ -120648,7 +115696,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120698,7 +115746,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120721,7 +115769,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -120869,7 +115917,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19454, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19559, 0) return } /* Obtain authorization to do a recursive query */ @@ -120906,7 +115954,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -120917,7 +115965,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 44 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -120931,7 +115979,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -120962,7 +116010,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19503, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19608, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -120977,7 +116025,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19545, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19650, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121005,7 +116053,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19551, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19656, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121058,11 +116106,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } else { - v1 = __ccgo_ts + 19566 + v1 = __ccgo_ts + 19671 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19568, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19673, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -121170,8 +116218,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19591, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19606, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19696, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19711, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121196,7 +116244,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19286, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19391, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121222,7 +116270,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -121248,7 +116296,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 32))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+32) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121280,11 +116328,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 44 + v6 = pParse + 48 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121306,7 +116354,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 60))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+96, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+60) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121413,6 +116461,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121429,9 +116478,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19646, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19751, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19692, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19797, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121502,7 +116551,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121750,7 +116799,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -121804,16 +116853,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7554) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7583) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -121831,32 +116880,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 48 + v16 = pParse + 52 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 48 + v18 = pParse + 52 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 48 + v20 = pParse + 52 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 48 + v22 = pParse + 52 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+28, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19774, libc.VaList(bp+64, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19879, libc.VaList(bp+64, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19785, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19890, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121869,7 +116918,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19790, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19895, 0) _sqlite3Select(tls, pParse, p, bp+28) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122079,11 +117128,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5151 + v1 = __ccgo_ts + 5181 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 36)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -122244,7 +117293,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122434,9 +117483,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122648,7 +117697,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122795,7 +117844,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 112 + v5 = pParse + 100 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -123034,18 +118083,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -123085,7 +118122,7 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ @@ -123154,7 +118191,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -123172,12 +118209,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*4)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123659,7 +118696,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123705,13 +118742,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15705) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15790) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15709) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15794) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123799,8 +118836,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19796, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19901, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 36)) = pIdx @@ -123824,7 +118861,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -123906,7 +118943,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -123924,7 +118961,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 12 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19814, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19919, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124072,7 +119109,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return int32(2) } @@ -124100,7 +119137,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 44)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 12 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19837, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+12+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124122,12 +119159,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+12+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19857, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19962, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -124144,7 +119181,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19900 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20005 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -124175,7 +119212,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19923, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20028, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -124184,9 +119221,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+34, pTab+4) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19961 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20066 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19995 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20100 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124235,7 +119272,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 44)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(64)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(80)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -124245,7 +119282,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20033, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20138, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124341,7 +119378,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 112 + v2 = pParse + 100 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124350,7 +119387,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(36)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+12)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124401,7 +119438,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20037, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124416,7 +119453,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20076, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20181, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124431,7 +119468,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 44))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124555,7 +119592,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName } else { - v10 = __ccgo_ts + 6716 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124572,7 +119609,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20107, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124651,7 +119688,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*20))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20112, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20217, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124664,7 +119701,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+8+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124684,9 +119721,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20121, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20226, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20139, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) } } } @@ -124700,7 +119737,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20159, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20264, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -124897,14 +119934,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*16))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*20))).FiSorterColumn if k > mx { mx = k } @@ -124913,7 +119950,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -124945,11 +119982,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*20 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125002,7 +120039,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -125039,12 +120076,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 20)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 20)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20190, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20295, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 20)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20241, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20346, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125065,7 +120102,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20274, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20379, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125204,7 +120241,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125312,7 +120349,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125356,7 +120393,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 16 + pC += 20 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125379,16 +120416,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20307 + v1 = __ccgo_ts + 20412 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20330, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20435, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125420,7 +120457,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125549,6 +120586,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125577,7 +120615,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+15999) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16104) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { @@ -125610,9 +120648,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125622,13 +120660,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125648,7 +120686,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -125821,8 +120859,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(160) defer tls.Free(160) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -125831,11 +120869,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+84 */ TNameContext var _ /* sSort at bp+12 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 52)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 52)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -125851,7 +120889,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -125875,14 +120913,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20342, libc.VaList(bp+128, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20447, libc.VaList(bp+128, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -125983,7 +121021,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20396, libc.VaList(bp+128, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20501, libc.VaList(bp+128, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -126141,7 +121179,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 44)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1663, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1667, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -126161,7 +121199,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** more conservative than necessary, but much easier than enforcing ** an exact limit. */ - *(*int32)(unsafe.Pointer(pParse + 232)) += _sqlite3SelectExprHeight(tls, p) + *(*int32)(unsafe.Pointer(pParse + 228)) += _sqlite3SelectExprHeight(tls, p) /* Make copies of constant WHERE-clause terms in the outer query down ** inside the subquery. This can help the subquery to run more efficiently. ** This is the "predicate push-down optimization". tag-select-0420 @@ -126184,14 +121222,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 48 + v13 = pParse + 52 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+56, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20436, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20541, libc.VaList(bp+128, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+56) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+12+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -126223,7 +121261,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 48 + v16 = pParse + 52 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -126238,7 +121276,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+56, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20451, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20556, libc.VaList(bp+128, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+56) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126260,7 +121298,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto select_end } - *(*int32)(unsafe.Pointer(pParse + 232)) -= _sqlite3SelectExprHeight(tls, p) + *(*int32)(unsafe.Pointer(pParse + 228)) -= _sqlite3SelectExprHeight(tls, p) (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext goto _11 _11: @@ -126292,7 +121330,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126325,7 +121363,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 44 + v20 = pParse + 48 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FiECursor = v19 @@ -126384,7 +121422,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 44 + v25 = pParse + 48 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126413,6 +121451,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126435,10 +121480,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 48 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 52 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126472,8 +121517,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 16))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 20 @@ -126488,8 +121533,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 16))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 20 @@ -126518,8 +121563,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126536,7 +121581,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(44)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(48)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126549,11 +121594,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 84))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 84 + 8)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+84, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+84, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy) @@ -126587,49 +121632,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 44 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 48 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 48 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 48 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 48 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 52 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 52 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 52 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 48 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 52 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126637,16 +121683,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126664,11 +121710,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20467 + v47 = __ccgo_ts + 20572 } else { - v46 = __ccgo_ts + 20476 + v47 = __ccgo_ts + 20581 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+128, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+128, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126678,12 +121724,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*16))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126696,13 +121742,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*16 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126713,12 +121759,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 44 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 48 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126767,12 +121813,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*20))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -126842,9 +121892,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -126861,10 +121911,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 44 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 48 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -126891,8 +121941,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -126932,32 +121982,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 48 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 52 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 20)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -126999,7 +122049,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20467) + _explainTempTable(tls, pParse, __ccgo_ts+20572) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -127105,7 +122155,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4)))) if z == uintptr(0) { goto malloc_failed } @@ -127121,7 +122171,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20485, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20590, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127211,7 +122261,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127373,7 +122423,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20550, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) goto trigger_cleanup } iDb = int32(1) @@ -127413,7 +122463,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+20596, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+20701, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+4, pTableName) != 0 { goto trigger_cleanup } @@ -127423,11 +122473,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20604, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20709, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20645, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20750, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127436,13 +122486,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20596, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20701, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema+40, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20685, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20790, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127450,8 +122500,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20711, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20816, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127459,15 +122509,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20749 + v1 = __ccgo_ts + 20854 } else { - v1 = __ccgo_ts + 20756 + v1 = __ccgo_ts + 20861 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20762, libc.VaList(bp+64, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20867, libc.VaList(bp+64, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20799, libc.VaList(bp+64, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20904, libc.VaList(bp+64, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127487,9 +122537,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127589,7 +122639,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+56, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20596, bp+56) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20701, bp+56) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127611,7 +122661,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20845, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20950, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127627,10 +122677,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20893, libc.VaList(bp+72, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20998, libc.VaList(bp+72, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20968, libc.VaList(bp+72, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21073, libc.VaList(bp+72, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -127898,11 +122948,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20997, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -127940,9 +122990,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -127957,7 +123007,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21017, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -128090,11 +123140,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21079 + v1 = __ccgo_ts + 21184 } else { - v1 = __ccgo_ts + 21086 + v1 = __ccgo_ts + 21191 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21093, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21198, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128196,7 +123246,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21246, 0) return int32(1) } @@ -128344,12 +123394,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(176) defer tls.Free(176) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+80 */ TSrcList - var _ /* sNC at bp+136 */ TNameContext + var _ /* fromSpace at bp+76 */ [56]Tu8 + var _ /* sNC at bp+132 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128357,19 +123407,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+8 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint32(76)) - libc.Xmemset(tls, bp+80, 0, uint32(56)) + pFrom = bp + 76 + libc.Xmemset(tls, pFrom, 0, uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 80 - (*(*TSrcList)(unsafe.Pointer(bp + 80))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 80 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 80 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 80 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128377,24 +123430,24 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab _sqlite3ExprListDelete(tls, db, (*(*TSelect)(unsafe.Pointer(bp))).FpEList) pNew = _sqlite3ExpandReturning(tls, pParse, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, pTab) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - libc.Xmemset(tls, bp+136, 0, uint32(36)) + libc.Xmemset(tls, bp+132, 0, uint32(36)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 } - (*(*TNameContext)(unsafe.Pointer(bp + 136))).FpParse = pParse - *(*int32)(unsafe.Pointer(bp + 136 + 8)) = regIn - (*(*TNameContext)(unsafe.Pointer(bp + 136))).FncFlags = int32(NC_UBaseReg) + (*(*TNameContext)(unsafe.Pointer(bp + 132))).FpParse = pParse + *(*int32)(unsafe.Pointer(bp + 132 + 8)) = regIn + (*(*TNameContext)(unsafe.Pointer(bp + 132))).FncFlags = int32(NC_UBaseReg) (*TParse)(unsafe.Pointer(pParse)).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab = pTab - if _sqlite3ResolveExprListNames(tls, bp+136, pNew) == SQLITE_OK && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + if _sqlite3ResolveExprListNames(tls, bp+132, pNew) == SQLITE_OK && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 48)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128462,7 +123515,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+40, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+40, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128513,8 +123566,8 @@ func _transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** implementing trigger pTrigger with ON CONFLICT policy orconf. // */ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) (r uintptr) { - bp := tls.Alloc(352) - defer tls.Free(352) + bp := tls.Alloc(336) + defer tls.Free(336) var db, pPrg, pProgram, pTop, pWhen, v, v1, v2 uintptr var iEndTrigger int32 var _ /* sNC at bp+0 */ TNameContext @@ -128561,10 +123614,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 36))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 36))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 36))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 36))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 36))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+36) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21183, libc.VaList(bp+336, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21288, libc.VaList(bp+328, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128586,7 +123641,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+36) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+108) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+96) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 36))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 36))).FnTab @@ -128658,7 +123713,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -129074,13 +124129,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(96) defer tls.Free(96) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+48 */ [2]int32 var _ /* bReplace at bp+56 */ int32 var _ /* iNotUsed1 at bp+60 */ int32 @@ -129088,21 +124143,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+8 */ TNameContext var _ /* tmask at bp+44 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -129149,7 +124204,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -129232,58 +124287,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+8, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21197, libc.VaList(bp+80, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21302, libc.VaList(bp+80, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+80, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+80, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8092 + v10 = __ccgo_ts + 8121 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129313,17 +124356,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129335,11 +124378,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129355,11 +124398,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 48 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 48)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 52 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 52)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129368,18 +124411,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 48 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 48)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 52 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 52)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 56)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129388,16 +124431,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 48 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 52 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 56)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129415,24 +124458,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 48 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 52 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 48 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 52 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129458,50 +124501,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*20))).FpExpr, k) @@ -129799,8 +124842,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -129850,8 +124893,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -129898,11 +124941,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -129914,11 +124957,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -129961,7 +125004,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21252) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21357) } goto update_cleanup update_cleanup: @@ -130018,13 +125061,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nArg + *(*int32)(unsafe.Pointer(pParse + 52)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -130066,11 +125109,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 48 + v7 = pParse + 52 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130395,9 +125438,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]uint8)(unsafe.Pointer(bp + 140)))[0] = uint8(0) } else { - Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+21265, libc.VaList(bp+168, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+21370, libc.VaList(bp+168, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21269, libc.VaList(bp+168, bp+140)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21374, libc.VaList(bp+168, bp+140)) return int32(SQLITE_ERROR) } goto _1 @@ -130486,13 +125529,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPk + *(*int32)(unsafe.Pointer(pParse + 52)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130500,7 +125543,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12657, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12715, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130582,7 +125625,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21342, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21346, uint32(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21447, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21451, uint32(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130673,7 +125716,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130712,24 +125755,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21350) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21455) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21390) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21495) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21433) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21538) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 60)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 60)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1663 + zOut = __ccgo_ts + 1667 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -130739,7 +125782,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 32)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 32)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21482) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21587) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_VacuumInto) @@ -130792,7 +125835,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15034) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15092) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130823,11 +125866,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21509, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21614, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21617, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21722, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130836,7 +125879,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21671, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21776, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 24)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -130846,7 +125889,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21808, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21913, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -130937,39 +125980,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -130980,7 +125990,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -130999,7 +126009,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -131024,15 +126034,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -131047,13 +126057,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131373,7 +126385,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 44))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131496,24 +126508,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32((*TToken)(unsafe.Pointer(pEnd)).Fz)-int32((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21931, libc.VaList(bp+8, pParse+204)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22036, libc.VaList(bp+8, pParse+172)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21955, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22060, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22054, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131554,7 +126571,7 @@ func _sqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { var pArg uintptr _ = pArg - pArg = pParse + 268 + pArg = pParse + 264 if (*TToken)(unsafe.Pointer(pArg)).Fz == uintptr(0) { (*TToken)(unsafe.Pointer(pArg)).Fz = (*TToken)(unsafe.Pointer(p)).Fz (*TToken)(unsafe.Pointer(pArg)).Fn = (*TToken)(unsafe.Pointer(p)).Fn @@ -131570,7 +126587,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131597,7 +126614,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22073, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22178, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131631,7 +126648,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8, bp+16) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8, bp+16) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131639,9 +126656,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22115, libc.VaList(bp+32, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22220, libc.VaList(bp+32, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3860, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 16)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 16)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } _sqlite3DbFree(tls, db, pVTable) @@ -131654,7 +126671,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22145 + zFormat = __ccgo_ts + 22250 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+32, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131680,7 +126697,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, __ccgo_ts+1663) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, __ccgo_ts+1667) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -131688,7 +126705,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16737, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16842, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131769,13 +126786,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 44))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22191, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22296, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -131856,7 +126873,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22191, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22296, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -131880,13 +126897,13 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, // ** virtual table module. // */ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r int32) { - bp := tls.Alloc(320) - defer tls.Free(320) + bp := tls.Alloc(304) + defer tls.Free(304) var i, initBusy, rc int32 var pCtx, pIdx, pNew, pTab, z, v3 uintptr var v2 Ti16 var _ /* sParse at bp+0 */ TParse - var _ /* tokenType at bp+288 */ int32 + var _ /* tokenType at bp+284 */ int32 _, _, _, _, _, _, _, _, _, _ = i, initBusy, pCtx, pIdx, pNew, pTab, rc, z, v2, v3 rc = SQLITE_OK /* Verify that the first two keywords in the CREATE TABLE statement @@ -131899,12 +126916,12 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i if !(_aKeyword1[i] != 0) { break } - *(*int32)(unsafe.Pointer(bp + 288)) = 0 - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 288)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp + 288)) == int32(TK_COMMENT) { - z += uintptr(_sqlite3GetToken(tls, z, bp+288)) + *(*int32)(unsafe.Pointer(bp + 284)) = 0 + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 284)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp + 284)) == int32(TK_COMMENT) { + z += uintptr(_sqlite3GetToken(tls, z, bp+284)) } - if *(*int32)(unsafe.Pointer(bp + 288)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22210, 0) + if *(*int32)(unsafe.Pointer(bp + 284)) != libc.Int32FromUint8(_aKeyword1[i]) { + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22315, 0) return int32(SQLITE_ERROR) } goto _1 @@ -131915,9 +126932,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -131959,11 +126976,11 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3860 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), v3, libc.VaList(bp+304, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), v3, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) rc = int32(SQLITE_ERROR) } @@ -132373,7 +127390,7 @@ func _sqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { apVtabLock = _sqlite3Realloc(tls, (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock, libc.Uint64FromInt32(n)) if apVtabLock != 0 { (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock - v4 = pToplevel + 228 + v4 = pToplevel + 224 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ *(*uintptr)(unsafe.Pointer((*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock + uintptr(v3)*4)) = pTab @@ -132415,7 +127432,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return 0 } @@ -132435,7 +127452,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132499,7 +127516,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132512,7 +127529,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132788,454 +127805,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - F__ccgo_align [0]uint32 - FpNext uintptr - F__ccgo_align1 [4]byte - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - F__ccgo_align [0]uint32 - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - F__ccgo_align21 [4]byte - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - F__ccgo_align [0]uint32 - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - F__ccgo_align [0]uint32 - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst - F__ccgo_pad3 [4]byte -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - F__ccgo_align [0]uint32 - Fn Tu16 - F__ccgo_align1 [6]byte - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - F__ccgo_align [0]uint32 - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr - F__ccgo_pad7 [4]byte -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - F__ccgo_align [0]uint32 - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff uint8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - F__ccgo_align [0]uint32 - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - F__ccgo_align8 [4]byte - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - F__ccgo_align [0]uint32 - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - F__ccgo_align [0]uint32 - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - F__ccgo_align [0]uint32 - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo48 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - F__ccgo_align26 [4]byte - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -133267,10 +127836,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22223 + return __ccgo_ts + 22328 } if i == -int32(1) { - return __ccgo_ts + 16846 + return __ccgo_ts + 16951 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*12))).FzCnName } @@ -133289,10 +127858,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133300,7 +127869,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133309,11 +127878,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133321,16 +127890,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } } @@ -133377,7 +127946,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22343, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133385,12 +127954,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22241 + v2 = __ccgo_ts + 22346 } else { - v2 = __ccgo_ts + 22246 + v2 = __ccgo_ts + 22351 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133407,7 +127976,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22254) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22359) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133418,9 +127987,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22256) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22361) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133465,11 +128034,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+24, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22258 + v2 = __ccgo_ts + 22363 } else { - v2 = __ccgo_ts + 22265 + v2 = __ccgo_ts + 22370 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22270, libc.VaList(bp+136, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22375, libc.VaList(bp+136, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133482,37 +128051,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11440 + zFmt = __ccgo_ts + 11498 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22276 + zFmt = __ccgo_ts + 22381 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22309 + zFmt = __ccgo_ts + 22414 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22334 + zFmt = __ccgo_ts + 22439 } else { - zFmt = __ccgo_ts + 22352 + zFmt = __ccgo_ts + 22457 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22361, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22466, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16846 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22369, libc.VaList(bp+136, zRowid)) + zRowid = __ccgo_ts + 16951 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22474, libc.VaList(bp+136, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = uint8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22400, libc.VaList(bp+136, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22505, libc.VaList(bp+136, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133522,14 +128091,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22410, libc.VaList(bp+136, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, libc.VaList(bp+136, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22415) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22520) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22437 + v3 = __ccgo_ts + 22542 } else { - v3 = __ccgo_ts + 22445 + v3 = __ccgo_ts + 22550 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+136, (*(*struct { FidxNum int32 @@ -133550,7 +128119,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22451, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22556, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133580,10 +128149,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133616,14 +128185,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+24, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22462, libc.VaList(bp+136, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22567, libc.VaList(bp+136, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+136, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+136, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22483, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22588, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133647,16 +128216,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22335, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+136, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+136, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -133861,7 +128430,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -133917,8 +128486,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)) + 24))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr = uintptr(0) if pRhs != 0 { @@ -133940,7 +128509,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 20)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 112 + v4 = pParse + 100 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -133997,10 +128566,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -134055,37 +128624,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*libc.Uint32FromInt32(nEq))) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*libc.Uint32FromInt32(v3))) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint32(4)*libc.Uint32FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -134132,24 +128687,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -134161,8 +128716,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -134220,7 +128775,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -134302,7 +128857,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134570,7 +129125,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134715,7 +129270,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134776,11 +129331,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 44 + v10 = pParse + 48 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134811,6 +129366,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -134949,7 +129507,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 48 + v21 = pParse + 52 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -135029,7 +129587,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 48 + v28 = pParse + 52 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -135063,7 +129621,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 48 + v33 = pParse + 52 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -135185,7 +129743,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 48 + v40 = pParse + 52 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135378,7 +129936,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135392,12 +129950,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135435,11 +129994,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 44 + v45 = pParse + 48 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 48 + v47 = pParse + 52 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135459,7 +130018,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(56)+libc.Uint32FromInt32(nNotReady)*uint32(48))) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint32FromInt64(48))) if pOrTab == uintptr(0) { return notReady } @@ -135495,21 +130054,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 48 + v50 = pParse + 52 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 44 + v52 = pParse + 48 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 48 + v54 = pParse + 52 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135527,7 +130086,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135582,7 +130141,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22491, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22596, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135605,7 +130164,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22506, libc.VaList(bp+72, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22611, libc.VaList(bp+72, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+760, uint16(0)) @@ -136094,9 +130653,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(80) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [56]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -136105,14 +130664,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*48 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22515, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22620, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760 + uintptr(k)*88))).FiFrom)*48 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760 + uintptr(k)*88))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760 + uintptr(k)*88))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 44)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -136151,15 +130710,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint32(48)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint32(48)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -136171,7 +130731,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -136642,19 +131202,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16695, + FzOp: __ccgo_ts + 16800, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16029, + FzOp: __ccgo_ts + 16134, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15508, + FzOp: __ccgo_ts + 15593, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22529, + FzOp: __ccgo_ts + 22634, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137174,37 +131734,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 uint8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if libc.Int32FromUint8(aff1) != libc.Int32FromUint8(aff2) && (!(libc.Int32FromUint8(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(libc.Int32FromUint8(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137442,7 +132006,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } } else { @@ -137454,10 +132018,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137516,7 +132080,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 p5 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 12 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137538,7 +132102,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8078 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8107 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137639,7 +132203,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { - v13 = __ccgo_ts + 22577 + v13 = __ccgo_ts + 22682 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138170,7 +132734,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22584, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -138242,22 +132806,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138370,7 +132922,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 760 + uintptr(i)*88 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -139286,7 +133838,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141537,13 +136090,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 12 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141643,6 +136191,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141656,12 +136205,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) + 24))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 24))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -142107,7 +136673,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -142158,15 +136724,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -142198,7 +136755,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -142217,7 +136774,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -142254,7 +136811,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(48) defer tls.Free(48) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+12 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -142262,7 +136819,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -142283,19 +136840,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+12, 0, uint32(28)) (*(*TWalker)(unsafe.Pointer(bp + 12))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 12))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 12 + 24)) = bp _sqlite3WalkSelect(tls, bp+12, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142391,7 +136948,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 80 + pArg = pParse + 84 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142569,7 +137126,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142597,6 +137154,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142673,7 +137238,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+112, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -142910,7 +137475,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142985,7 +137550,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143139,7 +137704,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 20 + uintptr(iCons)*4)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143575,7 +138140,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22683, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22788, 0) rc = SQLITE_OK } else { break @@ -143804,17 +138369,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*48))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144783,7 +139337,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22718, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22823, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145361,7 +139915,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 76 + pArg = pParse + 80 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145517,7 +140071,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22736, libc.VaList(bp+40, libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22841, libc.VaList(bp+40, libc.Int32FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145538,10 +140092,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint32((libc.Uint32FromInt64(848) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint32((libc.Uint32FromInt32(nByteWInfo) + libc.Uint32FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint32FromInt64(88) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) - } + nByteWInfo = libc.Int32FromUint32((uint32(libc.UintptrFromInt32(0)+760) + libc.Uint32FromInt32(nTabList)*libc.Uint32FromInt64(88) + libc.Uint32FromInt32(7)) & libc.Uint32FromInt32(^libc.Int32FromInt32(7))) pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint32FromInt32(nByteWInfo)+uint32(72))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) @@ -145590,7 +140141,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22764, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22869, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145735,7 +140286,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 50 @@ -145769,7 +140321,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 160 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 16 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145791,7 +140343,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145804,7 +140356,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -145895,11 +140447,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 44 + v17 = pParse + 48 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -145926,16 +140478,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 44 + v21 = pParse + 48 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 48 + v23 = pParse + 52 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 48 + v25 = pParse + 52 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -145983,7 +140535,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 760 + uintptr(ii)*88 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*48 if int32(*(*uint32)(unsafe.Pointer(pSrc + 12 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -146114,7 +140666,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 48)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -146292,7 +140844,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146321,7 +140873,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146331,7 +140883,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22782, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22887, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146381,7 +140933,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 26 + p12 = pParse + 25 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146653,7 +141205,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22811, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22916, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146836,7 +141388,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22867, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22972, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147162,7 +141714,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22912, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23017, libc.VaList(bp+8, zName)) } return p } @@ -147213,12 +141765,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23036, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23107, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147291,7 +141843,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) } break } @@ -147322,16 +141874,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147350,17 +141892,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*48))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*48))).FiCursor { break } goto _1 @@ -147378,7 +141920,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147402,13 +141944,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*20))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*20))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147423,23 +141965,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint32(52)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147455,13 +141997,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147573,7 +142115,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23065, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23170, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147609,7 +142151,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147624,7 +142166,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147643,11 +142185,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147693,11 +142235,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147714,7 +142256,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147736,7 +142278,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint32(64)) + libc.Xmemcpy(tls, pTab, pTab2, uint32(80)) *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -147860,7 +142402,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23091, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23196, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(100)) @@ -147928,18 +142470,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23123 + zErr = __ccgo_ts + 23228 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23140 + zErr = __ccgo_ts + 23245 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23156 + zErr = __ccgo_ts + 23261 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23176, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -147963,7 +142505,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23209, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23314, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148069,24 +142611,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 44 + v8 = pParse + 48 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -148104,12 +142646,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 44 + v11 = pParse + 48 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(3) if pKeyInfo != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -148121,15 +142663,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 44 + v13 = pParse + 48 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 44 + v15 = pParse + 48 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -148162,7 +142704,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -148181,11 +142723,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23256, - 1: __ccgo_ts + 23309, - 2: __ccgo_ts + 22811, - 3: __ccgo_ts + 23360, - 4: __ccgo_ts + 23412, + 0: __ccgo_ts + 23361, + 1: __ccgo_ts + 23414, + 2: __ccgo_ts + 22916, + 3: __ccgo_ts + 23465, + 4: __ccgo_ts + 23517, } var _aOp1 = [5]int32{ @@ -148238,87 +142780,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148765,7 +143226,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nArg + *(*int32)(unsafe.Pointer(pParse + 52)) += nArg return regArg } @@ -148861,7 +143322,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -148937,7 +143398,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -149578,12 +144039,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nInput - v2 = pParse + 48 + *(*int32)(unsafe.Pointer(pParse + 52)) += nInput + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149591,13 +144052,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149617,13 +144078,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149650,7 +144111,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -149869,6 +144330,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -149929,7 +144394,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23462, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23567, libc.VaList(bp+8, p)) } // C documentation @@ -149943,6 +144408,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+188, 0, uint32(20)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -149976,11 +144442,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23486 + v1 = __ccgo_ts + 23591 } else { - v1 = __ccgo_ts + 23495 + v1 = __ccgo_ts + 23600 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23501, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23606, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -149989,7 +144455,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23543, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23648, 0) } } } @@ -150095,7 +144561,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23577, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23682, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156562,14 +151028,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156580,16 +151038,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -157737,19 +152185,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(96) defer tls.Free(96) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+64 */ TToken var _ /* as at bp+48 */ TToken var _ /* dest at bp+8 */ TSelectDest var _ /* t at bp+56 */ TToken var _ /* x at bp+40 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158552,20 +153000,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16846, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16951, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16759, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+16887, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } *(*Tu32)(unsafe.Pointer(yymsp + 4)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158606,7 +153054,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 4)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 4)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158751,7 +153204,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -158841,9 +153299,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -159198,7 +153656,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), yymsp+uintptr(-libc.Int32FromInt32(4))*12+4) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23642) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+23747) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159538,23 +153996,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { + v347 = __ccgo_ts + 8102 + } else { + v347 = __ccgo_ts + 8107 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { - v347 = __ccgo_ts + 8073 - } else { - v347 = __ccgo_ts + 8078 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) + 8))).FpExpr @@ -159612,11 +154084,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 4)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 4))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 4))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), pSelect) @@ -159626,9 +154098,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) goto _346 _242: @@ -159636,11 +154108,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 20)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 20)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4))) @@ -159738,11 +154210,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*12+4, yymsp+uintptr(-libc.Int32FromInt32(6))*12+4, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4 + 4)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159792,15 +154264,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) = *(*TToken)(unsafe.Pointer(yymsp + 4)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23651, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23756, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23746, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23935, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -159942,7 +154414,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -160136,7 +154608,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23915, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24020, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -162262,7 +156734,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -162867,14 +157339,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163736,22 +158213,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(4) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163762,11 +158248,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164347,7 +158833,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164367,7 +158853,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24002, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24107, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164492,11 +158978,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164668,14 +159154,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24545 + zErr = __ccgo_ts + 24650 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { @@ -164687,31 +159173,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24070, - 1: __ccgo_ts + 24083, - 3: __ccgo_ts + 24099, - 4: __ccgo_ts + 24124, - 5: __ccgo_ts + 24138, - 6: __ccgo_ts + 24157, - 7: __ccgo_ts + 1633, - 8: __ccgo_ts + 24182, - 9: __ccgo_ts + 24219, - 10: __ccgo_ts + 24231, - 11: __ccgo_ts + 24246, - 12: __ccgo_ts + 24279, - 13: __ccgo_ts + 24297, - 14: __ccgo_ts + 24322, - 15: __ccgo_ts + 24351, - 17: __ccgo_ts + 6102, - 18: __ccgo_ts + 5504, - 19: __ccgo_ts + 24368, - 20: __ccgo_ts + 24386, - 21: __ccgo_ts + 24404, - 23: __ccgo_ts + 24438, - 25: __ccgo_ts + 24459, - 26: __ccgo_ts + 24485, - 27: __ccgo_ts + 24508, - 28: __ccgo_ts + 24529, + 0: __ccgo_ts + 24175, + 1: __ccgo_ts + 24188, + 3: __ccgo_ts + 24204, + 4: __ccgo_ts + 24229, + 5: __ccgo_ts + 24243, + 6: __ccgo_ts + 24262, + 7: __ccgo_ts + 1637, + 8: __ccgo_ts + 24287, + 9: __ccgo_ts + 24324, + 10: __ccgo_ts + 24336, + 11: __ccgo_ts + 24351, + 12: __ccgo_ts + 24384, + 13: __ccgo_ts + 24402, + 14: __ccgo_ts + 24427, + 15: __ccgo_ts + 24456, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24473, + 20: __ccgo_ts + 24491, + 21: __ccgo_ts + 24509, + 23: __ccgo_ts + 24543, + 25: __ccgo_ts + 24564, + 26: __ccgo_ts + 24590, + 27: __ccgo_ts + 24613, + 28: __ccgo_ts + 24634, } // C documentation @@ -164805,15 +159291,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164821,6 +159309,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164828,10 +159318,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -164858,6 +159348,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -164885,12 +159389,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -164908,9 +159412,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -164933,13 +159437,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24626, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24731, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -164957,15 +159461,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 36)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -164980,27 +159484,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(12)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -165011,30 +159515,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -165059,7 +159593,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24689, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24794, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165090,13 +159624,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -165107,43 +159643,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 216)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 216)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 216)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 216)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -165154,12 +159694,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 94 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -165171,6 +159711,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -165178,82 +159720,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -165297,18 +159849,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165334,7 +159888,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165344,7 +159898,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24740, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24845, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165466,7 +160020,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165598,7 +160152,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165608,7 +160162,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165644,7 +160198,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165657,7 +160211,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165666,7 +160220,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24761, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24866, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165701,9 +160255,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165813,7 +160367,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24829, uint32(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24934, uint32(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -165843,8 +160397,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24835, zUri+7, uint32(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24845, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24940, zUri+7, uint32(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24950, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -165933,24 +160487,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24873, zOpt, uint32(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24978, zOpt, uint32(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24877, zOpt, uint32(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24982, zOpt, uint32(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24877 + zModeType = __ccgo_ts + 24982 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24898, zOpt, uint32(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25003, zOpt, uint32(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3469 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -165979,12 +160533,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24913, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25018, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24933, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25038, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166008,7 +160562,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24957, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25062, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166028,11 +160582,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24883, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24890, + Fz: __ccgo_ts + 24995, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166043,19 +160597,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24903, + Fz: __ccgo_ts + 25008, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24906, + Fz: __ccgo_ts + 25011, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24909, + Fz: __ccgo_ts + 25014, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17916, + Fz: __ccgo_ts + 18021, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166183,8 +160737,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22577, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24973, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22682, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25078, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166205,10 +160759,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4255 + zFilename = __ccgo_ts + 4285 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+4, bp+8) } @@ -166217,7 +160771,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { - v2 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -166244,9 +160798,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6711 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6740 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 23975 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 24080 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166340,7 +160894,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24979 + zFilename = __ccgo_ts + 25084 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166359,36 +160913,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166396,7 +160958,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166404,31 +160966,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166462,12 +161028,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166500,10 +161068,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(uint32(16)+n+uint32(1))) + p = Xsqlite3_malloc64(tls, uint64(uint32(libc.UintptrFromInt32(0)+12)+(n+libc.Uint32FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166514,7 +161082,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166557,20 +161125,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24982, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25087, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25007) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25112) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25027) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25132) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25034) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25139) } // C documentation @@ -166595,9 +161163,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166624,29 +161192,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166670,7 +161227,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1137 + zDataType = __ccgo_ts + 1141 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -166701,15 +161258,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25051, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25156, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -166888,8 +161445,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167729,7 +162286,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25079, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25184, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -167877,6 +162434,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -167900,7 +162459,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -167910,7 +162469,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -167922,7 +162481,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -167938,7 +162497,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -167947,7 +162506,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25087 + v2 = __ccgo_ts + 25192 } else { v2 = uintptr(0) } @@ -168193,7 +162752,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168410,6 +162969,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168722,8 +163288,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168780,7 +163346,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168790,7 +163356,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168827,23 +163393,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1649, - 1: __ccgo_ts + 8073, - 2: __ccgo_ts + 8078, - 3: __ccgo_ts + 6387, - 4: __ccgo_ts + 6387, - 5: __ccgo_ts + 6382, - 6: __ccgo_ts + 6382, - 7: __ccgo_ts + 8384, - 8: __ccgo_ts + 8384, - 9: __ccgo_ts + 8384, - 10: __ccgo_ts + 8384, - 11: __ccgo_ts + 25110, - 12: __ccgo_ts + 25116, - 13: __ccgo_ts + 1663, - 14: __ccgo_ts + 1663, - 15: __ccgo_ts + 1663, - 16: __ccgo_ts + 1663, + 0: __ccgo_ts + 1653, + 1: __ccgo_ts + 8102, + 2: __ccgo_ts + 8107, + 3: __ccgo_ts + 6416, + 4: __ccgo_ts + 6416, + 5: __ccgo_ts + 6411, + 6: __ccgo_ts + 6411, + 7: __ccgo_ts + 8413, + 8: __ccgo_ts + 8413, + 9: __ccgo_ts + 8413, + 10: __ccgo_ts + 8413, + 11: __ccgo_ts + 25215, + 12: __ccgo_ts + 25221, + 13: __ccgo_ts + 1667, + 14: __ccgo_ts + 1667, + 15: __ccgo_ts + 1667, + 16: __ccgo_ts + 1667, } // C documentation @@ -169149,108 +163715,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - F__ccgo_align [0]uint32 - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]uint8 - F__ccgo_pad7 [2]byte -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169330,7 +163794,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169628,8 +164092,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = uint8('u') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = uint8('0') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = uint8('0') - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 16)) += uint64(6) } } @@ -169763,9 +164227,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1653, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15478, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15536, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169779,14 +164243,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint32(56)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25140, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25228, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169840,7 +164302,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25257, -int32(1)) } } } @@ -170123,8 +164585,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25184, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25272, + FzRepl: __ccgo_ts + 25276, }, 1: { Fc1: uint8('i'), @@ -170132,32 +164594,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25196, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25284, + FzRepl: __ccgo_ts + 25276, }, 2: { Fc1: uint8('n'), Fc2: uint8('N'), Fn: uint8(3), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 1654, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 1658, + FzRepl: __ccgo_ts + 1653, }, 3: { Fc1: uint8('q'), Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25205, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25293, + FzRepl: __ccgo_ts + 1653, }, 4: { Fc1: uint8('s'), Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25210, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25298, + FzRepl: __ccgo_ts + 1653, }, } @@ -170172,7 +164634,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25215, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25303, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170190,23 +164652,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -170284,7 +164746,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170355,7 +164817,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170630,7 +165096,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25258, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25346, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -171060,7 +165526,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('0') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || libc.Int32FromUint8(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -171099,7 +165565,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8073, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8102, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171107,7 +165573,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8078, uint32(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8107, uint32(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -171184,14 +165650,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25184, int32(3)) == 0 { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25272, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25280, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25368, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171352,7 +165818,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1649, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1653, uint32(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171376,7 +165842,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171421,7 +165887,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*uint8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171434,7 +165900,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171483,10 +165949,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171520,15 +165982,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171597,15 +166059,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1653, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8073, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8102, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8078, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8107, uint32(5)) return i + uint32(1) _6: ; @@ -171654,9 +166116,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25188 + v19 = __ccgo_ts + 25276 } else { - v19 = __ccgo_ts + 11940 + v19 = __ccgo_ts + 11998 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171692,9 +166154,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, uint8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, uint8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = uint8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = uint8('"') + *(*Tu64)(unsafe.Pointer(pOut + 16)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171721,7 +166186,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25286, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25374, uint32(2)) zIn2++ sz2-- continue @@ -171744,7 +166209,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25289, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25377, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 25 @@ -171752,12 +166217,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25296, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25384, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25301, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25389, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -171860,16 +166325,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -171937,7 +166392,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171960,12 +166415,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25311, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25399, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171980,50 +166435,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+4 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+4, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+4, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -172075,6 +166486,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 40)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -172095,6 +166584,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -172167,9 +166659,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -172212,7 +166704,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172700,7 +167203,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172835,7 +167338,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -172936,7 +167439,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } @@ -172973,11 +167476,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25140, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25228, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -172990,7 +167490,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint32(56)) return int32(1) @@ -173009,10 +167509,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173051,7 +167551,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25314, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25402, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173067,7 +167567,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -173148,7 +167648,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173160,34 +167660,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -173270,7 +167790,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173330,7 +167850,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173465,7 +167985,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25332 + v1 = __ccgo_ts + 25420 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173475,7 +167995,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } eErr = uint8(1) @@ -173585,23 +168105,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25334, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25336, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5226, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5256, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1676, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1706, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25426, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25341, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25429, uint32(1)) } } } @@ -173637,11 +168157,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1653, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -173909,7 +168429,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -173933,7 +168453,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25343, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25431, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -173944,7 +168464,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25394, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25482, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174016,7 +168536,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_remove_done @@ -174053,7 +168573,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15951) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16056) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174084,9 +168604,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25428 + v1 = __ccgo_ts + 25516 } else { - v1 = __ccgo_ts + 25432 + v1 = __ccgo_ts + 25520 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174134,7 +168654,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_type_done @@ -174181,7 +168701,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25439 + (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 25527 (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent) @@ -174255,17 +168775,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(112) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+56 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25444, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25532, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174274,18 +168793,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint32(56)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174347,9 +168865,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174456,7 +168972,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25501, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25589, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174548,20 +169064,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(128)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, uint8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, uint8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, uint8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*4))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, uint8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*4))) + } } } @@ -174605,7 +169123,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25504, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25592, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174634,17 +169152,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - F__ccgo_align [0]uint32 - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { F__ccgo_align [0]uint32 Fbase Tsqlite3_vtab_cursor @@ -174664,25 +169171,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174690,13 +169178,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174712,7 +169193,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25507) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25595) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(16)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174846,7 +169327,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+25590, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+25678, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -174872,9 +169353,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25597, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+25685, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25605, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+25693, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175185,9 +169666,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+168, 0, uint32(56)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+168) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -175260,7 +169740,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+40, __ccgo_ts+25611, uint32(1)) + _jsonAppendRaw(tls, p+40, __ccgo_ts+25699, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+168, i, bp) @@ -175284,7 +169764,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25169, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25257, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175345,186 +169825,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25613, + FzName: __ccgo_ts + 25701, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25618, + FzName: __ccgo_ts + 25706, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25624, + FzName: __ccgo_ts + 25712, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25635, + FzName: __ccgo_ts + 25723, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25665, + FzName: __ccgo_ts + 25753, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25685, + FzName: __ccgo_ts + 25773, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25698, + FzName: __ccgo_ts + 25786, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25712, + FzName: __ccgo_ts + 25800, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25715, + FzName: __ccgo_ts + 25803, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25719, + FzName: __ccgo_ts + 25807, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25731, + FzName: __ccgo_ts + 25819, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25744, + FzName: __ccgo_ts + 25832, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25756, + FzName: __ccgo_ts + 25844, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25769, + FzName: __ccgo_ts + 25857, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25780, + FzName: __ccgo_ts + 25868, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25804, + FzName: __ccgo_ts + 25892, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25815, + FzName: __ccgo_ts + 25903, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25827, + FzName: __ccgo_ts + 25915, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25840, + FzName: __ccgo_ts + 25928, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25853, + FzName: __ccgo_ts + 25941, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25867, + FzName: __ccgo_ts + 25955, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25876, + FzName: __ccgo_ts + 25964, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25907, + FzName: __ccgo_ts + 25995, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25924, + FzName: __ccgo_ts + 26012, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25942, + FzName: __ccgo_ts + 26030, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 25960, + FzName: __ccgo_ts + 26048, }, } @@ -175607,17 +170087,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25979, + FzName: __ccgo_ts + 26067, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25989, + FzName: __ccgo_ts + 26077, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175730,13 +170212,12 @@ type TRtreeConstraint = struct { type RtreeConstraint = TRtreeConstraint type TRtreeMatchArg = struct { - F__ccgo_align [0]uint32 - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - F__ccgo_align4 [4]byte - FaParam [1]TRtreeDValue + F__ccgo_align [0]uint32 + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr + F__ccgo_pad5 [4]byte } type RtreeMatchArg = TRtreeMatchArg @@ -175770,64 +170251,6 @@ type TRtreeSearchPoint = struct { type RtreeSearchPoint = TRtreeSearchPoint -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr - F__ccgo_pad31 [4]byte -} - -type Rtree1 = TRtree1 - /* Possible values for Rtree.eCoordType: */ // C documentation @@ -175847,197 +170270,7 @@ type TRtreeValue = float32 type RtreeValue = TRtreeValue -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - F__ccgo_align [0]uint32 - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 - F__ccgo_pad5 [5]byte -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ - -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ - -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord1 = TRtreeCoord1 - -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ - -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { - F__ccgo_align [0]uint32 - FiCoord int32 - Fop int32 - Fu struct { - F__ccgo_align [0]uint32 - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr - F__ccgo_pad4 [4]byte -} - -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - F__ccgo_align [0]uint32 - FpParent uintptr - F__ccgo_align1 [4]byte - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ - -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell1 = TRtreeCell1 - -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback1 = TRtreeGeomCallback1 - -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - F__ccgo_align [0]uint32 - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - F__ccgo_align4 [4]byte - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg1 = TRtreeMatchArg1 +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -176283,7 +170516,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25999, iNode, 0, pRtree+72) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26087, iNode, 0, pRtree+72) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176588,7 +170821,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26004, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26092, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -177505,7 +171738,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26086) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26174) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177814,7 +172047,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint32FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -177822,7 +172055,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -178060,7 +172293,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178991,11 +173224,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179008,11 +173241,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179040,7 +173273,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26100, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -179050,11 +173283,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26120, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26208, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26152, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26240, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179268,7 +173501,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26189, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -179322,9 +173555,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26334 + zFmt = __ccgo_ts + 26422 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11769, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11827, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179382,9 +173615,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26390, - 1: __ccgo_ts + 5565, - 2: __ccgo_ts + 16846, + 0: __ccgo_ts + 26478, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16951, } var _rtreeModule = Tsqlite3_module{ @@ -179428,21 +173661,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26804, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26892, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26866, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26954, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26871, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26935, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27005, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26959, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27023, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27093, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179472,7 +173705,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27054 + zFormat = __ccgo_ts + 27142 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179487,31 +173720,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27162, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27250, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27207, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27295, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13335, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27234, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27322, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27256, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27344, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27264, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27352, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179525,14 +173758,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26395, - 1: __ccgo_ts + 26448, - 2: __ccgo_ts + 26493, - 3: __ccgo_ts + 26545, - 4: __ccgo_ts + 26599, - 5: __ccgo_ts + 26644, - 6: __ccgo_ts + 26702, - 7: __ccgo_ts + 26757, + 0: __ccgo_ts + 26483, + 1: __ccgo_ts + 26536, + 2: __ccgo_ts + 26581, + 3: __ccgo_ts + 26633, + 4: __ccgo_ts + 26687, + 5: __ccgo_ts + 26732, + 6: __ccgo_ts + 26790, + 7: __ccgo_ts + 26845, } // C documentation @@ -179590,7 +173823,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27280, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179598,17 +173831,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27300, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27388, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+16) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179685,13 +173918,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), libc.Uint32FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27549, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27637, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) ii = int32(4) for { if !(ii < argc) { @@ -179700,7 +173933,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27573, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27661, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179714,19 +173947,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179749,7 +173982,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179760,7 +173993,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179776,8 +174009,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27579, - 1: __ccgo_ts + 27590, + 0: __ccgo_ts + 27667, + 1: __ccgo_ts + 27678, } // C documentation @@ -179835,21 +174068,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+32, bp, ii, bp+536) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11389, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11447, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27603, libc.VaList(bp+592, (*(*TRtreeCell)(unsafe.Pointer(bp + 536))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27691, libc.VaList(bp+592, (*(*TRtreeCell)(unsafe.Pointer(bp + 536))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 32))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27609, libc.VaList(bp+592, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 536 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27697, libc.VaList(bp+592, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 536 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27613, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27701, int32(1)) goto _1 _1: ; @@ -179876,7 +174109,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27615, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27703, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -179910,23 +174143,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -179979,7 +174195,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -179994,11 +174210,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4268 + v1 = __ccgo_ts + 4298 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27648, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27736, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -180032,7 +174248,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27655, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27743, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -180049,7 +174265,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27700, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27788, libc.VaList(bp+8, iNode)) } } return pRet @@ -180078,8 +174294,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27732, - 1: __ccgo_ts + 27786, + 0: __ccgo_ts + 27820, + 1: __ccgo_ts + 27874, } if *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -180092,21 +174308,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27834 + v1 = __ccgo_ts + 27922 } else { - v1 = __ccgo_ts + 27842 + v1 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27851, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27939, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27834 + v2 = __ccgo_ts + 27922 } else { - v2 = __ccgo_ts + 27842 + v2 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27896, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27984, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180151,7 +174367,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27954, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28042, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180169,7 +174385,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28002, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28090, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180202,19 +174418,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28069, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28157, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28103, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28191, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28133, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180259,12 +174475,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28188, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28276, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28307, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180293,7 +174509,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28286, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28374, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180303,11 +174519,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26100, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26188, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28314, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28402, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -180323,8 +174539,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28345, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28352, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28433, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28440, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180351,7 +174567,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28360, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28448, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180402,13 +174618,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28379, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28467, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6711 + zDb = __ccgo_ts + 6740 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4))) } @@ -180417,7 +174633,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18613 + v1 = __ccgo_ts + 18718 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180511,14 +174727,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180543,16 +174751,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180884,19 +175082,19 @@ func _geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if p != 0 { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) - Xsqlite3_str_append(tls, x, __ccgo_ts+25334, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+25422, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28430, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28518, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28441, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28529, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -180925,20 +175123,20 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) cSep = uint8('\'') - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28452, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28540, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28470, libc.VaList(bp+8, libc.Int32FromUint8(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28558, libc.VaList(bp+8, libc.Int32FromUint8(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) cSep = uint8(' ') goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28478, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28566, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) i = int32(1) for { if !(i < argc) { @@ -180946,14 +175144,14 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if z != 0 && *(*uint8)(unsafe.Pointer(z)) != 0 { - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28486, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28574, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+28490, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+28578, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -180999,8 +175197,8 @@ func _geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } x0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) y0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) - x1 = float32(A*float64(x0) + B*float64(y0) + E) - y1 = float32(C*float64(x0) + D*float64(y0) + F) + x1 = float32(float64(A*float64(x0)) + float64(B*float64(y0)) + E) + y1 = float32(float64(C*float64(x0)) + float64(D*float64(y0)) + F) *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) = x1 *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) = y1 goto _1 @@ -181032,13 +175230,13 @@ func _geopolyArea(tls *libc.TLS, p uintptr) (r float64) { if !(ii < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex-int32(1)) { break } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5)) goto _1 _1: ; ii++ } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5)) return rArea } @@ -181118,16 +175316,16 @@ func _geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { func _geopolySine(tls *libc.TLS, r float64) (r1 float64) { var r2, r3, r5 float64 _, _, _ = r2, r3, r5 - if r >= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -181174,9 +175372,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -181335,13 +175533,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181402,7 +175593,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181441,7 +175632,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181545,7 +175736,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { F__ccgo_align [0]uint32 Fx float64 @@ -181579,39 +175770,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - F__ccgo_align [0]uint32 - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr - F__ccgo_pad4 [4]byte -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - F__ccgo_align [0]uint32 - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181635,7 +175793,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*40 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -181919,7 +176077,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -182088,13 +176246,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), libc.Uint32FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), libc.Uint32FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28503, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28591, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -182103,13 +176261,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28525, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28613, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182117,7 +176275,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -182132,7 +176290,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182344,7 +176502,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16846 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16951 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -182354,7 +176512,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28529 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28617 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182362,7 +176520,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28535 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28623 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182482,7 +176640,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28544, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28632, 0) } goto geopoly_update_end } @@ -182582,16 +176740,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28584) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28672) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28600) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28688) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182661,7 +176819,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28777, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28865, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182675,61 +176833,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28615, + FzName: __ccgo_ts + 28703, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28628, + FzName: __ccgo_ts + 28716, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28641, + FzName: __ccgo_ts + 28729, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28654, + FzName: __ccgo_ts + 28742, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28600, + FzName: __ccgo_ts + 28688, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28666, + FzName: __ccgo_ts + 28754, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28584, + FzName: __ccgo_ts + 28672, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28689, + FzName: __ccgo_ts + 28777, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28703, + FzName: __ccgo_ts + 28791, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28716, + FzName: __ccgo_ts + 28804, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28730, + FzName: __ccgo_ts + 28818, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28746, + FzName: __ccgo_ts + 28834, }, } @@ -182755,7 +176913,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28758, + FzName: __ccgo_ts + 28846, }, } @@ -182780,20 +176938,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28785, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28873, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28795, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28883, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28806, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28894, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28529, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28617, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28817, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28905, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182867,7 +177025,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint32(uint32(40) + libc.Uint32FromInt32(nArg-libc.Int32FromInt32(1))*uint32(8) + libc.Uint32FromInt32(nArg)*uint32(4)) + nBlob = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+32) + libc.Uint32FromInt32(nArg)*uint32(8) + libc.Uint32FromInt32(nArg)*uint32(4)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -182895,17 +177053,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26086, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26174, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -182913,33 +177073,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(16)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -183136,7 +177300,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183564,255 +177728,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - F__ccgo_align [0]uint32 - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - F__ccgo_align6 [4]byte - FnProgress Ti64 - FiCookie Tu32 - F__ccgo_align8 [4]byte - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - F__ccgo_align [0]uint32 - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]uint8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - F__ccgo_align10 [4]byte - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - F__ccgo_align26 [4]byte - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -184126,7 +178041,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184136,7 +178051,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184162,7 +178077,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -184185,7 +178100,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -184317,7 +178232,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28848, uintptr(0), uintptr(0), p+36) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28936, uintptr(0), uintptr(0), p+36) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184406,7 +178321,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+25999, zIn, uint32(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+26087, zIn, uint32(4)) == 0 { i = int32(4) for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184443,13 +178358,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint32(108)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29019 + v1 = __ccgo_ts + 29107 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29060, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29148, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29210) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+29298) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184616,7 +178531,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184677,7 +178592,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29335, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29423, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184687,7 +178602,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29454, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29542, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184695,7 +178610,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29475, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29563, libc.VaList(bp+24, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184707,7 +178622,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29526, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29614, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184751,7 +178666,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint32(1)*libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184764,7 +178679,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint32(1)*libc.Uint32FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) if iCid >= 0 { @@ -184817,7 +178732,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+36, bp+4, pIter+60) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20121, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20226, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184828,7 +178743,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29604, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184839,7 +178754,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29623, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29711, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+32) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 8 @@ -184847,7 +178762,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*4)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29628, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29716, zName) { bRbuRowid = int32(1) } } @@ -184861,17 +178776,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29638 + v4 = __ccgo_ts + 29726 } else { - v4 = __ccgo_ts + 29651 + v4 = __ccgo_ts + 29739 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29660, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29748, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29689, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29777, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184893,7 +178808,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29711, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29799, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -184932,15 +178847,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29738, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29826, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -184965,7 +178880,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 for int32(1) != 0 { i = 0 for { @@ -184974,7 +178889,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29747, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29835, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185022,21 +178937,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29760, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29848, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29792, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+29815) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29821, __ccgo_ts+29828, __ccgo_ts+5171) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+29903) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29909, __ccgo_ts+29916, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29836, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29924, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29878, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29966, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185085,10 +179000,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -185110,15 +179025,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29906, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29927, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29963, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15145 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30015, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15203 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185127,9 +179042,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29990, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30078, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -185144,15 +179059,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30038, libc.VaList(bp+16, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15145 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30126, libc.VaList(bp+16, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15203 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30045, libc.VaList(bp+16, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+16, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -185206,11 +179121,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1663 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1663 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1667 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1667 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185219,8 +179134,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30057, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) - zType = __ccgo_ts + 1663 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30145, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) + zType = __ccgo_ts + 1667 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -185239,34 +179154,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } else { - zCol = __ccgo_ts + 29628 + zCol = __ccgo_ts + 29716 } } - zType = __ccgo_ts + 1137 + zType = __ccgo_ts + 1141 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30079, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29815 + v2 = __ccgo_ts + 29903 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30099, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30187, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30120, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30153, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30208, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30241, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15145 - zAnd = __ccgo_ts + 22230 + zCom = __ccgo_ts + 15203 + zAnd = __ccgo_ts + 22335 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185312,7 +179227,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1663 + zS = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185320,11 +179235,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30177, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30265, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30189, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30277, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15145 + zS = __ccgo_ts + 15203 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185336,7 +179251,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30198, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30286, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185362,27 +179277,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30213, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30227, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30315, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22335 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30239, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30327, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1663 + zSep1 = __ccgo_ts + 1667 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185390,8 +179305,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22335 } goto _2 _2: @@ -185414,7 +179329,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30302, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30390, 0) } // C documentation @@ -185448,7 +179363,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if libc.Int32FromUint32(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185456,16 +179371,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if libc.Int32FromUint8(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30328, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30416, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30358, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30446, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 15203 } } } @@ -185549,16 +179464,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30395 + zSep = __ccgo_ts + 30483 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16734) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16839) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, zIdx))) } break } @@ -185569,16 +179484,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30408, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15145 + z = _rbuMPrintf(tls, p, __ccgo_ts+30496, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15203 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30419, libc.VaList(bp+16, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+16, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } return z @@ -185618,13 +179533,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30423) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30511) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185632,7 +179547,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { @@ -185641,21 +179556,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30473, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30561, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30495, libc.VaList(bp+16, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15145 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30583, libc.VaList(bp+16, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15203 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+16, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+16, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30520, libc.VaList(bp+16, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30608, libc.VaList(bp+16, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185690,30 +179605,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1663 + zPk = __ccgo_ts + 1667 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*4)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30582 + zPk = __ccgo_ts + 30670 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30595 + v2 = __ccgo_ts + 30683 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30605, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15145 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30693, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15203 goto _1 _1: ; @@ -185722,17 +179637,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30632, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30720, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30639 + v3 = __ccgo_ts + 30727 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30654, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30742, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185758,7 +179673,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30686, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30774, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185804,7 +179719,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30743) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+30831) } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 4)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -185973,7 +179888,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30809, libc.VaList(bp+24, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30897, libc.VaList(bp+24, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -185990,18 +179905,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+4, bp+8, bp+12) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 12))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30829, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30917, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 12)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30894, libc.VaList(bp+24, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30982, libc.VaList(bp+24, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30930, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31018, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186016,26 +179931,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30964 + v2 = __ccgo_ts + 31052 } else { - v2 = __ccgo_ts + 30968 + v2 = __ccgo_ts + 31056 } v1 = v2 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30974, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31062, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31035, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31123, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30964 + v3 = __ccgo_ts + 31052 } else { - v3 = __ccgo_ts + 30968 + v3 = __ccgo_ts + 31056 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31096, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31184, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186054,62 +179969,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6722) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6718) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6751) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6747) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } else { - v4 = __ccgo_ts + 31255 + v4 = __ccgo_ts + 31343 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31264 + v5 = __ccgo_ts + 31352 } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31274, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31362, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31310, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31398, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1663 + zRbuRowid = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31338 + zRbuRowid = __ccgo_ts + 31426 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31350 + v6 = __ccgo_ts + 31438 } else { - v6 = __ccgo_ts + 1663 + v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31367, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31443, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31455, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31531, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31742, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31830, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1663 + zRbuRowid1 = __ccgo_ts + 1667 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31841 + v7 = __ccgo_ts + 31929 } else { - v7 = __ccgo_ts + 31851 + v7 = __ccgo_ts + 31939 } zRbuRowid1 = v7 } @@ -186122,28 +180037,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29898, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31862 + v8 = __ccgo_ts + 31950 } else { - v8 = __ccgo_ts + 1663 + v8 = __ccgo_ts + 1667 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1663 + v9 = __ccgo_ts + 1667 } if zOrder != 0 { - v10 = __ccgo_ts + 23486 + v10 = __ccgo_ts + 23591 } else { - v10 = __ccgo_ts + 1663 + v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31868, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31956, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186229,11 +180144,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1663 + zPrefix = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31255 + zPrefix = __ccgo_ts + 31343 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31916, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32004, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+4, p+36, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -186260,7 +180175,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -186307,7 +180222,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31946, libc.VaList(bp+16, p+24))) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32034, libc.VaList(bp+16, p+24))) for *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -186366,27 +180281,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31976, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32064, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32004, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+24, __ccgo_ts+3483, uint32(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32092, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+24, __ccgo_ts+3513, uint32(4)) } else { - libc.Xmemcpy(tls, p+24, __ccgo_ts+6711, uint32(4)) + libc.Xmemcpy(tls, p+24, __ccgo_ts+6740, uint32(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32022, libc.VaList(bp+8, p+24)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32110, libc.VaList(bp+8, p+24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186419,10 +180334,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32088, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32176, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24829, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24934, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186436,16 +180351,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 32120 + v2 = __ccgo_ts + 32208 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32122, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32210, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186456,27 +180371,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32154, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32242, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32169, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32257, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32186, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32274, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32202, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32290, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32230, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32318, 0) } } @@ -186526,7 +180441,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186628,7 +180543,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186701,12 +180616,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186728,21 +180643,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186759,7 +180674,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32283, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32371, 0) } // C documentation @@ -186776,13 +180691,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32308, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32315, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32396, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -186914,7 +180829,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24386, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24491, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187050,7 +180965,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32322) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+32410) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -187063,7 +180978,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32344, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187090,7 +181005,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32371, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32459, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -187126,9 +181041,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32531, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32619, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32546, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187151,9 +181066,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32566, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32654, uintptr(0), uintptr(0), p+36) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32591) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187164,10 +181079,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32699) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32787) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32764) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+32852) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187185,7 +181100,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32808, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32896, uintptr(0), uintptr(0), p+36) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -187212,8 +181127,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17819) - _rbuCopyPragma(tls, p, __ccgo_ts+16930) + _rbuCopyPragma(tls, p, __ccgo_ts+17924) + _rbuCopyPragma(tls, p, __ccgo_ts+17035) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187221,7 +181136,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32833, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32921, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187243,10 +181158,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187260,10 +181175,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -187333,7 +181248,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32861, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32949, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187356,10 +181271,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32308, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32396, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187381,7 +181296,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]uint8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32886, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32974, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187428,7 +181343,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32897, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+32985, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 4)), -int32(1)) } else { @@ -187473,11 +181388,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32969, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33057, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+32983) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33071) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187486,7 +181401,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33040) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33128) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187534,7 +181449,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint32(1)) pCsr += uintptr(nRbu + uint32(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3860, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187566,7 +181481,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33114, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33202, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187588,17 +181503,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33146 + v3 = __ccgo_ts + 33234 } else { - v3 = __ccgo_ts + 33153 + v3 = __ccgo_ts + 33241 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33160, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33248, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15034, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15092, uintptr(0), uintptr(0), p+36) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+56) @@ -187610,21 +181525,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17533) - _rbuCopyPragma(tls, p, __ccgo_ts+16945) + _rbuCopyPragma(tls, p, __ccgo_ts+17638) + _rbuCopyPragma(tls, p, __ccgo_ts+17050) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33192, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33280, uintptr(0), uintptr(0), p+36) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33208, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33296, uintptr(0), uintptr(0), p+36) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187702,7 +181617,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33232, zState+uintptr(n-uint32(7)), uint32(7)) { + if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33320, zState+uintptr(n-uint32(7)), uint32(7)) { return _rbuMisuseError(tls) } } @@ -187749,7 +181664,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(i < nErrmsg-uint32(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31255, uint32(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31343, uint32(8)) == 0 { nDel = int32(8) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187777,16 +181692,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+36) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+56) @@ -187796,7 +181711,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33240, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33328, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187897,32 +181812,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15034 + v1 = __ccgo_ts + 15092 } else { - v1 = __ccgo_ts + 33192 + v1 = __ccgo_ts + 33280 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33192, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33280, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -187948,9 +181863,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -188022,7 +181939,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -188225,7 +182142,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -188276,14 +182193,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint32FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189861,7 +183716,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33335, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33423, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FzPath = v4 if z == uintptr(0) { @@ -189884,13 +183739,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33343 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33431 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33352 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33440 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33357 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33445 break } *(*int32)(unsafe.Pointer(pCsr + 1320)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189899,7 +183754,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -189988,12 +183843,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33367, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33455, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33522, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33610, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33536, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33624, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190070,7 +183925,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33551, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33639, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -190210,316 +184065,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - F__ccgo_align [0]uint32 - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -191365,20 +184910,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33558, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33646, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1663, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33688, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33776, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191404,7 +184949,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29898)) + nByte += libc.Int64FromUint32(libc.Xstrlen(tls, __ccgo_ts+29986)) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { nByte += libc.Int64FromUint32(libc.Uint32FromInt32(nDbCol) * (libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2) + libc.Uint32FromInt64(4) + libc.Uint32FromInt64(1) + libc.Uint32FromInt32(1) + libc.Uint32FromInt32(1))) @@ -191428,8 +184973,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29898) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29898, nName+uint32(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29986) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29986, nName+uint32(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName + uint32(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191493,7 +185038,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191510,6 +185055,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _ = i, rc, v1 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 20 } else { @@ -191531,7 +185078,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -191825,10 +185372,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 12)) = SQLITE_OK - zSep = __ccgo_ts + 11389 + zSep = __ccgo_ts + 11447 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33718, 0) + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+33806, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191837,11 +185384,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*4)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*4)) } else { - v2 = __ccgo_ts + 1664 + v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5141, libc.VaList(bp+24, zSep, zDflt)) - zSep = __ccgo_ts + 15145 + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+5171, libc.VaList(bp+24, zSep, zDflt)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -191922,13 +185469,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -192160,7 +185700,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1663, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1667, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -192420,14 +185960,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192487,7 +186019,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) i = 0 for { @@ -192495,8 +186027,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33725, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 22230 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33813, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zSep = __ccgo_ts + 22335 if zRet == uintptr(0) { break } @@ -192515,7 +186047,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) bHave = 0 i = 0 @@ -192525,8 +186057,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33759, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 33800 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33847, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zSep = __ccgo_ts + 33888 if zRet == uintptr(0) { break } @@ -192537,7 +186069,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1783, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1813, 0) } return zRet } @@ -192548,12 +186080,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33805 + v1 = __ccgo_ts + 33893 } else { - v1 = __ccgo_ts + 6716 + v1 = __ccgo_ts + 6745 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33816, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192614,11 +186146,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33895, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33983, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) if !(zRet != 0) { break } @@ -192646,7 +186178,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33914, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34002, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192675,17 +186207,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(32) - defer tls.Free(32) + bp := tls.Alloc(64) + defer tls.Free(64) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+24 */ uintptr var _ /* azCol at bp+28 */ uintptr var _ /* bRowid at bp+20 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+16 */ int32 + var _ /* pDbExists at bp+32 */ uintptr var _ /* pTo at bp+12 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint32(12)) @@ -192698,7 +186231,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+12) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0) { goto diff_out } @@ -192709,18 +186244,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 16)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 20)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 28)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 20 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34059, libc.VaList(bp+48, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+32, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 16)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 16)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 20 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+16, uintptr(0), uintptr(0), bp+28, uintptr(0), uintptr(0), bp+24, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+16, uintptr(0), uintptr(0), bp+28, uintptr(0), uintptr(0), bp+24, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FnCol != *(*int32)(unsafe.Pointer(bp + 16)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 16)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34090, libc.VaList(bp+48, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192746,7 +186307,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 28))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33971, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34111, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192906,15 +186467,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -193078,7 +186641,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]uint8 - Xsqlite3_snprintf(tls, libc.Int32FromUint32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+5203, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+5233, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193372,18 +186935,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 16)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 28)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+16, __ccgo_ts+33998, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zTab) { - _sessionAppendStr(tls, bp+16, __ccgo_ts+34002, bp) - _sessionAppendStr(tls, bp+28, __ccgo_ts+34026, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34035, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34080, bp) + _sessionAppendStr(tls, bp+16, __ccgo_ts+34138, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zTab) { + _sessionAppendStr(tls, bp+16, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+28, __ccgo_ts+34166, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34175, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34220, bp) } else { i = 0 for { @@ -193391,17 +186954,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+28, zSep, bp) _sessionAppendStr(tls, bp+40, zSep, bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 _sessionAppendIdent(tls, bp+28, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) - _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34094, libc.VaList(bp+64, i+int32(1))) + _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+34234, libc.VaList(bp+64, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+34098, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+34238, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) } goto _1 _1: @@ -193413,9 +186976,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34125, libc.VaList(bp+64, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34265, libc.VaList(bp+64, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193536,7 +187099,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193550,14 +187113,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34167, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -193626,8 +187189,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193652,18 +187215,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34187, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34327, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -193687,28 +187250,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193847,7 +187414,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193862,9 +187429,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint32(100)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -193893,20 +187460,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -193918,13 +187489,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint32FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint32FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -194080,7 +187652,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194104,7 +187676,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194119,7 +187691,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194175,7 +187747,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194280,7 +187852,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+44, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194351,8 +187923,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194386,7 +187958,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194396,7 +187968,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194475,7 +188047,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194736,7 +188308,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194885,11 +188457,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -194901,8 +188473,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } goto finished_invert @@ -194930,12 +188502,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var rc int32 @@ -194943,9 +188519,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint32(44)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -194958,14 +188534,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -194989,29 +188557,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -195088,18 +188633,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint32(uint32(12) * libc.Uint32FromInt32(nU32) * uint32(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11769) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11827) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 libc.Xmemset(tls, bp+4, 0, uint32(12)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*12 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint32FromInt32(nU32)*uint32(4)) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34205, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34345, bp) _sessionAppendIdent(tls, bp+4, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34218, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34358, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195109,9 +188654,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 } goto _2 _2: @@ -195119,8 +188664,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1663 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34229, bp) + zSep = __ccgo_ts + 1667 + _sessionAppendStr(tls, bp+4, __ccgo_ts+34369, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195129,13 +188674,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+4, __ccgo_ts+34237, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34377, bp) } else { _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _3 _3: @@ -195218,13 +188763,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+4 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+4, __ccgo_ts+34318, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34458, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34229, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195234,9 +188779,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _1 _1: @@ -195244,10 +188789,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+4, __ccgo_ts+34336, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34476, bp) _sessionAppendInteger(tls, bp+4, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+33800, bp) - zSep = __ccgo_ts + 1663 + _sessionAppendStr(tls, bp+4, __ccgo_ts+33888, bp) + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195256,16 +188801,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 34344 + zSep = __ccgo_ts + 34484 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+5201, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf, p+4, uintptr(0)) @@ -195291,7 +188836,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6711, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6740, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) } // C documentation @@ -195314,16 +188859,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+4, __ccgo_ts+34349, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34489, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+22236, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+22341, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) goto _1 @@ -195331,19 +188876,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34367, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34507, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+4, __ccgo_ts+34378, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+34518, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+5201, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf, p+8, uintptr(0)) } @@ -195366,12 +188911,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11769, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11827, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34382) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34522) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34495) + rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+34635) } return rc } @@ -195415,7 +188960,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195433,11 +188978,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195614,7 +189159,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var aBlob uintptr @@ -195638,7 +189183,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195653,7 +189198,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195704,7 +189249,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var abPK, pNew, pOld, v1 uintptr @@ -195744,10 +189289,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195785,11 +189330,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195812,7 +189357,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195831,7 +189376,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195840,7 +189385,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195850,10 +189395,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34639, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34779, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195863,10 +189408,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34660, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34800, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195879,7 +189424,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -195906,7 +189451,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -195934,7 +189479,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(240) defer tls.Free(240) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -195966,15 +189511,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34679, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34819, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34705, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+92, bp+84, bp+88, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 92)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -195998,9 +189543,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 92)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 92)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp + 92)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp + 92)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -196010,7 +189555,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+96, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6711, *(*uintptr)(unsafe.Pointer(bp + 92)), bp+4+16, uintptr(0), bp, bp+4+20, uintptr(0), uintptr(0), bp+4+24, bp+4+76) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6740, *(*uintptr)(unsafe.Pointer(bp + 92)), bp+4+16, uintptr(0), bp, bp+4+20, uintptr(0), uintptr(0), bp+4+24, bp+4+76) if rc != SQLITE_OK { break } @@ -196029,18 +189574,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34735, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34875, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol < *(*int32)(unsafe.Pointer(bp + 84)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34779, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34919, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) } else { if *(*int32)(unsafe.Pointer(bp + 84)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 96)), libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp + 84)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34850, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34990, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol = *(*int32)(unsafe.Pointer(bp + 84)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11769) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11827) { v2 = _sessionStat1Sql(tls, db, bp+4) rc = v2 if v2 != 0 { @@ -196074,7 +189619,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+4, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+4, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -196083,7 +189628,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+100, bp+104, 0) @@ -196091,23 +189636,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+108, 0, uint32(100)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 108))).FnCol = *(*int32)(unsafe.Pointer(bp + 100)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+108) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+108) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34910, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35050, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34964, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35104, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase != 0 { @@ -196130,13 +189675,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -196145,11 +189694,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196157,10 +189710,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196168,37 +189727,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -196774,7 +190325,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i int32 @@ -196809,8 +190360,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf = 0 } goto _3 @@ -196829,9 +190380,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } else { if ppOut != 0 { @@ -196883,7 +190434,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -196919,11 +190470,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -196936,18 +190493,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -196955,13 +190514,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -197003,12 +190564,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -197016,27 +190583,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -197191,7 +190749,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var bDone, iHash, v2 int32 @@ -197299,8 +190857,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+16, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -197312,9 +190870,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+16, 0, uint32(12)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) } } else { if ppOut != 0 { @@ -197388,21 +190946,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197508,6 +191070,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197555,24 +191118,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197616,113 +191167,20 @@ type TFts5Config = struct { FpzErrmsg uintptr } -type Fts5Config = TFts5Config - -type TFts5TokenizerConfig = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig = TFts5TokenizerConfig - -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 +type Fts5Config = TFts5Config + +type TFts5TokenizerConfig = struct { + FpTok uintptr + FpApi2 uintptr + FpApi1 uintptr + FazArg uintptr + FnArg int32 + FePattern int32 + FpLocale uintptr + FnLocale int32 +} + +type Fts5TokenizerConfig = TFts5TokenizerConfig /* ** End of interface to code in fts5_config.c. @@ -197745,14 +191203,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { F__ccgo_align [0]uint32 Fa uintptr @@ -197766,19 +191216,6 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - F__ccgo_align [0]uint32 - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - F__ccgo_align5 [2]byte - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { F__ccgo_align [0]uint32 FiPrev Ti64 @@ -197786,13 +191223,6 @@ type TFts5PoslistWriter = struct { type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - F__ccgo_align [0]uint32 - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197854,17 +191284,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 - F__ccgo_pad4 [7]byte -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197886,14 +191305,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -197968,8 +191379,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte } type Fts5ExprNode = TFts5ExprNode @@ -197997,27 +191406,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { F__ccgo_align [0]uint32 Fwriter TFts5PoslistWriter @@ -198049,7 +191449,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198585,14 +191985,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198603,16 +191995,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198664,10 +192046,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(1216)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(1216)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198773,12 +192155,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198853,7 +192235,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34992, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35132, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199209,7 +192591,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -199365,18 +192747,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199459,22 +192829,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199493,7 +192847,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint32(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35051, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35191, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199592,7 +192946,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+68 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35058 + zErr = __ccgo_ts + 35198 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199603,7 +192957,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 68)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+16, bp+20) if *(*int32)(unsafe.Pointer(bp + 68)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 68)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -199652,16 +193006,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199809,7 +193153,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } return v1 } @@ -199847,7 +193191,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 76)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35108 + zErr = __ccgo_ts + 35248 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200031,17 +193375,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - F__ccgo_align [0]uint32 - FnPhrase int32 - F__ccgo_align1 [4]byte - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -200122,7 +193455,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -200214,13 +193547,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -200246,13 +193579,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35156 + z = __ccgo_ts + 35296 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35212 + z1 = __ccgo_ts + 35352 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200285,19 +193618,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35270, + FzFunc: __ccgo_ts + 35410, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35278, + FzFunc: __ccgo_ts + 35418, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35288, + FzFunc: __ccgo_ts + 35428, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35293, + FzFunc: __ccgo_ts + 35433, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200685,7 +194018,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) (r int32) { var aBareword [128]Tu8 @@ -200772,21 +194105,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -200957,7 +194275,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1649, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1653, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -201095,13 +194413,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -201161,7 +194472,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint32(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35309, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint32(libc.Uint32FromInt64(4) * libc.Uint32FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -201187,12 +194498,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32('0') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35316, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35456, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35347, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35487, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201201,7 +194512,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35380, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35520, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201211,14 +194522,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35417, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35557, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint32(libc.Xstrlen(tls, zArg) + uint32(1)) azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(2))*nArg) if azArg != 0 { pSpace = azArg + uintptr(nArg)*4 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35426, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35566, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201245,7 +194556,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35459, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201257,76 +194568,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35493, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35501, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*uint8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35533, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35673, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35539, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35601, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35741, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35623, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35763, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35637, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35777, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35675, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35815, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35686, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35826, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35721, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35861, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35728, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35868, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5580, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5610, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 4)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8405, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17899, + FzName: __ccgo_ts + 18004, }, 2: { - FzName: __ccgo_ts + 35759, + FzName: __ccgo_ts + 35899, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201334,20 +194645,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+4, zArg, pConfig+68) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35767, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35798, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35938, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35808, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35948, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35842, libc.VaList(bp+48, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35982, libc.VaList(bp+48, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201408,16 +194719,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35870) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16846) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35875, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36010) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16951) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35905) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36045) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35915, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36055, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201443,7 +194754,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 4)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35946, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36086, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201451,12 +194762,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35951, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36091, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35958, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36098, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36106, 0) } } goto _1 @@ -201472,9 +194783,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35973, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36113, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+36106, 0) } goto _2 _2: @@ -201537,8 +194848,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*4)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35870) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35981, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36010) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201569,19 +194880,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36010, libc.VaList(bp+32, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, libc.VaList(bp+32, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 12)) } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -201599,7 +194910,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36170, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201607,37 +194918,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36080, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36220, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36135, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36275, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36188 + zTail = __ccgo_ts + 36328 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36196, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36336, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16846, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16951, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201706,25 +195017,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36207, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36347, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36223, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36363, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36230, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35870)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36370, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36010)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201757,7 +195068,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201767,9 +195078,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201882,7 +195193,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+4 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36256) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36396) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201893,7 +195204,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36261) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36401) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201904,7 +195215,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36270) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -201918,7 +195229,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36280) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36420) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -201929,7 +195240,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36290) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36430) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -201946,7 +195257,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36302) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36442) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -201961,7 +195272,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35870) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36010) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+4) if rc == SQLITE_OK { @@ -201976,7 +195287,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36314) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36454) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -201992,7 +195303,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36328) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36468) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202035,7 +195346,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+4 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36338 + zSelect = __ccgo_ts + 36478 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK iVersion = 0 @@ -202055,7 +195366,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36370) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36510) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -202066,7 +195377,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 4)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36378, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36518, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202131,115 +195442,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - F__ccgo_align [0]uint32 - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - F__ccgo_align5 [4]byte - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -202315,7 +195517,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36449, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, 0) return FTS5_EOF } goto _1 @@ -202326,7 +195528,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z2) - int32(z) default: if _sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36469, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36609, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202341,13 +195543,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z21) - int32(z) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36500, uint32(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36640, uint32(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36503, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36643, uint32(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30964, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31052, uint32(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202391,7 +195593,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint32(libc.Uint32FromInt64(8) * libc.Uint32FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+8, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -202926,18 +196128,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - F__ccgo_align [0]uint32 - Fa uintptr - Fn int32 - Fi int32 - F__ccgo_align3 [4]byte - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+8, p+24) != 0 { @@ -202964,16 +196154,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - F__ccgo_align [0]uint32 - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr - F__ccgo_pad3 [4]byte -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -204038,7 +197218,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(SZALLOC)*uint32(4)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12) + libc.Uint32FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204048,7 +197228,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint32(uint32(16) + libc.Uint32FromInt32(nNew)*uint32(4)) + nByte1 = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12) + libc.Uint32FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204094,14 +197274,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -204154,12 +197326,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(44)+uint32(24)*libc.Uint32FromInt32(nNew))) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint32(44)) + libc.Xmemset(tls, pNew, 0, uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24)) } v3 = pNew pPhrase = v3 @@ -204293,7 +197465,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(44)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 20 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*24))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -204333,15 +197505,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(4)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(48)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(libc.Uint32FromInt64(16)+libc.Uint32FromInt64(4))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+12)+libc.Uint32FromInt32(libc.Int32FromInt32(2))*libc.Uint32FromInt64(4))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint32(uint32(8) + libc.Uint32FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt64(8) * libc.Uint32FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint32FromInt64(nByte)) @@ -204382,7 +197554,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(44)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase != 0 { @@ -204420,8 +197592,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36507, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36647, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204441,10 +197613,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if libc.Int32FromUint8(c) < int32('0') || libc.Int32FromUint8(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36512, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204478,7 +197653,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(uint32(8)+uint32(4)*libc.Uint32FromInt32(nCol))) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint32FromInt64(8)*libc.Uint32FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204528,7 +197703,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(uint32(8)+uint32(4)*libc.Uint32FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204579,7 +197754,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204606,7 +197781,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint32(uint32(8) + libc.Uint32FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = libc.Int64FromUint32(libc.Uint32FromInt64(8) * libc.Uint32FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint32FromInt64(nByte)) @@ -204703,7 +197878,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36541, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36681, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204788,7 +197963,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm - nByte = libc.Int32FromUint32(uint32(48) + libc.Uint32FromInt32(nTerm)*uint32(4)) + nByte = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+40) + libc.Uint32FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204801,7 +197976,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(44)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+20)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204875,7 +198050,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint32(uint32(48) + uint32(4)*libc.Uint32FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40) + libc.Uint32FromInt32(nChild)*libc.Uint32FromInt64(4)) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204901,11 +198076,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 12)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36594 + v2 = __ccgo_ts + 36734 } else { - v2 = __ccgo_ts + 36507 + v2 = __ccgo_ts + 36647 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36601, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36741, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204918,7 +198093,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36651, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36791, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205039,15 +198214,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - F__ccgo_align [0]uint32 - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -205087,15 +198253,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - F__ccgo_align [0]uint32 - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { F__ccgo_align [0]uint32 FpExpr uintptr @@ -205398,7 +198555,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205462,68 +198619,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - F__ccgo_align [0]uint32 - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -206408,7 +199504,6 @@ type TFts5DlidxIter = struct { F__ccgo_align [0]uint32 FnLvl int32 FiSegid int32 - FaLvl [1]TFts5DlidxLvl } type Fts5DlidxIter = TFts5DlidxIter @@ -206451,8 +199546,7 @@ type TFts5Iter = struct { F__ccgo_align9 [3]byte FiSwitchRowid Ti64 FaFirst uintptr - F__ccgo_align11 [4]byte - FaSeg [1]TFts5SegIter + F__ccgo_pad12 [4]byte } type Fts5Iter = TFts5Iter @@ -206536,8 +199630,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte } type Fts5Structure = TFts5Structure @@ -206575,7 +199667,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206591,166 +199682,12 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - F__ccgo_align [0]uint32 - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - F__ccgo_align5 [4]byte - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - F__ccgo_align21 [4]byte - FiStructVersion Ti64 - FpStruct uintptr - F__ccgo_pad23 [4]byte -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - F__ccgo_align [0]uint32 - FaEof uintptr - F__ccgo_align1 [4]byte - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 - F__ccgo_pad5 [4]byte -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - F__ccgo_align [0]uint32 - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - F__ccgo_align3 [4]byte - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - F__ccgo_align6 [4]byte - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - F__ccgo_align [0]uint32 - FnRef int32 - F__ccgo_align1 [4]byte - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - F__ccgo_align [0]uint32 - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer - F__ccgo_pad4 [4]byte -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - F__ccgo_align [0]uint32 - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 - F__ccgo_pad12 [4]byte -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206758,197 +199695,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - F__ccgo_align [0]uint32 - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - F__ccgo_align5 [4]byte - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - F__ccgo_align17 [4]byte - FiRowid Ti64 - FnPos int32 - FbDel Tu8 - F__ccgo_pad20 [3]byte -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - F__ccgo_align [0]uint32 - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - F__ccgo_align9 [3]byte - FiSwitchRowid Ti64 - FaFirst uintptr - F__ccgo_align11 [4]byte - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - F__ccgo_align [0]uint32 - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - F__ccgo_align5 [4]byte - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - F__ccgo_align [0]uint32 - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -207128,7 +199875,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, iRowid, 0, p+52) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, iRowid, 0, p+52) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -207233,7 +199980,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+56, Xsqlite3_mprintf(tls, __ccgo_ts+36710, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+56, Xsqlite3_mprintf(tls, __ccgo_ts+36850, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207262,7 +200009,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36761, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36901, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+60, zSql) != 0 { return } @@ -207296,7 +200043,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+36810, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+36950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -207374,7 +200121,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint32(uint32(48) + libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint32(12)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+32) + libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint32FromInt64(12)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint32FromInt64(nByte)) @@ -207465,7 +200212,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36850, uint32(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36990, uint32(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207476,7 +200223,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36850, uint32(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36990, uint32(4)) *(*int32)(unsafe.Pointer(bp + 4)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -208157,7 +200904,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint32(uint32(40) + libc.Uint32FromInt32(i)*uint32(32)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+8) + libc.Uint32FromInt32(i+libc.Int32FromInt32(1))*libc.Uint32FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -208402,15 +201149,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nTomb)*uint32(4) + uint32(12)) - pNew = _sqlite3Fts5MallocZero(tls, p+44, int64(nByte)) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+8)) + (nTomb+libc.Int64FromInt32(1))*libc.Int64FromInt64(4) + pNew = _sqlite3Fts5MallocZero(tls, p+44, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -209117,7 +201864,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+37018, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209206,7 +201953,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+76, Xsqlite3_mprintf(tls, __ccgo_ts+36962, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+76, Xsqlite3_mprintf(tls, __ccgo_ts+37102, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209853,7 +202600,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, int64(184)+int64(104)*(nSlot-int64(1))+int64(4)*nSlot) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+80))+nSlot*int64(104)+int64(4)*nSlot) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 80 + uintptr(nSlot)*104 @@ -209879,14 +202626,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209896,15 +202635,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -210018,7 +202748,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -210039,7 +202769,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210821,7 +203551,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -211176,7 +203906,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+44, pWriter+4+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+37044, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+37184, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211633,15 +204363,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - F__ccgo_align [0]uint32 - FpIdx uintptr - F__ccgo_align1 [4]byte - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211686,7 +204407,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+84, Xsqlite3_mprintf(tls, __ccgo_ts+37101, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+84, Xsqlite3_mprintf(tls, __ccgo_ts+37241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211855,7 +204576,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+44, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+44, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -212173,7 +204894,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+37162, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -212448,7 +205169,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+32) + libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(12)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212483,7 +205204,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte += libc.Int64FromUint32(libc.Uint32FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1)) * uint32(12)) + nByte += (int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel) + int64(1)) * int64(12) pNew = _sqlite3Fts5MallocZero(tls, p+44, nByte) if pNew != 0 { nByte = libc.Int64FromUint32(libc.Uint32FromInt32(nSeg) * uint32(56)) @@ -212764,18 +205485,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - F__ccgo_align [0]uint32 - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr - F__ccgo_pad5 [4]byte -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -212993,7 +205702,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -213030,7 +205739,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -213041,71 +205750,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -213174,7 +205819,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -213273,14 +205918,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -213329,21 +205966,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - F__ccgo_align [0]uint32 - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr - F__ccgo_pad8 [4]byte -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -213422,7 +206044,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 48 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 48))).FpT = _fts5IdxMalloc(tls, p, int64(44)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 48))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(80))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -213472,7 +206094,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint32(uint32(12)+libc.Uint32FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint32(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, int64(12)+int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+int64(FTS5_DATA_ZERO_PADDING)) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*12 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213554,15 +206176,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [44]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint32(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint32(libc.UintptrFromInt32(0)+32)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(12)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1663, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1667, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213588,11 +206213,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37213, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37353, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25999, __ccgo_ts+37221, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26087, __ccgo_ts+37361, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11980, __ccgo_ts+37256, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12038, __ccgo_ts+37396, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213790,7 +206415,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint32(libc.Uint32FromInt32(nAlloc)*uint32(4) + uint32(44)) + nByte = libc.Int32FromUint32(uint32(libc.UintptrFromInt32(0)+40) + libc.Uint32FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint32FromInt64(80)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -214045,7 +206670,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+44, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(1), __ccgo_ts+37300) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(1), __ccgo_ts+37440) } else { _sqlite3Fts5BufferSet(tls, p+44, bp, nToken, pToken) } @@ -214396,7 +207021,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+44, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 12))).FpT = _sqlite3Fts5MallocZero(tls, p+44, int64(44)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 12))).FpT = _sqlite3Fts5MallocZero(tls, p+44, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(80))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214518,7 +207143,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+44, int64(44)) + pT = _sqlite3Fts5MallocZero(tls, p+44, libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+40)+libc.Uint32FromInt32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(80))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214638,7 +207263,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -215232,7 +207857,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37442, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -215463,7 +208088,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12))+80+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FaFirst + 1*4))).FiFirst)*104, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(4), __ccgo_ts+37388) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(4), __ccgo_ts+37528) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+32, bp+24) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215606,8 +208231,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte } type Fts5Sorter = TFts5Sorter @@ -215662,89 +208285,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - F__ccgo_align [0]uint32 - Fapi Tfts5_api - Fdb uintptr - F__ccgo_align2 [4]byte - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215752,101 +208292,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - F__ccgo_align [0]uint32 - FpStmt uintptr - F__ccgo_align1 [4]byte - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - F__ccgo_align3 [4]byte - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -216097,7 +208542,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37393, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37533, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216134,7 +208579,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -216153,7 +208598,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*uint8)(unsafe.Pointer(idxStr + uintptr(v5))) = libc.Uint8FromInt32(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216603,7 +209048,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 60)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216631,7 +209076,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216651,7 +209096,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint32(uint32(32) + uint32(4)*libc.Uint32FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint32(uint32(libc.UintptrFromInt32(0)+20) + libc.Uint32FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint32FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216666,21 +209111,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15145 + v1 = __ccgo_ts + 15203 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } if bDesc != 0 { - v3 = __ccgo_ts + 37432 + v3 = __ccgo_ts + 37572 } else { - v3 = __ccgo_ts + 37437 + v3 = __ccgo_ts + 37577 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37441, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216738,14 +209183,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37496, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37636, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5562, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5592, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37502, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37642, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216795,7 +209240,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37530, libc.VaList(bp+16, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37670, libc.VaList(bp+16, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+4, uintptr(0)) @@ -216828,7 +209273,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37540, libc.VaList(bp+16, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37680, libc.VaList(bp+16, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216862,7 +209307,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 60)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37561, libc.VaList(bp+16, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37701, libc.VaList(bp+16, z)) } } } else { @@ -216870,7 +209315,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35288 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35428 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217027,7 +209472,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+4, bp+8, bp+12, bp+16) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37594, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37734, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 12)), *(*int32)(unsafe.Pointer(bp + 16))) } @@ -217098,7 +209543,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 4)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 4)) = __ccgo_ts + 1663 + *(*uintptr)(unsafe.Pointer(bp + 4)) = __ccgo_ts + 1667 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -217227,7 +209672,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37599, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37739, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -217360,10 +209805,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219901,12 +212281,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38948, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39088, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39052, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39192, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39090, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39230, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219915,7 +212295,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39128, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39268, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219927,14 +212307,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25999, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11980, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38282, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26087, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12038, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38422, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36188, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36328, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35493, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35633, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219954,13 +212334,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30639 + v1 = __ccgo_ts + 30727 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39170, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39310, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39200, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39340, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220001,7 +212381,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39244, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39384, 0) iOff = libc.Int32FromUint32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220009,7 +212389,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39267, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39407, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220024,7 +212404,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39273, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39413, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220033,22 +212413,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35493, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35633, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39279 + zCols = __ccgo_ts + 39419 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39311 + zCols = __ccgo_ts + 39451 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36188, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36328, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38282, __ccgo_ts+39359, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38422, __ccgo_ts+39499, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220093,14 +212473,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -220170,14 +212542,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(32) defer tls.Free(32) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+4 */ TFts5InsertCtx var _ /* nLoc at bp+28 */ int32 var _ /* nText at bp+20 */ int32 var _ /* pLoc at bp+24 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+16 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -220205,6 +212577,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 20)) = 0 *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) @@ -220217,11 +212590,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+16, bp+20, bp+24, bp+28) } else { - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 20)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 28)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 20)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 28)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -220234,6 +212620,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -220468,12 +212855,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39376, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39516, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39426, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39566, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39455, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39595, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -220481,7 +212868,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220783,7 +213170,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39484, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39624, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220817,18 +213204,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -221017,14 +213392,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 56)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35493, bp+56) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35633, bp+56) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 56)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222056,14 +214405,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -222074,16 +214415,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) (r int32) { return libc.BoolInt32(libc.Int32FromUint8(c) == int32('a') || libc.Int32FromUint8(c) == int32('e') || libc.Int32FromUint8(c) == int32('i') || libc.Int32FromUint8(c) == int32('o') || libc.Int32FromUint8(c) == int32('u') || bYIsVowel != 0 && libc.Int32FromUint8(c) == int32('y')) } @@ -222229,64 +214560,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39586, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39589, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39594, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39734, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39599, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39602, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39605, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39610, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39615, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39625, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39630, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222295,49 +214626,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39638, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39641, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39781, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39645, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39649, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39653, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39657, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39661, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39801, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222354,20 +214685,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39665, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39645, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39805, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39668, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39671, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39811, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39675, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39661, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39815, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39801, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222383,75 +214714,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39678, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39645, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39686, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39693, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39833, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39698, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39594, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39734, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39703, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39589, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39729, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39708, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39661, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39801, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39713, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16048, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16153, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39718, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39671, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39811, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39630, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39733, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39873, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39737, uint32(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39877, uint32(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39653, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39793, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222460,48 +214791,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39885, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39661, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39801, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39753, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39645, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39899, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39645, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39785, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39764, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39904, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39910, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39657, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39797, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39786, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39926, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39790, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39653, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39793, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222509,21 +214840,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39804, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39944, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39657, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39797, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39810, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39671, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39811, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222541,48 +214872,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39957, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39602, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39742, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39822, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39827, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39967, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39973, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39786, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39926, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39839, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39845, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222598,13 +214929,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39851, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39991, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39855, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39995, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222612,7 +214943,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39861, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222709,14 +215040,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 20 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222734,13 +215065,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222777,14 +215101,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*4)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39865) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+40005) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39558) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222822,7 +215146,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222950,7 +215274,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(zOut)-t__predefined_ptrdiff_t(bp), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(zOut)-t__predefined_ptrdiff_t(bp), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -223026,11 +215350,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -223052,7 +215376,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39880)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40020)) } // C documentation @@ -223078,7 +215402,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39576, + FzName: __ccgo_ts + 39716, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223086,7 +215410,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39888, + FzName: __ccgo_ts + 40028, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223094,7 +215418,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39880, + FzName: __ccgo_ts + 40020, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223124,7 +215448,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39894, pApi, bp+48, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40034, pApi, bp+48, uintptr(0)) } return rc } @@ -228588,42 +220912,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - F__ccgo_align14 [4]byte - FiInstPos Ti64 - FiInstOff int32 - F__ccgo_pad16 [4]byte -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228646,16 +220934,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39901) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40041) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39905) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40045) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39909) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40049) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39918, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40058, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228718,21 +221006,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39952, - 1: __ccgo_ts + 39992, - 2: __ccgo_ts + 40027, + 0: __ccgo_ts + 40092, + 1: __ccgo_ts + 40132, + 2: __ccgo_ts + 40167, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+23975, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+24080, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40070, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40210, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228753,23 +221042,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*4)) } zType = v3 - nDb = libc.Int32FromUint32(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint32(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint32(libc.Xstrlen(tls, zDb) + uint32(1)) + nTab = libc.Int64FromUint32(libc.Xstrlen(tls, zTab) + uint32(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint32(uint32(36) + libc.Uint32FromInt32(nDb) + libc.Uint32FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = int64(36) + nDb + nTab + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*36 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint32FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint32FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint32FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint32FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228902,10 +221191,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40103, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40243, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40134, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40274, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+4, uintptr(0)) } @@ -228924,7 +221213,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40185, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40325, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229250,7 +221539,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1663 + zCopy = __ccgo_ts + 1667 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -229374,7 +221663,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40211, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40351, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229429,15 +221718,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40221 + return __ccgo_ts + 40361 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229659,7 +221948,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229707,11 +221996,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go index 612efdd..8d7fd60 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_arm64.go @@ -1,4 +1,4 @@ -// Code generated for linux/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/arm64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/arm64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/arm64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/arm64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && arm64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -135,6 +137,31 @@ const CLOCK_REALTIME_COARSE = 5 const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 +const CLONE_CHILD_CLEARTID = 2097152 +const CLONE_CHILD_SETTID = 16777216 +const CLONE_DETACHED = 4194304 +const CLONE_FILES = 1024 +const CLONE_FS = 512 +const CLONE_IO = 2147483648 +const CLONE_NEWCGROUP = 33554432 +const CLONE_NEWIPC = 134217728 +const CLONE_NEWNET = 1073741824 +const CLONE_NEWNS = 131072 +const CLONE_NEWPID = 536870912 +const CLONE_NEWTIME = 128 +const CLONE_NEWUSER = 268435456 +const CLONE_NEWUTS = 67108864 +const CLONE_PARENT = 32768 +const CLONE_PARENT_SETTID = 1048576 +const CLONE_PIDFD = 4096 +const CLONE_PTRACE = 8192 +const CLONE_SETTLS = 524288 +const CLONE_SIGHAND = 2048 +const CLONE_SYSVSEM = 262144 +const CLONE_THREAD = 65536 +const CLONE_UNTRACED = 8388608 +const CLONE_VFORK = 16384 +const CLONE_VM = 256 const COLFLAG_BUSY = 256 const COLFLAG_GENERATED = 96 const COLFLAG_HASCOLL = 512 @@ -161,6 +188,8 @@ const COLTYPE_INT = 3 const COLTYPE_INTEGER = 4 const COLTYPE_REAL = 5 const COLTYPE_TEXT = 6 +const CPU_SETSIZE = 1024 +const CSIGNAL = 255 const CURSOR_FAULT = 4 const CURSOR_INVALID = 1 const CURSOR_REQUIRESEEK = 3 @@ -1245,6 +1274,31 @@ const PTF_INTKEY = 1 const PTF_LEAF = 8 const PTF_LEAFDATA = 4 const PTF_ZERODATA = 2 +const PTHREAD_BARRIER_SERIAL_THREAD = -1 +const PTHREAD_CANCELED = -1 +const PTHREAD_CANCEL_ASYNCHRONOUS = 1 +const PTHREAD_CANCEL_DEFERRED = 0 +const PTHREAD_CANCEL_DISABLE = 1 +const PTHREAD_CANCEL_ENABLE = 0 +const PTHREAD_CANCEL_MASKED = 2 +const PTHREAD_CREATE_DETACHED = 1 +const PTHREAD_CREATE_JOINABLE = 0 +const PTHREAD_EXPLICIT_SCHED = 1 +const PTHREAD_INHERIT_SCHED = 0 +const PTHREAD_MUTEX_DEFAULT = 0 +const PTHREAD_MUTEX_ERRORCHECK = 2 +const PTHREAD_MUTEX_NORMAL = 0 +const PTHREAD_MUTEX_RECURSIVE = 1 +const PTHREAD_MUTEX_ROBUST = 1 +const PTHREAD_MUTEX_STALLED = 0 +const PTHREAD_ONCE_INIT = 0 +const PTHREAD_PRIO_INHERIT = 1 +const PTHREAD_PRIO_NONE = 0 +const PTHREAD_PRIO_PROTECT = 2 +const PTHREAD_PROCESS_PRIVATE = 0 +const PTHREAD_PROCESS_SHARED = 1 +const PTHREAD_SCOPE_PROCESS = 1 +const PTHREAD_SCOPE_SYSTEM = 0 const PTRMAP_BTREE = 5 const PTRMAP_FREEPAGE = 2 const PTRMAP_OVERFLOW1 = 3 @@ -1385,6 +1439,13 @@ const R_OK = 4 const SAVEPOINT_BEGIN = 0 const SAVEPOINT_RELEASE = 1 const SAVEPOINT_ROLLBACK = 2 +const SCHED_BATCH = 3 +const SCHED_DEADLINE = 6 +const SCHED_FIFO = 1 +const SCHED_IDLE = 5 +const SCHED_OTHER = 0 +const SCHED_RESET_ON_FORK = 1073741824 +const SCHED_RR = 2 const SCHEMA_ROOT = 1 const SEEK_DATA = 3 const SEEK_HOLE = 4 @@ -1504,6 +1565,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1743,6 +1805,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1953,6 +2016,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -1976,7 +2040,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 -const SQLITE_MUTEX_NOOP = 1 +const SQLITE_MUTEX_NREF = 0 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -2115,6 +2179,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2123,7 +2188,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2208,6 +2273,7 @@ const SQLITE_TESTCTRL_USELONGDOUBLE = 34 const SQLITE_TESTCTRL_VDBE_COVERAGE = 21 const SQLITE_TEXT = 3 const SQLITE_THREADSAFE = 1 +const SQLITE_THREADS_IMPLEMENTED = 1 const SQLITE_TOKEN_KEYWORD = 2 const SQLITE_TOKEN_QUOTED = 1 const SQLITE_TOOBIG = 18 @@ -2233,8 +2299,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3405,6 +3471,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3414,9 +3483,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3864,12 +3930,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -3998,29 +4058,380 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
      +**
    • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. +** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. +** +**
    • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
    • [[SQLITE_FCNTL_SIZE_LIMIT]] +** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that +** implements [sqlite3_deserialize()] to set an upper bound on the size +** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. +** If the integer pointed to is negative, then it is filled in with the +** current limit. Otherwise the limit is set to the larger of the value +** of the integer pointed to and the current database size. The integer +** pointed to is set to the new limit. +** +**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
    • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
    • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
    • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions super-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
    • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log ([WAL file]) and shared memory +** files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
    • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
    • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
    • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
    • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
    • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connection's busy-handler callback. The argument is of type (void**) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connection's +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
    • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
    • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
    • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
    • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
    • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
    • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
    • [[SQLITE_FCNTL_NULL_IO]] +** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor +** or file handle for the [sqlite3_file] object such that it will no longer +** read or write to the database file. +** +**
    • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
    • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
    • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
    • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
    • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS +** to block for up to M milliseconds before failing when attempting to +** obtain a file lock using the xLock or xShmLock methods of the VFS. +** The parameter is a pointer to a 32-bit signed integer that contains +** the value that M is to be set to. Before returning, the 32-bit signed +** integer is overwritten with the previous value of M. +** +**
    • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** +**
    • [[SQLITE_FCNTL_DATA_VERSION]] +** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +** a database file. The argument is a pointer to a 32-bit unsigned integer. +** The "data version" for the pager is written into the pointer. The +** "data version" changes whenever any change occurs to the corresponding +** database file, either through SQL statements on the same database +** connection or through transactions committed by separate database +** connections possibly in other processes. The [sqlite3_total_changes()] +** interface can be used to find if any database on the connection has changed, +** but that interface responds to changes on TEMP as well as MAIN and does +** not provide a mechanism to detect changes to MAIN only. Also, the +** [sqlite3_total_changes()] interface responds to internal changes only and +** omits changes made by other database connections. The +** [PRAGMA data_version] command provides a mechanism to detect changes to +** a single attached database that occur due to other database connections, +** but omits changes implemented by the database connection on which it is +** called. This file control is the only mechanism to detect changes that +** happen either internally or externally and that are associated with +** a particular attached database. +** +**
    • [[SQLITE_FCNTL_CKPT_START]] +** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint +** in wal mode before the client starts to copy pages from the wal +** file to the database file. +** +**
    • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. +** +**
    • [[SQLITE_FCNTL_EXTERNAL_READER]] +** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect +** whether or not there is a database client in another process with a wal-mode +** transaction open on the database or not. It is only available on unix.The +** (void*) argument passed with this file-control should be a pointer to a +** value of type (int). The integer value is set to 1 if the database is a wal +** mode database and there exists at least one client in another process that +** currently has an SQL transaction open on the database. It is set to 0 if +** the database is not a wal-mode db, or if there is no such connection in any +** other process. This opcode cannot be used to detect transactions opened +** by clients within the current process, only within other processes. +** +**
    • [[SQLITE_FCNTL_CKSM_FILE]] +** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the +** [checksum VFS shim] only. +** +**
    • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control +** purges the contents of the in-memory page cache. If there is an open +** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. +**
    + */ + +/* deprecated names */ + +// C documentation +// +// /* +// ** CAPI3REF: Mutex Handle +// ** +// ** The mutex module within SQLite defines [sqlite3_mutex] to be an +// ** abstract type for a mutex object. The SQLite core never looks +// ** at the internal representation of an [sqlite3_mutex]. It only +// ** deals with pointers to the [sqlite3_mutex] object. +// ** +// ** Mutexes are created using [sqlite3_mutex_alloc()]. +// */ +type Tsqlite3_mutex = struct { + Fmutex Tpthread_mutex_t +} + +type sqlite3_mutex = Tsqlite3_mutex // C documentation // @@ -4303,6 +4714,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4533,33 +4945,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4638,19 +5023,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4735,7 +5107,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4827,223 +5198,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5125,20 +5279,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5188,13 +5328,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5253,9 +5386,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5263,17 +5396,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5300,12 +5433,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5322,7 +5455,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5340,7 +5473,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5374,24 +5507,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5415,22 +5530,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5491,7 +5590,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5571,50 +5670,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6011,340 +6066,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6354,15 +6075,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6378,14 +6090,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6411,17 +6115,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6476,11 +6169,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6854,55 +6553,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint64 type size_t = Tsize_t @@ -7049,6 +6704,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7107,6 +6767,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7216,14 +6887,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7308,7 +6971,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7410,7 +7073,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7469,6 +7131,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -7480,9 +7143,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -7497,7 +7160,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7546,8 +7208,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -7611,7 +7273,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7683,19 +7344,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7709,11 +7373,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7724,40 +7385,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -7775,7 +7437,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -7787,6 +7449,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -7874,9 +7537,11 @@ type TSelect = struct { type Select = TSelect type TSQLiteThread = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr + Ftid Tpthread_t + Fdone int32 + FpOut uintptr + FxTask uintptr + FpIn uintptr } type SQLiteThread = TSQLiteThread @@ -7935,9 +7600,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -7954,10 +7619,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -7992,6 +7653,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8172,7 +7834,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8214,7 +7875,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8387,9 +8047,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8516,53 +8176,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8666,16 +8279,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8699,38 +8302,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8743,34 +8319,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -8784,90 +8336,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -8886,187 +8354,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9076,913 +8363,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity uint8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10007,611 +8387,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr uint8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10621,317 +8396,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]uint8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11017,228 +8481,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]uint8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign uint8 - FisSpecial uint8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]uint8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -11382,10 +8624,10 @@ var _sqlite3azCompileOpt = [54]uintptr{ 47: __ccgo_ts + 1022, 48: __ccgo_ts + 1044, 49: __ccgo_ts + 1065, - 50: __ccgo_ts + 1076, - 51: __ccgo_ts + 1084, - 52: __ccgo_ts + 1098, - 53: __ccgo_ts + 1111, + 50: __ccgo_ts + 1080, + 51: __ccgo_ts + 1088, + 52: __ccgo_ts + 1102, + 53: __ccgo_ts + 1115, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -12216,12 +9458,12 @@ var _sqlite3StdTypeAffinity = [6]uint8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1124, - 1: __ccgo_ts + 1128, - 2: __ccgo_ts + 1133, - 3: __ccgo_ts + 1137, - 4: __ccgo_ts + 1145, - 5: __ccgo_ts + 1150, + 0: __ccgo_ts + 1128, + 1: __ccgo_ts + 1132, + 2: __ccgo_ts + 1137, + 3: __ccgo_ts + 1141, + 4: __ccgo_ts + 1149, + 5: __ccgo_ts + 1154, } /************** End of global.c **********************************************/ @@ -12321,7 +9563,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12399,72 +9640,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12510,164 +9689,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - /* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -12693,18 +9719,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12721,100 +9735,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]uint8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -12836,13 +9756,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -12862,14 +9775,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -12948,7 +9854,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13120,7 +10026,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13178,7 +10084,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13313,24 +10219,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD uint8 - FvalidYMD uint8 - FvalidHMS uint8 - FnFloor uint8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13461,7 +10349,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1155, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1159, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -13493,13 +10381,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1163, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1167, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1171, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -13507,7 +10395,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -13578,10 +10466,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(0) @@ -13649,7 +10537,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1179, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -13717,7 +10605,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) } } @@ -13750,14 +10638,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1187) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1198) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1195) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -13814,7 +10702,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -13955,13 +10843,13 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = uint8(0) _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1208, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1212, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -13969,7 +10857,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) @@ -14047,7 +10935,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) @@ -14116,7 +11004,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1231) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1235) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -14131,7 +11019,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1236) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -14144,7 +11032,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1244) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1248) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(libc.Int32FromUint8((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -14159,7 +11047,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1250) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -14174,7 +11062,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1260) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1264) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -14191,11 +11079,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1270) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1274) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14204,7 +11092,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1280) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1284) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -14251,7 +11139,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1284, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1288, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -14281,8 +11169,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1293, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1191) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1198) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1297, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1195) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -14301,16 +11189,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1303) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1307) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1309) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1314) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { rc = 0 } } @@ -14352,10 +11240,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1318, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -14376,11 +11264,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1330, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1338, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1342, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -14418,7 +11306,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1163, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1167, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -14498,7 +11386,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -14655,7 +11543,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(16)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(17)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(18)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(19)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(20)] = uint8('.') @@ -14703,7 +11591,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(4)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(5)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(6)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(7)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(8)] = uint8('.') @@ -14808,7 +11696,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -14895,9 +11783,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if libc.Int32FromUint8(cf) == int32('d') { - v3 = __ccgo_ts + 1350 + v3 = __ccgo_ts + 1354 } else { - v3 = __ccgo_ts + 1355 + v3 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -14905,9 +11793,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1363, libc.VaList(bp+184, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1366, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -14917,17 +11805,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FvalidYMD = uint8(0) _computeYMD(tls, bp+80) if libc.Int32FromUint8(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) } case int32('H'): fallthrough case int32('k'): if libc.Int32FromUint8(cf) == int32('H') { - v4 = __ccgo_ts + 1350 + v4 = __ccgo_ts + 1354 } else { - v4 = __ccgo_ts + 1355 + v4 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -14941,50 +11829,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if libc.Int32FromUint8(cf) == int32('I') { - v5 = __ccgo_ts + 1350 + v5 = __ccgo_ts + 1354 } else { - v5 = __ccgo_ts + 1355 + v5 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+184, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1386, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if libc.Int32FromUint8(cf) == int32('p') { - v6 = __ccgo_ts + 1397 + v6 = __ccgo_ts + 1401 } else { - v6 = __ccgo_ts + 1400 + v6 = __ccgo_ts + 1404 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if libc.Int32FromUint8(cf) == int32('p') { - v7 = __ccgo_ts + 1403 + v7 = __ccgo_ts + 1407 } else { - v7 = __ccgo_ts + 1406 + v7 = __ccgo_ts + 1410 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1409, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1413, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1419, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1423, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1424, libc.VaList(bp+184, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+184, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1429, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -14994,18 +11882,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 128)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 128))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 128))).FvalidYMD = uint8(0) _computeYMD(tls, bp+128) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), uint8('%')) default: @@ -15161,7 +12049,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1444, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1448, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15194,55 +12082,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1250, + FzName: __ccgo_ts + 1254, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1270, + FzName: __ccgo_ts + 1274, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1478, + FzName: __ccgo_ts + 1482, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1483, + FzName: __ccgo_ts + 1487, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1488, + FzName: __ccgo_ts + 1492, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1497, + FzName: __ccgo_ts + 1501, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1506, + FzName: __ccgo_ts + 1510, }, 7: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1515, + FzName: __ccgo_ts + 1519, }, 8: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1528, + FzName: __ccgo_ts + 1532, }, 9: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1546, + FzName: __ccgo_ts + 1550, }, } @@ -15324,28 +12212,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15353,19 +12241,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15382,12 +12270,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15395,7 +12283,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15408,34 +12296,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15537,7 +12425,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -15748,14 +12636,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -15770,9 +12651,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -15913,7 +12794,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1559, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1563, libc.VaList(bp+8, nByte)) } return p } @@ -15975,7 +12856,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1597, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1601, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -16186,7 +13067,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16206,9 +13091,11 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld + _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) + _sqlite3MemoryBarrier(tls) return rc } @@ -16391,40 +13278,320 @@ func init() { *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_noopMutexLeave) } +type Tpthread_t = uintptr + +type pthread_t = Tpthread_t + +type Tpthread_once_t = int32 + +type pthread_once_t = Tpthread_once_t + +type Tpthread_key_t = uint32 + +type pthread_key_t = Tpthread_key_t + +type Tpthread_spinlock_t = int32 + +type pthread_spinlock_t = Tpthread_spinlock_t + +type Tpthread_mutexattr_t = struct { + F__attr uint32 +} + +type pthread_mutexattr_t = Tpthread_mutexattr_t + +type Tpthread_condattr_t = struct { + F__attr uint32 +} + +type pthread_condattr_t = Tpthread_condattr_t + +type Tpthread_barrierattr_t = struct { + F__attr uint32 +} + +type pthread_barrierattr_t = Tpthread_barrierattr_t + +type Tpthread_rwlockattr_t = struct { + F__attr [2]uint32 +} + +type pthread_rwlockattr_t = Tpthread_rwlockattr_t + +type Tsigset_t = struct { + F__bits [16]uint64 +} + +type sigset_t = Tsigset_t + +type t__sigset_t = Tsigset_t + +type Tpthread_attr_t = struct { + F__u struct { + F__vi [0][14]int32 + F__s [0][7]uint64 + F__i [14]int32 + } +} + +type pthread_attr_t = Tpthread_attr_t + +type Tpthread_mutex_t = struct { + F__u struct { + F__vi [0][10]int32 + F__p [0][5]uintptr + F__i [10]int32 + } +} + +type pthread_mutex_t = Tpthread_mutex_t + +type Tpthread_cond_t = struct { + F__u struct { + F__vi [0][12]int32 + F__p [0][6]uintptr + F__i [12]int32 + } +} + +type pthread_cond_t = Tpthread_cond_t + +type Tpthread_rwlock_t = struct { + F__u struct { + F__vi [0][14]int32 + F__p [0][7]uintptr + F__i [14]int32 + } +} + +type pthread_rwlock_t = Tpthread_rwlock_t + +type Tpthread_barrier_t = struct { + F__u struct { + F__vi [0][8]int32 + F__p [0][4]uintptr + F__i [8]int32 + } +} + +type pthread_barrier_t = Tpthread_barrier_t + +type Tsched_param = struct { + Fsched_priority int32 + F__reserved1 int32 + F__reserved2 [2]struct { + F__reserved1 Ttime_t + F__reserved2 int64 + } + F__reserved3 int32 +} + +type sched_param = Tsched_param + +type Tcpu_set_t = struct { + F__bits [16]uint64 +} + +type cpu_set_t = Tcpu_set_t + +type t__ptcb = struct { + F__f uintptr + F__x uintptr + F__next uintptr +} + +/* +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +** intended for use only inside assert() statements. On some platforms, +** there might be race conditions that can cause these routines to +** deliver incorrect results. In particular, if pthread_equal() is +** not an atomic operation, then these routines might delivery +** incorrect results. On most platforms, pthread_equal() is a +** comparison of two integers and is therefore atomic. But we are +** told that HPUX is not such a platform. If so, then these routines +** will not always work correctly on HPUX. +** +** On those platforms where pthread_equal() is not atomic, SQLite +** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to +** make sure no assert() statements are evaluated and hence these +** routines are never called. + */ + +// C documentation +// +// /* +// ** Try to provide a memory barrier operation, needed for initialization +// ** and also for the implementation of xShmBarrier in the VFS in cases +// ** where SQLite is compiled without mutexes. +// */ +func _sqlite3MemoryBarrier(tls *libc.TLS) { + libc.X__sync_synchronize(tls) +} + +// C documentation +// +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ +func _pthreadMutexInit(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +func _pthreadMutexEnd(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. SQLite +// ** will unwind its stack and return an error. The argument +// ** to sqlite3_mutex_alloc() is one of these integer constants: +// ** +// **
      +// **
    • SQLITE_MUTEX_FAST +// **
    • SQLITE_MUTEX_RECURSIVE +// **
    • SQLITE_MUTEX_STATIC_MAIN +// **
    • SQLITE_MUTEX_STATIC_MEM +// **
    • SQLITE_MUTEX_STATIC_OPEN +// **
    • SQLITE_MUTEX_STATIC_PRNG +// **
    • SQLITE_MUTEX_STATIC_LRU +// **
    • SQLITE_MUTEX_STATIC_PMEM +// **
    • SQLITE_MUTEX_STATIC_APP1 +// **
    • SQLITE_MUTEX_STATIC_APP2 +// **
    • SQLITE_MUTEX_STATIC_APP3 +// **
    • SQLITE_MUTEX_STATIC_VFS1 +// **
    • SQLITE_MUTEX_STATIC_VFS2 +// **
    • SQLITE_MUTEX_STATIC_VFS3 +// **
    +// ** +// ** The first two constants cause sqlite3_mutex_alloc() to create +// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +// ** The mutex implementation does not need to make a distinction +// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +// ** not want to. But SQLite will only request a recursive mutex in +// ** cases where it really needs one. If a faster non-recursive mutex +// ** implementation is available on the host platform, the mutex subsystem +// ** might return such a mutex in response to SQLITE_MUTEX_FAST. +// ** +// ** The other allowed parameters to sqlite3_mutex_alloc() each return +// ** a pointer to a static preexisting mutex. Six static mutexes are +// ** used by the current version of SQLite. Future versions of SQLite +// ** may add additional static mutexes. Static mutexes are for internal +// ** use by SQLite only. Applications that use SQLite mutexes should +// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +// ** SQLITE_MUTEX_RECURSIVE. +// ** +// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +// ** returns a different mutex on every call. But for the static +// ** mutex types, the same mutex is returned on every call that has +// ** the same type number. +// */ +func _pthreadMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + var p uintptr + var _ /* recursiveAttr at bp+0 */ Tpthread_mutexattr_t + _ = p + switch iType { + case int32(SQLITE_MUTEX_RECURSIVE): + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutexattr_init(tls, bp) + libc.Xpthread_mutexattr_settype(tls, bp, int32(PTHREAD_MUTEX_RECURSIVE)) + libc.Xpthread_mutex_init(tls, p, bp) + libc.Xpthread_mutexattr_destroy(tls, bp) + } + case SQLITE_MUTEX_FAST: + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutex_init(tls, p, uintptr(0)) + } + default: + p = uintptr(unsafe.Pointer(&_staticMutexes)) + uintptr(iType-int32(2))*40 + break + } + return p +} + +var _staticMutexes = [12]Tsqlite3_mutex{} + +// C documentation +// +// /* +// ** This routine deallocates a previously +// ** allocated mutex. SQLite is careful to deallocate every +// ** mutex that it allocates. +// */ +func _pthreadMutexFree(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_destroy(tls, p) + Xsqlite3_free(tls, p) +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ +func _pthreadMutexEnter(tls *libc.TLS, p uintptr) { + /* Use the built-in recursive mutexes if they are available. + */ + libc.Xpthread_mutex_lock(tls, p) +} + +func _pthreadMutexTry(tls *libc.TLS, p uintptr) (r int32) { + var rc int32 + _ = rc + /* Use the built-in recursive mutexes if they are available. + */ + if libc.Xpthread_mutex_trylock(tls, p) == 0 { + rc = SQLITE_OK + } else { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* -// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation -// ** is used regardless of the run-time threadsafety setting. +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. // */ +func _pthreadMutexLeave(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_unlock(tls, p) +} + func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return _sqlite3NoopMutex(tls) + return uintptr(unsafe.Pointer(&_sMutex1)) } -/************** End of mutex_noop.c ******************************************/ -/************** Begin file mutex_unix.c **************************************/ -/* -** 2007 August 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement mutexes for pthreads - */ -/* #include "sqliteInt.h" */ +var _sMutex1 = Tsqlite3_mutex_methods{} -/* -** The code in this file is only used if we are compiling threadsafe -** under unix with pthreads. -** -** Note that this implementation requires a version of pthreads that -** supports recursive mutexes. - */ +func init() { + p := unsafe.Pointer(&_sMutex1) + *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_pthreadMutexInit) + *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_pthreadMutexEnd) + *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_pthreadMutexAlloc) + *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_pthreadMutexFree) + *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_pthreadMutexEnter) + *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_pthreadMutexTry) + *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_pthreadMutexLeave) +} /************** End of mutex_unix.c ******************************************/ /************** Begin file mutex_w32.c ***************************************/ @@ -16516,6 +13683,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16523,8 +13692,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17343,7 +14512,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -17511,17 +14680,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: uint8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: uint8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: uint8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: uint8('c'), @@ -17718,22 +14887,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 uint8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 uint8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]uint8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -17765,7 +14935,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1647, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1651, int32(1)) break } /* Find out what flags are present */ @@ -17982,11 +15152,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18014,7 +15184,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18036,7 +15206,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18180,9 +15350,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1649 + v57 = __ccgo_ts + 1653 } else { - v57 = __ccgo_ts + 1654 + v57 = __ccgo_ts + 1658 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -18193,7 +15363,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1658, uint64(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1662, uint64(5)) bufpt = bp if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -18463,29 +15633,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = uint8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(3)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18526,7 +15674,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1663 + bufpt = __ccgo_ts + 1667 } else { if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -18600,25 +15748,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = libc.Uint8FromInt32(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1664 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1668 } else { - v98 = __ccgo_ts + 1669 + v97 = __ccgo_ts + 1673 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = uint8('"') + flag_alternateform = uint8(0) + } else { + q = uint8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18626,15 +15778,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && libc.Int32FromUint8(v101) != 0) { + if !(v101 && libc.Int32FromUint8(v100) != 0) { break } if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { @@ -18645,13 +15797,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18665,35 +15850,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1680, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = uint8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v108 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if libc.Int32FromUint8(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = uint8('\\') + } else { + if libc.Int32FromUint8(ch1) <= int32(0x1f) { + *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = uint8('\\') + v110 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v110))) = uint8('u') + v111 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v111))) = uint8('0') + v112 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v112))) = uint8('0') + v113 = j1 + j1++ + if libc.Int32FromUint8(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v113))) = libc.Uint8FromInt32(v114) + v115 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v119 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v120))) = uint8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v121))) = uint8(')') + } } *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1))) = uint8(0) length = int32(j1) @@ -18718,9 +15966,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18734,7 +15982,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1676, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18744,21 +15992,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1678, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1688, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1709, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1739, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -18997,7 +16245,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -19033,7 +16281,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -19296,6 +16544,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19313,11 +16563,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]uint8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]uint8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -19751,76 +17001,34 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr - _ = p + var rc int32 + _, _ = p, rc + /* This routine is never used in single-threaded mode */ *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) - p = _sqlite3Malloc(tls, uint64(24)) + p = _sqlite3Malloc(tls, uint64(40)) if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask - (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + libc.Xmemset(tls, p, 0, uint64(40)) + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + ** function that returns SQLITE_ERROR when passed the argument 200, that + ** forces worker threads to run sequentially and deterministically + ** for testing purposes. */ + if _sqlite3FaultSim(tls, int32(200)) != 0 { + rc = int32(1) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) + } + if rc != 0 { + (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -19830,18 +17038,32 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui // // /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) (r int32) { + var rc, v1 int32 + _, _ = rc, v1 if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask != 0 { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TSQLiteThread)(unsafe.Pointer(p)).FxTask})))(tls, (*TSQLiteThread)(unsafe.Pointer(p)).FpIn) + if (*TSQLiteThread)(unsafe.Pointer(p)).Fdone != 0 { + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpOut + rc = SQLITE_OK } else { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpResult + if libc.Xpthread_join(tls, (*TSQLiteThread)(unsafe.Pointer(p)).Ftid, ppOut) != 0 { + v1 = int32(SQLITE_ERROR) + } else { + v1 = SQLITE_OK + } + rc = v1 } Xsqlite3_free(tls, p) - return SQLITE_OK + return rc } +/******************************** End Unix Pthreads *************************/ + +/********************************* Win32 Threads ****************************/ +/******************************** End Win32 Threads *************************/ + +/********************************* Single-Threaded **************************/ /****************************** End Single-Threaded *************************/ /************** End of threads.c *********************************************/ @@ -19951,6 +17173,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*uint8)(unsafe.Pointer(zOut)) = uint8(v & libc.Uint32FromInt32(0xff)) + return int32(1) + } + if v < uint32(0x00800) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 3)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20701,7 +17954,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -20876,7 +18129,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1723, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1753, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21088,11 +18341,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -21328,7 +18581,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -21418,7 +18671,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1748 + pow63 = __ccgo_ts + 1778 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21645,7 +18898,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1767)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -21805,7 +19058,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1783 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -21914,7 +19167,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22330,7 +19583,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1785, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1815, libc.VaList(bp+8, zType)) } // C documentation @@ -22353,13 +19606,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1664) + _logBadConnection(tls, __ccgo_ts+1668) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1830) + _logBadConnection(tls, __ccgo_ts+1860) } return 0 } else { @@ -22373,7 +19626,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1839) + _logBadConnection(tls, __ccgo_ts+1869) return 0 } else { return int32(1) @@ -22404,7 +19657,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -22755,23 +20008,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = *(*uint8)(unsafe.Pointer(v2)) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*uint8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))) h *= uint32(0x9e3779b1) } return h @@ -22826,8 +20077,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -22860,9 +20111,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -22882,13 +20132,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -22896,7 +20145,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -22912,7 +20161,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -22924,7 +20173,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -22973,7 +20222,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -22983,20 +20232,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -23015,196 +20263,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1847, - 1: __ccgo_ts + 1857, - 2: __ccgo_ts + 1868, - 3: __ccgo_ts + 1880, - 4: __ccgo_ts + 1891, - 5: __ccgo_ts + 1903, - 6: __ccgo_ts + 1910, - 7: __ccgo_ts + 1918, - 8: __ccgo_ts + 1926, - 9: __ccgo_ts + 1931, - 10: __ccgo_ts + 1936, - 11: __ccgo_ts + 1942, - 12: __ccgo_ts + 1956, - 13: __ccgo_ts + 1962, - 14: __ccgo_ts + 1972, - 15: __ccgo_ts + 1977, - 16: __ccgo_ts + 1982, - 17: __ccgo_ts + 1985, - 18: __ccgo_ts + 1991, - 19: __ccgo_ts + 1998, - 20: __ccgo_ts + 2002, - 21: __ccgo_ts + 2012, - 22: __ccgo_ts + 2019, - 23: __ccgo_ts + 2026, - 24: __ccgo_ts + 2033, - 25: __ccgo_ts + 2040, - 26: __ccgo_ts + 2050, - 27: __ccgo_ts + 2059, - 28: __ccgo_ts + 2070, - 29: __ccgo_ts + 2079, - 30: __ccgo_ts + 2085, - 31: __ccgo_ts + 2095, - 32: __ccgo_ts + 2105, - 33: __ccgo_ts + 2110, - 34: __ccgo_ts + 2124, - 35: __ccgo_ts + 2135, - 36: __ccgo_ts + 2140, - 37: __ccgo_ts + 2147, - 38: __ccgo_ts + 2158, - 39: __ccgo_ts + 2163, - 40: __ccgo_ts + 2168, - 41: __ccgo_ts + 2174, - 42: __ccgo_ts + 2180, - 43: __ccgo_ts + 2186, - 44: __ccgo_ts + 2189, - 45: __ccgo_ts + 2193, - 46: __ccgo_ts + 2199, - 47: __ccgo_ts + 2210, - 48: __ccgo_ts + 2221, - 49: __ccgo_ts + 2229, - 50: __ccgo_ts + 2238, - 51: __ccgo_ts + 2244, - 52: __ccgo_ts + 2251, - 53: __ccgo_ts + 2259, - 54: __ccgo_ts + 2262, - 55: __ccgo_ts + 2265, - 56: __ccgo_ts + 2268, - 57: __ccgo_ts + 2271, - 58: __ccgo_ts + 2274, - 59: __ccgo_ts + 2277, - 60: __ccgo_ts + 2284, - 61: __ccgo_ts + 2294, - 62: __ccgo_ts + 2307, - 63: __ccgo_ts + 2318, - 64: __ccgo_ts + 2324, - 65: __ccgo_ts + 2331, - 66: __ccgo_ts + 2340, - 67: __ccgo_ts + 2349, - 68: __ccgo_ts + 2356, - 69: __ccgo_ts + 2369, - 70: __ccgo_ts + 2380, - 71: __ccgo_ts + 2385, - 72: __ccgo_ts + 2393, - 73: __ccgo_ts + 2399, - 74: __ccgo_ts + 2406, - 75: __ccgo_ts + 2418, - 76: __ccgo_ts + 2423, - 77: __ccgo_ts + 2432, - 78: __ccgo_ts + 2437, - 79: __ccgo_ts + 2446, - 80: __ccgo_ts + 2451, - 81: __ccgo_ts + 2456, - 82: __ccgo_ts + 2462, - 83: __ccgo_ts + 2470, - 84: __ccgo_ts + 2478, - 85: __ccgo_ts + 2488, - 86: __ccgo_ts + 2496, - 87: __ccgo_ts + 2503, - 88: __ccgo_ts + 2516, - 89: __ccgo_ts + 2521, - 90: __ccgo_ts + 2533, - 91: __ccgo_ts + 2541, - 92: __ccgo_ts + 2548, - 93: __ccgo_ts + 2559, - 94: __ccgo_ts + 2566, - 95: __ccgo_ts + 2573, - 96: __ccgo_ts + 2583, - 97: __ccgo_ts + 2592, - 98: __ccgo_ts + 2603, - 99: __ccgo_ts + 2609, - 100: __ccgo_ts + 2620, - 101: __ccgo_ts + 2630, - 102: __ccgo_ts + 2640, - 103: __ccgo_ts + 2649, - 104: __ccgo_ts + 2656, - 105: __ccgo_ts + 2662, - 106: __ccgo_ts + 2672, - 107: __ccgo_ts + 2683, - 108: __ccgo_ts + 2687, - 109: __ccgo_ts + 2696, - 110: __ccgo_ts + 2705, - 111: __ccgo_ts + 2712, - 112: __ccgo_ts + 2722, - 113: __ccgo_ts + 2729, - 114: __ccgo_ts + 2739, - 115: __ccgo_ts + 2747, - 116: __ccgo_ts + 2754, - 117: __ccgo_ts + 2768, - 118: __ccgo_ts + 2782, - 119: __ccgo_ts + 2790, - 120: __ccgo_ts + 2801, - 121: __ccgo_ts + 2814, - 122: __ccgo_ts + 2825, - 123: __ccgo_ts + 2831, - 124: __ccgo_ts + 2843, - 125: __ccgo_ts + 2852, - 126: __ccgo_ts + 2860, - 127: __ccgo_ts + 2869, - 128: __ccgo_ts + 2878, - 129: __ccgo_ts + 2885, - 130: __ccgo_ts + 2893, - 131: __ccgo_ts + 2900, - 132: __ccgo_ts + 2911, - 133: __ccgo_ts + 2925, - 134: __ccgo_ts + 2936, - 135: __ccgo_ts + 2944, - 136: __ccgo_ts + 2950, - 137: __ccgo_ts + 2958, - 138: __ccgo_ts + 2966, - 139: __ccgo_ts + 2976, - 140: __ccgo_ts + 2989, - 141: __ccgo_ts + 2999, - 142: __ccgo_ts + 3012, - 143: __ccgo_ts + 3021, - 144: __ccgo_ts + 3032, - 145: __ccgo_ts + 3040, - 146: __ccgo_ts + 3046, - 147: __ccgo_ts + 3058, - 148: __ccgo_ts + 3070, - 149: __ccgo_ts + 3078, - 150: __ccgo_ts + 3090, - 151: __ccgo_ts + 3103, - 152: __ccgo_ts + 3113, - 153: __ccgo_ts + 3123, - 154: __ccgo_ts + 3135, - 155: __ccgo_ts + 3140, - 156: __ccgo_ts + 3152, - 157: __ccgo_ts + 3162, - 158: __ccgo_ts + 3168, - 159: __ccgo_ts + 3178, - 160: __ccgo_ts + 3185, - 161: __ccgo_ts + 3197, - 162: __ccgo_ts + 3208, - 163: __ccgo_ts + 3216, - 164: __ccgo_ts + 3225, - 165: __ccgo_ts + 3234, - 166: __ccgo_ts + 3243, - 167: __ccgo_ts + 3250, - 168: __ccgo_ts + 3261, - 169: __ccgo_ts + 3274, - 170: __ccgo_ts + 3284, - 171: __ccgo_ts + 3291, - 172: __ccgo_ts + 3299, - 173: __ccgo_ts + 3308, - 174: __ccgo_ts + 3314, - 175: __ccgo_ts + 3321, - 176: __ccgo_ts + 3329, - 177: __ccgo_ts + 3337, - 178: __ccgo_ts + 3345, - 179: __ccgo_ts + 3355, - 180: __ccgo_ts + 3364, - 181: __ccgo_ts + 3375, - 182: __ccgo_ts + 3386, - 183: __ccgo_ts + 3397, - 184: __ccgo_ts + 3407, - 185: __ccgo_ts + 3413, - 186: __ccgo_ts + 3424, - 187: __ccgo_ts + 3435, - 188: __ccgo_ts + 3440, - 189: __ccgo_ts + 3448, + 0: __ccgo_ts + 1877, + 1: __ccgo_ts + 1887, + 2: __ccgo_ts + 1898, + 3: __ccgo_ts + 1910, + 4: __ccgo_ts + 1921, + 5: __ccgo_ts + 1933, + 6: __ccgo_ts + 1940, + 7: __ccgo_ts + 1948, + 8: __ccgo_ts + 1956, + 9: __ccgo_ts + 1961, + 10: __ccgo_ts + 1966, + 11: __ccgo_ts + 1972, + 12: __ccgo_ts + 1986, + 13: __ccgo_ts + 1992, + 14: __ccgo_ts + 2002, + 15: __ccgo_ts + 2007, + 16: __ccgo_ts + 2012, + 17: __ccgo_ts + 2015, + 18: __ccgo_ts + 2021, + 19: __ccgo_ts + 2028, + 20: __ccgo_ts + 2032, + 21: __ccgo_ts + 2042, + 22: __ccgo_ts + 2049, + 23: __ccgo_ts + 2056, + 24: __ccgo_ts + 2063, + 25: __ccgo_ts + 2070, + 26: __ccgo_ts + 2080, + 27: __ccgo_ts + 2089, + 28: __ccgo_ts + 2100, + 29: __ccgo_ts + 2109, + 30: __ccgo_ts + 2115, + 31: __ccgo_ts + 2125, + 32: __ccgo_ts + 2135, + 33: __ccgo_ts + 2140, + 34: __ccgo_ts + 2154, + 35: __ccgo_ts + 2165, + 36: __ccgo_ts + 2170, + 37: __ccgo_ts + 2177, + 38: __ccgo_ts + 2188, + 39: __ccgo_ts + 2193, + 40: __ccgo_ts + 2198, + 41: __ccgo_ts + 2204, + 42: __ccgo_ts + 2210, + 43: __ccgo_ts + 2216, + 44: __ccgo_ts + 2219, + 45: __ccgo_ts + 2223, + 46: __ccgo_ts + 2229, + 47: __ccgo_ts + 2240, + 48: __ccgo_ts + 2251, + 49: __ccgo_ts + 2259, + 50: __ccgo_ts + 2268, + 51: __ccgo_ts + 2274, + 52: __ccgo_ts + 2281, + 53: __ccgo_ts + 2289, + 54: __ccgo_ts + 2292, + 55: __ccgo_ts + 2295, + 56: __ccgo_ts + 2298, + 57: __ccgo_ts + 2301, + 58: __ccgo_ts + 2304, + 59: __ccgo_ts + 2307, + 60: __ccgo_ts + 2314, + 61: __ccgo_ts + 2324, + 62: __ccgo_ts + 2337, + 63: __ccgo_ts + 2348, + 64: __ccgo_ts + 2354, + 65: __ccgo_ts + 2361, + 66: __ccgo_ts + 2370, + 67: __ccgo_ts + 2379, + 68: __ccgo_ts + 2386, + 69: __ccgo_ts + 2399, + 70: __ccgo_ts + 2410, + 71: __ccgo_ts + 2415, + 72: __ccgo_ts + 2423, + 73: __ccgo_ts + 2429, + 74: __ccgo_ts + 2436, + 75: __ccgo_ts + 2448, + 76: __ccgo_ts + 2453, + 77: __ccgo_ts + 2462, + 78: __ccgo_ts + 2467, + 79: __ccgo_ts + 2476, + 80: __ccgo_ts + 2481, + 81: __ccgo_ts + 2486, + 82: __ccgo_ts + 2492, + 83: __ccgo_ts + 2500, + 84: __ccgo_ts + 2508, + 85: __ccgo_ts + 2518, + 86: __ccgo_ts + 2526, + 87: __ccgo_ts + 2533, + 88: __ccgo_ts + 2546, + 89: __ccgo_ts + 2551, + 90: __ccgo_ts + 2563, + 91: __ccgo_ts + 2571, + 92: __ccgo_ts + 2578, + 93: __ccgo_ts + 2589, + 94: __ccgo_ts + 2596, + 95: __ccgo_ts + 2603, + 96: __ccgo_ts + 2613, + 97: __ccgo_ts + 2622, + 98: __ccgo_ts + 2633, + 99: __ccgo_ts + 2639, + 100: __ccgo_ts + 2650, + 101: __ccgo_ts + 2660, + 102: __ccgo_ts + 2670, + 103: __ccgo_ts + 2679, + 104: __ccgo_ts + 2686, + 105: __ccgo_ts + 2692, + 106: __ccgo_ts + 2702, + 107: __ccgo_ts + 2713, + 108: __ccgo_ts + 2717, + 109: __ccgo_ts + 2726, + 110: __ccgo_ts + 2735, + 111: __ccgo_ts + 2742, + 112: __ccgo_ts + 2752, + 113: __ccgo_ts + 2759, + 114: __ccgo_ts + 2769, + 115: __ccgo_ts + 2777, + 116: __ccgo_ts + 2784, + 117: __ccgo_ts + 2798, + 118: __ccgo_ts + 2812, + 119: __ccgo_ts + 2820, + 120: __ccgo_ts + 2831, + 121: __ccgo_ts + 2844, + 122: __ccgo_ts + 2855, + 123: __ccgo_ts + 2861, + 124: __ccgo_ts + 2873, + 125: __ccgo_ts + 2882, + 126: __ccgo_ts + 2890, + 127: __ccgo_ts + 2899, + 128: __ccgo_ts + 2908, + 129: __ccgo_ts + 2915, + 130: __ccgo_ts + 2923, + 131: __ccgo_ts + 2930, + 132: __ccgo_ts + 2941, + 133: __ccgo_ts + 2955, + 134: __ccgo_ts + 2966, + 135: __ccgo_ts + 2974, + 136: __ccgo_ts + 2980, + 137: __ccgo_ts + 2988, + 138: __ccgo_ts + 2996, + 139: __ccgo_ts + 3006, + 140: __ccgo_ts + 3019, + 141: __ccgo_ts + 3029, + 142: __ccgo_ts + 3042, + 143: __ccgo_ts + 3051, + 144: __ccgo_ts + 3062, + 145: __ccgo_ts + 3070, + 146: __ccgo_ts + 3076, + 147: __ccgo_ts + 3088, + 148: __ccgo_ts + 3100, + 149: __ccgo_ts + 3108, + 150: __ccgo_ts + 3120, + 151: __ccgo_ts + 3133, + 152: __ccgo_ts + 3143, + 153: __ccgo_ts + 3153, + 154: __ccgo_ts + 3165, + 155: __ccgo_ts + 3170, + 156: __ccgo_ts + 3182, + 157: __ccgo_ts + 3192, + 158: __ccgo_ts + 3198, + 159: __ccgo_ts + 3208, + 160: __ccgo_ts + 3215, + 161: __ccgo_ts + 3227, + 162: __ccgo_ts + 3238, + 163: __ccgo_ts + 3246, + 164: __ccgo_ts + 3255, + 165: __ccgo_ts + 3264, + 166: __ccgo_ts + 3273, + 167: __ccgo_ts + 3280, + 168: __ccgo_ts + 3291, + 169: __ccgo_ts + 3304, + 170: __ccgo_ts + 3314, + 171: __ccgo_ts + 3321, + 172: __ccgo_ts + 3329, + 173: __ccgo_ts + 3338, + 174: __ccgo_ts + 3344, + 175: __ccgo_ts + 3351, + 176: __ccgo_ts + 3359, + 177: __ccgo_ts + 3367, + 178: __ccgo_ts + 3375, + 179: __ccgo_ts + 3385, + 180: __ccgo_ts + 3394, + 181: __ccgo_ts + 3405, + 182: __ccgo_ts + 3416, + 183: __ccgo_ts + 3427, + 184: __ccgo_ts + 3437, + 185: __ccgo_ts + 3443, + 186: __ccgo_ts + 3454, + 187: __ccgo_ts + 3465, + 188: __ccgo_ts + 3470, + 189: __ccgo_ts + 3478, } type Tblksize_t = int32 @@ -23287,96 +20535,6 @@ type Tuseconds_t = uint32 type useconds_t = Tuseconds_t -type Tpthread_t = uintptr - -type pthread_t = Tpthread_t - -type Tpthread_once_t = int32 - -type pthread_once_t = Tpthread_once_t - -type Tpthread_key_t = uint32 - -type pthread_key_t = Tpthread_key_t - -type Tpthread_spinlock_t = int32 - -type pthread_spinlock_t = Tpthread_spinlock_t - -type Tpthread_mutexattr_t = struct { - F__attr uint32 -} - -type pthread_mutexattr_t = Tpthread_mutexattr_t - -type Tpthread_condattr_t = struct { - F__attr uint32 -} - -type pthread_condattr_t = Tpthread_condattr_t - -type Tpthread_barrierattr_t = struct { - F__attr uint32 -} - -type pthread_barrierattr_t = Tpthread_barrierattr_t - -type Tpthread_rwlockattr_t = struct { - F__attr [2]uint32 -} - -type pthread_rwlockattr_t = Tpthread_rwlockattr_t - -type Tpthread_attr_t = struct { - F__u struct { - F__vi [0][14]int32 - F__s [0][7]uint64 - F__i [14]int32 - } -} - -type pthread_attr_t = Tpthread_attr_t - -type Tpthread_mutex_t = struct { - F__u struct { - F__vi [0][10]int32 - F__p [0][5]uintptr - F__i [10]int32 - } -} - -type pthread_mutex_t = Tpthread_mutex_t - -type Tpthread_cond_t = struct { - F__u struct { - F__vi [0][12]int32 - F__p [0][6]uintptr - F__i [12]int32 - } -} - -type pthread_cond_t = Tpthread_cond_t - -type Tpthread_rwlock_t = struct { - F__u struct { - F__vi [0][14]int32 - F__p [0][7]uintptr - F__i [14]int32 - } -} - -type pthread_rwlock_t = Tpthread_rwlock_t - -type Tpthread_barrier_t = struct { - F__u struct { - F__vi [0][8]int32 - F__p [0][4]uintptr - F__i [8]int32 - } -} - -type pthread_barrier_t = Tpthread_barrier_t - type Tu_int8_t = uint8 type u_int8_t = Tu_int8_t @@ -23448,14 +20606,6 @@ type Ttimeval = struct { type timeval = Ttimeval -type Tsigset_t = struct { - F__bits [16]uint64 -} - -type sigset_t = Tsigset_t - -type t__sigset_t = Tsigset_t - type Tfd_mask = uint64 type fd_mask = Tfd_mask @@ -23688,22 +20838,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -23734,30 +20868,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -23839,91 +20949,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3458, + FzName: __ccgo_ts + 3488, }, 1: { - FzName: __ccgo_ts + 3463, + FzName: __ccgo_ts + 3493, }, 2: { - FzName: __ccgo_ts + 3469, + FzName: __ccgo_ts + 3499, }, 3: { - FzName: __ccgo_ts + 3476, + FzName: __ccgo_ts + 3506, }, 4: { - FzName: __ccgo_ts + 3483, + FzName: __ccgo_ts + 3513, }, 5: { - FzName: __ccgo_ts + 3488, + FzName: __ccgo_ts + 3518, }, 6: { - FzName: __ccgo_ts + 3494, + FzName: __ccgo_ts + 3524, }, 7: { - FzName: __ccgo_ts + 3504, + FzName: __ccgo_ts + 3534, }, 8: { - FzName: __ccgo_ts + 3510, + FzName: __ccgo_ts + 3540, }, 9: { - FzName: __ccgo_ts + 3515, + FzName: __ccgo_ts + 3545, }, 10: { - FzName: __ccgo_ts + 3521, + FzName: __ccgo_ts + 3551, }, 11: { - FzName: __ccgo_ts + 3529, + FzName: __ccgo_ts + 3559, }, 12: { - FzName: __ccgo_ts + 3535, + FzName: __ccgo_ts + 3565, }, 13: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3572, }, 14: { - FzName: __ccgo_ts + 3551, + FzName: __ccgo_ts + 3581, }, 15: { - FzName: __ccgo_ts + 3558, + FzName: __ccgo_ts + 3588, }, 16: { - FzName: __ccgo_ts + 3568, + FzName: __ccgo_ts + 3598, }, 17: { - FzName: __ccgo_ts + 3575, + FzName: __ccgo_ts + 3605, }, 18: { - FzName: __ccgo_ts + 3589, + FzName: __ccgo_ts + 3619, }, 19: { - FzName: __ccgo_ts + 3595, + FzName: __ccgo_ts + 3625, }, 20: { - FzName: __ccgo_ts + 3601, + FzName: __ccgo_ts + 3631, }, 21: { - FzName: __ccgo_ts + 3608, + FzName: __ccgo_ts + 3638, }, 22: { - FzName: __ccgo_ts + 3616, + FzName: __ccgo_ts + 3646, }, 23: { - FzName: __ccgo_ts + 3621, + FzName: __ccgo_ts + 3651, }, 24: { - FzName: __ccgo_ts + 3628, + FzName: __ccgo_ts + 3658, }, 25: { - FzName: __ccgo_ts + 3635, + FzName: __ccgo_ts + 3665, }, 26: { - FzName: __ccgo_ts + 3647, + FzName: __ccgo_ts + 3677, }, 27: { - FzName: __ccgo_ts + 3656, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3662, + FzName: __ccgo_ts + 3692, }, } @@ -23984,7 +21094,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24022,10 +21132,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24162,9 +21272,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3668, libc.VaList(bp+136, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3698, libc.VaList(bp+136, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3711, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3741, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -24400,47 +21510,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24480,11 +21549,11 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint ** equivalent to errno. Otherwise, use strerror_r(). */ /* This is a threadsafe build, but strerror_r() is not available. */ - zErr = __ccgo_ts + 1663 + zErr = __ccgo_ts + 1667 if zPath == uintptr(0) { - zPath = __ccgo_ts + 1663 + zPath = __ccgo_ts + 1667 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3721, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3751, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24512,7 +21581,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3805, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3832, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25171,7 +22240,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25776,7 +22845,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]uint8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3860, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3890, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -25802,7 +22871,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3575, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3605, bp, int32(42579)) } // C documentation @@ -25839,7 +22908,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<= nSize { iWrite = nSize - int64(1) } - nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1663, int32(1)) + nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1667, int32(1)) if nWrite != int32(1) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(3)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26387,7 +23367,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26450,7 +23430,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -26681,9 +23661,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte break } *(*int32)(unsafe.Pointer(bp + 128)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1663, int32(1), bp+128) != int32(1) { + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1667, int32(1), bp+128) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27451,10 +24430,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3917, - 3: __ccgo_ts + 3926, - 4: __ccgo_ts + 3935, - 5: __ccgo_ts + 1676, + 2: __ccgo_ts + 3947, + 3: __ccgo_ts + 3956, + 4: __ccgo_ts + 3965, + 5: __ccgo_ts + 1706, } // C documentation @@ -27463,8 +24442,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3940) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3954) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3970) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3984) } // C documentation @@ -27526,7 +24505,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = uint8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3961, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3991, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -27698,7 +24677,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3978) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4008) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -27853,7 +24832,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3458, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3488, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -27930,7 +24909,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+128, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(4098)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3647, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3677, zIn, int32(45510)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 128)))[got] = uint8(0) @@ -28128,14 +25097,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3476, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3506, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*uint8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = uint8(0) if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -29940,7 +26749,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -29994,7 +26809,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -30038,7 +26853,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30113,7 +26928,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30167,7 +26982,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30201,66 +27016,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30434,14 +27189,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31257,123 +28012,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31454,7 +28092,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -31548,7 +28186,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -31589,7 +28227,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -31717,7 +28355,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -31737,17 +28375,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -31765,7 +28405,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -31777,7 +28417,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -31978,10 +28618,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -32567,25 +29208,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -33547,258 +30169,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]uint8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -33897,7 +30267,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34126,7 +30496,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34144,7 +30514,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -34717,6 +31087,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35363,7 +31742,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 uint8 var _ /* exists at bp+8 */ int32 @@ -35375,7 +31755,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35396,11 +31776,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Uint8FromInt32(0) *(*uint8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35429,7 +31810,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -35662,7 +32043,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -35799,7 +32180,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -35815,7 +32196,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -36562,10 +32943,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37466,7 +33847,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37510,7 +33891,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -37541,7 +33922,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -37592,7 +33973,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -37627,7 +34008,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4143, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4173, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -37637,7 +34018,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4152, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4182, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -37679,8 +34060,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4157, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4164, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4187, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4194, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -37763,7 +34144,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38019,7 +34400,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38194,7 +34575,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38225,7 +34606,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38297,7 +34678,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -39357,7 +35738,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -39654,7 +36035,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -39922,7 +36303,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4174, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4204, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40486,9 +36867,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -40503,227 +36884,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -40742,28 +36902,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -40822,7 +36961,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -40834,7 +36973,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -40923,6 +37062,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41190,14 +37330,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41364,7 +37496,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41452,12 +37584,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -41591,7 +37723,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42032,10 +38164,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42133,7 +38265,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42172,7 +38304,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42185,7 +38317,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42201,7 +38333,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42222,7 +38354,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42288,7 +38420,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42338,7 +38470,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4229, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4259, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -42553,7 +38685,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -42579,7 +38718,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43302,8 +39441,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43390,7 +39529,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -43536,7 +39675,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -43563,7 +39702,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -43572,6 +39711,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -43616,6 +39756,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -43887,7 +40030,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44068,7 +40211,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44077,7 +40220,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44129,14 +40272,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -44682,283 +40825,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45091,27 +40957,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45274,10 +41119,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45286,14 +41132,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -45993,11 +41839,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46171,7 +42017,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46184,12 +42030,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46233,7 +42079,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46241,7 +42087,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46429,7 +42275,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46462,7 +42308,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46661,7 +42507,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -46701,12 +42547,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -46714,21 +42560,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -46775,12 +42621,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -46796,7 +42642,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -46856,7 +42702,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -46873,14 +42719,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -46923,11 +42769,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -46941,7 +42787,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -46994,42 +42840,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47037,70 +42881,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47146,7 +42990,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47172,7 +43016,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47211,12 +43055,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47243,7 +43087,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47274,11 +43118,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47307,11 +43151,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47320,7 +43164,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47342,30 +43186,28 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt32(flags) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(libc.Uint8FromInt32(flags)) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47473,7 +43315,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -47535,7 +43377,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -47623,7 +43465,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4255) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4285) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48247,7 +44089,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48409,7 +44251,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4264, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4294, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48447,7 +44289,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -48888,7 +44730,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -48912,7 +44754,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -48921,7 +44763,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -48935,7 +44777,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -48965,7 +44807,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49061,7 +44903,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49099,7 +44941,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49166,7 +45008,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49209,7 +45051,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49239,7 +45081,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49705,7 +45547,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50097,7 +45939,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50107,7 +45949,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50138,7 +45980,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50164,7 +46006,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50238,7 +46080,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50373,7 +46215,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50385,7 +46227,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -50501,7 +46343,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50515,7 +46357,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -50749,7 +46591,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -50833,7 +46675,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -50845,7 +46687,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51047,7 +46889,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51080,7 +46922,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51089,7 +46931,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51218,7 +47060,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51328,7 +47170,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51416,7 +47258,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51471,7 +47313,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51497,7 +47339,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51524,7 +47366,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -51595,7 +47437,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51733,7 +47575,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -51784,7 +47626,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -51793,7 +47635,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -51883,7 +47725,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -51901,7 +47743,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -51924,7 +47766,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52145,10 +47987,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52439,17 +48281,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -52539,12 +48370,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -52552,7 +48383,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -52647,7 +48478,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -52728,7 +48559,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -52755,7 +48586,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -52795,7 +48626,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -52866,7 +48697,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -52911,7 +48742,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53107,10 +48938,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53233,8 +49065,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53274,7 +49106,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53297,7 +49129,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53428,7 +49260,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53471,7 +49303,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -53530,7 +49362,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -53562,7 +49394,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -53792,7 +49624,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54038,7 +49870,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54111,7 +49943,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54270,7 +50102,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54301,7 +50133,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54386,7 +50218,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54478,7 +50310,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54514,7 +50346,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -54544,10 +50376,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -54665,12 +50497,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -54680,14 +50512,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -54787,21 +50619,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -54895,7 +50727,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -55005,7 +50837,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55046,7 +50878,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55127,14 +50959,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55271,7 +51103,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55536,7 +51368,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4268, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4298, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -55584,11 +51416,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4270, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4300, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4293, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4323, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -55614,11 +51446,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4423, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4453, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -55690,11 +51522,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4462 + v2 = __ccgo_ts + 4492 } else { - v2 = __ccgo_ts + 4467 + v2 = __ccgo_ts + 4497 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4488, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4518, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -55830,12 +51662,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4514 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4544 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4532, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4562, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4686, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -55920,7 +51752,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4740, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -55943,7 +51775,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4764, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4794, 0) depth = d2 } } else { @@ -56020,7 +51852,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4789, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4819, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56034,7 +51866,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4826, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4856, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56125,7 +51957,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4878 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4908 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56149,11 +51981,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4889, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4919, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4934, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56190,10 +52022,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4989, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5019, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5009, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56323,14 +52155,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -56541,45 +52373,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -56632,7 +52425,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3860, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -56642,7 +52435,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5041, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5071, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -56671,7 +52464,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5061, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -56701,7 +52494,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5092, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5122, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57379,7 +53172,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5132, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+48, v1)) *(*uint8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = uint8(0) /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57517,9 +53310,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = uint8(0) @@ -57694,20 +53484,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -57722,10 +53512,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58184,21 +53974,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } *(*uintptr)(unsafe.Pointer(pMem)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58357,7 +54147,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58399,11 +54189,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58413,7 +54203,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58435,12 +54225,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58479,7 +54269,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -58591,8 +54381,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -58643,7 +54433,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -58651,8 +54442,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -58709,14 +54500,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -58730,7 +54521,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -58755,14 +54546,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3860, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -58820,7 +54611,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1663 + zNeg = __ccgo_ts + 1667 rc = SQLITE_OK for { v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -58862,7 +54653,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5139 + zNeg = __ccgo_ts + 5169 } } } @@ -58877,7 +54668,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5141, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5171, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59181,7 +54972,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59197,7 +54988,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59207,7 +54998,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59258,9 +55049,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59334,7 +55125,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -59668,12 +55459,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -59847,7 +55637,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -59864,7 +55654,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -59932,8 +55722,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -59946,11 +55736,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -59987,13 +55777,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60024,7 +55817,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -60526,7 +56319,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5146, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -60536,66 +56329,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5151) == 0 { - zColl = __ccgo_ts + 5158 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5181) == 0 { + zColl = __ccgo_ts + 5188 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5139 + v3 = __ccgo_ts + 5169 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5160 + v4 = __ccgo_ts + 5190 } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5163, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5193, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5187, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5203, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5233, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1664 + zP4 = __ccgo_ts + 1668 } else { - zP4 = __ccgo_ts + 5206 + zP4 = __ccgo_ts + 5236 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5213, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5243, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -60610,20 +56403,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5221, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5251, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5226, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5256, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5228 + zP4 = __ccgo_ts + 5258 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5236, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5266, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -60637,10 +56430,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5173, - 1: __ccgo_ts + 5175, - 2: __ccgo_ts + 5177, - 3: __ccgo_ts + 5182, + 0: __ccgo_ts + 5203, + 1: __ccgo_ts + 5205, + 2: __ccgo_ts + 5207, + 3: __ccgo_ts + 5212, } // C documentation @@ -61437,7 +57230,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -61456,7 +57249,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61464,7 +57257,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -61591,7 +57384,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5252, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5282, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -61599,18 +57392,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5264, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5294, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5278, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5308, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5293, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5323, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -61841,7 +57634,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63229,7 +59022,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63264,7 +59057,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63318,7 +59111,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63450,7 +59243,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -63602,7 +59395,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -63633,7 +59426,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -63784,15 +59577,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5336 + zContext = __ccgo_ts + 5366 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5355 + zContext = __ccgo_ts + 5385 } else { - zContext = __ccgo_ts + 5374 + zContext = __ccgo_ts + 5404 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5383, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5413, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -63887,10 +59680,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -63899,9 +59693,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -63981,7 +59775,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5419, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5449, 0) return int32(1) } else { return 0 @@ -63991,7 +59785,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5464, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5494, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64049,7 +59843,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64376,12 +60170,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64398,29 +60192,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64450,13 +60248,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64468,11 +60268,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -64480,23 +60284,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -64552,7 +60362,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5504, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5534, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -64753,7 +60563,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -64883,7 +60693,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65052,6 +60862,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65065,7 +60877,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65103,13 +60915,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65343,18 +61155,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5527, - 1: __ccgo_ts + 5532, - 2: __ccgo_ts + 5539, - 3: __ccgo_ts + 5542, - 4: __ccgo_ts + 5545, - 5: __ccgo_ts + 5548, - 6: __ccgo_ts + 5551, - 7: __ccgo_ts + 5554, - 8: __ccgo_ts + 5562, - 9: __ccgo_ts + 5565, - 10: __ccgo_ts + 5572, - 11: __ccgo_ts + 5580, + 0: __ccgo_ts + 5557, + 1: __ccgo_ts + 5562, + 2: __ccgo_ts + 5569, + 3: __ccgo_ts + 5572, + 4: __ccgo_ts + 5575, + 5: __ccgo_ts + 5578, + 6: __ccgo_ts + 5581, + 7: __ccgo_ts + 5584, + 8: __ccgo_ts + 5592, + 9: __ccgo_ts + 5595, + 10: __ccgo_ts + 5602, + 11: __ccgo_ts + 5610, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -65609,14 +61421,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5587, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5617, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -65654,7 +61466,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -65664,7 +61476,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -65675,24 +61487,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -65740,7 +61556,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -65748,32 +61566,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66190,11 +62014,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66203,7 +62027,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66217,7 +62041,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66252,7 +62076,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, (*TColumn)(unsafe.Pointer(pCol)).Faffinity, bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66287,7 +62111,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66353,11 +62177,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66380,7 +62204,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66402,7 +62226,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66529,7 +62353,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5627, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5657, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -66561,13 +62385,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*56 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1668, int32(4)) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1424, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1428, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5132, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5162, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -66582,28 +62406,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5631, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5661, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5638, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5668, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5651, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5681, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5654, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5684, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5659, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -66767,9 +62591,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -66795,12 +62619,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -66809,28 +62631,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67203,11 +63025,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1133, - 1: __ccgo_ts + 1145, - 2: __ccgo_ts + 1150, - 3: __ccgo_ts + 1128, - 4: __ccgo_ts + 1664, + 0: __ccgo_ts + 1137, + 1: __ccgo_ts + 1149, + 2: __ccgo_ts + 1154, + 3: __ccgo_ts + 1132, + 4: __ccgo_ts + 1668, } // C documentation @@ -67221,12 +63043,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity uint8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67243,7 +63065,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -67261,7 +63083,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -67975,19 +63797,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5695, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5725, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5716, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5746, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5723, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5753, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69201,7 +65023,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69217,6 +65039,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -69710,7 +65538,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -69813,7 +65641,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5747, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5775, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5861, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5889, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70409,7 +66237,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5915, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5943, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70439,12 +66267,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5970 + v250 = __ccgo_ts + 5998 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6018 + v251 = __ccgo_ts + 6046 } else { - v251 = __ccgo_ts + 6061 + v251 = __ccgo_ts + 6089 } v250 = v251 } @@ -70536,7 +66364,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6102) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6130) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -70854,7 +66682,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1663 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1667 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -71620,7 +67448,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, uint8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -71647,7 +67475,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72106,7 +67934,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -72539,7 +68367,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -72869,7 +68697,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -72900,13 +68728,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6147 + zSchema = __ccgo_ts + 6175 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6161, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6189, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -72921,7 +68749,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73158,7 +68986,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6204, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6232, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73175,15 +69003,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73264,11 +69092,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73480,7 +69308,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -73530,7 +69358,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -73586,7 +69414,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -73665,11 +69493,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6241 + v286 = __ccgo_ts + 6269 } else { - v286 = __ccgo_ts + 6246 + v286 = __ccgo_ts + 6274 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6253, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6281, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -73822,7 +69650,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6305, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -73984,7 +69812,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6334, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6362, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74064,12 +69892,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74080,7 +69908,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74174,7 +70002,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74202,11 +70030,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74334,7 +70162,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74485,7 +70313,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -74572,15 +70400,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -75046,11 +70853,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3860 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75129,14 +70936,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75155,11 +70962,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75235,7 +71042,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75249,7 +71056,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3860 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -75516,108 +71323,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -75981,7 +71523,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76307,8 +71849,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76322,9 +71864,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76472,8 +72014,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76522,18 +72064,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -76667,7 +72210,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -76821,6 +72364,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78316,57 +73862,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -78663,7 +74158,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79366,25 +74861,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6651, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6680, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6659+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6678+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6688+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6707+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6147+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6175+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } @@ -79423,23 +74918,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79471,7 +74965,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6711, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6740, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -79565,7 +75059,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6716) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6745) != 0 { goto _2 } } @@ -79587,57 +75081,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -79682,11 +75163,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6718, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6747, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6722, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6751, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -79695,36 +75176,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6726, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6755, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -79753,18 +75223,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -79811,15 +75281,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6735, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6764, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6766, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6795, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -79830,8 +75300,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -79871,7 +75341,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6821, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6850, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -79891,7 +75361,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -79900,7 +75370,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6856 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6885 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -79910,26 +75380,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6865 + v8 = __ccgo_ts + 6894 } else { - v10 = __ccgo_ts + 6880 + v8 = __ccgo_ts + 6909 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6902, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6931, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6925, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -79978,8 +75448,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80053,19 +75523,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6993 + zIn = __ccgo_ts + 7022 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7021 + zIn = __ccgo_ts + 7050 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7039 + zIn = __ccgo_ts + 7068 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7057 + zIn = __ccgo_ts + 7086 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7075, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7104, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80091,7 +75561,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80237,7 +75707,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7095, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7124, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80292,7 +75762,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7112, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80316,7 +75786,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7205, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80330,13 +75800,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80356,16 +75826,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7212, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7241, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80376,35 +75843,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7240, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7269, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7283 + zType = __ccgo_ts + 7312 } else { - zType = __ccgo_ts + 7290 + zType = __ccgo_ts + 7319 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7300, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7329, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7328, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7350, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7379, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7394, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80489,7 +75959,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7442, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7471, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -80501,7 +75971,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7453, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7482, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -80547,7 +76017,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -80672,7 +76142,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7464, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7493, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -80707,7 +76177,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7520, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -80745,7 +76215,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7554, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7583, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -80815,7 +76285,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7560, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7589, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -80849,7 +76319,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7621, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7650, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81162,7 +76632,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7652, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7681, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81229,7 +76699,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81240,7 +76710,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7691) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7720) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81250,7 +76720,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7697, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7726, 0) return int32(WRC_Abort) } goto _6 @@ -81472,33 +76942,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -81550,7 +77022,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -81758,7 +77230,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82233,7 +77705,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82312,7 +77784,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7756, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82499,7 +77971,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -82657,11 +78129,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7804 + v2 = __ccgo_ts + 7833 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7806, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7835, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -82707,10 +78179,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -82738,7 +78210,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7850, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7879, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -82758,7 +78230,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7884, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7913, libc.VaList(bp+8, p)) } // C documentation @@ -82829,7 +78301,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7934, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+8, pExpr)) } } } @@ -82881,7 +78353,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7954, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7983, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -82914,7 +78386,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7997, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83150,12 +78622,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83297,7 +78763,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83437,7 +78903,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83458,27 +78923,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -83524,9 +78982,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -83536,8 +78994,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -83551,7 +79009,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -83602,7 +79060,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -83683,7 +79141,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -83701,7 +79159,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -83782,7 +79240,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -83911,7 +79369,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8050, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84009,10 +79467,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8073) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8102) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8078) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8107) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -84690,13 +80148,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) (r i // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8084) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8113) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8092) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8121) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8098) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8127) == 0 { return int32(1) } return 0 @@ -84711,32 +80169,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8084, - 1: __ccgo_ts + 8092, - 2: __ccgo_ts + 8098, + 0: __ccgo_ts + 8113, + 1: __ccgo_ts + 8121, + 2: __ccgo_ts + 8127, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -84945,7 +80390,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -84998,7 +80443,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8102, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8131, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85098,12 +80543,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -85695,7 +81141,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8317) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8346) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -85791,14 +81237,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -85826,9 +81272,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -85961,7 +81407,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86091,13 +81537,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -86877,7 +82328,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8410, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -86889,7 +82340,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -86904,7 +82355,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8437, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8466, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -86933,7 +82384,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87009,7 +82460,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87072,7 +82523,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87082,7 +82533,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87090,7 +82541,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87103,9 +82554,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87187,7 +82638,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8461, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8490, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87258,17 +82709,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87277,7 +82728,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87289,6 +82740,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87308,7 +82780,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87378,7 +82850,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87422,7 +82894,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87495,7 +82967,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -87522,8 +82994,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -87689,7 +83161,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -87898,7 +83372,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88605,7 +84081,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -88834,10 +84310,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -88875,7 +84351,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88889,7 +84365,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88903,10 +84379,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -88916,25 +84395,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -88947,7 +84430,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -88957,11 +84440,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -88981,13 +84464,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89057,7 +84540,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89093,6 +84576,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89110,44 +84594,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89227,7 +84716,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89235,7 +84724,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -89253,7 +84742,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -89272,11 +84761,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -89394,8 +84883,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8511, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8569, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89413,10 +84902,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8539, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8714, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8772, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89432,9 +84921,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8888, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8946, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9035, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9093, 0) } } @@ -89490,7 +84979,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9186, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9244, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89499,11 +84988,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9245, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9303, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9251, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9309, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89533,21 +85022,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9278, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9336, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9462, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9520, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9767, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9783, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9825, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9899, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -89555,7 +85044,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -89563,7 +85052,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10106, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10164, 0) goto exit_rename_table exit_rename_table: ; @@ -89580,7 +85069,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10119, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10177, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -89620,11 +85109,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10157, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10215, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10189, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10247, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -89640,10 +85129,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10216) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10274) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10275) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10333) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -89655,13 +85144,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10328) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10386) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10374) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10432) } } /* Modify the CREATE TABLE statement. */ @@ -89675,7 +85164,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10401, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10459, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -89703,7 +85192,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10547, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10605, libc.VaList(bp+16, zTab, zDb)) } } } @@ -89741,12 +85230,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10900, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10958, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10934, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10992, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -89761,7 +85250,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -89769,8 +85258,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10964, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11022, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -89831,18 +85320,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10988 + zType = __ccgo_ts + 11046 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11002 + v1 = __ccgo_ts + 11060 } else { - v1 = __ccgo_ts + 11019 + v1 = __ccgo_ts + 11077 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11037, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11095, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89889,25 +85378,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -89919,11 +85396,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11076, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11258, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11134, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11316, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10106, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10164, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -89933,31 +85410,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -89974,16 +85426,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90286,9 +85728,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90399,11 +85841,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*uint8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11391, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11449, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90474,30 +85916,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11414, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11472, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90518,9 +85964,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -90536,15 +85981,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11422, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11480, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -90555,16 +86000,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, *(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -90581,21 +86026,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0) _sqlite3Dequote(tls, zBuf1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11428, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11486, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -90621,7 +86066,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -90931,7 +86376,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91073,7 +86518,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 32))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91198,7 +86643,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -91299,7 +86744,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*8))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91381,7 +86826,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91465,8 +86910,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -91482,12 +86928,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -91561,7 +87007,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -91578,7 +87024,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11433, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11491, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -91633,23 +87079,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11440 + v1 = __ccgo_ts + 11498 } else { - v1 = __ccgo_ts + 5670 + v1 = __ccgo_ts + 5700 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11452, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11510, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11480, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -91659,33 +87105,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11528, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11586, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11649, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11707, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -91699,7 +87145,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -91710,8 +87156,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -91772,27 +87218,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11667, + FzName: __ccgo_ts + 11725, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11688, + FzName: __ccgo_ts + 11746, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11708, + FzName: __ccgo_ts + 11766, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11727, + FzName: __ccgo_ts + 11785, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11746, + FzName: __ccgo_ts + 11804, }, } @@ -92003,8 +87449,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11849, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11907, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92014,10 +87465,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11902, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11960, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92049,15 +87500,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11769, - FzCols: __ccgo_ts + 11782, + FzName: __ccgo_ts + 11827, + FzCols: __ccgo_ts + 11840, }, 1: { - FzName: __ccgo_ts + 11795, - FzCols: __ccgo_ts + 11808, + FzName: __ccgo_ts + 11853, + FzCols: __ccgo_ts + 11866, }, 2: { - FzName: __ccgo_ts + 11836, + FzName: __ccgo_ts + 11894, }, } @@ -92110,44 +87561,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92271,7 +87684,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92287,12 +87701,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92300,7 +87714,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92359,7 +87773,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11920, + FzName: __ccgo_ts + 11978, } func init() { @@ -92733,7 +88147,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11930, + FzName: __ccgo_ts + 11988, } func init() { @@ -92783,7 +88197,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11940, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11998, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -92794,7 +88208,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11945, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12003, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -92833,7 +88247,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11951, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12009, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -92851,7 +88265,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11957, + FzName: __ccgo_ts + 12015, } func init() { @@ -92917,7 +88331,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11966, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12024, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -92926,12 +88340,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11769, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11827, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93053,7 +88467,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93133,7 +88547,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93164,7 +88578,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93255,7 +88669,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93292,7 +88706,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93325,11 +88739,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11980) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12038) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11984) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12042) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93437,13 +88851,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93458,7 +88865,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1663 + z = __ccgo_ts + 1667 } i = 0 for { @@ -93493,17 +88900,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*uint8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11988, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12046, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+11999, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12057, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12009, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12067, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93515,13 +88922,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -93572,7 +88972,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -93775,8 +89175,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -93882,11 +89282,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11795, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11853, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12021, __ccgo_ts+12090, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12079, __ccgo_ts+12148, zDb) } return rc } @@ -93952,10 +89352,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11769, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12142, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12200, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94068,7 +89468,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6711, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6740, zName) == 0) } // C documentation @@ -94110,21 +89510,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1663 + zFile = __ccgo_ts + 1667 } if zName == uintptr(0) { - zName = __ccgo_ts + 1663 + zName = __ccgo_ts + 1667 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4032) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4062) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12183, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12241, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94155,7 +89555,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12186, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12244, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94164,7 +89564,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12223, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12281, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94176,13 +89576,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94220,7 +89620,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12253, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94228,7 +89628,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12282, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12340, 0) rc = int32(SQLITE_ERROR) } } @@ -94272,10 +89672,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12378, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12436, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12399, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12425, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12483, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94440,7 +89840,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12447, + FzName: __ccgo_ts + 12505, } func init() { @@ -94462,7 +89862,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12461, + FzName: __ccgo_ts + 12519, } func init() { @@ -94488,7 +89888,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12475, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12533, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94522,7 +89922,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12499, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12557, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -94649,6 +90049,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -94721,9 +90123,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -94739,7 +90141,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12603, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -94767,11 +90169,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12568, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12626, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12574, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12632, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12580, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12638, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -94831,7 +90233,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8092 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -94866,7 +90268,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12607, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12665, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -94903,47 +90305,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -94984,7 +90345,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95082,7 +90443,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95160,7 +90523,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95174,7 +90537,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95287,21 +90652,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6711) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6740) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6147) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95331,12 +90696,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6147) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6175) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } } @@ -95374,7 +90739,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12622, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12680, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95384,7 +90749,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95392,15 +90757,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12630 + v1 = __ccgo_ts + 12688 } else { - v1 = __ccgo_ts + 12643 + v1 = __ccgo_ts + 12701 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95438,12 +90803,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - return __ccgo_ts + 6697 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + return __ccgo_ts + 6726 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6659+7) == 0 { - return __ccgo_ts + 6678 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6688+7) == 0 { + return __ccgo_ts + 6707 } } return zName @@ -95567,9 +90932,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -95968,7 +91333,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6147) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6175) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96000,7 +91365,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6711, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6740, zName) { break } goto _1 @@ -96058,13 +91423,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12657, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12674, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96108,12 +91473,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*8))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*8))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12694, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12752, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96149,23 +91514,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96285,7 +91652,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96328,9 +91695,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96343,7 +91710,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12736, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12794, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96359,9 +91726,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10983 + v2 = __ccgo_ts + 11041 } else { - v2 = __ccgo_ts + 9245 + v2 = __ccgo_ts + 9303 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96371,9 +91738,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96397,11 +91764,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10983 + v4 = __ccgo_ts + 11041 } else { - v4 = __ccgo_ts + 9245 + v4 = __ccgo_ts + 9303 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12777, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96409,11 +91776,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12798, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12856, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96445,19 +91812,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96477,15 +91854,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96500,7 +91882,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -96561,7 +91943,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12833, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -96570,14 +91952,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12867, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12925, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -96609,11 +91993,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity uint8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -96624,7 +92008,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -96634,12 +92018,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12910, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12968, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12917, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12975, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -96681,21 +92065,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*uint8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = uint8(0) _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12927, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -96706,7 +92079,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -96719,12 +92092,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*uint8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = uint8(0) _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -96896,10 +92278,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13011, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12998, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13056, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -96957,7 +92339,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13039, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13097, 0) } } @@ -96985,8 +92367,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -96994,7 +92376,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13091, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13149, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97013,21 +92395,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97050,7 +92421,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13132, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97078,8 +92449,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97166,17 +92542,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13188, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13231, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13289, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13239, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13297, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97208,7 +92584,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13304, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97349,9 +92725,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97362,31 +92739,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1663 - zSep2 = __ccgo_ts + 13277 - zEnd = __ccgo_ts + 5171 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1667 + zSep2 = __ccgo_ts + 13335 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13279 - zSep2 = __ccgo_ts + 13283 - zEnd = __ccgo_ts + 13288 + zSep = __ccgo_ts + 13337 + zSep2 = __ccgo_ts + 13341 + zEnd = __ccgo_ts + 13346 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13291, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13349, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97397,8 +92774,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97411,17 +92789,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3860, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1663, - 1: __ccgo_ts + 13305, - 2: __ccgo_ts + 13311, - 3: __ccgo_ts + 13316, - 4: __ccgo_ts + 13321, - 5: __ccgo_ts + 13311, + 0: __ccgo_ts + 1667, + 1: __ccgo_ts + 13363, + 2: __ccgo_ts + 13369, + 3: __ccgo_ts + 13374, + 4: __ccgo_ts + 13379, + 5: __ccgo_ts + 13369, } // C documentation @@ -97430,15 +92809,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97453,7 +92833,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -97686,8 +93066,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -97787,7 +93177,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -97800,8 +93190,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -97831,7 +93221,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98023,7 +93413,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -98050,9 +93440,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13327, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13385, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13360, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13418, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98073,11 +93463,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13387, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13445, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13437, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13495, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98124,7 +93514,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13469, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13527, 0) return } } @@ -98158,16 +93548,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9245 - zType2 = __ccgo_ts + 13513 + zType = __ccgo_ts + 9303 + zType2 = __ccgo_ts + 13571 } else { /* A view */ - zType = __ccgo_ts + 10983 - zType2 = __ccgo_ts + 13519 + zType = __ccgo_ts + 11041 + zType2 = __ccgo_ts + 13577 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98184,24 +93574,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98249,13 +93644,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13524, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13539, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13597, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98264,15 +93669,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13637, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13695, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13679, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13737, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13713, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13771, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98290,7 +93695,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9767) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9825) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98323,7 +93728,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13734, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13792, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98340,7 +93745,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10983, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11041, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98437,7 +93842,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13770, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13828, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -98621,7 +94026,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13800, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13858, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -98634,7 +94039,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13815, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13873, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -98717,9 +94122,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13882, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13940, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -98760,7 +94165,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13896, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -98769,7 +94174,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13941, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13999, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -98804,11 +94209,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3483, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3513, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7453, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7482, int32(10)) == 0 { return 0 } return int32(1) @@ -98863,9 +94268,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -98898,18 +94303,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14008, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14066, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14036, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14070, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14128, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -98919,7 +94324,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12042, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -98967,19 +94372,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14102, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14160, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14165, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -99036,7 +94441,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14259, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14317, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99151,11 +94556,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99177,7 +94582,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99222,13 +94627,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99251,23 +94656,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99296,11 +94701,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14305 + v2 = __ccgo_ts + 14363 } else { - v2 = __ccgo_ts + 14311 + v2 = __ccgo_ts + 14369 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14316, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14374, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99378,7 +94783,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14344, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14402, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99388,7 +94793,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14350, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14408, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99402,16 +94807,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14400, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14458, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14428, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14453, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14511, 0) goto exit_create_index } /* @@ -99432,19 +94837,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14344, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14402, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14487, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14545, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14521, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14579, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99465,7 +94870,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14545, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14603, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99483,9 +94888,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99513,7 +94918,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14344) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14402) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -99545,7 +94950,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -99597,7 +95002,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14568, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14626, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -99607,7 +95012,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -99617,8 +95022,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -99696,7 +95101,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -99744,7 +95149,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14629, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14687, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -99774,8 +95179,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14671, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14729, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -99788,7 +95193,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -99815,11 +95220,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1663 + v13 = __ccgo_ts + 1667 } else { - v13 = __ccgo_ts + 14688 + v13 = __ccgo_ts + 14746 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14696, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14754, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -99827,7 +95232,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14716, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14774, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -99835,7 +95240,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14775, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -99998,16 +95403,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14860, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14820, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14878, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100015,9 +95420,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100033,8 +95438,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14893, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11980, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14951, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12038, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100107,12 +95512,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100224,13 +95629,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14953, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -100311,7 +95716,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -100361,7 +95766,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -100532,11 +95937,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14989 + v1 = __ccgo_ts + 15047 } else { - v1 = __ccgo_ts + 14992 + v1 = __ccgo_ts + 15050 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14998, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15056, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -100735,7 +96140,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15034, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15092, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -100782,9 +96187,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15040 + v1 = __ccgo_ts + 15098 } else { - v1 = __ccgo_ts + 15049 + v1 = __ccgo_ts + 15107 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -100816,9 +96221,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15034, - 1: __ccgo_ts + 15056, - 2: __ccgo_ts + 15040, + 0: __ccgo_ts + 15092, + 1: __ccgo_ts + 15114, + 2: __ccgo_ts + 15098, } // C documentation @@ -100838,7 +96243,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15064, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15122, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -100863,7 +96268,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101294,7 +96699,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102176,11 +97579,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15297, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15326, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102284,7 +97687,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102341,7 +97744,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15400, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15458, -int32(1)) return } if argc == int32(3) { @@ -104060,7 +99468,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15433, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15491, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104142,7 +99550,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104214,32 +99622,32 @@ var _hexdigits = [16]uint8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15478, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15536, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15486, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15544, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1424, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1428, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -104267,13 +99675,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15494, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15552 + } else { + v2 = __ccgo_ts + 15556 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1668, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*uint8)(unsafe.Pointer(zOut + uintptr(v2))) = uint8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0) + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15559, -int32(1)) + return +} + // C documentation // // /* @@ -104285,6 +99829,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104295,7 +99843,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -104506,7 +100054,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1663 + zPass = __ccgo_ts + 1667 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104730,7 +100278,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -104819,7 +100367,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11389, + 0: __ccgo_ts + 11447, } // C documentation @@ -104831,8 +100379,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -104847,7 +100395,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -104859,16 +100407,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -104887,7 +100435,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1663) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1667) } // C documentation @@ -104933,7 +100481,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1663 + zIn = __ccgo_ts + 1667 } i = 0 for { @@ -104979,7 +100527,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15497, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15582, int32(4), libc.UintptrFromInt32(0)) } } @@ -105040,7 +100588,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12607, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12665, -int32(1)) return } if argc == int32(2) { @@ -105071,17 +100619,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105150,7 +100687,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105232,7 +100769,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15377, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105295,12 +100832,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105464,7 +100995,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -105475,7 +101006,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -105562,7 +101093,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1663, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1667, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -105582,7 +101113,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15502, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15587, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -105611,8 +101142,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15508, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15508, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15593, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15593, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -105792,11 +101323,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -105900,7 +101431,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -105913,542 +101444,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15513, + FzName: __ccgo_ts + 15598, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15533, + FzName: __ccgo_ts + 15618, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15546, + FzName: __ccgo_ts + 15631, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15564, + FzName: __ccgo_ts + 15649, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15573, + FzName: __ccgo_ts + 15658, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15596, + FzName: __ccgo_ts + 15681, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15622, + FzName: __ccgo_ts + 15707, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15647, + FzName: __ccgo_ts + 15732, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15656, + FzName: __ccgo_ts + 15741, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15667, + FzName: __ccgo_ts + 15752, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15674, + FzName: __ccgo_ts + 15759, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15713, + FzName: __ccgo_ts + 15798, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15720, + FzName: __ccgo_ts + 15805, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15728, + FzName: __ccgo_ts + 15813, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15735, + FzName: __ccgo_ts + 15820, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15748, + FzName: __ccgo_ts + 15833, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15754, + FzName: __ccgo_ts + 15839, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15761, + FzName: __ccgo_ts + 15846, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15768, + FzName: __ccgo_ts + 15853, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15776, + FzName: __ccgo_ts + 15861, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15781, + FzName: __ccgo_ts + 15866, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15791, + FzName: __ccgo_ts + 15876, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15797, + FzName: __ccgo_ts + 15882, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15803, + FzName: __ccgo_ts + 15888, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15813, + FzName: __ccgo_ts + 15898, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15820, + FzName: __ccgo_ts + 15905, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15830, + FzName: __ccgo_ts + 15915, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15837, + FzName: __ccgo_ts + 15922, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15844, + FzName: __ccgo_ts + 15929, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15855, + FzName: __ccgo_ts + 15940, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15862, + FzName: __ccgo_ts + 15947, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15877, + FzName: __ccgo_ts + 15962, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15894, + FzName: __ccgo_ts + 15979, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15905, + FzName: __ccgo_ts + 15990, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15911, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15997, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15929, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16003, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15937, + FzName: __ccgo_ts + 16016, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15951, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16034, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15959, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16042, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16056, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16064, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15985, + FzName: __ccgo_ts + 16090, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15989, + FzName: __ccgo_ts + 16094, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15995, + FzName: __ccgo_ts + 16100, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16018, + FzName: __ccgo_ts + 16123, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16029, + FzName: __ccgo_ts + 16134, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, + FzName: __ccgo_ts + 15593, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16034, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1236, + FzName: __ccgo_ts + 15593, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1244, + FzName: __ccgo_ts + 16139, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16039, + FzName: __ccgo_ts + 1240, }, 74: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16045, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1248, }, 75: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16048, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16144, }, 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 16150, }, 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16058, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16153, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16048, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16157, }, 79: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16063, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 16163, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16067, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16153, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16071, + FzName: __ccgo_ts + 16168, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16077, + FzName: __ccgo_ts + 16172, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16081, + FzName: __ccgo_ts + 16176, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16086, + FzName: __ccgo_ts + 16182, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16091, + FzName: __ccgo_ts + 16186, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16096, + FzName: __ccgo_ts + 16191, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16102, + FzName: __ccgo_ts + 16196, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16106, + FzName: __ccgo_ts + 16201, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, + FzName: __ccgo_ts + 16207, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16114, + FzName: __ccgo_ts + 16211, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, + FzName: __ccgo_ts + 16215, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16124, + FzName: __ccgo_ts + 16219, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16129, + FzName: __ccgo_ts + 16224, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16135, + FzName: __ccgo_ts + 16229, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16141, + FzName: __ccgo_ts + 16234, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16147, + FzName: __ccgo_ts + 16240, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16152, + FzName: __ccgo_ts + 16246, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16160, + FzName: __ccgo_ts + 16252, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16168, + FzName: __ccgo_ts + 16257, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16171, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16265, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16273, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16276, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6856, + FzName: __ccgo_ts + 6885, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16176, + FzName: __ccgo_ts + 16281, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16180, + FzName: __ccgo_ts + 16285, }, } @@ -106507,109 +102049,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -106833,7 +102377,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -106926,7 +102470,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16183, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16288, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -107750,7 +103294,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108037,11 +103581,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6722, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6718, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108105,7 +103649,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5306) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5336) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108121,7 +103665,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -108569,7 +104113,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -108687,7 +104231,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8349, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8378, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -108753,11 +104297,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109082,7 +104626,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109096,7 +104640,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109131,7 +104675,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109144,7 +104688,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109271,27 +104815,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109372,7 +104916,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109399,7 +104943,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -109408,44 +104952,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16228, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16333, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16269, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16374, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109467,31 +104995,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16301, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16406, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109515,10 +105043,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -109559,8 +105087,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -109577,34 +105105,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16309, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16414, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16361, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16466, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -109711,18 +105239,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -109732,13 +105260,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -109749,14 +105277,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -109773,16 +105301,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -109893,11 +105421,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -109956,7 +105484,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16453) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16558) } goto insert_cleanup insert_cleanup: @@ -110079,33 +105607,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110352,7 +105853,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -112586,7 +107767,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16502, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16607, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -112606,19 +107787,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16506, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16611, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16512, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16617, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112633,14 +107814,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16555, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16660, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -112664,7 +107845,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16587, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16692, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112673,7 +107854,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16467, + 0: __ccgo_ts + 16572, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -112742,14 +107923,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} +var _sqlite3Autoext = Tsqlite3AutoExtList{} -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 - -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -112764,7 +107940,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -112782,7 +107958,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -112797,7 +107973,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -112807,6 +107983,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -112818,7 +107996,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -112830,7 +108008,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -112906,7 +108084,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16624, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16729, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -112960,63 +108138,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5562, - 1: __ccgo_ts + 16663, - 2: __ccgo_ts + 9245, - 3: __ccgo_ts + 16667, - 4: __ccgo_ts + 16672, - 5: __ccgo_ts + 16675, - 6: __ccgo_ts + 16685, - 7: __ccgo_ts + 16695, - 8: __ccgo_ts + 16701, - 9: __ccgo_ts + 16705, - 10: __ccgo_ts + 16710, - 11: __ccgo_ts + 16715, - 12: __ccgo_ts + 16723, - 13: __ccgo_ts + 16734, - 14: __ccgo_ts + 16737, - 15: __ccgo_ts + 16744, - 16: __ccgo_ts + 16705, - 17: __ccgo_ts + 16710, - 18: __ccgo_ts + 16751, - 19: __ccgo_ts + 16756, - 20: __ccgo_ts + 16759, - 21: __ccgo_ts + 16766, - 22: __ccgo_ts + 16701, - 23: __ccgo_ts + 16705, - 24: __ccgo_ts + 16772, - 25: __ccgo_ts + 16777, - 26: __ccgo_ts + 16782, - 27: __ccgo_ts + 16705, - 28: __ccgo_ts + 16786, - 29: __ccgo_ts + 16710, - 30: __ccgo_ts + 16794, - 31: __ccgo_ts + 16798, - 32: __ccgo_ts + 16803, - 33: __ccgo_ts + 11984, - 34: __ccgo_ts + 11980, - 35: __ccgo_ts + 16809, - 36: __ccgo_ts + 16814, - 37: __ccgo_ts + 16819, - 38: __ccgo_ts + 16663, - 39: __ccgo_ts + 16705, - 40: __ccgo_ts + 16824, - 41: __ccgo_ts + 16831, - 42: __ccgo_ts + 16838, - 43: __ccgo_ts + 9245, - 44: __ccgo_ts + 16846, - 45: __ccgo_ts + 5565, - 46: __ccgo_ts + 16852, - 47: __ccgo_ts + 16663, - 48: __ccgo_ts + 16705, - 49: __ccgo_ts + 16857, - 50: __ccgo_ts + 16862, - 51: __ccgo_ts + 16048, - 52: __ccgo_ts + 16867, - 53: __ccgo_ts + 16880, - 54: __ccgo_ts + 16889, - 55: __ccgo_ts + 16896, - 56: __ccgo_ts + 16907, + 0: __ccgo_ts + 5592, + 1: __ccgo_ts + 16768, + 2: __ccgo_ts + 9303, + 3: __ccgo_ts + 16772, + 4: __ccgo_ts + 16777, + 5: __ccgo_ts + 16780, + 6: __ccgo_ts + 16790, + 7: __ccgo_ts + 16800, + 8: __ccgo_ts + 16806, + 9: __ccgo_ts + 16810, + 10: __ccgo_ts + 16815, + 11: __ccgo_ts + 16820, + 12: __ccgo_ts + 16828, + 13: __ccgo_ts + 16839, + 14: __ccgo_ts + 16842, + 15: __ccgo_ts + 16810, + 16: __ccgo_ts + 16849, + 17: __ccgo_ts + 16815, + 18: __ccgo_ts + 16857, + 19: __ccgo_ts + 16861, + 20: __ccgo_ts + 16866, + 21: __ccgo_ts + 16872, + 22: __ccgo_ts + 16810, + 23: __ccgo_ts + 16815, + 24: __ccgo_ts + 16879, + 25: __ccgo_ts + 16884, + 26: __ccgo_ts + 16887, + 27: __ccgo_ts + 16894, + 28: __ccgo_ts + 16806, + 29: __ccgo_ts + 16810, + 30: __ccgo_ts + 16900, + 31: __ccgo_ts + 16905, + 32: __ccgo_ts + 16910, + 33: __ccgo_ts + 16768, + 34: __ccgo_ts + 16810, + 35: __ccgo_ts + 16914, + 36: __ccgo_ts + 16921, + 37: __ccgo_ts + 16928, + 38: __ccgo_ts + 12042, + 39: __ccgo_ts + 12038, + 40: __ccgo_ts + 16936, + 41: __ccgo_ts + 16941, + 42: __ccgo_ts + 16946, + 43: __ccgo_ts + 9303, + 44: __ccgo_ts + 16951, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16957, + 47: __ccgo_ts + 16962, + 48: __ccgo_ts + 16153, + 49: __ccgo_ts + 16967, + 50: __ccgo_ts + 16768, + 51: __ccgo_ts + 16810, + 52: __ccgo_ts + 16980, + 53: __ccgo_ts + 16985, + 54: __ccgo_ts + 16994, + 55: __ccgo_ts + 17001, + 56: __ccgo_ts + 17012, } // C documentation @@ -113035,338 +108213,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16915, + FzName: __ccgo_ts + 17020, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16930, + FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16945, + FzName: __ccgo_ts + 17050, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16957, + FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16973, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16896, + FzName: __ccgo_ts + 17001, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16986, + FzName: __ccgo_ts + 17091, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 16998, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17018, + FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17034, + FzName: __ccgo_ts + 17139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17055, + FzName: __ccgo_ts + 17160, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17070, + FzName: __ccgo_ts + 17175, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17086, + FzName: __ccgo_ts + 17191, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17100, + FzName: __ccgo_ts + 17205, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17113, + FzName: __ccgo_ts + 17218, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17127, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17146, + FzName: __ccgo_ts + 17251, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17165, + FzName: __ccgo_ts + 17270, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17188, + FzName: __ccgo_ts + 17293, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17197, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17215, + FzName: __ccgo_ts + 17320, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17232, + FzName: __ccgo_ts + 17337, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17245, + FzName: __ccgo_ts + 17350, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17260, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17278, + FzName: __ccgo_ts + 17383, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17288, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17302, + FzName: __ccgo_ts + 17407, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17318, + FzName: __ccgo_ts + 17423, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17343, + FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17362, + FzName: __ccgo_ts + 17467, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17373, + FzName: __ccgo_ts + 17478, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17384, + FzName: __ccgo_ts + 17489, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17396, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17412, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17425, + FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17444, + FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17463, + FzName: __ccgo_ts + 17568, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17476, + FzName: __ccgo_ts + 17581, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17491, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17501, + FzName: __ccgo_ts + 17606, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17513, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17522, + FzName: __ccgo_ts + 17627, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17533, + FzName: __ccgo_ts + 17638, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17543, + FzName: __ccgo_ts + 17648, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17555, + FzName: __ccgo_ts + 17660, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17566, + FzName: __ccgo_ts + 17671, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17578, + FzName: __ccgo_ts + 17683, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17595, + FzName: __ccgo_ts + 17700, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17614, + FzName: __ccgo_ts + 17719, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17640, + FzName: __ccgo_ts + 17745, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17655, + FzName: __ccgo_ts + 17760, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17774, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17688, + FzName: __ccgo_ts + 17793, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17702, + FzName: __ccgo_ts + 17807, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17718, + FzName: __ccgo_ts + 17823, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17730, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17741, + FzName: __ccgo_ts + 17846, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17752, + FzName: __ccgo_ts + 17857, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113374,45 +108552,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17764, + FzName: __ccgo_ts + 17869, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17775, + FzName: __ccgo_ts + 17880, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17796, + FzName: __ccgo_ts + 17901, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17804, + FzName: __ccgo_ts + 17909, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17819, + FzName: __ccgo_ts + 17924, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17832, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17851, + FzName: __ccgo_ts + 17956, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17866, + FzName: __ccgo_ts + 17971, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113430,7 +108608,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -113538,10 +108716,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17882) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17987) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17892) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17997) { return PAGER_LOCKINGMODE_NORMAL } } @@ -113559,13 +108737,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8405) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8434) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17899) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18004) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17904) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18009) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -113588,10 +108766,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) <= int32('2') { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16857) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16980) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17916) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18021) == 0 { return int32(2) } else { return 0 @@ -113613,7 +108791,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17923, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18028, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -113743,15 +108921,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17985 + zName = __ccgo_ts + 18090 case int32(OE_SetDflt): - zName = __ccgo_ts + 17994 + zName = __ccgo_ts + 18099 case int32(OE_Cascade): - zName = __ccgo_ts + 18006 + zName = __ccgo_ts + 18111 case int32(OE_Restrict): - zName = __ccgo_ts + 18014 + zName = __ccgo_ts + 18119 default: - zName = __ccgo_ts + 18023 + zName = __ccgo_ts + 18128 break } return zName @@ -113772,12 +108950,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18033, - 1: __ccgo_ts + 18040, - 2: __ccgo_ts + 18048, - 3: __ccgo_ts + 18052, - 4: __ccgo_ts + 17916, - 5: __ccgo_ts + 18061, + 0: __ccgo_ts + 18138, + 1: __ccgo_ts + 18145, + 2: __ccgo_ts + 18153, + 3: __ccgo_ts + 18157, + 4: __ccgo_ts + 18021, + 5: __ccgo_ts + 18166, } // C documentation @@ -113839,15 +109017,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18086 + zType = __ccgo_ts + 18191 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18088 + zType = __ccgo_ts + 18193 } else { - zType = __ccgo_ts + 7804 + zType = __ccgo_ts + 7833 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18090, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18195, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -113856,9 +109034,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18065, - 2: __ccgo_ts + 18070, - 3: __ccgo_ts + 18078, + 1: __ccgo_ts + 18170, + 2: __ccgo_ts + 18175, + 3: __ccgo_ts + 18183, } // C documentation @@ -113957,7 +109135,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18097, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18202, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114000,7 +109178,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114045,7 +109223,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114104,7 +109282,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18101) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18206) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114147,7 +109325,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114175,7 +109353,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17892 + zRet = __ccgo_ts + 17997 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114203,7 +109381,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17882 + zRet = __ccgo_ts + 17987 } _returnSingleText(tls, v, zRet) break @@ -114493,7 +109671,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uint8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18106, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18211, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114503,7 +109681,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*uint8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -114525,7 +109703,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18131, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18236, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -114557,8 +109735,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18184) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18289) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -114638,9 +109817,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18190 + v14 = __ccgo_ts + 18295 } else { - v14 = __ccgo_ts + 18198 + v14 = __ccgo_ts + 18303 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -114652,7 +109831,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667), v15, v16, k, isHidden)) goto _12 _12: ; @@ -114711,7 +109890,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18205, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18310, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -114719,7 +109898,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FpSchema + 8 @@ -114741,19 +109920,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13231 + zType = __ccgo_ts + 13289 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18221 + zType = __ccgo_ts + 18326 } else { - zType = __ccgo_ts + 9245 + zType = __ccgo_ts + 9303 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18228, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18333, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -114800,9 +109979,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18235, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18340, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18240, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18345, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -114826,11 +110005,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18245, - 1: __ccgo_ts + 18247, - 2: __ccgo_ts + 16734, + 0: __ccgo_ts + 18350, + 1: __ccgo_ts + 18352, + 2: __ccgo_ts + 16839, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18249, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18354, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -114849,7 +110028,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18255, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18360, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -114866,7 +110045,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18259, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18364, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -114916,7 +110095,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -114928,7 +110107,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -114954,7 +110133,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18262, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18271)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18367, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18376)) goto _32 _32: ; @@ -114968,8 +110147,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115095,7 +110274,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18276, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18381, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115191,7 +110370,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115235,7 +110414,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -115286,7 +110465,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18280, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18385, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115297,7 +110476,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18304) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18409) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115433,7 +110612,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18333, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115495,7 +110674,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115517,7 +110696,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18369, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18474, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -115530,7 +110709,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18389, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18494, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -115538,7 +110717,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18411, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18516, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -115549,10 +110728,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18434, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18539, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18436, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -115586,7 +110765,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18456, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18561, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -115610,9 +110789,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18491) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18596) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -115625,9 +110804,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18512) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18617) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18548) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18653) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -115655,9 +110834,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18559) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18664) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -115685,7 +110864,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18586) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18691) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -115782,7 +110961,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18613 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18718 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -115861,7 +111040,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18674, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18779, libc.VaList(bp+176, zRight)) } } } @@ -115966,13 +111145,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17899) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18004) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18699) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18804) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18052) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18157) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116107,7 +111286,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116137,7 +111316,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6651, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6680, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116199,7 +111378,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18707, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18812, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116472,34 +111651,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18616, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18621, + FzName: __ccgo_ts + 18726, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18627, + FzName: __ccgo_ts + 18732, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18636, + FzName: __ccgo_ts + 18741, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18645, + FzName: __ccgo_ts + 18750, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18653, + FzName: __ccgo_ts + 18758, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18661, + FzName: __ccgo_ts + 18766, }, 7: { - FzName: __ccgo_ts + 18668, + FzName: __ccgo_ts + 18773, }, 8: {}, } @@ -116556,25 +111735,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -116595,14 +111755,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18725) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18830) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18740, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18845, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -116611,19 +111771,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18747, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18852, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18753) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18765) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18870) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -116638,7 +111798,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -116819,7 +111979,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -116831,13 +111991,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18780) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18885) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18788, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18893, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18897, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -116846,7 +112006,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -116972,24 +112132,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18826, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18931, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5173 + v1 = __ccgo_ts + 5203 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18854, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18885, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18990, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -116997,9 +112157,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18796, - 1: __ccgo_ts + 18803, - 2: __ccgo_ts + 18815, + 0: __ccgo_ts + 18901, + 1: __ccgo_ts + 18908, + 2: __ccgo_ts + 18920, } // C documentation @@ -117075,7 +112235,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117108,11 +112268,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18893) + _corruptSchema(tls, pData, argv, __ccgo_ts+18998) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } } @@ -117151,18 +112311,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9245 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9303 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8317 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18906 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8346 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19011 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117246,7 +112406,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12282) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12340) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117272,7 +112432,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18978) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19083) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117287,7 +112447,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19002, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19107, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -117583,7 +112743,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -117596,9 +112756,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -117616,13 +112776,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1637, 0) } } @@ -117645,7 +112805,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -117656,7 +112816,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1637, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -117705,7 +112865,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19036, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19141, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -117721,7 +112881,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19066, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19171, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -117744,10 +112904,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -117755,7 +112915,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3860, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -117785,7 +112945,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -117919,7 +113079,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118041,15 +113201,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118085,21 +113236,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118179,7 +113315,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118187,7 +113323,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118343,15 +113479,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11389 - zSp2 = __ccgo_ts + 11389 + zSp1 = __ccgo_ts + 11447 + zSp2 = __ccgo_ts + 11447 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19085, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19190, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118408,25 +113544,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -118558,13 +113697,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -118642,7 +113781,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19115, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19220, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -118692,12 +113831,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19165, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19270, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -118712,9 +113851,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19229, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19334, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -118724,6 +113864,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = uint8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -118758,7 +113905,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6856, + Fz: __ccgo_ts + 6885, Fn: uint32(8), } @@ -118775,13 +113922,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -118806,7 +113946,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -118851,7 +113991,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -118875,7 +114015,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -118896,7 +114036,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119019,7 +114159,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119146,10 +114286,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119157,7 +114297,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119334,7 +114474,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119445,8 +114585,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119454,7 +114594,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -119539,13 +114679,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19286 + z = __ccgo_ts + 19391 case int32(TK_INTERSECT): - z = __ccgo_ts + 19296 + z = __ccgo_ts + 19401 case int32(TK_EXCEPT): - z = __ccgo_ts + 19306 + z = __ccgo_ts + 19411 default: - z = __ccgo_ts + 19313 + z = __ccgo_ts + 19418 break } return z @@ -119566,7 +114706,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+8, zUsage)) } /* @@ -119603,13 +114743,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19342 + v1 = __ccgo_ts + 19447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19356, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19461, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19387, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19492, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -119633,11 +114773,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -119852,8 +114992,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1137 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16846 + zType = __ccgo_ts + 1141 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16951 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -119966,7 +115106,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -119975,7 +115115,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -119999,13 +115139,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16846 + zCol = __ccgo_ts + 16951 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120013,7 +115153,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120067,7 +115207,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120105,7 +115245,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16846 + v3 = __ccgo_ts + 16951 } zName = v3 } else { @@ -120120,7 +115260,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120156,7 +115296,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19547, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120275,7 +115415,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != libc.Int32FromUint8(_sqlite3AffinityType(tls, zType, uintptr(0))) { if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19450 + zType = __ccgo_ts + 19555 } else { zType = uintptr(0) j = int32(1) @@ -120341,7 +115481,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -120369,7 +115509,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120419,7 +115559,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120442,7 +115582,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -120590,7 +115730,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19454, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19559, 0) return } /* Obtain authorization to do a recursive query */ @@ -120627,7 +115767,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -120638,7 +115778,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -120652,7 +115792,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -120683,7 +115823,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19503, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19608, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -120698,7 +115838,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19545, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19650, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -120726,7 +115866,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19551, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19656, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -120779,11 +115919,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } else { - v1 = __ccgo_ts + 19566 + v1 = __ccgo_ts + 19671 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19568, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19673, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -120891,8 +116031,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19591, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19606, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19696, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19711, 0) } /* Generate code for the left and right SELECT statements. */ @@ -120917,7 +116057,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19286, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19391, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120943,7 +116083,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -120969,7 +116109,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121001,11 +116141,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121027,7 +116167,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121134,6 +116274,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121150,9 +116291,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19646, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19751, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19692, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19797, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121223,7 +116364,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121439,7 +116580,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -121471,7 +116612,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -121525,16 +116666,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7554) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7583) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -121552,32 +116693,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19774, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19879, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19785, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19890, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121590,7 +116731,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19790, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19895, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -121800,11 +116941,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5151 + v1 = __ccgo_ts + 5181 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -121965,7 +117106,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122155,9 +117296,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122369,7 +117510,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122516,7 +117657,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -122755,18 +117896,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -122806,11 +117935,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -122875,7 +118004,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -122893,12 +118022,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123380,7 +118509,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123426,13 +118555,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15705) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15790) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15709) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15794) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123520,8 +118649,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19796, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19901, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -123545,7 +118674,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -123627,7 +118756,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -123645,7 +118774,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19814, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19919, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -123793,7 +118922,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -123821,7 +118950,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19837, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -123843,12 +118972,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19857, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19962, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -123865,7 +118994,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19900 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20005 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -123896,7 +119025,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19923, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20028, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -123905,9 +119034,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19961 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20066 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19995 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20100 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -123956,7 +119085,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -123966,7 +119095,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20033, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20138, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124062,7 +119191,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124071,7 +119200,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124122,7 +119251,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20037, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124137,7 +119266,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20076, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20181, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124152,7 +119281,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124276,7 +119405,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6716 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124293,7 +119422,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20107, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124372,7 +119501,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20112, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20217, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124385,7 +119514,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124405,9 +119534,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20121, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20226, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20139, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) } } } @@ -124421,7 +119550,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20159, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20264, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -124618,14 +119747,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -124634,7 +119763,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -124666,11 +119795,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -124723,7 +119852,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -124760,12 +119889,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20190, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20295, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20241, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20346, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -124786,7 +119915,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20274, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20379, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -124925,7 +120054,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125033,7 +120162,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125077,7 +120206,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125100,16 +120229,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20307 + v1 = __ccgo_ts + 20412 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20330, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20435, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125141,7 +120270,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125270,6 +120399,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125298,7 +120428,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+15999) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16104) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125331,9 +120461,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125343,13 +120473,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125369,7 +120499,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -125542,8 +120672,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -125552,11 +120682,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -125572,7 +120702,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -125596,14 +120726,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20342, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20447, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -125704,7 +120834,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20396, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20501, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -125862,7 +120992,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 72)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1663, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1667, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -125905,14 +121035,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20436, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20541, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -125944,7 +121074,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -125959,7 +121089,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20451, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20556, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126013,7 +121143,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126046,7 +121176,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126105,7 +121235,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126134,6 +121264,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126156,10 +121293,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126193,8 +121330,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126209,8 +121346,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126239,8 +121376,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126257,7 +121394,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126270,11 +121407,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126308,49 +121445,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126358,16 +121496,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126385,11 +121523,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20467 + v47 = __ccgo_ts + 20572 } else { - v46 = __ccgo_ts + 20476 + v47 = __ccgo_ts + 20581 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126399,12 +121537,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126417,13 +121555,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126434,12 +121572,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126488,12 +121626,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -126563,9 +121705,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -126582,10 +121724,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -126612,8 +121754,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -126653,32 +121795,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -126720,7 +121862,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20467) + _explainTempTable(tls, pParse, __ccgo_ts+20572) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -126826,7 +121968,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -126842,7 +121984,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20485, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20590, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -126932,7 +122074,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127094,7 +122236,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20550, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) goto trigger_cleanup } iDb = int32(1) @@ -127134,7 +122276,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20596, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20701, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127144,11 +122286,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20604, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20709, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20645, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20750, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127157,13 +122299,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20596, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20701, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20685, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20790, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127171,8 +122313,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20711, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20816, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127180,15 +122322,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20749 + v1 = __ccgo_ts + 20854 } else { - v1 = __ccgo_ts + 20756 + v1 = __ccgo_ts + 20861 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20762, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20867, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20799, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20904, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127208,9 +122350,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127310,7 +122452,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20596, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20701, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127332,7 +122474,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20845, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20950, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127348,10 +122490,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20893, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20998, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20968, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21073, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -127619,11 +122761,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20997, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -127661,9 +122803,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -127678,7 +122820,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21017, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -127811,11 +122953,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21079 + v1 = __ccgo_ts + 21184 } else { - v1 = __ccgo_ts + 21086 + v1 = __ccgo_ts + 21191 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21093, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21198, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -127917,7 +123059,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21246, 0) return int32(1) } @@ -128065,12 +123207,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128078,19 +123220,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128101,7 +123246,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128115,7 +123260,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128183,7 +123328,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128282,10 +123427,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21183, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21288, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128307,7 +123454,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -128379,7 +123526,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -128795,13 +123942,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -128809,21 +123956,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -128870,7 +124017,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -128909,7 +124056,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -128953,58 +124100,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21197, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21302, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8092 + v10 = __ccgo_ts + 8121 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129034,17 +124169,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129056,11 +124191,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129076,11 +124211,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129089,18 +124224,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129109,16 +124244,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129136,24 +124271,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129179,50 +124314,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -129520,8 +124655,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -129571,8 +124706,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -129619,11 +124754,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -129635,11 +124770,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -129682,7 +124817,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21252) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21357) } goto update_cleanup update_cleanup: @@ -129739,13 +124874,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -129787,11 +124922,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130116,9 +125251,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]uint8)(unsafe.Pointer(bp + 200)))[0] = uint8(0) } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21265, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21370, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21269, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21374, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130207,13 +125342,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130221,7 +125356,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12657, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12715, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130303,7 +125438,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21342, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21346, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21447, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21451, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130394,7 +125529,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130433,24 +125568,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21350) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21455) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21390) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21495) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21433) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21538) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 76)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 76)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1663 + zOut = __ccgo_ts + 1667 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -130460,7 +125595,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21482) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21587) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130513,7 +125648,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15034) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15092) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130544,11 +125679,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21509, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21614, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21617, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21722, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130557,7 +125692,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21671, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21776, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -130567,7 +125702,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21808, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21913, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -130658,39 +125793,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -130701,7 +125803,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -130710,7 +125812,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -130720,7 +125822,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -130745,15 +125847,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -130768,13 +125870,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131094,7 +126198,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131217,24 +126321,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21931, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22036, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21955, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22060, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22054, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131291,7 +126400,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131318,7 +126427,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22073, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22178, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131352,7 +126461,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131360,9 +126469,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22115, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22220, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3860, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -131375,7 +126484,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22145 + zFormat = __ccgo_ts + 22250 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131401,7 +126510,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1663) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1667) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -131409,7 +126518,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16737, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16842, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131490,13 +126599,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22191, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22296, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -131577,7 +126686,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22191, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22296, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -131625,7 +126734,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22210, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22315, 0) return int32(SQLITE_ERROR) } goto _1 @@ -131636,9 +126745,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -131680,7 +126789,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3860 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } @@ -132046,7 +127155,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132136,7 +127245,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132156,7 +127265,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132220,7 +127329,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132233,7 +127342,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132393,271 +127502,9 @@ type TWhereLoop = struct { FaLTermSpace [3]uintptr } -type WhereLoop = TWhereLoop - -type TWherePath = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath = TWherePath - -type TWhereTerm = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm = TWhereTerm - -type TWhereLoopBuilder = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder = TWhereLoopBuilder - -type TWhereScan = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff uint8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan = TWhereScan - -type TWhereOrCost = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost = TWhereOrCost - -type TWhereOrSet = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet = TWhereOrSet - -type TWhereMemBlock = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock = TWhereMemBlock - -type TWhereRightJoin = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin = TWhereRightJoin - -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 +type WhereLoop = TWhereLoop -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { +type TWherePath = struct { FmaskLoop TBitmask FrevLoop TBitmask FnRow TLogEst @@ -132667,60 +127514,9 @@ type TWherePath1 = struct { FaLoop uintptr } -type WherePath1 = TWherePath1 +type WherePath = TWherePath -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { +type TWhereTerm = struct { FpExpr uintptr FpWC uintptr FtruthProb TLogEst @@ -132742,17 +127538,23 @@ type TWhereTerm1 = struct { FprereqAll TBitmask } -type WhereTerm1 = TWhereTerm1 +type WhereTerm = TWhereTerm -/* -** Allowed values of WhereTerm.wtFlags - */ +type TWhereLoopBuilder = struct { + FpWInfo uintptr + FpWC uintptr + FpNew uintptr + FpOrSet uintptr + FpRec uintptr + FnRecValid int32 + FbldFlags1 uint8 + FbldFlags2 uint8 + FiPlanLimit uint32 +} -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { +type WhereLoopBuilder = TWhereLoopBuilder + +type TWhereScan = struct { FpOrigWC uintptr FpWC uintptr FzCollName uintptr @@ -132766,162 +127568,39 @@ type TWhereScan1 = struct { FaiColumn [11]Ti16 } -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 +type WhereScan = TWhereScan -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause +type TWhereOrCost = struct { + Fprereq TBitmask + FrRun TLogEst + FnOut TLogEst } -type WhereAndInfo1 = TWhereAndInfo1 +type WhereOrCost = TWhereOrCost -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 +type TWhereOrSet = struct { + Fn Tu16 + Fa [3]TWhereOrCost } -type WhereMaskSet1 = TWhereMaskSet1 +type WhereOrSet = TWhereOrSet -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 +type TWhereMemBlock = struct { + FpNext uintptr + Fsz Tu64 } -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ +type WhereMemBlock = TWhereMemBlock -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel +type TWhereRightJoin = struct { + FiMatch int32 + FregBloom int32 + FregReturn int32 + FaddrSubrtn int32 + FendSubrtn int32 } -type WhereInfo1 = TWhereInfo1 +type WhereRightJoin = TWhereRightJoin /* ** Bitmasks for the operators on WhereTerm objects. These are all @@ -132954,10 +127633,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22223 + return __ccgo_ts + 22328 } if i == -int32(1) { - return __ccgo_ts + 16846 + return __ccgo_ts + 16951 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -132976,10 +127655,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -132987,7 +127666,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -132996,11 +127675,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133008,16 +127687,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } } @@ -133064,7 +127743,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22343, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133072,12 +127751,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22241 + v2 = __ccgo_ts + 22346 } else { - v2 = __ccgo_ts + 22246 + v2 = __ccgo_ts + 22351 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133094,7 +127773,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22254) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22359) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133105,9 +127784,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22256) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22361) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133152,11 +127831,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22258 + v2 = __ccgo_ts + 22363 } else { - v2 = __ccgo_ts + 22265 + v2 = __ccgo_ts + 22370 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22270, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22375, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133169,37 +127848,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11440 + zFmt = __ccgo_ts + 11498 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22276 + zFmt = __ccgo_ts + 22381 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22309 + zFmt = __ccgo_ts + 22414 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22334 + zFmt = __ccgo_ts + 22439 } else { - zFmt = __ccgo_ts + 22352 + zFmt = __ccgo_ts + 22457 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22361, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22466, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16846 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22369, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16951 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22474, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = uint8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22400, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22505, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133209,14 +127888,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22410, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22415) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22520) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22437 + v3 = __ccgo_ts + 22542 } else { - v3 = __ccgo_ts + 22445 + v3 = __ccgo_ts + 22550 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133237,7 +127916,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22451, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22556, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133267,10 +127946,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133303,14 +127982,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22462, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22567, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22483, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22588, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133334,16 +128013,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22335, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -133548,7 +128227,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -133604,8 +128283,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -133627,7 +128306,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -133684,10 +128363,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -133742,37 +128421,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -133797,10 +128462,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -133819,24 +128484,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -133848,8 +128513,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -133907,7 +128572,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -133989,7 +128654,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134120,7 +128785,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -134257,7 +128922,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134402,7 +129067,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134463,11 +129128,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134498,6 +129163,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -134636,7 +129304,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -134716,7 +129384,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -134750,7 +129418,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -134872,7 +129540,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135065,7 +129733,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135079,12 +129747,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135122,11 +129791,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135146,7 +129815,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135182,21 +129851,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135214,7 +129883,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135269,7 +129938,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22491, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22596, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135292,7 +129961,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22506, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22611, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -135781,9 +130450,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -135792,14 +130461,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22515, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22620, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -135838,15 +130507,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -135858,7 +130528,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -135931,7 +130601,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -136329,19 +130999,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16695, + FzOp: __ccgo_ts + 16800, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16029, + FzOp: __ccgo_ts + 16134, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15508, + FzOp: __ccgo_ts + 15593, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22529, + FzOp: __ccgo_ts + 22634, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -136861,37 +131531,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 uint8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if libc.Int32FromUint8(aff1) != libc.Int32FromUint8(aff2) && (!(libc.Int32FromUint8(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(libc.Int32FromUint8(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137129,7 +131803,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } } else { @@ -137141,10 +131815,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137203,7 +131877,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137225,7 +131899,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8078 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8107 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137326,7 +132000,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22577 + v13 = __ccgo_ts + 22682 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -137857,7 +132531,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22584, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -137929,22 +132603,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138057,7 +132719,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -138973,7 +133635,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141224,13 +135887,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141330,6 +135988,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141343,12 +136002,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -141794,7 +136470,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -141845,15 +136521,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -141885,7 +136552,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -141904,7 +136571,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -141941,7 +136608,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -141949,7 +136616,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -141970,19 +136637,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142078,7 +136745,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142256,7 +136923,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142284,6 +136951,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142360,7 +137035,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -142597,7 +137272,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142672,7 +137347,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142826,7 +137501,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143262,7 +137937,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22683, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22788, 0) rc = SQLITE_OK } else { break @@ -143491,17 +138166,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144470,7 +139134,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22718, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22823, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145048,7 +139712,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145204,7 +139868,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22736, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22841, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145225,11 +139889,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -145277,7 +139938,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22764, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22869, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145422,7 +140083,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -145456,7 +140118,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145478,7 +140140,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145491,7 +140153,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -145582,11 +140244,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -145613,16 +140275,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -145670,7 +140332,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -145801,7 +140463,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -145979,7 +140641,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146008,7 +140670,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146018,7 +140680,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22782, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22887, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146068,7 +140730,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146337,7 +140999,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22811, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22916, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146519,7 +141181,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22867, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22972, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -146845,7 +141507,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22912, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23017, libc.VaList(bp+8, zName)) } return p } @@ -146896,12 +141558,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23036, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23107, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -146974,7 +141636,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) } break } @@ -147005,16 +141667,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147033,17 +141685,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -147061,7 +141713,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147085,13 +141737,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147106,23 +141758,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147138,13 +141790,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147256,7 +141908,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23065, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23170, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147292,7 +141944,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147307,7 +141959,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147326,11 +141978,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147376,11 +142028,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147397,7 +142049,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147419,7 +142071,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -147543,7 +142195,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23091, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23196, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -147611,18 +142263,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23123 + zErr = __ccgo_ts + 23228 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23140 + zErr = __ccgo_ts + 23245 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23156 + zErr = __ccgo_ts + 23261 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23176, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -147646,7 +142298,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23209, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23314, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -147752,24 +142404,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -147787,12 +142439,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -147804,15 +142456,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -147845,7 +142497,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -147864,11 +142516,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23256, - 1: __ccgo_ts + 23309, - 2: __ccgo_ts + 22811, - 3: __ccgo_ts + 23360, - 4: __ccgo_ts + 23412, + 0: __ccgo_ts + 23361, + 1: __ccgo_ts + 23414, + 2: __ccgo_ts + 22916, + 3: __ccgo_ts + 23465, + 4: __ccgo_ts + 23517, } var _aOp1 = [5]int32{ @@ -147921,87 +142573,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148448,7 +143019,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -148544,7 +143115,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -148620,7 +143191,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -149261,12 +143832,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149274,13 +143845,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149300,13 +143871,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149333,7 +143904,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -149552,6 +144123,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -149612,7 +144187,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23462, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23567, libc.VaList(bp+8, p)) } // C documentation @@ -149626,6 +144201,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -149659,11 +144235,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23486 + v1 = __ccgo_ts + 23591 } else { - v1 = __ccgo_ts + 23495 + v1 = __ccgo_ts + 23600 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23501, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23606, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -149672,7 +144248,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23543, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23648, 0) } } } @@ -149778,7 +144354,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23577, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23682, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156245,14 +150821,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156263,16 +150831,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -156299,13 +150857,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -157420,19 +151978,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158235,20 +152793,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16846, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16951, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16759, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16887, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158289,7 +152847,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158434,7 +152997,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -158524,9 +153092,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -158881,7 +153449,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23642) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23747) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159221,23 +153789,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8102 + } else { + v347 = __ccgo_ts + 8107 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8073 - } else { - v347 = __ccgo_ts + 8078 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -159295,11 +153877,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -159309,9 +153891,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -159319,11 +153901,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -159421,11 +154003,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159475,15 +154057,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23651, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23756, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23746, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23935, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -159625,7 +154207,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -159819,7 +154401,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23915, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24020, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -161945,7 +156527,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -162550,14 +157132,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163419,22 +158006,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163445,11 +158041,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164028,7 +158624,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164048,7 +158644,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24002, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24107, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164173,11 +158769,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164349,14 +158945,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24545 + zErr = __ccgo_ts + 24650 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164368,31 +158964,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24070, - 1: __ccgo_ts + 24083, - 3: __ccgo_ts + 24099, - 4: __ccgo_ts + 24124, - 5: __ccgo_ts + 24138, - 6: __ccgo_ts + 24157, - 7: __ccgo_ts + 1633, - 8: __ccgo_ts + 24182, - 9: __ccgo_ts + 24219, - 10: __ccgo_ts + 24231, - 11: __ccgo_ts + 24246, - 12: __ccgo_ts + 24279, - 13: __ccgo_ts + 24297, - 14: __ccgo_ts + 24322, - 15: __ccgo_ts + 24351, - 17: __ccgo_ts + 6102, - 18: __ccgo_ts + 5504, - 19: __ccgo_ts + 24368, - 20: __ccgo_ts + 24386, - 21: __ccgo_ts + 24404, - 23: __ccgo_ts + 24438, - 25: __ccgo_ts + 24459, - 26: __ccgo_ts + 24485, - 27: __ccgo_ts + 24508, - 28: __ccgo_ts + 24529, + 0: __ccgo_ts + 24175, + 1: __ccgo_ts + 24188, + 3: __ccgo_ts + 24204, + 4: __ccgo_ts + 24229, + 5: __ccgo_ts + 24243, + 6: __ccgo_ts + 24262, + 7: __ccgo_ts + 1637, + 8: __ccgo_ts + 24287, + 9: __ccgo_ts + 24324, + 10: __ccgo_ts + 24336, + 11: __ccgo_ts + 24351, + 12: __ccgo_ts + 24384, + 13: __ccgo_ts + 24402, + 14: __ccgo_ts + 24427, + 15: __ccgo_ts + 24456, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24473, + 20: __ccgo_ts + 24491, + 21: __ccgo_ts + 24509, + 23: __ccgo_ts + 24543, + 25: __ccgo_ts + 24564, + 26: __ccgo_ts + 24590, + 27: __ccgo_ts + 24613, + 28: __ccgo_ts + 24634, } // C documentation @@ -164486,15 +159082,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164502,6 +159100,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164509,10 +159109,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -164539,6 +159139,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -164566,12 +159180,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -164589,9 +159203,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -164614,13 +159228,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24626, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24731, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -164638,15 +159252,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -164661,27 +159275,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -164692,30 +159306,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -164740,7 +159384,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24689, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24794, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -164771,13 +159415,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -164788,43 +159434,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -164835,12 +159485,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -164852,6 +159502,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164859,82 +159511,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -164978,18 +159640,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165015,7 +159679,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165025,7 +159689,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24740, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24845, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165147,7 +159811,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165279,7 +159943,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165289,7 +159953,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165325,7 +159989,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165338,7 +160002,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165347,7 +160011,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24761, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24866, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165382,9 +160046,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165494,7 +160158,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24829, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24934, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -165524,8 +160188,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24835, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24845, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24940, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24950, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -165614,24 +160278,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24873, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24978, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24877, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24982, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24877 + zModeType = __ccgo_ts + 24982 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24898, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25003, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3469 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -165660,12 +160324,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24913, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25018, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24933, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25038, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -165689,7 +160353,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24957, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25062, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -165709,11 +160373,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24883, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24890, + Fz: __ccgo_ts + 24995, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -165724,19 +160388,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24903, + Fz: __ccgo_ts + 25008, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24906, + Fz: __ccgo_ts + 25011, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24909, + Fz: __ccgo_ts + 25014, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17916, + Fz: __ccgo_ts + 18021, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -165864,8 +160528,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22577, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24973, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22682, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25078, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -165886,10 +160550,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4255 + zFilename = __ccgo_ts + 4285 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -165898,7 +160562,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -165925,9 +160589,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6711 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6740 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23975 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24080 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166021,7 +160685,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24979 + zFilename = __ccgo_ts + 25084 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166040,36 +160704,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166077,7 +160749,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166085,31 +160757,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166143,12 +160819,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166181,10 +160859,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166195,7 +160873,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166238,20 +160916,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24982, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25087, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25007) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25112) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25027) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25132) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25034) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25139) } // C documentation @@ -166276,9 +160954,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166305,29 +160983,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166351,7 +161018,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1137 + zDataType = __ccgo_ts + 1141 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -166382,15 +161049,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25051, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25156, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -166569,8 +161236,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167014,7 +161681,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -167410,7 +162077,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25079, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25184, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -167558,6 +162225,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -167581,7 +162250,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -167591,7 +162260,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -167603,7 +162272,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -167619,7 +162288,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -167628,7 +162297,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25087 + v2 = __ccgo_ts + 25192 } else { v2 = uintptr(0) } @@ -167707,7 +162376,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -167874,7 +162543,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168091,6 +162760,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168403,8 +163079,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168461,7 +163137,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168471,7 +163147,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168508,23 +163184,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1649, - 1: __ccgo_ts + 8073, - 2: __ccgo_ts + 8078, - 3: __ccgo_ts + 6387, - 4: __ccgo_ts + 6387, - 5: __ccgo_ts + 6382, - 6: __ccgo_ts + 6382, - 7: __ccgo_ts + 8384, - 8: __ccgo_ts + 8384, - 9: __ccgo_ts + 8384, - 10: __ccgo_ts + 8384, - 11: __ccgo_ts + 25110, - 12: __ccgo_ts + 25116, - 13: __ccgo_ts + 1663, - 14: __ccgo_ts + 1663, - 15: __ccgo_ts + 1663, - 16: __ccgo_ts + 1663, + 0: __ccgo_ts + 1653, + 1: __ccgo_ts + 8102, + 2: __ccgo_ts + 8107, + 3: __ccgo_ts + 6416, + 4: __ccgo_ts + 6416, + 5: __ccgo_ts + 6411, + 6: __ccgo_ts + 6411, + 7: __ccgo_ts + 8413, + 8: __ccgo_ts + 8413, + 9: __ccgo_ts + 8413, + 10: __ccgo_ts + 8413, + 11: __ccgo_ts + 25215, + 12: __ccgo_ts + 25221, + 13: __ccgo_ts + 1667, + 14: __ccgo_ts + 1667, + 15: __ccgo_ts + 1667, + 16: __ccgo_ts + 1667, } // C documentation @@ -168828,106 +163504,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]uint8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169007,7 +163583,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169305,8 +163881,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = uint8('u') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = uint8('0') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = uint8('0') - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -169440,9 +164016,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1653, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15478, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15536, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169456,14 +164032,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25140, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25228, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169517,7 +164091,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25257, -int32(1)) } } } @@ -169800,8 +164374,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25184, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25272, + FzRepl: __ccgo_ts + 25276, }, 1: { Fc1: uint8('i'), @@ -169809,32 +164383,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25196, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25284, + FzRepl: __ccgo_ts + 25276, }, 2: { Fc1: uint8('n'), Fc2: uint8('N'), Fn: uint8(3), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 1654, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 1658, + FzRepl: __ccgo_ts + 1653, }, 3: { Fc1: uint8('q'), Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25205, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25293, + FzRepl: __ccgo_ts + 1653, }, 4: { Fc1: uint8('s'), Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25210, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25298, + FzRepl: __ccgo_ts + 1653, }, } @@ -169849,7 +164423,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25215, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25303, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -169867,23 +164441,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -169961,7 +164535,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170032,7 +164606,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170307,7 +164885,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25258, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25346, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -170737,7 +165315,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('0') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || libc.Int32FromUint8(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -170776,7 +165354,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8073, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8102, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -170784,7 +165362,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8078, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8107, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -170861,14 +165439,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25184, int32(3)) == 0 { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25272, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25280, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25368, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171029,7 +165607,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1649, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1653, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171053,7 +165631,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171098,7 +165676,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*uint8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171111,7 +165689,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171160,10 +165738,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171197,15 +165771,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171274,15 +165848,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1653, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8073, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8102, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8078, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8107, uint32(5)) return i + uint32(1) _6: ; @@ -171331,9 +165905,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25188 + v19 = __ccgo_ts + 25276 } else { - v19 = __ccgo_ts + 11940 + v19 = __ccgo_ts + 11998 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171369,9 +165943,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, uint8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, uint8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = uint8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = uint8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171398,7 +165975,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25286, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25374, uint32(2)) zIn2++ sz2-- continue @@ -171421,7 +165998,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25289, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25377, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171429,12 +166006,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25296, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25384, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25301, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25389, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -171537,16 +166114,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -171614,7 +166181,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171637,12 +166204,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25311, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25399, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171657,50 +166224,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -171752,6 +166275,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -171772,6 +166373,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -171844,9 +166448,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -171889,7 +166493,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172377,7 +166992,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172512,7 +167127,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -172613,7 +167228,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } @@ -172650,11 +167265,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25140, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25228, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -172667,7 +167279,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -172686,10 +167298,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -172728,7 +167340,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25314, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25402, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -172744,7 +167356,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -172825,7 +167437,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -172837,34 +167449,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -172947,7 +167579,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173007,7 +167639,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173142,7 +167774,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25332 + v1 = __ccgo_ts + 25420 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173152,7 +167784,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } eErr = uint8(1) @@ -173262,23 +167894,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25334, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25336, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5226, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5256, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1676, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1706, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25426, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25341, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25429, uint32(1)) } } } @@ -173314,11 +167946,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1653, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -173586,7 +168218,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -173610,7 +168242,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25343, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25431, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -173621,7 +168253,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25394, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25482, -int32(1)) _jsonStringReset(tls, bp) return } @@ -173693,7 +168325,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_remove_done @@ -173730,7 +168362,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15951) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16056) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -173761,9 +168393,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25428 + v1 = __ccgo_ts + 25516 } else { - v1 = __ccgo_ts + 25432 + v1 = __ccgo_ts + 25520 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -173811,7 +168443,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_type_done @@ -173858,7 +168490,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25439 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25527 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -173932,17 +168564,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25444, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25532, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -173951,18 +168582,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174024,9 +168654,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174133,7 +168761,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25501, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25589, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174225,20 +168853,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, uint8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, uint8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, uint8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, uint8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -174282,7 +168912,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25504, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25592, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174310,16 +168940,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -174338,24 +168958,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174363,13 +168965,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174385,7 +168980,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25507) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25595) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174519,7 +169114,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25590, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25678, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -174545,9 +169140,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25597, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25685, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25605, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25693, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -174858,9 +169453,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174933,7 +169527,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25611, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25699, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -174957,7 +169551,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25169, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25257, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175018,186 +169612,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25613, + FzName: __ccgo_ts + 25701, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25618, + FzName: __ccgo_ts + 25706, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25624, + FzName: __ccgo_ts + 25712, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25635, + FzName: __ccgo_ts + 25723, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25665, + FzName: __ccgo_ts + 25753, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25685, + FzName: __ccgo_ts + 25773, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25698, + FzName: __ccgo_ts + 25786, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25712, + FzName: __ccgo_ts + 25800, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25715, + FzName: __ccgo_ts + 25803, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25719, + FzName: __ccgo_ts + 25807, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25731, + FzName: __ccgo_ts + 25819, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25744, + FzName: __ccgo_ts + 25832, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25756, + FzName: __ccgo_ts + 25844, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25769, + FzName: __ccgo_ts + 25857, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25780, + FzName: __ccgo_ts + 25868, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25804, + FzName: __ccgo_ts + 25892, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25815, + FzName: __ccgo_ts + 25903, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25827, + FzName: __ccgo_ts + 25915, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25840, + FzName: __ccgo_ts + 25928, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25853, + FzName: __ccgo_ts + 25941, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25867, + FzName: __ccgo_ts + 25955, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25876, + FzName: __ccgo_ts + 25964, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25907, + FzName: __ccgo_ts + 25995, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25924, + FzName: __ccgo_ts + 26012, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25942, + FzName: __ccgo_ts + 26030, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25960, + FzName: __ccgo_ts + 26048, }, } @@ -175280,17 +169874,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25979, + FzName: __ccgo_ts + 26067, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25989, + FzName: __ccgo_ts + 26077, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175340,224 +169936,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -175575,33 +169956,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -175612,79 +169987,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 +} + +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -175761,7 +170121,7 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*Ti64)(unsafe.Pointer(bp)) = _i - *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp))))) + *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, uint64(libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp)))))) libc.Xmemcpy(tls, p, bp, uint64(8)) return int32(8) } @@ -175867,7 +170227,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -175930,7 +170290,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25999, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26087, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -175941,7 +170301,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176235,7 +170595,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26004, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26092, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176772,7 +171132,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177152,7 +171512,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26086) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26174) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177230,7 +171590,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -177461,7 +171821,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -177469,7 +171829,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -177707,7 +172067,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178129,7 +172489,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -178638,11 +172998,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178655,11 +173015,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178687,7 +173047,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26100, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -178697,11 +173057,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26120, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26208, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26152, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26240, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -178915,7 +173275,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26189, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -178969,9 +173329,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26334 + zFmt = __ccgo_ts + 26422 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11769, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11827, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179029,9 +173389,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26390, - 1: __ccgo_ts + 5565, - 2: __ccgo_ts + 16846, + 0: __ccgo_ts + 26478, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16951, } var _rtreeModule = Tsqlite3_module{ @@ -179075,21 +173435,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26804, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26892, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26866, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26954, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26871, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26935, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27005, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26959, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27023, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27093, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179119,7 +173479,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27054 + zFormat = __ccgo_ts + 27142 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179134,31 +173494,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27162, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27250, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27207, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27295, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13335, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27234, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27322, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27256, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27344, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27264, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27352, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179172,14 +173532,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26395, - 1: __ccgo_ts + 26448, - 2: __ccgo_ts + 26493, - 3: __ccgo_ts + 26545, - 4: __ccgo_ts + 26599, - 5: __ccgo_ts + 26644, - 6: __ccgo_ts + 26702, - 7: __ccgo_ts + 26757, + 0: __ccgo_ts + 26483, + 1: __ccgo_ts + 26536, + 2: __ccgo_ts + 26581, + 3: __ccgo_ts + 26633, + 4: __ccgo_ts + 26687, + 5: __ccgo_ts + 26732, + 6: __ccgo_ts + 26790, + 7: __ccgo_ts + 26845, } // C documentation @@ -179237,7 +173597,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27280, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179245,17 +173605,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27300, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27388, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179318,7 +173678,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -179332,13 +173692,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27549, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27637, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -179347,7 +173707,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27573, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27661, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179361,19 +173721,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179396,7 +173756,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179407,7 +173767,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179423,8 +173783,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27579, - 1: __ccgo_ts + 27590, + 0: __ccgo_ts + 27667, + 1: __ccgo_ts + 27678, } // C documentation @@ -179482,21 +173842,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11389, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11447, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27603, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27691, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27609, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27697, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27613, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27701, int32(1)) goto _1 _1: ; @@ -179523,7 +173883,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27615, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27703, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -179557,23 +173917,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -179626,7 +173969,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -179641,11 +173984,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4268 + v1 = __ccgo_ts + 4298 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27648, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27736, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -179679,7 +174022,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27655, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27743, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -179696,7 +174039,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27700, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27788, libc.VaList(bp+8, iNode)) } } return pRet @@ -179725,8 +174068,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27732, - 1: __ccgo_ts + 27786, + 0: __ccgo_ts + 27820, + 1: __ccgo_ts + 27874, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -179739,21 +174082,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27834 + v1 = __ccgo_ts + 27922 } else { - v1 = __ccgo_ts + 27842 + v1 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27851, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27939, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27834 + v2 = __ccgo_ts + 27922 } else { - v2 = __ccgo_ts + 27842 + v2 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27896, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27984, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -179798,7 +174141,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27954, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28042, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -179816,7 +174159,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28002, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28090, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -179849,19 +174192,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28069, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28157, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28103, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28191, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28133, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -179906,12 +174249,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28188, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28276, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28307, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -179940,7 +174283,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28286, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28374, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -179950,11 +174293,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26100, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26188, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28314, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28402, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -179970,8 +174313,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28345, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28352, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28433, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28440, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -179998,7 +174341,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28360, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28448, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180049,13 +174392,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28379, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28467, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6711 + zDb = __ccgo_ts + 6740 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180064,7 +174407,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18613 + v1 = __ccgo_ts + 18718 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180158,14 +174501,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180190,16 +174525,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180331,7 +174656,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -180376,7 +174701,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && libc.Int32FromUint8(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -180438,7 +174763,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -180806,7 +175131,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -180821,9 +175146,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -180908,7 +175233,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -180982,13 +175307,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181049,7 +175367,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181088,7 +175406,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181192,7 +175510,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181223,36 +175541,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181276,7 +175564,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -181560,7 +175848,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -181717,7 +176005,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -181729,13 +176017,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28503, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28591, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -181744,13 +176032,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28525, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28613, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -181758,7 +176046,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -181773,7 +176061,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -181985,7 +176273,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16846 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16951 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -181995,7 +176283,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28529 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28617 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182003,7 +176291,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28535 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28623 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182123,7 +176411,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28544, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28632, 0) } goto geopoly_update_end } @@ -182223,16 +176511,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28584) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28672) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28600) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28688) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182302,7 +176590,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28777, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28865, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182316,61 +176604,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28615, + FzName: __ccgo_ts + 28703, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28628, + FzName: __ccgo_ts + 28716, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28641, + FzName: __ccgo_ts + 28729, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28654, + FzName: __ccgo_ts + 28742, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28600, + FzName: __ccgo_ts + 28688, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28666, + FzName: __ccgo_ts + 28754, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28584, + FzName: __ccgo_ts + 28672, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28689, + FzName: __ccgo_ts + 28777, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28703, + FzName: __ccgo_ts + 28791, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28716, + FzName: __ccgo_ts + 28804, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28730, + FzName: __ccgo_ts + 28818, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28746, + FzName: __ccgo_ts + 28834, }, } @@ -182396,7 +176684,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28758, + FzName: __ccgo_ts + 28846, }, } @@ -182421,20 +176709,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28785, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28873, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28795, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28883, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28806, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28894, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28529, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28617, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28817, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28905, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182508,7 +176796,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -182536,17 +176824,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26086, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26174, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -182554,33 +176844,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -182777,7 +177071,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183198,248 +177492,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]uint8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -183753,7 +177805,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -183763,7 +177815,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -183789,7 +177841,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -183812,7 +177864,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -183944,7 +177996,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28848, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28936, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184033,7 +178085,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+25999, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26087, zIn, uint64(4)) == 0 { i = int32(4) for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184070,13 +178122,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29019 + v1 = __ccgo_ts + 29107 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29060, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29148, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29210) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29298) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184243,7 +178295,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184304,7 +178356,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29335, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29423, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184314,7 +178366,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29454, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29542, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184322,7 +178374,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29475, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29563, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184334,7 +178386,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29526, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29614, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184378,7 +178430,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184391,7 +178443,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -184444,7 +178496,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20121, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20226, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184455,7 +178507,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29604, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184466,7 +178518,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29623, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29711, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -184474,7 +178526,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29628, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29716, zName) { bRbuRowid = int32(1) } } @@ -184488,17 +178540,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29638 + v4 = __ccgo_ts + 29726 } else { - v4 = __ccgo_ts + 29651 + v4 = __ccgo_ts + 29739 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29660, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29748, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29689, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29777, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184520,7 +178572,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29711, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29799, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -184559,15 +178611,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29738, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29826, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -184592,7 +178644,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 for int32(1) != 0 { i = 0 for { @@ -184601,7 +178653,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29747, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29835, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -184649,21 +178701,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29760, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29848, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29792, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+29815) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29821, __ccgo_ts+29828, __ccgo_ts+5171) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+29903) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29909, __ccgo_ts+29916, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29836, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29924, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29878, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29966, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -184712,10 +178764,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -184737,15 +178789,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29906, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29927, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29963, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15145 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30015, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15203 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -184754,9 +178806,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29990, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30078, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -184771,15 +178823,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30038, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15145 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30126, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15203 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30045, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -184833,11 +178885,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1663 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1663 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1667 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1667 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184846,8 +178898,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30057, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) - zType = __ccgo_ts + 1663 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30145, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zType = __ccgo_ts + 1667 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -184866,34 +178918,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } else { - zCol = __ccgo_ts + 29628 + zCol = __ccgo_ts + 29716 } } - zType = __ccgo_ts + 1137 + zType = __ccgo_ts + 1141 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30079, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29815 + v2 = __ccgo_ts + 29903 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30099, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30187, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30120, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30153, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30208, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30241, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15145 - zAnd = __ccgo_ts + 22230 + zCom = __ccgo_ts + 15203 + zAnd = __ccgo_ts + 22335 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -184939,7 +178991,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1663 + zS = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -184947,11 +178999,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30177, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30265, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30189, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30277, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15145 + zS = __ccgo_ts + 15203 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -184963,7 +179015,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30198, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30286, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -184989,27 +179041,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30213, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30227, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30315, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22335 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30239, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30327, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1663 + zSep1 = __ccgo_ts + 1667 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185017,8 +179069,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22335 } goto _2 _2: @@ -185041,7 +179093,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30302, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30390, 0) } // C documentation @@ -185075,7 +179127,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if libc.Int32FromUint64(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185083,16 +179135,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if libc.Int32FromUint8(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30328, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30416, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30358, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30446, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } } } @@ -185176,16 +179228,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30395 + zSep = __ccgo_ts + 30483 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16734) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16839) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } break } @@ -185196,16 +179248,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30408, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15145 + z = _rbuMPrintf(tls, p, __ccgo_ts+30496, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15203 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30419, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185245,13 +179297,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30423) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30511) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185259,7 +179311,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -185268,21 +179320,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30473, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30561, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30495, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15145 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30583, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15203 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30520, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30608, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185317,30 +179369,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1663 + zPk = __ccgo_ts + 1667 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30582 + zPk = __ccgo_ts + 30670 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30595 + v2 = __ccgo_ts + 30683 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30605, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15145 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30693, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15203 goto _1 _1: ; @@ -185349,17 +179401,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30632, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30720, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30639 + v3 = __ccgo_ts + 30727 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30654, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30742, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185385,7 +179437,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30686, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30774, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185431,7 +179483,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30743) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30831) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -185600,7 +179652,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30809, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30897, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -185617,18 +179669,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30829, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30917, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30894, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30982, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30930, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31018, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185643,26 +179695,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30964 + v2 = __ccgo_ts + 31052 } else { - v2 = __ccgo_ts + 30968 + v2 = __ccgo_ts + 31056 } v1 = v2 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30974, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31062, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31035, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31123, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30964 + v3 = __ccgo_ts + 31052 } else { - v3 = __ccgo_ts + 30968 + v3 = __ccgo_ts + 31056 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31096, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31184, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185681,62 +179733,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6722) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6718) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6751) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6747) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } else { - v4 = __ccgo_ts + 31255 + v4 = __ccgo_ts + 31343 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31264 + v5 = __ccgo_ts + 31352 } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31274, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31362, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31310, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31398, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1663 + zRbuRowid = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31338 + zRbuRowid = __ccgo_ts + 31426 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31350 + v6 = __ccgo_ts + 31438 } else { - v6 = __ccgo_ts + 1663 + v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31367, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31443, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31455, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31531, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31742, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31830, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1663 + zRbuRowid1 = __ccgo_ts + 1667 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31841 + v7 = __ccgo_ts + 31929 } else { - v7 = __ccgo_ts + 31851 + v7 = __ccgo_ts + 31939 } zRbuRowid1 = v7 } @@ -185749,28 +179801,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29898, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31862 + v8 = __ccgo_ts + 31950 } else { - v8 = __ccgo_ts + 1663 + v8 = __ccgo_ts + 1667 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1663 + v9 = __ccgo_ts + 1667 } if zOrder != 0 { - v10 = __ccgo_ts + 23486 + v10 = __ccgo_ts + 23591 } else { - v10 = __ccgo_ts + 1663 + v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31868, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31956, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -185856,11 +179908,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1663 + zPrefix = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31255 + zPrefix = __ccgo_ts + 31343 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31916, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32004, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -185887,7 +179939,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -185934,7 +179986,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31946, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32034, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -185993,27 +180045,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31976, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32064, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32004, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3483, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32092, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3513, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6711, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6740, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32022, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32110, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186046,10 +180098,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32088, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32176, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24829, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24934, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186063,16 +180115,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 32120 + v2 = __ccgo_ts + 32208 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32122, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32210, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186083,27 +180135,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32154, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32242, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32169, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32257, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32186, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32274, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32202, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32290, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32230, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32318, 0) } } @@ -186153,7 +180205,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186255,7 +180307,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186285,7 +180337,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -186328,12 +180380,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186355,21 +180407,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186386,7 +180438,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32283, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32371, 0) } // C documentation @@ -186403,13 +180455,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32308, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32315, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32396, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -186541,7 +180593,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24386, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24491, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -186677,7 +180729,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32322) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32410) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -186690,7 +180742,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32344, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -186717,7 +180769,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32371, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32459, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -186753,9 +180805,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32531, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32619, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32546, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -186778,9 +180830,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32566, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32654, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32591) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -186791,10 +180843,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32699) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32787) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32764) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32852) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -186812,7 +180864,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32808, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32896, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -186839,8 +180891,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17819) - _rbuCopyPragma(tls, p, __ccgo_ts+16930) + _rbuCopyPragma(tls, p, __ccgo_ts+17924) + _rbuCopyPragma(tls, p, __ccgo_ts+17035) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -186848,7 +180900,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32833, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32921, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -186870,10 +180922,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -186887,10 +180939,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -186960,7 +181012,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32861, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32949, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -186983,10 +181035,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32308, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32396, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187008,7 +181060,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]uint8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32886, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32974, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187055,7 +181107,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32897, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32985, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187100,11 +181152,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32969, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33057, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32983) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33071) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187113,7 +181165,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33040) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33128) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187161,7 +181213,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3860, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187193,7 +181245,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33114, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33202, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187215,17 +181267,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33146 + v3 = __ccgo_ts + 33234 } else { - v3 = __ccgo_ts + 33153 + v3 = __ccgo_ts + 33241 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33160, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33248, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15034, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15092, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187237,21 +181289,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17533) - _rbuCopyPragma(tls, p, __ccgo_ts+16945) + _rbuCopyPragma(tls, p, __ccgo_ts+17638) + _rbuCopyPragma(tls, p, __ccgo_ts+17050) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33192, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33280, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33208, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33296, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187329,7 +181381,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33232, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33320, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187376,7 +181428,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31255, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31343, uint64(8)) == 0 { nDel = int32(8) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187404,16 +181456,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187423,7 +181475,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33240, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33328, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187524,32 +181576,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15034 + v1 = __ccgo_ts + 15092 } else { - v1 = __ccgo_ts + 33192 + v1 = __ccgo_ts + 33280 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33192, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33280, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -187575,9 +181627,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -187649,7 +181703,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -187852,7 +181906,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -187903,14 +181957,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189486,7 +183479,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33335, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33423, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -189509,13 +183502,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33343 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33431 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33352 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33440 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33357 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33445 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189524,7 +183517,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -189613,12 +183606,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33367, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33455, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33522, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33610, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33536, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33624, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -189695,7 +183688,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33551, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33639, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -189835,315 +183828,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -190896,7 +184580,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -190989,20 +184673,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33558, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33646, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1663, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33688, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33776, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191028,10 +184712,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29898)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29986))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -191052,8 +184736,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29898) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29898, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29986) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29986, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191117,7 +184801,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191134,6 +184818,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191155,12 +184841,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -191450,10 +185136,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11389 + zSep = __ccgo_ts + 11447 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33718, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33806, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191462,11 +185148,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) } else { - v2 = __ccgo_ts + 1664 + v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5141, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15145 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5171, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -191547,13 +185233,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -191785,7 +185464,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1663, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1667, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -192045,14 +185724,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192112,7 +185783,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) i = 0 for { @@ -192120,8 +185791,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33725, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22230 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33813, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22335 if zRet == uintptr(0) { break } @@ -192140,7 +185811,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) bHave = 0 i = 0 @@ -192150,8 +185821,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33759, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33800 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33847, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33888 if zRet == uintptr(0) { break } @@ -192162,7 +185833,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1783, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1813, 0) } return zRet } @@ -192173,12 +185844,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33805 + v1 = __ccgo_ts + 33893 } else { - v1 = __ccgo_ts + 6716 + v1 = __ccgo_ts + 6745 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33816, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192239,11 +185910,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33895, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33983, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -192271,7 +185942,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33914, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34002, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192300,17 +185971,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -192323,7 +185995,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -192334,18 +186008,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34059, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34090, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192371,7 +186071,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33971, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34111, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192419,7 +186119,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -192531,15 +186231,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -192703,7 +186405,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]uint8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5203, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5233, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -192997,18 +186699,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+33998, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34002, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34026, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34035, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34080, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34138, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34166, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34175, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34220, bp) } else { i = 0 for { @@ -193016,17 +186718,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34094, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34234, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34098, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34238, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193038,9 +186740,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34125, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34265, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193161,7 +186863,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193175,14 +186877,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34167, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193251,8 +186953,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193277,18 +186979,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34187, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34327, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193312,28 +187014,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193472,7 +187178,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193487,9 +187193,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -193518,20 +187224,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -193543,13 +187253,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -193705,7 +187416,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -193729,7 +187440,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -193744,7 +187455,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -193800,7 +187511,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -193905,7 +187616,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -193976,8 +187687,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194011,7 +187722,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194021,7 +187732,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194100,7 +187811,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194361,7 +188072,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194438,7 +188149,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -194510,11 +188221,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -194526,8 +188237,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -194555,12 +188266,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -194568,9 +188283,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -194583,14 +188298,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -194614,29 +188321,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -194713,18 +188397,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11769) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11827) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34205, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34345, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34218, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34358, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -194734,9 +188418,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 } goto _2 _2: @@ -194744,8 +188428,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1663 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34229, bp) + zSep = __ccgo_ts + 1667 + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -194754,13 +188438,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34237, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34377, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _3 _3: @@ -194843,13 +188527,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+8 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34318, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34458, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34229, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194859,9 +188543,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _1 _1: @@ -194869,10 +188553,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34336, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34476, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33800, bp) - zSep = __ccgo_ts + 1663 + _sessionAppendStr(tls, bp+8, __ccgo_ts+33888, bp) + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194881,16 +188565,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34344 + zSep = __ccgo_ts + 34484 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -194916,7 +188600,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6711, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6740, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -194939,16 +188623,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34349, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34489, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22236, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22341, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -194956,19 +188640,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34367, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34507, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34378, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34518, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -194991,12 +188675,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11769, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11827, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34382) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34522) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34495) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34635) } return rc } @@ -195040,7 +188724,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195058,11 +188742,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195239,7 +188923,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -195263,7 +188947,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195278,7 +188962,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195329,7 +189013,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -195369,10 +189053,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195410,11 +189094,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195437,7 +189121,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195456,7 +189140,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195465,7 +189149,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195475,10 +189159,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34639, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34779, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195488,10 +189172,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34660, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34800, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195504,7 +189188,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -195531,7 +189215,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -195559,7 +189243,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -195591,15 +189275,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34679, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34819, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34705, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -195623,9 +189307,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -195635,7 +189319,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6711, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6740, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -195654,18 +189338,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34735, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34875, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34779, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34919, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34850, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34990, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11769) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11827) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -195699,7 +189383,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -195708,7 +189392,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -195716,23 +189400,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34910, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35050, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34964, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35104, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -195755,13 +189439,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -195770,11 +189458,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195782,10 +189474,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195793,37 +189491,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -195846,7 +189536,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196216,7 +189906,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -196399,7 +190089,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -196434,8 +190124,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -196454,9 +190144,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -196508,7 +190198,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -196544,11 +190234,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -196561,18 +190257,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -196580,13 +190278,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -196628,12 +190328,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -196641,27 +190347,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -196816,7 +190513,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -196924,8 +190621,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -196937,9 +190634,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -197013,21 +190710,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197133,6 +190834,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197178,24 +190880,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197254,99 +190944,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -197368,14 +190965,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -197387,29 +190976,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197465,15 +191037,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197495,14 +191058,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -197573,7 +191128,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -197601,27 +191155,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -197652,7 +191197,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198188,14 +191733,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198206,16 +191743,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198267,10 +191794,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198376,12 +191903,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198456,7 +191983,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34992, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35132, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -198812,7 +192339,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -198968,18 +192495,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199062,22 +192577,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199096,7 +192595,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35051, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35191, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199195,7 +192694,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35058 + zErr = __ccgo_ts + 35198 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199206,7 +192705,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+24, bp+32) if *(*int32)(unsafe.Pointer(bp + 104)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 104)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -199255,16 +192754,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199283,7 +192772,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -199412,7 +192901,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } return v1 } @@ -199450,7 +192939,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35108 + zErr = __ccgo_ts + 35248 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199632,15 +193121,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -199721,7 +193201,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -199813,13 +193293,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -199845,13 +193325,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35156 + z = __ccgo_ts + 35296 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35212 + z1 = __ccgo_ts + 35352 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -199884,19 +193364,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35270, + FzFunc: __ccgo_ts + 35410, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35278, + FzFunc: __ccgo_ts + 35418, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35288, + FzFunc: __ccgo_ts + 35428, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35293, + FzFunc: __ccgo_ts + 35433, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200284,7 +193764,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) (r int32) { var aBareword [128]Tu8 @@ -200371,21 +193851,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -200556,7 +194021,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1649, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1653, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -200694,13 +194159,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -200760,7 +194218,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35309, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -200786,12 +194244,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32('0') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35316, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35456, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35347, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35487, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200800,7 +194258,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35380, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35520, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200810,14 +194268,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35417, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35557, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35426, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35566, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -200844,7 +194302,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35459, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -200856,76 +194314,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35493, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35501, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*uint8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35533, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35673, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35539, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35601, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35741, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35623, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35763, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35637, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35777, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35675, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35815, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35686, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35826, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35721, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35861, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35728, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35868, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5580, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5610, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8405, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17899, + FzName: __ccgo_ts + 18004, }, 2: { - FzName: __ccgo_ts + 35759, + FzName: __ccgo_ts + 35899, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -200933,20 +194391,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35767, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35798, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35938, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35808, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35948, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35842, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35982, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201007,16 +194465,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35870) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16846) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35875, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36010) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16951) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35905) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36045) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35915, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36055, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201042,7 +194500,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35946, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201050,12 +194508,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35951, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36091, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35958, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36098, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } } goto _1 @@ -201071,9 +194529,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35973, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36113, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } goto _2 _2: @@ -201136,8 +194594,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35870) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35981, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36010) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201168,19 +194626,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36010, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 16)) } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -201198,7 +194656,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36170, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201206,37 +194664,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36080, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36220, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36135, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36275, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36188 + zTail = __ccgo_ts + 36328 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36196, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36336, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16846, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16951, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201305,25 +194763,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36207, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36347, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36223, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36363, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36230, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35870)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36370, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36010)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201356,7 +194814,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201366,9 +194824,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201481,7 +194939,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36256) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36396) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201492,7 +194950,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36261) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36401) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201503,7 +194961,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36270) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -201517,7 +194975,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36280) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36420) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -201528,7 +194986,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36290) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36430) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -201545,7 +195003,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36302) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36442) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -201560,7 +195018,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35870) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36010) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -201575,7 +195033,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36314) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36454) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -201591,7 +195049,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36328) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36468) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -201634,7 +195092,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36338 + zSelect = __ccgo_ts + 36478 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -201654,7 +195112,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36370) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36510) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -201665,7 +195123,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36378, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36518, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -201730,112 +195188,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -201911,7 +195263,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36449, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, 0) return FTS5_EOF } goto _1 @@ -201922,7 +195274,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36469, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36609, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -201937,13 +195289,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36500, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36640, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36503, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36643, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30964, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31052, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -201987,7 +195339,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -202520,16 +195872,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -202554,14 +195896,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -203626,7 +196960,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203636,7 +196970,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203682,14 +197016,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -203742,12 +197068,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -203881,7 +197207,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -203921,15 +197247,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -203970,7 +197296,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -204008,8 +197334,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36507, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36647, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204029,10 +197355,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if libc.Int32FromUint8(c) < int32('0') || libc.Int32FromUint8(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36512, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204066,7 +197395,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204116,7 +197445,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204167,7 +197496,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204194,7 +197523,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -204291,7 +197620,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36541, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36681, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204376,7 +197705,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204389,7 +197718,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204463,7 +197792,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204489,11 +197818,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36594 + v2 = __ccgo_ts + 36734 } else { - v2 = __ccgo_ts + 36507 + v2 = __ccgo_ts + 36647 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36601, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36741, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204506,7 +197835,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36651, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36791, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -204627,14 +197956,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -204650,7 +197971,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -204674,14 +197995,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -204983,7 +198296,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205046,67 +198359,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205244,7 +198497,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -205556,7 +198809,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -205988,9 +199241,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -206027,7 +199280,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206100,7 +199352,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206135,7 +199386,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206150,149 +199400,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206300,187 +199414,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -206660,7 +199594,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -206765,7 +199699,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36710, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36850, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -206794,7 +199728,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36761, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36901, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -206828,7 +199762,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36810, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -206906,7 +199840,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -206997,7 +199931,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36850, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36990, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207008,7 +199942,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36850, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36990, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -207689,7 +200623,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -207934,15 +200868,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208043,7 +200977,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -208649,7 +201583,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37018, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -208738,7 +201672,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36962, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37102, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209385,7 +202319,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -209411,14 +202345,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209428,15 +202354,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -209550,7 +202467,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -209571,7 +202488,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210295,7 +203212,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -210354,7 +203271,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -210709,7 +203626,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37044, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37184, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211164,13 +204081,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211215,7 +204125,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37101, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211384,7 +204294,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -211702,7 +204612,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37162, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -211977,7 +204887,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212012,7 +204922,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -212291,16 +205201,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -212518,7 +205418,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -212555,7 +205455,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -212566,70 +205466,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -212698,7 +205535,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -212797,14 +205634,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -212851,19 +205680,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -212942,7 +205758,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -212992,7 +205808,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213074,15 +205890,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1663, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1667, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213108,11 +205927,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37213, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37353, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25999, __ccgo_ts+37221, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26087, __ccgo_ts+37361, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11980, __ccgo_ts+37256, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12038, __ccgo_ts+37396, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213310,7 +206129,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -213565,7 +206384,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37300) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37440) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -213916,7 +206735,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214038,7 +206857,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214158,7 +206977,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -214752,7 +207571,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37442, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -214983,7 +207802,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37388) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37528) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215122,7 +207941,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215177,87 +207995,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215265,96 +208002,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -215605,7 +208252,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37393, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37533, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -215642,7 +208289,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -215661,7 +208308,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*uint8)(unsafe.Pointer(idxStr + uintptr(v5))) = libc.Uint8FromInt32(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216111,7 +208758,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216139,7 +208786,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216159,7 +208806,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216174,21 +208821,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15145 + v1 = __ccgo_ts + 15203 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } if bDesc != 0 { - v3 = __ccgo_ts + 37432 + v3 = __ccgo_ts + 37572 } else { - v3 = __ccgo_ts + 37437 + v3 = __ccgo_ts + 37577 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37441, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216246,14 +208893,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37496, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37636, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5562, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5592, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37502, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37642, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216303,7 +208950,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37530, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37670, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -216336,7 +208983,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37540, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37680, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216370,7 +209017,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37561, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37701, libc.VaList(bp+24, z)) } } } else { @@ -216378,7 +209025,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35288 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35428 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -216535,7 +209182,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37594, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37734, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -216606,7 +209253,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1663 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1667 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -216735,7 +209382,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37599, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37739, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -216868,10 +209515,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219407,12 +211991,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38948, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39088, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39052, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39192, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39090, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39230, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219421,7 +212005,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39128, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39268, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219433,14 +212017,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25999, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11980, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38282, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26087, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12038, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38422, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36188, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36328, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35493, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35633, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219460,13 +212044,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30639 + v1 = __ccgo_ts + 30727 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39170, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39310, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39200, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39340, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -219507,7 +212091,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39244, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39384, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -219515,7 +212099,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39267, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39407, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -219530,7 +212114,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39273, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39413, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -219539,22 +212123,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35493, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35633, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39279 + zCols = __ccgo_ts + 39419 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39311 + zCols = __ccgo_ts + 39451 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36188, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36328, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38282, __ccgo_ts+39359, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38422, __ccgo_ts+39499, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -219599,14 +212183,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -219676,14 +212252,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -219711,6 +212287,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -219723,11 +212300,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -219740,6 +212330,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -219974,12 +212565,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39376, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39516, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39426, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39566, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39455, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39595, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -219987,7 +212578,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220289,7 +212880,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39484, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39624, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220322,17 +212913,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -220419,7 +212999,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -220521,14 +213101,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35493, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35633, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221180,11 +213742,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39538 + zCat = __ccgo_ts + 39678 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221194,7 +213756,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39547) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221211,20 +213773,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39558) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39516) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39656) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39527) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39667) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39547) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -221260,7 +213822,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -221447,7 +214009,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -221475,14 +214037,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]uint8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -221516,7 +214070,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39576 + zBase = __ccgo_ts + 39716 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -221560,14 +214114,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -221578,16 +214124,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) (r int32) { return libc.BoolInt32(libc.Int32FromUint8(c) == int32('a') || libc.Int32FromUint8(c) == int32('e') || libc.Int32FromUint8(c) == int32('i') || libc.Int32FromUint8(c) == int32('o') || libc.Int32FromUint8(c) == int32('u') || bYIsVowel != 0 && libc.Int32FromUint8(c) == int32('y')) } @@ -221733,64 +214269,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39586, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39589, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39594, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39734, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39599, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39602, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39605, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39610, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39615, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39625, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39630, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221799,49 +214335,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39638, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39641, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39781, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39645, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39649, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39653, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39657, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39661, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39801, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221858,20 +214394,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39665, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39645, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39805, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39668, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39671, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39675, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39661, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39815, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -221887,75 +214423,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39678, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39645, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39686, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39693, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39833, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39698, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39594, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39734, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39703, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39589, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39729, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39708, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39661, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39713, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16048, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16153, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39718, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39671, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39630, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39733, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39873, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39737, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39877, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39653, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -221964,48 +214500,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39885, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39661, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39753, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39645, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39899, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39645, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39764, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39904, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39910, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39657, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39786, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39926, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39790, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39653, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222013,21 +214549,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39804, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39944, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39657, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39810, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39671, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222045,48 +214581,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39957, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39602, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39822, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39827, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39967, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39973, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39786, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39926, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39839, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39845, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222102,13 +214638,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39851, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39991, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39855, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39995, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222116,7 +214652,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39861, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222213,14 +214749,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222238,13 +214774,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222281,14 +214810,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39865) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40005) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39558) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222326,7 +214855,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222454,7 +214983,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -222530,11 +215059,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -222556,7 +215085,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39880)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40020)) } // C documentation @@ -222582,7 +215111,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39576, + FzName: __ccgo_ts + 39716, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -222590,7 +215119,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39888, + FzName: __ccgo_ts + 40028, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -222598,7 +215127,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39880, + FzName: __ccgo_ts + 40020, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -222628,7 +215157,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39894, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40034, pApi, bp+96, uintptr(0)) } return rc } @@ -228089,39 +220618,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228144,16 +220640,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39901) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40041) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39905) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40045) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39909) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40049) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39918, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40058, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228216,21 +220712,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39952, - 1: __ccgo_ts + 39992, - 2: __ccgo_ts + 40027, + 0: __ccgo_ts + 40092, + 1: __ccgo_ts + 40132, + 2: __ccgo_ts + 40167, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23975, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24080, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40070, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40210, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228251,23 +220748,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228400,10 +220897,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40103, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40243, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40134, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40274, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -228422,7 +220919,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40185, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40325, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -228748,7 +221245,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1663 + zCopy = __ccgo_ts + 1667 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -228872,7 +221369,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40211, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40351, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -228927,15 +221424,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40221 + return __ccgo_ts + 40361 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229157,7 +221654,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229205,11 +221702,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go index 671fc01..049a348 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_loong64.go @@ -1,4 +1,4 @@ -// Code generated for linux/loong64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/cznic/src/modernc.org/libc/include/linux/loong64 -I /home/cznic/src/modernc.org/libz/include/linux/loong64 -I /home/cznic/src/modernc.org/libtcl8.6/include/linux/loong64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/loong64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/cznic/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/loong64 -I /home/cznic/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/loong64 -I /home/cznic/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/loong64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && loong64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -613,7 +615,7 @@ const F_TLOCK = 2 const F_ULOCK = 0 const F_UNLCK = 2 const F_WRLCK = 1 -const GCC_VERSION = 14001000 +const GCC_VERSION = 14002001 const GEOPOLY_PI = 3.141592653589793 const HASHSIZE = 97 const HASHTABLE_HASH_1 = 383 @@ -1561,6 +1563,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1800,6 +1803,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -2010,6 +2014,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -2172,6 +2177,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2180,7 +2186,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2291,8 +2297,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3296,8 +3302,9 @@ const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1 const __GCC_IEC_559 = 2 const __GCC_IEC_559_COMPLEX = 2 const __GNUC_EXECUTION_CHARSET_NAME = "UTF-8" -const __GNUC_MINOR__ = 1 -const __GNUC_PATCHLEVEL__ = 0 +const __GNUC_MINOR__ = 2 +const __GNUC_PATCHLEVEL__ = 1 +const __GNUC_RH_RELEASE__ = 6 const __GNUC_STDC_INLINE__ = 1 const __GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE" const __GNUC__ = 14 @@ -3515,7 +3522,7 @@ const __UTA_FBIT__ = 64 const __UTA_IBIT__ = 64 const __UTQ_FBIT__ = 128 const __UTQ_IBIT__ = 0 -const __VERSION__ = "14.1.0 20240507 (Red Hat 14.1.0-1)" +const __VERSION__ = "14.2.1 20241104 (Red Hat 14.2.1-6)" const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN__ = -2147483648 const __WCHAR_TYPE__ = 0 @@ -3563,6 +3570,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3572,9 +3582,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -4022,12 +4029,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -4156,30 +4157,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - /* ** CAPI3REF: Standard File Control Opcodes ** KEYWORDS: {file control opcodes} {file control opcode} @@ -4474,6 +4451,12 @@ type sqlite3_io_methods1 = Tsqlite3_io_methods1 ** the value that M is to be set to. Before returning, the 32-bit signed ** integer is overwritten with the previous value of M. ** +**
  • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** **
  • [[SQLITE_FCNTL_DATA_VERSION]] ** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to ** a database file. The argument is a pointer to a 32-bit unsigned integer. @@ -4830,6 +4813,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -5060,33 +5044,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -5165,19 +5122,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -5262,7 +5206,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -5354,223 +5297,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5652,20 +5378,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5715,13 +5427,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5780,9 +5485,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5790,17 +5495,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5827,12 +5532,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5849,7 +5554,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5867,7 +5572,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5901,24 +5606,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5942,22 +5629,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -6018,7 +5689,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -6098,50 +5769,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6538,340 +6165,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6881,15 +6174,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6905,14 +6189,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6938,17 +6214,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -7003,11 +6268,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -7381,55 +6652,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint64 type size_t = Tsize_t @@ -7576,6 +6803,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7634,6 +6866,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7743,14 +6986,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7835,7 +7070,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7937,7 +7172,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -7996,6 +7230,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -8007,9 +7242,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -8024,7 +7259,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -8073,8 +7307,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -8138,7 +7372,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -8210,19 +7443,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -8236,11 +7472,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -8251,40 +7484,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -8302,7 +7536,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -8314,6 +7548,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -8464,9 +7699,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -8483,10 +7718,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -8521,6 +7752,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8701,7 +7933,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8743,7 +7974,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8916,9 +8146,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -9045,53 +8275,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -9195,16 +8378,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -9228,38 +8401,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -9272,34 +8418,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -9313,90 +8435,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -9415,187 +8453,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9605,913 +8462,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10536,611 +8486,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -11150,317 +8495,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11546,228 +8580,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -12850,7 +9662,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12928,72 +9739,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -13039,164 +9788,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - /* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -13222,18 +9818,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -13250,100 +9834,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -13365,13 +9855,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -13391,14 +9874,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -13477,7 +9953,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13649,7 +10125,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13707,7 +10183,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13842,24 +10318,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -14036,7 +10494,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -14107,10 +10565,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -14246,7 +10704,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -14343,7 +10801,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -14484,10 +10942,10 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = 0 _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1240, -int32(1)) @@ -14498,7 +10956,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -14576,7 +11034,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -14724,7 +11182,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -15027,7 +11485,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -15184,7 +11642,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -15232,7 +11690,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -15337,7 +11795,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -15853,28 +12311,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15882,19 +12340,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15911,12 +12369,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15924,7 +12382,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15937,34 +12395,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -16066,7 +12524,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -16277,14 +12735,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -16299,9 +12750,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -16715,7 +13166,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -17044,27 +13499,6 @@ type t__ptcb = struct { F__next uintptr } -type Tcpu_set_t1 = struct { - F__bits [16]uint64 -} - -type cpu_set_t1 = Tcpu_set_t1 - -/* -** The sqlite3_mutex.id, sqlite3_mutex.nRef, and sqlite3_mutex.owner fields -** are necessary under two conditions: (1) Debug builds and (2) using -** home-grown mutexes. Encapsulate these conditions into a single #define. - */ - -/* -** Each recursive mutex is an instance of the following structure. - */ -type Tsqlite3_mutex1 = struct { - Fmutex Tpthread_mutex_t -} - -type sqlite3_mutex1 = Tsqlite3_mutex1 - /* ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are ** intended for use only inside assert() statements. On some platforms, @@ -17348,6 +13782,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -17355,8 +13791,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -18343,17 +14779,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -18550,22 +14986,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -18814,11 +15251,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18846,7 +15283,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18868,7 +15305,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -19295,29 +15732,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = libc.Int8FromUint32(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -19432,25 +15847,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1696 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1696 } else { - v98 = __ccgo_ts + 1701 + v97 = __ccgo_ts + 1701 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -19458,15 +15877,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -19477,13 +15896,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -19497,35 +15949,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1708, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if libc.Int32FromUint8(libc.Uint8FromInt8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1717 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -19550,9 +16065,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -19566,7 +16081,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1708, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1734, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -19576,21 +16091,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1710, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1736, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1720, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1746, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1741, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1767, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -19829,7 +16344,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -20128,6 +16643,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -20145,11 +16662,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -20583,56 +17100,10 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ - -/* #include */ - -/* A running thread */ -type TSQLiteThread1 = struct { - Ftid Tpthread_t - Fdone int32 - FpOut uintptr - FxTask uintptr - FpIn uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -20643,7 +17114,7 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui return int32(SQLITE_NOMEM) } libc.Xmemset(tls, p, 0, uint64(40)) - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a ** function that returns SQLITE_ERROR when passed the argument 200, that @@ -20652,11 +17123,11 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui if _sqlite3FaultSim(tls, int32(200)) != 0 { rc = int32(1) } else { - rc = libc.Xpthread_create(tls, p, uintptr(0), xTask, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) } if rc != 0 { (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) - (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -20801,6 +17272,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = libc.Int8FromUint8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -21551,7 +18053,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -21726,7 +18228,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1755, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1781, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21938,11 +18440,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -22178,7 +18680,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -22268,7 +18770,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1780 + pow63 = __ccgo_ts + 1806 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -22495,7 +18997,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1799)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1825)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -22655,7 +19157,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1815 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1841 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -22764,7 +19266,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -23180,7 +19682,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1817, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1843, libc.VaList(bp+8, zType)) } // C documentation @@ -23209,7 +19711,7 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1862) + _logBadConnection(tls, __ccgo_ts+1888) } return 0 } else { @@ -23223,7 +19725,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1871) + _logBadConnection(tls, __ccgo_ts+1897) return 0 } else { return int32(1) @@ -23254,7 +19756,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -23605,23 +20107,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -23676,8 +20176,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -23710,9 +20210,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -23732,13 +20231,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -23746,7 +20244,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -23762,7 +20260,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -23774,7 +20272,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -23823,7 +20321,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -23833,20 +20331,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -23865,196 +20362,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1879, - 1: __ccgo_ts + 1889, - 2: __ccgo_ts + 1900, - 3: __ccgo_ts + 1912, - 4: __ccgo_ts + 1923, - 5: __ccgo_ts + 1935, - 6: __ccgo_ts + 1942, - 7: __ccgo_ts + 1950, - 8: __ccgo_ts + 1958, - 9: __ccgo_ts + 1963, - 10: __ccgo_ts + 1968, - 11: __ccgo_ts + 1974, - 12: __ccgo_ts + 1988, - 13: __ccgo_ts + 1994, - 14: __ccgo_ts + 2004, - 15: __ccgo_ts + 2009, - 16: __ccgo_ts + 2014, - 17: __ccgo_ts + 2017, - 18: __ccgo_ts + 2023, - 19: __ccgo_ts + 2030, - 20: __ccgo_ts + 2034, - 21: __ccgo_ts + 2044, - 22: __ccgo_ts + 2051, - 23: __ccgo_ts + 2058, - 24: __ccgo_ts + 2065, - 25: __ccgo_ts + 2072, - 26: __ccgo_ts + 2082, - 27: __ccgo_ts + 2091, - 28: __ccgo_ts + 2102, - 29: __ccgo_ts + 2111, - 30: __ccgo_ts + 2117, - 31: __ccgo_ts + 2127, - 32: __ccgo_ts + 2137, - 33: __ccgo_ts + 2142, - 34: __ccgo_ts + 2156, - 35: __ccgo_ts + 2167, - 36: __ccgo_ts + 2172, - 37: __ccgo_ts + 2179, - 38: __ccgo_ts + 2190, - 39: __ccgo_ts + 2195, - 40: __ccgo_ts + 2200, - 41: __ccgo_ts + 2206, - 42: __ccgo_ts + 2212, - 43: __ccgo_ts + 2218, - 44: __ccgo_ts + 2221, - 45: __ccgo_ts + 2225, - 46: __ccgo_ts + 2231, - 47: __ccgo_ts + 2242, - 48: __ccgo_ts + 2253, - 49: __ccgo_ts + 2261, - 50: __ccgo_ts + 2270, - 51: __ccgo_ts + 2276, - 52: __ccgo_ts + 2283, - 53: __ccgo_ts + 2291, - 54: __ccgo_ts + 2294, - 55: __ccgo_ts + 2297, - 56: __ccgo_ts + 2300, - 57: __ccgo_ts + 2303, - 58: __ccgo_ts + 2306, - 59: __ccgo_ts + 2309, - 60: __ccgo_ts + 2316, - 61: __ccgo_ts + 2326, - 62: __ccgo_ts + 2339, - 63: __ccgo_ts + 2350, - 64: __ccgo_ts + 2356, - 65: __ccgo_ts + 2363, - 66: __ccgo_ts + 2372, - 67: __ccgo_ts + 2381, - 68: __ccgo_ts + 2388, - 69: __ccgo_ts + 2401, - 70: __ccgo_ts + 2412, - 71: __ccgo_ts + 2417, - 72: __ccgo_ts + 2425, - 73: __ccgo_ts + 2431, - 74: __ccgo_ts + 2438, - 75: __ccgo_ts + 2450, - 76: __ccgo_ts + 2455, - 77: __ccgo_ts + 2464, - 78: __ccgo_ts + 2469, - 79: __ccgo_ts + 2478, - 80: __ccgo_ts + 2483, - 81: __ccgo_ts + 2488, - 82: __ccgo_ts + 2494, - 83: __ccgo_ts + 2502, - 84: __ccgo_ts + 2510, - 85: __ccgo_ts + 2520, - 86: __ccgo_ts + 2528, - 87: __ccgo_ts + 2535, - 88: __ccgo_ts + 2548, - 89: __ccgo_ts + 2553, - 90: __ccgo_ts + 2565, - 91: __ccgo_ts + 2573, - 92: __ccgo_ts + 2580, - 93: __ccgo_ts + 2591, - 94: __ccgo_ts + 2598, - 95: __ccgo_ts + 2605, - 96: __ccgo_ts + 2615, - 97: __ccgo_ts + 2624, - 98: __ccgo_ts + 2635, - 99: __ccgo_ts + 2641, - 100: __ccgo_ts + 2652, - 101: __ccgo_ts + 2662, - 102: __ccgo_ts + 2672, - 103: __ccgo_ts + 2681, - 104: __ccgo_ts + 2688, - 105: __ccgo_ts + 2694, - 106: __ccgo_ts + 2704, - 107: __ccgo_ts + 2715, - 108: __ccgo_ts + 2719, - 109: __ccgo_ts + 2728, - 110: __ccgo_ts + 2737, - 111: __ccgo_ts + 2744, - 112: __ccgo_ts + 2754, - 113: __ccgo_ts + 2761, - 114: __ccgo_ts + 2771, - 115: __ccgo_ts + 2779, - 116: __ccgo_ts + 2786, - 117: __ccgo_ts + 2800, - 118: __ccgo_ts + 2814, - 119: __ccgo_ts + 2822, - 120: __ccgo_ts + 2833, - 121: __ccgo_ts + 2846, - 122: __ccgo_ts + 2857, - 123: __ccgo_ts + 2863, - 124: __ccgo_ts + 2875, - 125: __ccgo_ts + 2884, - 126: __ccgo_ts + 2892, - 127: __ccgo_ts + 2901, - 128: __ccgo_ts + 2910, - 129: __ccgo_ts + 2917, - 130: __ccgo_ts + 2925, - 131: __ccgo_ts + 2932, - 132: __ccgo_ts + 2943, - 133: __ccgo_ts + 2957, - 134: __ccgo_ts + 2968, - 135: __ccgo_ts + 2976, - 136: __ccgo_ts + 2982, - 137: __ccgo_ts + 2990, - 138: __ccgo_ts + 2998, - 139: __ccgo_ts + 3008, - 140: __ccgo_ts + 3021, - 141: __ccgo_ts + 3031, - 142: __ccgo_ts + 3044, - 143: __ccgo_ts + 3053, - 144: __ccgo_ts + 3064, - 145: __ccgo_ts + 3072, - 146: __ccgo_ts + 3078, - 147: __ccgo_ts + 3090, - 148: __ccgo_ts + 3102, - 149: __ccgo_ts + 3110, - 150: __ccgo_ts + 3122, - 151: __ccgo_ts + 3135, - 152: __ccgo_ts + 3145, - 153: __ccgo_ts + 3155, - 154: __ccgo_ts + 3167, - 155: __ccgo_ts + 3172, - 156: __ccgo_ts + 3184, - 157: __ccgo_ts + 3194, - 158: __ccgo_ts + 3200, - 159: __ccgo_ts + 3210, - 160: __ccgo_ts + 3217, - 161: __ccgo_ts + 3229, - 162: __ccgo_ts + 3240, - 163: __ccgo_ts + 3248, - 164: __ccgo_ts + 3257, - 165: __ccgo_ts + 3266, - 166: __ccgo_ts + 3275, - 167: __ccgo_ts + 3282, - 168: __ccgo_ts + 3293, - 169: __ccgo_ts + 3306, - 170: __ccgo_ts + 3316, - 171: __ccgo_ts + 3323, - 172: __ccgo_ts + 3331, - 173: __ccgo_ts + 3340, - 174: __ccgo_ts + 3346, - 175: __ccgo_ts + 3353, - 176: __ccgo_ts + 3361, - 177: __ccgo_ts + 3369, - 178: __ccgo_ts + 3377, - 179: __ccgo_ts + 3387, - 180: __ccgo_ts + 3396, - 181: __ccgo_ts + 3407, - 182: __ccgo_ts + 3418, - 183: __ccgo_ts + 3429, - 184: __ccgo_ts + 3439, - 185: __ccgo_ts + 3445, - 186: __ccgo_ts + 3456, - 187: __ccgo_ts + 3467, - 188: __ccgo_ts + 3472, - 189: __ccgo_ts + 3480, + 0: __ccgo_ts + 1905, + 1: __ccgo_ts + 1915, + 2: __ccgo_ts + 1926, + 3: __ccgo_ts + 1938, + 4: __ccgo_ts + 1949, + 5: __ccgo_ts + 1961, + 6: __ccgo_ts + 1968, + 7: __ccgo_ts + 1976, + 8: __ccgo_ts + 1984, + 9: __ccgo_ts + 1989, + 10: __ccgo_ts + 1994, + 11: __ccgo_ts + 2000, + 12: __ccgo_ts + 2014, + 13: __ccgo_ts + 2020, + 14: __ccgo_ts + 2030, + 15: __ccgo_ts + 2035, + 16: __ccgo_ts + 2040, + 17: __ccgo_ts + 2043, + 18: __ccgo_ts + 2049, + 19: __ccgo_ts + 2056, + 20: __ccgo_ts + 2060, + 21: __ccgo_ts + 2070, + 22: __ccgo_ts + 2077, + 23: __ccgo_ts + 2084, + 24: __ccgo_ts + 2091, + 25: __ccgo_ts + 2098, + 26: __ccgo_ts + 2108, + 27: __ccgo_ts + 2117, + 28: __ccgo_ts + 2128, + 29: __ccgo_ts + 2137, + 30: __ccgo_ts + 2143, + 31: __ccgo_ts + 2153, + 32: __ccgo_ts + 2163, + 33: __ccgo_ts + 2168, + 34: __ccgo_ts + 2182, + 35: __ccgo_ts + 2193, + 36: __ccgo_ts + 2198, + 37: __ccgo_ts + 2205, + 38: __ccgo_ts + 2216, + 39: __ccgo_ts + 2221, + 40: __ccgo_ts + 2226, + 41: __ccgo_ts + 2232, + 42: __ccgo_ts + 2238, + 43: __ccgo_ts + 2244, + 44: __ccgo_ts + 2247, + 45: __ccgo_ts + 2251, + 46: __ccgo_ts + 2257, + 47: __ccgo_ts + 2268, + 48: __ccgo_ts + 2279, + 49: __ccgo_ts + 2287, + 50: __ccgo_ts + 2296, + 51: __ccgo_ts + 2302, + 52: __ccgo_ts + 2309, + 53: __ccgo_ts + 2317, + 54: __ccgo_ts + 2320, + 55: __ccgo_ts + 2323, + 56: __ccgo_ts + 2326, + 57: __ccgo_ts + 2329, + 58: __ccgo_ts + 2332, + 59: __ccgo_ts + 2335, + 60: __ccgo_ts + 2342, + 61: __ccgo_ts + 2352, + 62: __ccgo_ts + 2365, + 63: __ccgo_ts + 2376, + 64: __ccgo_ts + 2382, + 65: __ccgo_ts + 2389, + 66: __ccgo_ts + 2398, + 67: __ccgo_ts + 2407, + 68: __ccgo_ts + 2414, + 69: __ccgo_ts + 2427, + 70: __ccgo_ts + 2438, + 71: __ccgo_ts + 2443, + 72: __ccgo_ts + 2451, + 73: __ccgo_ts + 2457, + 74: __ccgo_ts + 2464, + 75: __ccgo_ts + 2476, + 76: __ccgo_ts + 2481, + 77: __ccgo_ts + 2490, + 78: __ccgo_ts + 2495, + 79: __ccgo_ts + 2504, + 80: __ccgo_ts + 2509, + 81: __ccgo_ts + 2514, + 82: __ccgo_ts + 2520, + 83: __ccgo_ts + 2528, + 84: __ccgo_ts + 2536, + 85: __ccgo_ts + 2546, + 86: __ccgo_ts + 2554, + 87: __ccgo_ts + 2561, + 88: __ccgo_ts + 2574, + 89: __ccgo_ts + 2579, + 90: __ccgo_ts + 2591, + 91: __ccgo_ts + 2599, + 92: __ccgo_ts + 2606, + 93: __ccgo_ts + 2617, + 94: __ccgo_ts + 2624, + 95: __ccgo_ts + 2631, + 96: __ccgo_ts + 2641, + 97: __ccgo_ts + 2650, + 98: __ccgo_ts + 2661, + 99: __ccgo_ts + 2667, + 100: __ccgo_ts + 2678, + 101: __ccgo_ts + 2688, + 102: __ccgo_ts + 2698, + 103: __ccgo_ts + 2707, + 104: __ccgo_ts + 2714, + 105: __ccgo_ts + 2720, + 106: __ccgo_ts + 2730, + 107: __ccgo_ts + 2741, + 108: __ccgo_ts + 2745, + 109: __ccgo_ts + 2754, + 110: __ccgo_ts + 2763, + 111: __ccgo_ts + 2770, + 112: __ccgo_ts + 2780, + 113: __ccgo_ts + 2787, + 114: __ccgo_ts + 2797, + 115: __ccgo_ts + 2805, + 116: __ccgo_ts + 2812, + 117: __ccgo_ts + 2826, + 118: __ccgo_ts + 2840, + 119: __ccgo_ts + 2848, + 120: __ccgo_ts + 2859, + 121: __ccgo_ts + 2872, + 122: __ccgo_ts + 2883, + 123: __ccgo_ts + 2889, + 124: __ccgo_ts + 2901, + 125: __ccgo_ts + 2910, + 126: __ccgo_ts + 2918, + 127: __ccgo_ts + 2927, + 128: __ccgo_ts + 2936, + 129: __ccgo_ts + 2943, + 130: __ccgo_ts + 2951, + 131: __ccgo_ts + 2958, + 132: __ccgo_ts + 2969, + 133: __ccgo_ts + 2983, + 134: __ccgo_ts + 2994, + 135: __ccgo_ts + 3002, + 136: __ccgo_ts + 3008, + 137: __ccgo_ts + 3016, + 138: __ccgo_ts + 3024, + 139: __ccgo_ts + 3034, + 140: __ccgo_ts + 3047, + 141: __ccgo_ts + 3057, + 142: __ccgo_ts + 3070, + 143: __ccgo_ts + 3079, + 144: __ccgo_ts + 3090, + 145: __ccgo_ts + 3098, + 146: __ccgo_ts + 3104, + 147: __ccgo_ts + 3116, + 148: __ccgo_ts + 3128, + 149: __ccgo_ts + 3136, + 150: __ccgo_ts + 3148, + 151: __ccgo_ts + 3161, + 152: __ccgo_ts + 3171, + 153: __ccgo_ts + 3181, + 154: __ccgo_ts + 3193, + 155: __ccgo_ts + 3198, + 156: __ccgo_ts + 3210, + 157: __ccgo_ts + 3220, + 158: __ccgo_ts + 3226, + 159: __ccgo_ts + 3236, + 160: __ccgo_ts + 3243, + 161: __ccgo_ts + 3255, + 162: __ccgo_ts + 3266, + 163: __ccgo_ts + 3274, + 164: __ccgo_ts + 3283, + 165: __ccgo_ts + 3292, + 166: __ccgo_ts + 3301, + 167: __ccgo_ts + 3308, + 168: __ccgo_ts + 3319, + 169: __ccgo_ts + 3332, + 170: __ccgo_ts + 3342, + 171: __ccgo_ts + 3349, + 172: __ccgo_ts + 3357, + 173: __ccgo_ts + 3366, + 174: __ccgo_ts + 3372, + 175: __ccgo_ts + 3379, + 176: __ccgo_ts + 3387, + 177: __ccgo_ts + 3395, + 178: __ccgo_ts + 3403, + 179: __ccgo_ts + 3413, + 180: __ccgo_ts + 3422, + 181: __ccgo_ts + 3433, + 182: __ccgo_ts + 3444, + 183: __ccgo_ts + 3455, + 184: __ccgo_ts + 3465, + 185: __ccgo_ts + 3471, + 186: __ccgo_ts + 3482, + 187: __ccgo_ts + 3493, + 188: __ccgo_ts + 3498, + 189: __ccgo_ts + 3506, } type Tnlink_t = uint32 @@ -24440,22 +20937,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -24486,30 +20967,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -24591,91 +21048,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3490, + FzName: __ccgo_ts + 3516, }, 1: { - FzName: __ccgo_ts + 3495, + FzName: __ccgo_ts + 3521, }, 2: { - FzName: __ccgo_ts + 3501, + FzName: __ccgo_ts + 3527, }, 3: { - FzName: __ccgo_ts + 3508, + FzName: __ccgo_ts + 3534, }, 4: { - FzName: __ccgo_ts + 3515, + FzName: __ccgo_ts + 3541, }, 5: { - FzName: __ccgo_ts + 3520, + FzName: __ccgo_ts + 3546, }, 6: { - FzName: __ccgo_ts + 3526, + FzName: __ccgo_ts + 3552, }, 7: { - FzName: __ccgo_ts + 3536, + FzName: __ccgo_ts + 3562, }, 8: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3568, }, 9: { - FzName: __ccgo_ts + 3547, + FzName: __ccgo_ts + 3573, }, 10: { - FzName: __ccgo_ts + 3553, + FzName: __ccgo_ts + 3579, }, 11: { - FzName: __ccgo_ts + 3561, + FzName: __ccgo_ts + 3587, }, 12: { - FzName: __ccgo_ts + 3567, + FzName: __ccgo_ts + 3593, }, 13: { - FzName: __ccgo_ts + 3574, + FzName: __ccgo_ts + 3600, }, 14: { - FzName: __ccgo_ts + 3583, + FzName: __ccgo_ts + 3609, }, 15: { - FzName: __ccgo_ts + 3590, + FzName: __ccgo_ts + 3616, }, 16: { - FzName: __ccgo_ts + 3600, + FzName: __ccgo_ts + 3626, }, 17: { - FzName: __ccgo_ts + 3607, + FzName: __ccgo_ts + 3633, }, 18: { - FzName: __ccgo_ts + 3621, + FzName: __ccgo_ts + 3647, }, 19: { - FzName: __ccgo_ts + 3627, + FzName: __ccgo_ts + 3653, }, 20: { - FzName: __ccgo_ts + 3633, + FzName: __ccgo_ts + 3659, }, 21: { - FzName: __ccgo_ts + 3640, + FzName: __ccgo_ts + 3666, }, 22: { - FzName: __ccgo_ts + 3648, + FzName: __ccgo_ts + 3674, }, 23: { - FzName: __ccgo_ts + 3653, + FzName: __ccgo_ts + 3679, }, 24: { - FzName: __ccgo_ts + 3660, + FzName: __ccgo_ts + 3686, }, 25: { - FzName: __ccgo_ts + 3667, + FzName: __ccgo_ts + 3693, }, 26: { - FzName: __ccgo_ts + 3679, + FzName: __ccgo_ts + 3705, }, 27: { - FzName: __ccgo_ts + 3688, + FzName: __ccgo_ts + 3714, }, 28: { - FzName: __ccgo_ts + 3694, + FzName: __ccgo_ts + 3720, }, } @@ -24736,7 +21193,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24774,10 +21231,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24914,9 +21371,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3700, libc.VaList(bp+136, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3726, libc.VaList(bp+136, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3743, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3769, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -25152,47 +21609,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -25236,7 +21652,7 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint if zPath == uintptr(0) { zPath = __ccgo_ts + 1695 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3753, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3779, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -25264,7 +21680,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3837, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3863, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3864, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3890, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25923,7 +22339,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -26528,7 +22944,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]int8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3892, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3918, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && int32((*(*[513]int8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -26554,7 +22970,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3607, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3633, bp, int32(42579)) } // C documentation @@ -26591,7 +23007,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -27139,7 +23466,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -27202,7 +23529,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -27435,7 +23762,7 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte *(*int32)(unsafe.Pointer(bp + 128)) = 0 if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1695, int32(1), bp+128) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -28203,10 +24529,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3949, - 3: __ccgo_ts + 3958, - 4: __ccgo_ts + 3967, - 5: __ccgo_ts + 1708, + 2: __ccgo_ts + 3975, + 3: __ccgo_ts + 3984, + 4: __ccgo_ts + 3993, + 5: __ccgo_ts + 1734, } // C documentation @@ -28215,8 +24541,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3972) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3986) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3998) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+4012) } // C documentation @@ -28278,7 +24604,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = 0 - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3993, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4019, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = int32(*(*int8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -28450,7 +24776,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4010) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4036) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -28605,7 +24931,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3490, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3516, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -28682,7 +25008,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+128, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(4098)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3679, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3705, zIn, int32(45510)) return } (*(*[4098]int8)(unsafe.Pointer(bp + 128)))[got] = 0 @@ -28880,14 +25196,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if int32(*(*int8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3508, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3534, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*int8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = 0 if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -30692,7 +26848,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -30746,7 +26908,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -30790,7 +26952,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30865,7 +27027,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30919,7 +27081,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30953,66 +27115,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -31186,14 +27288,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -32009,123 +28111,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -32206,7 +28191,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -32300,7 +28285,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -32341,7 +28326,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -32469,7 +28454,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -32489,17 +28474,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -32517,7 +28504,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -32529,7 +28516,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -32730,10 +28717,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -33319,25 +29307,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -34299,258 +30268,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -34649,7 +30366,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34878,7 +30595,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34896,7 +30613,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -35469,6 +31186,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -36115,7 +31841,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -36127,7 +31854,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -36148,11 +31875,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -36181,7 +31909,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -36414,7 +32142,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -36551,7 +32279,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -36567,7 +32295,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -37314,10 +33042,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -38218,7 +33946,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -38262,7 +33990,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -38293,7 +34021,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -38344,7 +34072,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -38379,7 +34107,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4175, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4201, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -38389,7 +34117,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4184, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4210, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -38431,8 +34159,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4189, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4196, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4215, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4222, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -38515,7 +34243,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38771,7 +34499,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38946,7 +34674,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38977,7 +34705,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -39049,7 +34777,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -40109,7 +35837,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -40406,7 +36134,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -40674,7 +36402,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4206, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4232, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -41238,9 +36966,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -41255,227 +36983,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -41494,28 +37001,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -41574,7 +37060,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -41586,7 +37072,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -41675,6 +37161,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41942,14 +37429,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -42116,7 +37595,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -42204,12 +37683,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -42343,7 +37822,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42784,10 +38263,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42885,7 +38364,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42924,7 +38403,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42937,7 +38416,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42953,7 +38432,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42974,7 +38453,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -43040,7 +38519,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -43090,7 +38569,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4261, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4287, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -43305,7 +38784,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -43331,7 +38817,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -44054,8 +39540,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -44142,7 +39628,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -44288,7 +39774,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -44315,7 +39801,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -44324,6 +39810,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -44368,6 +39855,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -44639,7 +40129,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44820,7 +40310,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44829,7 +40319,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44881,14 +40371,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -45434,283 +40924,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45843,27 +41056,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -46026,10 +41218,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -46038,14 +41231,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -46745,11 +41938,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46923,7 +42116,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46936,12 +42129,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46985,7 +42178,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46993,7 +42186,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -47181,7 +42374,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -47214,7 +42407,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -47413,7 +42606,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -47453,12 +42646,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -47466,21 +42659,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -47527,12 +42720,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -47548,7 +42741,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -47608,7 +42801,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -47625,14 +42818,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -47675,11 +42868,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -47693,7 +42886,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -47746,42 +42939,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47789,70 +42980,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47898,7 +43089,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47924,7 +43115,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47963,12 +43154,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47995,7 +43186,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -48026,11 +43217,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -48059,11 +43250,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -48072,7 +43263,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -48094,15 +43285,13 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt8(int8(flags)) if flags&int32(PTF_LEAF) == 0 { @@ -48110,14 +43299,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -48225,7 +43414,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -48287,7 +43476,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -48375,7 +43564,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4287) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4313) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48999,7 +44188,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -49161,7 +44350,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4296, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4322, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -49199,7 +44388,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -49640,7 +44829,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -49664,7 +44853,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -49673,7 +44862,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -49687,7 +44876,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -49717,7 +44906,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49813,7 +45002,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49851,7 +45040,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49918,7 +45107,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49961,7 +45150,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49991,7 +45180,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -50457,7 +45646,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50849,7 +46038,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50859,7 +46048,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50890,7 +46079,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50916,7 +46105,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50990,7 +46179,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -51125,7 +46314,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -51137,7 +46326,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -51253,7 +46442,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -51267,7 +46456,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -51501,7 +46690,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -51585,7 +46774,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -51597,7 +46786,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51799,7 +46988,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51832,7 +47021,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51841,7 +47030,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51970,7 +47159,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -52080,7 +47269,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -52168,7 +47357,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -52223,7 +47412,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -52249,7 +47438,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52276,7 +47465,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -52347,7 +47536,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -52485,7 +47674,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -52536,7 +47725,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -52545,7 +47734,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -52635,7 +47824,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -52653,7 +47842,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -52676,7 +47865,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52897,10 +48086,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -53191,17 +48380,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -53291,12 +48469,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -53304,7 +48482,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -53399,7 +48577,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -53480,7 +48658,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -53507,7 +48685,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -53547,7 +48725,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -53618,7 +48796,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -53663,7 +48841,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53859,10 +49037,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53985,8 +49164,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -54026,7 +49205,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -54049,7 +49228,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -54180,7 +49359,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -54223,7 +49402,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -54282,7 +49461,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -54314,7 +49493,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -54544,7 +49723,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54790,7 +49969,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54863,7 +50042,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -55022,7 +50201,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -55053,7 +50232,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -55138,7 +50317,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -55230,7 +50409,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -55266,7 +50445,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55296,10 +50475,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -55417,12 +50596,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -55432,14 +50611,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -55539,21 +50718,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -55647,7 +50826,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -55757,7 +50936,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55798,7 +50977,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55879,14 +51058,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -56023,7 +51202,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -56288,7 +51467,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4300, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4326, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -56336,11 +51515,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4302, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4328, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4325, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4351, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -56366,11 +51545,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4455, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4481, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -56442,11 +51621,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4494 + v2 = __ccgo_ts + 4520 } else { - v2 = __ccgo_ts + 4499 + v2 = __ccgo_ts + 4525 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4520, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4546, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -56582,12 +51761,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4546 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4572 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4564, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4590, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4718, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4744, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4748, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4774, 0) doCoverageCheck = 0 goto _4 } @@ -56672,7 +51851,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4772, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4798, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -56695,7 +51874,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4796, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4822, 0) depth = d2 } } else { @@ -56772,7 +51951,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4821, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4847, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56786,7 +51965,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4858, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4884, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56877,7 +52056,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4910 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4936 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56901,11 +52080,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4921, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4947, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4966, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4992, 0) } } } @@ -56942,10 +52121,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+5021, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5047, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5041, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5067, libc.VaList(bp+248, i)) } goto _3 _3: @@ -57075,14 +52254,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -57293,45 +52472,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -57384,7 +52524,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3892, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3918, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -57394,7 +52534,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5073, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5099, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -57423,7 +52563,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5093, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5119, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -57453,7 +52593,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5124, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5150, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -58131,7 +53271,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5164, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5190, libc.VaList(bp+48, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -58269,9 +53409,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -58446,20 +53583,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -58474,10 +53611,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58936,7 +54073,7 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) @@ -58949,8 +54086,8 @@ func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -59109,7 +54246,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -59151,11 +54288,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -59165,7 +54302,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -59187,12 +54324,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -59231,7 +54368,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -59343,8 +54480,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -59395,7 +54532,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -59403,8 +54541,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -59461,14 +54599,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -59482,7 +54620,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -59507,14 +54645,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3892, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3918, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -59614,7 +54752,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5171 + zNeg = __ccgo_ts + 5197 } } } @@ -59629,7 +54767,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5173, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5199, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59933,7 +55071,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59949,7 +55087,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59959,7 +55097,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -60010,9 +55148,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -60086,7 +55224,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -60420,12 +55558,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -60599,7 +55736,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -60616,7 +55753,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -60684,8 +55821,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -60698,11 +55835,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -60739,13 +55876,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60776,7 +55916,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -61278,7 +56418,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5178, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5204, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -61291,39 +56431,39 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { v2 = __ccgo_ts + 1695 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5183) == 0 { - zColl = __ccgo_ts + 5190 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5209) == 0 { + zColl = __ccgo_ts + 5216 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5171 + v3 = __ccgo_ts + 5197 } else { v3 = __ccgo_ts + 1695 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5192 + v4 = __ccgo_ts + 5218 } else { v4 = __ccgo_ts + 1695 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5195, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5221, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5203, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5229, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5219, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5245, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5228, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5254, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5228, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5254, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1456, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5235, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5261, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1423, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): @@ -61340,14 +56480,14 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { zP4 = __ccgo_ts + 1696 } else { - zP4 = __ccgo_ts + 5238 + zP4 = __ccgo_ts + 5264 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5245, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5271, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -61362,20 +56502,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5253, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5279, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5258, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5284, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5260 + zP4 = __ccgo_ts + 5286 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5268, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5294, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -61389,10 +56529,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5205, - 1: __ccgo_ts + 5207, - 2: __ccgo_ts + 5209, - 3: __ccgo_ts + 5214, + 0: __ccgo_ts + 5231, + 1: __ccgo_ts + 5233, + 2: __ccgo_ts + 5235, + 3: __ccgo_ts + 5240, } // C documentation @@ -62189,7 +57329,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -62208,7 +57348,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -62216,7 +57356,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -62343,7 +57483,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5284, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5310, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -62351,18 +57491,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5296, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5322, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5310, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5336, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5325, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5351, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -62593,7 +57733,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63981,7 +59121,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -64016,7 +59156,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -64070,7 +59210,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -64202,7 +59342,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -64354,7 +59494,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -64385,7 +59525,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -64536,15 +59676,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5368 + zContext = __ccgo_ts + 5394 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5387 + zContext = __ccgo_ts + 5413 } else { - zContext = __ccgo_ts + 5406 + zContext = __ccgo_ts + 5432 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5415, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5441, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -64639,10 +59779,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -64651,9 +59792,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -64733,7 +59874,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5451, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5477, 0) return int32(1) } else { return 0 @@ -64743,7 +59884,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5496, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5522, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64801,7 +59942,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -65128,12 +60269,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -65150,29 +60291,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -65202,13 +60347,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -65220,11 +60367,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -65232,23 +60383,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -65304,7 +60461,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5536, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5562, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -65505,7 +60662,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -65635,7 +60792,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65804,6 +60961,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65817,7 +60976,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65855,13 +61014,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -66095,18 +61254,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5559, - 1: __ccgo_ts + 5564, - 2: __ccgo_ts + 5571, - 3: __ccgo_ts + 5574, - 4: __ccgo_ts + 5577, - 5: __ccgo_ts + 5580, - 6: __ccgo_ts + 5583, - 7: __ccgo_ts + 5586, - 8: __ccgo_ts + 5594, - 9: __ccgo_ts + 5597, - 10: __ccgo_ts + 5604, - 11: __ccgo_ts + 5612, + 0: __ccgo_ts + 5585, + 1: __ccgo_ts + 5590, + 2: __ccgo_ts + 5597, + 3: __ccgo_ts + 5600, + 4: __ccgo_ts + 5603, + 5: __ccgo_ts + 5606, + 6: __ccgo_ts + 5609, + 7: __ccgo_ts + 5612, + 8: __ccgo_ts + 5620, + 9: __ccgo_ts + 5623, + 10: __ccgo_ts + 5630, + 11: __ccgo_ts + 5638, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -66361,14 +61520,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5619, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5645, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -66406,7 +61565,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -66416,7 +61575,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -66427,24 +61586,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -66492,7 +61655,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -66500,32 +61665,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66942,11 +62113,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66955,7 +62126,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66969,7 +62140,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -67004,7 +62175,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, libc.Uint8FromInt8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -67039,7 +62210,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -67105,11 +62276,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -67132,7 +62303,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -67154,7 +62325,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -67281,7 +62452,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5659, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5685, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -67319,7 +62490,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1456, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5164, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5190, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -67334,28 +62505,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5663, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5689, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5670, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5696, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5683, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5709, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5686, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5712, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5691, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5717, int32(1)) } } } @@ -67519,9 +62690,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -67547,12 +62718,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -67561,28 +62730,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67973,12 +63142,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67995,7 +63164,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -68013,7 +63182,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -68727,19 +63896,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3892, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3918, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5727, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5753, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5748, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5774, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3892, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3918, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5755, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5781, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69953,7 +65122,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69969,6 +65138,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -70462,7 +65637,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -70565,7 +65740,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5779, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5803, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5893, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5917, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -71161,7 +66336,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5947, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5971, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -71191,12 +66366,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 6002 + v250 = __ccgo_ts + 6026 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6050 + v251 = __ccgo_ts + 6074 } else { - v251 = __ccgo_ts + 6093 + v251 = __ccgo_ts + 6117 } v250 = v251 } @@ -71288,7 +66463,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6134) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6158) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -72372,7 +67547,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, int8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -72399,7 +67574,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72858,7 +68033,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -73291,7 +68466,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -73621,7 +68796,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3892, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3918, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -73652,13 +68827,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6179 + zSchema = __ccgo_ts + 6203 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6193, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6217, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -73673,7 +68848,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73910,7 +69085,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6236, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6260, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73927,15 +69102,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -74016,11 +69191,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -74232,7 +69407,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -74282,7 +69457,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3892, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3918, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -74338,7 +69513,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3892, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3918, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -74417,11 +69592,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6273 + v286 = __ccgo_ts + 6297 } else { - v286 = __ccgo_ts + 6278 + v286 = __ccgo_ts + 6302 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6285, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6309, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -74574,7 +69749,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6337, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6361, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -74736,7 +69911,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6366, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6390, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74816,12 +69991,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74832,7 +70007,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3892, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3918, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74926,7 +70101,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74954,11 +70129,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -75086,7 +70261,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3892, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3918, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -75237,7 +70412,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6376, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6400, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -75324,15 +70499,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -75798,11 +70952,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3892 + v8 = __ccgo_ts + 3918 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75881,14 +71035,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75907,11 +71061,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75987,7 +71141,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -76001,7 +71155,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3892 + v1 = __ccgo_ts + 3918 } else { v1 = libc.UintptrFromInt32(0) } @@ -76268,108 +71422,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -76733,7 +71622,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -77059,8 +71948,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -77074,9 +71963,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -77224,8 +72113,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -77274,18 +72163,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -77419,7 +72309,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -77573,6 +72463,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -79068,57 +73961,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -79415,7 +74257,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -80118,25 +74960,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6683, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6708, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6691+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6710+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6716+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6735+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6179+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6203+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6729+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6754+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6729+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6754+7) == 0 { return int32(1) } } @@ -80175,23 +75017,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -80223,7 +75064,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6743, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6768, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -80317,7 +75158,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6748) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6773) != 0 { goto _2 } } @@ -80339,57 +75180,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -80434,11 +75262,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6750, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6775, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6754, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6779, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -80447,36 +75275,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6758, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6783, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -80505,18 +75322,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -80563,15 +75380,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6767, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6792, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6798, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6823, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6835, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6860, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -80582,8 +75399,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -80623,7 +75440,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6853, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6878, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -80643,7 +75460,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -80652,7 +75469,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6888 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6913 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -80662,26 +75479,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6897 + v8 = __ccgo_ts + 6922 } else { - v10 = __ccgo_ts + 6912 + v8 = __ccgo_ts + 6937 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6934, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6959, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6947, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6972, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6957, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6982, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7018, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7043, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -80730,8 +75547,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80805,19 +75622,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 7025 + zIn = __ccgo_ts + 7050 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7053 + zIn = __ccgo_ts + 7078 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7071 + zIn = __ccgo_ts + 7096 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7089 + zIn = __ccgo_ts + 7114 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7107, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7132, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80843,7 +75660,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80989,7 +75806,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7127, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7152, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -81044,7 +75861,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7144, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7169, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -81068,7 +75885,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7208, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7233, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -81082,13 +75899,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -81108,16 +75925,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7244, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7269, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -81128,35 +75942,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7272, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7297, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7315 + zType = __ccgo_ts + 7340 } else { - zType = __ccgo_ts + 7322 + zType = __ccgo_ts + 7347 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7332, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7360, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7385, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7382, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7407, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7426, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7451, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -81241,7 +76058,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7474, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7499, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -81253,7 +76070,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7485, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7510, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -81299,7 +76116,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6835, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6860, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -81424,7 +76241,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7496, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7521, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -81459,7 +76276,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7552, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7577, 0) return int32(1) } i = 0 @@ -81497,7 +76314,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7586, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7611, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -81567,7 +76384,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7592, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7617, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -81601,7 +76418,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7653, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7678, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81914,7 +76731,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7684, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7709, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81981,7 +76798,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7586) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7611) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81992,7 +76809,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7723) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7748) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -82002,7 +76819,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7729, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7754, 0) return int32(WRC_Abort) } goto _6 @@ -82224,33 +77041,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -82302,7 +77121,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -82510,7 +77329,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82985,7 +77804,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6835, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6860, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -83064,7 +77883,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7788, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7813, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -83251,7 +78070,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -83409,11 +78228,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7836 + v2 = __ccgo_ts + 7861 } else { v2 = __ccgo_ts + 1695 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7838, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7863, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -83459,10 +78278,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1815) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1841) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -83490,7 +78309,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7882, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7907, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -83510,7 +78329,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7916, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7941, libc.VaList(bp+8, p)) } // C documentation @@ -83581,7 +78400,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7966, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7991, libc.VaList(bp+8, pExpr)) } } } @@ -83633,7 +78452,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7986, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8011, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -83666,7 +78485,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8029, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8054, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83902,12 +78721,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -84049,7 +78862,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -84189,7 +79002,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -84210,27 +79022,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -84276,9 +79081,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -84288,8 +79093,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -84303,7 +79108,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -84354,7 +79159,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -84435,7 +79240,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -84453,7 +79258,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -84534,7 +79339,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8052, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8077, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -84663,7 +79468,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8082, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8107, libc.VaList(bp+8, zObject)) } } @@ -84761,10 +79566,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8105) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8130) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8110) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8135) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -85442,13 +80247,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8116) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8141) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8124) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8149) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8130) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8155) == 0 { return int32(1) } return 0 @@ -85463,32 +80268,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8116, - 1: __ccgo_ts + 8124, - 2: __ccgo_ts + 8130, + 0: __ccgo_ts + 8141, + 1: __ccgo_ts + 8149, + 2: __ccgo_ts + 8155, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -85697,7 +80489,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -85750,7 +80542,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8134, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85850,12 +80642,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1815) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1841) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -86447,7 +81240,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8349) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8374) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -86543,14 +81336,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -86578,9 +81371,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -86713,7 +81506,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86843,13 +81636,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -87629,7 +82427,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8442, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8467, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -87641,7 +82439,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -87656,7 +82454,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8469, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8494, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -87685,7 +82483,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87761,7 +82559,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8052, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8077, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87824,7 +82622,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6835, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6860, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87834,7 +82632,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87842,7 +82640,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87855,9 +82653,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87939,7 +82737,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8493, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8518, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -88010,17 +82808,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -88029,7 +82827,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -88041,6 +82839,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -88060,7 +82879,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -88130,7 +82949,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -88174,7 +82993,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -88247,7 +83066,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -88274,8 +83093,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -88441,7 +83260,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88650,7 +83471,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -89357,7 +84180,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -89586,10 +84409,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -89627,7 +84450,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89641,7 +84464,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -89655,10 +84478,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -89668,25 +84494,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8568, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -89699,7 +84529,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -89709,11 +84539,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -89733,13 +84563,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89809,7 +84639,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89845,6 +84675,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89862,44 +84693,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8568, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89979,7 +84815,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89987,7 +84823,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -90005,7 +84841,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -90024,11 +84860,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -90146,8 +84982,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6683, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8543, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6708, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90165,10 +85001,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8571, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8625, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8746, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8800, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -90184,9 +85020,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8920, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8974, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9067, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9121, 0) } } @@ -90242,7 +85078,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9218, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9272, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -90251,11 +85087,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9277, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9331, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9283, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9337, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -90285,21 +85121,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9310, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9364, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9494, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9548, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9799, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9815, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9853, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9869, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9873, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9927, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -90307,7 +85143,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -90315,7 +85151,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10138, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10192, 0) goto exit_rename_table exit_rename_table: ; @@ -90332,7 +85168,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10151, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10205, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -90372,11 +85208,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10189, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10243, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10221, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10275, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -90392,10 +85228,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10248) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10302) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10307) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10361) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -90407,13 +85243,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10360) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10414) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10406) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10460) } } /* Modify the CREATE TABLE statement. */ @@ -90427,7 +85263,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10433, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10487, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -90455,7 +85291,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10579, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10633, libc.VaList(bp+16, zTab, zDb)) } } } @@ -90493,12 +85329,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10932, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10986, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10966, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11020, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -90513,7 +85349,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -90521,8 +85357,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10996, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11050, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -90583,18 +85419,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 11015 + zType = __ccgo_ts + 11069 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 11020 + zType = __ccgo_ts + 11074 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11034 + v1 = __ccgo_ts + 11088 } else { - v1 = __ccgo_ts + 11051 + v1 = __ccgo_ts + 11105 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11069, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11123, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -90641,21 +85477,9 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11087, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11141, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ @@ -90671,11 +85495,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11108, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11290, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11162, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11344, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10138, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10192, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -90685,31 +85509,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -90726,16 +85525,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -91038,9 +85827,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -91151,11 +85940,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11421 + v1 = __ccgo_ts + 11475 } else { v1 = __ccgo_ts + 1695 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11423, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11477, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -91226,30 +86015,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11446, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11500, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -91270,9 +86063,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -91288,15 +86080,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11454, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11508, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -91307,16 +86099,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -91333,21 +86125,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11421 + v1 = __ccgo_ts + 11475 } else { v1 = __ccgo_ts + 1695 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11460, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11514, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -91373,7 +86165,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -91683,7 +86475,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91950,7 +86742,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -92133,7 +86925,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -92217,8 +87009,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -92234,12 +87027,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -92313,7 +87106,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -92330,7 +87123,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11465, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11519, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -92385,23 +87178,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11087, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11141, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11472 + v1 = __ccgo_ts + 11526 } else { - v1 = __ccgo_ts + 5702 + v1 = __ccgo_ts + 5728 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11484, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11512, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11566, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -92413,31 +87206,31 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1695, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11560, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11614, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11681, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11735, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -92451,7 +87244,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -92462,8 +87255,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -92524,27 +87317,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11699, + FzName: __ccgo_ts + 11753, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11720, + FzName: __ccgo_ts + 11774, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11740, + FzName: __ccgo_ts + 11794, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11759, + FzName: __ccgo_ts + 11813, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11778, + FzName: __ccgo_ts + 11832, }, } @@ -92755,8 +87548,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11881, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11935, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92766,10 +87564,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11904, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11958, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11934, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11988, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92801,15 +87599,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11801, - FzCols: __ccgo_ts + 11814, + FzName: __ccgo_ts + 11855, + FzCols: __ccgo_ts + 11868, }, 1: { - FzName: __ccgo_ts + 11827, - FzCols: __ccgo_ts + 11840, + FzName: __ccgo_ts + 11881, + FzCols: __ccgo_ts + 11894, }, 2: { - FzName: __ccgo_ts + 11868, + FzName: __ccgo_ts + 11922, }, } @@ -92862,44 +87660,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -93023,7 +87783,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -93039,12 +87800,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -93052,7 +87813,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -93111,7 +87872,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11952, + FzName: __ccgo_ts + 12006, } func init() { @@ -93485,7 +88246,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11962, + FzName: __ccgo_ts + 12016, } func init() { @@ -93535,7 +88296,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11972, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12026, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -93546,7 +88307,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11977, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12031, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -93585,7 +88346,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11983, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12037, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -93603,7 +88364,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11989, + FzName: __ccgo_ts + 12043, } func init() { @@ -93669,7 +88430,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11998, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12052, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -93678,12 +88439,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11801, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11855, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93805,7 +88566,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93885,7 +88646,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93916,7 +88677,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12008, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12062, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -94007,7 +88768,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12008, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12062, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -94044,7 +88805,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -94077,11 +88838,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12012) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12066) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12016) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12070) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -94189,13 +88950,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -94245,17 +88999,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+12020, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12074, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12031, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12085, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12041, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12095, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -94267,13 +89021,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -94324,7 +89071,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -94527,8 +89274,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -94634,11 +89381,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11881, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12053, __ccgo_ts+12122, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12107, __ccgo_ts+12176, zDb) } return rc } @@ -94704,10 +89451,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11801, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11855, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12174, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12228, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94820,7 +89567,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6743, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6768, zName) == 0) } // C documentation @@ -94872,11 +89619,11 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4064) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4090) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12215, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12269, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94907,7 +89654,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12218, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12272, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94916,7 +89663,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12255, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12309, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94928,13 +89675,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94972,7 +89719,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12285, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12339, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94980,7 +89727,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12314, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12368, 0) rc = int32(SQLITE_ERROR) } } @@ -95027,7 +89774,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+1665, 0) } else { if *(*uintptr)(unsafe.Pointer(bp + 24)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12382, libc.VaList(bp+56, zFile)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12436, libc.VaList(bp+56, zFile)) } } } @@ -95089,15 +89836,15 @@ func _detachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { i++ } if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12410, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12464, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12431, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12485, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12511, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -95192,7 +89939,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12479, + FzName: __ccgo_ts + 12533, } func init() { @@ -95214,7 +89961,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12493, + FzName: __ccgo_ts + 12547, } func init() { @@ -95240,7 +89987,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12507, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12561, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -95274,7 +90021,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12531, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12585, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -95401,6 +90148,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -95473,9 +90222,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -95491,7 +90240,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12577, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12631, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -95519,11 +90268,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12600, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12654, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12606, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12660, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12612, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12666, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -95583,7 +90332,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8124 + zCol = __ccgo_ts + 8149 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -95618,7 +90367,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12639, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12693, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -95655,47 +90404,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -95736,7 +90444,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95834,7 +90542,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95912,7 +90622,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95926,7 +90636,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -96039,21 +90751,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6743) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6768) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6683, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6708, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6729+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6179+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6691) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6754+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6203+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6716) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6729+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6179) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6754+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6203) } } } @@ -96083,12 +90795,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6683, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6729+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6179) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6708, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6754+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6203) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6710+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6691) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6735+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6716) } } } @@ -96126,7 +90838,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12654, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12708, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -96136,7 +90848,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -96144,15 +90856,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12662 + v1 = __ccgo_ts + 12716 } else { - v1 = __ccgo_ts + 12675 + v1 = __ccgo_ts + 12729 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6947, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6972, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7018, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7043, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -96190,12 +90902,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6683, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6179+7) == 0 { - return __ccgo_ts + 6729 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6708, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6203+7) == 0 { + return __ccgo_ts + 6754 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6691+7) == 0 { - return __ccgo_ts + 6710 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6716+7) == 0 { + return __ccgo_ts + 6735 } } return zName @@ -96319,9 +91031,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -96720,7 +91432,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6179) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6203) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96752,7 +91464,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6743, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6768, zName) { break } goto _1 @@ -96810,13 +91522,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12689, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12743, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12706, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12760, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96864,8 +91576,8 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6683, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12726, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6708, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12780, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96901,23 +91613,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -97037,7 +91751,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -97080,9 +91794,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6691 + v1 = __ccgo_ts + 6716 } else { - v1 = __ccgo_ts + 6179 + v1 = __ccgo_ts + 6203 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -97095,7 +91809,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12768, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12822, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -97111,9 +91825,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 11015 + v2 = __ccgo_ts + 11069 } else { - v2 = __ccgo_ts + 9277 + v2 = __ccgo_ts + 9331 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -97123,9 +91837,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6691 + v3 = __ccgo_ts + 6716 } else { - v3 = __ccgo_ts + 6179 + v3 = __ccgo_ts + 6203 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -97149,11 +91863,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 11015 + v4 = __ccgo_ts + 11069 } else { - v4 = __ccgo_ts + 9277 + v4 = __ccgo_ts + 9331 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12809, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12863, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -97161,11 +91875,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12830, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12884, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -97197,19 +91911,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -97229,15 +91953,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -97252,7 +91981,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -97313,7 +92042,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12865, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12919, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -97322,14 +92051,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12899, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12953, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -97361,11 +92092,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -97376,7 +92107,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12919, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12973, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -97386,12 +92117,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12942, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12996, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12949, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+13003, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -97433,21 +92164,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12959, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13013, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -97458,7 +92178,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -97471,12 +92191,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -97648,10 +92377,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13039, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13030, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13084, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -97709,7 +92438,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13071, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13125, 0) } } @@ -97737,8 +92466,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -97746,7 +92475,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13123, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13177, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97765,21 +92494,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97802,7 +92520,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13164, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13218, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97830,8 +92548,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97918,17 +92641,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13220, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13274, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13263, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13317, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13271, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13325, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97960,7 +92683,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13278, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13332, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -98101,9 +92824,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -98114,31 +92838,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { zSep = __ccgo_ts + 1695 - zSep2 = __ccgo_ts + 13309 - zEnd = __ccgo_ts + 5203 + zSep2 = __ccgo_ts + 13363 + zEnd = __ccgo_ts + 5229 } else { - zSep = __ccgo_ts + 13311 - zSep2 = __ccgo_ts + 13315 - zEnd = __ccgo_ts + 13320 + zSep = __ccgo_ts + 13365 + zSep2 = __ccgo_ts + 13369 + zEnd = __ccgo_ts + 13374 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13323, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13377, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -98149,8 +92873,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -98163,17 +92888,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3892, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ 0: __ccgo_ts + 1695, - 1: __ccgo_ts + 13337, - 2: __ccgo_ts + 13343, - 3: __ccgo_ts + 13348, - 4: __ccgo_ts + 13353, - 5: __ccgo_ts + 13343, + 1: __ccgo_ts + 13391, + 2: __ccgo_ts + 13397, + 3: __ccgo_ts + 13402, + 4: __ccgo_ts + 13407, + 5: __ccgo_ts + 13397, } // C documentation @@ -98182,15 +92908,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -98205,7 +92932,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -98438,8 +93165,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -98539,7 +93276,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -98552,8 +93289,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -98583,7 +93320,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98802,9 +93539,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13359, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1695))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13413, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1695))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13392, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13446, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98825,11 +93562,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13419, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13473, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13469, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13523, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98876,7 +93613,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13501, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13555, 0) return } } @@ -98910,16 +93647,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9277 - zType2 = __ccgo_ts + 13545 + zType = __ccgo_ts + 9331 + zType2 = __ccgo_ts + 13599 } else { /* A view */ - zType = __ccgo_ts + 11015 - zType2 = __ccgo_ts + 13551 + zType = __ccgo_ts + 11069 + zType2 = __ccgo_ts + 13605 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98936,24 +93673,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -99001,13 +93743,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13556, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13610, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13571, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13625, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -99016,15 +93768,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13669, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13723, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13711, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13765, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13745, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13799, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -99042,7 +93794,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9799) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9853) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -99075,7 +93827,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13766, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13820, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -99092,7 +93844,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11015, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11069, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -99189,7 +93941,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13802, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13856, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -99373,7 +94125,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13832, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13886, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -99386,7 +94138,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13847, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13901, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -99469,9 +94221,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13914, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13968, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11904, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11958, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -99512,7 +94264,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13928, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13982, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -99521,7 +94273,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13973, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14027, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -99556,11 +94308,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6683, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3515, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6708, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3541, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7485, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7510, int32(10)) == 0 { return 0 } return int32(1) @@ -99615,9 +94367,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6691 + v1 = __ccgo_ts + 6716 } else { - v1 = __ccgo_ts + 6179 + v1 = __ccgo_ts + 6203 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -99650,18 +94402,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14040, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14068, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14122, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14102, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14156, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -99671,7 +94423,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12016, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12070, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99719,19 +94471,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14134, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14188, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14197, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14251, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -99788,7 +94540,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14291, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14345, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99903,11 +94655,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99929,7 +94681,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99974,13 +94726,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -100003,23 +94755,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -100048,11 +94800,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14337 + v2 = __ccgo_ts + 14391 } else { - v2 = __ccgo_ts + 14343 + v2 = __ccgo_ts + 14397 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14348, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14402, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -100130,7 +94882,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14376, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14430, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -100140,7 +94892,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14382, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14436, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -100154,16 +94906,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6683, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14432, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6708, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14460, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14514, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14485, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14539, 0) goto exit_create_index } /* @@ -100184,19 +94936,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14376, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14430, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14519, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14573, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14553, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14607, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -100217,7 +94969,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14577, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14631, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -100235,9 +94987,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6691 + v2 = __ccgo_ts + 6716 } else { - v2 = __ccgo_ts + 6179 + v2 = __ccgo_ts + 6203 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -100265,7 +95017,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14376) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14430) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -100297,7 +95049,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -100349,7 +95101,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14600, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14654, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -100359,7 +95111,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -100369,8 +95121,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -100448,7 +95200,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -100496,7 +95248,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14661, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14715, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -100526,8 +95278,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14703, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14757, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -100540,7 +95292,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -100569,9 +95321,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if onError == OE_None { v13 = __ccgo_ts + 1695 } else { - v13 = __ccgo_ts + 14720 + v13 = __ccgo_ts + 14774 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14728, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14782, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -100579,7 +95331,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14748, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -100587,7 +95339,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14807, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14861, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -100750,16 +95502,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14834, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14888, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14852, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14906, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100767,9 +95519,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6691 + v1 = __ccgo_ts + 6716 } else { - v1 = __ccgo_ts + 6179 + v1 = __ccgo_ts + 6203 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100785,8 +95537,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14925, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12012, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14979, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12066, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100859,12 +95611,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100976,13 +95728,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14985, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15039, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -101063,7 +95815,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -101113,7 +95865,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -101284,11 +96036,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 15021 + v1 = __ccgo_ts + 15075 } else { - v1 = __ccgo_ts + 15024 + v1 = __ccgo_ts + 15078 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15030, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15084, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -101487,7 +96239,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15066, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15120, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -101534,9 +96286,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15072 + v1 = __ccgo_ts + 15126 } else { - v1 = __ccgo_ts + 15081 + v1 = __ccgo_ts + 15135 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -101568,9 +96320,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15066, - 1: __ccgo_ts + 15088, - 2: __ccgo_ts + 15072, + 0: __ccgo_ts + 15120, + 1: __ccgo_ts + 15142, + 2: __ccgo_ts + 15126, } // C documentation @@ -101590,7 +96342,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15096, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15150, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -101615,7 +96367,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12600, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12654, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -102046,7 +96798,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15296, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15350, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102928,11 +97678,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15329, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15383, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15358, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15412, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -103036,7 +97786,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -103093,7 +97843,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15432, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15486, -int32(1)) return } if argc == int32(3) { @@ -104812,7 +99567,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15465, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15519, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104894,7 +99649,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104966,28 +99721,28 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15510, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15564, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15518, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15572, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): @@ -105019,13 +99774,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15526, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15580 + } else { + v2 = __ccgo_ts + 15584 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: Xsqlite3_str_append(tls, pStr, __ccgo_ts+1696, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15587, -int32(1)) + return +} + // C documentation // // /* @@ -105037,6 +99928,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -105047,7 +99942,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -105482,7 +100377,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -105571,7 +100466,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11421, + 0: __ccgo_ts + 11475, } // C documentation @@ -105583,8 +100478,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -105599,7 +100494,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -105611,16 +100506,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -105731,7 +100626,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15529, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15610, int32(4), libc.UintptrFromInt32(0)) } } @@ -105792,7 +100687,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12639, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12693, -int32(1)) return } if argc == int32(2) { @@ -105823,17 +100718,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105902,7 +100786,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105984,7 +100868,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15409, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15463, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -106047,12 +100931,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -106216,7 +101094,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -106227,7 +101105,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -106334,7 +101212,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15534, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15615, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -106363,8 +101241,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15540, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15540, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15621, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15621, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -106544,11 +101422,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -106652,7 +101530,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -106665,542 +101543,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15545, + FzName: __ccgo_ts + 15626, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15565, + FzName: __ccgo_ts + 15646, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15578, + FzName: __ccgo_ts + 15659, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15596, + FzName: __ccgo_ts + 15677, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15605, + FzName: __ccgo_ts + 15686, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15613, + FzName: __ccgo_ts + 15694, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15613, + FzName: __ccgo_ts + 15694, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15628, + FzName: __ccgo_ts + 15709, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15654, + FzName: __ccgo_ts + 15735, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15679, + FzName: __ccgo_ts + 15760, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15769, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15699, + FzName: __ccgo_ts + 15780, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15706, + FzName: __ccgo_ts + 15787, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15720, + FzName: __ccgo_ts + 15801, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15720, + FzName: __ccgo_ts + 15801, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15726, + FzName: __ccgo_ts + 15807, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15726, + FzName: __ccgo_ts + 15807, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15732, + FzName: __ccgo_ts + 15813, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15732, + FzName: __ccgo_ts + 15813, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15737, + FzName: __ccgo_ts + 15818, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15737, + FzName: __ccgo_ts + 15818, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15741, + FzName: __ccgo_ts + 15822, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15741, + FzName: __ccgo_ts + 15822, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15745, + FzName: __ccgo_ts + 15826, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15752, + FzName: __ccgo_ts + 15833, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15760, + FzName: __ccgo_ts + 15841, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15767, + FzName: __ccgo_ts + 15848, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15780, + FzName: __ccgo_ts + 15861, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15786, + FzName: __ccgo_ts + 15867, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15793, + FzName: __ccgo_ts + 15874, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15800, + FzName: __ccgo_ts + 15881, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15808, + FzName: __ccgo_ts + 15889, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15813, + FzName: __ccgo_ts + 15894, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15817, + FzName: __ccgo_ts + 15898, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15817, + FzName: __ccgo_ts + 15898, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15823, + FzName: __ccgo_ts + 15904, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15829, + FzName: __ccgo_ts + 15910, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15835, + FzName: __ccgo_ts + 15916, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15839, + FzName: __ccgo_ts + 15920, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15839, + FzName: __ccgo_ts + 15920, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15845, + FzName: __ccgo_ts + 15926, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15852, + FzName: __ccgo_ts + 15933, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15862, + FzName: __ccgo_ts + 15943, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15869, + FzName: __ccgo_ts + 15950, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15876, + FzName: __ccgo_ts + 15957, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15887, + FzName: __ccgo_ts + 15968, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15894, + FzName: __ccgo_ts + 15975, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15909, + FzName: __ccgo_ts + 15990, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15926, + FzName: __ccgo_ts + 16007, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15937, + FzName: __ccgo_ts + 16018, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15943, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16025, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15961, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16031, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15969, + FzName: __ccgo_ts + 16044, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15983, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16062, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15991, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16070, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16000, + FzName: __ccgo_ts + 16084, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16000, + FzName: __ccgo_ts + 16092, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16007, + FzName: __ccgo_ts + 16101, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16007, + FzName: __ccgo_ts + 16101, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16108, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16108, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16017, + FzName: __ccgo_ts + 16118, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16021, + FzName: __ccgo_ts + 16122, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16027, + FzName: __ccgo_ts + 16128, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16031, + FzName: __ccgo_ts + 16132, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16031, + FzName: __ccgo_ts + 16132, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16037, + FzName: __ccgo_ts + 16138, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16037, + FzName: __ccgo_ts + 16138, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16050, + FzName: __ccgo_ts + 16151, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16061, + FzName: __ccgo_ts + 16162, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15540, + FzName: __ccgo_ts + 15621, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15540, + FzName: __ccgo_ts + 15621, }, - 70: { + 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16066, + FzName: __ccgo_ts + 16167, }, - 71: { + 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1268, }, - 72: { + 74: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), FzName: __ccgo_ts + 1276, }, - 73: { + 75: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16071, + FzName: __ccgo_ts + 16172, }, - 74: { + 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16077, + FzName: __ccgo_ts + 16178, }, - 75: { + 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16080, + FzName: __ccgo_ts + 16181, }, - 76: { + 78: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16084, + FzName: __ccgo_ts + 16185, }, - 77: { + 79: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16090, - }, - 78: { - FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16080, - }, - 79: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16095, + FzName: __ccgo_ts + 16191, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16099, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16181, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16103, + FzName: __ccgo_ts + 16196, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16109, + FzName: __ccgo_ts + 16200, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16113, + FzName: __ccgo_ts + 16204, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16118, + FzName: __ccgo_ts + 16210, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16123, + FzName: __ccgo_ts + 16214, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16128, + FzName: __ccgo_ts + 16219, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16134, + FzName: __ccgo_ts + 16224, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16138, + FzName: __ccgo_ts + 16229, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16142, + FzName: __ccgo_ts + 16235, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16146, + FzName: __ccgo_ts + 16239, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16151, + FzName: __ccgo_ts + 16243, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16156, + FzName: __ccgo_ts + 16247, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16161, + FzName: __ccgo_ts + 16252, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16167, + FzName: __ccgo_ts + 16257, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16173, + FzName: __ccgo_ts + 16262, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16179, + FzName: __ccgo_ts + 16268, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16184, + FzName: __ccgo_ts + 16274, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16192, + FzName: __ccgo_ts + 16280, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16200, + FzName: __ccgo_ts + 16285, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16203, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16293, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16301, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16304, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6888, + FzName: __ccgo_ts + 6913, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16208, + FzName: __ccgo_ts + 16309, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16212, + FzName: __ccgo_ts + 16313, }, } @@ -107259,109 +102148,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -107585,7 +102476,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -107678,7 +102569,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16215, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16316, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -108502,7 +103393,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108789,11 +103680,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6754, + Fz: __ccgo_ts + 6779, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6750, + Fz: __ccgo_ts + 6775, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108857,7 +103748,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5338) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5364) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -108873,7 +103764,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -109321,7 +104212,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -109439,7 +104330,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8381, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8406, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -109505,11 +104396,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109834,7 +104725,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109848,7 +104739,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109883,7 +104774,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109896,7 +104787,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -110023,27 +104914,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -110124,7 +105015,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -110151,7 +105042,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -110160,44 +105051,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16260, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16361, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16301, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16402, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -110219,31 +105094,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16333, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16434, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -110267,10 +105142,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -110311,8 +105186,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -110329,34 +105204,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16341, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16442, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16393, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16494, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -110463,18 +105338,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -110484,13 +105359,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -110501,14 +105376,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -110525,16 +105400,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -110645,11 +105520,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -110708,7 +105583,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16485) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16586) } goto insert_cleanup insert_cleanup: @@ -110831,33 +105706,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -111104,7 +105952,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12600, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12654, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -113338,7 +107866,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16534, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16635, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -113358,19 +107886,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16538, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16639, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16544, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16645, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113385,14 +107913,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16587, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16688, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -113416,7 +107944,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16619, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16720, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -113425,7 +107953,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16499, + 0: __ccgo_ts + 16600, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -113494,14 +108022,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -113516,7 +108039,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -113534,7 +108057,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -113549,7 +108072,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -113559,6 +108082,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -113570,7 +108095,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -113582,7 +108107,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -113658,7 +108183,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16656, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16757, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -113712,63 +108237,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5594, - 1: __ccgo_ts + 16695, - 2: __ccgo_ts + 9277, - 3: __ccgo_ts + 16699, - 4: __ccgo_ts + 16704, - 5: __ccgo_ts + 16707, - 6: __ccgo_ts + 16717, - 7: __ccgo_ts + 16727, - 8: __ccgo_ts + 16733, - 9: __ccgo_ts + 16737, - 10: __ccgo_ts + 16742, - 11: __ccgo_ts + 16747, - 12: __ccgo_ts + 16755, - 13: __ccgo_ts + 16766, - 14: __ccgo_ts + 16769, - 15: __ccgo_ts + 16776, - 16: __ccgo_ts + 16737, - 17: __ccgo_ts + 16742, - 18: __ccgo_ts + 16783, - 19: __ccgo_ts + 16788, - 20: __ccgo_ts + 16791, - 21: __ccgo_ts + 16798, - 22: __ccgo_ts + 16733, - 23: __ccgo_ts + 16737, - 24: __ccgo_ts + 16804, - 25: __ccgo_ts + 16809, - 26: __ccgo_ts + 16814, - 27: __ccgo_ts + 16737, - 28: __ccgo_ts + 16818, - 29: __ccgo_ts + 16742, - 30: __ccgo_ts + 16826, - 31: __ccgo_ts + 16830, - 32: __ccgo_ts + 16835, - 33: __ccgo_ts + 12016, - 34: __ccgo_ts + 12012, - 35: __ccgo_ts + 16841, - 36: __ccgo_ts + 16846, - 37: __ccgo_ts + 16851, - 38: __ccgo_ts + 16695, - 39: __ccgo_ts + 16737, - 40: __ccgo_ts + 16856, - 41: __ccgo_ts + 16863, - 42: __ccgo_ts + 16870, - 43: __ccgo_ts + 9277, - 44: __ccgo_ts + 16878, - 45: __ccgo_ts + 5597, - 46: __ccgo_ts + 16884, - 47: __ccgo_ts + 16695, - 48: __ccgo_ts + 16737, - 49: __ccgo_ts + 16889, - 50: __ccgo_ts + 16894, - 51: __ccgo_ts + 16080, - 52: __ccgo_ts + 16899, - 53: __ccgo_ts + 16912, - 54: __ccgo_ts + 16921, - 55: __ccgo_ts + 16928, - 56: __ccgo_ts + 16939, + 0: __ccgo_ts + 5620, + 1: __ccgo_ts + 16796, + 2: __ccgo_ts + 9331, + 3: __ccgo_ts + 16800, + 4: __ccgo_ts + 16805, + 5: __ccgo_ts + 16808, + 6: __ccgo_ts + 16818, + 7: __ccgo_ts + 16828, + 8: __ccgo_ts + 16834, + 9: __ccgo_ts + 16838, + 10: __ccgo_ts + 16843, + 11: __ccgo_ts + 16848, + 12: __ccgo_ts + 16856, + 13: __ccgo_ts + 16867, + 14: __ccgo_ts + 16870, + 15: __ccgo_ts + 16838, + 16: __ccgo_ts + 16877, + 17: __ccgo_ts + 16843, + 18: __ccgo_ts + 16885, + 19: __ccgo_ts + 16889, + 20: __ccgo_ts + 16894, + 21: __ccgo_ts + 16900, + 22: __ccgo_ts + 16838, + 23: __ccgo_ts + 16843, + 24: __ccgo_ts + 16907, + 25: __ccgo_ts + 16912, + 26: __ccgo_ts + 16915, + 27: __ccgo_ts + 16922, + 28: __ccgo_ts + 16834, + 29: __ccgo_ts + 16838, + 30: __ccgo_ts + 16928, + 31: __ccgo_ts + 16933, + 32: __ccgo_ts + 16938, + 33: __ccgo_ts + 16796, + 34: __ccgo_ts + 16838, + 35: __ccgo_ts + 16942, + 36: __ccgo_ts + 16949, + 37: __ccgo_ts + 16956, + 38: __ccgo_ts + 12070, + 39: __ccgo_ts + 12066, + 40: __ccgo_ts + 16964, + 41: __ccgo_ts + 16969, + 42: __ccgo_ts + 16974, + 43: __ccgo_ts + 9331, + 44: __ccgo_ts + 16979, + 45: __ccgo_ts + 5623, + 46: __ccgo_ts + 16985, + 47: __ccgo_ts + 16990, + 48: __ccgo_ts + 16181, + 49: __ccgo_ts + 16995, + 50: __ccgo_ts + 16796, + 51: __ccgo_ts + 16838, + 52: __ccgo_ts + 17008, + 53: __ccgo_ts + 17013, + 54: __ccgo_ts + 17022, + 55: __ccgo_ts + 17029, + 56: __ccgo_ts + 17040, } // C documentation @@ -113787,338 +108312,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16947, + FzName: __ccgo_ts + 17048, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16962, + FzName: __ccgo_ts + 17063, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16977, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16989, + FzName: __ccgo_ts + 17090, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 17005, + FzName: __ccgo_ts + 17106, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16928, + FzName: __ccgo_ts + 17029, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 17018, + FzName: __ccgo_ts + 17119, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17030, + FzName: __ccgo_ts + 17131, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17050, + FzName: __ccgo_ts + 17151, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17066, + FzName: __ccgo_ts + 17167, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17087, + FzName: __ccgo_ts + 17188, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17102, + FzName: __ccgo_ts + 17203, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17118, + FzName: __ccgo_ts + 17219, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17132, + FzName: __ccgo_ts + 17233, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17145, + FzName: __ccgo_ts + 17246, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17159, + FzName: __ccgo_ts + 17260, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17178, + FzName: __ccgo_ts + 17279, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17197, + FzName: __ccgo_ts + 17298, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17220, + FzName: __ccgo_ts + 17321, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17229, + FzName: __ccgo_ts + 17330, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17247, + FzName: __ccgo_ts + 17348, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17264, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17277, + FzName: __ccgo_ts + 17378, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17292, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17310, + FzName: __ccgo_ts + 17411, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17320, + FzName: __ccgo_ts + 17421, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17334, + FzName: __ccgo_ts + 17435, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17350, + FzName: __ccgo_ts + 17451, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17375, + FzName: __ccgo_ts + 17476, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17394, + FzName: __ccgo_ts + 17495, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17405, + FzName: __ccgo_ts + 17506, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17416, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17428, + FzName: __ccgo_ts + 17529, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17444, + FzName: __ccgo_ts + 17545, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17457, + FzName: __ccgo_ts + 17558, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17476, + FzName: __ccgo_ts + 17577, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17495, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17508, + FzName: __ccgo_ts + 17609, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17523, + FzName: __ccgo_ts + 17624, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17533, + FzName: __ccgo_ts + 17634, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17545, + FzName: __ccgo_ts + 17646, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17554, + FzName: __ccgo_ts + 17655, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17565, + FzName: __ccgo_ts + 17666, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17575, + FzName: __ccgo_ts + 17676, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17587, + FzName: __ccgo_ts + 17688, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17598, + FzName: __ccgo_ts + 17699, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17610, + FzName: __ccgo_ts + 17711, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17627, + FzName: __ccgo_ts + 17728, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17646, + FzName: __ccgo_ts + 17747, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17672, + FzName: __ccgo_ts + 17773, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17687, + FzName: __ccgo_ts + 17788, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17701, + FzName: __ccgo_ts + 17802, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17720, + FzName: __ccgo_ts + 17821, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17734, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17750, + FzName: __ccgo_ts + 17851, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17762, + FzName: __ccgo_ts + 17863, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17773, + FzName: __ccgo_ts + 17874, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17784, + FzName: __ccgo_ts + 17885, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -114126,45 +108651,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17796, + FzName: __ccgo_ts + 17897, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17807, + FzName: __ccgo_ts + 17908, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17828, + FzName: __ccgo_ts + 17929, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17836, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17851, + FzName: __ccgo_ts + 17952, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17864, + FzName: __ccgo_ts + 17965, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17883, + FzName: __ccgo_ts + 17984, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17898, + FzName: __ccgo_ts + 17999, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -114182,7 +108707,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -114290,10 +108815,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17914) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18015) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17924) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18025) { return PAGER_LOCKINGMODE_NORMAL } } @@ -114311,13 +108836,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8437) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8462) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17931) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18032) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17936) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18037) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -114340,10 +108865,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16889) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+17008) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17948) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18049) == 0 { return int32(2) } else { return 0 @@ -114365,7 +108890,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17955, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18056, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -114495,15 +109020,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 18017 + zName = __ccgo_ts + 18118 case int32(OE_SetDflt): - zName = __ccgo_ts + 18026 + zName = __ccgo_ts + 18127 case int32(OE_Cascade): - zName = __ccgo_ts + 18038 + zName = __ccgo_ts + 18139 case int32(OE_Restrict): - zName = __ccgo_ts + 18046 + zName = __ccgo_ts + 18147 default: - zName = __ccgo_ts + 18055 + zName = __ccgo_ts + 18156 break } return zName @@ -114524,12 +109049,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18065, - 1: __ccgo_ts + 18072, - 2: __ccgo_ts + 18080, - 3: __ccgo_ts + 18084, - 4: __ccgo_ts + 17948, - 5: __ccgo_ts + 18093, + 0: __ccgo_ts + 18166, + 1: __ccgo_ts + 18173, + 2: __ccgo_ts + 18181, + 3: __ccgo_ts + 18185, + 4: __ccgo_ts + 18049, + 5: __ccgo_ts + 18194, } // C documentation @@ -114591,15 +109116,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18118 + zType = __ccgo_ts + 18219 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18120 + zType = __ccgo_ts + 18221 } else { - zType = __ccgo_ts + 7836 + zType = __ccgo_ts + 7861 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18122, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18223, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -114608,9 +109133,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18097, - 2: __ccgo_ts + 18102, - 3: __ccgo_ts + 18110, + 1: __ccgo_ts + 18198, + 2: __ccgo_ts + 18203, + 3: __ccgo_ts + 18211, } // C documentation @@ -114709,7 +109234,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18129, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18230, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114752,7 +109277,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3892, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3918, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114797,7 +109322,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114856,7 +109381,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18133) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18234) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114899,7 +109424,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114927,7 +109452,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17924 + zRet = __ccgo_ts + 18025 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114955,7 +109480,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17914 + zRet = __ccgo_ts + 18015 } _returnSingleText(tls, v, zRet) break @@ -115245,7 +109770,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18138, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18239, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -115255,7 +109780,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -115277,7 +109802,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18163, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18264, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -115309,8 +109834,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18216) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18317) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -115390,9 +109916,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18222 + v14 = __ccgo_ts + 18323 } else { - v14 = __ccgo_ts + 18230 + v14 = __ccgo_ts + 18331 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -115463,7 +109989,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18237, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18338, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -115493,19 +110019,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 11015 + zType = __ccgo_ts + 11069 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13263 + zType = __ccgo_ts + 13317 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18253 + zType = __ccgo_ts + 18354 } else { - zType = __ccgo_ts + 9277 + zType = __ccgo_ts + 9331 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18260, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18361, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -115552,9 +110078,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18267, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18368, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18272, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18373, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -115578,11 +110104,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18277, - 1: __ccgo_ts + 18279, - 2: __ccgo_ts + 16766, + 0: __ccgo_ts + 18378, + 1: __ccgo_ts + 18380, + 2: __ccgo_ts + 16867, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18281, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18382, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -115601,7 +110127,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18287, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18388, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -115618,7 +110144,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18291, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18392, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -115668,7 +110194,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7836, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7861, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -115680,7 +110206,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7836, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7861, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -115706,7 +110232,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18294, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18303)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18395, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18404)) goto _32 _32: ; @@ -115720,8 +110246,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115847,7 +110373,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18308, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18409, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115943,7 +110469,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115987,7 +110513,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -116038,7 +110564,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18312, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18413, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -116049,7 +110575,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18336) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18437) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -116185,7 +110711,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18365, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18466, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -116247,7 +110773,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -116269,7 +110795,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18401, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18502, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -116282,7 +110808,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18421, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18522, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -116290,7 +110816,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18443, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18544, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -116301,10 +110827,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18466, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18567, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18468, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18569, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -116338,7 +110864,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18488, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18589, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -116362,9 +110888,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18518) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18619) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18523) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18624) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -116377,9 +110903,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18544) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18645) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18580) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18681) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -116407,9 +110933,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18518) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18619) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18591) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18692) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -116437,7 +110963,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18618) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18719) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -116534,7 +111060,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18645 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18746 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -116613,7 +111139,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18706, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18807, libc.VaList(bp+176, zRight)) } } } @@ -116718,13 +111244,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17931) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18032) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18731) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18832) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18084) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18185) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116859,7 +111385,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116889,7 +111415,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6683, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6708, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116951,7 +111477,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18739, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18840, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -117224,34 +111750,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18648, + FzName: __ccgo_ts + 18749, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18653, + FzName: __ccgo_ts + 18754, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18659, + FzName: __ccgo_ts + 18760, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18668, + FzName: __ccgo_ts + 18769, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18677, + FzName: __ccgo_ts + 18778, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18685, + FzName: __ccgo_ts + 18786, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18693, + FzName: __ccgo_ts + 18794, }, 7: { - FzName: __ccgo_ts + 18700, + FzName: __ccgo_ts + 18801, }, 8: {}, } @@ -117308,25 +111834,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -117347,14 +111854,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18757) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18772, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18873, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -117363,19 +111870,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18779, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18880, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18785) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18886) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18797) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18898) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5203, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5229, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -117390,7 +111897,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -117571,7 +112078,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -117583,13 +112090,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18812) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18913) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18820, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18921, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18824, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18925, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -117598,7 +112105,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117724,24 +112231,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18858, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5205 + v1 = __ccgo_ts + 5231 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18886, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18987, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18917, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+19018, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -117749,9 +112256,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18828, - 1: __ccgo_ts + 18835, - 2: __ccgo_ts + 18847, + 0: __ccgo_ts + 18929, + 1: __ccgo_ts + 18936, + 2: __ccgo_ts + 18948, } // C documentation @@ -117827,7 +112334,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14703) + _corruptSchema(tls, pData, argv, __ccgo_ts+14757) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117860,11 +112367,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18925) + _corruptSchema(tls, pData, argv, __ccgo_ts+19026) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14703) + _corruptSchema(tls, pData, argv, __ccgo_ts+14757) } } } @@ -117903,18 +112410,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9277 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9331 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6691 + v2 = __ccgo_ts + 6716 } else { - v2 = __ccgo_ts + 6179 + v2 = __ccgo_ts + 6203 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8349 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18938 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8374 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19039 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117998,7 +112505,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12314) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12368) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -118024,7 +112531,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19010) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19111) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -118039,7 +112546,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19034, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19135, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -118335,7 +112842,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -118348,9 +112855,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -118368,7 +112875,7 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse @@ -118397,7 +112904,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -118457,7 +112964,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19068, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19169, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -118473,7 +112980,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19098, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19199, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -118496,10 +113003,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -118507,7 +113014,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3892, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3918, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -118537,7 +113044,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -118671,7 +113178,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118793,15 +113300,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118837,21 +113335,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118931,7 +113414,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118939,7 +113422,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -119095,15 +113578,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11421 - zSp2 = __ccgo_ts + 11421 + zSp1 = __ccgo_ts + 11475 + zSp2 = __ccgo_ts + 11475 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19117, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19218, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -119160,25 +113643,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -119310,13 +113796,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -119394,7 +113880,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19147, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19248, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -119444,12 +113930,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19197, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19298, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -119464,9 +113950,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19261, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19362, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -119476,6 +113963,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -119510,7 +114004,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6888, + Fz: __ccgo_ts + 6913, Fn: uint32(8), } @@ -119527,13 +114021,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -119558,7 +114045,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -119603,7 +114090,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -119627,7 +114114,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -119648,7 +114135,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119771,7 +114258,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119898,10 +114385,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119909,7 +114396,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -120086,7 +114573,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19298, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19399, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -120197,8 +114684,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -120206,7 +114693,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -120291,13 +114778,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19318 + z = __ccgo_ts + 19419 case int32(TK_INTERSECT): - z = __ccgo_ts + 19328 + z = __ccgo_ts + 19429 case int32(TK_EXCEPT): - z = __ccgo_ts + 19338 + z = __ccgo_ts + 19439 default: - z = __ccgo_ts + 19345 + z = __ccgo_ts + 19446 break } return z @@ -120318,7 +114805,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19351, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19452, libc.VaList(bp+8, zUsage)) } /* @@ -120355,13 +114842,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19374 + v1 = __ccgo_ts + 19475 } else { v1 = __ccgo_ts + 1695 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19388, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19489, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19419, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19520, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -120385,11 +114872,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -120605,7 +115092,7 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr } if iCol < 0 { zType = __ccgo_ts + 1169 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16878 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16979 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -120718,7 +115205,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -120727,7 +115214,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -120751,13 +115238,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16878 + zCol = __ccgo_ts + 16979 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12600, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12654, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120765,7 +115252,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19465, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19566, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120819,7 +115306,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120857,7 +115344,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16878 + v3 = __ccgo_ts + 16979 } zName = v3 } else { @@ -120872,7 +115359,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19465, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19566, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120908,7 +115395,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19474, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19575, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -121027,7 +115514,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19482 + zType = __ccgo_ts + 19583 } else { zType = uintptr(0) j = int32(1) @@ -121093,7 +115580,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -121121,7 +115608,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -121171,7 +115658,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -121194,7 +115681,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -121342,7 +115829,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19486, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19587, 0) return } /* Obtain authorization to do a recursive query */ @@ -121379,7 +115866,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -121390,7 +115877,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -121404,7 +115891,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -121435,7 +115922,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19535, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19636, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -121450,7 +115937,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19577, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19678, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -121478,7 +115965,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19583, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19684, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -121533,9 +116020,9 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) if nRow == int32(1) { v1 = __ccgo_ts + 1695 } else { - v1 = __ccgo_ts + 19598 + v1 = __ccgo_ts + 19699 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19600, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19701, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -121643,8 +116130,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19623, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19638, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19724, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19739, 0) } /* Generate code for the left and right SELECT statements. */ @@ -121669,7 +116156,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19318, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19419, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121695,7 +116182,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -121721,7 +116208,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19657, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19758, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121753,11 +116240,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121779,7 +116266,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19657, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19758, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121886,6 +116373,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121902,9 +116390,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19678, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19779, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19724, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19825, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121975,7 +116463,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19298, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19399, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -122191,7 +116679,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -122223,7 +116711,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -122277,16 +116765,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7586) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7586) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7611) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7611) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -122304,32 +116792,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19806, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19907, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19817, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19918, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -122342,7 +116830,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19822, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19923, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -122552,11 +117040,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5183 + v1 = __ccgo_ts + 5209 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -122717,7 +117205,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122907,9 +117395,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -123121,7 +117609,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -123268,7 +117756,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -123507,18 +117995,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -123558,11 +118034,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -123627,7 +118103,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -123645,12 +118121,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -124132,7 +118608,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -124178,13 +118654,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15737) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15818) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15741) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15822) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -124272,8 +118748,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19828, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19929, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -124297,7 +118773,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -124379,7 +118855,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -124397,7 +118873,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19846, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19947, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -124545,7 +119021,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -124573,7 +119049,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19869, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19970, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -124595,12 +119071,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19889, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19990, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -124617,7 +119093,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19932 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20033 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -124648,7 +119124,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19955, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20056, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -124657,9 +119133,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19993 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20094 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20027 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20128 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -124708,7 +119184,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -124718,7 +119194,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20065, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20166, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124814,7 +119290,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124823,7 +119299,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124874,7 +119350,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20069, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20170, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124889,7 +119365,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20108, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20209, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124904,7 +119380,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15296, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15350, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -125028,7 +119504,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6748 + v10 = __ccgo_ts + 6773 } zSchemaName = v10 } @@ -125045,7 +119521,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20139, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20240, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -125124,7 +119600,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20144, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20245, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -125137,7 +119613,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12600, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12654, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -125157,9 +119633,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20153, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20254, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20171, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20272, 0) } } } @@ -125173,7 +119649,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20191, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20292, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -125370,14 +119846,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -125386,7 +119862,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -125418,11 +119894,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -125475,7 +119951,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -125512,12 +119988,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20222, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20323, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20273, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20374, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -125538,7 +120014,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20306, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20407, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -125677,7 +120153,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125785,7 +120261,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125829,7 +120305,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125852,7 +120328,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20339 + v1 = __ccgo_ts + 20440 } else { v1 = __ccgo_ts + 1695 } @@ -125861,7 +120337,7 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp } else { v2 = __ccgo_ts + 1695 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20362, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20463, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125893,7 +120369,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8349) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8374) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -126022,6 +120498,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -126050,7 +120527,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16031) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16132) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -126083,9 +120560,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -126095,13 +120572,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -126121,7 +120598,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -126294,8 +120771,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -126304,11 +120781,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -126324,7 +120801,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -126348,14 +120825,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20374, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20475, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -126456,7 +120933,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20428, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20529, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -126657,14 +121134,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20468, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20569, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -126696,7 +121173,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -126711,7 +121188,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20483, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20584, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126765,7 +121242,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126798,7 +121275,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126857,7 +121334,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126886,6 +121363,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126908,10 +121392,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126945,8 +121429,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126961,8 +121445,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126991,8 +121475,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -127009,7 +121493,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -127022,11 +121506,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -127060,49 +121544,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -127110,16 +121595,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -127137,11 +121622,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20499 + v47 = __ccgo_ts + 20600 } else { - v46 = __ccgo_ts + 20508 + v47 = __ccgo_ts + 20609 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19351, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19452, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -127151,12 +121636,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -127169,13 +121654,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -127186,12 +121671,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -127240,12 +121725,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -127315,9 +121804,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -127334,10 +121823,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -127364,8 +121853,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -127405,32 +121894,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -127472,7 +121961,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20499) + _explainTempTable(tls, pParse, __ccgo_ts+20600) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -127578,7 +122067,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -127594,7 +122083,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20517, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20618, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -127684,7 +122173,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127846,7 +122335,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20582, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20683, 0) goto trigger_cleanup } iDb = int32(1) @@ -127886,7 +122375,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20628, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20729, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127896,11 +122385,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20636, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20737, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20677, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20778, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127909,13 +122398,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20628, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20729, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20717, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20818, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127923,8 +122412,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6683, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20743, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6708, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20844, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127932,15 +122421,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20781 + v1 = __ccgo_ts + 20882 } else { - v1 = __ccgo_ts + 20788 + v1 = __ccgo_ts + 20889 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20794, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20895, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20831, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20932, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127960,9 +122449,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6691 + v3 = __ccgo_ts + 6716 } else { - v3 = __ccgo_ts + 6179 + v3 = __ccgo_ts + 6203 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -128062,7 +122551,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20628, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20729, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -128084,7 +122573,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20877, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20978, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -128100,10 +122589,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20925, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21026, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21000, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21101, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -128371,11 +122860,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21029, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21130, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -128413,9 +122902,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6691 + v1 = __ccgo_ts + 6716 } else { - v1 = __ccgo_ts + 6179 + v1 = __ccgo_ts + 6203 } zTab = v1 if iDb == int32(1) { @@ -128430,7 +122919,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21049, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21150, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -128563,11 +123052,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21111 + v1 = __ccgo_ts + 21212 } else { - v1 = __ccgo_ts + 21118 + v1 = __ccgo_ts + 21219 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21125, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21226, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -128669,7 +123158,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21173, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21274, 0) return int32(1) } @@ -128817,12 +123306,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128830,19 +123319,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128853,7 +123345,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128867,7 +123359,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128935,7 +123427,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6376, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6400, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -129034,10 +123526,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21215, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21316, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -129059,7 +123553,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -129131,7 +123625,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -129547,13 +124041,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -129561,21 +124055,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -129622,7 +124116,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -129661,7 +124155,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -129705,58 +124199,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21229, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21330, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21265, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21366, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8124 + v10 = __ccgo_ts + 8149 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129786,17 +124268,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129808,11 +124290,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129828,11 +124310,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129841,18 +124323,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129861,16 +124343,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129888,24 +124370,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129931,50 +124413,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -130272,8 +124754,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -130323,8 +124805,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -130371,11 +124853,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -130387,11 +124869,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -130434,7 +124916,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21284) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21385) } goto update_cleanup update_cleanup: @@ -130491,13 +124973,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -130539,11 +125021,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130868,9 +125350,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 200)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21297, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21398, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21301, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21402, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130959,13 +125441,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130973,7 +125455,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12689, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12743, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -131055,7 +125537,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21374, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21378, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21475, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21479, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -131146,7 +125628,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -131185,17 +125667,17 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21382) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21483) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21422) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21523) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21465) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21566) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) @@ -131212,7 +125694,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21514) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21615) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -131265,7 +125747,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15066) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15120) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131296,11 +125778,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21541, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21642, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21649, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21750, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -131309,7 +125791,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21703, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21804, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -131319,7 +125801,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21840, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21941, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -131410,39 +125892,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -131453,7 +125902,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -131462,7 +125911,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -131472,7 +125921,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -131497,15 +125946,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -131520,13 +125969,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131846,7 +126297,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12919, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12973, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131969,24 +126420,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21963, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22064, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21987, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22088, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22086, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22187, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -132043,7 +126499,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -132070,7 +126526,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22105, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22206, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -132104,7 +126560,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -132112,9 +126568,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22147, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22248, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3892, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3918, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -132127,7 +126583,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22177 + zFormat = __ccgo_ts + 22278 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -132161,7 +126617,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16769, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16870, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -132242,13 +126698,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22223, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22324, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3892, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3918, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -132329,7 +126785,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22223, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22324, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -132377,7 +126833,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22242, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22343, 0) return int32(SQLITE_ERROR) } goto _1 @@ -132388,9 +126844,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -132432,7 +126888,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3892 + v3 = __ccgo_ts + 3918 } else { v3 = uintptr(0) } @@ -132798,7 +127254,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132888,7 +127344,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132908,7 +127364,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3892, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3918, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132972,7 +127428,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132985,7 +127441,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -133245,436 +127701,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -133706,10 +127732,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22255 + return __ccgo_ts + 22356 } if i == -int32(1) { - return __ccgo_ts + 16878 + return __ccgo_ts + 16979 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133728,10 +127754,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22262, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22363, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22268, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22369, int32(1)) } i = 0 for { @@ -133739,7 +127765,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13309, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13363, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133748,11 +127774,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5229, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22268, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22369, int32(1)) } i = 0 for { @@ -133760,16 +127786,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13309, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13363, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5205, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5231, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5229, int32(1)) } } @@ -133816,7 +127842,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22270, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22371, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133824,12 +127850,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22262, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22363, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22273 + v2 = __ccgo_ts + 22374 } else { - v2 = __ccgo_ts + 22278 + v2 = __ccgo_ts + 22379 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133846,7 +127872,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22286) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22387) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133857,9 +127883,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22288) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22389) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5229, int32(1)) } // C documentation @@ -133904,11 +127930,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22290 + v2 = __ccgo_ts + 22391 } else { - v2 = __ccgo_ts + 22297 + v2 = __ccgo_ts + 22398 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22302, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22403, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133921,37 +127947,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11472 + zFmt = __ccgo_ts + 11526 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22308 + zFmt = __ccgo_ts + 22409 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22341 + zFmt = __ccgo_ts + 22442 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22366 + zFmt = __ccgo_ts + 22467 } else { - zFmt = __ccgo_ts + 22384 + zFmt = __ccgo_ts + 22485 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22393, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22494, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16878 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22401, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16979 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22502, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22432, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22533, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133961,14 +127987,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22442, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22543, libc.VaList(bp+144, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22447) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22548) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22469 + v3 = __ccgo_ts + 22570 } else { - v3 = __ccgo_ts + 22477 + v3 = __ccgo_ts + 22578 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133989,7 +128015,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22483, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22584, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -134019,10 +128045,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -134055,14 +128081,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22494, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22595, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22273, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22374, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22616, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -134086,16 +128112,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22262, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22363, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22273, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22374, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5203, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5229, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -134300,7 +128326,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -134356,8 +128382,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -134379,7 +128405,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -134436,10 +128462,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -134494,37 +128520,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -134549,10 +128561,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -134571,24 +128583,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -134600,8 +128612,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -134659,7 +128671,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -134741,7 +128753,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134872,7 +128884,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -135009,7 +129021,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -135154,7 +129166,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -135215,11 +129227,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -135250,6 +129262,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -135388,7 +129403,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -135468,7 +129483,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -135502,7 +129517,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -135624,7 +129639,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135817,7 +129832,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135831,12 +129846,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135874,11 +129890,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135898,7 +129914,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135934,21 +129950,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135966,7 +129982,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -136021,7 +130037,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22523, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22624, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -136044,7 +130060,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22538, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22639, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -136533,9 +130549,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -136544,14 +130560,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22547, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22648, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -136590,15 +130606,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -136610,7 +130627,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -136683,7 +130700,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -137081,19 +131098,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16727, + FzOp: __ccgo_ts + 16828, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16061, + FzOp: __ccgo_ts + 16162, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15540, + FzOp: __ccgo_ts + 15621, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22561, + FzOp: __ccgo_ts + 22662, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -137613,37 +131630,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137881,7 +131902,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22568, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22669, 0) return } } else { @@ -137893,10 +131914,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22568, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22669, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137955,7 +131976,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137977,7 +131998,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8110 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8135 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -138078,7 +132099,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22609 + v13 = __ccgo_ts + 22710 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -138609,7 +132630,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22616, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22717, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -138681,22 +132702,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138809,7 +132818,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -139725,7 +133734,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141976,13 +135986,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -142082,6 +136087,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -142095,12 +136101,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -142546,7 +136569,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -142597,15 +136620,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -142637,7 +136651,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -142656,7 +136670,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -142693,7 +136707,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -142701,7 +136715,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -142722,19 +136736,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142830,7 +136844,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -143008,7 +137022,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -143036,6 +137050,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -143112,7 +137134,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -143349,7 +137371,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22790, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143424,7 +137446,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22790, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -143578,7 +137600,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -144014,7 +138036,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22715, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22816, 0) rc = SQLITE_OK } else { break @@ -144243,17 +138265,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -145222,7 +139233,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22750, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22851, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145800,7 +139811,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145956,7 +139967,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22768, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22869, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145977,11 +139988,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -146029,7 +140037,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22796, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22897, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -146174,7 +140182,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -146208,7 +140217,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -146230,7 +140239,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -146243,7 +140252,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -146334,11 +140343,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -146365,16 +140374,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -146422,7 +140431,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -146553,7 +140562,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -146731,7 +140740,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146760,7 +140769,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146770,7 +140779,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22814, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22915, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146820,7 +140829,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -147089,7 +141098,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22843, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22944, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -147271,7 +141280,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22899, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+23000, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -147597,7 +141606,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22944, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23045, libc.VaList(bp+8, zName)) } return p } @@ -147648,12 +141657,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22963, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23064, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23034, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23135, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147726,7 +141735,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8349) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8374) } break } @@ -147757,16 +141766,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147785,17 +141784,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -147813,7 +141812,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147837,13 +141836,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147858,23 +141857,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147890,13 +141889,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -148008,7 +142007,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23097, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23198, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -148044,7 +142043,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -148059,7 +142058,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -148078,11 +142077,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -148128,11 +142127,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -148149,7 +142148,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1815)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1841)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -148171,7 +142170,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -148295,7 +142294,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23123, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23224, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -148363,18 +142362,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23155 + zErr = __ccgo_ts + 23256 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23172 + zErr = __ccgo_ts + 23273 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23188 + zErr = __ccgo_ts + 23289 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23208, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23309, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -148398,7 +142397,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23241, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23342, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -148504,24 +142503,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -148539,12 +142538,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -148556,15 +142555,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -148616,11 +142615,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23288, - 1: __ccgo_ts + 23341, - 2: __ccgo_ts + 22843, - 3: __ccgo_ts + 23392, - 4: __ccgo_ts + 23444, + 0: __ccgo_ts + 23389, + 1: __ccgo_ts + 23442, + 2: __ccgo_ts + 22944, + 3: __ccgo_ts + 23493, + 4: __ccgo_ts + 23545, } var _aOp1 = [5]int32{ @@ -148673,87 +142672,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -149200,7 +143118,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -149296,7 +143214,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -150013,12 +143931,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -150026,13 +143944,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -150052,13 +143970,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -150085,7 +144003,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -150304,6 +144222,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -150364,7 +144286,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23494, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23595, libc.VaList(bp+8, p)) } // C documentation @@ -150378,6 +144300,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -150411,11 +144334,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23518 + v1 = __ccgo_ts + 23619 } else { - v1 = __ccgo_ts + 23527 + v1 = __ccgo_ts + 23628 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23533, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23634, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -150424,7 +144347,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23575, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23676, 0) } } } @@ -150530,7 +144453,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23609, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23710, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156997,14 +150920,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -157015,16 +150930,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -157051,13 +150956,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -158172,19 +152077,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158987,20 +152892,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16878, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16979, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23647, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23748, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16791, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16915, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23647, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23748, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -159041,7 +152946,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -159186,7 +153096,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -159276,9 +153191,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -159633,7 +153548,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23674) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23775) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159973,23 +153888,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8130 + } else { + v347 = __ccgo_ts + 8135 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8105 - } else { - v347 = __ccgo_ts + 8110 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -160047,11 +153976,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -160061,9 +153990,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -160071,11 +154000,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -160173,11 +154102,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -160227,15 +154156,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23683, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23784, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23778, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23879, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23862, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23963, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -160377,7 +154306,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -160571,7 +154500,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23947, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24048, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -162697,7 +156626,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -163302,14 +157231,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -164173,22 +158105,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -164199,11 +158140,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164782,7 +158723,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164802,7 +158743,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24034, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24135, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164927,11 +158868,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -165103,14 +159044,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24577 + zErr = __ccgo_ts + 24678 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -165122,31 +159063,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24102, - 1: __ccgo_ts + 24115, - 3: __ccgo_ts + 24131, - 4: __ccgo_ts + 24156, - 5: __ccgo_ts + 24170, - 6: __ccgo_ts + 24189, + 0: __ccgo_ts + 24203, + 1: __ccgo_ts + 24216, + 3: __ccgo_ts + 24232, + 4: __ccgo_ts + 24257, + 5: __ccgo_ts + 24271, + 6: __ccgo_ts + 24290, 7: __ccgo_ts + 1665, - 8: __ccgo_ts + 24214, - 9: __ccgo_ts + 24251, - 10: __ccgo_ts + 24263, - 11: __ccgo_ts + 24278, - 12: __ccgo_ts + 24311, - 13: __ccgo_ts + 24329, - 14: __ccgo_ts + 24354, - 15: __ccgo_ts + 24383, - 17: __ccgo_ts + 6134, - 18: __ccgo_ts + 5536, - 19: __ccgo_ts + 24400, - 20: __ccgo_ts + 24418, - 21: __ccgo_ts + 24436, - 23: __ccgo_ts + 24470, - 25: __ccgo_ts + 24491, - 26: __ccgo_ts + 24517, - 27: __ccgo_ts + 24540, - 28: __ccgo_ts + 24561, + 8: __ccgo_ts + 24315, + 9: __ccgo_ts + 24352, + 10: __ccgo_ts + 24364, + 11: __ccgo_ts + 24379, + 12: __ccgo_ts + 24412, + 13: __ccgo_ts + 24430, + 14: __ccgo_ts + 24455, + 15: __ccgo_ts + 24484, + 17: __ccgo_ts + 6158, + 18: __ccgo_ts + 5562, + 19: __ccgo_ts + 24501, + 20: __ccgo_ts + 24519, + 21: __ccgo_ts + 24537, + 23: __ccgo_ts + 24571, + 25: __ccgo_ts + 24592, + 26: __ccgo_ts + 24618, + 27: __ccgo_ts + 24641, + 28: __ccgo_ts + 24662, } // C documentation @@ -165240,15 +159181,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -165256,6 +159199,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -165263,10 +159208,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -165293,6 +159238,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -165320,12 +159279,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -165343,9 +159302,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -165368,13 +159327,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24658, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24759, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -165392,15 +159351,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -165415,27 +159374,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -165446,30 +159405,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -165494,7 +159483,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24721, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24822, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -165525,13 +159514,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -165542,43 +159533,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -165589,12 +159584,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -165606,6 +159601,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -165613,82 +159610,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -165732,18 +159739,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165769,7 +159778,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -165779,7 +159788,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24772, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24873, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165901,7 +159910,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166033,7 +160042,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166043,7 +160052,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -166079,7 +160088,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -166092,7 +160101,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -166101,7 +160110,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24793, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24894, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -166136,9 +160145,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -166248,7 +160257,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24861, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24962, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -166278,8 +160287,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24867, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24877, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24968, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24978, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -166368,24 +160377,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24905, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+25006, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24909, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+25010, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24909 + zModeType = __ccgo_ts + 25010 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24930, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25031, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3501 + zModeType = __ccgo_ts + 3527 } if aMode != 0 { mode = 0 @@ -166414,12 +160423,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24945, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25046, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24965, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25066, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -166443,7 +160452,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24989, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25090, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -166463,11 +160472,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24915, + Fz: __ccgo_ts + 25016, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24922, + Fz: __ccgo_ts + 25023, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -166478,19 +160487,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24935, + Fz: __ccgo_ts + 25036, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24938, + Fz: __ccgo_ts + 25039, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24941, + Fz: __ccgo_ts + 25042, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17948, + Fz: __ccgo_ts + 18049, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -166618,8 +160627,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22609, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+25005, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22710, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25106, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -166640,10 +160649,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4287 + zFilename = __ccgo_ts + 4313 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -166652,7 +160661,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3892 + v2 = __ccgo_ts + 3918 } else { v2 = uintptr(0) } @@ -166679,9 +160688,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6743 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6768 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24007 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24108 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166775,7 +160784,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 25011 + zFilename = __ccgo_ts + 25112 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166794,36 +160803,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166831,7 +160848,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166839,31 +160856,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166897,12 +160918,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166935,10 +160958,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166949,7 +160972,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166992,20 +161015,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+25014, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25115, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25039) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25140) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25059) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25160) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25066) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25167) } // C documentation @@ -167030,9 +161053,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -167059,29 +161082,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -167136,15 +161148,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25083, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25184, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3892 + v2 = __ccgo_ts + 3918 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -167323,8 +161335,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167768,7 +161780,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -168164,7 +162176,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25111, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25212, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -168312,6 +162324,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -168335,7 +162349,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -168345,7 +162359,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -168357,7 +162371,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -168373,7 +162387,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -168382,7 +162396,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25119 + v2 = __ccgo_ts + 25220 } else { v2 = uintptr(0) } @@ -168461,7 +162475,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -168628,7 +162642,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168845,6 +162859,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -169157,8 +163178,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -169215,7 +163236,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -169225,7 +163246,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -169263,18 +163284,18 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // */ var _jsonbType = [17]uintptr{ 0: __ccgo_ts + 1681, - 1: __ccgo_ts + 8105, - 2: __ccgo_ts + 8110, - 3: __ccgo_ts + 6419, - 4: __ccgo_ts + 6419, - 5: __ccgo_ts + 6414, - 6: __ccgo_ts + 6414, - 7: __ccgo_ts + 8416, - 8: __ccgo_ts + 8416, - 9: __ccgo_ts + 8416, - 10: __ccgo_ts + 8416, - 11: __ccgo_ts + 25142, - 12: __ccgo_ts + 25148, + 1: __ccgo_ts + 8130, + 2: __ccgo_ts + 8135, + 3: __ccgo_ts + 6444, + 4: __ccgo_ts + 6444, + 5: __ccgo_ts + 6439, + 6: __ccgo_ts + 6439, + 7: __ccgo_ts + 8441, + 8: __ccgo_ts + 8441, + 9: __ccgo_ts + 8441, + 10: __ccgo_ts + 8441, + 11: __ccgo_ts + 25243, + 12: __ccgo_ts + 25249, 13: __ccgo_ts + 1695, 14: __ccgo_ts + 1695, 15: __ccgo_ts + 1695, @@ -169582,106 +163603,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169761,7 +163682,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -170059,8 +163980,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25155 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 25155 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1717 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1717 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -170196,7 +164117,7 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { case int32(SQLITE_NULL): _jsonAppendRawNZ(tls, p, __ccgo_ts+1681, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15510, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15564, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -170210,14 +164131,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25172, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25256, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -170271,7 +164190,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25285, -int32(1)) } } } @@ -170554,8 +164473,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25216, - FzRepl: __ccgo_ts + 25220, + FzMatch: __ccgo_ts + 25300, + FzRepl: __ccgo_ts + 25304, }, 1: { Fc1: int8('i'), @@ -170563,8 +164482,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 25228, - FzRepl: __ccgo_ts + 25220, + FzMatch: __ccgo_ts + 25312, + FzRepl: __ccgo_ts + 25304, }, 2: { Fc1: int8('n'), @@ -170579,7 +164498,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25237, + FzMatch: __ccgo_ts + 25321, FzRepl: __ccgo_ts + 1681, }, 4: { @@ -170587,7 +164506,7 @@ var _aNanInfName = [5]TNanInfName{ Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 25242, + FzMatch: __ccgo_ts + 25326, FzRepl: __ccgo_ts + 1681, }, } @@ -170603,7 +164522,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25247, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25331, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -170621,23 +164540,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -170715,7 +164634,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170786,7 +164705,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -171061,7 +164984,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25290, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25374, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -171491,7 +165414,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(libc.Uint8FromInt8(c)) && int32(0x80) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == libc.Int32FromUint8(libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -171530,7 +165453,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8105, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8130, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171538,7 +165461,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8110, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8135, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -171615,14 +165538,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25216, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25300, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25299) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25383) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25306) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25390) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25312, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25396, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171807,7 +165730,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25306) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25390) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171852,7 +165775,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25285, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171865,7 +165788,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25285, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171914,10 +165837,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171951,15 +165870,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -172032,11 +165951,11 @@ _2: return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8105, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8130, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8110, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8135, uint32(5)) return i + uint32(1) _6: ; @@ -172085,9 +166004,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25220 + v19 = __ccgo_ts + 25304 } else { - v19 = __ccgo_ts + 11972 + v19 = __ccgo_ts + 12026 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -172123,9 +166042,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -172152,7 +166074,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25318, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25402, uint32(2)) zIn2++ sz2-- continue @@ -172175,7 +166097,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25321, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25405, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -172183,12 +166105,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25328, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25412, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25333, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25417, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -172291,16 +166213,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -172368,7 +166280,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25340, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25424, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172391,12 +166303,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25343, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25427, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25340, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25424, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -172411,50 +166323,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -172506,6 +166374,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -172526,6 +166472,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -172598,9 +166547,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -172643,7 +166592,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[libc.Uint8FromInt8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -173131,7 +167091,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25285, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -173266,7 +167226,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -173367,7 +167327,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25285, -int32(1)) return } @@ -173404,11 +167364,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25172, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25256, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -173421,7 +167378,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -173440,10 +167397,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25306) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25390) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25299) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25383) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -173482,7 +167439,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25346, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25430, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -173498,7 +167455,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -173579,7 +167536,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -173591,34 +167548,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -173701,7 +167678,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173761,7 +167738,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173896,7 +167873,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25364 + v1 = __ccgo_ts + 25448 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173906,7 +167883,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) } } eErr = uint8(1) @@ -174016,23 +167993,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25366, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25450, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25368, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25452, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5258, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5284, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1708, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1734, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25370, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25454, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25373, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25457, uint32(1)) } } } @@ -174072,7 +168049,7 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -174340,7 +168317,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -174364,7 +168341,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25375, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25459, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -174375,7 +168352,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25426, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25510, -int32(1)) _jsonStringReset(tls, bp) return } @@ -174447,7 +168424,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) } } goto json_remove_done @@ -174484,7 +168461,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15983) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16084) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -174515,9 +168492,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25460 + v1 = __ccgo_ts + 25544 } else { - v1 = __ccgo_ts + 25464 + v1 = __ccgo_ts + 25548 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -174565,7 +168542,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25201, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25285, -int32(1)) } } goto json_type_done @@ -174612,7 +168589,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25471 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25555 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -174686,17 +168663,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25476, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25560, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -174705,18 +168681,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174778,9 +168753,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174887,7 +168860,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25533, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25617, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174979,20 +168952,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -175036,7 +169011,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25536, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25620, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -175064,16 +169039,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -175092,24 +169057,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -175117,13 +169064,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -175139,7 +169079,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25539) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25623) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -175273,7 +169213,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25622, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25706, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -175299,9 +169239,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25629, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25713, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25637, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25721, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -175612,9 +169552,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -175687,7 +169626,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25643, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25727, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -175711,7 +169650,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25201, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25285, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175772,186 +169711,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25645, + FzName: __ccgo_ts + 25729, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25650, + FzName: __ccgo_ts + 25734, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25656, + FzName: __ccgo_ts + 25740, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25667, + FzName: __ccgo_ts + 25751, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25679, + FzName: __ccgo_ts + 25763, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25679, + FzName: __ccgo_ts + 25763, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25697, + FzName: __ccgo_ts + 25781, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25717, + FzName: __ccgo_ts + 25801, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25730, + FzName: __ccgo_ts + 25814, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25744, + FzName: __ccgo_ts + 25828, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25747, + FzName: __ccgo_ts + 25831, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25751, + FzName: __ccgo_ts + 25835, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25763, + FzName: __ccgo_ts + 25847, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25776, + FzName: __ccgo_ts + 25860, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25788, + FzName: __ccgo_ts + 25872, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25801, + FzName: __ccgo_ts + 25885, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25812, + FzName: __ccgo_ts + 25896, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25824, + FzName: __ccgo_ts + 25908, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25824, + FzName: __ccgo_ts + 25908, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25836, + FzName: __ccgo_ts + 25920, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25847, + FzName: __ccgo_ts + 25931, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25859, + FzName: __ccgo_ts + 25943, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25872, + FzName: __ccgo_ts + 25956, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25885, + FzName: __ccgo_ts + 25969, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25899, + FzName: __ccgo_ts + 25983, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25908, + FzName: __ccgo_ts + 25992, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25918, + FzName: __ccgo_ts + 26002, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25918, + FzName: __ccgo_ts + 26002, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25928, + FzName: __ccgo_ts + 26012, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25928, + FzName: __ccgo_ts + 26012, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25939, + FzName: __ccgo_ts + 26023, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25956, + FzName: __ccgo_ts + 26040, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25974, + FzName: __ccgo_ts + 26058, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25992, + FzName: __ccgo_ts + 26076, }, } @@ -176034,17 +169973,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 26011, + FzName: __ccgo_ts + 26095, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 26021, + FzName: __ccgo_ts + 26105, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -176094,224 +170035,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -176329,33 +170055,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -176366,79 +170086,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -176515,7 +170220,7 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*Ti64)(unsafe.Pointer(bp)) = _i - *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp))))) + *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, uint64(libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp)))))) libc.Xmemcpy(tls, p, bp, uint64(8)) return int32(8) } @@ -176621,7 +170326,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -176684,7 +170389,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26031, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26115, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -176695,7 +170400,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176989,7 +170694,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26036, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26120, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -177526,7 +171231,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177906,7 +171611,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26118) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26202) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177984,7 +171689,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -178215,7 +171920,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -178223,7 +171928,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -178461,7 +172166,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178883,7 +172588,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -179392,11 +173097,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179409,11 +173114,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -179441,7 +173146,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26132, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26216, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -179451,11 +173156,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26152, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26236, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26184, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26268, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -179669,7 +173374,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26221, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26305, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -179723,9 +173428,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26366 + zFmt = __ccgo_ts + 26450 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11801, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11855, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179783,9 +173488,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26422, - 1: __ccgo_ts + 5597, - 2: __ccgo_ts + 16878, + 0: __ccgo_ts + 26506, + 1: __ccgo_ts + 5623, + 2: __ccgo_ts + 16979, } var _rtreeModule = Tsqlite3_module{ @@ -179829,21 +173534,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26836, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26920, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26898, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26982, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26903, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26967, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27037, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26987, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27051, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27121, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179873,7 +173578,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27086 + zFormat = __ccgo_ts + 27170 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179888,31 +173593,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27194, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27278, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27239, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27323, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13309, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13363, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27266, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27350, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27288, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27372, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27296, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27380, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179926,14 +173631,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26427, - 1: __ccgo_ts + 26480, - 2: __ccgo_ts + 26525, - 3: __ccgo_ts + 26577, - 4: __ccgo_ts + 26631, - 5: __ccgo_ts + 26676, - 6: __ccgo_ts + 26734, - 7: __ccgo_ts + 26789, + 0: __ccgo_ts + 26511, + 1: __ccgo_ts + 26564, + 2: __ccgo_ts + 26609, + 3: __ccgo_ts + 26661, + 4: __ccgo_ts + 26715, + 5: __ccgo_ts + 26760, + 6: __ccgo_ts + 26818, + 7: __ccgo_ts + 26873, } // C documentation @@ -179991,7 +173696,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27312, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27396, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179999,17 +173704,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27332, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27416, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -180072,7 +173777,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -180086,13 +173791,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27575, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27659, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27581, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27665, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -180101,7 +173806,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27605, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27689, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -180115,19 +173820,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27632, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27716, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -180150,7 +173855,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -180161,7 +173866,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -180177,8 +173882,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27611, - 1: __ccgo_ts + 27622, + 0: __ccgo_ts + 27695, + 1: __ccgo_ts + 27706, } // C documentation @@ -180236,21 +173941,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11421, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11475, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27635, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27719, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27641, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27725, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27645, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27729, int32(1)) goto _1 _1: ; @@ -180277,7 +173982,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27647, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27731, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -180311,23 +174016,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -180380,7 +174068,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -180395,11 +174083,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4300 + v1 = __ccgo_ts + 4326 } else { v1 = __ccgo_ts + 1695 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27680, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27764, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -180433,7 +174121,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27687, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27771, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -180450,7 +174138,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27732, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27816, libc.VaList(bp+8, iNode)) } } return pRet @@ -180479,8 +174167,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27764, - 1: __ccgo_ts + 27818, + 0: __ccgo_ts + 27848, + 1: __ccgo_ts + 27902, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -180493,21 +174181,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27866 + v1 = __ccgo_ts + 27950 } else { - v1 = __ccgo_ts + 27874 + v1 = __ccgo_ts + 27958 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27883, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27967, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27866 + v2 = __ccgo_ts + 27950 } else { - v2 = __ccgo_ts + 27874 + v2 = __ccgo_ts + 27958 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27928, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28012, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -180552,7 +174240,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27986, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28070, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -180570,7 +174258,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28034, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28118, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -180603,19 +174291,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28101, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28185, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28135, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28165, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28249, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -180660,12 +174348,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28220, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28304, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28251, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28335, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -180694,7 +174382,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28318, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28402, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -180704,11 +174392,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26132, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26216, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28346, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28430, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -180724,8 +174412,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28377, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28384, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28461, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28468, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180752,7 +174440,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28392, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28476, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180803,13 +174491,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28411, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28495, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6743 + zDb = __ccgo_ts + 6768 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180818,7 +174506,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18645 + v1 = __ccgo_ts + 18746 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180912,14 +174600,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180944,16 +174624,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -181085,7 +174755,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -181130,7 +174800,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && int32(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -181192,7 +174862,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -181560,7 +175230,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -181575,9 +175245,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -181662,7 +175332,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -181736,13 +175406,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181803,7 +175466,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181842,7 +175505,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181946,7 +175609,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181977,36 +175640,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -182030,7 +175663,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -182314,7 +175947,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -182471,7 +176104,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -182483,13 +176116,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27575, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27659, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28535, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28619, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -182498,13 +176131,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28557, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28641, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27632, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27716, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -182512,7 +176145,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -182527,7 +176160,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182739,7 +176372,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16878 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16979 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -182749,7 +176382,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28561 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28645 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182757,7 +176390,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28567 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28651 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182877,7 +176510,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28576, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28660, 0) } goto geopoly_update_end } @@ -182977,16 +176610,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28616) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28700) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28632) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28716) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -183056,7 +176689,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28809, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28893, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -183070,61 +176703,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28647, + FzName: __ccgo_ts + 28731, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28660, + FzName: __ccgo_ts + 28744, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28673, + FzName: __ccgo_ts + 28757, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28686, + FzName: __ccgo_ts + 28770, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28632, + FzName: __ccgo_ts + 28716, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28698, + FzName: __ccgo_ts + 28782, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28616, + FzName: __ccgo_ts + 28700, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28721, + FzName: __ccgo_ts + 28805, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28735, + FzName: __ccgo_ts + 28819, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28748, + FzName: __ccgo_ts + 28832, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28762, + FzName: __ccgo_ts + 28846, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28778, + FzName: __ccgo_ts + 28862, }, } @@ -183150,7 +176783,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28790, + FzName: __ccgo_ts + 28874, }, } @@ -183175,20 +176808,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28817, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28901, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28827, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28911, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28838, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28922, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28561, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28645, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28849, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28933, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -183262,7 +176895,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -183290,17 +176923,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26118, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26202, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -183308,33 +176943,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -183531,7 +177170,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183952,248 +177591,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -184507,7 +177904,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28859, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28943, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -184517,7 +177914,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28859, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28943, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -184543,7 +177940,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -184566,7 +177963,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -184698,7 +178095,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28880, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28964, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184787,7 +178184,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26031, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26115, zIn, uint64(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184824,13 +178221,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29051 + v1 = __ccgo_ts + 29135 } else { v1 = __ccgo_ts + 1695 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29092, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29176, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29242) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29326) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184997,7 +178394,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -185058,7 +178455,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29367, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29451, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -185068,7 +178465,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29486, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29570, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -185076,7 +178473,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29507, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29591, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -185088,7 +178485,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29558, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29642, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -185132,7 +178529,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29579, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185145,7 +178542,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29607, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29691, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -185198,7 +178595,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20153, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20254, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -185209,7 +178606,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29636, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29720, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -185220,7 +178617,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29655, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29739, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -185228,7 +178625,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29660, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29744, zName) { bRbuRowid = int32(1) } } @@ -185242,17 +178639,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29670 + v4 = __ccgo_ts + 29754 } else { - v4 = __ccgo_ts + 29683 + v4 = __ccgo_ts + 29767 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29776, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29721, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29805, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185274,7 +178671,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29743, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29827, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -185320,8 +178717,8 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29770, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15177 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29854, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15231 goto _1 _1: ; @@ -185355,7 +178752,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29779, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29863, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -185403,21 +178800,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29792, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29876, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29824, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29908, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1695, __ccgo_ts+15177, __ccgo_ts+29847) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29853, __ccgo_ts+29860, __ccgo_ts+5203) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1695, __ccgo_ts+15177, __ccgo_ts+1695) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1695, __ccgo_ts+15231, __ccgo_ts+29931) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29937, __ccgo_ts+29944, __ccgo_ts+5229) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1695, __ccgo_ts+15231, __ccgo_ts+1695) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29868, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29952, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29910, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -185469,7 +178866,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zSep = __ccgo_ts + 1695 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29607, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29691, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -185491,15 +178888,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29930 + zCol = __ccgo_ts + 30014 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29938, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29959, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29995, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15177 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+30022, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30043, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30079, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15231 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -185508,7 +178905,7 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30022, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30106, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { zSep = __ccgo_ts + 1695 iCol = 0 @@ -185525,15 +178922,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30070, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15177 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30154, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15231 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30077, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30161, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -185591,7 +178988,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zAnd = __ccgo_ts + 1695 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29607, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29691, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -185600,7 +178997,7 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30089, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30173, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) zType = __ccgo_ts + 1695 } else { if iCid < 0 { @@ -185620,9 +179017,9 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29930 + zCol = __ccgo_ts + 30014 } else { - zCol = __ccgo_ts + 29660 + zCol = __ccgo_ts + 29744 } } zType = __ccgo_ts + 1169 @@ -185630,24 +179027,24 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30111, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30195, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29847 + v2 = __ccgo_ts + 29931 } else { v2 = __ccgo_ts + 1695 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30131, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30215, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30152, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30185, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30236, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30269, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15177 - zAnd = __ccgo_ts + 22262 + zCom = __ccgo_ts + 15231 + zAnd = __ccgo_ts + 22363 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -185701,11 +179098,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30209, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30293, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30221, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30305, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15177 + zS = __ccgo_ts + 15231 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -185717,7 +179114,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30230, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30314, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185743,7 +179140,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30245, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30329, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { zSep = __ccgo_ts + 1695 @@ -185753,15 +179150,15 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30259, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22262 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30343, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22363 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30271, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30355, libc.VaList(bp+8, zList)) } else { zSep1 = __ccgo_ts + 1695 i1 = 0 @@ -185771,8 +179168,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30321, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22262 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30405, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22363 } goto _2 _2: @@ -185795,7 +179192,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30334, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30418, 0) } // C documentation @@ -185837,16 +179234,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30321, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15177 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30405, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15231 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30360, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15177 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30444, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15231 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30390, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15177 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30474, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15231 } } } @@ -185930,16 +179327,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30427 + zSep = __ccgo_ts + 30511 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29579, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16766) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16867) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29607, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29691, libc.VaList(bp+24, zIdx))) } break } @@ -185950,16 +179347,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29847 + v1 = __ccgo_ts + 29931 } else { v1 = __ccgo_ts + 1695 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30440, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15177 + z = _rbuMPrintf(tls, p, __ccgo_ts+30524, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15231 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30451, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30535, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -186005,7 +179402,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30455) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30539) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -186013,7 +179410,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29607, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29691, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -186022,21 +179419,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30589, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29847 + v1 = __ccgo_ts + 29931 } else { v1 = __ccgo_ts + 1695 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30527, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15177 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30611, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15231 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30537, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30621, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30552, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30636, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, 0, 0)) } } @@ -186073,7 +179470,7 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum zComma = __ccgo_ts + 1695 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -186082,19 +179479,19 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { zPk = __ccgo_ts + 1695 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30614 + zPk = __ccgo_ts + 30698 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30627 + v2 = __ccgo_ts + 30711 } else { v2 = __ccgo_ts + 1695 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30637, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15177 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30721, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15231 goto _1 _1: ; @@ -186103,17 +179500,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30664, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30748, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30671 + v3 = __ccgo_ts + 30755 } else { v3 = __ccgo_ts + 1695 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30686, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30770, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, 0, 0)) } } @@ -186139,7 +179536,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30718, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30802, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -186185,7 +179582,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30775) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30859) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -186354,7 +179751,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30841, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30925, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -186371,18 +179768,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30861, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30945, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30926, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31010, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30962, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31046, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186397,26 +179794,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30996 + v2 = __ccgo_ts + 31080 } else { - v2 = __ccgo_ts + 31000 + v2 = __ccgo_ts + 31084 } v1 = v2 } else { v1 = __ccgo_ts + 1695 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31006, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31090, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31067, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31151, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30996 + v3 = __ccgo_ts + 31080 } else { - v3 = __ccgo_ts + 31000 + v3 = __ccgo_ts + 31084 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31128, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31212, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -186435,8 +179832,8 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6754) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6750) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6779) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6775) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ @@ -186445,39 +179842,39 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { v4 = __ccgo_ts + 1695 } else { - v4 = __ccgo_ts + 31287 + v4 = __ccgo_ts + 31371 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31296 + v5 = __ccgo_ts + 31380 } else { v5 = __ccgo_ts + 1695 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31306, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31390, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31342, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31426, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { zRbuRowid = __ccgo_ts + 1695 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31370 + zRbuRowid = __ccgo_ts + 31454 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31382 + v6 = __ccgo_ts + 31466 } else { v6 = __ccgo_ts + 1695 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31399, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31475, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31483, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31559, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31774, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31858, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } @@ -186488,9 +179885,9 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31873 + v7 = __ccgo_ts + 31957 } else { - v7 = __ccgo_ts + 31883 + v7 = __ccgo_ts + 31967 } zRbuRowid1 = v7 } @@ -186503,14 +179900,14 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29930, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30014, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1695, __ccgo_ts+15177, __ccgo_ts+1695) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1695, __ccgo_ts+15231, __ccgo_ts+1695) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31894 + v8 = __ccgo_ts + 31978 } else { v8 = __ccgo_ts + 1695 } @@ -186520,11 +179917,11 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 v9 = __ccgo_ts + 1695 } if zOrder != 0 { - v10 = __ccgo_ts + 23518 + v10 = __ccgo_ts + 23619 } else { v10 = __ccgo_ts + 1695 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31900, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31984, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -186612,9 +180009,9 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p if zSet != 0 { zPrefix = __ccgo_ts + 1695 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31287 + zPrefix = __ccgo_ts + 31371 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31948, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32032, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -186641,7 +180038,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -186688,7 +180085,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31978, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32062, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -186747,27 +180144,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6743, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6768, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6743) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32008, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6768) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32092, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32036, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3515, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32120, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3541, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6743, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6768, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32054, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32138, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6743, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6768, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186800,10 +180197,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32120, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32204, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24861, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24962, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186819,14 +180216,14 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) if zExtra == uintptr(0) { v2 = __ccgo_ts + 1695 } else { - v2 = __ccgo_ts + 32152 + v2 = __ccgo_ts + 32236 } if zExtra == uintptr(0) { v3 = __ccgo_ts + 1695 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32154, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6743), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32238, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6768), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186837,27 +180234,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32186, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32270, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32201, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32285, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32218, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32302, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32234, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32318, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32262, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32346, 0) } } @@ -186907,7 +180304,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -187009,7 +180406,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -187039,7 +180436,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -187082,12 +180479,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -187109,21 +180506,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6743, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6768, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6743, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6768, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6743, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6768, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6743, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6768, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -187140,7 +180537,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32315, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32399, 0) } // C documentation @@ -187157,13 +180554,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6743) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6768) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32340, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32347, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32424, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32431, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -187295,7 +180692,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24418, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24519, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -187431,7 +180828,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32354) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32438) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -187444,7 +180841,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32376, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32460, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -187471,7 +180868,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32487, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -187507,9 +180904,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32563, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32647, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32578, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32662, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -187532,9 +180929,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32598, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32682, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32623) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32707) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187545,10 +180942,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32731) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32815) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32796) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32880) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -187566,7 +180963,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32840, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32924, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -187593,8 +180990,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17851) - _rbuCopyPragma(tls, p, __ccgo_ts+16962) + _rbuCopyPragma(tls, p, __ccgo_ts+17952) + _rbuCopyPragma(tls, p, __ccgo_ts+17063) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -187602,7 +180999,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32865, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32949, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -187624,10 +181021,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15081, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15135, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15081, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15135, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -187641,10 +181038,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -187714,7 +181111,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32893, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32977, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187737,10 +181134,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32340, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32424, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6743, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6768, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187762,7 +181159,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32918, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+33002, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187809,7 +181206,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32929, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+33013, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187854,11 +181251,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33001, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33085, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33015) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33099) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187867,7 +181264,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33072) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33156) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187915,7 +181312,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3892, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3918, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187947,7 +181344,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33146, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33230, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187969,17 +181366,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33178 + v3 = __ccgo_ts + 33262 } else { - v3 = __ccgo_ts + 33185 + v3 = __ccgo_ts + 33269 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33192, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33276, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15066, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15120, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187991,21 +181388,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17565) - _rbuCopyPragma(tls, p, __ccgo_ts+16977) + _rbuCopyPragma(tls, p, __ccgo_ts+17666) + _rbuCopyPragma(tls, p, __ccgo_ts+17078) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33224, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33308, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6743, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6768, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33240, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33324, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -188083,7 +181480,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33264, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33348, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -188130,7 +181527,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31287, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31371, uint64(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -188158,16 +181555,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15081, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15135, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15081, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15135, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -188177,7 +181574,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33272, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33356, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -188278,32 +181675,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15081, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15135, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15081, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15135, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15066 + v1 = __ccgo_ts + 15120 } else { - v1 = __ccgo_ts + 33224 + v1 = __ccgo_ts + 33308 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33224, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33308, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -188329,9 +181726,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -188403,7 +181802,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -188606,7 +182005,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -188657,14 +182056,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -190240,7 +183578,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33367, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33451, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -190263,13 +183601,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33375 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33459 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33384 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33468 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33389 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33473 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -190278,7 +183616,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -190367,12 +183705,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33399, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33483, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33554, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33638, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33568, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33652, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -190449,7 +183787,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33583, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33667, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -190589,315 +183927,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -191650,7 +184679,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -191743,11 +184772,11 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11801, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11855, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33590, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33674, 0) } else { if rc == int32(SQLITE_ERROR) { zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1695, 0) @@ -191756,7 +184785,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33720, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33804, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191782,10 +184811,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29930)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+30014))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -191806,8 +184835,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29930) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29930, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+30014) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+30014, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191871,7 +184900,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191888,6 +184917,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191909,12 +184940,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11801, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11855, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -192204,10 +185235,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11421 + zSep = __ccgo_ts + 11475 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33750, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33834, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -192219,8 +185250,8 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin v2 = __ccgo_ts + 1696 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5173, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15177 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5199, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15231 goto _1 _1: ; @@ -192301,13 +185332,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -192799,14 +185823,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192874,8 +185890,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33757, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22262 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33841, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22363 if zRet == uintptr(0) { break } @@ -192904,8 +185920,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33791, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33832 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33875, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33916 if zRet == uintptr(0) { break } @@ -192916,7 +185932,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1815, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1841, 0) } return zRet } @@ -192927,12 +185943,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33837 + v1 = __ccgo_ts + 33921 } else { - v1 = __ccgo_ts + 6748 + v1 = __ccgo_ts + 6773 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33848, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33932, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192993,11 +186009,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15177 + v2 = __ccgo_ts + 15231 } else { v2 = __ccgo_ts + 1695 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33927, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+34011, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -193025,7 +186041,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33946, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34030, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -193054,17 +186070,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -193077,7 +186094,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -193088,18 +186107,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34087, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34118, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -193125,7 +186170,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34003, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34139, 0) } rc = int32(SQLITE_SCHEMA) } @@ -193173,7 +186218,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -193285,15 +186330,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -193457,7 +186504,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5235, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5261, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193757,12 +186804,12 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34030, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11801, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34034, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34058, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34067, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34112, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34166, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11855, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34170, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34194, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34203, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34248, bp) } else { i = 0 for { @@ -193770,17 +186817,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15177, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15231, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15177 + zSep = __ccgo_ts + 15231 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34126, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34262, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34130, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34266, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193794,7 +186841,7 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt } else { v2 = __ccgo_ts + 1695 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34157, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34293, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193915,7 +186962,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193929,14 +186976,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34199, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34335, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194005,8 +187052,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -194031,18 +187078,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34219, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34355, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -194066,28 +187113,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -194226,7 +187277,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -194241,9 +187292,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -194272,20 +187323,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -194297,13 +187352,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -194459,7 +187515,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -194483,7 +187539,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -194498,7 +187554,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -194554,7 +187610,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -194659,7 +187715,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194730,8 +187786,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194765,7 +187821,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194775,7 +187831,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194854,7 +187910,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -195115,7 +188171,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -195192,7 +188248,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -195264,11 +188320,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -195280,8 +188336,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -195309,12 +188365,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -195322,9 +188382,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -195337,14 +188397,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -195368,29 +188420,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -195467,7 +188496,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11801) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11855) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) @@ -195476,9 +188505,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34237, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34373, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34250, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34386, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -195488,9 +188517,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34256, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34392, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15177 + zSep = __ccgo_ts + 15231 } goto _2 _2: @@ -195499,7 +188528,7 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } /* Create the WHERE clause part of the UPDATE */ zSep = __ccgo_ts + 1695 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34261, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34397, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -195508,13 +188537,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34269, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34405, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34344, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34480, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22262 + zSep = __ccgo_ts + 22363 } goto _3 _3: @@ -195601,9 +188630,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34350, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34486, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34261, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34397, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -195613,9 +188642,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34256, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34392, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22262 + zSep = __ccgo_ts + 22363 } goto _1 _1: @@ -195623,9 +188652,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34368, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34504, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33832, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+33916, bp) zSep = __ccgo_ts + 1695 i = 0 for { @@ -195635,16 +188664,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34344, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34480, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34376 + zSep = __ccgo_ts + 34512 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5203, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5229, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -195670,7 +188699,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6743, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6768, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -195693,16 +188722,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34381, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34517, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22268, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15177, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15231, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -195710,19 +188739,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34399, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34535, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34410, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34546, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5203, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5229, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -195745,12 +188774,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11801, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11855, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34414) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34550) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34527) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34663) } return rc } @@ -195794,7 +188823,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195812,11 +188841,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195993,7 +189022,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -196017,7 +189046,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -196032,7 +189061,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -196083,7 +189112,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -196123,10 +189152,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -196164,11 +189193,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -196191,7 +189220,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -196210,7 +189239,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -196219,7 +189248,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -196229,10 +189258,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34671, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34807, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -196242,10 +189271,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34692, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34828, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -196258,7 +189287,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -196285,7 +189314,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -196313,7 +189342,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -196345,15 +189374,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34711, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34847, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34737, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34873, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -196377,9 +189406,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -196389,7 +189418,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6743, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6768, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -196408,18 +189437,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34767, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34903, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34811, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34947, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34882, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+35018, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11801) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11855) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -196453,7 +189482,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -196462,7 +189491,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -196470,23 +189499,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34942, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35078, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34972, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35108, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34996, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34972, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35132, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35108, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -196509,13 +189538,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -196524,11 +189557,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196536,10 +189573,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -196547,37 +189590,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -196600,7 +189635,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196970,7 +190005,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -197153,7 +190188,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -197188,8 +190223,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -197208,9 +190243,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -197262,7 +190297,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -197298,11 +190333,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -197315,18 +190356,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -197334,13 +190377,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -197382,12 +190427,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -197395,27 +190446,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -197570,7 +190612,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -197678,8 +190720,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -197691,9 +190733,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -197767,21 +190809,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197887,6 +190933,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197932,24 +190979,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -198008,99 +191043,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -198122,14 +191064,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -198141,29 +191075,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -198219,15 +191136,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -198249,14 +191157,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -198327,7 +191227,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -198355,27 +191254,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -198406,7 +191296,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198942,14 +191832,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198960,16 +191842,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -199021,10 +191893,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -199130,12 +192002,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -199210,7 +192082,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35024, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -199566,7 +192438,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35052, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35188, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -199722,18 +192594,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199816,22 +192676,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199850,7 +192694,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35083, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35219, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199949,7 +192793,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35090 + zErr = __ccgo_ts + 35226 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200009,16 +192853,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -200037,7 +192871,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -200204,7 +193038,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35140 + zErr = __ccgo_ts + 35276 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -200386,15 +193220,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -200475,7 +193300,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -200567,13 +193392,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -200599,13 +193424,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35188 + z = __ccgo_ts + 35324 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35244 + z1 = __ccgo_ts + 35380 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -200638,19 +193463,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35302, + FzFunc: __ccgo_ts + 35438, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35310, + FzFunc: __ccgo_ts + 35446, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35320, + FzFunc: __ccgo_ts + 35456, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35325, + FzFunc: __ccgo_ts + 35461, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -201038,7 +193863,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -201125,21 +193950,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -201448,13 +194258,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -201514,7 +194317,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35341, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35477, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -201540,12 +194343,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35348, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35484, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35379, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35515, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201554,7 +194357,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35412, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35548, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -201564,14 +194367,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35585, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35458, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35594, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -201598,7 +194401,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35491, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35627, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -201610,76 +194413,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35525, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35661, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35533, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35565, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35701, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35571, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35707, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35590, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35726, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35769, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35590, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35726, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35655, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35791, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35669, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35805, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35707, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35843, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35718, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35854, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35753, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35889, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35760, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35896, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5612, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5638, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8437, + FzName: __ccgo_ts + 8462, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17931, + FzName: __ccgo_ts + 18032, }, 2: { - FzName: __ccgo_ts + 35791, + FzName: __ccgo_ts + 35927, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -201687,20 +194490,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35799, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35935, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35830, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35966, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35840, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35976, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35874, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36010, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201761,16 +194564,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35902) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16878) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36038) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16979) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36043, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35937) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36073) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35947, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36083, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201796,7 +194599,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35978, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36114, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201804,12 +194607,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35983, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36119, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35990, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36126, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35998, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36134, 0) } } goto _1 @@ -201825,9 +194628,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36005, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36141, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35998, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36134, 0) } goto _2 _2: @@ -201890,8 +194693,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35902) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36013, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36038) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36149, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201922,7 +194725,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36042, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36178, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { @@ -201952,7 +194755,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36062, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36198, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201960,37 +194763,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36112, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36248, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36167, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36303, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35525 + zTail = __ccgo_ts + 35661 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35525 + zTail = __ccgo_ts + 35661 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36220 + zTail = __ccgo_ts + 36356 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36228, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36364, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16878, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16979, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -202059,7 +194862,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36239, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36375, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { @@ -202068,16 +194871,16 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { if i == 0 { v2 = __ccgo_ts + 1695 } else { - v2 = __ccgo_ts + 15177 + v2 = __ccgo_ts + 15231 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36255, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36391, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36262, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35902)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36398, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36038)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -202110,7 +194913,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -202120,9 +194923,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -202235,7 +195038,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36288) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36424) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -202246,7 +195049,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36293) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36429) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -202257,7 +195060,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36302) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36438) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -202271,7 +195074,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36312) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36448) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -202282,7 +195085,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36322) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36458) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -202299,7 +195102,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36334) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36470) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -202314,7 +195117,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35902) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36038) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -202329,7 +195132,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36346) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36482) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -202345,7 +195148,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36360) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36496) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -202388,7 +195191,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36370 + zSelect = __ccgo_ts + 36506 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -202408,7 +195211,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36402) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36538) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -202419,7 +195222,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36410, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36546, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -202484,112 +195287,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -202665,7 +195362,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36481, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36617, 0) return FTS5_EOF } goto _1 @@ -202676,7 +195373,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36501, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36637, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -202691,13 +195388,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36532, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36668, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36535, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36671, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30996, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31080, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202741,7 +195438,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -203274,16 +195971,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -203308,14 +195995,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -204380,7 +197059,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204390,7 +197069,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -204436,14 +197115,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -204496,12 +197167,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -204635,7 +197306,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -204675,15 +197346,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -204724,7 +197395,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -204762,8 +197433,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36539, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35052, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36675, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35188, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204783,10 +197454,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36544, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36680, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204820,7 +197494,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204870,7 +197544,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204921,7 +197595,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21265, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21366, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204948,7 +197622,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -205045,7 +197719,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36573, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36709, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -205130,7 +197804,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -205143,7 +197817,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -205217,7 +197891,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -205243,11 +197917,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36626 + v2 = __ccgo_ts + 36762 } else { - v2 = __ccgo_ts + 36539 + v2 = __ccgo_ts + 36675 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36633, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36769, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -205260,7 +197934,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36683, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36819, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -205381,14 +198055,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -205404,7 +198070,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -205428,14 +198094,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -205737,7 +198395,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205800,67 +198458,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205998,7 +198596,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -206310,7 +198908,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -206742,9 +199340,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -206781,7 +199379,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206854,7 +199451,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206889,7 +199485,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206904,149 +199499,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -207054,187 +199513,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -207414,7 +199693,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36736, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36872, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -207519,7 +199798,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36742, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -207548,7 +199827,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36793, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36929, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -207582,7 +199861,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36842, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36978, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -207660,7 +199939,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -207751,7 +200030,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36882, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+37018, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207762,7 +200041,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36882, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+37018, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -208443,7 +200722,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -208688,15 +200967,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208797,7 +201076,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -209403,7 +201682,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36910, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37046, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -209492,7 +201771,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36994, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37130, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -210139,7 +202418,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -210165,14 +202444,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -210182,15 +202453,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -210304,7 +202566,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -210325,7 +202587,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -211049,7 +203311,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -211463,7 +203725,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37076, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37212, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211918,13 +204180,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211969,7 +204224,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37133, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37269, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -212138,7 +204393,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -212456,7 +204711,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37194, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37330, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -212731,7 +204986,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212766,7 +205021,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -213045,16 +205300,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -213272,7 +205517,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -213309,7 +205554,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -213320,70 +205565,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -213452,7 +205634,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -213551,14 +205733,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -213605,19 +205779,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -213696,7 +205857,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -213746,7 +205907,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213828,15 +205989,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1695, 0) - _fts5StructureWrite(tls, p, bp) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213862,11 +206026,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37245, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37381, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26031, __ccgo_ts+37253, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26115, __ccgo_ts+37389, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12012, __ccgo_ts+37288, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12066, __ccgo_ts+37424, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -214064,7 +206228,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -214319,7 +206483,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37332) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37468) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -214670,7 +206834,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214792,7 +206956,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214912,7 +207076,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36736, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36872, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -215506,7 +207670,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37334, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37470, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -215737,7 +207901,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37420) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37556) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215876,7 +208040,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215931,87 +208094,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -216019,96 +208101,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -216359,7 +208351,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37425, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37561, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -216396,7 +208388,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5235, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5261, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -216415,7 +208407,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5235, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5261, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216865,7 +208857,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3892, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3918, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216893,7 +208885,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3892, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3918, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216913,7 +208905,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216928,7 +208920,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15177 + v1 = __ccgo_ts + 15231 } else { v1 = __ccgo_ts + 1695 } @@ -216938,11 +208930,11 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int v2 = __ccgo_ts + 1695 } if bDesc != 0 { - v3 = __ccgo_ts + 37464 + v3 = __ccgo_ts + 37600 } else { - v3 = __ccgo_ts + 37469 + v3 = __ccgo_ts + 37605 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37473, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37609, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -217000,14 +208992,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37528, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37664, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5594, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5620, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37534, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37670, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -217057,7 +209049,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37562, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37698, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -217090,7 +209082,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37572, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37708, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -217124,7 +209116,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37593, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37729, libc.VaList(bp+24, z)) } } } else { @@ -217132,7 +209124,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35320 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35456 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -217289,7 +209281,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37626, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37762, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -217489,7 +209481,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37631, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37767, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -217622,10 +209614,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -220161,12 +212090,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38980, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39116, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39084, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39220, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39122, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39258, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -220175,7 +212104,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39160, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39296, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -220187,14 +212116,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26031, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12012, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38314, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26115, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12066, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38450, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36220, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36356, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35525, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35661, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -220214,13 +212143,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30671 + v1 = __ccgo_ts + 30755 } else { v1 = __ccgo_ts + 1695 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39202, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39338, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39232, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39368, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -220261,7 +212190,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39276, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39412, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -220269,7 +212198,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39299, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39435, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -220284,7 +212213,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39305, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39441, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -220293,22 +212222,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35525, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35661, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39311 + zCols = __ccgo_ts + 39447 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39343 + zCols = __ccgo_ts + 39479 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36220, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36356, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38314, __ccgo_ts+39391, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38450, __ccgo_ts+39527, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36402, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36538, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -220353,14 +212282,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -220430,14 +212351,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -220465,6 +212386,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -220477,11 +212399,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -220494,6 +212429,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -220728,12 +212664,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39408, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39544, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39458, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39594, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39487, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39623, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -220741,7 +212677,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36402, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36538, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -221043,7 +212979,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39516, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39652, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -221076,17 +213012,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -221173,7 +213098,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -221275,14 +213200,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35525, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35661, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221934,11 +213841,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39570 + zCat = __ccgo_ts + 39706 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221948,7 +213855,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39579) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39715) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221965,20 +213872,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39590) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39726) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(*(*int8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39548) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39684) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39559) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39695) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39579) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39715) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -222014,7 +213921,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -222201,7 +214108,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -222229,14 +214136,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]int8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -222270,7 +214169,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39608 + zBase = __ccgo_ts + 39744 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -222314,14 +214213,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -222332,16 +214223,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -222487,64 +214368,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39618, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39754, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39621, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39757, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39626, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39762, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39631, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39767, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39637, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39773, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39642, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39647, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39783, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39651, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39787, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39657, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39662, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222553,49 +214434,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39666, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39802, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39670, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39806, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39673, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39809, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39677, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39813, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39681, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39685, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39821, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39689, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39825, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39693, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39829, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -222612,20 +214493,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39697, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39677, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39813, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39700, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39703, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39836, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39839, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39707, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39693, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39829, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -222641,75 +214522,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39710, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39846, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39677, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39813, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39718, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39854, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39725, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39861, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39730, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39866, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39626, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39762, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39735, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39871, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39621, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39757, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39740, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39876, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39693, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39829, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39881, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16080, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16181, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39886, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39703, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39839, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39754, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39890, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39618, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39754, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39895, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39662, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39798, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39901, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39769, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39905, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39771, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39907, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39685, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39821, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -222718,48 +214599,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39777, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39913, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39693, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39829, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39921, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39677, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39813, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39791, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39927, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39677, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39813, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39796, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39932, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39618, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39754, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39802, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39689, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39825, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39810, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39946, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39818, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39954, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39822, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39958, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39685, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39821, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222767,21 +214648,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39830, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39966, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39618, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39754, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39836, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39972, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39689, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39825, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39842, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39978, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39703, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39839, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222799,48 +214680,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39849, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39634, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39770, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39854, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39990, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39859, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39995, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39634, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39865, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39634, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39954, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39871, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40007, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39877, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40013, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39618, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39754, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222856,13 +214737,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39883, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40019, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39887, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+40023, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39890, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40026, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222870,7 +214751,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40029, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222967,14 +214848,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222992,13 +214873,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -223035,14 +214909,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39897) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40033) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39590) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39726) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -223080,7 +214954,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -223208,7 +215082,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -223284,11 +215158,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -223310,7 +215184,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39912)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40048)) } // C documentation @@ -223336,7 +215210,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39608, + FzName: __ccgo_ts + 39744, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -223344,7 +215218,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39920, + FzName: __ccgo_ts + 40056, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -223352,7 +215226,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39912, + FzName: __ccgo_ts + 40048, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -223382,7 +215256,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39926, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40062, pApi, bp+96, uintptr(0)) } return rc } @@ -228843,39 +220717,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228898,16 +220739,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39933) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40069) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39937) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40073) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39941) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40077) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39950, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40086, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228970,21 +220811,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39984, - 1: __ccgo_ts + 40024, - 2: __ccgo_ts + 40059, + 0: __ccgo_ts + 40120, + 1: __ccgo_ts + 40160, + 2: __ccgo_ts + 40195, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24007, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24108, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40102, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40238, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -229005,23 +220847,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -229154,10 +220996,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40135, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40271, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40166, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40302, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -229176,7 +221018,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40217, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40353, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -229626,7 +221468,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40243, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40379, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -229681,15 +221523,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40253 + return __ccgo_ts + 40389 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229911,7 +221753,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229959,11 +221801,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.1.0 20240507 (Red Hat 14.1.0-1)\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.2.1 20241104 (Red Hat 14.2.1-6)\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go index d506ce1..8117bdf 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_ppc64le.go @@ -1,4 +1,4 @@ -// Code generated for linux/ppc64le by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/debian/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/ppc64le -I /home/debian/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/ppc64le -I /home/debian/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/ppc64le -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/ppc64le by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/debian/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/ppc64le -I /home/debian/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/ppc64le -I /home/debian/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/ppc64le -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && ppc64le @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -135,6 +137,31 @@ const CLOCK_REALTIME_COARSE = 5 const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 +const CLONE_CHILD_CLEARTID = 2097152 +const CLONE_CHILD_SETTID = 16777216 +const CLONE_DETACHED = 4194304 +const CLONE_FILES = 1024 +const CLONE_FS = 512 +const CLONE_IO = 2147483648 +const CLONE_NEWCGROUP = 33554432 +const CLONE_NEWIPC = 134217728 +const CLONE_NEWNET = 1073741824 +const CLONE_NEWNS = 131072 +const CLONE_NEWPID = 536870912 +const CLONE_NEWTIME = 128 +const CLONE_NEWUSER = 268435456 +const CLONE_NEWUTS = 67108864 +const CLONE_PARENT = 32768 +const CLONE_PARENT_SETTID = 1048576 +const CLONE_PIDFD = 4096 +const CLONE_PTRACE = 8192 +const CLONE_SETTLS = 524288 +const CLONE_SIGHAND = 2048 +const CLONE_SYSVSEM = 262144 +const CLONE_THREAD = 65536 +const CLONE_UNTRACED = 8388608 +const CLONE_VFORK = 16384 +const CLONE_VM = 256 const COLFLAG_BUSY = 256 const COLFLAG_GENERATED = 96 const COLFLAG_HASCOLL = 512 @@ -161,6 +188,8 @@ const COLTYPE_INT = 3 const COLTYPE_INTEGER = 4 const COLTYPE_REAL = 5 const COLTYPE_TEXT = 6 +const CPU_SETSIZE = 1024 +const CSIGNAL = 255 const CURSOR_FAULT = 4 const CURSOR_INVALID = 1 const CURSOR_REQUIRESEEK = 3 @@ -587,7 +616,7 @@ const F_TLOCK = 2 const F_ULOCK = 0 const F_UNLCK = 2 const F_WRLCK = 1 -const GCC_VERSION = 10002001 +const GCC_VERSION = 14002000 const GEOPOLY_PI = 3.141592653589793 const HASHSIZE = 97 const HASHTABLE_HASH_1 = 383 @@ -1240,6 +1269,31 @@ const PTF_INTKEY = 1 const PTF_LEAF = 8 const PTF_LEAFDATA = 4 const PTF_ZERODATA = 2 +const PTHREAD_BARRIER_SERIAL_THREAD = -1 +const PTHREAD_CANCELED = -1 +const PTHREAD_CANCEL_ASYNCHRONOUS = 1 +const PTHREAD_CANCEL_DEFERRED = 0 +const PTHREAD_CANCEL_DISABLE = 1 +const PTHREAD_CANCEL_ENABLE = 0 +const PTHREAD_CANCEL_MASKED = 2 +const PTHREAD_CREATE_DETACHED = 1 +const PTHREAD_CREATE_JOINABLE = 0 +const PTHREAD_EXPLICIT_SCHED = 1 +const PTHREAD_INHERIT_SCHED = 0 +const PTHREAD_MUTEX_DEFAULT = 0 +const PTHREAD_MUTEX_ERRORCHECK = 2 +const PTHREAD_MUTEX_NORMAL = 0 +const PTHREAD_MUTEX_RECURSIVE = 1 +const PTHREAD_MUTEX_ROBUST = 1 +const PTHREAD_MUTEX_STALLED = 0 +const PTHREAD_ONCE_INIT = 0 +const PTHREAD_PRIO_INHERIT = 1 +const PTHREAD_PRIO_NONE = 0 +const PTHREAD_PRIO_PROTECT = 2 +const PTHREAD_PROCESS_PRIVATE = 0 +const PTHREAD_PROCESS_SHARED = 1 +const PTHREAD_SCOPE_PROCESS = 1 +const PTHREAD_SCOPE_SYSTEM = 0 const PTRMAP_BTREE = 5 const PTRMAP_FREEPAGE = 2 const PTRMAP_OVERFLOW1 = 3 @@ -1380,6 +1434,13 @@ const R_OK = 4 const SAVEPOINT_BEGIN = 0 const SAVEPOINT_RELEASE = 1 const SAVEPOINT_ROLLBACK = 2 +const SCHED_BATCH = 3 +const SCHED_DEADLINE = 6 +const SCHED_FIFO = 1 +const SCHED_IDLE = 5 +const SCHED_OTHER = 0 +const SCHED_RESET_ON_FORK = 1073741824 +const SCHED_RR = 2 const SCHEMA_ROOT = 1 const SEEK_DATA = 3 const SEEK_HOLE = 4 @@ -1499,6 +1560,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1738,6 +1800,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1948,6 +2011,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -1971,7 +2035,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 -const SQLITE_MUTEX_NOOP = 1 +const SQLITE_MUTEX_NREF = 0 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -2110,6 +2174,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2118,7 +2183,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2203,6 +2268,7 @@ const SQLITE_TESTCTRL_USELONGDOUBLE = 34 const SQLITE_TESTCTRL_VDBE_COVERAGE = 21 const SQLITE_TEXT = 3 const SQLITE_THREADSAFE = 1 +const SQLITE_THREADS_IMPLEMENTED = 1 const SQLITE_TOKEN_KEYWORD = 2 const SQLITE_TOKEN_QUOTED = 1 const SQLITE_TOOBIG = 18 @@ -2228,8 +2294,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3096,6 +3162,7 @@ const __DBL_DIG__ = 15 const __DBL_HAS_DENORM__ = 1 const __DBL_HAS_INFINITY__ = 1 const __DBL_HAS_QUIET_NAN__ = 1 +const __DBL_IS_IEC_60559__ = 1 const __DBL_MANT_DIG__ = 53 const __DBL_MAX_10_EXP__ = 308 const __DBL_MAX_EXP__ = 1024 @@ -3136,6 +3203,7 @@ const __FLT128_EPSILON__ = 0 const __FLT128_HAS_DENORM__ = 1 const __FLT128_HAS_INFINITY__ = 1 const __FLT128_HAS_QUIET_NAN__ = 1 +const __FLT128_IS_IEC_60559__ = 1 const __FLT128_MANT_DIG__ = 113 const __FLT128_MAX_10_EXP__ = 4932 const __FLT128_MAX_EXP__ = 16384 @@ -3151,6 +3219,7 @@ const __FLT32X_EPSILON__ = 0 const __FLT32X_HAS_DENORM__ = 1 const __FLT32X_HAS_INFINITY__ = 1 const __FLT32X_HAS_QUIET_NAN__ = 1 +const __FLT32X_IS_IEC_60559__ = 1 const __FLT32X_MANT_DIG__ = 53 const __FLT32X_MAX_10_EXP__ = 308 const __FLT32X_MAX_EXP__ = 1024 @@ -3166,6 +3235,7 @@ const __FLT32_EPSILON__ = 0 const __FLT32_HAS_DENORM__ = 1 const __FLT32_HAS_INFINITY__ = 1 const __FLT32_HAS_QUIET_NAN__ = 1 +const __FLT32_IS_IEC_60559__ = 1 const __FLT32_MANT_DIG__ = 24 const __FLT32_MAX_10_EXP__ = 38 const __FLT32_MAX_EXP__ = 128 @@ -3181,6 +3251,7 @@ const __FLT64X_EPSILON__ = 0 const __FLT64X_HAS_DENORM__ = 1 const __FLT64X_HAS_INFINITY__ = 1 const __FLT64X_HAS_QUIET_NAN__ = 1 +const __FLT64X_IS_IEC_60559__ = 1 const __FLT64X_MANT_DIG__ = 113 const __FLT64X_MAX_10_EXP__ = 4932 const __FLT64X_MAX_EXP__ = 16384 @@ -3196,6 +3267,7 @@ const __FLT64_EPSILON__ = 0 const __FLT64_HAS_DENORM__ = 1 const __FLT64_HAS_INFINITY__ = 1 const __FLT64_HAS_QUIET_NAN__ = 1 +const __FLT64_IS_IEC_60559__ = 1 const __FLT64_MANT_DIG__ = 53 const __FLT64_MAX_10_EXP__ = 308 const __FLT64_MAX_EXP__ = 1024 @@ -3213,6 +3285,7 @@ const __FLT_EVAL_METHOD__ = 0 const __FLT_HAS_DENORM__ = 1 const __FLT_HAS_INFINITY__ = 1 const __FLT_HAS_QUIET_NAN__ = 1 +const __FLT_IS_IEC_60559__ = 1 const __FLT_MANT_DIG__ = 24 const __FLT_MAX_10_EXP__ = 38 const __FLT_MAX_EXP__ = 128 @@ -3248,14 +3321,15 @@ const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1 const __GCC_IEC_559 = 2 const __GCC_IEC_559_COMPLEX = 2 +const __GNUC_EXECUTION_CHARSET_NAME = "UTF-8" const __GNUC_MINOR__ = 2 -const __GNUC_PATCHLEVEL__ = 1 +const __GNUC_PATCHLEVEL__ = 0 const __GNUC_STDC_INLINE__ = 1 -const __GNUC__ = 10 -const __GXX_ABI_VERSION = 1014 +const __GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32LE" +const __GNUC__ = 14 +const __GXX_ABI_VERSION = 1019 const __HAVE_BSWAP__ = 1 const __HAVE_SPECULATION_SAFE_VALUE = 1 -const __HTM__ = 1 const __INT16_MAX__ = 32767 const __INT32_MAX__ = 2147483647 const __INT32_TYPE__ = 0 @@ -3291,6 +3365,7 @@ const __LDBL_EPSILON__ = 0 const __LDBL_HAS_DENORM__ = 1 const __LDBL_HAS_INFINITY__ = 1 const __LDBL_HAS_QUIET_NAN__ = 1 +const __LDBL_IS_IEC_60559__ = 1 const __LDBL_MANT_DIG__ = 53 const __LDBL_MAX_10_EXP__ = 308 const __LDBL_MAX_EXP__ = 1024 @@ -3329,6 +3404,7 @@ const __RSQRTEF__ = 1 const __RSQRTE__ = 1 const __SCHAR_MAX__ = 127 const __SCHAR_WIDTH__ = 8 +const __SET_FPSCR_RN_RETURNS_FPSCR__ = 1 const __SHRT_MAX__ = 32767 const __SHRT_WIDTH__ = 16 const __SIG_ATOMIC_MAX__ = 2147483647 @@ -3336,7 +3412,9 @@ const __SIG_ATOMIC_MIN__ = -2147483648 const __SIG_ATOMIC_TYPE__ = 0 const __SIG_ATOMIC_WIDTH__ = 32 const __SIZEOF_DOUBLE__ = 8 +const __SIZEOF_FLOAT128__ = 16 const __SIZEOF_FLOAT__ = 4 +const __SIZEOF_IEEE128__ = 16 const __SIZEOF_INT128__ = 16 const __SIZEOF_INT__ = 4 const __SIZEOF_LONG_DOUBLE__ = 8 @@ -3354,13 +3432,14 @@ const __SQLITESESSION_H_ = 1 const __STDC_HOSTED__ = 1 const __STDC_IEC_559_COMPLEX__ = 1 const __STDC_IEC_559__ = 1 +const __STDC_IEC_60559_BFP__ = 201404 +const __STDC_IEC_60559_COMPLEX__ = 201404 const __STDC_ISO_10646__ = 201706 const __STDC_UTF_16__ = 1 const __STDC_UTF_32__ = 1 const __STDC_VERSION__ = 201710 const __STDC__ = 1 const __STRUCT_PARM_ALIGN__ = 16 -const __TM_FENCE__ = 1 const __UINT16_MAX__ = 65535 const __UINT32_MAX__ = 4294967295 const __UINT64_MAX__ = 18446744073709551615 @@ -3378,7 +3457,7 @@ const __UINT_LEAST8_MAX__ = 255 const __USE_TIME_BITS64 = 1 const __VEC_ELEMENT_REG_ORDER__ = 1234 const __VEC__ = 10206 -const __VERSION__ = "10.2.1 20210110" +const __VERSION__ = "14.2.0" const __VSX__ = 1 const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN__ = -2147483648 @@ -3441,6 +3520,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3450,9 +3532,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3900,12 +3979,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -4034,29 +4107,380 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
      +**
    • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. +** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. +** +**
    • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
    • [[SQLITE_FCNTL_SIZE_LIMIT]] +** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that +** implements [sqlite3_deserialize()] to set an upper bound on the size +** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. +** If the integer pointed to is negative, then it is filled in with the +** current limit. Otherwise the limit is set to the larger of the value +** of the integer pointed to and the current database size. The integer +** pointed to is set to the new limit. +** +**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
    • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
    • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
    • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions super-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
    • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log ([WAL file]) and shared memory +** files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
    • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
    • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
    • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
    • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
    • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connection's busy-handler callback. The argument is of type (void**) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connection's +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
    • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
    • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
    • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
    • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
    • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
    • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
    • [[SQLITE_FCNTL_NULL_IO]] +** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor +** or file handle for the [sqlite3_file] object such that it will no longer +** read or write to the database file. +** +**
    • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
    • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
    • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
    • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
    • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS +** to block for up to M milliseconds before failing when attempting to +** obtain a file lock using the xLock or xShmLock methods of the VFS. +** The parameter is a pointer to a 32-bit signed integer that contains +** the value that M is to be set to. Before returning, the 32-bit signed +** integer is overwritten with the previous value of M. +** +**
    • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** +**
    • [[SQLITE_FCNTL_DATA_VERSION]] +** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +** a database file. The argument is a pointer to a 32-bit unsigned integer. +** The "data version" for the pager is written into the pointer. The +** "data version" changes whenever any change occurs to the corresponding +** database file, either through SQL statements on the same database +** connection or through transactions committed by separate database +** connections possibly in other processes. The [sqlite3_total_changes()] +** interface can be used to find if any database on the connection has changed, +** but that interface responds to changes on TEMP as well as MAIN and does +** not provide a mechanism to detect changes to MAIN only. Also, the +** [sqlite3_total_changes()] interface responds to internal changes only and +** omits changes made by other database connections. The +** [PRAGMA data_version] command provides a mechanism to detect changes to +** a single attached database that occur due to other database connections, +** but omits changes implemented by the database connection on which it is +** called. This file control is the only mechanism to detect changes that +** happen either internally or externally and that are associated with +** a particular attached database. +** +**
    • [[SQLITE_FCNTL_CKPT_START]] +** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint +** in wal mode before the client starts to copy pages from the wal +** file to the database file. +** +**
    • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. +** +**
    • [[SQLITE_FCNTL_EXTERNAL_READER]] +** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect +** whether or not there is a database client in another process with a wal-mode +** transaction open on the database or not. It is only available on unix.The +** (void*) argument passed with this file-control should be a pointer to a +** value of type (int). The integer value is set to 1 if the database is a wal +** mode database and there exists at least one client in another process that +** currently has an SQL transaction open on the database. It is set to 0 if +** the database is not a wal-mode db, or if there is no such connection in any +** other process. This opcode cannot be used to detect transactions opened +** by clients within the current process, only within other processes. +** +**
    • [[SQLITE_FCNTL_CKSM_FILE]] +** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the +** [checksum VFS shim] only. +** +**
    • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control +** purges the contents of the in-memory page cache. If there is an open +** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. +**
    + */ + +/* deprecated names */ + +// C documentation +// +// /* +// ** CAPI3REF: Mutex Handle +// ** +// ** The mutex module within SQLite defines [sqlite3_mutex] to be an +// ** abstract type for a mutex object. The SQLite core never looks +// ** at the internal representation of an [sqlite3_mutex]. It only +// ** deals with pointers to the [sqlite3_mutex] object. +// ** +// ** Mutexes are created using [sqlite3_mutex_alloc()]. +// */ +type Tsqlite3_mutex = struct { + Fmutex Tpthread_mutex_t +} + +type sqlite3_mutex = Tsqlite3_mutex // C documentation // @@ -4339,6 +4763,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4569,33 +4994,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4674,19 +5072,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4771,7 +5156,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4863,223 +5247,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5161,20 +5328,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5224,13 +5377,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5289,9 +5435,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5299,17 +5445,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5336,12 +5482,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5358,7 +5504,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5376,7 +5522,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5410,24 +5556,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5451,22 +5579,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5527,7 +5639,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5607,50 +5719,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6047,340 +6115,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6390,15 +6124,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6414,14 +6139,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6447,17 +6164,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6512,11 +6218,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6890,55 +6602,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint64 type size_t = Tsize_t @@ -7085,6 +6753,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7143,6 +6816,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7252,14 +6936,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7344,7 +7020,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7446,7 +7122,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7505,6 +7180,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -7516,9 +7192,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -7533,7 +7209,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7582,8 +7257,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -7647,7 +7322,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7719,19 +7393,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7745,11 +7422,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7760,40 +7434,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -7811,7 +7486,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -7823,6 +7498,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -7910,9 +7586,11 @@ type TSelect = struct { type Select = TSelect type TSQLiteThread = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr + Ftid Tpthread_t + Fdone int32 + FpOut uintptr + FxTask uintptr + FpIn uintptr } type SQLiteThread = TSQLiteThread @@ -7971,9 +7649,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -7990,10 +7668,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -8028,6 +7702,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8208,7 +7883,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8250,7 +7924,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8423,9 +8096,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8552,53 +8225,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8702,16 +8328,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8735,38 +8351,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8779,34 +8368,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -8820,90 +8385,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -8922,187 +8403,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9112,913 +8412,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity uint8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10043,611 +8436,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr uint8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10657,317 +8445,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]uint8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11053,228 +8530,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]uint8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign uint8 - FisSpecial uint8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]uint8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -11370,58 +8625,58 @@ type FpDecode1 = TFpDecode1 var _sqlite3azCompileOpt = [54]uintptr{ 0: __ccgo_ts, 1: __ccgo_ts + 20, - 2: __ccgo_ts + 49, - 3: __ccgo_ts + 68, - 4: __ccgo_ts + 93, - 5: __ccgo_ts + 115, - 6: __ccgo_ts + 145, - 7: __ccgo_ts + 165, - 8: __ccgo_ts + 185, - 9: __ccgo_ts + 208, - 10: __ccgo_ts + 233, - 11: __ccgo_ts + 260, - 12: __ccgo_ts + 285, - 13: __ccgo_ts + 307, - 14: __ccgo_ts + 339, - 15: __ccgo_ts + 365, - 16: __ccgo_ts + 390, - 17: __ccgo_ts + 411, - 18: __ccgo_ts + 434, - 19: __ccgo_ts + 453, - 20: __ccgo_ts + 465, - 21: __ccgo_ts + 480, - 22: __ccgo_ts + 502, - 23: __ccgo_ts + 527, - 24: __ccgo_ts + 550, - 25: __ccgo_ts + 572, - 26: __ccgo_ts + 583, - 27: __ccgo_ts + 596, - 28: __ccgo_ts + 611, - 29: __ccgo_ts + 627, - 30: __ccgo_ts + 640, - 31: __ccgo_ts + 661, - 32: __ccgo_ts + 685, - 33: __ccgo_ts + 708, - 34: __ccgo_ts + 724, - 35: __ccgo_ts + 740, - 36: __ccgo_ts + 764, - 37: __ccgo_ts + 791, - 38: __ccgo_ts + 811, - 39: __ccgo_ts + 833, - 40: __ccgo_ts + 855, - 41: __ccgo_ts + 885, - 42: __ccgo_ts + 910, - 43: __ccgo_ts + 936, - 44: __ccgo_ts + 956, - 45: __ccgo_ts + 982, - 46: __ccgo_ts + 1005, - 47: __ccgo_ts + 1031, - 48: __ccgo_ts + 1053, - 49: __ccgo_ts + 1074, - 50: __ccgo_ts + 1085, - 51: __ccgo_ts + 1093, - 52: __ccgo_ts + 1107, - 53: __ccgo_ts + 1120, + 2: __ccgo_ts + 40, + 3: __ccgo_ts + 59, + 4: __ccgo_ts + 84, + 5: __ccgo_ts + 106, + 6: __ccgo_ts + 136, + 7: __ccgo_ts + 156, + 8: __ccgo_ts + 176, + 9: __ccgo_ts + 199, + 10: __ccgo_ts + 224, + 11: __ccgo_ts + 251, + 12: __ccgo_ts + 276, + 13: __ccgo_ts + 298, + 14: __ccgo_ts + 330, + 15: __ccgo_ts + 356, + 16: __ccgo_ts + 381, + 17: __ccgo_ts + 402, + 18: __ccgo_ts + 425, + 19: __ccgo_ts + 444, + 20: __ccgo_ts + 456, + 21: __ccgo_ts + 471, + 22: __ccgo_ts + 493, + 23: __ccgo_ts + 518, + 24: __ccgo_ts + 541, + 25: __ccgo_ts + 563, + 26: __ccgo_ts + 574, + 27: __ccgo_ts + 587, + 28: __ccgo_ts + 602, + 29: __ccgo_ts + 618, + 30: __ccgo_ts + 631, + 31: __ccgo_ts + 652, + 32: __ccgo_ts + 676, + 33: __ccgo_ts + 699, + 34: __ccgo_ts + 715, + 35: __ccgo_ts + 731, + 36: __ccgo_ts + 755, + 37: __ccgo_ts + 782, + 38: __ccgo_ts + 802, + 39: __ccgo_ts + 824, + 40: __ccgo_ts + 846, + 41: __ccgo_ts + 876, + 42: __ccgo_ts + 901, + 43: __ccgo_ts + 927, + 44: __ccgo_ts + 947, + 45: __ccgo_ts + 973, + 46: __ccgo_ts + 996, + 47: __ccgo_ts + 1022, + 48: __ccgo_ts + 1044, + 49: __ccgo_ts + 1065, + 50: __ccgo_ts + 1080, + 51: __ccgo_ts + 1088, + 52: __ccgo_ts + 1102, + 53: __ccgo_ts + 1115, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -12252,12 +9507,12 @@ var _sqlite3StdTypeAffinity = [6]uint8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1133, - 1: __ccgo_ts + 1137, - 2: __ccgo_ts + 1142, - 3: __ccgo_ts + 1146, - 4: __ccgo_ts + 1154, - 5: __ccgo_ts + 1159, + 0: __ccgo_ts + 1128, + 1: __ccgo_ts + 1132, + 2: __ccgo_ts + 1137, + 3: __ccgo_ts + 1141, + 4: __ccgo_ts + 1149, + 5: __ccgo_ts + 1154, } /************** End of global.c **********************************************/ @@ -12357,7 +9612,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12435,72 +9689,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12546,163 +9738,10 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - -/* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - /* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ // C documentation // @@ -12729,18 +9768,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12757,100 +9784,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]uint8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -12872,13 +9805,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -12898,14 +9824,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -12984,7 +9903,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13156,7 +10075,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13214,7 +10133,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13349,24 +10268,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD uint8 - FvalidYMD uint8 - FvalidHMS uint8 - FnFloor uint8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13497,7 +10398,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1164, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1159, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -13529,13 +10430,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1172, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1167, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1180, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -13543,7 +10444,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -13614,10 +10515,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(0) @@ -13685,7 +10586,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1184, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1179, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -13753,7 +10654,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) } } @@ -13786,14 +10687,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1196) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1200) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1207) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1195) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -13850,7 +10751,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -13991,13 +10892,13 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = uint8(0) _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1217, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1212, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -14005,7 +10906,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) @@ -14083,7 +10984,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) @@ -14152,7 +11053,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1235) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -14167,7 +11068,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1245) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -14180,7 +11081,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1253) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1248) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(libc.Int32FromUint8((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -14195,7 +11096,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1259) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -14210,7 +11111,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1269) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1264) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -14227,11 +11128,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1279) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1274) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14240,7 +11141,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1289) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1284) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -14287,7 +11188,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1293, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1288, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -14317,8 +11218,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1302, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1200) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1207) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1297, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1195) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -14337,16 +11238,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1312) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1307) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1323) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { rc = 0 } } @@ -14388,10 +11289,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1327, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1331, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -14412,11 +11313,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1335, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1330, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1347, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1342, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -14454,7 +11355,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1172, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1167, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -14534,7 +11435,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -14691,7 +11592,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(16)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(17)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(18)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(19)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(20)] = uint8('.') @@ -14739,7 +11640,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(4)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(5)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(6)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(7)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(8)] = uint8('.') @@ -14844,7 +11745,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -14931,9 +11832,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if libc.Int32FromUint8(cf) == int32('d') { - v3 = __ccgo_ts + 1359 + v3 = __ccgo_ts + 1354 } else { - v3 = __ccgo_ts + 1364 + v3 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -14941,9 +11842,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1368, libc.VaList(bp+184, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1363, libc.VaList(bp+184, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1375, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -14953,17 +11854,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FvalidYMD = uint8(0) _computeYMD(tls, bp+80) if libc.Int32FromUint8(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) } case int32('H'): fallthrough case int32('k'): if libc.Int32FromUint8(cf) == int32('H') { - v4 = __ccgo_ts + 1359 + v4 = __ccgo_ts + 1354 } else { - v4 = __ccgo_ts + 1364 + v4 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -14977,50 +11878,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if libc.Int32FromUint8(cf) == int32('I') { - v5 = __ccgo_ts + 1359 + v5 = __ccgo_ts + 1354 } else { - v5 = __ccgo_ts + 1364 + v5 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+184, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1400, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if libc.Int32FromUint8(cf) == int32('p') { - v6 = __ccgo_ts + 1406 + v6 = __ccgo_ts + 1401 } else { - v6 = __ccgo_ts + 1409 + v6 = __ccgo_ts + 1404 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if libc.Int32FromUint8(cf) == int32('p') { - v7 = __ccgo_ts + 1412 + v7 = __ccgo_ts + 1407 } else { - v7 = __ccgo_ts + 1415 + v7 = __ccgo_ts + 1410 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1418, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1413, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1423, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+184, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+184, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1438, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -15030,18 +11931,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 128)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 128))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 128))).FvalidYMD = uint8(0) _computeYMD(tls, bp+128) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), uint8('%')) default: @@ -15197,7 +12098,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1453, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1448, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15230,55 +12131,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1259, + FzName: __ccgo_ts + 1254, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1279, + FzName: __ccgo_ts + 1274, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1487, + FzName: __ccgo_ts + 1482, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1492, + FzName: __ccgo_ts + 1487, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1497, + FzName: __ccgo_ts + 1492, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1506, + FzName: __ccgo_ts + 1501, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1515, + FzName: __ccgo_ts + 1510, }, 7: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1524, + FzName: __ccgo_ts + 1519, }, 8: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1537, + FzName: __ccgo_ts + 1532, }, 9: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1555, + FzName: __ccgo_ts + 1550, }, } @@ -15360,28 +12261,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15389,19 +12290,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15418,12 +12319,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15431,7 +12332,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15444,34 +12345,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15573,7 +12474,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -15784,14 +12685,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -15806,9 +12700,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -15949,7 +12843,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1568, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1563, libc.VaList(bp+8, nByte)) } return p } @@ -16011,7 +12905,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1606, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1601, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -16222,7 +13116,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16242,9 +13140,11 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld + _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) + _sqlite3MemoryBarrier(tls) return rc } @@ -16427,40 +13327,320 @@ func init() { *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_noopMutexLeave) } +type Tpthread_t = uintptr + +type pthread_t = Tpthread_t + +type Tpthread_once_t = int32 + +type pthread_once_t = Tpthread_once_t + +type Tpthread_key_t = uint32 + +type pthread_key_t = Tpthread_key_t + +type Tpthread_spinlock_t = int32 + +type pthread_spinlock_t = Tpthread_spinlock_t + +type Tpthread_mutexattr_t = struct { + F__attr uint32 +} + +type pthread_mutexattr_t = Tpthread_mutexattr_t + +type Tpthread_condattr_t = struct { + F__attr uint32 +} + +type pthread_condattr_t = Tpthread_condattr_t + +type Tpthread_barrierattr_t = struct { + F__attr uint32 +} + +type pthread_barrierattr_t = Tpthread_barrierattr_t + +type Tpthread_rwlockattr_t = struct { + F__attr [2]uint32 +} + +type pthread_rwlockattr_t = Tpthread_rwlockattr_t + +type Tsigset_t = struct { + F__bits [16]uint64 +} + +type sigset_t = Tsigset_t + +type t__sigset_t = Tsigset_t + +type Tpthread_attr_t = struct { + F__u struct { + F__vi [0][14]int32 + F__s [0][7]uint64 + F__i [14]int32 + } +} + +type pthread_attr_t = Tpthread_attr_t + +type Tpthread_mutex_t = struct { + F__u struct { + F__vi [0][10]int32 + F__p [0][5]uintptr + F__i [10]int32 + } +} + +type pthread_mutex_t = Tpthread_mutex_t + +type Tpthread_cond_t = struct { + F__u struct { + F__vi [0][12]int32 + F__p [0][6]uintptr + F__i [12]int32 + } +} + +type pthread_cond_t = Tpthread_cond_t + +type Tpthread_rwlock_t = struct { + F__u struct { + F__vi [0][14]int32 + F__p [0][7]uintptr + F__i [14]int32 + } +} + +type pthread_rwlock_t = Tpthread_rwlock_t + +type Tpthread_barrier_t = struct { + F__u struct { + F__vi [0][8]int32 + F__p [0][4]uintptr + F__i [8]int32 + } +} + +type pthread_barrier_t = Tpthread_barrier_t + +type Tsched_param = struct { + Fsched_priority int32 + F__reserved1 int32 + F__reserved2 [2]struct { + F__reserved1 Ttime_t + F__reserved2 int64 + } + F__reserved3 int32 +} + +type sched_param = Tsched_param + +type Tcpu_set_t = struct { + F__bits [16]uint64 +} + +type cpu_set_t = Tcpu_set_t + +type t__ptcb = struct { + F__f uintptr + F__x uintptr + F__next uintptr +} + +/* +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +** intended for use only inside assert() statements. On some platforms, +** there might be race conditions that can cause these routines to +** deliver incorrect results. In particular, if pthread_equal() is +** not an atomic operation, then these routines might delivery +** incorrect results. On most platforms, pthread_equal() is a +** comparison of two integers and is therefore atomic. But we are +** told that HPUX is not such a platform. If so, then these routines +** will not always work correctly on HPUX. +** +** On those platforms where pthread_equal() is not atomic, SQLite +** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to +** make sure no assert() statements are evaluated and hence these +** routines are never called. + */ + +// C documentation +// +// /* +// ** Try to provide a memory barrier operation, needed for initialization +// ** and also for the implementation of xShmBarrier in the VFS in cases +// ** where SQLite is compiled without mutexes. +// */ +func _sqlite3MemoryBarrier(tls *libc.TLS) { + libc.X__sync_synchronize(tls) +} + +// C documentation +// +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ +func _pthreadMutexInit(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +func _pthreadMutexEnd(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. SQLite +// ** will unwind its stack and return an error. The argument +// ** to sqlite3_mutex_alloc() is one of these integer constants: +// ** +// **
      +// **
    • SQLITE_MUTEX_FAST +// **
    • SQLITE_MUTEX_RECURSIVE +// **
    • SQLITE_MUTEX_STATIC_MAIN +// **
    • SQLITE_MUTEX_STATIC_MEM +// **
    • SQLITE_MUTEX_STATIC_OPEN +// **
    • SQLITE_MUTEX_STATIC_PRNG +// **
    • SQLITE_MUTEX_STATIC_LRU +// **
    • SQLITE_MUTEX_STATIC_PMEM +// **
    • SQLITE_MUTEX_STATIC_APP1 +// **
    • SQLITE_MUTEX_STATIC_APP2 +// **
    • SQLITE_MUTEX_STATIC_APP3 +// **
    • SQLITE_MUTEX_STATIC_VFS1 +// **
    • SQLITE_MUTEX_STATIC_VFS2 +// **
    • SQLITE_MUTEX_STATIC_VFS3 +// **
    +// ** +// ** The first two constants cause sqlite3_mutex_alloc() to create +// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +// ** The mutex implementation does not need to make a distinction +// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +// ** not want to. But SQLite will only request a recursive mutex in +// ** cases where it really needs one. If a faster non-recursive mutex +// ** implementation is available on the host platform, the mutex subsystem +// ** might return such a mutex in response to SQLITE_MUTEX_FAST. +// ** +// ** The other allowed parameters to sqlite3_mutex_alloc() each return +// ** a pointer to a static preexisting mutex. Six static mutexes are +// ** used by the current version of SQLite. Future versions of SQLite +// ** may add additional static mutexes. Static mutexes are for internal +// ** use by SQLite only. Applications that use SQLite mutexes should +// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +// ** SQLITE_MUTEX_RECURSIVE. +// ** +// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +// ** returns a different mutex on every call. But for the static +// ** mutex types, the same mutex is returned on every call that has +// ** the same type number. +// */ +func _pthreadMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + var p uintptr + var _ /* recursiveAttr at bp+0 */ Tpthread_mutexattr_t + _ = p + switch iType { + case int32(SQLITE_MUTEX_RECURSIVE): + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutexattr_init(tls, bp) + libc.Xpthread_mutexattr_settype(tls, bp, int32(PTHREAD_MUTEX_RECURSIVE)) + libc.Xpthread_mutex_init(tls, p, bp) + libc.Xpthread_mutexattr_destroy(tls, bp) + } + case SQLITE_MUTEX_FAST: + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutex_init(tls, p, uintptr(0)) + } + default: + p = uintptr(unsafe.Pointer(&_staticMutexes)) + uintptr(iType-int32(2))*40 + break + } + return p +} + +var _staticMutexes = [12]Tsqlite3_mutex{} + +// C documentation +// +// /* +// ** This routine deallocates a previously +// ** allocated mutex. SQLite is careful to deallocate every +// ** mutex that it allocates. +// */ +func _pthreadMutexFree(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_destroy(tls, p) + Xsqlite3_free(tls, p) +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ +func _pthreadMutexEnter(tls *libc.TLS, p uintptr) { + /* Use the built-in recursive mutexes if they are available. + */ + libc.Xpthread_mutex_lock(tls, p) +} + +func _pthreadMutexTry(tls *libc.TLS, p uintptr) (r int32) { + var rc int32 + _ = rc + /* Use the built-in recursive mutexes if they are available. + */ + if libc.Xpthread_mutex_trylock(tls, p) == 0 { + rc = SQLITE_OK + } else { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* -// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation -// ** is used regardless of the run-time threadsafety setting. +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. // */ +func _pthreadMutexLeave(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_unlock(tls, p) +} + func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return _sqlite3NoopMutex(tls) + return uintptr(unsafe.Pointer(&_sMutex1)) } -/************** End of mutex_noop.c ******************************************/ -/************** Begin file mutex_unix.c **************************************/ -/* -** 2007 August 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement mutexes for pthreads - */ -/* #include "sqliteInt.h" */ +var _sMutex1 = Tsqlite3_mutex_methods{} -/* -** The code in this file is only used if we are compiling threadsafe -** under unix with pthreads. -** -** Note that this implementation requires a version of pthreads that -** supports recursive mutexes. - */ +func init() { + p := unsafe.Pointer(&_sMutex1) + *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_pthreadMutexInit) + *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_pthreadMutexEnd) + *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_pthreadMutexAlloc) + *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_pthreadMutexFree) + *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_pthreadMutexEnter) + *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_pthreadMutexTry) + *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_pthreadMutexLeave) +} /************** End of mutex_unix.c ******************************************/ /************** Begin file mutex_w32.c ***************************************/ @@ -16552,6 +13732,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16559,8 +13741,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17379,7 +14561,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -17547,17 +14729,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: uint8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: uint8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: uint8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: uint8('c'), @@ -17754,22 +14936,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 uint8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 uint8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]uint8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -17801,7 +14984,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1656, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1651, int32(1)) break } /* Find out what flags are present */ @@ -18018,11 +15201,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18050,7 +15233,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18072,7 +15255,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18216,9 +15399,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1658 + v57 = __ccgo_ts + 1653 } else { - v57 = __ccgo_ts + 1663 + v57 = __ccgo_ts + 1658 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -18229,7 +15412,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1667, uint64(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1662, uint64(5)) bufpt = bp if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -18499,29 +15682,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = uint8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(3)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18562,7 +15723,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1672 + bufpt = __ccgo_ts + 1667 } else { if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -18636,25 +15797,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = libc.Uint8FromInt32(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1673 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1668 } else { - v98 = __ccgo_ts + 1678 + v97 = __ccgo_ts + 1673 } - escarg = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = uint8('"') + flag_alternateform = uint8(0) + } else { + q = uint8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18662,15 +15827,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && libc.Int32FromUint8(v101) != 0) { + if !(v101 && libc.Int32FromUint8(v100) != 0) { break } if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { @@ -18681,13 +15846,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18701,35 +15899,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1680, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = uint8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v108 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if libc.Int32FromUint8(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = uint8('\\') + } else { + if libc.Int32FromUint8(ch1) <= int32(0x1f) { + *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = uint8('\\') + v110 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v110))) = uint8('u') + v111 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v111))) = uint8('0') + v112 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v112))) = uint8('0') + v113 = j1 + j1++ + if libc.Int32FromUint8(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v113))) = libc.Uint8FromInt32(v114) + v115 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v119 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v120))) = uint8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v121))) = uint8(')') + } } *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1))) = uint8(0) length = int32(j1) @@ -18754,9 +16015,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18770,7 +16031,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1685, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18780,21 +16041,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1687, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1697, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1739, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -19033,7 +16294,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -19069,7 +16330,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1672, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -19332,6 +16593,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19349,11 +16612,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]uint8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]uint8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -19787,76 +17050,34 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr - _ = p + var rc int32 + _, _ = p, rc + /* This routine is never used in single-threaded mode */ *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) - p = _sqlite3Malloc(tls, uint64(24)) + p = _sqlite3Malloc(tls, uint64(40)) if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask - (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + libc.Xmemset(tls, p, 0, uint64(40)) + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + ** function that returns SQLITE_ERROR when passed the argument 200, that + ** forces worker threads to run sequentially and deterministically + ** for testing purposes. */ + if _sqlite3FaultSim(tls, int32(200)) != 0 { + rc = int32(1) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) + } + if rc != 0 { + (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -19866,18 +17087,32 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui // // /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) (r int32) { + var rc, v1 int32 + _, _ = rc, v1 if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask != 0 { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TSQLiteThread)(unsafe.Pointer(p)).FxTask})))(tls, (*TSQLiteThread)(unsafe.Pointer(p)).FpIn) + if (*TSQLiteThread)(unsafe.Pointer(p)).Fdone != 0 { + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpOut + rc = SQLITE_OK } else { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpResult + if libc.Xpthread_join(tls, (*TSQLiteThread)(unsafe.Pointer(p)).Ftid, ppOut) != 0 { + v1 = int32(SQLITE_ERROR) + } else { + v1 = SQLITE_OK + } + rc = v1 } Xsqlite3_free(tls, p) - return SQLITE_OK + return rc } +/******************************** End Unix Pthreads *************************/ + +/********************************* Win32 Threads ****************************/ +/******************************** End Win32 Threads *************************/ + +/********************************* Single-Threaded **************************/ /****************************** End Single-Threaded *************************/ /************** End of threads.c *********************************************/ @@ -19987,6 +17222,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*uint8)(unsafe.Pointer(zOut)) = uint8(v & libc.Uint32FromInt32(0xff)) + return int32(1) + } + if v < uint32(0x00800) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 3)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20737,7 +18003,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -20912,7 +18178,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1732, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1753, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21124,11 +18390,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -21364,7 +18630,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -21454,7 +18720,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1757 + pow63 = __ccgo_ts + 1778 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21681,7 +18947,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1776)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -21841,7 +19107,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1792 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -21950,7 +19216,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22366,7 +19632,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1794, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1815, libc.VaList(bp+8, zType)) } // C documentation @@ -22389,13 +19655,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1673) + _logBadConnection(tls, __ccgo_ts+1668) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1839) + _logBadConnection(tls, __ccgo_ts+1860) } return 0 } else { @@ -22409,7 +19675,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1848) + _logBadConnection(tls, __ccgo_ts+1869) return 0 } else { return int32(1) @@ -22440,7 +19706,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -22791,23 +20057,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = *(*uint8)(unsafe.Pointer(v2)) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*uint8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))) h *= uint32(0x9e3779b1) } return h @@ -22862,8 +20126,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -22896,9 +20160,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -22918,13 +20181,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -22932,7 +20194,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -22948,7 +20210,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -22960,7 +20222,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -23009,7 +20271,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -23019,20 +20281,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -23051,196 +20312,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1856, - 1: __ccgo_ts + 1866, - 2: __ccgo_ts + 1877, - 3: __ccgo_ts + 1889, - 4: __ccgo_ts + 1900, - 5: __ccgo_ts + 1912, - 6: __ccgo_ts + 1919, - 7: __ccgo_ts + 1927, - 8: __ccgo_ts + 1935, - 9: __ccgo_ts + 1940, - 10: __ccgo_ts + 1945, - 11: __ccgo_ts + 1951, - 12: __ccgo_ts + 1965, - 13: __ccgo_ts + 1971, - 14: __ccgo_ts + 1981, - 15: __ccgo_ts + 1986, - 16: __ccgo_ts + 1991, - 17: __ccgo_ts + 1994, - 18: __ccgo_ts + 2000, - 19: __ccgo_ts + 2007, - 20: __ccgo_ts + 2011, - 21: __ccgo_ts + 2021, - 22: __ccgo_ts + 2028, - 23: __ccgo_ts + 2035, - 24: __ccgo_ts + 2042, - 25: __ccgo_ts + 2049, - 26: __ccgo_ts + 2059, - 27: __ccgo_ts + 2068, - 28: __ccgo_ts + 2079, - 29: __ccgo_ts + 2088, - 30: __ccgo_ts + 2094, - 31: __ccgo_ts + 2104, - 32: __ccgo_ts + 2114, - 33: __ccgo_ts + 2119, - 34: __ccgo_ts + 2133, - 35: __ccgo_ts + 2144, - 36: __ccgo_ts + 2149, - 37: __ccgo_ts + 2156, - 38: __ccgo_ts + 2167, - 39: __ccgo_ts + 2172, - 40: __ccgo_ts + 2177, - 41: __ccgo_ts + 2183, - 42: __ccgo_ts + 2189, - 43: __ccgo_ts + 2195, - 44: __ccgo_ts + 2198, - 45: __ccgo_ts + 2202, - 46: __ccgo_ts + 2208, - 47: __ccgo_ts + 2219, - 48: __ccgo_ts + 2230, - 49: __ccgo_ts + 2238, - 50: __ccgo_ts + 2247, - 51: __ccgo_ts + 2253, - 52: __ccgo_ts + 2260, - 53: __ccgo_ts + 2268, - 54: __ccgo_ts + 2271, - 55: __ccgo_ts + 2274, - 56: __ccgo_ts + 2277, - 57: __ccgo_ts + 2280, - 58: __ccgo_ts + 2283, - 59: __ccgo_ts + 2286, - 60: __ccgo_ts + 2293, - 61: __ccgo_ts + 2303, - 62: __ccgo_ts + 2316, - 63: __ccgo_ts + 2327, - 64: __ccgo_ts + 2333, - 65: __ccgo_ts + 2340, - 66: __ccgo_ts + 2349, - 67: __ccgo_ts + 2358, - 68: __ccgo_ts + 2365, - 69: __ccgo_ts + 2378, - 70: __ccgo_ts + 2389, - 71: __ccgo_ts + 2394, - 72: __ccgo_ts + 2402, - 73: __ccgo_ts + 2408, - 74: __ccgo_ts + 2415, - 75: __ccgo_ts + 2427, - 76: __ccgo_ts + 2432, - 77: __ccgo_ts + 2441, - 78: __ccgo_ts + 2446, - 79: __ccgo_ts + 2455, - 80: __ccgo_ts + 2460, - 81: __ccgo_ts + 2465, - 82: __ccgo_ts + 2471, - 83: __ccgo_ts + 2479, - 84: __ccgo_ts + 2487, - 85: __ccgo_ts + 2497, - 86: __ccgo_ts + 2505, - 87: __ccgo_ts + 2512, - 88: __ccgo_ts + 2525, - 89: __ccgo_ts + 2530, - 90: __ccgo_ts + 2542, - 91: __ccgo_ts + 2550, - 92: __ccgo_ts + 2557, - 93: __ccgo_ts + 2568, - 94: __ccgo_ts + 2575, - 95: __ccgo_ts + 2582, - 96: __ccgo_ts + 2592, - 97: __ccgo_ts + 2601, - 98: __ccgo_ts + 2612, - 99: __ccgo_ts + 2618, - 100: __ccgo_ts + 2629, - 101: __ccgo_ts + 2639, - 102: __ccgo_ts + 2649, - 103: __ccgo_ts + 2658, - 104: __ccgo_ts + 2665, - 105: __ccgo_ts + 2671, - 106: __ccgo_ts + 2681, - 107: __ccgo_ts + 2692, - 108: __ccgo_ts + 2696, - 109: __ccgo_ts + 2705, - 110: __ccgo_ts + 2714, - 111: __ccgo_ts + 2721, - 112: __ccgo_ts + 2731, - 113: __ccgo_ts + 2738, - 114: __ccgo_ts + 2748, - 115: __ccgo_ts + 2756, - 116: __ccgo_ts + 2763, - 117: __ccgo_ts + 2777, - 118: __ccgo_ts + 2791, - 119: __ccgo_ts + 2799, - 120: __ccgo_ts + 2810, - 121: __ccgo_ts + 2823, - 122: __ccgo_ts + 2834, - 123: __ccgo_ts + 2840, - 124: __ccgo_ts + 2852, - 125: __ccgo_ts + 2861, - 126: __ccgo_ts + 2869, - 127: __ccgo_ts + 2878, - 128: __ccgo_ts + 2887, - 129: __ccgo_ts + 2894, - 130: __ccgo_ts + 2902, - 131: __ccgo_ts + 2909, - 132: __ccgo_ts + 2920, - 133: __ccgo_ts + 2934, - 134: __ccgo_ts + 2945, - 135: __ccgo_ts + 2953, - 136: __ccgo_ts + 2959, - 137: __ccgo_ts + 2967, - 138: __ccgo_ts + 2975, - 139: __ccgo_ts + 2985, - 140: __ccgo_ts + 2998, - 141: __ccgo_ts + 3008, - 142: __ccgo_ts + 3021, - 143: __ccgo_ts + 3030, - 144: __ccgo_ts + 3041, - 145: __ccgo_ts + 3049, - 146: __ccgo_ts + 3055, - 147: __ccgo_ts + 3067, - 148: __ccgo_ts + 3079, - 149: __ccgo_ts + 3087, - 150: __ccgo_ts + 3099, - 151: __ccgo_ts + 3112, - 152: __ccgo_ts + 3122, - 153: __ccgo_ts + 3132, - 154: __ccgo_ts + 3144, - 155: __ccgo_ts + 3149, - 156: __ccgo_ts + 3161, - 157: __ccgo_ts + 3171, - 158: __ccgo_ts + 3177, - 159: __ccgo_ts + 3187, - 160: __ccgo_ts + 3194, - 161: __ccgo_ts + 3206, - 162: __ccgo_ts + 3217, - 163: __ccgo_ts + 3225, - 164: __ccgo_ts + 3234, - 165: __ccgo_ts + 3243, - 166: __ccgo_ts + 3252, - 167: __ccgo_ts + 3259, - 168: __ccgo_ts + 3270, - 169: __ccgo_ts + 3283, - 170: __ccgo_ts + 3293, - 171: __ccgo_ts + 3300, - 172: __ccgo_ts + 3308, - 173: __ccgo_ts + 3317, - 174: __ccgo_ts + 3323, - 175: __ccgo_ts + 3330, - 176: __ccgo_ts + 3338, - 177: __ccgo_ts + 3346, - 178: __ccgo_ts + 3354, - 179: __ccgo_ts + 3364, - 180: __ccgo_ts + 3373, - 181: __ccgo_ts + 3384, - 182: __ccgo_ts + 3395, - 183: __ccgo_ts + 3406, - 184: __ccgo_ts + 3416, - 185: __ccgo_ts + 3422, - 186: __ccgo_ts + 3433, - 187: __ccgo_ts + 3444, - 188: __ccgo_ts + 3449, - 189: __ccgo_ts + 3457, + 0: __ccgo_ts + 1877, + 1: __ccgo_ts + 1887, + 2: __ccgo_ts + 1898, + 3: __ccgo_ts + 1910, + 4: __ccgo_ts + 1921, + 5: __ccgo_ts + 1933, + 6: __ccgo_ts + 1940, + 7: __ccgo_ts + 1948, + 8: __ccgo_ts + 1956, + 9: __ccgo_ts + 1961, + 10: __ccgo_ts + 1966, + 11: __ccgo_ts + 1972, + 12: __ccgo_ts + 1986, + 13: __ccgo_ts + 1992, + 14: __ccgo_ts + 2002, + 15: __ccgo_ts + 2007, + 16: __ccgo_ts + 2012, + 17: __ccgo_ts + 2015, + 18: __ccgo_ts + 2021, + 19: __ccgo_ts + 2028, + 20: __ccgo_ts + 2032, + 21: __ccgo_ts + 2042, + 22: __ccgo_ts + 2049, + 23: __ccgo_ts + 2056, + 24: __ccgo_ts + 2063, + 25: __ccgo_ts + 2070, + 26: __ccgo_ts + 2080, + 27: __ccgo_ts + 2089, + 28: __ccgo_ts + 2100, + 29: __ccgo_ts + 2109, + 30: __ccgo_ts + 2115, + 31: __ccgo_ts + 2125, + 32: __ccgo_ts + 2135, + 33: __ccgo_ts + 2140, + 34: __ccgo_ts + 2154, + 35: __ccgo_ts + 2165, + 36: __ccgo_ts + 2170, + 37: __ccgo_ts + 2177, + 38: __ccgo_ts + 2188, + 39: __ccgo_ts + 2193, + 40: __ccgo_ts + 2198, + 41: __ccgo_ts + 2204, + 42: __ccgo_ts + 2210, + 43: __ccgo_ts + 2216, + 44: __ccgo_ts + 2219, + 45: __ccgo_ts + 2223, + 46: __ccgo_ts + 2229, + 47: __ccgo_ts + 2240, + 48: __ccgo_ts + 2251, + 49: __ccgo_ts + 2259, + 50: __ccgo_ts + 2268, + 51: __ccgo_ts + 2274, + 52: __ccgo_ts + 2281, + 53: __ccgo_ts + 2289, + 54: __ccgo_ts + 2292, + 55: __ccgo_ts + 2295, + 56: __ccgo_ts + 2298, + 57: __ccgo_ts + 2301, + 58: __ccgo_ts + 2304, + 59: __ccgo_ts + 2307, + 60: __ccgo_ts + 2314, + 61: __ccgo_ts + 2324, + 62: __ccgo_ts + 2337, + 63: __ccgo_ts + 2348, + 64: __ccgo_ts + 2354, + 65: __ccgo_ts + 2361, + 66: __ccgo_ts + 2370, + 67: __ccgo_ts + 2379, + 68: __ccgo_ts + 2386, + 69: __ccgo_ts + 2399, + 70: __ccgo_ts + 2410, + 71: __ccgo_ts + 2415, + 72: __ccgo_ts + 2423, + 73: __ccgo_ts + 2429, + 74: __ccgo_ts + 2436, + 75: __ccgo_ts + 2448, + 76: __ccgo_ts + 2453, + 77: __ccgo_ts + 2462, + 78: __ccgo_ts + 2467, + 79: __ccgo_ts + 2476, + 80: __ccgo_ts + 2481, + 81: __ccgo_ts + 2486, + 82: __ccgo_ts + 2492, + 83: __ccgo_ts + 2500, + 84: __ccgo_ts + 2508, + 85: __ccgo_ts + 2518, + 86: __ccgo_ts + 2526, + 87: __ccgo_ts + 2533, + 88: __ccgo_ts + 2546, + 89: __ccgo_ts + 2551, + 90: __ccgo_ts + 2563, + 91: __ccgo_ts + 2571, + 92: __ccgo_ts + 2578, + 93: __ccgo_ts + 2589, + 94: __ccgo_ts + 2596, + 95: __ccgo_ts + 2603, + 96: __ccgo_ts + 2613, + 97: __ccgo_ts + 2622, + 98: __ccgo_ts + 2633, + 99: __ccgo_ts + 2639, + 100: __ccgo_ts + 2650, + 101: __ccgo_ts + 2660, + 102: __ccgo_ts + 2670, + 103: __ccgo_ts + 2679, + 104: __ccgo_ts + 2686, + 105: __ccgo_ts + 2692, + 106: __ccgo_ts + 2702, + 107: __ccgo_ts + 2713, + 108: __ccgo_ts + 2717, + 109: __ccgo_ts + 2726, + 110: __ccgo_ts + 2735, + 111: __ccgo_ts + 2742, + 112: __ccgo_ts + 2752, + 113: __ccgo_ts + 2759, + 114: __ccgo_ts + 2769, + 115: __ccgo_ts + 2777, + 116: __ccgo_ts + 2784, + 117: __ccgo_ts + 2798, + 118: __ccgo_ts + 2812, + 119: __ccgo_ts + 2820, + 120: __ccgo_ts + 2831, + 121: __ccgo_ts + 2844, + 122: __ccgo_ts + 2855, + 123: __ccgo_ts + 2861, + 124: __ccgo_ts + 2873, + 125: __ccgo_ts + 2882, + 126: __ccgo_ts + 2890, + 127: __ccgo_ts + 2899, + 128: __ccgo_ts + 2908, + 129: __ccgo_ts + 2915, + 130: __ccgo_ts + 2923, + 131: __ccgo_ts + 2930, + 132: __ccgo_ts + 2941, + 133: __ccgo_ts + 2955, + 134: __ccgo_ts + 2966, + 135: __ccgo_ts + 2974, + 136: __ccgo_ts + 2980, + 137: __ccgo_ts + 2988, + 138: __ccgo_ts + 2996, + 139: __ccgo_ts + 3006, + 140: __ccgo_ts + 3019, + 141: __ccgo_ts + 3029, + 142: __ccgo_ts + 3042, + 143: __ccgo_ts + 3051, + 144: __ccgo_ts + 3062, + 145: __ccgo_ts + 3070, + 146: __ccgo_ts + 3076, + 147: __ccgo_ts + 3088, + 148: __ccgo_ts + 3100, + 149: __ccgo_ts + 3108, + 150: __ccgo_ts + 3120, + 151: __ccgo_ts + 3133, + 152: __ccgo_ts + 3143, + 153: __ccgo_ts + 3153, + 154: __ccgo_ts + 3165, + 155: __ccgo_ts + 3170, + 156: __ccgo_ts + 3182, + 157: __ccgo_ts + 3192, + 158: __ccgo_ts + 3198, + 159: __ccgo_ts + 3208, + 160: __ccgo_ts + 3215, + 161: __ccgo_ts + 3227, + 162: __ccgo_ts + 3238, + 163: __ccgo_ts + 3246, + 164: __ccgo_ts + 3255, + 165: __ccgo_ts + 3264, + 166: __ccgo_ts + 3273, + 167: __ccgo_ts + 3280, + 168: __ccgo_ts + 3291, + 169: __ccgo_ts + 3304, + 170: __ccgo_ts + 3314, + 171: __ccgo_ts + 3321, + 172: __ccgo_ts + 3329, + 173: __ccgo_ts + 3338, + 174: __ccgo_ts + 3344, + 175: __ccgo_ts + 3351, + 176: __ccgo_ts + 3359, + 177: __ccgo_ts + 3367, + 178: __ccgo_ts + 3375, + 179: __ccgo_ts + 3385, + 180: __ccgo_ts + 3394, + 181: __ccgo_ts + 3405, + 182: __ccgo_ts + 3416, + 183: __ccgo_ts + 3427, + 184: __ccgo_ts + 3437, + 185: __ccgo_ts + 3443, + 186: __ccgo_ts + 3454, + 187: __ccgo_ts + 3465, + 188: __ccgo_ts + 3470, + 189: __ccgo_ts + 3478, } type Tregister_t = int64 @@ -23323,96 +20584,6 @@ type Tuseconds_t = uint32 type useconds_t = Tuseconds_t -type Tpthread_t = uintptr - -type pthread_t = Tpthread_t - -type Tpthread_once_t = int32 - -type pthread_once_t = Tpthread_once_t - -type Tpthread_key_t = uint32 - -type pthread_key_t = Tpthread_key_t - -type Tpthread_spinlock_t = int32 - -type pthread_spinlock_t = Tpthread_spinlock_t - -type Tpthread_mutexattr_t = struct { - F__attr uint32 -} - -type pthread_mutexattr_t = Tpthread_mutexattr_t - -type Tpthread_condattr_t = struct { - F__attr uint32 -} - -type pthread_condattr_t = Tpthread_condattr_t - -type Tpthread_barrierattr_t = struct { - F__attr uint32 -} - -type pthread_barrierattr_t = Tpthread_barrierattr_t - -type Tpthread_rwlockattr_t = struct { - F__attr [2]uint32 -} - -type pthread_rwlockattr_t = Tpthread_rwlockattr_t - -type Tpthread_attr_t = struct { - F__u struct { - F__vi [0][14]int32 - F__s [0][7]uint64 - F__i [14]int32 - } -} - -type pthread_attr_t = Tpthread_attr_t - -type Tpthread_mutex_t = struct { - F__u struct { - F__vi [0][10]int32 - F__p [0][5]uintptr - F__i [10]int32 - } -} - -type pthread_mutex_t = Tpthread_mutex_t - -type Tpthread_cond_t = struct { - F__u struct { - F__vi [0][12]int32 - F__p [0][6]uintptr - F__i [12]int32 - } -} - -type pthread_cond_t = Tpthread_cond_t - -type Tpthread_rwlock_t = struct { - F__u struct { - F__vi [0][14]int32 - F__p [0][7]uintptr - F__i [14]int32 - } -} - -type pthread_rwlock_t = Tpthread_rwlock_t - -type Tpthread_barrier_t = struct { - F__u struct { - F__vi [0][8]int32 - F__p [0][4]uintptr - F__i [8]int32 - } -} - -type pthread_barrier_t = Tpthread_barrier_t - type Tu_int8_t = uint8 type u_int8_t = Tu_int8_t @@ -23484,14 +20655,6 @@ type Ttimeval = struct { type timeval = Ttimeval -type Tsigset_t = struct { - F__bits [16]uint64 -} - -type sigset_t = Tsigset_t - -type t__sigset_t = Tsigset_t - type Tfd_mask = uint64 type fd_mask = Tfd_mask @@ -23722,22 +20885,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -23768,30 +20915,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -23873,91 +20996,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3467, + FzName: __ccgo_ts + 3488, }, 1: { - FzName: __ccgo_ts + 3472, + FzName: __ccgo_ts + 3493, }, 2: { - FzName: __ccgo_ts + 3478, + FzName: __ccgo_ts + 3499, }, 3: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3506, }, 4: { - FzName: __ccgo_ts + 3492, + FzName: __ccgo_ts + 3513, }, 5: { - FzName: __ccgo_ts + 3497, + FzName: __ccgo_ts + 3518, }, 6: { - FzName: __ccgo_ts + 3503, + FzName: __ccgo_ts + 3524, }, 7: { - FzName: __ccgo_ts + 3513, + FzName: __ccgo_ts + 3534, }, 8: { - FzName: __ccgo_ts + 3519, + FzName: __ccgo_ts + 3540, }, 9: { - FzName: __ccgo_ts + 3524, + FzName: __ccgo_ts + 3545, }, 10: { - FzName: __ccgo_ts + 3530, + FzName: __ccgo_ts + 3551, }, 11: { - FzName: __ccgo_ts + 3538, + FzName: __ccgo_ts + 3559, }, 12: { - FzName: __ccgo_ts + 3544, + FzName: __ccgo_ts + 3565, }, 13: { - FzName: __ccgo_ts + 3551, + FzName: __ccgo_ts + 3572, }, 14: { - FzName: __ccgo_ts + 3560, + FzName: __ccgo_ts + 3581, }, 15: { - FzName: __ccgo_ts + 3567, + FzName: __ccgo_ts + 3588, }, 16: { - FzName: __ccgo_ts + 3577, + FzName: __ccgo_ts + 3598, }, 17: { - FzName: __ccgo_ts + 3584, + FzName: __ccgo_ts + 3605, }, 18: { - FzName: __ccgo_ts + 3598, + FzName: __ccgo_ts + 3619, }, 19: { - FzName: __ccgo_ts + 3604, + FzName: __ccgo_ts + 3625, }, 20: { - FzName: __ccgo_ts + 3610, + FzName: __ccgo_ts + 3631, }, 21: { - FzName: __ccgo_ts + 3617, + FzName: __ccgo_ts + 3638, }, 22: { - FzName: __ccgo_ts + 3625, + FzName: __ccgo_ts + 3646, }, 23: { - FzName: __ccgo_ts + 3630, + FzName: __ccgo_ts + 3651, }, 24: { - FzName: __ccgo_ts + 3637, + FzName: __ccgo_ts + 3658, }, 25: { - FzName: __ccgo_ts + 3644, + FzName: __ccgo_ts + 3665, }, 26: { - FzName: __ccgo_ts + 3656, + FzName: __ccgo_ts + 3677, }, 27: { - FzName: __ccgo_ts + 3665, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3671, + FzName: __ccgo_ts + 3692, }, } @@ -24018,7 +21141,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24056,10 +21179,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24196,9 +21319,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3677, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3698, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3720, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3741, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -24434,47 +21557,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24514,11 +21596,11 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint ** equivalent to errno. Otherwise, use strerror_r(). */ /* This is a threadsafe build, but strerror_r() is not available. */ - zErr = __ccgo_ts + 1672 + zErr = __ccgo_ts + 1667 if zPath == uintptr(0) { - zPath = __ccgo_ts + 1672 + zPath = __ccgo_ts + 1667 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3730, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3751, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24546,7 +21628,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint64(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3814, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3841, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25205,7 +22287,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25810,7 +22892,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]uint8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3869, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3890, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -25836,7 +22918,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3584, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3605, bp, int32(42579)) } // C documentation @@ -25873,7 +22955,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<= nSize { iWrite = nSize - int64(1) } - nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1672, int32(1)) + nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1667, int32(1)) if nWrite != int32(1) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(3)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26421,7 +23414,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26484,7 +23477,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -26715,9 +23708,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte break } *(*int32)(unsafe.Pointer(bp + 144)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1672, int32(1), bp+144) != int32(1) { + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1667, int32(1), bp+144) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27485,10 +24477,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3926, - 3: __ccgo_ts + 3935, - 4: __ccgo_ts + 3944, - 5: __ccgo_ts + 1685, + 2: __ccgo_ts + 3947, + 3: __ccgo_ts + 3956, + 4: __ccgo_ts + 3965, + 5: __ccgo_ts + 1706, } // C documentation @@ -27497,8 +24489,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3949) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3963) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3970) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3984) } // C documentation @@ -27560,7 +24552,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = uint8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3970, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3991, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -27732,7 +24724,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3987) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4008) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -27887,7 +24879,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3467, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3488, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -27964,7 +24956,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+144, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(4098)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3656, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3677, zIn, int32(45510)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 144)))[got] = uint8(0) @@ -28162,14 +25144,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3485, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3506, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*uint8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = uint8(0) if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -29974,7 +26796,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -30028,7 +26856,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -30072,7 +26900,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30147,7 +26975,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30201,7 +27029,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30235,66 +27063,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30468,14 +27236,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31291,123 +28059,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31488,7 +28139,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -31582,7 +28233,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -31623,7 +28274,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -31751,7 +28402,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -31771,17 +28422,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -31799,7 +28452,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -31811,7 +28464,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -32012,10 +28665,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -32601,25 +29255,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -33581,258 +30216,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]uint8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -33931,7 +30314,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34160,7 +30543,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34178,7 +30561,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -34751,6 +31134,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35397,7 +31789,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 uint8 var _ /* exists at bp+8 */ int32 @@ -35409,7 +31802,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35430,11 +31823,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Uint8FromInt32(0) *(*uint8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35463,7 +31857,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -35696,7 +32090,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -35833,7 +32227,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -35849,7 +32243,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -36596,10 +32990,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37500,7 +33894,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37544,7 +33938,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -37575,7 +33969,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -37626,7 +34020,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -37661,7 +34055,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4152, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4173, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -37671,7 +34065,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4161, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4182, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -37713,8 +34107,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4166, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4173, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4187, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4194, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -37797,7 +34191,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38053,7 +34447,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38228,7 +34622,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38259,7 +34653,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38331,7 +34725,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -39391,7 +35785,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -39688,7 +36082,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -39956,7 +36350,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4183, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4204, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40520,9 +36914,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -40537,227 +36931,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -40776,28 +36949,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -40856,7 +37008,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -40868,7 +37020,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -40957,6 +37109,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41224,14 +37377,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41398,7 +37543,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41486,12 +37631,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -41625,7 +37770,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42066,10 +38211,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42167,7 +38312,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42206,7 +38351,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42219,7 +38364,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42235,7 +38380,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42256,7 +38401,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42322,7 +38467,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42372,7 +38517,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4238, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4259, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -42587,7 +38732,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -42613,7 +38765,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43336,8 +39488,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43424,7 +39576,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -43570,7 +39722,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -43597,7 +39749,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -43606,6 +39758,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -43650,6 +39803,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -43921,7 +40077,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44102,7 +40258,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44111,7 +40267,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44163,14 +40319,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -44716,283 +40872,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45125,27 +41004,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45308,10 +41166,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45320,14 +41179,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -46027,11 +41886,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46205,7 +42064,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46218,12 +42077,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46267,7 +42126,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46275,7 +42134,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46463,7 +42322,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46496,7 +42355,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46695,7 +42554,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -46735,12 +42594,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -46748,21 +42607,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -46809,12 +42668,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -46830,7 +42689,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -46890,7 +42749,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -46907,14 +42766,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -46957,11 +42816,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -46975,7 +42834,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -47028,42 +42887,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47071,70 +42928,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47180,7 +43037,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47206,7 +43063,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47245,12 +43102,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47277,7 +43134,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47308,11 +43165,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47341,11 +43198,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47354,7 +43211,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47376,30 +43233,28 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt32(flags) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(libc.Uint8FromInt32(flags)) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47507,7 +43362,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -47569,7 +43424,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -47657,7 +43512,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4264) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4285) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48281,7 +44136,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48443,7 +44298,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4273, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4294, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48481,7 +44336,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -48922,7 +44777,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -48946,7 +44801,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -48955,7 +44810,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -48969,7 +44824,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -48999,7 +44854,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49095,7 +44950,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49133,7 +44988,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49200,7 +45055,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49243,7 +45098,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49273,7 +45128,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49739,7 +45594,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50131,7 +45986,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50141,7 +45996,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50172,7 +46027,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50198,7 +46053,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50272,7 +46127,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50407,7 +46262,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50419,7 +46274,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -50535,7 +46390,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50549,7 +46404,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -50783,7 +46638,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -50867,7 +46722,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -50879,7 +46734,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51081,7 +46936,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51114,7 +46969,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51123,7 +46978,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51252,7 +47107,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51362,7 +47217,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51450,7 +47305,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51505,7 +47360,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51531,7 +47386,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51558,7 +47413,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -51629,7 +47484,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51767,7 +47622,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -51818,7 +47673,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -51827,7 +47682,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -51917,7 +47772,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -51935,7 +47790,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -51958,7 +47813,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52179,10 +48034,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52473,17 +48328,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -52573,12 +48417,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -52586,7 +48430,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -52681,7 +48525,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -52762,7 +48606,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -52789,7 +48633,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -52829,7 +48673,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -52900,7 +48744,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -52945,7 +48789,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53141,10 +48985,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53267,8 +49112,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53308,7 +49153,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53331,7 +49176,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53462,7 +49307,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53505,7 +49350,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -53564,7 +49409,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -53596,7 +49441,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -53826,7 +49671,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54072,7 +49917,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54145,7 +49990,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54304,7 +50149,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54335,7 +50180,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54420,7 +50265,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54512,7 +50357,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54548,7 +50393,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -54578,10 +50423,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -54699,12 +50544,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -54714,14 +50559,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -54821,21 +50666,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -54929,7 +50774,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -55039,7 +50884,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55080,7 +50925,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55161,14 +51006,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55305,7 +51150,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55570,7 +51415,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4277, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4298, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -55618,11 +51463,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4279, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4300, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4302, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4323, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -55648,11 +51493,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4432, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4453, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -55724,11 +51569,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4471 + v2 = __ccgo_ts + 4492 } else { - v2 = __ccgo_ts + 4476 + v2 = __ccgo_ts + 4497 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4497, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4518, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -55864,12 +51709,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4523 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4544 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4541, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4562, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4695, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4725, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -55954,7 +51799,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4749, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -55977,7 +51822,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4773, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4794, 0) depth = d2 } } else { @@ -56054,7 +51899,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4798, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4819, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56068,7 +51913,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4835, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4856, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56159,7 +52004,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4887 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4908 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56183,11 +52028,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4898, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4919, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4943, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56224,10 +52069,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4998, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5019, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5018, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56357,14 +52202,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -56575,45 +52420,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -56666,7 +52472,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3869, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -56676,7 +52482,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5050, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5071, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -56705,7 +52511,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5070, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -56735,7 +52541,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5101, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5122, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57413,7 +53219,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5141, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+48, v1)) *(*uint8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = uint8(0) /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57551,9 +53357,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = uint8(0) @@ -57728,20 +53531,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -57756,10 +53559,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58218,21 +54021,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } *(*uintptr)(unsafe.Pointer(pMem)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58391,7 +54194,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58433,11 +54236,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58447,7 +54250,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58469,12 +54272,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58513,7 +54316,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -58625,8 +54428,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -58677,7 +54480,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -58685,8 +54489,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -58743,14 +54547,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -58764,7 +54568,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -58789,14 +54593,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3869, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -58854,7 +54658,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1672 + zNeg = __ccgo_ts + 1667 rc = SQLITE_OK for { v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -58896,7 +54700,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5148 + zNeg = __ccgo_ts + 5169 } } } @@ -58911,7 +54715,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5150, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5171, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59215,7 +55019,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59231,7 +55035,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59241,7 +55045,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59292,9 +55096,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59368,7 +55172,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -59702,12 +55506,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -59881,7 +55684,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -59898,7 +55701,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -59966,8 +55769,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -59980,11 +55783,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -60021,13 +55824,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60058,7 +55864,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -60560,7 +56366,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5155, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -60570,66 +56376,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5160) == 0 { - zColl = __ccgo_ts + 5167 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5181) == 0 { + zColl = __ccgo_ts + 5188 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5148 + v3 = __ccgo_ts + 5169 } else { - v3 = __ccgo_ts + 1672 + v3 = __ccgo_ts + 1667 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5169 + v4 = __ccgo_ts + 5190 } else { - v4 = __ccgo_ts + 1672 + v4 = __ccgo_ts + 1667 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5172, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5193, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5205, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5205, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1433, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5212, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5233, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1400, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1433, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1400, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1673 + zP4 = __ccgo_ts + 1668 } else { - zP4 = __ccgo_ts + 5215 + zP4 = __ccgo_ts + 5236 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5222, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5243, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -60644,20 +56450,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5230, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5251, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5235, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5256, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5237 + zP4 = __ccgo_ts + 5258 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5245, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5266, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -60671,10 +56477,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5182, - 1: __ccgo_ts + 5184, - 2: __ccgo_ts + 5186, - 3: __ccgo_ts + 5191, + 0: __ccgo_ts + 5203, + 1: __ccgo_ts + 5205, + 2: __ccgo_ts + 5207, + 3: __ccgo_ts + 5212, } // C documentation @@ -61471,7 +57277,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -61490,7 +57296,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61498,7 +57304,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -61625,7 +57431,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5261, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5282, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -61633,18 +57439,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5273, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5294, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5287, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5308, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5302, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5323, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -61875,7 +57681,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63263,7 +59069,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63298,7 +59104,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63352,7 +59158,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63484,7 +59290,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -63636,7 +59442,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -63667,7 +59473,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -63818,15 +59624,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5345 + zContext = __ccgo_ts + 5366 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5364 + zContext = __ccgo_ts + 5385 } else { - zContext = __ccgo_ts + 5383 + zContext = __ccgo_ts + 5404 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5392, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5413, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -63921,10 +59727,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -63933,9 +59740,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -64015,7 +59822,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5428, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5449, 0) return int32(1) } else { return 0 @@ -64025,7 +59832,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5473, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5494, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64083,7 +59890,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64410,12 +60217,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64432,29 +60239,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64484,13 +60295,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64502,11 +60315,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -64514,23 +60331,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -64586,7 +60409,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5513, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5534, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -64787,7 +60610,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -64917,7 +60740,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65086,6 +60909,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65099,7 +60924,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65137,13 +60962,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65377,18 +61202,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5536, - 1: __ccgo_ts + 5541, - 2: __ccgo_ts + 5548, - 3: __ccgo_ts + 5551, - 4: __ccgo_ts + 5554, - 5: __ccgo_ts + 5557, - 6: __ccgo_ts + 5560, - 7: __ccgo_ts + 5563, - 8: __ccgo_ts + 5571, - 9: __ccgo_ts + 5574, - 10: __ccgo_ts + 5581, - 11: __ccgo_ts + 5589, + 0: __ccgo_ts + 5557, + 1: __ccgo_ts + 5562, + 2: __ccgo_ts + 5569, + 3: __ccgo_ts + 5572, + 4: __ccgo_ts + 5575, + 5: __ccgo_ts + 5578, + 6: __ccgo_ts + 5581, + 7: __ccgo_ts + 5584, + 8: __ccgo_ts + 5592, + 9: __ccgo_ts + 5595, + 10: __ccgo_ts + 5602, + 11: __ccgo_ts + 5610, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -65643,14 +61468,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5596, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5617, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -65688,7 +61513,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -65698,7 +61523,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -65709,24 +61534,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -65774,7 +61603,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -65782,32 +61613,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66224,11 +62061,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66237,7 +62074,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66251,7 +62088,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66286,7 +62123,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, (*TColumn)(unsafe.Pointer(pCol)).Faffinity, bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66321,7 +62158,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66387,11 +62224,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66414,7 +62251,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66436,7 +62273,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66563,7 +62400,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5636, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5657, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -66595,13 +62432,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*56 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1673, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1668, int32(4)) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1433, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1428, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5141, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5162, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -66616,28 +62453,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5640, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5661, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5647, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5668, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5660, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5681, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5663, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5684, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5668, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -66801,9 +62638,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -66829,12 +62666,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -66843,28 +62678,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67237,11 +63072,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1142, - 1: __ccgo_ts + 1154, - 2: __ccgo_ts + 1159, - 3: __ccgo_ts + 1137, - 4: __ccgo_ts + 1673, + 0: __ccgo_ts + 1137, + 1: __ccgo_ts + 1149, + 2: __ccgo_ts + 1154, + 3: __ccgo_ts + 1132, + 4: __ccgo_ts + 1668, } // C documentation @@ -67255,12 +63090,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity uint8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67277,7 +63112,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -67295,7 +63130,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -68009,19 +63844,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5704, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5725, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5725, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5746, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5732, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5753, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69235,7 +65070,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69251,6 +65086,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -69744,7 +65585,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -69847,7 +65688,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5756, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5775, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5870, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5889, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70443,7 +66284,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5924, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5943, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70473,12 +66314,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5979 + v250 = __ccgo_ts + 5998 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6027 + v251 = __ccgo_ts + 6046 } else { - v251 = __ccgo_ts + 6070 + v251 = __ccgo_ts + 6089 } v250 = v251 } @@ -70570,7 +66411,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6111) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6130) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -70888,7 +66729,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1672 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1667 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -71654,7 +67495,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, uint8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -71681,7 +67522,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72140,7 +67981,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -72573,7 +68414,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -72903,7 +68744,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -72934,13 +68775,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6156 + zSchema = __ccgo_ts + 6175 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6170, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6189, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -72955,7 +68796,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73192,7 +69033,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6213, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6232, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73209,15 +69050,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73298,11 +69139,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73514,7 +69355,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -73564,7 +69405,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -73620,7 +69461,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -73699,11 +69540,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6250 + v286 = __ccgo_ts + 6269 } else { - v286 = __ccgo_ts + 6255 + v286 = __ccgo_ts + 6274 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6262, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6281, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -73856,7 +69697,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6314, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -74018,7 +69859,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6343, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6362, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74098,12 +69939,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74114,7 +69955,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74208,7 +70049,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74236,11 +70077,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74368,7 +70209,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74519,7 +70360,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6353, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -74606,15 +70447,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -75080,11 +70900,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3869 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75163,14 +70983,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75189,11 +71009,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75269,7 +71089,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75283,7 +71103,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3869 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -75550,108 +71370,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -76015,7 +71570,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76341,8 +71896,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76356,9 +71911,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76506,8 +72061,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76556,18 +72111,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -76701,7 +72257,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -76855,6 +72411,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78350,57 +73909,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -78697,7 +74205,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79400,25 +74908,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6660, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6680, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6668+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6687+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6688+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6707+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6156+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6175+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6706+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6706+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } @@ -79457,23 +74965,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79505,7 +75012,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6720, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6740, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -79599,7 +75106,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6725) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6745) != 0 { goto _2 } } @@ -79621,57 +75128,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -79716,11 +75210,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6727, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6747, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6731, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6751, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -79729,36 +75223,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6735, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6755, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -79787,18 +75270,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -79845,15 +75328,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6744, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6764, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6775, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6795, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -79864,8 +75347,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -79905,7 +75388,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6830, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6850, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -79925,7 +75408,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -79934,7 +75417,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6865 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6885 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -79944,26 +75427,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6874 + v8 = __ccgo_ts + 6894 } else { - v10 = __ccgo_ts + 6889 + v8 = __ccgo_ts + 6909 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6911, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6931, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6934, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6995, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -80012,8 +75495,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80087,19 +75570,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 7002 + zIn = __ccgo_ts + 7022 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7030 + zIn = __ccgo_ts + 7050 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7048 + zIn = __ccgo_ts + 7068 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7066 + zIn = __ccgo_ts + 7086 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7084, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7104, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80125,7 +75608,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80271,7 +75754,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7104, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7124, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80326,7 +75809,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7121, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80350,7 +75833,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7185, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7205, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80364,13 +75847,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80390,16 +75873,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7221, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7241, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80410,35 +75890,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7249, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7269, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7292 + zType = __ccgo_ts + 7312 } else { - zType = __ccgo_ts + 7299 + zType = __ccgo_ts + 7319 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7309, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7329, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7337, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7359, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7379, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7403, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80523,7 +76006,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7451, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7471, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -80535,7 +76018,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7462, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7482, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -80581,7 +76064,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -80706,7 +76189,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7473, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7493, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -80741,7 +76224,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7529, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -80779,7 +76262,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7563, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7583, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -80849,7 +76332,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7569, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7589, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -80883,7 +76366,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7630, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7650, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81196,7 +76679,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7661, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7681, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81263,7 +76746,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7563) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81274,7 +76757,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7700) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7720) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81284,7 +76767,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7706, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7726, 0) return int32(WRC_Abort) } goto _6 @@ -81506,33 +76989,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -81584,7 +77069,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -81792,7 +77277,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82267,7 +77752,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82346,7 +77831,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7765, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82533,7 +78018,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -82691,11 +78176,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7813 + v2 = __ccgo_ts + 7833 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7815, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7835, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -82741,10 +78226,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1792) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -82772,7 +78257,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7859, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7879, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -82792,7 +78277,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7893, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7913, libc.VaList(bp+8, p)) } // C documentation @@ -82863,7 +78348,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7943, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+8, pExpr)) } } } @@ -82915,7 +78400,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7983, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -82948,7 +78433,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8006, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83184,12 +78669,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83331,7 +78810,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83471,7 +78950,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83492,27 +78970,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -83558,9 +79029,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -83570,8 +79041,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -83585,7 +79056,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -83636,7 +79107,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -83717,7 +79188,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -83735,7 +79206,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -83816,7 +79287,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8029, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -83945,7 +79416,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8059, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84043,10 +79514,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8082) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8102) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8087) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8107) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -84724,13 +80195,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) (r i // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8093) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8113) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8101) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8121) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8107) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8127) == 0 { return int32(1) } return 0 @@ -84745,32 +80216,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8093, - 1: __ccgo_ts + 8101, - 2: __ccgo_ts + 8107, + 0: __ccgo_ts + 8113, + 1: __ccgo_ts + 8121, + 2: __ccgo_ts + 8127, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -84979,7 +80437,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -85032,7 +80490,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8111, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8131, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85132,12 +80590,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1792) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -85729,7 +81188,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8326) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8346) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -85825,14 +81284,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -85860,9 +81319,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -85995,7 +81454,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86125,13 +81584,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -86911,7 +82375,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8419, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -86923,7 +82387,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -86938,7 +82402,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8446, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8466, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -86967,7 +82431,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87043,7 +82507,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8029, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87106,7 +82570,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87116,7 +82580,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87124,7 +82588,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87137,9 +82601,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87221,7 +82685,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8470, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8490, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87292,17 +82756,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87311,7 +82775,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87323,6 +82787,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87342,7 +82827,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87412,7 +82897,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87456,7 +82941,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87529,7 +83014,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -87556,8 +83041,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -87723,7 +83208,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -87932,7 +83419,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88639,7 +84128,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -88868,10 +84357,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -88909,7 +84398,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88923,7 +84412,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88937,10 +84426,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -88950,25 +84442,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -88981,7 +84477,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -88991,11 +84487,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -89015,13 +84511,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89091,7 +84587,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89127,6 +84623,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89144,44 +84641,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89261,7 +84763,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89269,7 +84771,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -89287,7 +84789,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -89306,11 +84808,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -89428,8 +84930,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8520, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8569, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89447,10 +84949,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8548, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8723, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8772, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89466,9 +84968,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8897, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8946, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9044, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9093, 0) } } @@ -89524,7 +85026,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9195, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9244, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89533,11 +85035,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9254, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9303, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9260, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9309, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89567,21 +85069,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9287, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9336, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9471, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9520, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9776, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9792, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9825, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9850, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9899, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -89589,7 +85091,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -89597,7 +85099,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10115, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10164, 0) goto exit_rename_table exit_rename_table: ; @@ -89614,7 +85116,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10128, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10177, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -89654,11 +85156,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10166, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10215, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10198, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10247, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -89674,10 +85176,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10225) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10274) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10284) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10333) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -89689,13 +85191,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10337) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10386) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10383) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10432) } } /* Modify the CREATE TABLE statement. */ @@ -89709,7 +85211,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10410, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10459, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -89737,7 +85239,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10556, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10605, libc.VaList(bp+16, zTab, zDb)) } } } @@ -89775,12 +85277,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10909, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10958, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10943, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10992, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -89795,7 +85297,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -89803,8 +85305,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10973, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11022, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -89865,18 +85367,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11041 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10997 + zType = __ccgo_ts + 11046 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11011 + v1 = __ccgo_ts + 11060 } else { - v1 = __ccgo_ts + 11028 + v1 = __ccgo_ts + 11077 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11046, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11095, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89923,25 +85425,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11064, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1672, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -89953,11 +85443,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11085, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11267, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11134, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11316, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10115, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10164, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -89967,31 +85457,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -90008,16 +85473,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90320,9 +85775,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90433,11 +85888,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*uint8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11398 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11400, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11449, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90508,30 +85963,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11423, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11472, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90552,9 +86011,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -90570,15 +86028,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11431, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11480, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -90589,16 +86047,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, *(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -90615,21 +86073,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0) _sqlite3Dequote(tls, zBuf1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11398 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11437, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11486, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -90655,7 +86113,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -90965,7 +86423,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91107,7 +86565,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 32))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1672, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91232,7 +86690,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -91333,7 +86791,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*8))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1672, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91415,7 +86873,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91499,8 +86957,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -91516,12 +86975,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -91595,7 +87054,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -91612,7 +87071,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11442, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11491, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -91667,23 +87126,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11064, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11449 + v1 = __ccgo_ts + 11498 } else { - v1 = __ccgo_ts + 5679 + v1 = __ccgo_ts + 5700 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11461, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11510, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11489, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -91693,33 +87152,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1672, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11537, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11586, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11658, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11707, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -91733,7 +87192,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -91744,8 +87203,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -91806,27 +87265,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11676, + FzName: __ccgo_ts + 11725, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11697, + FzName: __ccgo_ts + 11746, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11717, + FzName: __ccgo_ts + 11766, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11736, + FzName: __ccgo_ts + 11785, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11755, + FzName: __ccgo_ts + 11804, }, } @@ -92037,8 +87496,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11858, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11907, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92048,10 +87512,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11881, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11911, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11960, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92083,15 +87547,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11778, - FzCols: __ccgo_ts + 11791, + FzName: __ccgo_ts + 11827, + FzCols: __ccgo_ts + 11840, }, 1: { - FzName: __ccgo_ts + 11804, - FzCols: __ccgo_ts + 11817, + FzName: __ccgo_ts + 11853, + FzCols: __ccgo_ts + 11866, }, 2: { - FzName: __ccgo_ts + 11845, + FzName: __ccgo_ts + 11894, }, } @@ -92144,44 +87608,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92305,7 +87731,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92321,12 +87748,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92334,7 +87761,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92393,7 +87820,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11929, + FzName: __ccgo_ts + 11978, } func init() { @@ -92767,7 +88194,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11939, + FzName: __ccgo_ts + 11988, } func init() { @@ -92817,7 +88244,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11949, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11998, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -92828,7 +88255,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11954, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12003, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -92867,7 +88294,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11960, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12009, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -92885,7 +88312,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11966, + FzName: __ccgo_ts + 12015, } func init() { @@ -92951,7 +88378,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11975, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12024, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -92960,12 +88387,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11778, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11827, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93087,7 +88514,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93167,7 +88594,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93198,7 +88625,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11985, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93289,7 +88716,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11985, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93326,7 +88753,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93359,11 +88786,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11989) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12038) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11993) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12042) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93471,13 +88898,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93492,7 +88912,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1672 + z = __ccgo_ts + 1667 } i = 0 for { @@ -93527,17 +88947,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*uint8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11997, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12046, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12008, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12057, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12018, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12067, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93549,13 +88969,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -93606,7 +89019,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -93809,8 +89222,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -93916,11 +89329,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11804, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11853, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12030, __ccgo_ts+12099, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12079, __ccgo_ts+12148, zDb) } return rc } @@ -93986,10 +89399,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11778, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12151, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12200, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94102,7 +89515,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6720, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6740, zName) == 0) } // C documentation @@ -94144,21 +89557,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1672 + zFile = __ccgo_ts + 1667 } if zName == uintptr(0) { - zName = __ccgo_ts + 1672 + zName = __ccgo_ts + 1667 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4041) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4062) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12192, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12241, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94189,7 +89602,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12195, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12244, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94198,7 +89611,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12232, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12281, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94210,13 +89623,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94254,7 +89667,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12262, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94262,7 +89675,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12291, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12340, 0) rc = int32(SQLITE_ERROR) } } @@ -94306,10 +89719,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12387, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12436, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12408, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12434, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12483, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94474,7 +89887,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12456, + FzName: __ccgo_ts + 12505, } func init() { @@ -94496,7 +89909,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12470, + FzName: __ccgo_ts + 12519, } func init() { @@ -94522,7 +89935,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12484, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12533, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94556,7 +89969,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12508, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12557, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -94683,6 +90096,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -94755,9 +90170,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -94773,7 +90188,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12554, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12603, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -94801,11 +90216,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12577, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12626, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12583, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12632, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12589, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12638, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -94865,7 +90280,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8101 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -94900,7 +90315,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12616, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12665, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -94937,47 +90352,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -95018,7 +90392,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95116,7 +90490,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95194,7 +90570,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95208,7 +90584,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95321,21 +90699,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6720) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6740) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6687+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6706+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6156+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6668) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6706+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6156) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95365,12 +90743,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6706+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6156) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6175) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6687+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6668) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } } @@ -95408,7 +90786,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12631, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12680, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95418,7 +90796,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95426,15 +90804,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12639 + v1 = __ccgo_ts + 12688 } else { - v1 = __ccgo_ts + 12652 + v1 = __ccgo_ts + 12701 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6995, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95472,12 +90850,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6156+7) == 0 { - return __ccgo_ts + 6706 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + return __ccgo_ts + 6726 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6668+7) == 0 { - return __ccgo_ts + 6687 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6688+7) == 0 { + return __ccgo_ts + 6707 } } return zName @@ -95601,9 +90979,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -96002,7 +91380,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6156) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6175) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -96034,7 +91412,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6720, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6740, zName) { break } goto _1 @@ -96092,13 +91470,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12666, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12683, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96142,12 +91520,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*8))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*8))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1672, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12703, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12752, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96183,23 +91561,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96319,7 +91699,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96362,9 +91742,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96377,7 +91757,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12745, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12794, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96393,9 +91773,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10992 + v2 = __ccgo_ts + 11041 } else { - v2 = __ccgo_ts + 9254 + v2 = __ccgo_ts + 9303 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96405,9 +91785,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6668 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6156 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96431,11 +91811,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10992 + v4 = __ccgo_ts + 11041 } else { - v4 = __ccgo_ts + 9254 + v4 = __ccgo_ts + 9303 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12786, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96443,11 +91823,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12807, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12856, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96479,19 +91859,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96511,15 +91901,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96534,7 +91929,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -96595,7 +91990,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12842, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -96604,14 +91999,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12876, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12925, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -96643,11 +92040,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity uint8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -96658,7 +92055,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12896, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -96668,12 +92065,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12919, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12968, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12926, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12975, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -96715,21 +92112,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*uint8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = uint8(0) _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12936, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -96740,7 +92126,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -96753,12 +92139,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*uint8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = uint8(0) _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -96930,10 +92325,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12962, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13011, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13007, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13056, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -96991,7 +92386,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13048, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13097, 0) } } @@ -97019,8 +92414,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -97028,7 +92423,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13100, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13149, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97047,21 +92442,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97084,7 +92468,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97112,8 +92496,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97200,17 +92589,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13197, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13240, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13289, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13248, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13297, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97242,7 +92631,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13255, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13304, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97383,9 +92772,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97396,31 +92786,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1672 - zSep2 = __ccgo_ts + 13286 - zEnd = __ccgo_ts + 5180 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1667 + zSep2 = __ccgo_ts + 13335 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13288 - zSep2 = __ccgo_ts + 13292 - zEnd = __ccgo_ts + 13297 + zSep = __ccgo_ts + 13337 + zSep2 = __ccgo_ts + 13341 + zEnd = __ccgo_ts + 13346 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13300, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13349, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97431,8 +92821,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97445,17 +92836,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3869, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1672, - 1: __ccgo_ts + 13314, - 2: __ccgo_ts + 13320, - 3: __ccgo_ts + 13325, - 4: __ccgo_ts + 13330, - 5: __ccgo_ts + 13320, + 0: __ccgo_ts + 1667, + 1: __ccgo_ts + 13363, + 2: __ccgo_ts + 13369, + 3: __ccgo_ts + 13374, + 4: __ccgo_ts + 13379, + 5: __ccgo_ts + 13369, } // C documentation @@ -97464,15 +92856,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97487,7 +92880,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -97720,8 +93113,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -97821,7 +93224,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -97834,8 +93237,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -97865,7 +93268,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98057,7 +93460,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1672, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -98084,9 +93487,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13336, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1672))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13385, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13369, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13418, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98107,11 +93510,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13396, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13445, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13446, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13495, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98158,7 +93561,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13478, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13527, 0) return } } @@ -98192,16 +93595,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9254 - zType2 = __ccgo_ts + 13522 + zType = __ccgo_ts + 9303 + zType2 = __ccgo_ts + 13571 } else { /* A view */ - zType = __ccgo_ts + 10992 - zType2 = __ccgo_ts + 13528 + zType = __ccgo_ts + 11041 + zType2 = __ccgo_ts + 13577 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98218,24 +93621,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98283,13 +93691,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13533, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13548, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13597, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98298,15 +93716,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13646, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13695, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13688, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13737, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13722, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13771, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98324,7 +93742,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9776) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9825) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98357,7 +93775,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13743, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13792, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98374,7 +93792,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10992, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11041, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98471,7 +93889,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13779, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13828, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -98655,7 +94073,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13809, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13858, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -98668,7 +94086,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13824, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13873, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -98751,9 +94169,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13891, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13940, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11881, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -98794,7 +94212,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13905, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -98803,7 +94221,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13950, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13999, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -98838,11 +94256,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3492, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3513, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7462, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7482, int32(10)) == 0 { return 0 } return int32(1) @@ -98897,9 +94315,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -98932,18 +94350,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14017, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14066, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14045, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14079, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14128, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -98953,7 +94371,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11993, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12042, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -99001,19 +94419,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14111, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14160, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14174, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -99070,7 +94488,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14268, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14317, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99185,11 +94603,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99211,7 +94629,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99256,13 +94674,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99285,23 +94703,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99330,11 +94748,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14314 + v2 = __ccgo_ts + 14363 } else { - v2 = __ccgo_ts + 14320 + v2 = __ccgo_ts + 14369 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14325, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14374, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99412,7 +94830,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14353, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14402, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99422,7 +94840,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14359, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14408, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99436,16 +94854,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14409, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14458, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14437, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14462, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14511, 0) goto exit_create_index } /* @@ -99466,19 +94884,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14353, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14402, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14496, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14545, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14530, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14579, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99499,7 +94917,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14554, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14603, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99517,9 +94935,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6668 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6156 + v2 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99547,7 +94965,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14353) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14402) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -99579,7 +94997,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -99631,7 +95049,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14577, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14626, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -99641,7 +95059,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -99651,8 +95069,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -99730,7 +95148,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -99778,7 +95196,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14638, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14687, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -99808,8 +95226,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14680, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14729, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -99822,7 +95240,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -99849,11 +95267,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1672 + v13 = __ccgo_ts + 1667 } else { - v13 = __ccgo_ts + 14697 + v13 = __ccgo_ts + 14746 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14705, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14754, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -99861,7 +95279,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14725, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14774, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -99869,7 +95287,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14784, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -100032,16 +95450,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14811, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14860, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14829, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14878, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100049,9 +95467,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100067,8 +95485,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14902, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11989, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14951, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12038, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100141,12 +95559,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100258,13 +95676,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14962, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -100345,7 +95763,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -100395,7 +95813,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -100566,11 +95984,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14998 + v1 = __ccgo_ts + 15047 } else { - v1 = __ccgo_ts + 15001 + v1 = __ccgo_ts + 15050 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15007, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15056, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -100769,7 +96187,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15043, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15092, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -100816,9 +96234,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15049 + v1 = __ccgo_ts + 15098 } else { - v1 = __ccgo_ts + 15058 + v1 = __ccgo_ts + 15107 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -100850,9 +96268,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15043, - 1: __ccgo_ts + 15065, - 2: __ccgo_ts + 15049, + 0: __ccgo_ts + 15092, + 1: __ccgo_ts + 15114, + 2: __ccgo_ts + 15098, } // C documentation @@ -100872,7 +96290,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15073, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15122, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -100897,7 +96315,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12577, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101328,7 +96746,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15273, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102210,11 +97626,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15306, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15335, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102318,7 +97734,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102375,7 +97791,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15409, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15458, -int32(1)) return } if argc == int32(3) { @@ -104094,7 +99515,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15442, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15491, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104176,7 +99597,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104248,32 +99669,32 @@ var _hexdigits = [16]uint8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15487, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15536, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15495, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15544, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1433, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1428, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -104301,13 +99722,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15503, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15552 + } else { + v2 = __ccgo_ts + 15556 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1673, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1668, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*uint8)(unsafe.Pointer(zOut + uintptr(v2))) = uint8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0) + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15559, -int32(1)) + return +} + // C documentation // // /* @@ -104319,6 +99876,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104329,7 +99890,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -104540,7 +100101,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1672 + zPass = __ccgo_ts + 1667 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104764,7 +100325,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -104853,7 +100414,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11398, + 0: __ccgo_ts + 11447, } // C documentation @@ -104865,8 +100426,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -104881,7 +100442,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -104893,16 +100454,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -104921,7 +100482,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1672) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1667) } // C documentation @@ -104967,7 +100528,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1672 + zIn = __ccgo_ts + 1667 } i = 0 for { @@ -105013,7 +100574,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15506, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15582, int32(4), libc.UintptrFromInt32(0)) } } @@ -105074,7 +100635,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12616, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12665, -int32(1)) return } if argc == int32(2) { @@ -105105,17 +100666,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105184,7 +100734,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105266,7 +100816,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15386, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105329,12 +100879,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105498,7 +101042,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -105509,7 +101053,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -105596,7 +101140,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1672, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1667, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -105616,7 +101160,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15511, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15587, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -105645,8 +101189,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15517, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15517, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15593, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15593, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -105826,11 +101370,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -105934,7 +101478,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -105947,542 +101491,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15522, + FzName: __ccgo_ts + 15598, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15542, + FzName: __ccgo_ts + 15618, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15555, + FzName: __ccgo_ts + 15631, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15573, + FzName: __ccgo_ts + 15649, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15582, + FzName: __ccgo_ts + 15658, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15590, + FzName: __ccgo_ts + 15666, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15590, + FzName: __ccgo_ts + 15666, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15605, + FzName: __ccgo_ts + 15681, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15631, + FzName: __ccgo_ts + 15707, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15656, + FzName: __ccgo_ts + 15732, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15665, + FzName: __ccgo_ts + 15741, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15676, + FzName: __ccgo_ts + 15752, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15683, + FzName: __ccgo_ts + 15759, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15697, + FzName: __ccgo_ts + 15773, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15697, + FzName: __ccgo_ts + 15773, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15703, + FzName: __ccgo_ts + 15779, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15703, + FzName: __ccgo_ts + 15779, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15785, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15785, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15714, + FzName: __ccgo_ts + 15790, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15714, + FzName: __ccgo_ts + 15790, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15718, + FzName: __ccgo_ts + 15794, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15718, + FzName: __ccgo_ts + 15794, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15722, + FzName: __ccgo_ts + 15798, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15729, + FzName: __ccgo_ts + 15805, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15737, + FzName: __ccgo_ts + 15813, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15744, + FzName: __ccgo_ts + 15820, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15757, + FzName: __ccgo_ts + 15833, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15763, + FzName: __ccgo_ts + 15839, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15770, + FzName: __ccgo_ts + 15846, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15777, + FzName: __ccgo_ts + 15853, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15861, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15790, + FzName: __ccgo_ts + 15866, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15794, + FzName: __ccgo_ts + 15870, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15794, + FzName: __ccgo_ts + 15870, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15800, + FzName: __ccgo_ts + 15876, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15806, + FzName: __ccgo_ts + 15882, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15812, + FzName: __ccgo_ts + 15888, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15816, + FzName: __ccgo_ts + 15892, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15816, + FzName: __ccgo_ts + 15892, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15822, + FzName: __ccgo_ts + 15898, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15829, + FzName: __ccgo_ts + 15905, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15839, + FzName: __ccgo_ts + 15915, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15846, + FzName: __ccgo_ts + 15922, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15853, + FzName: __ccgo_ts + 15929, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15864, + FzName: __ccgo_ts + 15940, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15871, + FzName: __ccgo_ts + 15947, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15886, + FzName: __ccgo_ts + 15962, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15903, + FzName: __ccgo_ts + 15979, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15914, + FzName: __ccgo_ts + 15990, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15920, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15997, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15938, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16003, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15946, + FzName: __ccgo_ts + 16016, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15960, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16034, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16042, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16056, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16064, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15984, + FzName: __ccgo_ts + 16073, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15984, + FzName: __ccgo_ts + 16073, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15994, + FzName: __ccgo_ts + 16090, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15998, + FzName: __ccgo_ts + 16094, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16004, + FzName: __ccgo_ts + 16100, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16008, + FzName: __ccgo_ts + 16104, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16008, + FzName: __ccgo_ts + 16104, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16014, + FzName: __ccgo_ts + 16110, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16014, + FzName: __ccgo_ts + 16110, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16027, + FzName: __ccgo_ts + 16123, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16038, + FzName: __ccgo_ts + 16134, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15517, + FzName: __ccgo_ts + 15593, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15517, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16043, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1245, + FzName: __ccgo_ts + 15593, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1253, + FzName: __ccgo_ts + 16139, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16048, + FzName: __ccgo_ts + 1240, }, 74: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16054, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1248, }, 75: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16057, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16144, }, 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16061, + FzName: __ccgo_ts + 16150, }, 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16067, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16153, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16057, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16157, }, 79: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16072, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 16163, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16076, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16153, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16080, + FzName: __ccgo_ts + 16168, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16086, + FzName: __ccgo_ts + 16172, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, + FzName: __ccgo_ts + 16176, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16095, + FzName: __ccgo_ts + 16182, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, + FzName: __ccgo_ts + 16186, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16105, + FzName: __ccgo_ts + 16191, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16111, + FzName: __ccgo_ts + 16196, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16115, + FzName: __ccgo_ts + 16201, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, + FzName: __ccgo_ts + 16207, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16123, + FzName: __ccgo_ts + 16211, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16128, + FzName: __ccgo_ts + 16215, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16133, + FzName: __ccgo_ts + 16219, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16138, + FzName: __ccgo_ts + 16224, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16144, + FzName: __ccgo_ts + 16229, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16150, + FzName: __ccgo_ts + 16234, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16156, + FzName: __ccgo_ts + 16240, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16161, + FzName: __ccgo_ts + 16246, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16169, + FzName: __ccgo_ts + 16252, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16177, + FzName: __ccgo_ts + 16257, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16180, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16265, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16273, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16276, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6865, + FzName: __ccgo_ts + 6885, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16185, + FzName: __ccgo_ts + 16281, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16189, + FzName: __ccgo_ts + 16285, }, } @@ -106541,109 +102096,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -106867,7 +102424,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -106960,7 +102517,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16192, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16288, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -107784,7 +103341,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108071,11 +103628,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6731, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6727, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108139,7 +103696,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5315) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5336) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108155,7 +103712,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -108603,7 +104160,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -108721,7 +104278,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8358, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8378, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -108787,11 +104344,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109116,7 +104673,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109130,7 +104687,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109165,7 +104722,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109178,7 +104735,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109305,27 +104862,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109406,7 +104963,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109433,7 +104990,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -109442,44 +104999,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16237, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16333, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16278, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16374, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109501,31 +105042,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16310, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16406, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109549,10 +105090,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -109593,8 +105134,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -109611,34 +105152,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16318, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16414, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16370, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16466, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -109745,18 +105286,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -109766,13 +105307,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -109783,14 +105324,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -109807,16 +105348,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -109927,11 +105468,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -109990,7 +105531,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16462) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16558) } goto insert_cleanup insert_cleanup: @@ -110113,33 +105654,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110386,7 +105900,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12577, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -112620,7 +107814,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16511, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16607, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -112640,19 +107834,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16515, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16611, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16521, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16617, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112667,14 +107861,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16564, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16660, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -112698,7 +107892,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16596, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16692, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112707,7 +107901,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16476, + 0: __ccgo_ts + 16572, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -112776,14 +107970,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -112798,7 +107987,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -112816,7 +108005,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -112831,7 +108020,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -112841,6 +108030,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -112852,7 +108043,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -112864,7 +108055,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -112940,7 +108131,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16633, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16729, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -112994,63 +108185,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5571, - 1: __ccgo_ts + 16672, - 2: __ccgo_ts + 9254, - 3: __ccgo_ts + 16676, - 4: __ccgo_ts + 16681, - 5: __ccgo_ts + 16684, - 6: __ccgo_ts + 16694, - 7: __ccgo_ts + 16704, - 8: __ccgo_ts + 16710, - 9: __ccgo_ts + 16714, - 10: __ccgo_ts + 16719, - 11: __ccgo_ts + 16724, - 12: __ccgo_ts + 16732, - 13: __ccgo_ts + 16743, - 14: __ccgo_ts + 16746, - 15: __ccgo_ts + 16753, - 16: __ccgo_ts + 16714, - 17: __ccgo_ts + 16719, - 18: __ccgo_ts + 16760, - 19: __ccgo_ts + 16765, - 20: __ccgo_ts + 16768, - 21: __ccgo_ts + 16775, - 22: __ccgo_ts + 16710, - 23: __ccgo_ts + 16714, - 24: __ccgo_ts + 16781, - 25: __ccgo_ts + 16786, - 26: __ccgo_ts + 16791, - 27: __ccgo_ts + 16714, - 28: __ccgo_ts + 16795, - 29: __ccgo_ts + 16719, - 30: __ccgo_ts + 16803, - 31: __ccgo_ts + 16807, - 32: __ccgo_ts + 16812, - 33: __ccgo_ts + 11993, - 34: __ccgo_ts + 11989, - 35: __ccgo_ts + 16818, - 36: __ccgo_ts + 16823, - 37: __ccgo_ts + 16828, - 38: __ccgo_ts + 16672, - 39: __ccgo_ts + 16714, - 40: __ccgo_ts + 16833, - 41: __ccgo_ts + 16840, - 42: __ccgo_ts + 16847, - 43: __ccgo_ts + 9254, - 44: __ccgo_ts + 16855, - 45: __ccgo_ts + 5574, - 46: __ccgo_ts + 16861, - 47: __ccgo_ts + 16672, - 48: __ccgo_ts + 16714, - 49: __ccgo_ts + 16866, - 50: __ccgo_ts + 16871, - 51: __ccgo_ts + 16057, - 52: __ccgo_ts + 16876, - 53: __ccgo_ts + 16889, - 54: __ccgo_ts + 16898, - 55: __ccgo_ts + 16905, - 56: __ccgo_ts + 16916, + 0: __ccgo_ts + 5592, + 1: __ccgo_ts + 16768, + 2: __ccgo_ts + 9303, + 3: __ccgo_ts + 16772, + 4: __ccgo_ts + 16777, + 5: __ccgo_ts + 16780, + 6: __ccgo_ts + 16790, + 7: __ccgo_ts + 16800, + 8: __ccgo_ts + 16806, + 9: __ccgo_ts + 16810, + 10: __ccgo_ts + 16815, + 11: __ccgo_ts + 16820, + 12: __ccgo_ts + 16828, + 13: __ccgo_ts + 16839, + 14: __ccgo_ts + 16842, + 15: __ccgo_ts + 16810, + 16: __ccgo_ts + 16849, + 17: __ccgo_ts + 16815, + 18: __ccgo_ts + 16857, + 19: __ccgo_ts + 16861, + 20: __ccgo_ts + 16866, + 21: __ccgo_ts + 16872, + 22: __ccgo_ts + 16810, + 23: __ccgo_ts + 16815, + 24: __ccgo_ts + 16879, + 25: __ccgo_ts + 16884, + 26: __ccgo_ts + 16887, + 27: __ccgo_ts + 16894, + 28: __ccgo_ts + 16806, + 29: __ccgo_ts + 16810, + 30: __ccgo_ts + 16900, + 31: __ccgo_ts + 16905, + 32: __ccgo_ts + 16910, + 33: __ccgo_ts + 16768, + 34: __ccgo_ts + 16810, + 35: __ccgo_ts + 16914, + 36: __ccgo_ts + 16921, + 37: __ccgo_ts + 16928, + 38: __ccgo_ts + 12042, + 39: __ccgo_ts + 12038, + 40: __ccgo_ts + 16936, + 41: __ccgo_ts + 16941, + 42: __ccgo_ts + 16946, + 43: __ccgo_ts + 9303, + 44: __ccgo_ts + 16951, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16957, + 47: __ccgo_ts + 16962, + 48: __ccgo_ts + 16153, + 49: __ccgo_ts + 16967, + 50: __ccgo_ts + 16768, + 51: __ccgo_ts + 16810, + 52: __ccgo_ts + 16980, + 53: __ccgo_ts + 16985, + 54: __ccgo_ts + 16994, + 55: __ccgo_ts + 17001, + 56: __ccgo_ts + 17012, } // C documentation @@ -113069,338 +108260,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16924, + FzName: __ccgo_ts + 17020, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16939, + FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16954, + FzName: __ccgo_ts + 17050, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16966, + FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16982, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16905, + FzName: __ccgo_ts + 17001, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16995, + FzName: __ccgo_ts + 17091, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17007, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17027, + FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17043, + FzName: __ccgo_ts + 17139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17064, + FzName: __ccgo_ts + 17160, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17079, + FzName: __ccgo_ts + 17175, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17095, + FzName: __ccgo_ts + 17191, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17109, + FzName: __ccgo_ts + 17205, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17122, + FzName: __ccgo_ts + 17218, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17136, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17155, + FzName: __ccgo_ts + 17251, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17174, + FzName: __ccgo_ts + 17270, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17197, + FzName: __ccgo_ts + 17293, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17206, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17224, + FzName: __ccgo_ts + 17320, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17241, + FzName: __ccgo_ts + 17337, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17254, + FzName: __ccgo_ts + 17350, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17269, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17287, + FzName: __ccgo_ts + 17383, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17297, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17311, + FzName: __ccgo_ts + 17407, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17327, + FzName: __ccgo_ts + 17423, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17352, + FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17371, + FzName: __ccgo_ts + 17467, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17382, + FzName: __ccgo_ts + 17478, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17393, + FzName: __ccgo_ts + 17489, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17405, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17421, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17434, + FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17453, + FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17472, + FzName: __ccgo_ts + 17568, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17485, + FzName: __ccgo_ts + 17581, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17500, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17510, + FzName: __ccgo_ts + 17606, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17522, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17531, + FzName: __ccgo_ts + 17627, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17542, + FzName: __ccgo_ts + 17638, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17552, + FzName: __ccgo_ts + 17648, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17564, + FzName: __ccgo_ts + 17660, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17575, + FzName: __ccgo_ts + 17671, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17587, + FzName: __ccgo_ts + 17683, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17604, + FzName: __ccgo_ts + 17700, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17623, + FzName: __ccgo_ts + 17719, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17649, + FzName: __ccgo_ts + 17745, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17664, + FzName: __ccgo_ts + 17760, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17678, + FzName: __ccgo_ts + 17774, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17697, + FzName: __ccgo_ts + 17793, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17711, + FzName: __ccgo_ts + 17807, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17727, + FzName: __ccgo_ts + 17823, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17739, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17750, + FzName: __ccgo_ts + 17846, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17761, + FzName: __ccgo_ts + 17857, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113408,45 +108599,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17773, + FzName: __ccgo_ts + 17869, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17784, + FzName: __ccgo_ts + 17880, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17805, + FzName: __ccgo_ts + 17901, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17813, + FzName: __ccgo_ts + 17909, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17828, + FzName: __ccgo_ts + 17924, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17841, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17860, + FzName: __ccgo_ts + 17956, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17875, + FzName: __ccgo_ts + 17971, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113464,7 +108655,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -113572,10 +108763,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17891) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17987) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17901) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17997) { return PAGER_LOCKINGMODE_NORMAL } } @@ -113593,13 +108784,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8414) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8434) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18004) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17913) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18009) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -113622,10 +108813,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) <= int32('2') { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16866) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16980) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17925) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18021) == 0 { return int32(2) } else { return 0 @@ -113647,7 +108838,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17932, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18028, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -113777,15 +108968,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17994 + zName = __ccgo_ts + 18090 case int32(OE_SetDflt): - zName = __ccgo_ts + 18003 + zName = __ccgo_ts + 18099 case int32(OE_Cascade): - zName = __ccgo_ts + 18015 + zName = __ccgo_ts + 18111 case int32(OE_Restrict): - zName = __ccgo_ts + 18023 + zName = __ccgo_ts + 18119 default: - zName = __ccgo_ts + 18032 + zName = __ccgo_ts + 18128 break } return zName @@ -113806,12 +108997,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18042, - 1: __ccgo_ts + 18049, - 2: __ccgo_ts + 18057, - 3: __ccgo_ts + 18061, - 4: __ccgo_ts + 17925, - 5: __ccgo_ts + 18070, + 0: __ccgo_ts + 18138, + 1: __ccgo_ts + 18145, + 2: __ccgo_ts + 18153, + 3: __ccgo_ts + 18157, + 4: __ccgo_ts + 18021, + 5: __ccgo_ts + 18166, } // C documentation @@ -113873,15 +109064,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18095 + zType = __ccgo_ts + 18191 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18097 + zType = __ccgo_ts + 18193 } else { - zType = __ccgo_ts + 7813 + zType = __ccgo_ts + 7833 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18099, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18195, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -113890,9 +109081,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18074, - 2: __ccgo_ts + 18079, - 3: __ccgo_ts + 18087, + 1: __ccgo_ts + 18170, + 2: __ccgo_ts + 18175, + 3: __ccgo_ts + 18183, } // C documentation @@ -113991,7 +109182,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18106, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18202, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -114034,7 +109225,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3869, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114079,7 +109270,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114138,7 +109329,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18110) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18206) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114181,7 +109372,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114209,7 +109400,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17901 + zRet = __ccgo_ts + 17997 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114237,7 +109428,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17891 + zRet = __ccgo_ts + 17987 } _returnSingleText(tls, v, zRet) break @@ -114527,7 +109718,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uint8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18115, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18211, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114537,7 +109728,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*uint8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -114559,7 +109750,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18140, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18236, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -114591,8 +109782,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18193) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18289) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -114672,9 +109864,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18199 + v14 = __ccgo_ts + 18295 } else { - v14 = __ccgo_ts + 18207 + v14 = __ccgo_ts + 18303 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -114686,7 +109878,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1672), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667), v15, v16, k, isHidden)) goto _12 _12: ; @@ -114745,7 +109937,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18214, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18310, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -114753,7 +109945,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FpSchema + 8 @@ -114775,19 +109967,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11041 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13240 + zType = __ccgo_ts + 13289 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18230 + zType = __ccgo_ts + 18326 } else { - zType = __ccgo_ts + 9254 + zType = __ccgo_ts + 9303 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18237, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18333, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -114834,9 +110026,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18244, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18340, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18249, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18345, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -114860,11 +110052,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18254, - 1: __ccgo_ts + 18256, - 2: __ccgo_ts + 16743, + 0: __ccgo_ts + 18350, + 1: __ccgo_ts + 18352, + 2: __ccgo_ts + 16839, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18258, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18354, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -114883,7 +110075,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18264, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18360, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -114900,7 +110092,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18268, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18364, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -114950,7 +110142,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7813, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -114962,7 +110154,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7813, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -114988,7 +110180,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18271, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18280)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18367, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18376)) goto _32 _32: ; @@ -115002,8 +110194,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115129,7 +110321,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18285, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18381, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115225,7 +110417,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115269,7 +110461,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -115320,7 +110512,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18289, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18385, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115331,7 +110523,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18313) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18409) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115467,7 +110659,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18342, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115529,7 +110721,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115551,7 +110743,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18378, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18474, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -115564,7 +110756,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18398, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18494, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -115572,7 +110764,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18420, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18516, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -115583,10 +110775,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18443, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18539, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18445, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -115620,7 +110812,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18465, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18561, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -115644,9 +110836,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18495) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18500) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18596) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -115659,9 +110851,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18521) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18617) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18557) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18653) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -115689,9 +110881,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18495) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18568) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18664) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -115719,7 +110911,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18595) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18691) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -115816,7 +111008,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18622 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18718 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -115895,7 +111087,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18683, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18779, libc.VaList(bp+176, zRight)) } } } @@ -116000,13 +111192,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17908) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18004) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18708) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18804) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18061) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18157) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116141,7 +111333,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116171,7 +111363,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6660, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6680, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116233,7 +111425,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18716, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18812, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116506,34 +111698,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18630, + FzName: __ccgo_ts + 18726, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18636, + FzName: __ccgo_ts + 18732, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18645, + FzName: __ccgo_ts + 18741, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18654, + FzName: __ccgo_ts + 18750, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18662, + FzName: __ccgo_ts + 18758, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18670, + FzName: __ccgo_ts + 18766, }, 7: { - FzName: __ccgo_ts + 18677, + FzName: __ccgo_ts + 18773, }, 8: {}, } @@ -116590,25 +111782,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -116629,14 +111802,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18734) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18830) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18749, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18845, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -116645,19 +111818,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18756, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18852, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18762) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18774) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18870) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -116672,7 +111845,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -116853,7 +112026,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -116865,13 +112038,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18789) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18885) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18797, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18893, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18801, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18897, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -116880,7 +112053,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -117006,24 +112179,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18835, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18931, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5182 + v1 = __ccgo_ts + 5203 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18863, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18894, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18990, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -117031,9 +112204,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18805, - 1: __ccgo_ts + 18812, - 2: __ccgo_ts + 18824, + 0: __ccgo_ts + 18901, + 1: __ccgo_ts + 18908, + 2: __ccgo_ts + 18920, } // C documentation @@ -117109,7 +112282,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14680) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117142,11 +112315,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18902) + _corruptSchema(tls, pData, argv, __ccgo_ts+18998) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14680) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } } @@ -117185,18 +112358,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9254 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9303 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6668 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6156 + v2 = __ccgo_ts + 6175 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8326 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18915 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8346 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19011 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117280,7 +112453,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12291) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12340) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117306,7 +112479,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18987) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19083) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117321,7 +112494,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19011, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19107, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -117617,7 +112790,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -117630,9 +112803,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -117650,13 +112823,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1637, 0) } } @@ -117679,7 +112852,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -117690,7 +112863,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1637, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -117739,7 +112912,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19045, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19141, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -117755,7 +112928,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19075, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19171, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -117778,10 +112951,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -117789,7 +112962,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3869, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -117819,7 +112992,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -117953,7 +113126,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118075,15 +113248,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118119,21 +113283,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118213,7 +113362,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118221,7 +113370,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118377,15 +113526,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11398 - zSp2 = __ccgo_ts + 11398 + zSp1 = __ccgo_ts + 11447 + zSp2 = __ccgo_ts + 11447 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19094, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19190, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118442,25 +113591,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -118592,13 +113744,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -118676,7 +113828,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19124, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19220, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -118726,12 +113878,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19174, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19270, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -118746,9 +113898,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19238, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19334, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -118758,6 +113911,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = uint8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -118792,7 +113952,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6865, + Fz: __ccgo_ts + 6885, Fn: uint32(8), } @@ -118809,13 +113969,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -118840,7 +113993,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -118885,7 +114038,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -118909,7 +114062,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -118930,7 +114083,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119053,7 +114206,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119180,10 +114333,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119191,7 +114344,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119368,7 +114521,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19275, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119479,8 +114632,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119488,7 +114641,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -119573,13 +114726,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19295 + z = __ccgo_ts + 19391 case int32(TK_INTERSECT): - z = __ccgo_ts + 19305 + z = __ccgo_ts + 19401 case int32(TK_EXCEPT): - z = __ccgo_ts + 19315 + z = __ccgo_ts + 19411 default: - z = __ccgo_ts + 19322 + z = __ccgo_ts + 19418 break } return z @@ -119600,7 +114753,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19328, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+8, zUsage)) } /* @@ -119637,13 +114790,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19351 + v1 = __ccgo_ts + 19447 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19365, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19461, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19396, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19492, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -119667,11 +114820,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -119886,8 +115039,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1146 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16855 + zType = __ccgo_ts + 1141 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16951 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -120000,7 +115153,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -120009,7 +115162,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -120033,13 +115186,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16855 + zCol = __ccgo_ts + 16951 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12577, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120047,7 +115200,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120101,7 +115254,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120139,7 +115292,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16855 + v3 = __ccgo_ts + 16951 } zName = v3 } else { @@ -120154,7 +115307,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120190,7 +115343,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19451, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19547, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120309,7 +115462,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != libc.Int32FromUint8(_sqlite3AffinityType(tls, zType, uintptr(0))) { if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19459 + zType = __ccgo_ts + 19555 } else { zType = uintptr(0) j = int32(1) @@ -120375,7 +115528,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -120403,7 +115556,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120453,7 +115606,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120476,7 +115629,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -120624,7 +115777,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19463, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19559, 0) return } /* Obtain authorization to do a recursive query */ @@ -120661,7 +115814,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -120672,7 +115825,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -120686,7 +115839,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -120717,7 +115870,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19512, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19608, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -120732,7 +115885,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19554, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19650, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -120760,7 +115913,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19560, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19656, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -120813,11 +115966,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } else { - v1 = __ccgo_ts + 19575 + v1 = __ccgo_ts + 19671 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19577, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19673, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -120925,8 +116078,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19600, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19615, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19696, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19711, 0) } /* Generate code for the left and right SELECT statements. */ @@ -120951,7 +116104,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19295, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19391, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120977,7 +116130,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -121003,7 +116156,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19634, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121035,11 +116188,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121061,7 +116214,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19634, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121168,6 +116321,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121184,9 +116338,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19655, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19751, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19701, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19797, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121257,7 +116411,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19275, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121473,7 +116627,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -121505,7 +116659,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -121559,16 +116713,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7563) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7563) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7583) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -121586,32 +116740,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19783, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19879, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19794, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19890, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121624,7 +116778,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19799, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19895, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -121834,11 +116988,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5160 + v1 = __ccgo_ts + 5181 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -121999,7 +117153,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122189,9 +117343,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122403,7 +117557,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122550,7 +117704,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -122789,18 +117943,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -122840,11 +117982,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -122909,7 +118051,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -122927,12 +118069,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123414,7 +118556,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123460,13 +118602,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15714) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15790) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15718) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15794) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123554,8 +118696,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19805, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19901, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -123579,7 +118721,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -123661,7 +118803,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -123679,7 +118821,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19823, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19919, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -123827,7 +118969,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -123855,7 +118997,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19846, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -123877,12 +119019,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19866, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19962, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -123899,7 +119041,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19909 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20005 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -123930,7 +119072,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19932, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20028, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -123939,9 +119081,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19970 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20066 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20004 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20100 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -123990,7 +119132,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -124000,7 +119142,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20042, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20138, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124096,7 +119238,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124105,7 +119247,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124156,7 +119298,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20046, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124171,7 +119313,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20085, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20181, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124186,7 +119328,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15273, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124310,7 +119452,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6725 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124327,7 +119469,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20116, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124406,7 +119548,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20121, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20217, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124419,7 +119561,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12577, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124439,9 +119581,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20130, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20226, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20148, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) } } } @@ -124455,7 +119597,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20168, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20264, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -124652,14 +119794,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -124668,7 +119810,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -124700,11 +119842,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -124757,7 +119899,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -124794,12 +119936,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20199, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20295, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20250, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20346, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -124820,7 +119962,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20283, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20379, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -124959,7 +120101,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125067,7 +120209,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125111,7 +120253,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125134,16 +120276,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20316 + v1 = __ccgo_ts + 20412 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20339, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20435, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125175,7 +120317,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8326) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125304,6 +120446,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125332,7 +120475,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16008) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16104) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125365,9 +120508,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125377,13 +120520,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125403,7 +120546,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -125576,8 +120719,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -125586,11 +120729,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -125606,7 +120749,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -125630,14 +120773,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20351, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20447, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -125738,7 +120881,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20405, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20501, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -125896,7 +121039,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 72)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1672, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1667, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -125939,14 +121082,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20445, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20541, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -125978,7 +121121,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -125993,7 +121136,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20460, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20556, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126047,7 +121190,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126080,7 +121223,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126139,7 +121282,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126168,6 +121311,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126190,10 +121340,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126227,8 +121377,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126243,8 +121393,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126273,8 +121423,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126291,7 +121441,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126304,11 +121454,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126342,49 +121492,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126392,16 +121543,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126419,11 +121570,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20476 + v47 = __ccgo_ts + 20572 } else { - v46 = __ccgo_ts + 20485 + v47 = __ccgo_ts + 20581 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19328, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126433,12 +121584,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126451,13 +121602,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126468,12 +121619,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126522,12 +121673,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -126597,9 +121752,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -126616,10 +121771,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -126646,8 +121801,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -126687,32 +121842,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -126754,7 +121909,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20476) + _explainTempTable(tls, pParse, __ccgo_ts+20572) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -126860,7 +122015,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -126876,7 +122031,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20494, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20590, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -126966,7 +122121,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127128,7 +122283,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20559, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) goto trigger_cleanup } iDb = int32(1) @@ -127168,7 +122323,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20605, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20701, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127178,11 +122333,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20613, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20709, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20654, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20750, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127191,13 +122346,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20605, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20701, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20694, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20790, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127205,8 +122360,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20720, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20816, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127214,15 +122369,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20758 + v1 = __ccgo_ts + 20854 } else { - v1 = __ccgo_ts + 20765 + v1 = __ccgo_ts + 20861 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20771, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20867, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20808, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20904, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127242,9 +122397,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6668 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6156 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127344,7 +122499,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20605, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20701, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127366,7 +122521,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20854, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20950, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127382,10 +122537,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20902, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20998, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20977, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21073, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -127653,11 +122808,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21006, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -127695,9 +122850,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -127712,7 +122867,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21026, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -127845,11 +123000,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21088 + v1 = __ccgo_ts + 21184 } else { - v1 = __ccgo_ts + 21095 + v1 = __ccgo_ts + 21191 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21198, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -127951,7 +123106,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21150, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21246, 0) return int32(1) } @@ -128099,12 +123254,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128112,19 +123267,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128135,7 +123293,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128149,7 +123307,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128217,7 +123375,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6353, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128316,10 +123474,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21192, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21288, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128341,7 +123501,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -128413,7 +123573,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -128829,13 +123989,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -128843,21 +124003,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -128904,7 +124064,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -128943,7 +124103,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -128987,58 +124147,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21206, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21302, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21242, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8101 + v10 = __ccgo_ts + 8121 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129068,17 +124216,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129090,11 +124238,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129110,11 +124258,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129123,18 +124271,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129143,16 +124291,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129170,24 +124318,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129213,50 +124361,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -129554,8 +124702,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -129605,8 +124753,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -129653,11 +124801,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -129669,11 +124817,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -129716,7 +124864,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21261) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21357) } goto update_cleanup update_cleanup: @@ -129773,13 +124921,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -129821,11 +124969,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130150,9 +125298,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]uint8)(unsafe.Pointer(bp + 200)))[0] = uint8(0) } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21274, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21370, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21278, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21374, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130241,13 +125389,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130255,7 +125403,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12666, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12715, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130337,7 +125485,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21351, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21355, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21447, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21451, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130428,7 +125576,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130467,24 +125615,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21359) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21455) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21399) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21495) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21442) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21538) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 76)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 76)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1672 + zOut = __ccgo_ts + 1667 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -130494,7 +125642,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21491) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21587) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130547,7 +125695,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15043) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15092) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130578,11 +125726,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21518, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21614, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21626, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21722, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130591,7 +125739,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21680, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21776, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -130601,7 +125749,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21817, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21913, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -130692,39 +125840,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -130735,7 +125850,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -130744,7 +125859,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -130754,7 +125869,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -130779,15 +125894,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -130802,13 +125917,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131128,7 +126245,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12896, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131251,24 +126368,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21940, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22036, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21964, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22060, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22063, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131325,7 +126447,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131352,7 +126474,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22082, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22178, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131386,7 +126508,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131394,9 +126516,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22124, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22220, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3869, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -131409,7 +126531,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22154 + zFormat = __ccgo_ts + 22250 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131435,7 +126557,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1672) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1667) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -131443,7 +126565,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16746, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16842, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131524,13 +126646,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22200, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22296, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3869, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -131611,7 +126733,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22200, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22296, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -131659,7 +126781,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22219, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22315, 0) return int32(SQLITE_ERROR) } goto _1 @@ -131670,9 +126792,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -131714,7 +126836,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3869 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } @@ -132080,7 +127202,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132170,7 +127292,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132190,7 +127312,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3869, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132254,7 +127376,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132267,7 +127389,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132427,271 +127549,9 @@ type TWhereLoop = struct { FaLTermSpace [3]uintptr } -type WhereLoop = TWhereLoop - -type TWherePath = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath = TWherePath - -type TWhereTerm = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm = TWhereTerm - -type TWhereLoopBuilder = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder = TWhereLoopBuilder - -type TWhereScan = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff uint8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan = TWhereScan - -type TWhereOrCost = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost = TWhereOrCost - -type TWhereOrSet = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet = TWhereOrSet - -type TWhereMemBlock = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock = TWhereMemBlock - -type TWhereRightJoin = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin = TWhereRightJoin - -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 +type WhereLoop = TWhereLoop -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { +type TWherePath = struct { FmaskLoop TBitmask FrevLoop TBitmask FnRow TLogEst @@ -132701,60 +127561,9 @@ type TWherePath1 = struct { FaLoop uintptr } -type WherePath1 = TWherePath1 +type WherePath = TWherePath -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { +type TWhereTerm = struct { FpExpr uintptr FpWC uintptr FtruthProb TLogEst @@ -132776,17 +127585,23 @@ type TWhereTerm1 = struct { FprereqAll TBitmask } -type WhereTerm1 = TWhereTerm1 +type WhereTerm = TWhereTerm -/* -** Allowed values of WhereTerm.wtFlags - */ +type TWhereLoopBuilder = struct { + FpWInfo uintptr + FpWC uintptr + FpNew uintptr + FpOrSet uintptr + FpRec uintptr + FnRecValid int32 + FbldFlags1 uint8 + FbldFlags2 uint8 + FiPlanLimit uint32 +} -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { +type WhereLoopBuilder = TWhereLoopBuilder + +type TWhereScan = struct { FpOrigWC uintptr FpWC uintptr FzCollName uintptr @@ -132800,162 +127615,39 @@ type TWhereScan1 = struct { FaiColumn [11]Ti16 } -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 +type WhereScan = TWhereScan -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause +type TWhereOrCost = struct { + Fprereq TBitmask + FrRun TLogEst + FnOut TLogEst } -type WhereAndInfo1 = TWhereAndInfo1 +type WhereOrCost = TWhereOrCost -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 +type TWhereOrSet = struct { + Fn Tu16 + Fa [3]TWhereOrCost } -type WhereMaskSet1 = TWhereMaskSet1 +type WhereOrSet = TWhereOrSet -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 +type TWhereMemBlock = struct { + FpNext uintptr + Fsz Tu64 } -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ +type WhereMemBlock = TWhereMemBlock -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel +type TWhereRightJoin = struct { + FiMatch int32 + FregBloom int32 + FregReturn int32 + FaddrSubrtn int32 + FendSubrtn int32 } -type WhereInfo1 = TWhereInfo1 +type WhereRightJoin = TWhereRightJoin /* ** Bitmasks for the operators on WhereTerm objects. These are all @@ -132988,10 +127680,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22232 + return __ccgo_ts + 22328 } if i == -int32(1) { - return __ccgo_ts + 16855 + return __ccgo_ts + 16951 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -133010,10 +127702,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22239, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22245, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133021,7 +127713,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13286, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -133030,11 +127722,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22245, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133042,16 +127734,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13286, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5182, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } } @@ -133098,7 +127790,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22247, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22343, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133106,12 +127798,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22239, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22346 } else { - v2 = __ccgo_ts + 22255 + v2 = __ccgo_ts + 22351 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133128,7 +127820,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22263) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22359) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133139,9 +127831,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22265) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22361) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133186,11 +127878,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22267 + v2 = __ccgo_ts + 22363 } else { - v2 = __ccgo_ts + 22274 + v2 = __ccgo_ts + 22370 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22279, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22375, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133203,37 +127895,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11449 + zFmt = __ccgo_ts + 11498 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22285 + zFmt = __ccgo_ts + 22381 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22318 + zFmt = __ccgo_ts + 22414 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22343 + zFmt = __ccgo_ts + 22439 } else { - zFmt = __ccgo_ts + 22361 + zFmt = __ccgo_ts + 22457 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22370, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22466, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16855 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22378, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16951 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22474, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = uint8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22409, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22505, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133243,14 +127935,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22419, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22424) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22520) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22446 + v3 = __ccgo_ts + 22542 } else { - v3 = __ccgo_ts + 22454 + v3 = __ccgo_ts + 22550 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133271,7 +127963,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22460, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22556, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133301,10 +127993,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133337,14 +128029,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22471, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22567, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22250, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22492, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22588, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133368,16 +128060,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22239, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22335, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22250, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -133582,7 +128274,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -133638,8 +128330,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -133661,7 +128353,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -133718,10 +128410,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -133776,37 +128468,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -133831,10 +128509,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -133853,24 +128531,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -133882,8 +128560,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -133941,7 +128619,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -134023,7 +128701,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134154,7 +128832,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -134291,7 +128969,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134436,7 +129114,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134497,11 +129175,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134532,6 +129210,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -134670,7 +129351,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -134750,7 +129431,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -134784,7 +129465,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -134906,7 +129587,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135099,7 +129780,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135113,12 +129794,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135156,11 +129838,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135180,7 +129862,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135216,21 +129898,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135248,7 +129930,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135303,7 +129985,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22500, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22596, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135326,7 +130008,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22515, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22611, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -135815,9 +130497,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -135826,14 +130508,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22524, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22620, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -135872,15 +130554,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -135892,7 +130575,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -135965,7 +130648,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -136363,19 +131046,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16704, + FzOp: __ccgo_ts + 16800, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16038, + FzOp: __ccgo_ts + 16134, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15517, + FzOp: __ccgo_ts + 15593, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22538, + FzOp: __ccgo_ts + 22634, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -136895,37 +131578,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 uint8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if libc.Int32FromUint8(aff1) != libc.Int32FromUint8(aff2) && (!(libc.Int32FromUint8(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(libc.Int32FromUint8(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137163,7 +131850,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } } else { @@ -137175,10 +131862,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137237,7 +131924,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137259,7 +131946,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8087 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8107 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137360,7 +132047,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22586 + v13 = __ccgo_ts + 22682 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -137891,7 +132578,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22593, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -137963,22 +132650,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138091,7 +132766,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -139007,7 +133682,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141258,13 +135934,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141364,6 +136035,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141377,12 +136049,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -141828,7 +136517,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -141879,15 +136568,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -141919,7 +136599,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -141938,7 +136618,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -141975,7 +136655,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -141983,7 +136663,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -142004,19 +136684,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142112,7 +136792,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142290,7 +136970,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142318,6 +136998,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142394,7 +137082,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -142631,7 +137319,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142706,7 +137394,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142860,7 +137548,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143296,7 +137984,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22692, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22788, 0) rc = SQLITE_OK } else { break @@ -143525,17 +138213,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144504,7 +139181,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22727, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22823, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145082,7 +139759,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145238,7 +139915,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22745, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22841, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145259,11 +139936,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -145311,7 +139985,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22773, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22869, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145456,7 +140130,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -145490,7 +140165,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145512,7 +140187,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145525,7 +140200,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -145616,11 +140291,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -145647,16 +140322,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -145704,7 +140379,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -145835,7 +140510,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -146013,7 +140688,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146042,7 +140717,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146052,7 +140727,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22791, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22887, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146102,7 +140777,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146371,7 +141046,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22820, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22916, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146553,7 +141228,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22876, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22972, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -146879,7 +141554,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22921, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23017, libc.VaList(bp+8, zName)) } return p } @@ -146930,12 +141605,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22940, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23036, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23011, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23107, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -147008,7 +141683,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8326) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) } break } @@ -147039,16 +141714,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147067,17 +141732,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -147095,7 +141760,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147119,13 +141784,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147140,23 +141805,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147172,13 +141837,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147290,7 +141955,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23074, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23170, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147326,7 +141991,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147341,7 +142006,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147360,11 +142025,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147410,11 +142075,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147431,7 +142096,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1792)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147453,7 +142118,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -147577,7 +142242,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23100, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23196, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -147645,18 +142310,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23132 + zErr = __ccgo_ts + 23228 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23149 + zErr = __ccgo_ts + 23245 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23165 + zErr = __ccgo_ts + 23261 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23185, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -147680,7 +142345,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23218, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23314, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -147786,24 +142451,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -147821,12 +142486,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -147838,15 +142503,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -147879,7 +142544,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1672, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -147898,11 +142563,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23265, - 1: __ccgo_ts + 23318, - 2: __ccgo_ts + 22820, - 3: __ccgo_ts + 23369, - 4: __ccgo_ts + 23421, + 0: __ccgo_ts + 23361, + 1: __ccgo_ts + 23414, + 2: __ccgo_ts + 22916, + 3: __ccgo_ts + 23465, + 4: __ccgo_ts + 23517, } var _aOp1 = [5]int32{ @@ -147955,87 +142620,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148482,7 +143066,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -148578,7 +143162,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -148654,7 +143238,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1672, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -149295,12 +143879,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149308,13 +143892,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149334,13 +143918,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149367,7 +143951,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -149586,6 +144170,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -149646,7 +144234,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23471, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23567, libc.VaList(bp+8, p)) } // C documentation @@ -149660,6 +144248,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -149693,11 +144282,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23495 + v1 = __ccgo_ts + 23591 } else { - v1 = __ccgo_ts + 23504 + v1 = __ccgo_ts + 23600 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23510, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23606, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -149706,7 +144295,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23552, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23648, 0) } } } @@ -149812,7 +144401,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23586, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23682, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156279,14 +150868,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156297,16 +150878,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -156333,13 +150904,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -157454,19 +152025,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158269,20 +152840,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16855, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16951, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23624, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16768, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16887, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23624, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158323,7 +152894,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158468,7 +153044,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -158558,9 +153139,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -158915,7 +153496,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23651) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23747) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159255,23 +153836,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8102 + } else { + v347 = __ccgo_ts + 8107 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8082 - } else { - v347 = __ccgo_ts + 8087 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -159329,11 +153924,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -159343,9 +153938,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -159353,11 +153948,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -159455,11 +154050,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159509,15 +154104,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23660, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23756, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23755, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23839, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23935, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -159659,7 +154254,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -159853,7 +154448,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23924, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24020, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -161979,7 +156574,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -162584,14 +157179,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163453,22 +158053,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163479,11 +158088,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164062,7 +158671,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164082,7 +158691,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24011, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24107, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164207,11 +158816,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164383,14 +158992,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24554 + zErr = __ccgo_ts + 24650 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164402,31 +159011,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24079, - 1: __ccgo_ts + 24092, - 3: __ccgo_ts + 24108, - 4: __ccgo_ts + 24133, - 5: __ccgo_ts + 24147, - 6: __ccgo_ts + 24166, - 7: __ccgo_ts + 1642, - 8: __ccgo_ts + 24191, - 9: __ccgo_ts + 24228, - 10: __ccgo_ts + 24240, - 11: __ccgo_ts + 24255, - 12: __ccgo_ts + 24288, - 13: __ccgo_ts + 24306, - 14: __ccgo_ts + 24331, - 15: __ccgo_ts + 24360, - 17: __ccgo_ts + 6111, - 18: __ccgo_ts + 5513, - 19: __ccgo_ts + 24377, - 20: __ccgo_ts + 24395, - 21: __ccgo_ts + 24413, - 23: __ccgo_ts + 24447, - 25: __ccgo_ts + 24468, - 26: __ccgo_ts + 24494, - 27: __ccgo_ts + 24517, - 28: __ccgo_ts + 24538, + 0: __ccgo_ts + 24175, + 1: __ccgo_ts + 24188, + 3: __ccgo_ts + 24204, + 4: __ccgo_ts + 24229, + 5: __ccgo_ts + 24243, + 6: __ccgo_ts + 24262, + 7: __ccgo_ts + 1637, + 8: __ccgo_ts + 24287, + 9: __ccgo_ts + 24324, + 10: __ccgo_ts + 24336, + 11: __ccgo_ts + 24351, + 12: __ccgo_ts + 24384, + 13: __ccgo_ts + 24402, + 14: __ccgo_ts + 24427, + 15: __ccgo_ts + 24456, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24473, + 20: __ccgo_ts + 24491, + 21: __ccgo_ts + 24509, + 23: __ccgo_ts + 24543, + 25: __ccgo_ts + 24564, + 26: __ccgo_ts + 24590, + 27: __ccgo_ts + 24613, + 28: __ccgo_ts + 24634, } // C documentation @@ -164520,15 +159129,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164536,6 +159147,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164543,10 +159156,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -164573,6 +159186,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -164600,12 +159227,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -164623,9 +159250,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -164648,13 +159275,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24635, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24731, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -164672,15 +159299,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -164695,27 +159322,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -164726,30 +159353,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -164774,7 +159431,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24698, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24794, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -164805,13 +159462,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -164822,43 +159481,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -164869,12 +159532,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -164886,6 +159549,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164893,82 +159558,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -165012,18 +159687,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165049,7 +159726,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165059,7 +159736,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24749, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24845, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165181,7 +159858,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165313,7 +159990,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165323,7 +160000,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165359,7 +160036,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165372,7 +160049,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165381,7 +160058,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24770, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24866, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165416,9 +160093,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165528,7 +160205,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24838, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24934, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -165558,8 +160235,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24844, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24854, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24940, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24950, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -165648,24 +160325,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24882, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24978, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24886, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24982, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24886 + zModeType = __ccgo_ts + 24982 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24907, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25003, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3478 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -165694,12 +160371,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24922, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25018, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24942, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25038, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -165723,7 +160400,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24966, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25062, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -165743,11 +160420,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24892, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24899, + Fz: __ccgo_ts + 24995, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -165758,19 +160435,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24912, + Fz: __ccgo_ts + 25008, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24915, + Fz: __ccgo_ts + 25011, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24918, + Fz: __ccgo_ts + 25014, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17925, + Fz: __ccgo_ts + 18021, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -165898,8 +160575,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22586, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24982, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22682, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25078, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -165920,10 +160597,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4264 + zFilename = __ccgo_ts + 4285 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -165932,7 +160609,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3869 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -165959,9 +160636,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6720 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6740 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23984 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24080 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166055,7 +160732,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24988 + zFilename = __ccgo_ts + 25084 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166074,36 +160751,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166111,7 +160796,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166119,31 +160804,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166177,12 +160866,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166215,10 +160906,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166229,7 +160920,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166272,20 +160963,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24991, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25087, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25016) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25112) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25036) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25132) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25043) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25139) } // C documentation @@ -166310,9 +161001,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166339,29 +161030,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166385,7 +161065,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1146 + zDataType = __ccgo_ts + 1141 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -166416,15 +161096,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25060, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25156, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3869 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -166603,8 +161283,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167048,7 +161728,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -167444,7 +162124,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25088, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25184, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -167592,6 +162272,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -167615,7 +162297,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -167625,7 +162307,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -167637,7 +162319,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -167653,7 +162335,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -167662,7 +162344,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25096 + v2 = __ccgo_ts + 25192 } else { v2 = uintptr(0) } @@ -167741,7 +162423,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -167908,7 +162590,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168125,6 +162807,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168437,8 +163126,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168495,7 +163184,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168505,7 +163194,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168542,23 +163231,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1658, - 1: __ccgo_ts + 8082, - 2: __ccgo_ts + 8087, - 3: __ccgo_ts + 6396, - 4: __ccgo_ts + 6396, - 5: __ccgo_ts + 6391, - 6: __ccgo_ts + 6391, - 7: __ccgo_ts + 8393, - 8: __ccgo_ts + 8393, - 9: __ccgo_ts + 8393, - 10: __ccgo_ts + 8393, - 11: __ccgo_ts + 25119, - 12: __ccgo_ts + 25125, - 13: __ccgo_ts + 1672, - 14: __ccgo_ts + 1672, - 15: __ccgo_ts + 1672, - 16: __ccgo_ts + 1672, + 0: __ccgo_ts + 1653, + 1: __ccgo_ts + 8102, + 2: __ccgo_ts + 8107, + 3: __ccgo_ts + 6416, + 4: __ccgo_ts + 6416, + 5: __ccgo_ts + 6411, + 6: __ccgo_ts + 6411, + 7: __ccgo_ts + 8413, + 8: __ccgo_ts + 8413, + 9: __ccgo_ts + 8413, + 10: __ccgo_ts + 8413, + 11: __ccgo_ts + 25215, + 12: __ccgo_ts + 25221, + 13: __ccgo_ts + 1667, + 14: __ccgo_ts + 1667, + 15: __ccgo_ts + 1667, + 16: __ccgo_ts + 1667, } // C documentation @@ -168862,106 +163551,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]uint8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169041,7 +163630,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169339,8 +163928,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = uint8('u') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = uint8('0') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = uint8('0') - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25132 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25132 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -169474,9 +164063,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1658, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1653, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15487, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15536, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169490,14 +164079,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25149, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25228, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169551,7 +164138,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25257, -int32(1)) } } } @@ -169834,8 +164421,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25193, - FzRepl: __ccgo_ts + 25197, + FzMatch: __ccgo_ts + 25272, + FzRepl: __ccgo_ts + 25276, }, 1: { Fc1: uint8('i'), @@ -169843,32 +164430,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25205, - FzRepl: __ccgo_ts + 25197, + FzMatch: __ccgo_ts + 25284, + FzRepl: __ccgo_ts + 25276, }, 2: { Fc1: uint8('n'), Fc2: uint8('N'), Fn: uint8(3), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 1663, - FzRepl: __ccgo_ts + 1658, + FzMatch: __ccgo_ts + 1658, + FzRepl: __ccgo_ts + 1653, }, 3: { Fc1: uint8('q'), Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25214, - FzRepl: __ccgo_ts + 1658, + FzMatch: __ccgo_ts + 25293, + FzRepl: __ccgo_ts + 1653, }, 4: { Fc1: uint8('s'), Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25219, - FzRepl: __ccgo_ts + 1658, + FzMatch: __ccgo_ts + 25298, + FzRepl: __ccgo_ts + 1653, }, } @@ -169883,7 +164470,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25224, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25303, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -169901,23 +164488,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -169995,7 +164582,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170066,7 +164653,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170341,7 +164932,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25267, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25346, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -170771,7 +165362,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('0') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || libc.Int32FromUint8(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -170810,7 +165401,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8082, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8102, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -170818,7 +165409,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8087, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8107, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -170895,14 +165486,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25193, int32(3)) == 0 { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25272, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25283) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25289, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25368, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171063,7 +165654,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1658, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1653, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171087,7 +165678,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25283) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171132,7 +165723,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*uint8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171145,7 +165736,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171194,10 +165785,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171231,15 +165818,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171308,15 +165895,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1658, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1653, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8082, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8102, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8087, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8107, uint32(5)) return i + uint32(1) _6: ; @@ -171365,9 +165952,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25197 + v19 = __ccgo_ts + 25276 } else { - v19 = __ccgo_ts + 11949 + v19 = __ccgo_ts + 11998 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171403,9 +165990,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, uint8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, uint8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = uint8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = uint8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171432,7 +166022,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25295, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25374, uint32(2)) zIn2++ sz2-- continue @@ -171455,7 +166045,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25298, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25377, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171463,12 +166053,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25305, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25384, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25389, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -171571,16 +166161,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -171648,7 +166228,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25317, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171671,12 +166251,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25320, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25399, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25317, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171691,50 +166271,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -171786,6 +166322,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -171806,6 +166420,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -171878,9 +166495,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -171923,7 +166540,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172411,7 +167039,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172546,7 +167174,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -172647,7 +167275,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } @@ -172684,11 +167312,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25149, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25228, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -172701,7 +167326,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -172720,10 +167345,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25283) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -172762,7 +167387,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25323, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25402, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -172778,7 +167403,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -172859,7 +167484,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -172871,34 +167496,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -172981,7 +167626,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173041,7 +167686,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173176,7 +167821,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25341 + v1 = __ccgo_ts + 25420 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173186,7 +167831,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } eErr = uint8(1) @@ -173296,23 +167941,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25343, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5235, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5256, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1685, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1706, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25347, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25426, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25350, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25429, uint32(1)) } } } @@ -173348,11 +167993,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1658, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1653, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -173620,7 +168265,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -173644,7 +168289,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25352, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25431, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -173655,7 +168300,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25403, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25482, -int32(1)) _jsonStringReset(tls, bp) return } @@ -173727,7 +168372,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_remove_done @@ -173764,7 +168409,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15960) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16056) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -173795,9 +168440,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25437 + v1 = __ccgo_ts + 25516 } else { - v1 = __ccgo_ts + 25441 + v1 = __ccgo_ts + 25520 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -173845,7 +168490,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_type_done @@ -173892,7 +168537,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25448 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25527 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -173966,17 +168611,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25453, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25532, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -173985,18 +168629,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174058,9 +168701,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174167,7 +168808,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25510, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25589, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174259,20 +168900,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, uint8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, uint8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, uint8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, uint8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -174316,7 +168959,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25513, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25592, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174344,16 +168987,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -174372,24 +169005,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174397,13 +169012,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174419,7 +169027,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25516) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25595) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174553,7 +169161,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25599, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25678, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -174579,9 +169187,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25606, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25685, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25614, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25693, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -174892,9 +169500,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174967,7 +169574,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25620, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25699, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -174991,7 +169598,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25178, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25257, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175052,186 +169659,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25622, + FzName: __ccgo_ts + 25701, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25627, + FzName: __ccgo_ts + 25706, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25633, + FzName: __ccgo_ts + 25712, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25644, + FzName: __ccgo_ts + 25723, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25656, + FzName: __ccgo_ts + 25735, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25656, + FzName: __ccgo_ts + 25735, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25674, + FzName: __ccgo_ts + 25753, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25694, + FzName: __ccgo_ts + 25773, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25707, + FzName: __ccgo_ts + 25786, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25721, + FzName: __ccgo_ts + 25800, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25724, + FzName: __ccgo_ts + 25803, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25728, + FzName: __ccgo_ts + 25807, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25740, + FzName: __ccgo_ts + 25819, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25753, + FzName: __ccgo_ts + 25832, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25765, + FzName: __ccgo_ts + 25844, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25778, + FzName: __ccgo_ts + 25857, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25789, + FzName: __ccgo_ts + 25868, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25801, + FzName: __ccgo_ts + 25880, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25801, + FzName: __ccgo_ts + 25880, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25813, + FzName: __ccgo_ts + 25892, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25824, + FzName: __ccgo_ts + 25903, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25836, + FzName: __ccgo_ts + 25915, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25849, + FzName: __ccgo_ts + 25928, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25862, + FzName: __ccgo_ts + 25941, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25876, + FzName: __ccgo_ts + 25955, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25885, + FzName: __ccgo_ts + 25964, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25895, + FzName: __ccgo_ts + 25974, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25895, + FzName: __ccgo_ts + 25974, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25905, + FzName: __ccgo_ts + 25984, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25905, + FzName: __ccgo_ts + 25984, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25916, + FzName: __ccgo_ts + 25995, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25933, + FzName: __ccgo_ts + 26012, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25951, + FzName: __ccgo_ts + 26030, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25969, + FzName: __ccgo_ts + 26048, }, } @@ -175314,17 +169921,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25988, + FzName: __ccgo_ts + 26067, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25998, + FzName: __ccgo_ts + 26077, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175374,224 +169983,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -175609,33 +170003,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -175646,79 +170034,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -175795,7 +170168,7 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*Ti64)(unsafe.Pointer(bp)) = _i - *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp))))) + *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, uint64(libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp)))))) libc.Xmemcpy(tls, p, bp, uint64(8)) return int32(8) } @@ -175901,7 +170274,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -175964,7 +170337,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26008, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26087, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -175975,7 +170348,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176269,7 +170642,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26013, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26092, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176806,7 +171179,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177186,7 +171559,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26095) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26174) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177264,7 +171637,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -177495,7 +171868,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -177503,7 +171876,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -177741,7 +172114,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178163,7 +172536,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -178672,11 +173045,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178689,11 +173062,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178721,7 +173094,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26109, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -178731,11 +173104,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26129, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26208, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26161, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26240, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -178949,7 +173322,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26198, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -179003,9 +173376,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26343 + zFmt = __ccgo_ts + 26422 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11778, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11827, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179063,9 +173436,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26399, - 1: __ccgo_ts + 5574, - 2: __ccgo_ts + 16855, + 0: __ccgo_ts + 26478, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16951, } var _rtreeModule = Tsqlite3_module{ @@ -179109,21 +173482,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26813, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26892, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26875, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26954, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26880, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26944, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27014, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26959, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27023, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27093, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179153,7 +173526,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27063 + zFormat = __ccgo_ts + 27142 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179168,31 +173541,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27171, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27250, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27216, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27295, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13286, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13335, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27243, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27322, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27265, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27344, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27273, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27352, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179206,14 +173579,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26404, - 1: __ccgo_ts + 26457, - 2: __ccgo_ts + 26502, - 3: __ccgo_ts + 26554, - 4: __ccgo_ts + 26608, - 5: __ccgo_ts + 26653, - 6: __ccgo_ts + 26711, - 7: __ccgo_ts + 26766, + 0: __ccgo_ts + 26483, + 1: __ccgo_ts + 26536, + 2: __ccgo_ts + 26581, + 3: __ccgo_ts + 26633, + 4: __ccgo_ts + 26687, + 5: __ccgo_ts + 26732, + 6: __ccgo_ts + 26790, + 7: __ccgo_ts + 26845, } // C documentation @@ -179271,7 +173644,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27289, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179279,17 +173652,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27309, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27388, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179352,7 +173725,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -179366,13 +173739,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27552, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27558, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27637, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -179381,7 +173754,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27582, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27661, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179395,19 +173768,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27609, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179430,7 +173803,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179441,7 +173814,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179457,8 +173830,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27588, - 1: __ccgo_ts + 27599, + 0: __ccgo_ts + 27667, + 1: __ccgo_ts + 27678, } // C documentation @@ -179516,21 +173889,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11398, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11447, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27612, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27691, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27618, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27697, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27622, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27701, int32(1)) goto _1 _1: ; @@ -179557,7 +173930,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27624, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27703, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -179591,23 +173964,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -179660,7 +174016,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -179675,11 +174031,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4277 + v1 = __ccgo_ts + 4298 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27657, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27736, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -179713,7 +174069,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27664, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27743, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -179730,7 +174086,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27709, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27788, libc.VaList(bp+8, iNode)) } } return pRet @@ -179759,8 +174115,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27741, - 1: __ccgo_ts + 27795, + 0: __ccgo_ts + 27820, + 1: __ccgo_ts + 27874, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -179773,21 +174129,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27843 + v1 = __ccgo_ts + 27922 } else { - v1 = __ccgo_ts + 27851 + v1 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27860, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27939, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27843 + v2 = __ccgo_ts + 27922 } else { - v2 = __ccgo_ts + 27851 + v2 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27905, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27984, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -179832,7 +174188,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27963, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28042, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -179850,7 +174206,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28011, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28090, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -179883,19 +174239,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28078, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28157, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28112, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28191, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28142, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -179940,12 +174296,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28197, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28276, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28228, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28307, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -179974,7 +174330,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28295, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28374, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -179984,11 +174340,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26109, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26188, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28323, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28402, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -180004,8 +174360,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28354, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28361, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28433, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28440, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -180032,7 +174388,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28369, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28448, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180083,13 +174439,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28388, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28467, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6720 + zDb = __ccgo_ts + 6740 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180098,7 +174454,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18622 + v1 = __ccgo_ts + 18718 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180192,14 +174548,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180224,16 +174572,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180365,7 +174703,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -180410,7 +174748,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && libc.Int32FromUint8(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -180472,7 +174810,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -180840,7 +175178,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -180855,9 +175193,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -180942,7 +175280,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -181016,13 +175354,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181083,7 +175414,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181122,7 +175453,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181226,7 +175557,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181257,36 +175588,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181310,7 +175611,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -181594,7 +175895,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -181751,7 +176052,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -181763,13 +176064,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27552, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28512, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28591, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -181778,13 +176079,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28534, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28613, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27609, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -181792,7 +176093,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -181807,7 +176108,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -182019,7 +176320,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16855 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16951 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -182029,7 +176330,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28538 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28617 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -182037,7 +176338,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28544 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28623 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182157,7 +176458,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28553, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28632, 0) } goto geopoly_update_end } @@ -182257,16 +176558,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28593) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28672) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28609) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28688) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182336,7 +176637,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28786, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28865, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182350,61 +176651,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28624, + FzName: __ccgo_ts + 28703, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28637, + FzName: __ccgo_ts + 28716, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28650, + FzName: __ccgo_ts + 28729, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28663, + FzName: __ccgo_ts + 28742, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28609, + FzName: __ccgo_ts + 28688, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28675, + FzName: __ccgo_ts + 28754, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28593, + FzName: __ccgo_ts + 28672, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28698, + FzName: __ccgo_ts + 28777, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28712, + FzName: __ccgo_ts + 28791, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28725, + FzName: __ccgo_ts + 28804, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28739, + FzName: __ccgo_ts + 28818, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28755, + FzName: __ccgo_ts + 28834, }, } @@ -182430,7 +176731,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28767, + FzName: __ccgo_ts + 28846, }, } @@ -182455,20 +176756,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28794, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28873, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28804, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28883, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28815, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28894, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28538, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28617, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28826, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28905, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182542,7 +176843,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -182570,17 +176871,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26095, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26174, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -182588,33 +176891,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -182811,7 +177118,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183232,248 +177539,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]uint8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -183787,7 +177852,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28836, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -183797,7 +177862,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28836, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -183823,7 +177888,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -183846,7 +177911,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -183978,7 +178043,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28857, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28936, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184067,7 +178132,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26008, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26087, zIn, uint64(4)) == 0 { i = int32(4) for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184104,13 +178169,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29028 + v1 = __ccgo_ts + 29107 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29069, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29148, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29219) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29298) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184277,7 +178342,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184338,7 +178403,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29344, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29423, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184348,7 +178413,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29463, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29542, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184356,7 +178421,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29484, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29563, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184368,7 +178433,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29535, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29614, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184412,7 +178477,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29556, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184425,7 +178490,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -184478,7 +178543,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20130, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20226, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184489,7 +178554,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29613, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184500,7 +178565,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29632, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29711, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -184508,7 +178573,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29637, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29716, zName) { bRbuRowid = int32(1) } } @@ -184522,17 +178587,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29647 + v4 = __ccgo_ts + 29726 } else { - v4 = __ccgo_ts + 29660 + v4 = __ccgo_ts + 29739 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29669, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29748, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29698, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29777, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184554,7 +178619,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29720, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29799, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -184593,15 +178658,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29747, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29826, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -184626,7 +178691,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 for int32(1) != 0 { i = 0 for { @@ -184635,7 +178700,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29756, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29835, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -184683,21 +178748,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29769, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29848, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29801, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1672, __ccgo_ts+15154, __ccgo_ts+29824) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29830, __ccgo_ts+29837, __ccgo_ts+5180) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1672, __ccgo_ts+15154, __ccgo_ts+1672) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+29903) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29909, __ccgo_ts+29916, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29845, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29924, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29887, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29966, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -184746,10 +178811,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -184771,15 +178836,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29907 + zCol = __ccgo_ts + 29986 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29915, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29936, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29972, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15154 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30015, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15203 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -184788,9 +178853,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29999, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30078, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -184805,15 +178870,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30047, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15154 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30126, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15203 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30054, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -184867,11 +178932,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1672 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1672 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1667 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1667 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184880,8 +178945,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30066, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) - zType = __ccgo_ts + 1672 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30145, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zType = __ccgo_ts + 1667 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -184900,34 +178965,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29907 + zCol = __ccgo_ts + 29986 } else { - zCol = __ccgo_ts + 29637 + zCol = __ccgo_ts + 29716 } } - zType = __ccgo_ts + 1146 + zType = __ccgo_ts + 1141 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30088, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29824 + v2 = __ccgo_ts + 29903 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30108, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30187, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30129, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30162, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30208, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30241, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15154 - zAnd = __ccgo_ts + 22239 + zCom = __ccgo_ts + 15203 + zAnd = __ccgo_ts + 22335 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -184973,7 +179038,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1672 + zS = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -184981,11 +179046,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30186, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30265, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30198, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30277, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15154 + zS = __ccgo_ts + 15203 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -184997,7 +179062,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30207, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30286, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -185023,27 +179088,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30222, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30236, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22239 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30315, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22335 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30248, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30327, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1672 + zSep1 = __ccgo_ts + 1667 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185051,8 +179116,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22239 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22335 } goto _2 _2: @@ -185075,7 +179140,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30311, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30390, 0) } // C documentation @@ -185109,7 +179174,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if libc.Int32FromUint64(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185117,16 +179182,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if libc.Int32FromUint8(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30337, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30416, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30367, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30446, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } } } @@ -185210,16 +179275,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30404 + zSep = __ccgo_ts + 30483 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29556, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16743) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16839) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } break } @@ -185230,16 +179295,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29824 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30417, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15154 + z = _rbuMPrintf(tls, p, __ccgo_ts+30496, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15203 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30428, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185279,13 +179344,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1672 + zComma = __ccgo_ts + 1667 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30432) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30511) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185293,7 +179358,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -185302,21 +179367,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30482, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30561, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29824 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30504, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15154 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30583, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15203 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30514, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30529, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30608, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185351,30 +179416,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1672 + zComma = __ccgo_ts + 1667 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1672 + zPk = __ccgo_ts + 1667 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30591 + zPk = __ccgo_ts + 30670 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30604 + v2 = __ccgo_ts + 30683 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30614, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15154 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30693, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15203 goto _1 _1: ; @@ -185383,17 +179448,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30641, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30720, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30648 + v3 = __ccgo_ts + 30727 } else { - v3 = __ccgo_ts + 1672 + v3 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30742, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185419,7 +179484,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30695, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30774, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185465,7 +179530,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30752) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30831) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -185634,7 +179699,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30818, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30897, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -185651,18 +179716,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30838, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30917, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30903, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30982, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30939, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31018, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185677,26 +179742,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30973 + v2 = __ccgo_ts + 31052 } else { - v2 = __ccgo_ts + 30977 + v2 = __ccgo_ts + 31056 } v1 = v2 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30983, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31062, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31044, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31123, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30973 + v3 = __ccgo_ts + 31052 } else { - v3 = __ccgo_ts + 30977 + v3 = __ccgo_ts + 31056 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31105, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31184, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185715,62 +179780,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6731) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6727) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6751) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6747) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1672 + v4 = __ccgo_ts + 1667 } else { - v4 = __ccgo_ts + 31264 + v4 = __ccgo_ts + 31343 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31273 + v5 = __ccgo_ts + 31352 } else { - v5 = __ccgo_ts + 1672 + v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31283, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31362, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31319, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31398, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1672 + zRbuRowid = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31347 + zRbuRowid = __ccgo_ts + 31426 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31359 + v6 = __ccgo_ts + 31438 } else { - v6 = __ccgo_ts + 1672 + v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31376, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31452, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31455, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31531, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31751, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31830, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1672 + zRbuRowid1 = __ccgo_ts + 1667 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31850 + v7 = __ccgo_ts + 31929 } else { - v7 = __ccgo_ts + 31860 + v7 = __ccgo_ts + 31939 } zRbuRowid1 = v7 } @@ -185783,28 +179848,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29907, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1672, __ccgo_ts+15154, __ccgo_ts+1672) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31871 + v8 = __ccgo_ts + 31950 } else { - v8 = __ccgo_ts + 1672 + v8 = __ccgo_ts + 1667 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1672 + v9 = __ccgo_ts + 1667 } if zOrder != 0 { - v10 = __ccgo_ts + 23495 + v10 = __ccgo_ts + 23591 } else { - v10 = __ccgo_ts + 1672 + v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31877, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31956, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -185890,11 +179955,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1672 + zPrefix = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31264 + zPrefix = __ccgo_ts + 31343 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31925, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32004, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -185921,7 +179986,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -185968,7 +180033,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31955, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32034, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -186027,27 +180092,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31985, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32064, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32013, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3492, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32092, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3513, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6720, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6740, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32031, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32110, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186080,10 +180145,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32097, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32176, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24838, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24934, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186097,16 +180162,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 32129 + v2 = __ccgo_ts + 32208 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1672 + v3 = __ccgo_ts + 1667 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32131, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32210, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186117,27 +180182,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32163, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32242, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32178, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32257, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32195, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32274, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32211, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32290, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32239, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32318, 0) } } @@ -186187,7 +180252,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186289,7 +180354,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186319,7 +180384,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -186362,12 +180427,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186389,21 +180454,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186420,7 +180485,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32292, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32371, 0) } // C documentation @@ -186437,13 +180502,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32317, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32324, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32396, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -186575,7 +180640,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24395, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24491, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -186711,7 +180776,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32331) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32410) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -186724,7 +180789,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32353, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -186751,7 +180816,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32380, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32459, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -186787,9 +180852,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32540, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32619, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32555, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -186812,9 +180877,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32575, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32654, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32600) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -186825,10 +180890,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32708) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32787) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32773) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32852) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -186846,7 +180911,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32817, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32896, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -186873,8 +180938,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17828) - _rbuCopyPragma(tls, p, __ccgo_ts+16939) + _rbuCopyPragma(tls, p, __ccgo_ts+17924) + _rbuCopyPragma(tls, p, __ccgo_ts+17035) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -186882,7 +180947,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32842, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32921, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -186904,10 +180969,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -186921,10 +180986,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -186994,7 +181059,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32870, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32949, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -187017,10 +181082,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32317, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32396, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187042,7 +181107,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]uint8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32895, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32974, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187089,7 +181154,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32906, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32985, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187134,11 +181199,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32978, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33057, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32992) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33071) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187147,7 +181212,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33049) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33128) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187195,7 +181260,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3869, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187227,7 +181292,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33123, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33202, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187249,17 +181314,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33155 + v3 = __ccgo_ts + 33234 } else { - v3 = __ccgo_ts + 33162 + v3 = __ccgo_ts + 33241 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33169, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33248, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15043, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15092, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187271,21 +181336,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17542) - _rbuCopyPragma(tls, p, __ccgo_ts+16954) + _rbuCopyPragma(tls, p, __ccgo_ts+17638) + _rbuCopyPragma(tls, p, __ccgo_ts+17050) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33201, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33280, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33217, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33296, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187363,7 +181428,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33241, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33320, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187410,7 +181475,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31264, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31343, uint64(8)) == 0 { nDel = int32(8) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187438,16 +181503,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187457,7 +181522,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33249, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33328, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187558,32 +181623,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15058, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15058, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15043 + v1 = __ccgo_ts + 15092 } else { - v1 = __ccgo_ts + 33201 + v1 = __ccgo_ts + 33280 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33201, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33280, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -187609,9 +181674,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -187683,7 +181750,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -187886,7 +181953,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -187937,14 +182004,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189520,7 +183526,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33344, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33423, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -189543,13 +183549,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33352 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33431 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33440 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33366 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33445 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189558,7 +183564,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -189647,12 +183653,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33376, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33455, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33531, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33610, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33545, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33624, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -189729,7 +183735,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33560, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33639, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -189869,315 +183875,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -190930,7 +184627,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -191023,20 +184720,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11778, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33567, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33646, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1672, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33697, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33776, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191062,10 +184759,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29907)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29986))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -191086,8 +184783,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29907) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29907, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29986) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29986, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191151,7 +184848,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191168,6 +184865,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191189,12 +184888,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11778, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -191484,10 +185183,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11398 + zSep = __ccgo_ts + 11447 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33727, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33806, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191496,11 +185195,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5150, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15154 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5171, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -191581,13 +185280,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -191819,7 +185511,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1672, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1667, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -192079,14 +185771,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192146,7 +185830,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) i = 0 for { @@ -192154,8 +185838,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33734, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22239 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33813, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22335 if zRet == uintptr(0) { break } @@ -192174,7 +185858,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) bHave = 0 i = 0 @@ -192184,8 +185868,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33768, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33809 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33847, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33888 if zRet == uintptr(0) { break } @@ -192196,7 +185880,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1792, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1813, 0) } return zRet } @@ -192207,12 +185891,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33814 + v1 = __ccgo_ts + 33893 } else { - v1 = __ccgo_ts + 6725 + v1 = __ccgo_ts + 6745 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33825, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192273,11 +185957,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15154 + v2 = __ccgo_ts + 15203 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33983, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -192305,7 +185989,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33923, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34002, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192334,17 +186018,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -192357,7 +186042,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -192368,18 +186055,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34059, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34090, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192405,7 +186118,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33980, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34111, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192453,7 +186166,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -192565,15 +186278,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -192737,7 +186452,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]uint8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5212, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5233, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -193031,18 +186746,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34007, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11778, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34011, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34035, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34044, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34089, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34138, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34166, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34175, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34220, bp) } else { i = 0 for { @@ -193050,17 +186765,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15154, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15154 + zSep = __ccgo_ts + 15203 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34103, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34234, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34107, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34238, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193072,9 +186787,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34134, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34265, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193195,7 +186910,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193209,14 +186924,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34176, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193285,8 +187000,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193311,18 +187026,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34196, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34327, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193346,28 +187061,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193506,7 +187225,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193521,9 +187240,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -193552,20 +187271,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -193577,13 +187300,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -193739,7 +187463,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -193763,7 +187487,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -193778,7 +187502,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -193834,7 +187558,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -193939,7 +187663,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -194010,8 +187734,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194045,7 +187769,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194055,7 +187779,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194134,7 +187858,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194395,7 +188119,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194472,7 +188196,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -194544,11 +188268,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -194560,8 +188284,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -194589,12 +188313,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -194602,9 +188330,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -194617,14 +188345,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -194648,29 +188368,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -194747,18 +188444,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11778) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11827) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34214, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34345, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34227, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34358, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -194768,9 +188465,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15154 + zSep = __ccgo_ts + 15203 } goto _2 _2: @@ -194778,8 +188475,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1672 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34238, bp) + zSep = __ccgo_ts + 1667 + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -194788,13 +188485,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34246, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34377, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34321, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22239 + zSep = __ccgo_ts + 22335 } goto _3 _3: @@ -194877,13 +188574,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+8 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34327, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34458, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34238, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194893,9 +188590,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22239 + zSep = __ccgo_ts + 22335 } goto _1 _1: @@ -194903,10 +188600,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34345, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34476, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33809, bp) - zSep = __ccgo_ts + 1672 + _sessionAppendStr(tls, bp+8, __ccgo_ts+33888, bp) + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194915,16 +188612,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34321, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34353 + zSep = __ccgo_ts + 34484 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5180, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -194950,7 +188647,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6720, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6740, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -194973,16 +188670,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34358, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34489, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22245, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22341, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15154, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -194990,19 +188687,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34376, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34507, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34387, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34518, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5180, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -195025,12 +188722,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11778, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11827, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34391) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34522) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34504) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34635) } return rc } @@ -195074,7 +188771,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195092,11 +188789,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195273,7 +188970,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -195297,7 +188994,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195312,7 +189009,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195363,7 +189060,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -195403,10 +189100,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195444,11 +189141,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195471,7 +189168,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195490,7 +189187,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195499,7 +189196,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195509,10 +189206,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34648, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34779, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195522,10 +189219,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34669, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34800, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195538,7 +189235,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -195565,7 +189262,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -195593,7 +189290,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -195625,15 +189322,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34688, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34819, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34714, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -195657,9 +189354,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -195669,7 +189366,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6720, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6740, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -195688,18 +189385,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34744, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34875, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34788, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34919, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34859, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34990, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11778) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11827) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -195733,7 +189430,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -195742,7 +189439,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -195750,23 +189447,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34919, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35050, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34949, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34973, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34949, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35104, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -195789,13 +189486,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -195804,11 +189505,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195816,10 +189521,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195827,37 +189538,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -195880,7 +189583,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196250,7 +189953,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -196433,7 +190136,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -196468,8 +190171,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -196488,9 +190191,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -196542,7 +190245,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -196578,11 +190281,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -196595,18 +190304,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -196614,13 +190325,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -196662,12 +190375,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -196675,27 +190394,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -196850,7 +190560,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -196958,8 +190668,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -196971,9 +190681,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -197047,21 +190757,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197167,6 +190881,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197212,24 +190927,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197288,99 +190991,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -197402,14 +191012,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -197421,29 +191023,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197499,15 +191084,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197529,14 +191105,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -197607,7 +191175,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -197635,27 +191202,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -197686,7 +191244,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198222,14 +191780,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198240,16 +191790,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198301,10 +191841,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198410,12 +191950,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198490,7 +192030,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35001, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35132, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -198846,7 +192386,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35029, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -199002,18 +192542,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199096,22 +192624,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199130,7 +192642,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35060, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35191, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199229,7 +192741,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35067 + zErr = __ccgo_ts + 35198 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199240,7 +192752,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+24, bp+32) if *(*int32)(unsafe.Pointer(bp + 104)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1672, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 104)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -199289,16 +192801,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199317,7 +192819,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -199446,7 +192948,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } return v1 } @@ -199484,7 +192986,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35117 + zErr = __ccgo_ts + 35248 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199666,15 +193168,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -199755,7 +193248,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -199847,13 +193340,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -199879,13 +193372,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35165 + z = __ccgo_ts + 35296 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35221 + z1 = __ccgo_ts + 35352 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -199918,19 +193411,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35279, + FzFunc: __ccgo_ts + 35410, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35287, + FzFunc: __ccgo_ts + 35418, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35428, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35302, + FzFunc: __ccgo_ts + 35433, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200318,7 +193811,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) (r int32) { var aBareword [128]Tu8 @@ -200405,21 +193898,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -200590,7 +194068,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1658, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1653, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -200728,13 +194206,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -200794,7 +194265,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35318, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -200820,12 +194291,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32('0') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35325, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35456, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35356, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35487, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200834,7 +194305,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35389, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35520, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200844,14 +194315,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35426, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35557, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35435, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35566, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -200878,7 +194349,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35468, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -200890,76 +194361,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35502, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35510, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*uint8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35542, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35673, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35548, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35567, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35610, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35741, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35567, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35632, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35763, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35646, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35777, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35684, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35815, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35695, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35826, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35730, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35861, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35737, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35868, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5589, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5610, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8414, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17908, + FzName: __ccgo_ts + 18004, }, 2: { - FzName: __ccgo_ts + 35768, + FzName: __ccgo_ts + 35899, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -200967,20 +194438,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35776, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35807, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35938, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35817, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35948, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35851, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35982, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201041,16 +194512,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35879) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16855) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35884, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36010) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16951) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35914) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36045) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35924, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36055, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201076,7 +194547,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35955, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201084,12 +194555,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35960, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36091, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35967, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36098, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35975, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } } goto _1 @@ -201105,9 +194576,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35982, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36113, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35975, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } goto _2 _2: @@ -201170,8 +194641,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35879) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35990, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36010) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201202,19 +194673,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36019, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1672 + v4 = __ccgo_ts + 1667 } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 16)) } else { - v5 = __ccgo_ts + 1672 + v5 = __ccgo_ts + 1667 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -201232,7 +194703,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36039, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36170, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201240,37 +194711,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36089, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36220, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36144, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36275, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35502 + zTail = __ccgo_ts + 35633 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35502 + zTail = __ccgo_ts + 35633 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36197 + zTail = __ccgo_ts + 36328 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36205, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36336, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16855, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16951, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201339,25 +194810,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36216, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36347, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 15154 + v2 = __ccgo_ts + 15203 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36232, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36363, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36239, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35879)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36370, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36010)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201390,7 +194861,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201400,9 +194871,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201515,7 +194986,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36265) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36396) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201526,7 +194997,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36270) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36401) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201537,7 +195008,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36279) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -201551,7 +195022,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36289) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36420) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -201562,7 +195033,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36299) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36430) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -201579,7 +195050,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36311) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36442) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -201594,7 +195065,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35879) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36010) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -201609,7 +195080,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36323) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36454) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -201625,7 +195096,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36337) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36468) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -201668,7 +195139,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36347 + zSelect = __ccgo_ts + 36478 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -201688,7 +195159,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36379) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36510) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -201699,7 +195170,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36387, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36518, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -201764,112 +195235,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -201945,7 +195310,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36458, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, 0) return FTS5_EOF } goto _1 @@ -201956,7 +195321,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36478, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36609, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -201971,13 +195336,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36509, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36640, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36512, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36643, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30973, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31052, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -202021,7 +195386,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -202554,16 +195919,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -202588,14 +195943,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -203660,7 +197007,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203670,7 +197017,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203716,14 +197063,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -203776,12 +197115,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -203915,7 +197254,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -203955,15 +197294,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -204004,7 +197343,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -204042,8 +197381,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36516, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35029, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36647, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204063,10 +197402,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if libc.Int32FromUint8(c) < int32('0') || libc.Int32FromUint8(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36521, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204100,7 +197442,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204150,7 +197492,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204201,7 +197543,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21242, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204228,7 +197570,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -204325,7 +197667,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36550, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36681, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204410,7 +197752,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204423,7 +197765,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204497,7 +197839,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204523,11 +197865,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36603 + v2 = __ccgo_ts + 36734 } else { - v2 = __ccgo_ts + 36516 + v2 = __ccgo_ts + 36647 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36610, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36741, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204540,7 +197882,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36660, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36791, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -204661,14 +198003,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -204684,7 +198018,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -204708,14 +198042,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -205017,7 +198343,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205080,67 +198406,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205278,7 +198544,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -205590,7 +198856,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -206022,9 +199288,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -206061,7 +199327,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206134,7 +199399,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206169,7 +199433,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206184,149 +199447,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206334,187 +199461,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -206694,7 +199641,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36713, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -206799,7 +199746,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36719, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36850, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -206828,7 +199775,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36770, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36901, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -206862,7 +199809,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36819, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -206940,7 +199887,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -207031,7 +199978,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36859, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36990, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207042,7 +199989,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36859, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36990, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -207723,7 +200670,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -207968,15 +200915,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208077,7 +201024,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -208683,7 +201630,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36887, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37018, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -208772,7 +201719,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36971, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37102, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209419,7 +202366,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -209445,14 +202392,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209462,15 +202401,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -209584,7 +202514,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -209605,7 +202535,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210329,7 +203259,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -210388,7 +203318,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -210743,7 +203673,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37053, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37184, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211198,13 +204128,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211249,7 +204172,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37110, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211418,7 +204341,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -211736,7 +204659,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37171, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -212011,7 +204934,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212046,7 +204969,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -212325,16 +205248,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -212552,7 +205465,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -212589,7 +205502,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -212600,70 +205513,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -212732,7 +205582,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -212831,14 +205681,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -212885,19 +205727,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -212976,7 +205805,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -213026,7 +205855,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213108,15 +205937,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1672, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1667, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213142,11 +205974,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37222, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37353, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26008, __ccgo_ts+37230, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26087, __ccgo_ts+37361, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11989, __ccgo_ts+37265, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12038, __ccgo_ts+37396, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213344,7 +206176,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -213599,7 +206431,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37309) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37440) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -213950,7 +206782,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214072,7 +206904,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214192,7 +207024,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36713, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -214786,7 +207618,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37311, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37442, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -215017,7 +207849,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37397) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37528) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215156,7 +207988,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215211,87 +208042,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215299,96 +208049,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -215639,7 +208299,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37402, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37533, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -215676,7 +208336,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5212, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -215695,7 +208355,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*uint8)(unsafe.Pointer(idxStr + uintptr(v5))) = libc.Uint8FromInt32(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5212, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216145,7 +208805,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216173,7 +208833,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216193,7 +208853,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216208,21 +208868,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15154 + v1 = __ccgo_ts + 15203 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } if bDesc != 0 { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37572 } else { - v3 = __ccgo_ts + 37446 + v3 = __ccgo_ts + 37577 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37450, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216280,14 +208940,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37505, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37636, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5571, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5592, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37511, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37642, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216337,7 +208997,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37539, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37670, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -216370,7 +209030,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37549, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37680, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216404,7 +209064,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37570, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37701, libc.VaList(bp+24, z)) } } } else { @@ -216412,7 +209072,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35297 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35428 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -216569,7 +209229,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37603, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37734, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -216640,7 +209300,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1672 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1667 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -216769,7 +209429,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37608, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37739, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -216902,10 +209562,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219441,12 +212038,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38957, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39088, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39061, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39192, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39099, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39230, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219455,7 +212052,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39137, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39268, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219467,14 +212064,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26008, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11989, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38291, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26087, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12038, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38422, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36197, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36328, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35502, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35633, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219494,13 +212091,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30648 + v1 = __ccgo_ts + 30727 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39179, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39310, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39209, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39340, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -219541,7 +212138,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39253, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39384, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -219549,7 +212146,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39276, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39407, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -219564,7 +212161,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39282, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39413, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -219573,22 +212170,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35502, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35633, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39288 + zCols = __ccgo_ts + 39419 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39320 + zCols = __ccgo_ts + 39451 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36197, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36328, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38291, __ccgo_ts+39368, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38422, __ccgo_ts+39499, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36379, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -219633,14 +212230,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -219710,14 +212299,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -219745,6 +212334,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -219757,11 +212347,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -219774,6 +212377,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -220008,12 +212612,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39385, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39516, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39435, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39566, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39464, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39595, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -220021,7 +212625,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36379, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220323,7 +212927,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39493, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39624, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220356,17 +212960,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -220453,7 +213046,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -220555,14 +213148,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35502, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35633, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221214,11 +213789,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39547 + zCat = __ccgo_ts + 39678 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221228,7 +213803,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39556) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221245,20 +213820,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39567) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39525) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39656) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39536) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39667) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39556) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -221294,7 +213869,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -221481,7 +214056,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -221509,14 +214084,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]uint8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -221550,7 +214117,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39585 + zBase = __ccgo_ts + 39716 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -221594,14 +214161,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -221612,16 +214171,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) (r int32) { return libc.BoolInt32(libc.Int32FromUint8(c) == int32('a') || libc.Int32FromUint8(c) == int32('e') || libc.Int32FromUint8(c) == int32('i') || libc.Int32FromUint8(c) == int32('o') || libc.Int32FromUint8(c) == int32('u') || bYIsVowel != 0 && libc.Int32FromUint8(c) == int32('y')) } @@ -221767,64 +214316,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39595, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39598, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39603, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39734, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39608, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39611, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39614, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39624, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39628, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39639, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221833,49 +214382,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39643, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39647, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39650, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39781, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39654, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39658, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39662, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39666, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39670, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39801, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221892,20 +214441,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39674, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39654, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39805, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39677, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39680, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39684, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39670, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39815, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -221921,75 +214470,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39687, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39654, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39695, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39702, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39833, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39707, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39603, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39734, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39712, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39598, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39729, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39717, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39670, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16057, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16153, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39680, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39731, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39736, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39639, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39873, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39746, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39877, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39748, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39662, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -221998,48 +214547,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39754, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39885, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39670, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39762, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39654, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39768, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39899, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39654, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39773, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39904, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39779, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39910, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39666, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39787, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39795, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39926, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39799, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39662, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222047,21 +214596,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39807, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39813, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39944, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39666, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39819, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39680, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222079,48 +214628,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39957, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39611, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39831, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39836, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39967, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39611, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39842, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39973, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39611, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39795, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39926, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39854, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222136,13 +214685,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39860, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39991, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39864, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39995, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222150,7 +214699,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39870, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222247,14 +214796,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222272,13 +214821,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222315,14 +214857,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39874) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40005) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39567) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222360,7 +214902,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222488,7 +215030,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -222564,11 +215106,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -222590,7 +215132,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39889)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40020)) } // C documentation @@ -222616,7 +215158,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39585, + FzName: __ccgo_ts + 39716, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -222624,7 +215166,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39897, + FzName: __ccgo_ts + 40028, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -222632,7 +215174,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39889, + FzName: __ccgo_ts + 40020, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -222662,7 +215204,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39903, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40034, pApi, bp+96, uintptr(0)) } return rc } @@ -228123,39 +220665,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228178,16 +220687,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39910) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40041) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39914) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40045) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39918) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40049) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39927, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40058, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228250,21 +220759,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39961, - 1: __ccgo_ts + 40001, - 2: __ccgo_ts + 40036, + 0: __ccgo_ts + 40092, + 1: __ccgo_ts + 40132, + 2: __ccgo_ts + 40167, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23984, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24080, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40079, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40210, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228285,23 +220795,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228434,10 +220944,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40112, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40243, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40143, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40274, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -228456,7 +220966,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40194, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40325, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -228782,7 +221292,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1672 + zCopy = __ccgo_ts + 1667 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -228906,7 +221416,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40220, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40351, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -228961,15 +221471,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40230 + return __ccgo_ts + 40361 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229191,7 +221701,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229239,11 +221749,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-10.2.1 20210110\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go index 359240b..f3a6bca 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_riscv64.go @@ -1,4 +1,4 @@ -// Code generated for linux/riscv64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/riscv64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/riscv64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/riscv64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/riscv64 by 'generator --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/riscv64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/riscv64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/riscv64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && riscv64 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 1234 const CACHE_STALE = 0 @@ -135,6 +137,31 @@ const CLOCK_REALTIME_COARSE = 5 const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 +const CLONE_CHILD_CLEARTID = 2097152 +const CLONE_CHILD_SETTID = 16777216 +const CLONE_DETACHED = 4194304 +const CLONE_FILES = 1024 +const CLONE_FS = 512 +const CLONE_IO = 2147483648 +const CLONE_NEWCGROUP = 33554432 +const CLONE_NEWIPC = 134217728 +const CLONE_NEWNET = 1073741824 +const CLONE_NEWNS = 131072 +const CLONE_NEWPID = 536870912 +const CLONE_NEWTIME = 128 +const CLONE_NEWUSER = 268435456 +const CLONE_NEWUTS = 67108864 +const CLONE_PARENT = 32768 +const CLONE_PARENT_SETTID = 1048576 +const CLONE_PIDFD = 4096 +const CLONE_PTRACE = 8192 +const CLONE_SETTLS = 524288 +const CLONE_SIGHAND = 2048 +const CLONE_SYSVSEM = 262144 +const CLONE_THREAD = 65536 +const CLONE_UNTRACED = 8388608 +const CLONE_VFORK = 16384 +const CLONE_VM = 256 const COLFLAG_BUSY = 256 const COLFLAG_GENERATED = 96 const COLFLAG_HASCOLL = 512 @@ -161,6 +188,8 @@ const COLTYPE_INT = 3 const COLTYPE_INTEGER = 4 const COLTYPE_REAL = 5 const COLTYPE_TEXT = 6 +const CPU_SETSIZE = 1024 +const CSIGNAL = 255 const CURSOR_FAULT = 4 const CURSOR_INVALID = 1 const CURSOR_REQUIRESEEK = 3 @@ -1243,6 +1272,31 @@ const PTF_INTKEY = 1 const PTF_LEAF = 8 const PTF_LEAFDATA = 4 const PTF_ZERODATA = 2 +const PTHREAD_BARRIER_SERIAL_THREAD = -1 +const PTHREAD_CANCELED = -1 +const PTHREAD_CANCEL_ASYNCHRONOUS = 1 +const PTHREAD_CANCEL_DEFERRED = 0 +const PTHREAD_CANCEL_DISABLE = 1 +const PTHREAD_CANCEL_ENABLE = 0 +const PTHREAD_CANCEL_MASKED = 2 +const PTHREAD_CREATE_DETACHED = 1 +const PTHREAD_CREATE_JOINABLE = 0 +const PTHREAD_EXPLICIT_SCHED = 1 +const PTHREAD_INHERIT_SCHED = 0 +const PTHREAD_MUTEX_DEFAULT = 0 +const PTHREAD_MUTEX_ERRORCHECK = 2 +const PTHREAD_MUTEX_NORMAL = 0 +const PTHREAD_MUTEX_RECURSIVE = 1 +const PTHREAD_MUTEX_ROBUST = 1 +const PTHREAD_MUTEX_STALLED = 0 +const PTHREAD_ONCE_INIT = 0 +const PTHREAD_PRIO_INHERIT = 1 +const PTHREAD_PRIO_NONE = 0 +const PTHREAD_PRIO_PROTECT = 2 +const PTHREAD_PROCESS_PRIVATE = 0 +const PTHREAD_PROCESS_SHARED = 1 +const PTHREAD_SCOPE_PROCESS = 1 +const PTHREAD_SCOPE_SYSTEM = 0 const PTRMAP_BTREE = 5 const PTRMAP_FREEPAGE = 2 const PTRMAP_OVERFLOW1 = 3 @@ -1383,6 +1437,13 @@ const R_OK = 4 const SAVEPOINT_BEGIN = 0 const SAVEPOINT_RELEASE = 1 const SAVEPOINT_ROLLBACK = 2 +const SCHED_BATCH = 3 +const SCHED_DEADLINE = 6 +const SCHED_FIFO = 1 +const SCHED_IDLE = 5 +const SCHED_OTHER = 0 +const SCHED_RESET_ON_FORK = 1073741824 +const SCHED_RR = 2 const SCHEMA_ROOT = 1 const SEEK_DATA = 3 const SEEK_HOLE = 4 @@ -1502,6 +1563,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1741,6 +1803,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1951,6 +2014,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -1974,7 +2038,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 -const SQLITE_MUTEX_NOOP = 1 +const SQLITE_MUTEX_NREF = 0 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -2113,6 +2177,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2121,7 +2186,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2206,6 +2271,7 @@ const SQLITE_TESTCTRL_USELONGDOUBLE = 34 const SQLITE_TESTCTRL_VDBE_COVERAGE = 21 const SQLITE_TEXT = 3 const SQLITE_THREADSAFE = 1 +const SQLITE_THREADS_IMPLEMENTED = 1 const SQLITE_TOKEN_KEYWORD = 2 const SQLITE_TOKEN_QUOTED = 1 const SQLITE_TOOBIG = 18 @@ -2231,8 +2297,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3398,6 +3464,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3407,9 +3476,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3857,12 +3923,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -3991,29 +4051,380 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
      +**
    • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. +** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. +** +**
    • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
    • [[SQLITE_FCNTL_SIZE_LIMIT]] +** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that +** implements [sqlite3_deserialize()] to set an upper bound on the size +** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. +** If the integer pointed to is negative, then it is filled in with the +** current limit. Otherwise the limit is set to the larger of the value +** of the integer pointed to and the current database size. The integer +** pointed to is set to the new limit. +** +**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
    • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
    • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
    • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions super-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
    • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log ([WAL file]) and shared memory +** files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
    • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
    • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
    • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
    • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
    • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connection's busy-handler callback. The argument is of type (void**) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connection's +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
    • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
    • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
    • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
    • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
    • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
    • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
    • [[SQLITE_FCNTL_NULL_IO]] +** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor +** or file handle for the [sqlite3_file] object such that it will no longer +** read or write to the database file. +** +**
    • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
    • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
    • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
    • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
    • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS +** to block for up to M milliseconds before failing when attempting to +** obtain a file lock using the xLock or xShmLock methods of the VFS. +** The parameter is a pointer to a 32-bit signed integer that contains +** the value that M is to be set to. Before returning, the 32-bit signed +** integer is overwritten with the previous value of M. +** +**
    • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** +**
    • [[SQLITE_FCNTL_DATA_VERSION]] +** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +** a database file. The argument is a pointer to a 32-bit unsigned integer. +** The "data version" for the pager is written into the pointer. The +** "data version" changes whenever any change occurs to the corresponding +** database file, either through SQL statements on the same database +** connection or through transactions committed by separate database +** connections possibly in other processes. The [sqlite3_total_changes()] +** interface can be used to find if any database on the connection has changed, +** but that interface responds to changes on TEMP as well as MAIN and does +** not provide a mechanism to detect changes to MAIN only. Also, the +** [sqlite3_total_changes()] interface responds to internal changes only and +** omits changes made by other database connections. The +** [PRAGMA data_version] command provides a mechanism to detect changes to +** a single attached database that occur due to other database connections, +** but omits changes implemented by the database connection on which it is +** called. This file control is the only mechanism to detect changes that +** happen either internally or externally and that are associated with +** a particular attached database. +** +**
    • [[SQLITE_FCNTL_CKPT_START]] +** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint +** in wal mode before the client starts to copy pages from the wal +** file to the database file. +** +**
    • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. +** +**
    • [[SQLITE_FCNTL_EXTERNAL_READER]] +** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect +** whether or not there is a database client in another process with a wal-mode +** transaction open on the database or not. It is only available on unix.The +** (void*) argument passed with this file-control should be a pointer to a +** value of type (int). The integer value is set to 1 if the database is a wal +** mode database and there exists at least one client in another process that +** currently has an SQL transaction open on the database. It is set to 0 if +** the database is not a wal-mode db, or if there is no such connection in any +** other process. This opcode cannot be used to detect transactions opened +** by clients within the current process, only within other processes. +** +**
    • [[SQLITE_FCNTL_CKSM_FILE]] +** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the +** [checksum VFS shim] only. +** +**
    • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control +** purges the contents of the in-memory page cache. If there is an open +** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. +**
    + */ + +/* deprecated names */ + +// C documentation +// +// /* +// ** CAPI3REF: Mutex Handle +// ** +// ** The mutex module within SQLite defines [sqlite3_mutex] to be an +// ** abstract type for a mutex object. The SQLite core never looks +// ** at the internal representation of an [sqlite3_mutex]. It only +// ** deals with pointers to the [sqlite3_mutex] object. +// ** +// ** Mutexes are created using [sqlite3_mutex_alloc()]. +// */ +type Tsqlite3_mutex = struct { + Fmutex Tpthread_mutex_t +} + +type sqlite3_mutex = Tsqlite3_mutex // C documentation // @@ -4296,6 +4707,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4526,33 +4938,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4631,19 +5016,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4728,7 +5100,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4820,223 +5191,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5118,20 +5272,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5181,13 +5321,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5246,9 +5379,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5256,17 +5389,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5293,12 +5426,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5315,7 +5448,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5333,7 +5466,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5367,24 +5500,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5408,22 +5523,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5484,7 +5583,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5564,50 +5663,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -6004,340 +6059,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6347,15 +6068,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6371,14 +6083,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6404,17 +6108,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6469,11 +6162,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6847,55 +6546,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint64 type size_t = Tsize_t @@ -7042,6 +6697,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7100,6 +6760,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7209,14 +6880,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7301,7 +6964,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7403,7 +7066,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7462,6 +7124,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -7473,9 +7136,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -7490,7 +7153,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7539,8 +7201,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -7604,7 +7266,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7676,19 +7337,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7702,11 +7366,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7717,40 +7378,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -7768,7 +7430,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -7780,6 +7442,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -7867,9 +7530,11 @@ type TSelect = struct { type Select = TSelect type TSQLiteThread = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr + Ftid Tpthread_t + Fdone int32 + FpOut uintptr + FxTask uintptr + FpIn uintptr } type SQLiteThread = TSQLiteThread @@ -7928,9 +7593,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -7947,10 +7612,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -7985,6 +7646,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8165,7 +7827,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8207,7 +7868,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8380,9 +8040,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8509,53 +8169,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8659,16 +8272,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8692,38 +8295,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8736,34 +8312,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -8777,90 +8329,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -8879,187 +8347,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9069,913 +8356,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity uint8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -10000,611 +8380,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr uint8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10614,317 +8389,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]uint8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -11010,228 +8474,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]uint8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign uint8 - FisSpecial uint8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]uint8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -11375,10 +8617,10 @@ var _sqlite3azCompileOpt = [54]uintptr{ 47: __ccgo_ts + 1022, 48: __ccgo_ts + 1044, 49: __ccgo_ts + 1065, - 50: __ccgo_ts + 1076, - 51: __ccgo_ts + 1084, - 52: __ccgo_ts + 1098, - 53: __ccgo_ts + 1111, + 50: __ccgo_ts + 1080, + 51: __ccgo_ts + 1088, + 52: __ccgo_ts + 1102, + 53: __ccgo_ts + 1115, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -12209,12 +9451,12 @@ var _sqlite3StdTypeAffinity = [6]uint8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1124, - 1: __ccgo_ts + 1128, - 2: __ccgo_ts + 1133, - 3: __ccgo_ts + 1137, - 4: __ccgo_ts + 1145, - 5: __ccgo_ts + 1150, + 0: __ccgo_ts + 1128, + 1: __ccgo_ts + 1132, + 2: __ccgo_ts + 1137, + 3: __ccgo_ts + 1141, + 4: __ccgo_ts + 1149, + 5: __ccgo_ts + 1154, } /************** End of global.c **********************************************/ @@ -12314,7 +9556,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12392,72 +9633,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12503,164 +9682,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - /* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -12686,18 +9712,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12714,100 +9728,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]uint8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -12829,13 +9749,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -12855,14 +9768,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -12941,7 +9847,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13113,7 +10019,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13171,7 +10077,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13306,24 +10212,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD uint8 - FvalidYMD uint8 - FvalidHMS uint8 - FnFloor uint8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13454,7 +10342,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1155, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1159, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -13486,13 +10374,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1163, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1167, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1171, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -13500,7 +10388,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -13571,10 +10459,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(0) @@ -13642,7 +10530,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1179, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -13710,7 +10598,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) } } @@ -13743,14 +10631,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1187) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1198) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1195) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -13807,7 +10695,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -13948,13 +10836,13 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = uint8(0) _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1208, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1212, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -13962,7 +10850,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) @@ -14040,7 +10928,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) @@ -14109,7 +10997,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1231) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1235) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -14124,7 +11012,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1236) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -14137,7 +11025,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1244) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1248) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(libc.Int32FromUint8((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -14152,7 +11040,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1250) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -14167,7 +11055,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1260) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1264) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -14184,11 +11072,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1270) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1274) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14197,7 +11085,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1280) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1284) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -14244,7 +11132,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1284, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1288, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -14274,8 +11162,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1293, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1191) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1198) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1297, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1195) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -14294,16 +11182,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1303) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1307) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1309) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1314) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { rc = 0 } } @@ -14345,10 +11233,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1318, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -14369,11 +11257,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1330, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1338, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1342, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -14411,7 +11299,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1163, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1167, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -14491,7 +11379,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -14648,7 +11536,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(16)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(17)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(18)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(19)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(20)] = uint8('.') @@ -14696,7 +11584,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(4)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(5)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(6)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(7)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(8)] = uint8('.') @@ -14801,7 +11689,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -14888,9 +11776,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if libc.Int32FromUint8(cf) == int32('d') { - v3 = __ccgo_ts + 1350 + v3 = __ccgo_ts + 1354 } else { - v3 = __ccgo_ts + 1355 + v3 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -14898,9 +11786,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1363, libc.VaList(bp+184, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1366, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -14910,17 +11798,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FvalidYMD = uint8(0) _computeYMD(tls, bp+80) if libc.Int32FromUint8(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) } case int32('H'): fallthrough case int32('k'): if libc.Int32FromUint8(cf) == int32('H') { - v4 = __ccgo_ts + 1350 + v4 = __ccgo_ts + 1354 } else { - v4 = __ccgo_ts + 1355 + v4 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -14934,50 +11822,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if libc.Int32FromUint8(cf) == int32('I') { - v5 = __ccgo_ts + 1350 + v5 = __ccgo_ts + 1354 } else { - v5 = __ccgo_ts + 1355 + v5 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+184, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1386, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if libc.Int32FromUint8(cf) == int32('p') { - v6 = __ccgo_ts + 1397 + v6 = __ccgo_ts + 1401 } else { - v6 = __ccgo_ts + 1400 + v6 = __ccgo_ts + 1404 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if libc.Int32FromUint8(cf) == int32('p') { - v7 = __ccgo_ts + 1403 + v7 = __ccgo_ts + 1407 } else { - v7 = __ccgo_ts + 1406 + v7 = __ccgo_ts + 1410 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1409, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1413, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1419, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1423, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1424, libc.VaList(bp+184, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+184, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1429, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -14987,18 +11875,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 128)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 128))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 128))).FvalidYMD = uint8(0) _computeYMD(tls, bp+128) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1350, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1381, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), uint8('%')) default: @@ -15154,7 +12042,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1444, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1448, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15187,55 +12075,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1250, + FzName: __ccgo_ts + 1254, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1270, + FzName: __ccgo_ts + 1274, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1478, + FzName: __ccgo_ts + 1482, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1483, + FzName: __ccgo_ts + 1487, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1488, + FzName: __ccgo_ts + 1492, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1497, + FzName: __ccgo_ts + 1501, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1506, + FzName: __ccgo_ts + 1510, }, 7: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1515, + FzName: __ccgo_ts + 1519, }, 8: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1528, + FzName: __ccgo_ts + 1532, }, 9: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1546, + FzName: __ccgo_ts + 1550, }, } @@ -15317,28 +12205,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15346,19 +12234,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15375,12 +12263,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15388,7 +12276,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15401,34 +12289,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15530,7 +12418,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -15741,14 +12629,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -15763,9 +12644,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -15906,7 +12787,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1559, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1563, libc.VaList(bp+8, nByte)) } return p } @@ -15968,7 +12849,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1597, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1601, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -16179,7 +13060,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16199,9 +13084,11 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld + _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) + _sqlite3MemoryBarrier(tls) return rc } @@ -16384,40 +13271,320 @@ func init() { *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_noopMutexLeave) } +type Tpthread_t = uintptr + +type pthread_t = Tpthread_t + +type Tpthread_once_t = int32 + +type pthread_once_t = Tpthread_once_t + +type Tpthread_key_t = uint32 + +type pthread_key_t = Tpthread_key_t + +type Tpthread_spinlock_t = int32 + +type pthread_spinlock_t = Tpthread_spinlock_t + +type Tpthread_mutexattr_t = struct { + F__attr uint32 +} + +type pthread_mutexattr_t = Tpthread_mutexattr_t + +type Tpthread_condattr_t = struct { + F__attr uint32 +} + +type pthread_condattr_t = Tpthread_condattr_t + +type Tpthread_barrierattr_t = struct { + F__attr uint32 +} + +type pthread_barrierattr_t = Tpthread_barrierattr_t + +type Tpthread_rwlockattr_t = struct { + F__attr [2]uint32 +} + +type pthread_rwlockattr_t = Tpthread_rwlockattr_t + +type Tsigset_t = struct { + F__bits [16]uint64 +} + +type sigset_t = Tsigset_t + +type t__sigset_t = Tsigset_t + +type Tpthread_attr_t = struct { + F__u struct { + F__vi [0][14]int32 + F__s [0][7]uint64 + F__i [14]int32 + } +} + +type pthread_attr_t = Tpthread_attr_t + +type Tpthread_mutex_t = struct { + F__u struct { + F__vi [0][10]int32 + F__p [0][5]uintptr + F__i [10]int32 + } +} + +type pthread_mutex_t = Tpthread_mutex_t + +type Tpthread_cond_t = struct { + F__u struct { + F__vi [0][12]int32 + F__p [0][6]uintptr + F__i [12]int32 + } +} + +type pthread_cond_t = Tpthread_cond_t + +type Tpthread_rwlock_t = struct { + F__u struct { + F__vi [0][14]int32 + F__p [0][7]uintptr + F__i [14]int32 + } +} + +type pthread_rwlock_t = Tpthread_rwlock_t + +type Tpthread_barrier_t = struct { + F__u struct { + F__vi [0][8]int32 + F__p [0][4]uintptr + F__i [8]int32 + } +} + +type pthread_barrier_t = Tpthread_barrier_t + +type Tsched_param = struct { + Fsched_priority int32 + F__reserved1 int32 + F__reserved2 [2]struct { + F__reserved1 Ttime_t + F__reserved2 int64 + } + F__reserved3 int32 +} + +type sched_param = Tsched_param + +type Tcpu_set_t = struct { + F__bits [16]uint64 +} + +type cpu_set_t = Tcpu_set_t + +type t__ptcb = struct { + F__f uintptr + F__x uintptr + F__next uintptr +} + +/* +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +** intended for use only inside assert() statements. On some platforms, +** there might be race conditions that can cause these routines to +** deliver incorrect results. In particular, if pthread_equal() is +** not an atomic operation, then these routines might delivery +** incorrect results. On most platforms, pthread_equal() is a +** comparison of two integers and is therefore atomic. But we are +** told that HPUX is not such a platform. If so, then these routines +** will not always work correctly on HPUX. +** +** On those platforms where pthread_equal() is not atomic, SQLite +** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to +** make sure no assert() statements are evaluated and hence these +** routines are never called. + */ + +// C documentation +// +// /* +// ** Try to provide a memory barrier operation, needed for initialization +// ** and also for the implementation of xShmBarrier in the VFS in cases +// ** where SQLite is compiled without mutexes. +// */ +func _sqlite3MemoryBarrier(tls *libc.TLS) { + libc.X__sync_synchronize(tls) +} + +// C documentation +// +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ +func _pthreadMutexInit(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +func _pthreadMutexEnd(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. SQLite +// ** will unwind its stack and return an error. The argument +// ** to sqlite3_mutex_alloc() is one of these integer constants: +// ** +// **
      +// **
    • SQLITE_MUTEX_FAST +// **
    • SQLITE_MUTEX_RECURSIVE +// **
    • SQLITE_MUTEX_STATIC_MAIN +// **
    • SQLITE_MUTEX_STATIC_MEM +// **
    • SQLITE_MUTEX_STATIC_OPEN +// **
    • SQLITE_MUTEX_STATIC_PRNG +// **
    • SQLITE_MUTEX_STATIC_LRU +// **
    • SQLITE_MUTEX_STATIC_PMEM +// **
    • SQLITE_MUTEX_STATIC_APP1 +// **
    • SQLITE_MUTEX_STATIC_APP2 +// **
    • SQLITE_MUTEX_STATIC_APP3 +// **
    • SQLITE_MUTEX_STATIC_VFS1 +// **
    • SQLITE_MUTEX_STATIC_VFS2 +// **
    • SQLITE_MUTEX_STATIC_VFS3 +// **
    +// ** +// ** The first two constants cause sqlite3_mutex_alloc() to create +// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +// ** The mutex implementation does not need to make a distinction +// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +// ** not want to. But SQLite will only request a recursive mutex in +// ** cases where it really needs one. If a faster non-recursive mutex +// ** implementation is available on the host platform, the mutex subsystem +// ** might return such a mutex in response to SQLITE_MUTEX_FAST. +// ** +// ** The other allowed parameters to sqlite3_mutex_alloc() each return +// ** a pointer to a static preexisting mutex. Six static mutexes are +// ** used by the current version of SQLite. Future versions of SQLite +// ** may add additional static mutexes. Static mutexes are for internal +// ** use by SQLite only. Applications that use SQLite mutexes should +// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +// ** SQLITE_MUTEX_RECURSIVE. +// ** +// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +// ** returns a different mutex on every call. But for the static +// ** mutex types, the same mutex is returned on every call that has +// ** the same type number. +// */ +func _pthreadMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + var p uintptr + var _ /* recursiveAttr at bp+0 */ Tpthread_mutexattr_t + _ = p + switch iType { + case int32(SQLITE_MUTEX_RECURSIVE): + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutexattr_init(tls, bp) + libc.Xpthread_mutexattr_settype(tls, bp, int32(PTHREAD_MUTEX_RECURSIVE)) + libc.Xpthread_mutex_init(tls, p, bp) + libc.Xpthread_mutexattr_destroy(tls, bp) + } + case SQLITE_MUTEX_FAST: + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutex_init(tls, p, uintptr(0)) + } + default: + p = uintptr(unsafe.Pointer(&_staticMutexes)) + uintptr(iType-int32(2))*40 + break + } + return p +} + +var _staticMutexes = [12]Tsqlite3_mutex{} + +// C documentation +// +// /* +// ** This routine deallocates a previously +// ** allocated mutex. SQLite is careful to deallocate every +// ** mutex that it allocates. +// */ +func _pthreadMutexFree(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_destroy(tls, p) + Xsqlite3_free(tls, p) +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ +func _pthreadMutexEnter(tls *libc.TLS, p uintptr) { + /* Use the built-in recursive mutexes if they are available. + */ + libc.Xpthread_mutex_lock(tls, p) +} + +func _pthreadMutexTry(tls *libc.TLS, p uintptr) (r int32) { + var rc int32 + _ = rc + /* Use the built-in recursive mutexes if they are available. + */ + if libc.Xpthread_mutex_trylock(tls, p) == 0 { + rc = SQLITE_OK + } else { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* -// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation -// ** is used regardless of the run-time threadsafety setting. +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. // */ +func _pthreadMutexLeave(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_unlock(tls, p) +} + func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return _sqlite3NoopMutex(tls) + return uintptr(unsafe.Pointer(&_sMutex1)) } -/************** End of mutex_noop.c ******************************************/ -/************** Begin file mutex_unix.c **************************************/ -/* -** 2007 August 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement mutexes for pthreads - */ -/* #include "sqliteInt.h" */ +var _sMutex1 = Tsqlite3_mutex_methods{} -/* -** The code in this file is only used if we are compiling threadsafe -** under unix with pthreads. -** -** Note that this implementation requires a version of pthreads that -** supports recursive mutexes. - */ +func init() { + p := unsafe.Pointer(&_sMutex1) + *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_pthreadMutexInit) + *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_pthreadMutexEnd) + *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_pthreadMutexAlloc) + *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_pthreadMutexFree) + *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_pthreadMutexEnter) + *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_pthreadMutexTry) + *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_pthreadMutexLeave) +} /************** End of mutex_unix.c ******************************************/ /************** Begin file mutex_w32.c ***************************************/ @@ -16509,6 +13676,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16516,8 +13685,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17336,7 +14505,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -17504,17 +14673,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: uint8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: uint8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: uint8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: uint8('c'), @@ -17711,22 +14880,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 uint8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 uint8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]uint8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -17758,7 +14928,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1647, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1651, int32(1)) break } /* Find out what flags are present */ @@ -17975,11 +15145,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -18007,7 +15177,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -18029,7 +15199,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18173,9 +15343,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1649 + v57 = __ccgo_ts + 1653 } else { - v57 = __ccgo_ts + 1654 + v57 = __ccgo_ts + 1658 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -18186,7 +15356,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1658, uint64(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1662, uint64(5)) bufpt = bp if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -18456,29 +15626,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = uint8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(3)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18519,7 +15667,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1663 + bufpt = __ccgo_ts + 1667 } else { if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -18593,25 +15741,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = libc.Uint8FromInt32(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1664 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1668 } else { - v98 = __ccgo_ts + 1669 + v97 = __ccgo_ts + 1673 + } + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = uint8('"') + flag_alternateform = uint8(0) + } else { + q = uint8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18619,15 +15771,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && libc.Int32FromUint8(v101) != 0) { + if !(v101 && libc.Int32FromUint8(v100) != 0) { break } if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { @@ -18638,13 +15790,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18658,35 +15843,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1680, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = uint8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v108 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if libc.Int32FromUint8(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = uint8('\\') + } else { + if libc.Int32FromUint8(ch1) <= int32(0x1f) { + *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = uint8('\\') + v110 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v110))) = uint8('u') + v111 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v111))) = uint8('0') + v112 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v112))) = uint8('0') + v113 = j1 + j1++ + if libc.Int32FromUint8(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v113))) = libc.Uint8FromInt32(v114) + v115 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v119 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v120))) = uint8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v121))) = uint8(')') + } } *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1))) = uint8(0) length = int32(j1) @@ -18711,9 +15959,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18727,7 +15975,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1676, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18737,21 +15985,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1678, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1688, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1709, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1739, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -18990,7 +16238,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -19026,7 +16274,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -19289,6 +16537,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19306,11 +16556,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]uint8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]uint8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -19744,76 +16994,34 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr - _ = p + var rc int32 + _, _ = p, rc + /* This routine is never used in single-threaded mode */ *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) - p = _sqlite3Malloc(tls, uint64(24)) + p = _sqlite3Malloc(tls, uint64(40)) if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask - (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + libc.Xmemset(tls, p, 0, uint64(40)) + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + ** function that returns SQLITE_ERROR when passed the argument 200, that + ** forces worker threads to run sequentially and deterministically + ** for testing purposes. */ + if _sqlite3FaultSim(tls, int32(200)) != 0 { + rc = int32(1) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) + } + if rc != 0 { + (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -19823,18 +17031,32 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui // // /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) (r int32) { + var rc, v1 int32 + _, _ = rc, v1 if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask != 0 { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TSQLiteThread)(unsafe.Pointer(p)).FxTask})))(tls, (*TSQLiteThread)(unsafe.Pointer(p)).FpIn) + if (*TSQLiteThread)(unsafe.Pointer(p)).Fdone != 0 { + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpOut + rc = SQLITE_OK } else { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpResult + if libc.Xpthread_join(tls, (*TSQLiteThread)(unsafe.Pointer(p)).Ftid, ppOut) != 0 { + v1 = int32(SQLITE_ERROR) + } else { + v1 = SQLITE_OK + } + rc = v1 } Xsqlite3_free(tls, p) - return SQLITE_OK + return rc } +/******************************** End Unix Pthreads *************************/ + +/********************************* Win32 Threads ****************************/ +/******************************** End Win32 Threads *************************/ + +/********************************* Single-Threaded **************************/ /****************************** End Single-Threaded *************************/ /************** End of threads.c *********************************************/ @@ -19944,6 +17166,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*uint8)(unsafe.Pointer(zOut)) = uint8(v & libc.Uint32FromInt32(0xff)) + return int32(1) + } + if v < uint32(0x00800) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 3)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20694,7 +17947,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -20869,7 +18122,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1723, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1753, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21081,11 +18334,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -21321,7 +18574,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -21411,7 +18664,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1748 + pow63 = __ccgo_ts + 1778 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21638,7 +18891,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1767)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -21798,7 +19051,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1783 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -21907,7 +19160,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22323,7 +19576,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1785, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1815, libc.VaList(bp+8, zType)) } // C documentation @@ -22346,13 +19599,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1664) + _logBadConnection(tls, __ccgo_ts+1668) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1830) + _logBadConnection(tls, __ccgo_ts+1860) } return 0 } else { @@ -22366,7 +19619,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1839) + _logBadConnection(tls, __ccgo_ts+1869) return 0 } else { return int32(1) @@ -22397,7 +19650,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -22748,23 +20001,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = *(*uint8)(unsafe.Pointer(v2)) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*uint8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))) h *= uint32(0x9e3779b1) } return h @@ -22819,8 +20070,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -22853,9 +20104,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -22875,13 +20125,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -22889,7 +20138,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -22905,7 +20154,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -22917,7 +20166,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -22966,7 +20215,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -22976,20 +20225,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -23008,196 +20256,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1847, - 1: __ccgo_ts + 1857, - 2: __ccgo_ts + 1868, - 3: __ccgo_ts + 1880, - 4: __ccgo_ts + 1891, - 5: __ccgo_ts + 1903, - 6: __ccgo_ts + 1910, - 7: __ccgo_ts + 1918, - 8: __ccgo_ts + 1926, - 9: __ccgo_ts + 1931, - 10: __ccgo_ts + 1936, - 11: __ccgo_ts + 1942, - 12: __ccgo_ts + 1956, - 13: __ccgo_ts + 1962, - 14: __ccgo_ts + 1972, - 15: __ccgo_ts + 1977, - 16: __ccgo_ts + 1982, - 17: __ccgo_ts + 1985, - 18: __ccgo_ts + 1991, - 19: __ccgo_ts + 1998, - 20: __ccgo_ts + 2002, - 21: __ccgo_ts + 2012, - 22: __ccgo_ts + 2019, - 23: __ccgo_ts + 2026, - 24: __ccgo_ts + 2033, - 25: __ccgo_ts + 2040, - 26: __ccgo_ts + 2050, - 27: __ccgo_ts + 2059, - 28: __ccgo_ts + 2070, - 29: __ccgo_ts + 2079, - 30: __ccgo_ts + 2085, - 31: __ccgo_ts + 2095, - 32: __ccgo_ts + 2105, - 33: __ccgo_ts + 2110, - 34: __ccgo_ts + 2124, - 35: __ccgo_ts + 2135, - 36: __ccgo_ts + 2140, - 37: __ccgo_ts + 2147, - 38: __ccgo_ts + 2158, - 39: __ccgo_ts + 2163, - 40: __ccgo_ts + 2168, - 41: __ccgo_ts + 2174, - 42: __ccgo_ts + 2180, - 43: __ccgo_ts + 2186, - 44: __ccgo_ts + 2189, - 45: __ccgo_ts + 2193, - 46: __ccgo_ts + 2199, - 47: __ccgo_ts + 2210, - 48: __ccgo_ts + 2221, - 49: __ccgo_ts + 2229, - 50: __ccgo_ts + 2238, - 51: __ccgo_ts + 2244, - 52: __ccgo_ts + 2251, - 53: __ccgo_ts + 2259, - 54: __ccgo_ts + 2262, - 55: __ccgo_ts + 2265, - 56: __ccgo_ts + 2268, - 57: __ccgo_ts + 2271, - 58: __ccgo_ts + 2274, - 59: __ccgo_ts + 2277, - 60: __ccgo_ts + 2284, - 61: __ccgo_ts + 2294, - 62: __ccgo_ts + 2307, - 63: __ccgo_ts + 2318, - 64: __ccgo_ts + 2324, - 65: __ccgo_ts + 2331, - 66: __ccgo_ts + 2340, - 67: __ccgo_ts + 2349, - 68: __ccgo_ts + 2356, - 69: __ccgo_ts + 2369, - 70: __ccgo_ts + 2380, - 71: __ccgo_ts + 2385, - 72: __ccgo_ts + 2393, - 73: __ccgo_ts + 2399, - 74: __ccgo_ts + 2406, - 75: __ccgo_ts + 2418, - 76: __ccgo_ts + 2423, - 77: __ccgo_ts + 2432, - 78: __ccgo_ts + 2437, - 79: __ccgo_ts + 2446, - 80: __ccgo_ts + 2451, - 81: __ccgo_ts + 2456, - 82: __ccgo_ts + 2462, - 83: __ccgo_ts + 2470, - 84: __ccgo_ts + 2478, - 85: __ccgo_ts + 2488, - 86: __ccgo_ts + 2496, - 87: __ccgo_ts + 2503, - 88: __ccgo_ts + 2516, - 89: __ccgo_ts + 2521, - 90: __ccgo_ts + 2533, - 91: __ccgo_ts + 2541, - 92: __ccgo_ts + 2548, - 93: __ccgo_ts + 2559, - 94: __ccgo_ts + 2566, - 95: __ccgo_ts + 2573, - 96: __ccgo_ts + 2583, - 97: __ccgo_ts + 2592, - 98: __ccgo_ts + 2603, - 99: __ccgo_ts + 2609, - 100: __ccgo_ts + 2620, - 101: __ccgo_ts + 2630, - 102: __ccgo_ts + 2640, - 103: __ccgo_ts + 2649, - 104: __ccgo_ts + 2656, - 105: __ccgo_ts + 2662, - 106: __ccgo_ts + 2672, - 107: __ccgo_ts + 2683, - 108: __ccgo_ts + 2687, - 109: __ccgo_ts + 2696, - 110: __ccgo_ts + 2705, - 111: __ccgo_ts + 2712, - 112: __ccgo_ts + 2722, - 113: __ccgo_ts + 2729, - 114: __ccgo_ts + 2739, - 115: __ccgo_ts + 2747, - 116: __ccgo_ts + 2754, - 117: __ccgo_ts + 2768, - 118: __ccgo_ts + 2782, - 119: __ccgo_ts + 2790, - 120: __ccgo_ts + 2801, - 121: __ccgo_ts + 2814, - 122: __ccgo_ts + 2825, - 123: __ccgo_ts + 2831, - 124: __ccgo_ts + 2843, - 125: __ccgo_ts + 2852, - 126: __ccgo_ts + 2860, - 127: __ccgo_ts + 2869, - 128: __ccgo_ts + 2878, - 129: __ccgo_ts + 2885, - 130: __ccgo_ts + 2893, - 131: __ccgo_ts + 2900, - 132: __ccgo_ts + 2911, - 133: __ccgo_ts + 2925, - 134: __ccgo_ts + 2936, - 135: __ccgo_ts + 2944, - 136: __ccgo_ts + 2950, - 137: __ccgo_ts + 2958, - 138: __ccgo_ts + 2966, - 139: __ccgo_ts + 2976, - 140: __ccgo_ts + 2989, - 141: __ccgo_ts + 2999, - 142: __ccgo_ts + 3012, - 143: __ccgo_ts + 3021, - 144: __ccgo_ts + 3032, - 145: __ccgo_ts + 3040, - 146: __ccgo_ts + 3046, - 147: __ccgo_ts + 3058, - 148: __ccgo_ts + 3070, - 149: __ccgo_ts + 3078, - 150: __ccgo_ts + 3090, - 151: __ccgo_ts + 3103, - 152: __ccgo_ts + 3113, - 153: __ccgo_ts + 3123, - 154: __ccgo_ts + 3135, - 155: __ccgo_ts + 3140, - 156: __ccgo_ts + 3152, - 157: __ccgo_ts + 3162, - 158: __ccgo_ts + 3168, - 159: __ccgo_ts + 3178, - 160: __ccgo_ts + 3185, - 161: __ccgo_ts + 3197, - 162: __ccgo_ts + 3208, - 163: __ccgo_ts + 3216, - 164: __ccgo_ts + 3225, - 165: __ccgo_ts + 3234, - 166: __ccgo_ts + 3243, - 167: __ccgo_ts + 3250, - 168: __ccgo_ts + 3261, - 169: __ccgo_ts + 3274, - 170: __ccgo_ts + 3284, - 171: __ccgo_ts + 3291, - 172: __ccgo_ts + 3299, - 173: __ccgo_ts + 3308, - 174: __ccgo_ts + 3314, - 175: __ccgo_ts + 3321, - 176: __ccgo_ts + 3329, - 177: __ccgo_ts + 3337, - 178: __ccgo_ts + 3345, - 179: __ccgo_ts + 3355, - 180: __ccgo_ts + 3364, - 181: __ccgo_ts + 3375, - 182: __ccgo_ts + 3386, - 183: __ccgo_ts + 3397, - 184: __ccgo_ts + 3407, - 185: __ccgo_ts + 3413, - 186: __ccgo_ts + 3424, - 187: __ccgo_ts + 3435, - 188: __ccgo_ts + 3440, - 189: __ccgo_ts + 3448, + 0: __ccgo_ts + 1877, + 1: __ccgo_ts + 1887, + 2: __ccgo_ts + 1898, + 3: __ccgo_ts + 1910, + 4: __ccgo_ts + 1921, + 5: __ccgo_ts + 1933, + 6: __ccgo_ts + 1940, + 7: __ccgo_ts + 1948, + 8: __ccgo_ts + 1956, + 9: __ccgo_ts + 1961, + 10: __ccgo_ts + 1966, + 11: __ccgo_ts + 1972, + 12: __ccgo_ts + 1986, + 13: __ccgo_ts + 1992, + 14: __ccgo_ts + 2002, + 15: __ccgo_ts + 2007, + 16: __ccgo_ts + 2012, + 17: __ccgo_ts + 2015, + 18: __ccgo_ts + 2021, + 19: __ccgo_ts + 2028, + 20: __ccgo_ts + 2032, + 21: __ccgo_ts + 2042, + 22: __ccgo_ts + 2049, + 23: __ccgo_ts + 2056, + 24: __ccgo_ts + 2063, + 25: __ccgo_ts + 2070, + 26: __ccgo_ts + 2080, + 27: __ccgo_ts + 2089, + 28: __ccgo_ts + 2100, + 29: __ccgo_ts + 2109, + 30: __ccgo_ts + 2115, + 31: __ccgo_ts + 2125, + 32: __ccgo_ts + 2135, + 33: __ccgo_ts + 2140, + 34: __ccgo_ts + 2154, + 35: __ccgo_ts + 2165, + 36: __ccgo_ts + 2170, + 37: __ccgo_ts + 2177, + 38: __ccgo_ts + 2188, + 39: __ccgo_ts + 2193, + 40: __ccgo_ts + 2198, + 41: __ccgo_ts + 2204, + 42: __ccgo_ts + 2210, + 43: __ccgo_ts + 2216, + 44: __ccgo_ts + 2219, + 45: __ccgo_ts + 2223, + 46: __ccgo_ts + 2229, + 47: __ccgo_ts + 2240, + 48: __ccgo_ts + 2251, + 49: __ccgo_ts + 2259, + 50: __ccgo_ts + 2268, + 51: __ccgo_ts + 2274, + 52: __ccgo_ts + 2281, + 53: __ccgo_ts + 2289, + 54: __ccgo_ts + 2292, + 55: __ccgo_ts + 2295, + 56: __ccgo_ts + 2298, + 57: __ccgo_ts + 2301, + 58: __ccgo_ts + 2304, + 59: __ccgo_ts + 2307, + 60: __ccgo_ts + 2314, + 61: __ccgo_ts + 2324, + 62: __ccgo_ts + 2337, + 63: __ccgo_ts + 2348, + 64: __ccgo_ts + 2354, + 65: __ccgo_ts + 2361, + 66: __ccgo_ts + 2370, + 67: __ccgo_ts + 2379, + 68: __ccgo_ts + 2386, + 69: __ccgo_ts + 2399, + 70: __ccgo_ts + 2410, + 71: __ccgo_ts + 2415, + 72: __ccgo_ts + 2423, + 73: __ccgo_ts + 2429, + 74: __ccgo_ts + 2436, + 75: __ccgo_ts + 2448, + 76: __ccgo_ts + 2453, + 77: __ccgo_ts + 2462, + 78: __ccgo_ts + 2467, + 79: __ccgo_ts + 2476, + 80: __ccgo_ts + 2481, + 81: __ccgo_ts + 2486, + 82: __ccgo_ts + 2492, + 83: __ccgo_ts + 2500, + 84: __ccgo_ts + 2508, + 85: __ccgo_ts + 2518, + 86: __ccgo_ts + 2526, + 87: __ccgo_ts + 2533, + 88: __ccgo_ts + 2546, + 89: __ccgo_ts + 2551, + 90: __ccgo_ts + 2563, + 91: __ccgo_ts + 2571, + 92: __ccgo_ts + 2578, + 93: __ccgo_ts + 2589, + 94: __ccgo_ts + 2596, + 95: __ccgo_ts + 2603, + 96: __ccgo_ts + 2613, + 97: __ccgo_ts + 2622, + 98: __ccgo_ts + 2633, + 99: __ccgo_ts + 2639, + 100: __ccgo_ts + 2650, + 101: __ccgo_ts + 2660, + 102: __ccgo_ts + 2670, + 103: __ccgo_ts + 2679, + 104: __ccgo_ts + 2686, + 105: __ccgo_ts + 2692, + 106: __ccgo_ts + 2702, + 107: __ccgo_ts + 2713, + 108: __ccgo_ts + 2717, + 109: __ccgo_ts + 2726, + 110: __ccgo_ts + 2735, + 111: __ccgo_ts + 2742, + 112: __ccgo_ts + 2752, + 113: __ccgo_ts + 2759, + 114: __ccgo_ts + 2769, + 115: __ccgo_ts + 2777, + 116: __ccgo_ts + 2784, + 117: __ccgo_ts + 2798, + 118: __ccgo_ts + 2812, + 119: __ccgo_ts + 2820, + 120: __ccgo_ts + 2831, + 121: __ccgo_ts + 2844, + 122: __ccgo_ts + 2855, + 123: __ccgo_ts + 2861, + 124: __ccgo_ts + 2873, + 125: __ccgo_ts + 2882, + 126: __ccgo_ts + 2890, + 127: __ccgo_ts + 2899, + 128: __ccgo_ts + 2908, + 129: __ccgo_ts + 2915, + 130: __ccgo_ts + 2923, + 131: __ccgo_ts + 2930, + 132: __ccgo_ts + 2941, + 133: __ccgo_ts + 2955, + 134: __ccgo_ts + 2966, + 135: __ccgo_ts + 2974, + 136: __ccgo_ts + 2980, + 137: __ccgo_ts + 2988, + 138: __ccgo_ts + 2996, + 139: __ccgo_ts + 3006, + 140: __ccgo_ts + 3019, + 141: __ccgo_ts + 3029, + 142: __ccgo_ts + 3042, + 143: __ccgo_ts + 3051, + 144: __ccgo_ts + 3062, + 145: __ccgo_ts + 3070, + 146: __ccgo_ts + 3076, + 147: __ccgo_ts + 3088, + 148: __ccgo_ts + 3100, + 149: __ccgo_ts + 3108, + 150: __ccgo_ts + 3120, + 151: __ccgo_ts + 3133, + 152: __ccgo_ts + 3143, + 153: __ccgo_ts + 3153, + 154: __ccgo_ts + 3165, + 155: __ccgo_ts + 3170, + 156: __ccgo_ts + 3182, + 157: __ccgo_ts + 3192, + 158: __ccgo_ts + 3198, + 159: __ccgo_ts + 3208, + 160: __ccgo_ts + 3215, + 161: __ccgo_ts + 3227, + 162: __ccgo_ts + 3238, + 163: __ccgo_ts + 3246, + 164: __ccgo_ts + 3255, + 165: __ccgo_ts + 3264, + 166: __ccgo_ts + 3273, + 167: __ccgo_ts + 3280, + 168: __ccgo_ts + 3291, + 169: __ccgo_ts + 3304, + 170: __ccgo_ts + 3314, + 171: __ccgo_ts + 3321, + 172: __ccgo_ts + 3329, + 173: __ccgo_ts + 3338, + 174: __ccgo_ts + 3344, + 175: __ccgo_ts + 3351, + 176: __ccgo_ts + 3359, + 177: __ccgo_ts + 3367, + 178: __ccgo_ts + 3375, + 179: __ccgo_ts + 3385, + 180: __ccgo_ts + 3394, + 181: __ccgo_ts + 3405, + 182: __ccgo_ts + 3416, + 183: __ccgo_ts + 3427, + 184: __ccgo_ts + 3437, + 185: __ccgo_ts + 3443, + 186: __ccgo_ts + 3454, + 187: __ccgo_ts + 3465, + 188: __ccgo_ts + 3470, + 189: __ccgo_ts + 3478, } type Tblksize_t = int32 @@ -23280,96 +20528,6 @@ type Tuseconds_t = uint32 type useconds_t = Tuseconds_t -type Tpthread_t = uintptr - -type pthread_t = Tpthread_t - -type Tpthread_once_t = int32 - -type pthread_once_t = Tpthread_once_t - -type Tpthread_key_t = uint32 - -type pthread_key_t = Tpthread_key_t - -type Tpthread_spinlock_t = int32 - -type pthread_spinlock_t = Tpthread_spinlock_t - -type Tpthread_mutexattr_t = struct { - F__attr uint32 -} - -type pthread_mutexattr_t = Tpthread_mutexattr_t - -type Tpthread_condattr_t = struct { - F__attr uint32 -} - -type pthread_condattr_t = Tpthread_condattr_t - -type Tpthread_barrierattr_t = struct { - F__attr uint32 -} - -type pthread_barrierattr_t = Tpthread_barrierattr_t - -type Tpthread_rwlockattr_t = struct { - F__attr [2]uint32 -} - -type pthread_rwlockattr_t = Tpthread_rwlockattr_t - -type Tpthread_attr_t = struct { - F__u struct { - F__vi [0][14]int32 - F__s [0][7]uint64 - F__i [14]int32 - } -} - -type pthread_attr_t = Tpthread_attr_t - -type Tpthread_mutex_t = struct { - F__u struct { - F__vi [0][10]int32 - F__p [0][5]uintptr - F__i [10]int32 - } -} - -type pthread_mutex_t = Tpthread_mutex_t - -type Tpthread_cond_t = struct { - F__u struct { - F__vi [0][12]int32 - F__p [0][6]uintptr - F__i [12]int32 - } -} - -type pthread_cond_t = Tpthread_cond_t - -type Tpthread_rwlock_t = struct { - F__u struct { - F__vi [0][14]int32 - F__p [0][7]uintptr - F__i [14]int32 - } -} - -type pthread_rwlock_t = Tpthread_rwlock_t - -type Tpthread_barrier_t = struct { - F__u struct { - F__vi [0][8]int32 - F__p [0][4]uintptr - F__i [8]int32 - } -} - -type pthread_barrier_t = Tpthread_barrier_t - type Tu_int8_t = uint8 type u_int8_t = Tu_int8_t @@ -23441,14 +20599,6 @@ type Ttimeval = struct { type timeval = Ttimeval -type Tsigset_t = struct { - F__bits [16]uint64 -} - -type sigset_t = Tsigset_t - -type t__sigset_t = Tsigset_t - type Tfd_mask = uint64 type fd_mask = Tfd_mask @@ -23681,22 +20831,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -23727,30 +20861,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -23832,91 +20942,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3458, + FzName: __ccgo_ts + 3488, }, 1: { - FzName: __ccgo_ts + 3463, + FzName: __ccgo_ts + 3493, }, 2: { - FzName: __ccgo_ts + 3469, + FzName: __ccgo_ts + 3499, }, 3: { - FzName: __ccgo_ts + 3476, + FzName: __ccgo_ts + 3506, }, 4: { - FzName: __ccgo_ts + 3483, + FzName: __ccgo_ts + 3513, }, 5: { - FzName: __ccgo_ts + 3488, + FzName: __ccgo_ts + 3518, }, 6: { - FzName: __ccgo_ts + 3494, + FzName: __ccgo_ts + 3524, }, 7: { - FzName: __ccgo_ts + 3504, + FzName: __ccgo_ts + 3534, }, 8: { - FzName: __ccgo_ts + 3510, + FzName: __ccgo_ts + 3540, }, 9: { - FzName: __ccgo_ts + 3515, + FzName: __ccgo_ts + 3545, }, 10: { - FzName: __ccgo_ts + 3521, + FzName: __ccgo_ts + 3551, }, 11: { - FzName: __ccgo_ts + 3529, + FzName: __ccgo_ts + 3559, }, 12: { - FzName: __ccgo_ts + 3535, + FzName: __ccgo_ts + 3565, }, 13: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3572, }, 14: { - FzName: __ccgo_ts + 3551, + FzName: __ccgo_ts + 3581, }, 15: { - FzName: __ccgo_ts + 3558, + FzName: __ccgo_ts + 3588, }, 16: { - FzName: __ccgo_ts + 3568, + FzName: __ccgo_ts + 3598, }, 17: { - FzName: __ccgo_ts + 3575, + FzName: __ccgo_ts + 3605, }, 18: { - FzName: __ccgo_ts + 3589, + FzName: __ccgo_ts + 3619, }, 19: { - FzName: __ccgo_ts + 3595, + FzName: __ccgo_ts + 3625, }, 20: { - FzName: __ccgo_ts + 3601, + FzName: __ccgo_ts + 3631, }, 21: { - FzName: __ccgo_ts + 3608, + FzName: __ccgo_ts + 3638, }, 22: { - FzName: __ccgo_ts + 3616, + FzName: __ccgo_ts + 3646, }, 23: { - FzName: __ccgo_ts + 3621, + FzName: __ccgo_ts + 3651, }, 24: { - FzName: __ccgo_ts + 3628, + FzName: __ccgo_ts + 3658, }, 25: { - FzName: __ccgo_ts + 3635, + FzName: __ccgo_ts + 3665, }, 26: { - FzName: __ccgo_ts + 3647, + FzName: __ccgo_ts + 3677, }, 27: { - FzName: __ccgo_ts + 3656, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3662, + FzName: __ccgo_ts + 3692, }, } @@ -23977,7 +21087,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -24015,10 +21125,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24155,9 +21265,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3668, libc.VaList(bp+136, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3698, libc.VaList(bp+136, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3711, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3741, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -24393,47 +21503,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24473,11 +21542,11 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint ** equivalent to errno. Otherwise, use strerror_r(). */ /* This is a threadsafe build, but strerror_r() is not available. */ - zErr = __ccgo_ts + 1663 + zErr = __ccgo_ts + 1667 if zPath == uintptr(0) { - zPath = __ccgo_ts + 1663 + zPath = __ccgo_ts + 1667 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3721, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3751, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24505,7 +21574,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint32(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3805, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3832, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+136, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25164,7 +22233,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25769,7 +22838,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]uint8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3860, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3890, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -25795,7 +22864,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3575, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3605, bp, int32(42579)) } // C documentation @@ -25832,7 +22901,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<= nSize { iWrite = nSize - int64(1) } - nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1663, int32(1)) + nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1667, int32(1)) if nWrite != int32(1) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(3)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26380,7 +23360,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26443,7 +23423,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -26674,9 +23654,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte break } *(*int32)(unsafe.Pointer(bp + 128)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1663, int32(1), bp+128) != int32(1) { + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1667, int32(1), bp+128) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27444,10 +24423,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3917, - 3: __ccgo_ts + 3926, - 4: __ccgo_ts + 3935, - 5: __ccgo_ts + 1676, + 2: __ccgo_ts + 3947, + 3: __ccgo_ts + 3956, + 4: __ccgo_ts + 3965, + 5: __ccgo_ts + 1706, } // C documentation @@ -27456,8 +24435,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3940) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3954) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3970) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3984) } // C documentation @@ -27519,7 +24498,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = uint8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3961, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3991, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -27691,7 +24670,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3978) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4008) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -27846,7 +24825,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3458, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3488, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -27923,7 +24902,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+128, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(4098)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3647, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3677, zIn, int32(45510)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 128)))[got] = uint8(0) @@ -28121,14 +25090,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3476, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3506, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*uint8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = uint8(0) if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -29933,7 +26742,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -29987,7 +26802,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -30031,7 +26846,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30106,7 +26921,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30160,7 +26975,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30194,66 +27009,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30427,14 +27182,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31250,123 +28005,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31447,7 +28085,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -31541,7 +28179,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -31582,7 +28220,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -31710,7 +28348,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -31730,17 +28368,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -31758,7 +28398,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -31770,7 +28410,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -31971,10 +28611,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -32560,25 +29201,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -33540,258 +30162,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]uint8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -33890,7 +30260,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34119,7 +30489,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34137,7 +30507,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -34710,6 +31080,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35356,7 +31735,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 uint8 var _ /* exists at bp+8 */ int32 @@ -35368,7 +31748,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35389,11 +31769,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Uint8FromInt32(0) *(*uint8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35422,7 +31803,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -35655,7 +32036,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -35792,7 +32173,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -35808,7 +32189,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -36555,10 +32936,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37459,7 +33840,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37503,7 +33884,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -37534,7 +33915,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -37585,7 +33966,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -37620,7 +34001,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4143, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4173, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -37630,7 +34011,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4152, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4182, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -37672,8 +34053,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4157, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4164, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4187, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4194, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -37756,7 +34137,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -38012,7 +34393,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38187,7 +34568,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38218,7 +34599,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38290,7 +34671,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -39350,7 +35731,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -39647,7 +36028,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -39915,7 +36296,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4174, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4204, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40479,9 +36860,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -40496,227 +36877,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -40735,28 +36895,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -40815,7 +36954,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -40827,7 +36966,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -40916,6 +37055,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41183,14 +37323,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41357,7 +37489,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41445,12 +37577,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -41584,7 +37716,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -42025,10 +38157,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42126,7 +38258,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42165,7 +38297,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42178,7 +38310,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42194,7 +38326,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42215,7 +38347,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42281,7 +38413,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42331,7 +38463,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4229, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4259, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -42546,7 +38678,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -42572,7 +38711,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43295,8 +39434,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43383,7 +39522,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -43529,7 +39668,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -43556,7 +39695,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -43565,6 +39704,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -43609,6 +39749,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -43880,7 +40023,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44061,7 +40204,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44070,7 +40213,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44122,14 +40265,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -44675,283 +40818,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45084,27 +40950,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45267,10 +41112,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45279,14 +41125,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -45986,11 +41832,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46164,7 +42010,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46177,12 +42023,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46226,7 +42072,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46234,7 +42080,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46422,7 +42268,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46455,7 +42301,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46654,7 +42500,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -46694,12 +42540,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -46707,21 +42553,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -46768,12 +42614,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -46789,7 +42635,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -46849,7 +42695,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -46866,14 +42712,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -46916,11 +42762,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -46934,7 +42780,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -46987,42 +42833,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -47030,70 +42874,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47139,7 +42983,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47165,7 +43009,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47204,12 +43048,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47236,7 +43080,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47267,11 +43111,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47300,11 +43144,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47313,7 +43157,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47335,30 +43179,28 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt32(flags) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(libc.Uint8FromInt32(flags)) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47466,7 +43308,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -47528,7 +43370,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -47616,7 +43458,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4255) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4285) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48240,7 +44082,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48402,7 +44244,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4264, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4294, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48440,7 +44282,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -48881,7 +44723,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -48905,7 +44747,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -48914,7 +44756,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -48928,7 +44770,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -48958,7 +44800,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -49054,7 +44896,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49092,7 +44934,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49159,7 +45001,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49202,7 +45044,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49232,7 +45074,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49698,7 +45540,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50090,7 +45932,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50100,7 +45942,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50131,7 +45973,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50157,7 +45999,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50231,7 +46073,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50366,7 +46208,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50378,7 +46220,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -50494,7 +46336,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50508,7 +46350,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -50742,7 +46584,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -50826,7 +46668,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -50838,7 +46680,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -51040,7 +46882,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51073,7 +46915,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51082,7 +46924,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51211,7 +47053,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51321,7 +47163,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51409,7 +47251,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51464,7 +47306,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51490,7 +47332,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51517,7 +47359,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -51588,7 +47430,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51726,7 +47568,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -51777,7 +47619,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -51786,7 +47628,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -51876,7 +47718,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -51894,7 +47736,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -51917,7 +47759,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52138,10 +47980,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52432,17 +48274,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -52532,12 +48363,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -52545,7 +48376,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -52640,7 +48471,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -52721,7 +48552,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -52748,7 +48579,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -52788,7 +48619,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -52859,7 +48690,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -52904,7 +48735,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53100,10 +48931,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53226,8 +49058,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53267,7 +49099,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53290,7 +49122,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53421,7 +49253,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53464,7 +49296,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -53523,7 +49355,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -53555,7 +49387,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -53785,7 +49617,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -54031,7 +49863,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54104,7 +49936,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54263,7 +50095,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54294,7 +50126,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54379,7 +50211,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54471,7 +50303,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54507,7 +50339,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -54537,10 +50369,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -54658,12 +50490,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -54673,14 +50505,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -54780,21 +50612,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -54888,7 +50720,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -54998,7 +50830,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -55039,7 +50871,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55120,14 +50952,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55264,7 +51096,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55529,7 +51361,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4268, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4298, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -55577,11 +51409,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4270, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4300, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4293, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4323, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -55607,11 +51439,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4423, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4453, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -55683,11 +51515,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4462 + v2 = __ccgo_ts + 4492 } else { - v2 = __ccgo_ts + 4467 + v2 = __ccgo_ts + 4497 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4488, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4518, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -55823,12 +51655,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4514 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4544 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4532, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4562, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4686, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -55913,7 +51745,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4740, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -55936,7 +51768,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4764, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4794, 0) depth = d2 } } else { @@ -56013,7 +51845,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4789, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4819, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -56027,7 +51859,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4826, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4856, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56118,7 +51950,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4878 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4908 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56142,11 +51974,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4889, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4919, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4934, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56183,10 +52015,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4989, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5019, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5009, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56316,14 +52148,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -56534,45 +52366,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -56625,7 +52418,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3860, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -56635,7 +52428,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5041, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5071, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -56664,7 +52457,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5061, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -56694,7 +52487,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5092, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5122, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57372,7 +53165,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5132, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+48, v1)) *(*uint8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = uint8(0) /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57510,9 +53303,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = uint8(0) @@ -57687,20 +53477,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -57715,10 +53505,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58177,21 +53967,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } *(*uintptr)(unsafe.Pointer(pMem)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58350,7 +54140,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58392,11 +54182,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58406,7 +54196,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58428,12 +54218,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58472,7 +54262,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -58584,8 +54374,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -58636,7 +54426,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -58644,8 +54435,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -58702,14 +54493,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -58723,7 +54514,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -58748,14 +54539,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3860, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -58813,7 +54604,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1663 + zNeg = __ccgo_ts + 1667 rc = SQLITE_OK for { v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -58855,7 +54646,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5139 + zNeg = __ccgo_ts + 5169 } } } @@ -58870,7 +54661,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5141, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5171, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59174,7 +54965,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59190,7 +54981,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59200,7 +54991,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59251,9 +55042,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59327,7 +55118,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -59661,12 +55452,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -59840,7 +55630,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -59857,7 +55647,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -59925,8 +55715,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -59939,11 +55729,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -59980,13 +55770,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -60017,7 +55810,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -60519,7 +56312,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5146, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -60529,66 +56322,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5151) == 0 { - zColl = __ccgo_ts + 5158 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5181) == 0 { + zColl = __ccgo_ts + 5188 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5139 + v3 = __ccgo_ts + 5169 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5160 + v4 = __ccgo_ts + 5190 } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5163, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5193, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5187, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5203, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5233, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1424, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1391, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1664 + zP4 = __ccgo_ts + 1668 } else { - zP4 = __ccgo_ts + 5206 + zP4 = __ccgo_ts + 5236 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5213, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5243, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -60603,20 +56396,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5221, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5251, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5226, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5256, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5228 + zP4 = __ccgo_ts + 5258 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5236, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5266, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -60630,10 +56423,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5173, - 1: __ccgo_ts + 5175, - 2: __ccgo_ts + 5177, - 3: __ccgo_ts + 5182, + 0: __ccgo_ts + 5203, + 1: __ccgo_ts + 5205, + 2: __ccgo_ts + 5207, + 3: __ccgo_ts + 5212, } // C documentation @@ -61430,7 +57223,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -61449,7 +57242,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61457,7 +57250,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -61584,7 +57377,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5252, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5282, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -61592,18 +57385,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5264, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5294, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5278, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5308, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5293, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5323, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -61834,7 +57627,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63222,7 +59015,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63257,7 +59050,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63311,7 +59104,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63443,7 +59236,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -63595,7 +59388,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -63626,7 +59419,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -63777,15 +59570,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5336 + zContext = __ccgo_ts + 5366 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5355 + zContext = __ccgo_ts + 5385 } else { - zContext = __ccgo_ts + 5374 + zContext = __ccgo_ts + 5404 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5383, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5413, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -63880,10 +59673,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -63892,9 +59686,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -63974,7 +59768,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5419, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5449, 0) return int32(1) } else { return 0 @@ -63984,7 +59778,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5464, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5494, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -64042,7 +59836,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64369,12 +60163,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64391,29 +60185,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64443,13 +60241,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64461,11 +60261,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -64473,23 +60277,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -64545,7 +60355,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5504, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5534, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -64746,7 +60556,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -64876,7 +60686,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -65045,6 +60855,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65058,7 +60870,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65096,13 +60908,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65336,18 +61148,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5527, - 1: __ccgo_ts + 5532, - 2: __ccgo_ts + 5539, - 3: __ccgo_ts + 5542, - 4: __ccgo_ts + 5545, - 5: __ccgo_ts + 5548, - 6: __ccgo_ts + 5551, - 7: __ccgo_ts + 5554, - 8: __ccgo_ts + 5562, - 9: __ccgo_ts + 5565, - 10: __ccgo_ts + 5572, - 11: __ccgo_ts + 5580, + 0: __ccgo_ts + 5557, + 1: __ccgo_ts + 5562, + 2: __ccgo_ts + 5569, + 3: __ccgo_ts + 5572, + 4: __ccgo_ts + 5575, + 5: __ccgo_ts + 5578, + 6: __ccgo_ts + 5581, + 7: __ccgo_ts + 5584, + 8: __ccgo_ts + 5592, + 9: __ccgo_ts + 5595, + 10: __ccgo_ts + 5602, + 11: __ccgo_ts + 5610, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -65602,14 +61414,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5587, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5617, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -65647,7 +61459,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -65657,7 +61469,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -65668,24 +61480,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -65733,7 +61549,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -65741,32 +61559,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66183,11 +62007,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66196,7 +62020,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66210,7 +62034,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66245,7 +62069,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, (*TColumn)(unsafe.Pointer(pCol)).Faffinity, bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66280,7 +62104,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66346,11 +62170,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66373,7 +62197,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66395,7 +62219,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66522,7 +62346,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5627, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5657, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -66554,13 +62378,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*56 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1668, int32(4)) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1424, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1428, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5132, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5162, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -66575,28 +62399,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5631, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5661, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5638, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5668, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5651, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5681, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5654, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5684, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5659, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -66760,9 +62584,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -66788,12 +62612,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -66802,28 +62624,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67196,11 +63018,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1133, - 1: __ccgo_ts + 1145, - 2: __ccgo_ts + 1150, - 3: __ccgo_ts + 1128, - 4: __ccgo_ts + 1664, + 0: __ccgo_ts + 1137, + 1: __ccgo_ts + 1149, + 2: __ccgo_ts + 1154, + 3: __ccgo_ts + 1132, + 4: __ccgo_ts + 1668, } // C documentation @@ -67214,12 +63036,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity uint8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67236,7 +63058,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -67254,7 +63076,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -67968,19 +63790,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5695, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5725, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5716, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5746, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5723, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5753, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69194,7 +65016,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69210,6 +65032,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -69703,7 +65531,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -69806,7 +65634,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5747, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5775, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5861, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5889, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70402,7 +66230,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5915, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5943, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70432,12 +66260,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5970 + v250 = __ccgo_ts + 5998 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6018 + v251 = __ccgo_ts + 6046 } else { - v251 = __ccgo_ts + 6061 + v251 = __ccgo_ts + 6089 } v250 = v251 } @@ -70529,7 +66357,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6102) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6130) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -70847,7 +66675,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1663 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1667 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -71613,7 +67441,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, uint8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -71640,7 +67468,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72099,7 +67927,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -72532,7 +68360,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -72862,7 +68690,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -72893,13 +68721,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6147 + zSchema = __ccgo_ts + 6175 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6161, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6189, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -72914,7 +68742,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73151,7 +68979,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6204, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6232, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73168,15 +68996,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73257,11 +69085,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73473,7 +69301,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -73523,7 +69351,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -73579,7 +69407,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -73658,11 +69486,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6241 + v286 = __ccgo_ts + 6269 } else { - v286 = __ccgo_ts + 6246 + v286 = __ccgo_ts + 6274 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6253, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6281, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -73815,7 +69643,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6305, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -73977,7 +69805,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6334, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6362, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74057,12 +69885,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74073,7 +69901,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74167,7 +69995,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74195,11 +70023,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74327,7 +70155,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3860, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74478,7 +70306,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -74565,15 +70393,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -75039,11 +70846,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3860 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75122,14 +70929,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75148,11 +70955,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75228,7 +71035,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75242,7 +71049,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3860 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -75509,108 +71316,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -75974,7 +71516,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76300,8 +71842,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76315,9 +71857,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76465,8 +72007,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76515,18 +72057,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -76660,7 +72203,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -76814,6 +72357,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78309,57 +73855,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -78656,7 +74151,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79359,25 +74854,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6651, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6680, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6659+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6678+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6688+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6707+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6147+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6175+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6697+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } @@ -79416,23 +74911,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79464,7 +74958,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6711, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6740, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -79558,7 +75052,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6716) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6745) != 0 { goto _2 } } @@ -79580,57 +75074,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -79675,11 +75156,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6718, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6747, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6722, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6751, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -79688,36 +75169,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6726, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6755, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -79746,18 +75216,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -79804,15 +75274,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6735, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6764, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6766, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6795, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -79823,8 +75293,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -79864,7 +75334,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6821, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6850, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -79884,7 +75354,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -79893,7 +75363,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6856 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6885 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -79903,26 +75373,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6865 + v8 = __ccgo_ts + 6894 } else { - v10 = __ccgo_ts + 6880 + v8 = __ccgo_ts + 6909 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6902, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6931, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6925, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -79971,8 +75441,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -80046,19 +75516,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 6993 + zIn = __ccgo_ts + 7022 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7021 + zIn = __ccgo_ts + 7050 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7039 + zIn = __ccgo_ts + 7068 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7057 + zIn = __ccgo_ts + 7086 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7075, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7104, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80084,7 +75554,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80230,7 +75700,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7095, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7124, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80285,7 +75755,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7112, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80309,7 +75779,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7176, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7205, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80323,13 +75793,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80349,16 +75819,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7212, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7241, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80369,35 +75836,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7240, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7269, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7283 + zType = __ccgo_ts + 7312 } else { - zType = __ccgo_ts + 7290 + zType = __ccgo_ts + 7319 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7300, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7329, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7328, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7350, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7379, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7394, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80482,7 +75952,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7442, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7471, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -80494,7 +75964,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7453, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7482, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -80540,7 +76010,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -80665,7 +76135,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7464, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7493, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -80700,7 +76170,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7520, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -80738,7 +76208,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7554, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7583, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -80808,7 +76278,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7560, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7589, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -80842,7 +76312,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7621, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7650, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81155,7 +76625,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7652, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7681, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81222,7 +76692,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81233,7 +76703,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7691) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7720) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81243,7 +76713,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7697, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7726, 0) return int32(WRC_Abort) } goto _6 @@ -81465,33 +76935,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -81543,7 +77015,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -81751,7 +77223,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82226,7 +77698,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82305,7 +77777,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7756, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82492,7 +77964,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -82650,11 +78122,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7804 + v2 = __ccgo_ts + 7833 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7806, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7835, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -82700,10 +78172,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -82731,7 +78203,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7850, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7879, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -82751,7 +78223,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7884, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7913, libc.VaList(bp+8, p)) } // C documentation @@ -82822,7 +78294,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7934, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+8, pExpr)) } } } @@ -82874,7 +78346,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7954, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7983, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -82907,7 +78379,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7997, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83143,12 +78615,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83290,7 +78756,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83430,7 +78896,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83451,27 +78916,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -83517,9 +78975,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -83529,8 +78987,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -83544,7 +79002,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -83595,7 +79053,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -83676,7 +79134,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -83694,7 +79152,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -83775,7 +79233,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -83904,7 +79362,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8050, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -84002,10 +79460,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8073) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8102) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8078) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8107) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -84683,13 +80141,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) (r i // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8084) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8113) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8092) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8121) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8098) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8127) == 0 { return int32(1) } return 0 @@ -84704,32 +80162,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8084, - 1: __ccgo_ts + 8092, - 2: __ccgo_ts + 8098, + 0: __ccgo_ts + 8113, + 1: __ccgo_ts + 8121, + 2: __ccgo_ts + 8127, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -84938,7 +80383,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -84991,7 +80436,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8102, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8131, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85091,12 +80536,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -85688,7 +81134,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8317) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8346) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -85784,14 +81230,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -85819,9 +81265,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -85954,7 +81400,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86084,13 +81530,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -86870,7 +82321,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8410, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -86882,7 +82333,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -86897,7 +82348,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8437, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8466, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -86926,7 +82377,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -87002,7 +82453,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8020, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87065,7 +82516,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6803, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87075,7 +82526,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87083,7 +82534,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87096,9 +82547,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87180,7 +82631,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8461, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8490, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87251,17 +82702,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87270,7 +82721,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87282,6 +82733,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87301,7 +82773,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87371,7 +82843,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87415,7 +82887,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87488,7 +82960,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -87515,8 +82987,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -87682,7 +83154,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -87891,7 +83365,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88598,7 +84074,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -88827,10 +84303,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -88868,7 +84344,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88882,7 +84358,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88896,10 +84372,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -88909,25 +84388,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -88940,7 +84423,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -88950,11 +84433,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -88974,13 +84457,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -89050,7 +84533,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89086,6 +84569,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89103,44 +84587,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89220,7 +84709,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89228,7 +84717,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -89246,7 +84735,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -89265,11 +84754,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -89387,8 +84876,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8511, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8569, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89406,10 +84895,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8539, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8714, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8772, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89425,9 +84914,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8888, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8946, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9035, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9093, 0) } } @@ -89483,7 +84972,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9186, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9244, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89492,11 +84981,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9245, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9303, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9251, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9309, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89526,21 +85015,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9278, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9336, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9462, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9520, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9767, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9783, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9825, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9899, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -89548,7 +85037,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -89556,7 +85045,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10106, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10164, 0) goto exit_rename_table exit_rename_table: ; @@ -89573,7 +85062,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10119, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10177, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -89613,11 +85102,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10157, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10215, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10189, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10247, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -89633,10 +85122,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10216) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10274) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10275) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10333) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -89648,13 +85137,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10328) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10386) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10374) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10432) } } /* Modify the CREATE TABLE statement. */ @@ -89668,7 +85157,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10401, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10459, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -89696,7 +85185,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10547, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10605, libc.VaList(bp+16, zTab, zDb)) } } } @@ -89734,12 +85223,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10900, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10958, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10934, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10992, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -89754,7 +85243,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -89762,8 +85251,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10964, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11022, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -89824,18 +85313,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10988 + zType = __ccgo_ts + 11046 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11002 + v1 = __ccgo_ts + 11060 } else { - v1 = __ccgo_ts + 11019 + v1 = __ccgo_ts + 11077 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11037, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11095, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89882,25 +85371,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -89912,11 +85389,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11076, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11258, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11134, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11316, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10106, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10164, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -89926,31 +85403,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -89967,16 +85419,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90279,9 +85721,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90392,11 +85834,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*uint8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11391, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11449, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90467,30 +85909,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11414, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11472, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90511,9 +85957,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -90529,15 +85974,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11422, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11480, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -90548,16 +85993,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, *(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -90574,21 +86019,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0) _sqlite3Dequote(tls, zBuf1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11389 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11428, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11486, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -90614,7 +86059,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -90924,7 +86369,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91066,7 +86511,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 32))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91191,7 +86636,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -91292,7 +86737,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*8))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1663, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91374,7 +86819,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91458,8 +86903,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -91475,12 +86921,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -91554,7 +87000,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -91571,7 +87017,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11433, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11491, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -91626,23 +87072,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11055, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11440 + v1 = __ccgo_ts + 11498 } else { - v1 = __ccgo_ts + 5670 + v1 = __ccgo_ts + 5700 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11452, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11510, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11480, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -91652,33 +87098,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1663, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11528, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11586, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11649, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11707, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -91692,7 +87138,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -91703,8 +87149,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -91765,27 +87211,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11667, + FzName: __ccgo_ts + 11725, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11688, + FzName: __ccgo_ts + 11746, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11708, + FzName: __ccgo_ts + 11766, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11727, + FzName: __ccgo_ts + 11785, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11746, + FzName: __ccgo_ts + 11804, }, } @@ -91996,8 +87442,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11849, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11907, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -92007,10 +87458,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11902, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11960, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -92042,15 +87493,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11769, - FzCols: __ccgo_ts + 11782, + FzName: __ccgo_ts + 11827, + FzCols: __ccgo_ts + 11840, }, 1: { - FzName: __ccgo_ts + 11795, - FzCols: __ccgo_ts + 11808, + FzName: __ccgo_ts + 11853, + FzCols: __ccgo_ts + 11866, }, 2: { - FzName: __ccgo_ts + 11836, + FzName: __ccgo_ts + 11894, }, } @@ -92103,44 +87554,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92264,7 +87677,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92280,12 +87694,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92293,7 +87707,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92352,7 +87766,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11920, + FzName: __ccgo_ts + 11978, } func init() { @@ -92726,7 +88140,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11930, + FzName: __ccgo_ts + 11988, } func init() { @@ -92776,7 +88190,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11940, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11998, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -92787,7 +88201,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11945, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12003, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -92826,7 +88240,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11951, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12009, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -92844,7 +88258,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11957, + FzName: __ccgo_ts + 12015, } func init() { @@ -92910,7 +88324,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11966, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12024, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -92919,12 +88333,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11769, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11827, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -93046,7 +88460,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93126,7 +88540,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93157,7 +88571,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93248,7 +88662,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11976, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93285,7 +88699,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93318,11 +88732,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11980) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12038) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11984) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12042) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93430,13 +88844,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93451,7 +88858,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1663 + z = __ccgo_ts + 1667 } i = 0 for { @@ -93486,17 +88893,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*uint8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11988, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12046, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+11999, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12057, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12009, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12067, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93508,13 +88915,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -93565,7 +88965,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -93768,8 +89168,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -93875,11 +89275,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11795, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11853, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12021, __ccgo_ts+12090, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12079, __ccgo_ts+12148, zDb) } return rc } @@ -93945,10 +89345,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11769, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12142, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12200, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94061,7 +89461,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6711, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6740, zName) == 0) } // C documentation @@ -94103,21 +89503,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1663 + zFile = __ccgo_ts + 1667 } if zName == uintptr(0) { - zName = __ccgo_ts + 1663 + zName = __ccgo_ts + 1667 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4032) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4062) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12183, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12241, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94148,7 +89548,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12186, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12244, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94157,7 +89557,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12223, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12281, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94169,13 +89569,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94213,7 +89613,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12253, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94221,7 +89621,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12282, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12340, 0) rc = int32(SQLITE_ERROR) } } @@ -94265,10 +89665,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12378, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12436, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12399, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12425, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12483, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94433,7 +89833,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12447, + FzName: __ccgo_ts + 12505, } func init() { @@ -94455,7 +89855,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12461, + FzName: __ccgo_ts + 12519, } func init() { @@ -94481,7 +89881,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12475, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12533, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94515,7 +89915,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12499, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12557, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -94642,6 +90042,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -94714,9 +90116,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -94732,7 +90134,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12603, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -94760,11 +90162,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12568, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12626, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12574, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12632, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12580, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12638, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -94824,7 +90226,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8092 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -94859,7 +90261,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12607, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12665, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -94896,47 +90298,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -94977,7 +90338,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95075,7 +90436,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95153,7 +90516,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95167,7 +90530,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95280,21 +90645,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6711) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6740) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6147) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95324,12 +90689,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6697+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6147) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6175) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6678+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6659) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } } @@ -95367,7 +90732,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12622, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12680, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95377,7 +90742,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95385,15 +90750,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12630 + v1 = __ccgo_ts + 12688 } else { - v1 = __ccgo_ts + 12643 + v1 = __ccgo_ts + 12701 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6915, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6986, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95431,12 +90796,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6147+7) == 0 { - return __ccgo_ts + 6697 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + return __ccgo_ts + 6726 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6659+7) == 0 { - return __ccgo_ts + 6678 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6688+7) == 0 { + return __ccgo_ts + 6707 } } return zName @@ -95560,9 +90925,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -95961,7 +91326,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6147) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6175) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -95993,7 +91358,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6711, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6740, zName) { break } goto _1 @@ -96051,13 +91416,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12657, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12674, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96101,12 +91466,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*8))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*8))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6651, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12694, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12752, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96142,23 +91507,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96278,7 +91645,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96321,9 +91688,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96336,7 +91703,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12736, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12794, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96352,9 +91719,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10983 + v2 = __ccgo_ts + 11041 } else { - v2 = __ccgo_ts + 9245 + v2 = __ccgo_ts + 9303 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96364,9 +91731,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96390,11 +91757,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10983 + v4 = __ccgo_ts + 11041 } else { - v4 = __ccgo_ts + 9245 + v4 = __ccgo_ts + 9303 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12777, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96402,11 +91769,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12798, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12856, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96438,19 +91805,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96470,15 +91847,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96493,7 +91875,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -96554,7 +91936,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12833, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -96563,14 +91945,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12867, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12925, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -96602,11 +91986,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity uint8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -96617,7 +92001,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -96627,12 +92011,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12910, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12968, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12917, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12975, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -96674,21 +92058,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*uint8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = uint8(0) _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12927, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -96699,7 +92072,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -96712,12 +92085,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*uint8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = uint8(0) _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -96889,10 +92271,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13011, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12998, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13056, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -96950,7 +92332,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13039, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13097, 0) } } @@ -96978,8 +92360,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -96987,7 +92369,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13091, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13149, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -97006,21 +92388,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -97043,7 +92414,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13132, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97071,8 +92442,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97159,17 +92535,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13188, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13231, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13289, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13239, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13297, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97201,7 +92577,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13304, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97342,9 +92718,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97355,31 +92732,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1663 - zSep2 = __ccgo_ts + 13277 - zEnd = __ccgo_ts + 5171 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1667 + zSep2 = __ccgo_ts + 13335 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13279 - zSep2 = __ccgo_ts + 13283 - zEnd = __ccgo_ts + 13288 + zSep = __ccgo_ts + 13337 + zSep2 = __ccgo_ts + 13341 + zEnd = __ccgo_ts + 13346 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13291, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13349, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97390,8 +92767,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97404,17 +92782,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3860, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1663, - 1: __ccgo_ts + 13305, - 2: __ccgo_ts + 13311, - 3: __ccgo_ts + 13316, - 4: __ccgo_ts + 13321, - 5: __ccgo_ts + 13311, + 0: __ccgo_ts + 1667, + 1: __ccgo_ts + 13363, + 2: __ccgo_ts + 13369, + 3: __ccgo_ts + 13374, + 4: __ccgo_ts + 13379, + 5: __ccgo_ts + 13369, } // C documentation @@ -97423,15 +92802,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97446,7 +92826,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -97679,8 +93059,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -97780,7 +93170,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -97793,8 +93183,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -97824,7 +93214,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -98016,7 +93406,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1663, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -98043,9 +93433,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13327, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13385, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13360, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13418, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98066,11 +93456,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13387, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13445, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13437, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13495, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98117,7 +93507,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13469, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13527, 0) return } } @@ -98151,16 +93541,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9245 - zType2 = __ccgo_ts + 13513 + zType = __ccgo_ts + 9303 + zType2 = __ccgo_ts + 13571 } else { /* A view */ - zType = __ccgo_ts + 10983 - zType2 = __ccgo_ts + 13519 + zType = __ccgo_ts + 11041 + zType2 = __ccgo_ts + 13577 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98177,24 +93567,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98242,13 +93637,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13524, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13539, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13597, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98257,15 +93662,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13637, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13695, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13679, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13737, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13713, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13771, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98283,7 +93688,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9767) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9825) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98316,7 +93721,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13734, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13792, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98333,7 +93738,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10983, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11041, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98430,7 +93835,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13770, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13828, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -98614,7 +94019,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13800, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13858, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -98627,7 +94032,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13815, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13873, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -98710,9 +94115,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13882, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13940, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11872, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -98753,7 +94158,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13896, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -98762,7 +94167,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13941, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13999, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -98797,11 +94202,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3483, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3513, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7453, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7482, int32(10)) == 0 { return 0 } return int32(1) @@ -98856,9 +94261,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -98891,18 +94296,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14008, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14066, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14036, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14070, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14128, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -98912,7 +94317,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11984, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12042, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -98960,19 +94365,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14102, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14160, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14165, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -99029,7 +94434,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14259, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14317, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99144,11 +94549,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99170,7 +94575,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99215,13 +94620,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99244,23 +94649,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99289,11 +94694,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14305 + v2 = __ccgo_ts + 14363 } else { - v2 = __ccgo_ts + 14311 + v2 = __ccgo_ts + 14369 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14316, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14374, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99371,7 +94776,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14344, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14402, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99381,7 +94786,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14350, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14408, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99395,16 +94800,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14400, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14458, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14428, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14453, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14511, 0) goto exit_create_index } /* @@ -99425,19 +94830,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14344, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14402, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14487, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14545, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14521, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14579, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99458,7 +94863,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14545, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14603, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99476,9 +94881,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99506,7 +94911,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14344) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14402) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -99538,7 +94943,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -99590,7 +94995,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14568, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14626, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -99600,7 +95005,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -99610,8 +95015,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -99689,7 +95094,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -99737,7 +95142,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14629, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14687, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -99767,8 +95172,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14671, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14729, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -99781,7 +95186,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -99808,11 +95213,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1663 + v13 = __ccgo_ts + 1667 } else { - v13 = __ccgo_ts + 14688 + v13 = __ccgo_ts + 14746 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14696, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14754, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -99820,7 +95225,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14716, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14774, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -99828,7 +95233,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14775, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -99991,16 +95396,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14802, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14860, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14820, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14878, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -100008,9 +95413,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -100026,8 +95431,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14893, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11980, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14951, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12038, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100100,12 +95505,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100217,13 +95622,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14953, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -100304,7 +95709,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -100354,7 +95759,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -100525,11 +95930,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14989 + v1 = __ccgo_ts + 15047 } else { - v1 = __ccgo_ts + 14992 + v1 = __ccgo_ts + 15050 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14998, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15056, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -100728,7 +96133,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15034, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15092, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -100775,9 +96180,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15040 + v1 = __ccgo_ts + 15098 } else { - v1 = __ccgo_ts + 15049 + v1 = __ccgo_ts + 15107 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -100809,9 +96214,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15034, - 1: __ccgo_ts + 15056, - 2: __ccgo_ts + 15040, + 0: __ccgo_ts + 15092, + 1: __ccgo_ts + 15114, + 2: __ccgo_ts + 15098, } // C documentation @@ -100831,7 +96236,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15064, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15122, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -100856,7 +96261,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101287,7 +96692,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102169,11 +97572,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15297, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15326, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102277,7 +97680,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102334,7 +97737,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15400, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15458, -int32(1)) return } if argc == int32(3) { @@ -104053,7 +99461,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15433, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15491, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104135,7 +99543,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104207,32 +99615,32 @@ var _hexdigits = [16]uint8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15478, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15536, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15486, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15544, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1424, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1428, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -104260,13 +99668,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15494, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15552 + } else { + v2 = __ccgo_ts + 15556 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1664, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1668, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*uint8)(unsafe.Pointer(zOut + uintptr(v2))) = uint8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0) + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15559, -int32(1)) + return +} + // C documentation // // /* @@ -104278,6 +99822,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104288,7 +99836,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -104499,7 +100047,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1663 + zPass = __ccgo_ts + 1667 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104723,7 +100271,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -104812,7 +100360,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11389, + 0: __ccgo_ts + 11447, } // C documentation @@ -104824,8 +100372,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -104840,7 +100388,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -104852,16 +100400,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -104880,7 +100428,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1663) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1667) } // C documentation @@ -104926,7 +100474,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1663 + zIn = __ccgo_ts + 1667 } i = 0 for { @@ -104972,7 +100520,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15497, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15582, int32(4), libc.UintptrFromInt32(0)) } } @@ -105033,7 +100581,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12607, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12665, -int32(1)) return } if argc == int32(2) { @@ -105064,17 +100612,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105143,7 +100680,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105225,7 +100762,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15377, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105288,12 +100825,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105457,7 +100988,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -105468,7 +100999,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -105555,7 +101086,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1663, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1667, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -105575,7 +101106,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15502, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15587, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -105604,8 +101135,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15508, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15508, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15593, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15593, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -105785,11 +101316,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -105893,7 +101424,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -105906,542 +101437,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15513, + FzName: __ccgo_ts + 15598, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15533, + FzName: __ccgo_ts + 15618, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15546, + FzName: __ccgo_ts + 15631, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15564, + FzName: __ccgo_ts + 15649, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15573, + FzName: __ccgo_ts + 15658, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15581, + FzName: __ccgo_ts + 15666, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15596, + FzName: __ccgo_ts + 15681, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15622, + FzName: __ccgo_ts + 15707, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15647, + FzName: __ccgo_ts + 15732, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15656, + FzName: __ccgo_ts + 15741, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15667, + FzName: __ccgo_ts + 15752, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15674, + FzName: __ccgo_ts + 15759, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15688, + FzName: __ccgo_ts + 15773, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15694, + FzName: __ccgo_ts + 15779, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15700, + FzName: __ccgo_ts + 15785, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15705, + FzName: __ccgo_ts + 15790, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15794, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15713, + FzName: __ccgo_ts + 15798, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15720, + FzName: __ccgo_ts + 15805, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15728, + FzName: __ccgo_ts + 15813, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15735, + FzName: __ccgo_ts + 15820, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15748, + FzName: __ccgo_ts + 15833, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15754, + FzName: __ccgo_ts + 15839, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15761, + FzName: __ccgo_ts + 15846, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15768, + FzName: __ccgo_ts + 15853, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15776, + FzName: __ccgo_ts + 15861, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15781, + FzName: __ccgo_ts + 15866, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15870, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15791, + FzName: __ccgo_ts + 15876, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15797, + FzName: __ccgo_ts + 15882, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15803, + FzName: __ccgo_ts + 15888, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15807, + FzName: __ccgo_ts + 15892, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15813, + FzName: __ccgo_ts + 15898, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15820, + FzName: __ccgo_ts + 15905, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15830, + FzName: __ccgo_ts + 15915, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15837, + FzName: __ccgo_ts + 15922, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15844, + FzName: __ccgo_ts + 15929, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15855, + FzName: __ccgo_ts + 15940, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15862, + FzName: __ccgo_ts + 15947, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15877, + FzName: __ccgo_ts + 15962, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15894, + FzName: __ccgo_ts + 15979, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15905, + FzName: __ccgo_ts + 15990, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15911, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15997, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15929, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16003, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15937, + FzName: __ccgo_ts + 16016, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15951, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16034, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15959, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16042, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16056, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FzName: __ccgo_ts + 16064, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15975, + FzName: __ccgo_ts + 16073, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15985, + FzName: __ccgo_ts + 16090, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15989, + FzName: __ccgo_ts + 16094, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15995, + FzName: __ccgo_ts + 16100, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15999, + FzName: __ccgo_ts + 16104, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16005, + FzName: __ccgo_ts + 16110, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16018, + FzName: __ccgo_ts + 16123, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16029, + FzName: __ccgo_ts + 16134, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, + FzName: __ccgo_ts + 15593, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15508, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16034, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1236, + FzName: __ccgo_ts + 15593, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1244, + FzName: __ccgo_ts + 16139, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16039, + FzName: __ccgo_ts + 1240, }, 74: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16045, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1248, }, 75: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16048, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16144, }, 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16052, + FzName: __ccgo_ts + 16150, }, 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16058, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16153, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16048, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16157, }, 79: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16063, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 16163, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16067, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16153, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16071, + FzName: __ccgo_ts + 16168, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16077, + FzName: __ccgo_ts + 16172, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16081, + FzName: __ccgo_ts + 16176, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16086, + FzName: __ccgo_ts + 16182, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16091, + FzName: __ccgo_ts + 16186, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16096, + FzName: __ccgo_ts + 16191, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16102, + FzName: __ccgo_ts + 16196, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16106, + FzName: __ccgo_ts + 16201, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16110, + FzName: __ccgo_ts + 16207, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16114, + FzName: __ccgo_ts + 16211, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, + FzName: __ccgo_ts + 16215, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16124, + FzName: __ccgo_ts + 16219, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16129, + FzName: __ccgo_ts + 16224, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16135, + FzName: __ccgo_ts + 16229, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16141, + FzName: __ccgo_ts + 16234, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16147, + FzName: __ccgo_ts + 16240, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16152, + FzName: __ccgo_ts + 16246, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16160, + FzName: __ccgo_ts + 16252, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16168, + FzName: __ccgo_ts + 16257, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16171, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16265, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16273, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16276, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6856, + FzName: __ccgo_ts + 6885, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16176, + FzName: __ccgo_ts + 16281, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16180, + FzName: __ccgo_ts + 16285, }, } @@ -106500,109 +102042,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -106826,7 +102370,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -106919,7 +102463,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16183, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16288, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -107743,7 +103287,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -108030,11 +103574,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6722, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6718, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108098,7 +103642,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5306) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5336) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108114,7 +103658,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -108562,7 +104106,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -108680,7 +104224,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8349, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8378, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -108746,11 +104290,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109075,7 +104619,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109089,7 +104633,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109124,7 +104668,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109137,7 +104681,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109264,27 +104808,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109365,7 +104909,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109392,7 +104936,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -109401,44 +104945,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16228, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16333, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16269, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16374, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109460,31 +104988,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16301, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16406, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109508,10 +105036,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -109552,8 +105080,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -109570,34 +105098,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16309, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16414, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16361, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16466, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -109704,18 +105232,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -109725,13 +105253,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -109742,14 +105270,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -109766,16 +105294,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -109886,11 +105414,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -109949,7 +105477,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16453) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16558) } goto insert_cleanup insert_cleanup: @@ -110072,33 +105600,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110345,7 +105846,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -112579,7 +107760,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16502, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16607, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -112599,19 +107780,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16506, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16611, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16512, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16617, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112626,14 +107807,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16555, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16660, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -112657,7 +107838,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16587, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16692, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112666,7 +107847,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16467, + 0: __ccgo_ts + 16572, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -112735,14 +107916,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} +var _sqlite3Autoext = Tsqlite3AutoExtList{} -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 - -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -112757,7 +107933,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -112775,7 +107951,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -112790,7 +107966,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -112800,6 +107976,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -112811,7 +107989,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -112823,7 +108001,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -112899,7 +108077,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16624, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16729, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -112953,63 +108131,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5562, - 1: __ccgo_ts + 16663, - 2: __ccgo_ts + 9245, - 3: __ccgo_ts + 16667, - 4: __ccgo_ts + 16672, - 5: __ccgo_ts + 16675, - 6: __ccgo_ts + 16685, - 7: __ccgo_ts + 16695, - 8: __ccgo_ts + 16701, - 9: __ccgo_ts + 16705, - 10: __ccgo_ts + 16710, - 11: __ccgo_ts + 16715, - 12: __ccgo_ts + 16723, - 13: __ccgo_ts + 16734, - 14: __ccgo_ts + 16737, - 15: __ccgo_ts + 16744, - 16: __ccgo_ts + 16705, - 17: __ccgo_ts + 16710, - 18: __ccgo_ts + 16751, - 19: __ccgo_ts + 16756, - 20: __ccgo_ts + 16759, - 21: __ccgo_ts + 16766, - 22: __ccgo_ts + 16701, - 23: __ccgo_ts + 16705, - 24: __ccgo_ts + 16772, - 25: __ccgo_ts + 16777, - 26: __ccgo_ts + 16782, - 27: __ccgo_ts + 16705, - 28: __ccgo_ts + 16786, - 29: __ccgo_ts + 16710, - 30: __ccgo_ts + 16794, - 31: __ccgo_ts + 16798, - 32: __ccgo_ts + 16803, - 33: __ccgo_ts + 11984, - 34: __ccgo_ts + 11980, - 35: __ccgo_ts + 16809, - 36: __ccgo_ts + 16814, - 37: __ccgo_ts + 16819, - 38: __ccgo_ts + 16663, - 39: __ccgo_ts + 16705, - 40: __ccgo_ts + 16824, - 41: __ccgo_ts + 16831, - 42: __ccgo_ts + 16838, - 43: __ccgo_ts + 9245, - 44: __ccgo_ts + 16846, - 45: __ccgo_ts + 5565, - 46: __ccgo_ts + 16852, - 47: __ccgo_ts + 16663, - 48: __ccgo_ts + 16705, - 49: __ccgo_ts + 16857, - 50: __ccgo_ts + 16862, - 51: __ccgo_ts + 16048, - 52: __ccgo_ts + 16867, - 53: __ccgo_ts + 16880, - 54: __ccgo_ts + 16889, - 55: __ccgo_ts + 16896, - 56: __ccgo_ts + 16907, + 0: __ccgo_ts + 5592, + 1: __ccgo_ts + 16768, + 2: __ccgo_ts + 9303, + 3: __ccgo_ts + 16772, + 4: __ccgo_ts + 16777, + 5: __ccgo_ts + 16780, + 6: __ccgo_ts + 16790, + 7: __ccgo_ts + 16800, + 8: __ccgo_ts + 16806, + 9: __ccgo_ts + 16810, + 10: __ccgo_ts + 16815, + 11: __ccgo_ts + 16820, + 12: __ccgo_ts + 16828, + 13: __ccgo_ts + 16839, + 14: __ccgo_ts + 16842, + 15: __ccgo_ts + 16810, + 16: __ccgo_ts + 16849, + 17: __ccgo_ts + 16815, + 18: __ccgo_ts + 16857, + 19: __ccgo_ts + 16861, + 20: __ccgo_ts + 16866, + 21: __ccgo_ts + 16872, + 22: __ccgo_ts + 16810, + 23: __ccgo_ts + 16815, + 24: __ccgo_ts + 16879, + 25: __ccgo_ts + 16884, + 26: __ccgo_ts + 16887, + 27: __ccgo_ts + 16894, + 28: __ccgo_ts + 16806, + 29: __ccgo_ts + 16810, + 30: __ccgo_ts + 16900, + 31: __ccgo_ts + 16905, + 32: __ccgo_ts + 16910, + 33: __ccgo_ts + 16768, + 34: __ccgo_ts + 16810, + 35: __ccgo_ts + 16914, + 36: __ccgo_ts + 16921, + 37: __ccgo_ts + 16928, + 38: __ccgo_ts + 12042, + 39: __ccgo_ts + 12038, + 40: __ccgo_ts + 16936, + 41: __ccgo_ts + 16941, + 42: __ccgo_ts + 16946, + 43: __ccgo_ts + 9303, + 44: __ccgo_ts + 16951, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16957, + 47: __ccgo_ts + 16962, + 48: __ccgo_ts + 16153, + 49: __ccgo_ts + 16967, + 50: __ccgo_ts + 16768, + 51: __ccgo_ts + 16810, + 52: __ccgo_ts + 16980, + 53: __ccgo_ts + 16985, + 54: __ccgo_ts + 16994, + 55: __ccgo_ts + 17001, + 56: __ccgo_ts + 17012, } // C documentation @@ -113028,338 +108206,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16915, + FzName: __ccgo_ts + 17020, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16930, + FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16945, + FzName: __ccgo_ts + 17050, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16957, + FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16973, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16896, + FzName: __ccgo_ts + 17001, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16986, + FzName: __ccgo_ts + 17091, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 16998, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17018, + FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17034, + FzName: __ccgo_ts + 17139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17055, + FzName: __ccgo_ts + 17160, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17070, + FzName: __ccgo_ts + 17175, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17086, + FzName: __ccgo_ts + 17191, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17100, + FzName: __ccgo_ts + 17205, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17113, + FzName: __ccgo_ts + 17218, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17127, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17146, + FzName: __ccgo_ts + 17251, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17165, + FzName: __ccgo_ts + 17270, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17188, + FzName: __ccgo_ts + 17293, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17197, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17215, + FzName: __ccgo_ts + 17320, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17232, + FzName: __ccgo_ts + 17337, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17245, + FzName: __ccgo_ts + 17350, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17260, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17278, + FzName: __ccgo_ts + 17383, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17288, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17302, + FzName: __ccgo_ts + 17407, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17318, + FzName: __ccgo_ts + 17423, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17343, + FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17362, + FzName: __ccgo_ts + 17467, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17373, + FzName: __ccgo_ts + 17478, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17384, + FzName: __ccgo_ts + 17489, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17396, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17412, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17425, + FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17444, + FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17463, + FzName: __ccgo_ts + 17568, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17476, + FzName: __ccgo_ts + 17581, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17491, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17501, + FzName: __ccgo_ts + 17606, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17513, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17522, + FzName: __ccgo_ts + 17627, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17533, + FzName: __ccgo_ts + 17638, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17543, + FzName: __ccgo_ts + 17648, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17555, + FzName: __ccgo_ts + 17660, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17566, + FzName: __ccgo_ts + 17671, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17578, + FzName: __ccgo_ts + 17683, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17595, + FzName: __ccgo_ts + 17700, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17614, + FzName: __ccgo_ts + 17719, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17640, + FzName: __ccgo_ts + 17745, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17655, + FzName: __ccgo_ts + 17760, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17669, + FzName: __ccgo_ts + 17774, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17688, + FzName: __ccgo_ts + 17793, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17702, + FzName: __ccgo_ts + 17807, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17718, + FzName: __ccgo_ts + 17823, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17730, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17741, + FzName: __ccgo_ts + 17846, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17752, + FzName: __ccgo_ts + 17857, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113367,45 +108545,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17764, + FzName: __ccgo_ts + 17869, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17775, + FzName: __ccgo_ts + 17880, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17796, + FzName: __ccgo_ts + 17901, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17804, + FzName: __ccgo_ts + 17909, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17819, + FzName: __ccgo_ts + 17924, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17832, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17851, + FzName: __ccgo_ts + 17956, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17866, + FzName: __ccgo_ts + 17971, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113423,7 +108601,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -113531,10 +108709,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17882) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17987) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17892) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17997) { return PAGER_LOCKINGMODE_NORMAL } } @@ -113552,13 +108730,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8405) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8434) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17899) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18004) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17904) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18009) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -113581,10 +108759,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) <= int32('2') { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16857) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16980) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17916) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18021) == 0 { return int32(2) } else { return 0 @@ -113606,7 +108784,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17923, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18028, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -113736,15 +108914,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17985 + zName = __ccgo_ts + 18090 case int32(OE_SetDflt): - zName = __ccgo_ts + 17994 + zName = __ccgo_ts + 18099 case int32(OE_Cascade): - zName = __ccgo_ts + 18006 + zName = __ccgo_ts + 18111 case int32(OE_Restrict): - zName = __ccgo_ts + 18014 + zName = __ccgo_ts + 18119 default: - zName = __ccgo_ts + 18023 + zName = __ccgo_ts + 18128 break } return zName @@ -113765,12 +108943,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18033, - 1: __ccgo_ts + 18040, - 2: __ccgo_ts + 18048, - 3: __ccgo_ts + 18052, - 4: __ccgo_ts + 17916, - 5: __ccgo_ts + 18061, + 0: __ccgo_ts + 18138, + 1: __ccgo_ts + 18145, + 2: __ccgo_ts + 18153, + 3: __ccgo_ts + 18157, + 4: __ccgo_ts + 18021, + 5: __ccgo_ts + 18166, } // C documentation @@ -113832,15 +109010,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18086 + zType = __ccgo_ts + 18191 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18088 + zType = __ccgo_ts + 18193 } else { - zType = __ccgo_ts + 7804 + zType = __ccgo_ts + 7833 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18090, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18195, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -113849,9 +109027,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18065, - 2: __ccgo_ts + 18070, - 3: __ccgo_ts + 18078, + 1: __ccgo_ts + 18170, + 2: __ccgo_ts + 18175, + 3: __ccgo_ts + 18183, } // C documentation @@ -113950,7 +109128,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18097, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18202, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -113993,7 +109171,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -114038,7 +109216,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114097,7 +109275,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18101) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18206) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114140,7 +109318,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114168,7 +109346,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17892 + zRet = __ccgo_ts + 17997 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114196,7 +109374,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17882 + zRet = __ccgo_ts + 17987 } _returnSingleText(tls, v, zRet) break @@ -114486,7 +109664,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uint8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18106, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18211, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114496,7 +109674,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*uint8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -114518,7 +109696,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18131, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18236, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -114550,8 +109728,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18184) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18289) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -114631,9 +109810,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18190 + v14 = __ccgo_ts + 18295 } else { - v14 = __ccgo_ts + 18198 + v14 = __ccgo_ts + 18303 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -114645,7 +109824,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1663), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667), v15, v16, k, isHidden)) goto _12 _12: ; @@ -114704,7 +109883,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18205, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18310, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -114712,7 +109891,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FpSchema + 8 @@ -114734,19 +109913,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10983 + zType = __ccgo_ts + 11041 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13231 + zType = __ccgo_ts + 13289 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18221 + zType = __ccgo_ts + 18326 } else { - zType = __ccgo_ts + 9245 + zType = __ccgo_ts + 9303 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18228, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18333, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -114793,9 +109972,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18235, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18340, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18240, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18345, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -114819,11 +109998,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18245, - 1: __ccgo_ts + 18247, - 2: __ccgo_ts + 16734, + 0: __ccgo_ts + 18350, + 1: __ccgo_ts + 18352, + 2: __ccgo_ts + 16839, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18249, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18354, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -114842,7 +110021,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18255, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18360, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -114859,7 +110038,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18259, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18364, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -114909,7 +110088,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -114921,7 +110100,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7804, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -114947,7 +110126,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18262, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18271)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18367, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18376)) goto _32 _32: ; @@ -114961,8 +110140,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115088,7 +110267,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18276, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18381, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115184,7 +110363,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115228,7 +110407,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -115279,7 +110458,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18280, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18385, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115290,7 +110469,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18304) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18409) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115426,7 +110605,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18333, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115488,7 +110667,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115510,7 +110689,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18369, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18474, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -115523,7 +110702,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18389, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18494, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -115531,7 +110710,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18411, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18516, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -115542,10 +110721,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18434, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18539, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18436, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -115579,7 +110758,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18456, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18561, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -115603,9 +110782,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18491) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18596) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -115618,9 +110797,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18512) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18617) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18548) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18653) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -115648,9 +110827,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18486) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18559) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18664) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -115678,7 +110857,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18586) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18691) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -115775,7 +110954,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18613 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18718 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -115854,7 +111033,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18674, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18779, libc.VaList(bp+176, zRight)) } } } @@ -115959,13 +111138,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17899) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18004) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18699) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18804) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18052) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18157) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116100,7 +111279,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116130,7 +111309,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6651, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6680, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116192,7 +111371,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18707, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18812, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116465,34 +111644,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18616, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18621, + FzName: __ccgo_ts + 18726, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18627, + FzName: __ccgo_ts + 18732, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18636, + FzName: __ccgo_ts + 18741, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18645, + FzName: __ccgo_ts + 18750, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18653, + FzName: __ccgo_ts + 18758, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18661, + FzName: __ccgo_ts + 18766, }, 7: { - FzName: __ccgo_ts + 18668, + FzName: __ccgo_ts + 18773, }, 8: {}, } @@ -116549,25 +111728,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -116588,14 +111748,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18725) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18830) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18740, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18845, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -116604,19 +111764,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18747, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18852, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18753) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18765) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18870) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -116631,7 +111791,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -116812,7 +111972,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -116824,13 +111984,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18780) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18885) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18788, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18893, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18792, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18897, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -116839,7 +111999,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -116965,24 +112125,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18826, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18931, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5173 + v1 = __ccgo_ts + 5203 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18854, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18885, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18990, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -116990,9 +112150,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18796, - 1: __ccgo_ts + 18803, - 2: __ccgo_ts + 18815, + 0: __ccgo_ts + 18901, + 1: __ccgo_ts + 18908, + 2: __ccgo_ts + 18920, } // C documentation @@ -117068,7 +112228,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117101,11 +112261,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18893) + _corruptSchema(tls, pData, argv, __ccgo_ts+18998) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14671) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } } @@ -117144,18 +112304,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9245 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9303 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6659 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6147 + v2 = __ccgo_ts + 6175 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8317 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18906 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8346 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19011 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117239,7 +112399,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12282) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12340) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117265,7 +112425,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18978) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19083) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117280,7 +112440,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19002, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19107, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -117576,7 +112736,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -117589,9 +112749,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -117609,13 +112769,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1637, 0) } } @@ -117638,7 +112798,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -117649,7 +112809,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1633, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1637, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -117698,7 +112858,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19036, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19141, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -117714,7 +112874,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19066, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19171, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -117737,10 +112897,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -117748,7 +112908,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3860, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -117778,7 +112938,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -117912,7 +113072,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -118034,15 +113194,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118078,21 +113229,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118172,7 +113308,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118180,7 +113316,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118336,15 +113472,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11389 - zSp2 = __ccgo_ts + 11389 + zSp1 = __ccgo_ts + 11447 + zSp2 = __ccgo_ts + 11447 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19085, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19190, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118401,25 +113537,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -118551,13 +113690,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -118635,7 +113774,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19115, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19220, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -118685,12 +113824,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19165, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19270, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -118705,9 +113844,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19229, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19334, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -118717,6 +113857,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = uint8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -118751,7 +113898,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6856, + Fz: __ccgo_ts + 6885, Fn: uint32(8), } @@ -118768,13 +113915,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -118799,7 +113939,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -118844,7 +113984,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -118868,7 +114008,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -118889,7 +114029,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -119012,7 +114152,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119139,10 +114279,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119150,7 +114290,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119327,7 +114467,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119438,8 +114578,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119447,7 +114587,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -119532,13 +114672,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19286 + z = __ccgo_ts + 19391 case int32(TK_INTERSECT): - z = __ccgo_ts + 19296 + z = __ccgo_ts + 19401 case int32(TK_EXCEPT): - z = __ccgo_ts + 19306 + z = __ccgo_ts + 19411 default: - z = __ccgo_ts + 19313 + z = __ccgo_ts + 19418 break } return z @@ -119559,7 +114699,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+8, zUsage)) } /* @@ -119596,13 +114736,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19342 + v1 = __ccgo_ts + 19447 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19356, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19461, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19387, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19492, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -119626,11 +114766,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -119845,8 +114985,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1137 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16846 + zType = __ccgo_ts + 1141 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16951 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -119959,7 +115099,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -119968,7 +115108,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -119992,13 +115132,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16846 + zCol = __ccgo_ts + 16951 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -120006,7 +115146,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120060,7 +115200,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120098,7 +115238,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16846 + v3 = __ccgo_ts + 16951 } zName = v3 } else { @@ -120113,7 +115253,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19433, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120149,7 +115289,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19547, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120268,7 +115408,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != libc.Int32FromUint8(_sqlite3AffinityType(tls, zType, uintptr(0))) { if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19450 + zType = __ccgo_ts + 19555 } else { zType = uintptr(0) j = int32(1) @@ -120334,7 +115474,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -120362,7 +115502,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120412,7 +115552,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120435,7 +115575,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -120583,7 +115723,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19454, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19559, 0) return } /* Obtain authorization to do a recursive query */ @@ -120620,7 +115760,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -120631,7 +115771,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -120645,7 +115785,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -120676,7 +115816,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19503, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19608, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -120691,7 +115831,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19545, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19650, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -120719,7 +115859,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19551, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19656, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -120772,11 +115912,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } else { - v1 = __ccgo_ts + 19566 + v1 = __ccgo_ts + 19671 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19568, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19673, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -120884,8 +116024,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19591, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19606, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19696, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19711, 0) } /* Generate code for the left and right SELECT statements. */ @@ -120910,7 +116050,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19286, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19391, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120936,7 +116076,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -120962,7 +116102,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120994,11 +116134,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -121020,7 +116160,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19625, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121127,6 +116267,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121143,9 +116284,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19646, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19751, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19692, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19797, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121216,7 +116357,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19266, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121432,7 +116573,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -121464,7 +116605,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -121518,16 +116659,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7554) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7554) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7583) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -121545,32 +116686,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19774, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19879, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19785, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19890, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121583,7 +116724,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19790, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19895, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -121793,11 +116934,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5151 + v1 = __ccgo_ts + 5181 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -121958,7 +117099,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122148,9 +117289,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122362,7 +117503,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122509,7 +117650,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -122748,18 +117889,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -122799,11 +117928,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -122868,7 +117997,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -122886,12 +118015,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123373,7 +118502,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123419,13 +118548,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15705) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15790) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15709) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15794) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123513,8 +118642,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19796, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19901, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -123538,7 +118667,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -123620,7 +118749,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -123638,7 +118767,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19814, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19919, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -123786,7 +118915,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -123814,7 +118943,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19837, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -123836,12 +118965,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19857, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19962, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -123858,7 +118987,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19900 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20005 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -123889,7 +119018,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19923, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20028, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -123898,9 +119027,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19961 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20066 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19995 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20100 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -123949,7 +119078,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -123959,7 +119088,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20033, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20138, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124055,7 +119184,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124064,7 +119193,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124115,7 +119244,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20037, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124130,7 +119259,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20076, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20181, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124145,7 +119274,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15264, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124269,7 +119398,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6716 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124286,7 +119415,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20107, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124365,7 +119494,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20112, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20217, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124378,7 +119507,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12568, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124398,9 +119527,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20121, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20226, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20139, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) } } } @@ -124414,7 +119543,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20159, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20264, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -124611,14 +119740,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -124627,7 +119756,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -124659,11 +119788,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -124716,7 +119845,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -124753,12 +119882,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20190, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20295, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20241, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20346, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -124779,7 +119908,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20274, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20379, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -124918,7 +120047,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -125026,7 +120155,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125070,7 +120199,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125093,16 +120222,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20307 + v1 = __ccgo_ts + 20412 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20330, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20435, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125134,7 +120263,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125263,6 +120392,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125291,7 +120421,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+15999) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16104) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125324,9 +120454,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125336,13 +120466,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125362,7 +120492,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -125535,8 +120665,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -125545,11 +120675,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -125565,7 +120695,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -125589,14 +120719,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20342, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20447, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -125697,7 +120827,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20396, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20501, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -125855,7 +120985,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 72)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1663, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1667, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -125898,14 +121028,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20436, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20541, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -125937,7 +121067,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -125952,7 +121082,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20451, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20556, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -126006,7 +121136,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -126039,7 +121169,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126098,7 +121228,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126127,6 +121257,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126149,10 +121286,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126186,8 +121323,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126202,8 +121339,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126232,8 +121369,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126250,7 +121387,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126263,11 +121400,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126301,49 +121438,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126351,16 +121489,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126378,11 +121516,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20467 + v47 = __ccgo_ts + 20572 } else { - v46 = __ccgo_ts + 20476 + v47 = __ccgo_ts + 20581 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19319, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126392,12 +121530,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126410,13 +121548,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126427,12 +121565,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126481,12 +121619,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -126556,9 +121698,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -126575,10 +121717,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -126605,8 +121747,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -126646,32 +121788,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -126713,7 +121855,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20467) + _explainTempTable(tls, pParse, __ccgo_ts+20572) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -126819,7 +121961,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -126835,7 +121977,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20485, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20590, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -126925,7 +122067,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127087,7 +122229,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20550, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) goto trigger_cleanup } iDb = int32(1) @@ -127127,7 +122269,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20596, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20701, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127137,11 +122279,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20604, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20709, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20645, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20750, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127150,13 +122292,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20596, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20701, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20685, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20790, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127164,8 +122306,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6651, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20711, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20816, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127173,15 +122315,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20749 + v1 = __ccgo_ts + 20854 } else { - v1 = __ccgo_ts + 20756 + v1 = __ccgo_ts + 20861 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20762, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20867, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20799, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20904, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127201,9 +122343,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6659 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6147 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127303,7 +122445,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20596, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20701, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127325,7 +122467,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20845, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20950, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127341,10 +122483,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20893, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20998, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20968, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21073, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -127612,11 +122754,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20997, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -127654,9 +122796,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6659 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6147 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -127671,7 +122813,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21017, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -127804,11 +122946,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21079 + v1 = __ccgo_ts + 21184 } else { - v1 = __ccgo_ts + 21086 + v1 = __ccgo_ts + 21191 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21093, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21198, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -127910,7 +123052,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21246, 0) return int32(1) } @@ -128058,12 +123200,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128071,19 +123213,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128094,7 +123239,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128108,7 +123253,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128176,7 +123321,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6344, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128275,10 +123420,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21183, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21288, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128300,7 +123447,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -128372,7 +123519,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -128788,13 +123935,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -128802,21 +123949,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -128863,7 +124010,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -128902,7 +124049,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -128946,58 +124093,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21197, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21302, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8092 + v10 = __ccgo_ts + 8121 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -129027,17 +124162,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -129049,11 +124184,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129069,11 +124204,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129082,18 +124217,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129102,16 +124237,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129129,24 +124264,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129172,50 +124307,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -129513,8 +124648,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -129564,8 +124699,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -129612,11 +124747,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -129628,11 +124763,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -129675,7 +124810,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21252) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21357) } goto update_cleanup update_cleanup: @@ -129732,13 +124867,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -129780,11 +124915,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130109,9 +125244,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]uint8)(unsafe.Pointer(bp + 200)))[0] = uint8(0) } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21265, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21370, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21269, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21374, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130200,13 +125335,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130214,7 +125349,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12657, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12715, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130296,7 +125431,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21342, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21346, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21447, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21451, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130387,7 +125522,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130426,24 +125561,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21350) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21455) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21390) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21495) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21433) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21538) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 76)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 76)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1663 + zOut = __ccgo_ts + 1667 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -130453,7 +125588,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21482) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21587) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130506,7 +125641,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15034) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15092) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130537,11 +125672,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21509, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21614, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21617, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21722, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130550,7 +125685,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21671, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21776, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -130560,7 +125695,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21808, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21913, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -130651,39 +125786,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -130694,7 +125796,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -130703,7 +125805,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -130713,7 +125815,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -130738,15 +125840,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -130761,13 +125863,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131087,7 +126191,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12887, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131210,24 +126314,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21931, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22036, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21955, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22060, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22054, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131284,7 +126393,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131311,7 +126420,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22073, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22178, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131345,7 +126454,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131353,9 +126462,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22115, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22220, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3860, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -131368,7 +126477,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22145 + zFormat = __ccgo_ts + 22250 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131394,7 +126503,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1663) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1667) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -131402,7 +126511,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16737, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16842, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131483,13 +126592,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22191, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22296, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -131570,7 +126679,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22191, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22296, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -131618,7 +126727,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22210, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22315, 0) return int32(SQLITE_ERROR) } goto _1 @@ -131629,9 +126738,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -131673,7 +126782,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3860 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } @@ -132039,7 +127148,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132129,7 +127238,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132149,7 +127258,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3860, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132213,7 +127322,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132226,7 +127335,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132386,271 +127495,9 @@ type TWhereLoop = struct { FaLTermSpace [3]uintptr } -type WhereLoop = TWhereLoop - -type TWherePath = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath = TWherePath - -type TWhereTerm = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm = TWhereTerm - -type TWhereLoopBuilder = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder = TWhereLoopBuilder - -type TWhereScan = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff uint8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan = TWhereScan - -type TWhereOrCost = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost = TWhereOrCost - -type TWhereOrSet = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet = TWhereOrSet - -type TWhereMemBlock = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock = TWhereMemBlock - -type TWhereRightJoin = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin = TWhereRightJoin - -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 +type WhereLoop = TWhereLoop -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { +type TWherePath = struct { FmaskLoop TBitmask FrevLoop TBitmask FnRow TLogEst @@ -132660,60 +127507,9 @@ type TWherePath1 = struct { FaLoop uintptr } -type WherePath1 = TWherePath1 +type WherePath = TWherePath -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { +type TWhereTerm = struct { FpExpr uintptr FpWC uintptr FtruthProb TLogEst @@ -132735,17 +127531,23 @@ type TWhereTerm1 = struct { FprereqAll TBitmask } -type WhereTerm1 = TWhereTerm1 +type WhereTerm = TWhereTerm -/* -** Allowed values of WhereTerm.wtFlags - */ +type TWhereLoopBuilder = struct { + FpWInfo uintptr + FpWC uintptr + FpNew uintptr + FpOrSet uintptr + FpRec uintptr + FnRecValid int32 + FbldFlags1 uint8 + FbldFlags2 uint8 + FiPlanLimit uint32 +} -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { +type WhereLoopBuilder = TWhereLoopBuilder + +type TWhereScan = struct { FpOrigWC uintptr FpWC uintptr FzCollName uintptr @@ -132759,162 +127561,39 @@ type TWhereScan1 = struct { FaiColumn [11]Ti16 } -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 +type WhereScan = TWhereScan -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause +type TWhereOrCost = struct { + Fprereq TBitmask + FrRun TLogEst + FnOut TLogEst } -type WhereAndInfo1 = TWhereAndInfo1 +type WhereOrCost = TWhereOrCost -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 +type TWhereOrSet = struct { + Fn Tu16 + Fa [3]TWhereOrCost } -type WhereMaskSet1 = TWhereMaskSet1 +type WhereOrSet = TWhereOrSet -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 +type TWhereMemBlock = struct { + FpNext uintptr + Fsz Tu64 } -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ +type WhereMemBlock = TWhereMemBlock -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel +type TWhereRightJoin = struct { + FiMatch int32 + FregBloom int32 + FregReturn int32 + FaddrSubrtn int32 + FendSubrtn int32 } -type WhereInfo1 = TWhereInfo1 +type WhereRightJoin = TWhereRightJoin /* ** Bitmasks for the operators on WhereTerm objects. These are all @@ -132947,10 +127626,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22223 + return __ccgo_ts + 22328 } if i == -int32(1) { - return __ccgo_ts + 16846 + return __ccgo_ts + 16951 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -132969,10 +127648,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -132980,7 +127659,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -132989,11 +127668,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22236, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -133001,16 +127680,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5173, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } } @@ -133057,7 +127736,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22238, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22343, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133065,12 +127744,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22241 + v2 = __ccgo_ts + 22346 } else { - v2 = __ccgo_ts + 22246 + v2 = __ccgo_ts + 22351 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133087,7 +127766,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22254) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22359) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133098,9 +127777,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22256) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22361) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133145,11 +127824,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22258 + v2 = __ccgo_ts + 22363 } else { - v2 = __ccgo_ts + 22265 + v2 = __ccgo_ts + 22370 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22270, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22375, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133162,37 +127841,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11440 + zFmt = __ccgo_ts + 11498 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22276 + zFmt = __ccgo_ts + 22381 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22309 + zFmt = __ccgo_ts + 22414 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22334 + zFmt = __ccgo_ts + 22439 } else { - zFmt = __ccgo_ts + 22352 + zFmt = __ccgo_ts + 22457 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22361, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22466, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16846 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22369, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16951 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22474, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = uint8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22400, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22505, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133202,14 +127881,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22410, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22415) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22520) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22437 + v3 = __ccgo_ts + 22542 } else { - v3 = __ccgo_ts + 22445 + v3 = __ccgo_ts + 22550 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133230,7 +127909,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22451, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22556, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133260,10 +127939,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133296,14 +127975,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22462, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22567, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22483, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22588, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133327,16 +128006,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22230, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22335, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22241, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5171, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -133541,7 +128220,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -133597,8 +128276,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -133620,7 +128299,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -133677,10 +128356,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -133735,37 +128414,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -133790,10 +128455,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -133812,24 +128477,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -133841,8 +128506,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -133900,7 +128565,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -133982,7 +128647,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134113,7 +128778,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -134250,7 +128915,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134395,7 +129060,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134456,11 +129121,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134491,6 +129156,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -134629,7 +129297,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -134709,7 +129377,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -134743,7 +129411,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -134865,7 +129533,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135058,7 +129726,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135072,12 +129740,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135115,11 +129784,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135139,7 +129808,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135175,21 +129844,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135207,7 +129876,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135262,7 +129931,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22491, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22596, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135285,7 +129954,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22506, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22611, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -135774,9 +130443,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -135785,14 +130454,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22515, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22620, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -135831,15 +130500,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -135851,7 +130521,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -135924,7 +130594,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -136322,19 +130992,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16695, + FzOp: __ccgo_ts + 16800, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16029, + FzOp: __ccgo_ts + 16134, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15508, + FzOp: __ccgo_ts + 15593, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22529, + FzOp: __ccgo_ts + 22634, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -136854,37 +131524,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 uint8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if libc.Int32FromUint8(aff1) != libc.Int32FromUint8(aff2) && (!(libc.Int32FromUint8(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(libc.Int32FromUint8(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137122,7 +131796,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } } else { @@ -137134,10 +131808,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22536, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137196,7 +131870,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137218,7 +131892,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8078 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8107 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137319,7 +131993,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22577 + v13 = __ccgo_ts + 22682 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -137850,7 +132524,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22584, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -137922,22 +132596,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -138050,7 +132712,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -138966,7 +133628,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141217,13 +135880,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141323,6 +135981,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141336,12 +135995,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -141787,7 +136463,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -141838,15 +136514,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -141878,7 +136545,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -141897,7 +136564,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -141934,7 +136601,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -141942,7 +136609,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -141963,19 +136630,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142071,7 +136738,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142249,7 +136916,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142277,6 +136944,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142353,7 +137028,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -142590,7 +137265,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142665,7 +137340,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22657, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142819,7 +137494,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143255,7 +137930,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22683, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22788, 0) rc = SQLITE_OK } else { break @@ -143484,17 +138159,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144463,7 +139127,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22718, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22823, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -145041,7 +139705,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145197,7 +139861,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22736, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22841, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145218,11 +139882,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -145270,7 +139931,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22764, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22869, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145415,7 +140076,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -145449,7 +140111,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145471,7 +140133,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145484,7 +140146,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -145575,11 +140237,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -145606,16 +140268,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -145663,7 +140325,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -145794,7 +140456,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -145972,7 +140634,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -146001,7 +140663,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -146011,7 +140673,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22782, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22887, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146061,7 +140723,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146330,7 +140992,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22811, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22916, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146512,7 +141174,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22867, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22972, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -146838,7 +141500,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22912, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23017, libc.VaList(bp+8, zName)) } return p } @@ -146889,12 +141551,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22931, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23036, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23002, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23107, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -146967,7 +141629,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8317) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) } break } @@ -146998,16 +141660,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -147026,17 +141678,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -147054,7 +141706,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147078,13 +141730,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147099,23 +141751,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147131,13 +141783,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147249,7 +141901,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23065, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23170, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147285,7 +141937,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147300,7 +141952,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147319,11 +141971,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147369,11 +142021,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147390,7 +142042,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1783)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147412,7 +142064,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -147536,7 +142188,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23091, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23196, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -147604,18 +142256,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23123 + zErr = __ccgo_ts + 23228 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23140 + zErr = __ccgo_ts + 23245 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23156 + zErr = __ccgo_ts + 23261 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23176, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -147639,7 +142291,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23209, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23314, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -147745,24 +142397,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -147780,12 +142432,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -147797,15 +142449,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -147838,7 +142490,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -147857,11 +142509,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23256, - 1: __ccgo_ts + 23309, - 2: __ccgo_ts + 22811, - 3: __ccgo_ts + 23360, - 4: __ccgo_ts + 23412, + 0: __ccgo_ts + 23361, + 1: __ccgo_ts + 23414, + 2: __ccgo_ts + 22916, + 3: __ccgo_ts + 23465, + 4: __ccgo_ts + 23517, } var _aOp1 = [5]int32{ @@ -147914,87 +142566,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148441,7 +143012,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -148537,7 +143108,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -148613,7 +143184,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1663, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -149254,12 +143825,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149267,13 +143838,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149293,13 +143864,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149326,7 +143897,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -149545,6 +144116,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -149605,7 +144180,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23462, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23567, libc.VaList(bp+8, p)) } // C documentation @@ -149619,6 +144194,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -149652,11 +144228,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23486 + v1 = __ccgo_ts + 23591 } else { - v1 = __ccgo_ts + 23495 + v1 = __ccgo_ts + 23600 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23501, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23606, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -149665,7 +144241,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23543, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23648, 0) } } } @@ -149771,7 +144347,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23577, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23682, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156238,14 +150814,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156256,16 +150824,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -156292,13 +150850,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -157413,19 +151971,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158228,20 +152786,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16846, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16951, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16759, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16887, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23615, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158282,7 +152840,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158427,7 +152990,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -158517,9 +153085,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -158874,7 +153442,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23642) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23747) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159214,23 +153782,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8102 + } else { + v347 = __ccgo_ts + 8107 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8073 - } else { - v347 = __ccgo_ts + 8078 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -159288,11 +153870,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -159302,9 +153884,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -159312,11 +153894,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -159414,11 +153996,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159468,15 +154050,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23651, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23756, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23746, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23830, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23935, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -159618,7 +154200,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -159812,7 +154394,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23915, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24020, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -161938,7 +156520,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -162543,14 +157125,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163412,22 +157999,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163438,11 +158034,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -164021,7 +158617,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -164041,7 +158637,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24002, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24107, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164166,11 +158762,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164342,14 +158938,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24545 + zErr = __ccgo_ts + 24650 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164361,31 +158957,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24070, - 1: __ccgo_ts + 24083, - 3: __ccgo_ts + 24099, - 4: __ccgo_ts + 24124, - 5: __ccgo_ts + 24138, - 6: __ccgo_ts + 24157, - 7: __ccgo_ts + 1633, - 8: __ccgo_ts + 24182, - 9: __ccgo_ts + 24219, - 10: __ccgo_ts + 24231, - 11: __ccgo_ts + 24246, - 12: __ccgo_ts + 24279, - 13: __ccgo_ts + 24297, - 14: __ccgo_ts + 24322, - 15: __ccgo_ts + 24351, - 17: __ccgo_ts + 6102, - 18: __ccgo_ts + 5504, - 19: __ccgo_ts + 24368, - 20: __ccgo_ts + 24386, - 21: __ccgo_ts + 24404, - 23: __ccgo_ts + 24438, - 25: __ccgo_ts + 24459, - 26: __ccgo_ts + 24485, - 27: __ccgo_ts + 24508, - 28: __ccgo_ts + 24529, + 0: __ccgo_ts + 24175, + 1: __ccgo_ts + 24188, + 3: __ccgo_ts + 24204, + 4: __ccgo_ts + 24229, + 5: __ccgo_ts + 24243, + 6: __ccgo_ts + 24262, + 7: __ccgo_ts + 1637, + 8: __ccgo_ts + 24287, + 9: __ccgo_ts + 24324, + 10: __ccgo_ts + 24336, + 11: __ccgo_ts + 24351, + 12: __ccgo_ts + 24384, + 13: __ccgo_ts + 24402, + 14: __ccgo_ts + 24427, + 15: __ccgo_ts + 24456, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24473, + 20: __ccgo_ts + 24491, + 21: __ccgo_ts + 24509, + 23: __ccgo_ts + 24543, + 25: __ccgo_ts + 24564, + 26: __ccgo_ts + 24590, + 27: __ccgo_ts + 24613, + 28: __ccgo_ts + 24634, } // C documentation @@ -164479,15 +159075,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164495,6 +159093,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164502,10 +159102,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -164532,6 +159132,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -164559,12 +159173,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -164582,9 +159196,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -164607,13 +159221,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24626, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24731, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -164631,15 +159245,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -164654,27 +159268,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -164685,30 +159299,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -164733,7 +159377,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24689, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24794, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -164764,13 +159408,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -164781,43 +159427,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -164828,12 +159478,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -164845,6 +159495,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164852,82 +159504,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -164971,18 +159633,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -165008,7 +159672,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -165018,7 +159682,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24740, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24845, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165140,7 +159804,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165272,7 +159936,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165282,7 +159946,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165318,7 +159982,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165331,7 +159995,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165340,7 +160004,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24761, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24866, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165375,9 +160039,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165487,7 +160151,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24829, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24934, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -165517,8 +160181,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24835, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24845, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24940, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24950, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -165607,24 +160271,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24873, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24978, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24877, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24982, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24877 + zModeType = __ccgo_ts + 24982 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24898, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25003, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3469 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -165653,12 +160317,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24913, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25018, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24933, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25038, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -165682,7 +160346,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24957, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25062, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -165702,11 +160366,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24883, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24890, + Fz: __ccgo_ts + 24995, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -165717,19 +160381,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24903, + Fz: __ccgo_ts + 25008, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24906, + Fz: __ccgo_ts + 25011, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24909, + Fz: __ccgo_ts + 25014, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17916, + Fz: __ccgo_ts + 18021, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -165857,8 +160521,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22577, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24973, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22682, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25078, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -165879,10 +160543,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4255 + zFilename = __ccgo_ts + 4285 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -165891,7 +160555,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -165918,9 +160582,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6711 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6740 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23975 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24080 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166014,7 +160678,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24979 + zFilename = __ccgo_ts + 25084 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -166033,36 +160697,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166070,7 +160742,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166078,31 +160750,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166136,12 +160812,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166174,10 +160852,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166188,7 +160866,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166231,20 +160909,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24982, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25087, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25007) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25112) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25027) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25132) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25034) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25139) } // C documentation @@ -166269,9 +160947,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166298,29 +160976,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166344,7 +161011,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1137 + zDataType = __ccgo_ts + 1141 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -166375,15 +161042,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25051, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25156, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3860 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -166562,8 +161229,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -167007,7 +161674,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -167403,7 +162070,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25079, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25184, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -167551,6 +162218,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -167574,7 +162243,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -167584,7 +162253,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -167596,7 +162265,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -167612,7 +162281,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -167621,7 +162290,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25087 + v2 = __ccgo_ts + 25192 } else { v2 = uintptr(0) } @@ -167700,7 +162369,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -167867,7 +162536,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168084,6 +162753,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168396,8 +163072,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168454,7 +163130,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168464,7 +163140,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168501,23 +163177,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1649, - 1: __ccgo_ts + 8073, - 2: __ccgo_ts + 8078, - 3: __ccgo_ts + 6387, - 4: __ccgo_ts + 6387, - 5: __ccgo_ts + 6382, - 6: __ccgo_ts + 6382, - 7: __ccgo_ts + 8384, - 8: __ccgo_ts + 8384, - 9: __ccgo_ts + 8384, - 10: __ccgo_ts + 8384, - 11: __ccgo_ts + 25110, - 12: __ccgo_ts + 25116, - 13: __ccgo_ts + 1663, - 14: __ccgo_ts + 1663, - 15: __ccgo_ts + 1663, - 16: __ccgo_ts + 1663, + 0: __ccgo_ts + 1653, + 1: __ccgo_ts + 8102, + 2: __ccgo_ts + 8107, + 3: __ccgo_ts + 6416, + 4: __ccgo_ts + 6416, + 5: __ccgo_ts + 6411, + 6: __ccgo_ts + 6411, + 7: __ccgo_ts + 8413, + 8: __ccgo_ts + 8413, + 9: __ccgo_ts + 8413, + 10: __ccgo_ts + 8413, + 11: __ccgo_ts + 25215, + 12: __ccgo_ts + 25221, + 13: __ccgo_ts + 1667, + 14: __ccgo_ts + 1667, + 15: __ccgo_ts + 1667, + 16: __ccgo_ts + 1667, } // C documentation @@ -168821,106 +163497,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]uint8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -169000,7 +163576,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169298,8 +163874,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = uint8('u') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = uint8('0') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = uint8('0') - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25123 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -169433,9 +164009,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1653, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15478, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15536, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169449,14 +164025,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25140, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25228, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169510,7 +164084,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25257, -int32(1)) } } } @@ -169793,8 +164367,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25184, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25272, + FzRepl: __ccgo_ts + 25276, }, 1: { Fc1: uint8('i'), @@ -169802,32 +164376,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25196, - FzRepl: __ccgo_ts + 25188, + FzMatch: __ccgo_ts + 25284, + FzRepl: __ccgo_ts + 25276, }, 2: { Fc1: uint8('n'), Fc2: uint8('N'), Fn: uint8(3), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 1654, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 1658, + FzRepl: __ccgo_ts + 1653, }, 3: { Fc1: uint8('q'), Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25205, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25293, + FzRepl: __ccgo_ts + 1653, }, 4: { Fc1: uint8('s'), Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25210, - FzRepl: __ccgo_ts + 1649, + FzMatch: __ccgo_ts + 25298, + FzRepl: __ccgo_ts + 1653, }, } @@ -169842,7 +164416,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25215, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25303, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -169860,23 +164434,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -169954,7 +164528,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -170025,7 +164599,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170300,7 +164878,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25258, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25346, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -170730,7 +165308,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('0') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || libc.Int32FromUint8(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -170769,7 +165347,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8073, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8102, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -170777,7 +165355,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8078, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8107, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -170854,14 +165432,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25184, int32(3)) == 0 { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25272, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25280, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25368, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -171022,7 +165600,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1649, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1653, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return libc.Int32FromUint32(i + uint32(4)) } @@ -171046,7 +165624,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171091,7 +165669,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*uint8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171104,7 +165682,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171153,10 +165731,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171190,15 +165764,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171267,15 +165841,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1653, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8073, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8102, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8078, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8107, uint32(5)) return i + uint32(1) _6: ; @@ -171324,9 +165898,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25188 + v19 = __ccgo_ts + 25276 } else { - v19 = __ccgo_ts + 11940 + v19 = __ccgo_ts + 11998 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171362,9 +165936,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, uint8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, uint8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = uint8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = uint8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171391,7 +165968,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25286, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25374, uint32(2)) zIn2++ sz2-- continue @@ -171414,7 +165991,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25289, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25377, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171422,12 +165999,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25296, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25384, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25301, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25389, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -171530,16 +166107,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -171607,7 +166174,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171630,12 +166197,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25311, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25399, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25308, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171650,50 +166217,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -171745,6 +166268,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -171765,6 +166366,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -171837,9 +166441,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -171882,7 +166486,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172370,7 +166985,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172505,7 +167120,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -172606,7 +167221,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } @@ -172643,11 +167258,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25140, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25228, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -172660,7 +167272,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -172679,10 +167291,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25274) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25267) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -172721,7 +167333,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25314, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25402, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -172737,7 +167349,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -172818,7 +167430,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -172830,34 +167442,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -172940,7 +167572,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -173000,7 +167632,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173135,7 +167767,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25332 + v1 = __ccgo_ts + 25420 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173145,7 +167777,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } eErr = uint8(1) @@ -173255,23 +167887,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25334, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25336, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5226, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5256, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1676, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1706, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25338, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25426, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25341, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25429, uint32(1)) } } } @@ -173307,11 +167939,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1649, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1653, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -173579,7 +168211,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -173603,7 +168235,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25343, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25431, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -173614,7 +168246,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25394, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25482, -int32(1)) _jsonStringReset(tls, bp) return } @@ -173686,7 +168318,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_remove_done @@ -173723,7 +168355,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15951) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16056) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -173754,9 +168386,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25428 + v1 = __ccgo_ts + 25516 } else { - v1 = __ccgo_ts + 25432 + v1 = __ccgo_ts + 25520 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -173804,7 +168436,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25169, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_type_done @@ -173851,7 +168483,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25439 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25527 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -173925,17 +168557,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25444, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25532, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -173944,18 +168575,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -174017,9 +168647,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174126,7 +168754,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25501, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25589, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174218,20 +168846,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, uint8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, uint8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, uint8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, uint8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -174275,7 +168905,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25504, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25592, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174303,16 +168933,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -174331,24 +168951,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174356,13 +168958,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174378,7 +168973,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25507) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25595) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174512,7 +169107,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25590, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25678, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -174538,9 +169133,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25597, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25685, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25605, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25693, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -174851,9 +169446,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174926,7 +169520,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25611, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25699, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -174950,7 +169544,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25169, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25257, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -175011,186 +169605,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25613, + FzName: __ccgo_ts + 25701, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25618, + FzName: __ccgo_ts + 25706, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25624, + FzName: __ccgo_ts + 25712, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25635, + FzName: __ccgo_ts + 25723, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25647, + FzName: __ccgo_ts + 25735, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25665, + FzName: __ccgo_ts + 25753, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25685, + FzName: __ccgo_ts + 25773, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25698, + FzName: __ccgo_ts + 25786, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25712, + FzName: __ccgo_ts + 25800, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25715, + FzName: __ccgo_ts + 25803, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25719, + FzName: __ccgo_ts + 25807, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25731, + FzName: __ccgo_ts + 25819, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25744, + FzName: __ccgo_ts + 25832, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25756, + FzName: __ccgo_ts + 25844, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25769, + FzName: __ccgo_ts + 25857, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25780, + FzName: __ccgo_ts + 25868, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25792, + FzName: __ccgo_ts + 25880, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25804, + FzName: __ccgo_ts + 25892, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25815, + FzName: __ccgo_ts + 25903, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25827, + FzName: __ccgo_ts + 25915, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25840, + FzName: __ccgo_ts + 25928, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25853, + FzName: __ccgo_ts + 25941, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25867, + FzName: __ccgo_ts + 25955, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25876, + FzName: __ccgo_ts + 25964, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25886, + FzName: __ccgo_ts + 25974, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25896, + FzName: __ccgo_ts + 25984, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25907, + FzName: __ccgo_ts + 25995, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25924, + FzName: __ccgo_ts + 26012, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25942, + FzName: __ccgo_ts + 26030, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25960, + FzName: __ccgo_ts + 26048, }, } @@ -175273,17 +169867,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25979, + FzName: __ccgo_ts + 26067, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25989, + FzName: __ccgo_ts + 26077, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175333,224 +169929,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -175568,33 +169949,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -175605,79 +169980,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 +} + +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -175754,7 +170114,7 @@ func _writeInt64(tls *libc.TLS, p uintptr, _i Ti64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*Ti64)(unsafe.Pointer(bp)) = _i - *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp))))) + *(*Ti64)(unsafe.Pointer(bp)) = libc.Int64FromUint64(libc.X__builtin_bswap64(tls, uint64(libc.Uint64FromInt64(*(*Ti64)(unsafe.Pointer(bp)))))) libc.Xmemcpy(tls, p, bp, uint64(8)) return int32(8) } @@ -175860,7 +170220,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -175923,7 +170283,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+25999, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26087, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -175934,7 +170294,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176228,7 +170588,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26004, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26092, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176765,7 +171125,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177145,7 +171505,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26086) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26174) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177223,7 +171583,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -177454,7 +171814,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -177462,7 +171822,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -177700,7 +172060,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178122,7 +172482,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -178631,11 +172991,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178648,11 +173008,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178680,7 +173040,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26100, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -178690,11 +173050,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26120, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26208, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26152, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26240, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -178908,7 +173268,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26189, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -178962,9 +173322,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26334 + zFmt = __ccgo_ts + 26422 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11769, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11827, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -179022,9 +173382,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26390, - 1: __ccgo_ts + 5565, - 2: __ccgo_ts + 16846, + 0: __ccgo_ts + 26478, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16951, } var _rtreeModule = Tsqlite3_module{ @@ -179068,21 +173428,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26804, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26892, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26866, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26954, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26871, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26935, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27005, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26959, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27023, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27093, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179112,7 +173472,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27054 + zFormat = __ccgo_ts + 27142 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179127,31 +173487,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27162, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27250, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27207, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27295, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13277, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13335, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27234, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27322, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27256, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27344, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27264, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27352, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179165,14 +173525,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26395, - 1: __ccgo_ts + 26448, - 2: __ccgo_ts + 26493, - 3: __ccgo_ts + 26545, - 4: __ccgo_ts + 26599, - 5: __ccgo_ts + 26644, - 6: __ccgo_ts + 26702, - 7: __ccgo_ts + 26757, + 0: __ccgo_ts + 26483, + 1: __ccgo_ts + 26536, + 2: __ccgo_ts + 26581, + 3: __ccgo_ts + 26633, + 4: __ccgo_ts + 26687, + 5: __ccgo_ts + 26732, + 6: __ccgo_ts + 26790, + 7: __ccgo_ts + 26845, } // C documentation @@ -179230,7 +173590,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27280, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179238,17 +173598,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27300, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27388, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179311,7 +173671,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -179325,13 +173685,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27549, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27637, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -179340,7 +173700,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27573, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27661, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179354,19 +173714,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179389,7 +173749,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179400,7 +173760,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179416,8 +173776,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27579, - 1: __ccgo_ts + 27590, + 0: __ccgo_ts + 27667, + 1: __ccgo_ts + 27678, } // C documentation @@ -179475,21 +173835,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11389, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11447, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27603, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27691, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27609, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27697, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27613, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27701, int32(1)) goto _1 _1: ; @@ -179516,7 +173876,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27615, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27703, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -179550,23 +173910,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -179619,7 +173962,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -179634,11 +173977,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4268 + v1 = __ccgo_ts + 4298 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27648, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27736, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -179672,7 +174015,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27655, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27743, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -179689,7 +174032,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27700, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27788, libc.VaList(bp+8, iNode)) } } return pRet @@ -179718,8 +174061,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27732, - 1: __ccgo_ts + 27786, + 0: __ccgo_ts + 27820, + 1: __ccgo_ts + 27874, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -179732,21 +174075,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27834 + v1 = __ccgo_ts + 27922 } else { - v1 = __ccgo_ts + 27842 + v1 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27851, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27939, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27834 + v2 = __ccgo_ts + 27922 } else { - v2 = __ccgo_ts + 27842 + v2 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27896, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27984, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -179791,7 +174134,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27954, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28042, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -179809,7 +174152,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28002, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28090, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -179842,19 +174185,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28069, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28157, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28103, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28191, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28133, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -179899,12 +174242,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28188, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28276, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28219, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28307, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -179933,7 +174276,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28286, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28374, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -179943,11 +174286,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26100, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26188, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28314, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28402, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -179963,8 +174306,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28345, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28352, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28433, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28440, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -179991,7 +174334,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28360, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28448, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -180042,13 +174385,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28379, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28467, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6711 + zDb = __ccgo_ts + 6740 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180057,7 +174400,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18613 + v1 = __ccgo_ts + 18718 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180151,14 +174494,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180183,16 +174518,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180324,7 +174649,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -180369,7 +174694,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && libc.Int32FromUint8(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -180431,7 +174756,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -180799,7 +175124,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -180814,9 +175139,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -180901,7 +175226,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -180975,13 +175300,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -181042,7 +175360,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181081,7 +175399,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181185,7 +175503,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181216,36 +175534,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181269,7 +175557,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -181553,7 +175841,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -181710,7 +175998,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -181722,13 +176010,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27543, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28503, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28591, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -181737,13 +176025,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28525, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28613, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27600, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -181751,7 +176039,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -181766,7 +176054,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -181978,7 +176266,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16846 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16951 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -181988,7 +176276,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28529 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28617 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -181996,7 +176284,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28535 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28623 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182116,7 +176404,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28544, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28632, 0) } goto geopoly_update_end } @@ -182216,16 +176504,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28584) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28672) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28600) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28688) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182295,7 +176583,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28777, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28865, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182309,61 +176597,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28615, + FzName: __ccgo_ts + 28703, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28628, + FzName: __ccgo_ts + 28716, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28641, + FzName: __ccgo_ts + 28729, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28654, + FzName: __ccgo_ts + 28742, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28600, + FzName: __ccgo_ts + 28688, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28666, + FzName: __ccgo_ts + 28754, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28584, + FzName: __ccgo_ts + 28672, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28689, + FzName: __ccgo_ts + 28777, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28703, + FzName: __ccgo_ts + 28791, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28716, + FzName: __ccgo_ts + 28804, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28730, + FzName: __ccgo_ts + 28818, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28746, + FzName: __ccgo_ts + 28834, }, } @@ -182389,7 +176677,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28758, + FzName: __ccgo_ts + 28846, }, } @@ -182414,20 +176702,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28785, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28873, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28795, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28883, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28806, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28894, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28529, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28617, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28817, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28905, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182501,7 +176789,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -182529,17 +176817,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26086, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26174, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -182547,33 +176837,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -182770,7 +177064,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183191,248 +177485,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]uint8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -183746,7 +177798,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -183756,7 +177808,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28827, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -183782,7 +177834,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -183805,7 +177857,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -183937,7 +177989,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28848, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28936, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -184026,7 +178078,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+25999, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26087, zIn, uint64(4)) == 0 { i = int32(4) for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184063,13 +178115,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29019 + v1 = __ccgo_ts + 29107 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29060, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29148, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29210) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29298) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184236,7 +178288,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184297,7 +178349,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29335, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29423, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184307,7 +178359,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29454, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29542, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184315,7 +178367,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29475, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29563, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184327,7 +178379,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29526, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29614, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184371,7 +178423,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184384,7 +178436,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -184437,7 +178489,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20121, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20226, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184448,7 +178500,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29604, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184459,7 +178511,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29623, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29711, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -184467,7 +178519,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29628, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29716, zName) { bRbuRowid = int32(1) } } @@ -184481,17 +178533,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29638 + v4 = __ccgo_ts + 29726 } else { - v4 = __ccgo_ts + 29651 + v4 = __ccgo_ts + 29739 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29660, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29748, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29689, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29777, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184513,7 +178565,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29711, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29799, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -184552,15 +178604,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29738, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29826, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -184585,7 +178637,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 for int32(1) != 0 { i = 0 for { @@ -184594,7 +178646,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29747, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29835, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -184642,21 +178694,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29760, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29848, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29792, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+29815) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29821, __ccgo_ts+29828, __ccgo_ts+5171) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+29903) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29909, __ccgo_ts+29916, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29836, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29924, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29878, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29966, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -184705,10 +178757,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -184730,15 +178782,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29906, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29927, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29963, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15145 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30015, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15203 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -184747,9 +178799,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29990, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30078, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -184764,15 +178816,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30038, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15145 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30126, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15203 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30045, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -184826,11 +178878,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1663 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1663 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1667 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1667 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184839,8 +178891,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30057, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) - zType = __ccgo_ts + 1663 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30145, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zType = __ccgo_ts + 1667 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -184859,34 +178911,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29898 + zCol = __ccgo_ts + 29986 } else { - zCol = __ccgo_ts + 29628 + zCol = __ccgo_ts + 29716 } } - zType = __ccgo_ts + 1137 + zType = __ccgo_ts + 1141 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30079, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29815 + v2 = __ccgo_ts + 29903 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30099, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30187, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30120, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30153, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30208, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30241, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15145 - zAnd = __ccgo_ts + 22230 + zCom = __ccgo_ts + 15203 + zAnd = __ccgo_ts + 22335 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -184932,7 +178984,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1663 + zS = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -184940,11 +178992,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30177, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30265, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30189, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30277, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15145 + zS = __ccgo_ts + 15203 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -184956,7 +179008,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30198, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30286, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -184982,27 +179034,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30213, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30227, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30315, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22335 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30239, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30327, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1663 + zSep1 = __ccgo_ts + 1667 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185010,8 +179062,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22230 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22335 } goto _2 _2: @@ -185034,7 +179086,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30302, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30390, 0) } // C documentation @@ -185068,7 +179120,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if libc.Int32FromUint64(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185076,16 +179128,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if libc.Int32FromUint8(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30289, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30328, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30416, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30358, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15145 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30446, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } } } @@ -185169,16 +179221,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30395 + zSep = __ccgo_ts + 30483 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29547, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16734) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16839) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } break } @@ -185189,16 +179241,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30408, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15145 + z = _rbuMPrintf(tls, p, __ccgo_ts+30496, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15203 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30419, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185238,13 +179290,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30423) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30511) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185252,7 +179304,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29575, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -185261,21 +179313,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30473, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30561, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29815 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30495, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15145 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30583, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15203 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30505, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30520, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30608, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185310,30 +179362,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1663 + zComma = __ccgo_ts + 1667 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1663 + zPk = __ccgo_ts + 1667 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30582 + zPk = __ccgo_ts + 30670 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30595 + v2 = __ccgo_ts + 30683 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30605, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15145 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30693, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15203 goto _1 _1: ; @@ -185342,17 +179394,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30632, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30720, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30639 + v3 = __ccgo_ts + 30727 } else { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30654, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30742, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185378,7 +179430,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30686, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30774, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185424,7 +179476,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30743) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30831) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -185593,7 +179645,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30809, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30897, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -185610,18 +179662,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30829, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30917, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30894, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30982, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30930, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31018, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185636,26 +179688,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30964 + v2 = __ccgo_ts + 31052 } else { - v2 = __ccgo_ts + 30968 + v2 = __ccgo_ts + 31056 } v1 = v2 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30974, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31062, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31035, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31123, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30964 + v3 = __ccgo_ts + 31052 } else { - v3 = __ccgo_ts + 30968 + v3 = __ccgo_ts + 31056 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31096, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31184, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185674,62 +179726,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6722) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6718) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6751) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6747) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } else { - v4 = __ccgo_ts + 31255 + v4 = __ccgo_ts + 31343 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31264 + v5 = __ccgo_ts + 31352 } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31274, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31362, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31310, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31398, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1663 + zRbuRowid = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31338 + zRbuRowid = __ccgo_ts + 31426 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31350 + v6 = __ccgo_ts + 31438 } else { - v6 = __ccgo_ts + 1663 + v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31367, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31443, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31455, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31531, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31742, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31830, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1663 + zRbuRowid1 = __ccgo_ts + 1667 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31841 + v7 = __ccgo_ts + 31929 } else { - v7 = __ccgo_ts + 31851 + v7 = __ccgo_ts + 31939 } zRbuRowid1 = v7 } @@ -185742,28 +179794,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29898, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1663, __ccgo_ts+15145, __ccgo_ts+1663) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31862 + v8 = __ccgo_ts + 31950 } else { - v8 = __ccgo_ts + 1663 + v8 = __ccgo_ts + 1667 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1663 + v9 = __ccgo_ts + 1667 } if zOrder != 0 { - v10 = __ccgo_ts + 23486 + v10 = __ccgo_ts + 23591 } else { - v10 = __ccgo_ts + 1663 + v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31868, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31956, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -185849,11 +179901,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1663 + zPrefix = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31255 + zPrefix = __ccgo_ts + 31343 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31916, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32004, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -185880,7 +179932,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -185927,7 +179979,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31946, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32034, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -185986,27 +180038,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31976, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32064, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32004, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3483, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32092, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3513, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6711, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6740, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32022, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32110, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -186039,10 +180091,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32088, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32176, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24829, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24934, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186056,16 +180108,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 32120 + v2 = __ccgo_ts + 32208 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1663 + v3 = __ccgo_ts + 1667 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32122, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32210, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186076,27 +180128,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32154, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32242, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32169, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32257, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32186, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32274, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32202, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32290, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32230, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32318, 0) } } @@ -186146,7 +180198,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186248,7 +180300,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186278,7 +180330,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -186321,12 +180373,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186348,21 +180400,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186379,7 +180431,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32283, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32371, 0) } // C documentation @@ -186396,13 +180448,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6711) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32308, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32315, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32396, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -186534,7 +180586,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24386, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24491, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -186670,7 +180722,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32322) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32410) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -186683,7 +180735,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32344, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -186710,7 +180762,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32371, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32459, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -186746,9 +180798,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32531, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32619, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32546, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -186771,9 +180823,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32566, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32654, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32591) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -186784,10 +180836,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32699) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32787) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32764) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32852) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -186805,7 +180857,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32808, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32896, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -186832,8 +180884,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17819) - _rbuCopyPragma(tls, p, __ccgo_ts+16930) + _rbuCopyPragma(tls, p, __ccgo_ts+17924) + _rbuCopyPragma(tls, p, __ccgo_ts+17035) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -186841,7 +180893,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32833, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32921, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -186863,10 +180915,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -186880,10 +180932,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -186953,7 +181005,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32861, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32949, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -186976,10 +181028,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32308, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32396, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6711, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -187001,7 +181053,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]uint8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32886, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32974, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -187048,7 +181100,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32897, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32985, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187093,11 +181145,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32969, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33057, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32983) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33071) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187106,7 +181158,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33040) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33128) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187154,7 +181206,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3860, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187186,7 +181238,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33114, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33202, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187208,17 +181260,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33146 + v3 = __ccgo_ts + 33234 } else { - v3 = __ccgo_ts + 33153 + v3 = __ccgo_ts + 33241 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33160, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33248, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15034, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15092, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187230,21 +181282,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17533) - _rbuCopyPragma(tls, p, __ccgo_ts+16945) + _rbuCopyPragma(tls, p, __ccgo_ts+17638) + _rbuCopyPragma(tls, p, __ccgo_ts+17050) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33192, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33280, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6711, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33208, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33296, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187322,7 +181374,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33232, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33320, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187369,7 +181421,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31255, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31343, uint64(8)) == 0 { nDel = int32(8) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187397,16 +181449,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187416,7 +181468,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33240, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33328, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187517,32 +181569,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15049, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15034 + v1 = __ccgo_ts + 15092 } else { - v1 = __ccgo_ts + 33192 + v1 = __ccgo_ts + 33280 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33192, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33280, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -187568,9 +181620,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -187642,7 +181696,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -187845,7 +181899,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -187896,14 +181950,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189479,7 +183472,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33335, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33423, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -189502,13 +183495,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33343 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33431 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33352 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33440 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33357 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33445 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189517,7 +183510,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -189606,12 +183599,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33367, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33455, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33522, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33610, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33536, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33624, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -189688,7 +183681,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33551, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33639, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -189828,315 +183821,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -190889,7 +184573,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -190982,20 +184666,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33558, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33646, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1663, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33688, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33776, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -191021,10 +184705,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29898)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29986))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -191045,8 +184729,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29898) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29898, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29986) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29986, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191110,7 +184794,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191127,6 +184811,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191148,12 +184834,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -191443,10 +185129,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11389 + zSep = __ccgo_ts + 11447 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33718, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33806, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191455,11 +185141,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) } else { - v2 = __ccgo_ts + 1664 + v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5141, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15145 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5171, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -191540,13 +185226,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -191778,7 +185457,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1663, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1667, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -192038,14 +185717,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192105,7 +185776,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) i = 0 for { @@ -192113,8 +185784,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33725, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22230 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33813, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22335 if zRet == uintptr(0) { break } @@ -192133,7 +185804,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) bHave = 0 i = 0 @@ -192143,8 +185814,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33759, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33800 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33847, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33888 if zRet == uintptr(0) { break } @@ -192155,7 +185826,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1783, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1813, 0) } return zRet } @@ -192166,12 +185837,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33805 + v1 = __ccgo_ts + 33893 } else { - v1 = __ccgo_ts + 6716 + v1 = __ccgo_ts + 6745 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33816, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192232,11 +185903,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33895, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33983, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -192264,7 +185935,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33914, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34002, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192293,17 +185964,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -192316,7 +185988,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -192327,18 +186001,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34059, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34090, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192364,7 +186064,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33971, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34111, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192412,7 +186112,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -192524,15 +186224,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -192696,7 +186398,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]uint8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5203, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5233, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -192990,18 +186692,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+33998, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11769, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34002, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34026, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34035, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34080, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34138, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34166, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34175, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34220, bp) } else { i = 0 for { @@ -193009,17 +186711,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34094, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34234, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34098, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34238, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -193031,9 +186733,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34125, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34265, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193154,7 +186856,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193168,14 +186870,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34167, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193244,8 +186946,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193270,18 +186972,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34187, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34327, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193305,28 +187007,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193465,7 +187171,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193480,9 +187186,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -193511,20 +187217,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -193536,13 +187246,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -193698,7 +187409,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -193722,7 +187433,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -193737,7 +187448,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -193793,7 +187504,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -193898,7 +187609,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -193969,8 +187680,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -194004,7 +187715,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -194014,7 +187725,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194093,7 +187804,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194354,7 +188065,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194431,7 +188142,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -194503,11 +188214,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -194519,8 +188230,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -194548,12 +188259,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -194561,9 +188276,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -194576,14 +188291,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -194607,29 +188314,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -194706,18 +188390,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11769) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11827) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34205, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34345, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34218, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34358, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -194727,9 +188411,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15145 + zSep = __ccgo_ts + 15203 } goto _2 _2: @@ -194737,8 +188421,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1663 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34229, bp) + zSep = __ccgo_ts + 1667 + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -194747,13 +188431,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34237, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34377, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _3 _3: @@ -194836,13 +188520,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+8 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1663 + zSep = __ccgo_ts + 1667 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34318, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34458, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34229, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194852,9 +188536,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34224, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22230 + zSep = __ccgo_ts + 22335 } goto _1 _1: @@ -194862,10 +188546,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34336, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34476, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33800, bp) - zSep = __ccgo_ts + 1663 + _sessionAppendStr(tls, bp+8, __ccgo_ts+33888, bp) + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194874,16 +188558,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34312, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34344 + zSep = __ccgo_ts + 34484 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -194909,7 +188593,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6711, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6740, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -194932,16 +188616,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34349, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34489, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22236, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22341, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15145, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -194949,19 +188633,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34367, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34507, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34378, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34518, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5171, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -194984,12 +188668,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11769, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11827, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34382) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34522) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34495) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34635) } return rc } @@ -195033,7 +188717,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -195051,11 +188735,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195232,7 +188916,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -195256,7 +188940,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195271,7 +188955,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195322,7 +189006,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -195362,10 +189046,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195403,11 +189087,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195430,7 +189114,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195449,7 +189133,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195458,7 +189142,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195468,10 +189152,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34639, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34779, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195481,10 +189165,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34660, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34800, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195497,7 +189181,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -195524,7 +189208,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -195552,7 +189236,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -195584,15 +189268,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34679, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34819, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34705, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -195616,9 +189300,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -195628,7 +189312,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6711, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6740, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -195647,18 +189331,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34735, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34875, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34779, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34919, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34850, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34990, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11769) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11827) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -195692,7 +189376,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -195701,7 +189385,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -195709,23 +189393,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34910, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35050, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34964, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34940, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35104, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -195748,13 +189432,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -195763,11 +189451,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195775,10 +189467,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195786,37 +189484,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -195839,7 +189529,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196209,7 +189899,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -196392,7 +190082,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -196427,8 +190117,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -196447,9 +190137,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -196501,7 +190191,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -196537,11 +190227,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -196554,18 +190250,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -196573,13 +190271,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -196621,12 +190321,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -196634,27 +190340,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -196809,7 +190506,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -196917,8 +190614,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -196930,9 +190627,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -197006,21 +190703,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197126,6 +190827,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197171,24 +190873,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197247,99 +190937,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -197361,14 +190958,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -197380,29 +190969,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197458,15 +191030,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197488,14 +191051,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -197566,7 +191121,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -197594,27 +191148,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -197645,7 +191190,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198181,14 +191726,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198199,16 +191736,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198260,10 +191787,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198369,12 +191896,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198449,7 +191976,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+34992, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35132, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -198805,7 +192332,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -198961,18 +192488,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -199055,22 +192570,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199089,7 +192588,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35051, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35191, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199188,7 +192687,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35058 + zErr = __ccgo_ts + 35198 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199199,7 +192698,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+24, bp+32) if *(*int32)(unsafe.Pointer(bp + 104)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1663, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 104)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -199248,16 +192747,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199276,7 +192765,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -199405,7 +192894,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } return v1 } @@ -199443,7 +192932,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35108 + zErr = __ccgo_ts + 35248 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199625,15 +193114,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -199714,7 +193194,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -199806,13 +193286,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -199838,13 +193318,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35156 + z = __ccgo_ts + 35296 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35212 + z1 = __ccgo_ts + 35352 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -199877,19 +193357,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35270, + FzFunc: __ccgo_ts + 35410, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35278, + FzFunc: __ccgo_ts + 35418, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35288, + FzFunc: __ccgo_ts + 35428, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35293, + FzFunc: __ccgo_ts + 35433, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200277,7 +193757,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) (r int32) { var aBareword [128]Tu8 @@ -200364,21 +193844,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -200549,7 +194014,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1649, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1653, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -200687,13 +194152,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -200753,7 +194211,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35309, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -200779,12 +194237,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32('0') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35316, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35456, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35347, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35487, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200793,7 +194251,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35380, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35520, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200803,14 +194261,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35417, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35557, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35426, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35566, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -200837,7 +194295,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35459, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -200849,76 +194307,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35493, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35501, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*uint8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35533, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35673, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35539, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35601, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35741, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35558, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35623, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35763, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35637, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35777, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35675, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35815, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35686, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35826, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35721, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35861, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35728, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35868, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5580, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5610, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8405, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17899, + FzName: __ccgo_ts + 18004, }, 2: { - FzName: __ccgo_ts + 35759, + FzName: __ccgo_ts + 35899, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -200926,20 +194384,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35767, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35798, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35938, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35808, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35948, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35842, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35982, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -201000,16 +194458,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35870) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16846) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35875, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36010) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16951) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35905) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36045) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35915, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36055, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -201035,7 +194493,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35946, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -201043,12 +194501,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35951, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36091, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35958, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36098, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } } goto _1 @@ -201064,9 +194522,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35973, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36113, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35966, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } goto _2 _2: @@ -201129,8 +194587,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35870) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35981, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36010) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201161,19 +194619,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36010, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1663 + v4 = __ccgo_ts + 1667 } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 16)) } else { - v5 = __ccgo_ts + 1663 + v5 = __ccgo_ts + 1667 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -201191,7 +194649,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36030, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36170, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201199,37 +194657,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36080, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36220, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36135, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36275, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35493 + zTail = __ccgo_ts + 35633 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36188 + zTail = __ccgo_ts + 36328 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36196, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36336, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16846, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16951, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201298,25 +194756,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36207, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36347, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 15145 + v2 = __ccgo_ts + 15203 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36223, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36363, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36230, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35870)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36370, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36010)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201349,7 +194807,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201359,9 +194817,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201474,7 +194932,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36256) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36396) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201485,7 +194943,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36261) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36401) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201496,7 +194954,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36270) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -201510,7 +194968,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36280) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36420) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -201521,7 +194979,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36290) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36430) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -201538,7 +194996,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36302) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36442) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -201553,7 +195011,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35870) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36010) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -201568,7 +195026,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36314) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36454) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -201584,7 +195042,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36328) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36468) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -201627,7 +195085,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36338 + zSelect = __ccgo_ts + 36478 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -201647,7 +195105,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36370) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36510) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -201658,7 +195116,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36378, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36518, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -201723,112 +195181,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -201904,7 +195256,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36449, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, 0) return FTS5_EOF } goto _1 @@ -201915,7 +195267,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36469, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36609, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -201930,13 +195282,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36500, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36640, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36503, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36643, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30964, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31052, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -201980,7 +195332,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -202513,16 +195865,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -202547,14 +195889,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -203619,7 +196953,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203629,7 +196963,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203675,14 +197009,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -203735,12 +197061,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -203874,7 +197200,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -203914,15 +197240,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -203963,7 +197289,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -204001,8 +197327,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36507, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35020, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36647, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -204022,10 +197348,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if libc.Int32FromUint8(c) < int32('0') || libc.Int32FromUint8(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36512, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204059,7 +197388,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204109,7 +197438,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204160,7 +197489,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21233, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204187,7 +197516,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -204284,7 +197613,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36541, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36681, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204369,7 +197698,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204382,7 +197711,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204456,7 +197785,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204482,11 +197811,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36594 + v2 = __ccgo_ts + 36734 } else { - v2 = __ccgo_ts + 36507 + v2 = __ccgo_ts + 36647 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36601, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36741, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204499,7 +197828,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36651, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36791, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -204620,14 +197949,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -204643,7 +197964,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -204667,14 +197988,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -204976,7 +198289,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -205039,67 +198352,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205237,7 +198490,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -205549,7 +198802,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -205981,9 +199234,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -206020,7 +199273,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206093,7 +199345,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206128,7 +199379,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206143,149 +199393,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206293,187 +199407,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -206653,7 +199587,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -206758,7 +199692,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36710, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36850, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -206787,7 +199721,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36761, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36901, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -206821,7 +199755,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36810, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -206899,7 +199833,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -206990,7 +199924,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36850, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36990, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -207001,7 +199935,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36850, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36990, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -207682,7 +200616,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -207927,15 +200861,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -208036,7 +200970,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -208642,7 +201576,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37018, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -208731,7 +201665,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36962, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37102, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209378,7 +202312,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -209404,14 +202338,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209421,15 +202347,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -209543,7 +202460,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -209564,7 +202481,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210288,7 +203205,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -210347,7 +203264,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -210702,7 +203619,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37044, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37184, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211157,13 +204074,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211208,7 +204118,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37101, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211377,7 +204287,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -211695,7 +204605,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37162, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -211970,7 +204880,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -212005,7 +204915,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -212284,16 +205194,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -212511,7 +205411,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -212548,7 +205448,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -212559,70 +205459,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -212691,7 +205528,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -212790,14 +205627,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -212844,19 +205673,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -212935,7 +205751,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -212985,7 +205801,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213067,15 +205883,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1663, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1667, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213101,11 +205920,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37213, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37353, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+25999, __ccgo_ts+37221, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26087, __ccgo_ts+37361, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11980, __ccgo_ts+37256, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12038, __ccgo_ts+37396, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213303,7 +206122,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -213558,7 +206377,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37300) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37440) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -213909,7 +206728,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -214031,7 +206850,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214151,7 +206970,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36704, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -214745,7 +207564,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37442, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -214976,7 +207795,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37388) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37528) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215115,7 +207934,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215170,87 +207988,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215258,96 +207995,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -215598,7 +208245,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37393, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37533, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -215635,7 +208282,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -215654,7 +208301,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*uint8)(unsafe.Pointer(idxStr + uintptr(v5))) = libc.Uint8FromInt32(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5203, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216104,7 +208751,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216132,7 +208779,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3860, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216152,7 +208799,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216167,21 +208814,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15145 + v1 = __ccgo_ts + 15203 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1663 + v2 = __ccgo_ts + 1667 } if bDesc != 0 { - v3 = __ccgo_ts + 37432 + v3 = __ccgo_ts + 37572 } else { - v3 = __ccgo_ts + 37437 + v3 = __ccgo_ts + 37577 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37441, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216239,14 +208886,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37496, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37636, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5562, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5592, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37502, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37642, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216296,7 +208943,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37530, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37670, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -216329,7 +208976,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37540, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37680, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216363,7 +209010,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37561, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37701, libc.VaList(bp+24, z)) } } } else { @@ -216371,7 +209018,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35288 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35428 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -216528,7 +209175,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37594, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37734, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -216599,7 +209246,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1663 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1667 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -216728,7 +209375,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37599, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37739, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -216861,10 +209508,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219400,12 +211984,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38948, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39088, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39052, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39192, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39090, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39230, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219414,7 +211998,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39128, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39268, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219426,14 +212010,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+25999, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11980, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38282, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26087, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12038, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38422, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36188, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36328, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35493, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35633, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219453,13 +212037,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30639 + v1 = __ccgo_ts + 30727 } else { - v1 = __ccgo_ts + 1663 + v1 = __ccgo_ts + 1667 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39170, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39310, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39200, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39340, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -219500,7 +212084,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39244, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39384, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -219508,7 +212092,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39267, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39407, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -219523,7 +212107,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39273, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39413, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -219532,22 +212116,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35493, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35633, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39279 + zCols = __ccgo_ts + 39419 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39311 + zCols = __ccgo_ts + 39451 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36188, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36328, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38282, __ccgo_ts+39359, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38422, __ccgo_ts+39499, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -219592,14 +212176,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -219669,14 +212245,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -219704,6 +212280,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -219716,11 +212293,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -219733,6 +212323,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -219967,12 +212558,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39376, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39516, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39426, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39566, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39455, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39595, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -219980,7 +212571,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36370, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220282,7 +212873,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39484, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39624, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220315,17 +212906,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -220412,7 +212992,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -220514,14 +213094,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35493, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35633, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221173,11 +213735,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39538 + zCat = __ccgo_ts + 39678 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221187,7 +213749,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39547) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221204,20 +213766,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39558) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39516) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39656) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39527) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39667) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39547) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -221253,7 +213815,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -221440,7 +214002,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -221468,14 +214030,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]uint8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -221509,7 +214063,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39576 + zBase = __ccgo_ts + 39716 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -221553,14 +214107,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -221571,16 +214117,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) (r int32) { return libc.BoolInt32(libc.Int32FromUint8(c) == int32('a') || libc.Int32FromUint8(c) == int32('e') || libc.Int32FromUint8(c) == int32('i') || libc.Int32FromUint8(c) == int32('o') || libc.Int32FromUint8(c) == int32('u') || bYIsVowel != 0 && libc.Int32FromUint8(c) == int32('y')) } @@ -221726,64 +214262,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39586, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39589, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39594, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39734, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39599, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39602, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39605, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39610, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39615, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39625, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39630, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221792,49 +214328,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39638, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39641, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39781, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39645, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39649, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39653, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39657, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39661, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39801, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221851,20 +214387,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39665, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39645, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39805, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39668, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39671, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39675, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39661, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39815, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -221880,75 +214416,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39678, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39645, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39686, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39693, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39833, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39698, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39594, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39734, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39703, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39589, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39729, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39708, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39661, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39713, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16048, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16153, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39718, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39671, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39630, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39733, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39873, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39737, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39877, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39653, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -221957,48 +214493,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39885, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39661, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39753, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39645, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39899, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39645, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39764, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39904, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39910, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39657, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39786, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39926, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39790, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39653, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -222006,21 +214542,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39798, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39804, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39944, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39657, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39810, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39671, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -222038,48 +214574,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39817, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39957, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39602, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39822, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39827, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39967, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39833, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39973, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39602, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39786, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39926, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39839, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39845, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39586, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222095,13 +214631,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39851, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39991, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39855, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39995, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222109,7 +214645,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39861, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222206,14 +214742,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222231,13 +214767,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222274,14 +214803,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39865) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40005) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39558) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222319,7 +214848,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222447,7 +214976,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -222523,11 +215052,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -222549,7 +215078,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39880)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40020)) } // C documentation @@ -222575,7 +215104,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39576, + FzName: __ccgo_ts + 39716, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -222583,7 +215112,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39888, + FzName: __ccgo_ts + 40028, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -222591,7 +215120,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39880, + FzName: __ccgo_ts + 40020, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -222621,7 +215150,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39894, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40034, pApi, bp+96, uintptr(0)) } return rc } @@ -228082,39 +220611,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228137,16 +220633,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39901) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40041) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39905) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40045) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39909) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40049) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39918, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40058, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228209,21 +220705,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39952, - 1: __ccgo_ts + 39992, - 2: __ccgo_ts + 40027, + 0: __ccgo_ts + 40092, + 1: __ccgo_ts + 40132, + 2: __ccgo_ts + 40167, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23975, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24080, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40070, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40210, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228244,23 +220741,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228393,10 +220890,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40103, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40243, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40134, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40274, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -228415,7 +220912,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40185, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40325, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -228741,7 +221238,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1663 + zCopy = __ccgo_ts + 1667 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -228865,7 +221362,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40211, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40351, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -228920,15 +221417,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40221 + return __ccgo_ts + 40361 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229150,7 +221647,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229198,11 +221695,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-14.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go b/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go index a00e5d9..9b766c8 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_linux_s390x.go @@ -1,4 +1,4 @@ -// Code generated for linux/s390x by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/s390x -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/s390x -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/s390x -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. +// Code generated for linux/s390x by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/linux/s390x -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/linux/s390x -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/linux/s390x -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_OS_UNIX=1 -eval-all-macros', DO NOT EDIT. //go:build linux && s390x @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -32,7 +34,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -86,6 +87,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 1024 const BYTE_ORDER = 4321 const CACHE_STALE = 0 @@ -135,6 +137,31 @@ const CLOCK_REALTIME_COARSE = 5 const CLOCK_SGI_CYCLE = 10 const CLOCK_TAI = 11 const CLOCK_THREAD_CPUTIME_ID = 3 +const CLONE_CHILD_CLEARTID = 2097152 +const CLONE_CHILD_SETTID = 16777216 +const CLONE_DETACHED = 4194304 +const CLONE_FILES = 1024 +const CLONE_FS = 512 +const CLONE_IO = 2147483648 +const CLONE_NEWCGROUP = 33554432 +const CLONE_NEWIPC = 134217728 +const CLONE_NEWNET = 1073741824 +const CLONE_NEWNS = 131072 +const CLONE_NEWPID = 536870912 +const CLONE_NEWTIME = 128 +const CLONE_NEWUSER = 268435456 +const CLONE_NEWUTS = 67108864 +const CLONE_PARENT = 32768 +const CLONE_PARENT_SETTID = 1048576 +const CLONE_PIDFD = 4096 +const CLONE_PTRACE = 8192 +const CLONE_SETTLS = 524288 +const CLONE_SIGHAND = 2048 +const CLONE_SYSVSEM = 262144 +const CLONE_THREAD = 65536 +const CLONE_UNTRACED = 8388608 +const CLONE_VFORK = 16384 +const CLONE_VM = 256 const COLFLAG_BUSY = 256 const COLFLAG_GENERATED = 96 const COLFLAG_HASCOLL = 512 @@ -161,6 +188,8 @@ const COLTYPE_INT = 3 const COLTYPE_INTEGER = 4 const COLTYPE_REAL = 5 const COLTYPE_TEXT = 6 +const CPU_SETSIZE = 1024 +const CSIGNAL = 255 const CURSOR_FAULT = 4 const CURSOR_INVALID = 1 const CURSOR_REQUIRESEEK = 3 @@ -586,7 +615,7 @@ const F_TLOCK = 2 const F_ULOCK = 0 const F_UNLCK = 2 const F_WRLCK = 1 -const GCC_VERSION = 10002001 +const GCC_VERSION = 12002000 const GEOPOLY_PI = 3.141592653589793 const HASHSIZE = 97 const HASHTABLE_HASH_1 = 383 @@ -1243,6 +1272,31 @@ const PTF_INTKEY = 1 const PTF_LEAF = 8 const PTF_LEAFDATA = 4 const PTF_ZERODATA = 2 +const PTHREAD_BARRIER_SERIAL_THREAD = -1 +const PTHREAD_CANCELED = -1 +const PTHREAD_CANCEL_ASYNCHRONOUS = 1 +const PTHREAD_CANCEL_DEFERRED = 0 +const PTHREAD_CANCEL_DISABLE = 1 +const PTHREAD_CANCEL_ENABLE = 0 +const PTHREAD_CANCEL_MASKED = 2 +const PTHREAD_CREATE_DETACHED = 1 +const PTHREAD_CREATE_JOINABLE = 0 +const PTHREAD_EXPLICIT_SCHED = 1 +const PTHREAD_INHERIT_SCHED = 0 +const PTHREAD_MUTEX_DEFAULT = 0 +const PTHREAD_MUTEX_ERRORCHECK = 2 +const PTHREAD_MUTEX_NORMAL = 0 +const PTHREAD_MUTEX_RECURSIVE = 1 +const PTHREAD_MUTEX_ROBUST = 1 +const PTHREAD_MUTEX_STALLED = 0 +const PTHREAD_ONCE_INIT = 0 +const PTHREAD_PRIO_INHERIT = 1 +const PTHREAD_PRIO_NONE = 0 +const PTHREAD_PRIO_PROTECT = 2 +const PTHREAD_PROCESS_PRIVATE = 0 +const PTHREAD_PROCESS_SHARED = 1 +const PTHREAD_SCOPE_PROCESS = 1 +const PTHREAD_SCOPE_SYSTEM = 0 const PTRMAP_BTREE = 5 const PTRMAP_FREEPAGE = 2 const PTRMAP_OVERFLOW1 = 3 @@ -1383,6 +1437,13 @@ const R_OK = 4 const SAVEPOINT_BEGIN = 0 const SAVEPOINT_RELEASE = 1 const SAVEPOINT_ROLLBACK = 2 +const SCHED_BATCH = 3 +const SCHED_DEADLINE = 6 +const SCHED_FIFO = 1 +const SCHED_IDLE = 5 +const SCHED_OTHER = 0 +const SCHED_RESET_ON_FORK = 1073741824 +const SCHED_RR = 2 const SCHEMA_ROOT = 1 const SEEK_DATA = 3 const SEEK_HOLE = 4 @@ -1502,6 +1563,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -1741,6 +1803,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -1951,6 +2014,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -1974,7 +2038,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 -const SQLITE_MUTEX_NOOP = 1 +const SQLITE_MUTEX_NREF = 0 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -2113,6 +2177,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -2121,7 +2186,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -2206,6 +2271,7 @@ const SQLITE_TESTCTRL_USELONGDOUBLE = 34 const SQLITE_TESTCTRL_VDBE_COVERAGE = 21 const SQLITE_TEXT = 3 const SQLITE_THREADSAFE = 1 +const SQLITE_THREADS_IMPLEMENTED = 1 const SQLITE_TOKEN_KEYWORD = 2 const SQLITE_TOKEN_QUOTED = 1 const SQLITE_TOOBIG = 18 @@ -2231,8 +2297,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 3 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -3079,6 +3145,7 @@ const __DBL_DIG__ = 15 const __DBL_HAS_DENORM__ = 1 const __DBL_HAS_INFINITY__ = 1 const __DBL_HAS_QUIET_NAN__ = 1 +const __DBL_IS_IEC_60559__ = 2 const __DBL_MANT_DIG__ = 53 const __DBL_MAX_10_EXP__ = 308 const __DBL_MAX_EXP__ = 1024 @@ -3117,6 +3184,7 @@ const __FLT32X_EPSILON__ = 0 const __FLT32X_HAS_DENORM__ = 1 const __FLT32X_HAS_INFINITY__ = 1 const __FLT32X_HAS_QUIET_NAN__ = 1 +const __FLT32X_IS_IEC_60559__ = 2 const __FLT32X_MANT_DIG__ = 53 const __FLT32X_MAX_10_EXP__ = 308 const __FLT32X_MAX_EXP__ = 1024 @@ -3132,6 +3200,7 @@ const __FLT32_EPSILON__ = 0 const __FLT32_HAS_DENORM__ = 1 const __FLT32_HAS_INFINITY__ = 1 const __FLT32_HAS_QUIET_NAN__ = 1 +const __FLT32_IS_IEC_60559__ = 2 const __FLT32_MANT_DIG__ = 24 const __FLT32_MAX_10_EXP__ = 38 const __FLT32_MAX_EXP__ = 128 @@ -3147,6 +3216,7 @@ const __FLT64_EPSILON__ = 0 const __FLT64_HAS_DENORM__ = 1 const __FLT64_HAS_INFINITY__ = 1 const __FLT64_HAS_QUIET_NAN__ = 1 +const __FLT64_IS_IEC_60559__ = 2 const __FLT64_MANT_DIG__ = 53 const __FLT64_MAX_10_EXP__ = 308 const __FLT64_MAX_EXP__ = 1024 @@ -3164,6 +3234,7 @@ const __FLT_EVAL_METHOD__ = 0 const __FLT_HAS_DENORM__ = 1 const __FLT_HAS_INFINITY__ = 1 const __FLT_HAS_QUIET_NAN__ = 1 +const __FLT_IS_IEC_60559__ = 2 const __FLT_MANT_DIG__ = 24 const __FLT_MAX_10_EXP__ = 38 const __FLT_MAX_EXP__ = 128 @@ -3199,11 +3270,13 @@ const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1 const __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1 const __GCC_IEC_559 = 2 const __GCC_IEC_559_COMPLEX = 2 +const __GNUC_EXECUTION_CHARSET_NAME = "UTF-8" const __GNUC_MINOR__ = 2 -const __GNUC_PATCHLEVEL__ = 1 +const __GNUC_PATCHLEVEL__ = 0 const __GNUC_STDC_INLINE__ = 1 -const __GNUC__ = 10 -const __GXX_ABI_VERSION = 1014 +const __GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-32BE" +const __GNUC__ = 12 +const __GXX_ABI_VERSION = 1017 const __HAVE_SPECULATION_SAFE_VALUE = 1 const __INT16_MAX__ = 32767 const __INT32_MAX__ = 2147483647 @@ -3240,6 +3313,7 @@ const __LDBL_EPSILON__ = 0 const __LDBL_HAS_DENORM__ = 1 const __LDBL_HAS_INFINITY__ = 1 const __LDBL_HAS_QUIET_NAN__ = 1 +const __LDBL_IS_IEC_60559__ = 2 const __LDBL_MANT_DIG__ = 53 const __LDBL_MAX_10_EXP__ = 308 const __LDBL_MAX_EXP__ = 1024 @@ -3293,6 +3367,8 @@ const __SQLITESESSION_H_ = 1 const __STDC_HOSTED__ = 1 const __STDC_IEC_559_COMPLEX__ = 1 const __STDC_IEC_559__ = 1 +const __STDC_IEC_60559_BFP__ = 201404 +const __STDC_IEC_60559_COMPLEX__ = 201404 const __STDC_ISO_10646__ = 201706 const __STDC_UTF_16__ = 1 const __STDC_UTF_32__ = 1 @@ -3313,7 +3389,7 @@ const __UINT_LEAST32_MAX__ = 4294967295 const __UINT_LEAST64_MAX__ = 18446744073709551615 const __UINT_LEAST8_MAX__ = 255 const __USE_TIME_BITS64 = 1 -const __VERSION__ = "10.2.1 20210110" +const __VERSION__ = "12.2.0" const __WCHAR_MAX__ = 2147483647 const __WCHAR_MIN__ = -2147483648 const __WCHAR_TYPE__ = 0 @@ -3346,6 +3422,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -3355,9 +3434,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -3805,12 +3881,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -3939,29 +4009,380 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 +/* +** CAPI3REF: Standard File Control Opcodes +** KEYWORDS: {file control opcodes} {file control opcode} +** +** These integer constants are opcodes for the xFileControl method +** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] +** interface. +** +**
      +**
    • [[SQLITE_FCNTL_LOCKSTATE]] +** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This +** opcode causes the xFileControl method to write the current state of +** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], +** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) +** into an integer that the pArg argument points to. +** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. +** +**
    • [[SQLITE_FCNTL_SIZE_HINT]] +** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS +** layer a hint of how large the database file will grow to be during the +** current transaction. This hint is not guaranteed to be accurate but it +** is often close. The underlying VFS might choose to preallocate database +** file space based on this hint in order to help writes to the database +** file run faster. +** +**
    • [[SQLITE_FCNTL_SIZE_LIMIT]] +** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that +** implements [sqlite3_deserialize()] to set an upper bound on the size +** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. +** If the integer pointed to is negative, then it is filled in with the +** current limit. Otherwise the limit is set to the larger of the value +** of the integer pointed to and the current database size. The integer +** pointed to is set to the new limit. +** +**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] +** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS +** extends and truncates the database file in chunks of a size specified +** by the user. The fourth argument to [sqlite3_file_control()] should +** point to an integer (type int) containing the new chunk-size to use +** for the nominated database. Allocating database file space in large +** chunks (say 1MB at a time), may reduce file-system fragmentation and +** improve performance on some systems. +** +**
    • [[SQLITE_FCNTL_FILE_POINTER]] +** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with a particular database +** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. +** +**
    • [[SQLITE_FCNTL_JOURNAL_POINTER]] +** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer +** to the [sqlite3_file] object associated with the journal file (either +** the [rollback journal] or the [write-ahead log]) for a particular database +** connection. See also [SQLITE_FCNTL_FILE_POINTER]. +** +**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] +** No longer in use. +** +**
    • [[SQLITE_FCNTL_SYNC]] +** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and +** sent to the VFS immediately before the xSync method is invoked on a +** database file descriptor. Or, if the xSync method is not invoked +** because the user has configured SQLite with +** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place +** of the xSync method. In most cases, the pointer argument passed with +** this file-control is NULL. However, if the database file is being synced +** as part of a multi-database commit, the argument points to a nul-terminated +** string containing the transactions super-journal file name. VFSes that +** do not need this signal should silently ignore this opcode. Applications +** should not call [sqlite3_file_control()] with this opcode as doing so may +** disrupt the operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] +** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite +** and sent to the VFS after a transaction has been committed immediately +** but before the database is unlocked. VFSes that do not need this signal +** should silently ignore this opcode. Applications should not call +** [sqlite3_file_control()] with this opcode as doing so may disrupt the +** operation of the specialized VFSes that do require it. +** +**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] +** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic +** retry counts and intervals for certain disk I/O operations for the +** windows [VFS] in order to provide robustness in the presence of +** anti-virus programs. By default, the windows VFS will retry file read, +** file write, and file delete operations up to 10 times, with a delay +** of 25 milliseconds before the first retry and with the delay increasing +** by an additional 25 milliseconds with each subsequent retry. This +** opcode allows these two values (10 retries and 25 milliseconds of delay) +** to be adjusted. The values are changed for all database connections +** within the same process. The argument is a pointer to an array of two +** integers where the first integer is the new retry count and the second +** integer is the delay. If either integer is negative, then the setting +** is not changed but instead the prior value of that setting is written +** into the array entry, allowing the current retry settings to be +** interrogated. The zDbName parameter is ignored. +** +**
    • [[SQLITE_FCNTL_PERSIST_WAL]] +** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the +** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary +** write ahead log ([WAL file]) and shared memory +** files used for transaction control +** are automatically deleted when the latest connection to the database +** closes. Setting persistent WAL mode causes those files to persist after +** close. Persisting the files is useful when other processes that do not +** have write permission on the directory containing the database file want +** to read the database file, as the WAL and shared memory files must exist +** in order for the database to be readable. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable persistent WAL mode or 1 to enable persistent +** WAL mode. If the integer is -1, then it is overwritten with the current +** WAL persistence setting. +** +**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] +** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the +** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting +** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the +** xDeviceCharacteristics methods. The fourth parameter to +** [sqlite3_file_control()] for this opcode should be a pointer to an integer. +** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage +** mode. If the integer is -1, then it is overwritten with the current +** zero-damage mode setting. +** +**
    • [[SQLITE_FCNTL_OVERWRITE]] +** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening +** a write transaction to indicate that, unless it is rolled back for some +** reason, the entire database file will be overwritten by the current +** transaction. This is used by VACUUM operations. +** +**
    • [[SQLITE_FCNTL_VFSNAME]] +** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of +** all [VFSes] in the VFS stack. The names are of all VFS shims and the +** final bottom-level VFS are written into memory obtained from +** [sqlite3_malloc()] and the result is stored in the char* variable +** that the fourth parameter of [sqlite3_file_control()] points to. +** The caller is responsible for freeing the memory when done. As with +** all file-control actions, there is no guarantee that this will actually +** do anything. Callers should initialize the char* variable to a NULL +** pointer in case this file-control is not implemented. This file-control +** is intended for diagnostic use only. +** +**
    • [[SQLITE_FCNTL_VFS_POINTER]] +** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level +** [VFSes] currently in use. ^(The argument X in +** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be +** of type "[sqlite3_vfs] **". This opcodes will set *X +** to a pointer to the top-level VFS.)^ +** ^When there are multiple VFS shims in the stack, this opcode finds the +** upper-most shim only. +** +**
    • [[SQLITE_FCNTL_PRAGMA]] +** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] +** file control is sent to the open [sqlite3_file] object corresponding +** to the database file to which the pragma statement refers. ^The argument +** to the [SQLITE_FCNTL_PRAGMA] file control is an array of +** pointers to strings (char**) in which the second element of the array +** is the name of the pragma and the third element is the argument to the +** pragma or NULL if the pragma has no argument. ^The handler for an +** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element +** of the char** argument point to a string obtained from [sqlite3_mprintf()] +** or the equivalent and that string will become the result of the pragma or +** the error message if the pragma fails. ^If the +** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal +** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] +** file control returns [SQLITE_OK], then the parser assumes that the +** VFS has handled the PRAGMA itself and the parser generates a no-op +** prepared statement if result string is NULL, or that returns a copy +** of the result string if the string is non-NULL. +** ^If the [SQLITE_FCNTL_PRAGMA] file control returns +** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means +** that the VFS encountered an error while handling the [PRAGMA] and the +** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] +** file control occurs at the beginning of pragma statement analysis and so +** it is able to override built-in [PRAGMA] statements. +** +**
    • [[SQLITE_FCNTL_BUSYHANDLER]] +** ^The [SQLITE_FCNTL_BUSYHANDLER] +** file-control may be invoked by SQLite on the database file handle +** shortly after it is opened in order to provide a custom VFS with access +** to the connection's busy-handler callback. The argument is of type (void**) +** - an array of two (void *) values. The first (void *) actually points +** to a function of type (int (*)(void *)). In order to invoke the connection's +** busy-handler, this function should be invoked with the second (void *) in +** the array as the only argument. If it returns non-zero, then the operation +** should be retried. If it returns zero, the custom VFS should abandon the +** current operation. +** +**
    • [[SQLITE_FCNTL_TEMPFILENAME]] +** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control +** to have SQLite generate a +** temporary filename using the same algorithm that is followed to generate +** temporary filenames for TEMP tables and other internal uses. The +** argument should be a char** which will be filled with the filename +** written into memory obtained from [sqlite3_malloc()]. The caller should +** invoke [sqlite3_free()] on the result to avoid a memory leak. +** +**
    • [[SQLITE_FCNTL_MMAP_SIZE]] +** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the +** maximum number of bytes that will be used for memory-mapped I/O. +** The argument is a pointer to a value of type sqlite3_int64 that +** is an advisory maximum number of bytes in the file to memory map. The +** pointer is overwritten with the old value. The limit is not changed if +** the value originally pointed to is negative, and so the current limit +** can be queried by passing in a pointer to a negative number. This +** file-control is used internally to implement [PRAGMA mmap_size]. +** +**
    • [[SQLITE_FCNTL_TRACE]] +** The [SQLITE_FCNTL_TRACE] file control provides advisory information +** to the VFS about what the higher layers of the SQLite stack are doing. +** This file control is used by some VFS activity tracing [shims]. +** The argument is a zero-terminated string. Higher layers in the +** SQLite stack may generate instances of this file control if +** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. +** +**
    • [[SQLITE_FCNTL_HAS_MOVED]] +** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a +** pointer to an integer and it writes a boolean into that integer depending +** on whether or not the file has been renamed, moved, or deleted since it +** was first opened. +** +**
    • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the +** underlying native file handle associated with a file handle. This file +** control interprets its argument as a pointer to a native file handle and +** writes the resulting value there. +** +**
    • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] +** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This +** opcode causes the xFileControl method to swap the file handle with the one +** pointed to by the pArg argument. This capability is used during testing +** and only needs to be supported when SQLITE_TEST is defined. +** +**
    • [[SQLITE_FCNTL_NULL_IO]] +** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor +** or file handle for the [sqlite3_file] object such that it will no longer +** read or write to the database file. +** +**
    • [[SQLITE_FCNTL_WAL_BLOCK]] +** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might +** be advantageous to block on the next WAL lock if the lock is not immediately +** available. The WAL subsystem issues this signal during rare +** circumstances in order to fix a problem with priority inversion. +** Applications should not use this file-control. +** +**
    • [[SQLITE_FCNTL_ZIPVFS]] +** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other +** VFS should return SQLITE_NOTFOUND for this opcode. +** +**
    • [[SQLITE_FCNTL_RBU]] +** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by +** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for +** this opcode. +** +**
    • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] +** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then +** the file descriptor is placed in "batch write mode", which +** means all subsequent write operations will be deferred and done +** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems +** that do not support batch atomic writes will return SQLITE_NOTFOUND. +** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to +** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or +** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make +** no VFS interface calls on the same [sqlite3_file] file descriptor +** except for calls to the xWrite method and the xFileControl method +** with [SQLITE_FCNTL_SIZE_HINT]. +** +**
    • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. +** This file control returns [SQLITE_OK] if and only if the writes were +** all performed successfully and have been committed to persistent storage. +** ^Regardless of whether or not it is successful, this file control takes +** the file descriptor out of batch write mode so that all subsequent +** write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] +** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write +** operations since the previous successful call to +** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. +** ^This file control takes the file descriptor out of batch write mode +** so that all subsequent write operations are independent. +** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without +** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. +** +**
    • [[SQLITE_FCNTL_LOCK_TIMEOUT]] +** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS +** to block for up to M milliseconds before failing when attempting to +** obtain a file lock using the xLock or xShmLock methods of the VFS. +** The parameter is a pointer to a 32-bit signed integer that contains +** the value that M is to be set to. Before returning, the 32-bit signed +** integer is overwritten with the previous value of M. +** +**
    • [[SQLITE_FCNTL_BLOCK_ON_CONNECT]] +** The [SQLITE_FCNTL_BLOCK_ON_CONNECT] opcode is used to configure the +** VFS to block when taking a SHARED lock to connect to a wal mode database. +** This is used to implement the functionality associated with +** SQLITE_SETLK_BLOCK_ON_CONNECT. +** +**
    • [[SQLITE_FCNTL_DATA_VERSION]] +** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to +** a database file. The argument is a pointer to a 32-bit unsigned integer. +** The "data version" for the pager is written into the pointer. The +** "data version" changes whenever any change occurs to the corresponding +** database file, either through SQL statements on the same database +** connection or through transactions committed by separate database +** connections possibly in other processes. The [sqlite3_total_changes()] +** interface can be used to find if any database on the connection has changed, +** but that interface responds to changes on TEMP as well as MAIN and does +** not provide a mechanism to detect changes to MAIN only. Also, the +** [sqlite3_total_changes()] interface responds to internal changes only and +** omits changes made by other database connections. The +** [PRAGMA data_version] command provides a mechanism to detect changes to +** a single attached database that occur due to other database connections, +** but omits changes implemented by the database connection on which it is +** called. This file control is the only mechanism to detect changes that +** happen either internally or externally and that are associated with +** a particular attached database. +** +**
    • [[SQLITE_FCNTL_CKPT_START]] +** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint +** in wal mode before the client starts to copy pages from the wal +** file to the database file. +** +**
    • [[SQLITE_FCNTL_CKPT_DONE]] +** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint +** in wal mode after the client has finished copying pages from the wal +** file to the database file, but before the *-shm file is updated to +** record the fact that the pages have been checkpointed. +** +**
    • [[SQLITE_FCNTL_EXTERNAL_READER]] +** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect +** whether or not there is a database client in another process with a wal-mode +** transaction open on the database or not. It is only available on unix.The +** (void*) argument passed with this file-control should be a pointer to a +** value of type (int). The integer value is set to 1 if the database is a wal +** mode database and there exists at least one client in another process that +** currently has an SQL transaction open on the database. It is set to 0 if +** the database is not a wal-mode db, or if there is no such connection in any +** other process. This opcode cannot be used to detect transactions opened +** by clients within the current process, only within other processes. +** +**
    • [[SQLITE_FCNTL_CKSM_FILE]] +** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the +** [checksum VFS shim] only. +** +**
    • [[SQLITE_FCNTL_RESET_CACHE]] +** If there is currently no transaction open on the database, and the +** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control +** purges the contents of the in-memory page cache. If there is an open +** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. +**
    + */ + +/* deprecated names */ + +// C documentation +// +// /* +// ** CAPI3REF: Mutex Handle +// ** +// ** The mutex module within SQLite defines [sqlite3_mutex] to be an +// ** abstract type for a mutex object. The SQLite core never looks +// ** at the internal representation of an [sqlite3_mutex]. It only +// ** deals with pointers to the [sqlite3_mutex] object. +// ** +// ** Mutexes are created using [sqlite3_mutex_alloc()]. +// */ +type Tsqlite3_mutex = struct { + Fmutex Tpthread_mutex_t +} + +type sqlite3_mutex = Tsqlite3_mutex // C documentation // @@ -4244,6 +4665,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -4474,33 +4896,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -4579,19 +4974,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -4676,7 +5058,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -4768,223 +5149,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -5066,20 +5230,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -5129,13 +5279,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -5194,9 +5337,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -5204,17 +5347,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -5241,12 +5384,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -5263,7 +5406,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -5281,7 +5424,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -5315,24 +5458,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -5356,22 +5481,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -5432,7 +5541,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -5512,50 +5621,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -5952,340 +6017,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -6295,15 +6026,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -6319,14 +6041,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -6352,17 +6066,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -6417,11 +6120,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -6795,55 +6504,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint64 type size_t = Tsize_t @@ -6990,6 +6655,11 @@ type ptrdiff_t = Tptrdiff_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -7048,6 +6718,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -7157,14 +6838,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -7249,7 +6922,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -7351,7 +7024,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]uint8 } type DbClientData = TDbClientData @@ -7410,6 +7082,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -7421,9 +7094,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -7438,7 +7111,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -7487,8 +7159,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -7552,7 +7224,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -7624,19 +7295,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -7650,11 +7324,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -7665,40 +7336,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -7716,7 +7388,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -7728,6 +7400,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -7815,9 +7488,11 @@ type TSelect = struct { type Select = TSelect type TSQLiteThread = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr + Ftid Tpthread_t + Fdone int32 + FpOut uintptr + FxTask uintptr + FpIn uintptr } type SQLiteThread = TSQLiteThread @@ -7876,9 +7551,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -7895,10 +7570,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -7933,6 +7604,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -8113,7 +7785,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -8155,7 +7826,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -8328,9 +7998,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -8457,53 +8127,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -8607,16 +8230,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -8640,38 +8253,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -8684,34 +8270,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -8725,90 +8287,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -8827,187 +8305,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -9017,913 +8314,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity uint8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -9948,611 +8338,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr uint8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -10562,317 +8347,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]uint8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -10958,228 +8432,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]uint8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign uint8 - FisSpecial uint8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]uint8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -11275,58 +8527,58 @@ type FpDecode1 = TFpDecode1 var _sqlite3azCompileOpt = [54]uintptr{ 0: __ccgo_ts, 1: __ccgo_ts + 20, - 2: __ccgo_ts + 49, - 3: __ccgo_ts + 68, - 4: __ccgo_ts + 93, - 5: __ccgo_ts + 115, - 6: __ccgo_ts + 145, - 7: __ccgo_ts + 165, - 8: __ccgo_ts + 185, - 9: __ccgo_ts + 208, - 10: __ccgo_ts + 233, - 11: __ccgo_ts + 260, - 12: __ccgo_ts + 285, - 13: __ccgo_ts + 307, - 14: __ccgo_ts + 339, - 15: __ccgo_ts + 365, - 16: __ccgo_ts + 390, - 17: __ccgo_ts + 411, - 18: __ccgo_ts + 434, - 19: __ccgo_ts + 453, - 20: __ccgo_ts + 465, - 21: __ccgo_ts + 480, - 22: __ccgo_ts + 502, - 23: __ccgo_ts + 527, - 24: __ccgo_ts + 550, - 25: __ccgo_ts + 572, - 26: __ccgo_ts + 583, - 27: __ccgo_ts + 596, - 28: __ccgo_ts + 611, - 29: __ccgo_ts + 627, - 30: __ccgo_ts + 640, - 31: __ccgo_ts + 661, - 32: __ccgo_ts + 685, - 33: __ccgo_ts + 708, - 34: __ccgo_ts + 724, - 35: __ccgo_ts + 740, - 36: __ccgo_ts + 764, - 37: __ccgo_ts + 791, - 38: __ccgo_ts + 811, - 39: __ccgo_ts + 833, - 40: __ccgo_ts + 855, - 41: __ccgo_ts + 885, - 42: __ccgo_ts + 910, - 43: __ccgo_ts + 936, - 44: __ccgo_ts + 956, - 45: __ccgo_ts + 982, - 46: __ccgo_ts + 1005, - 47: __ccgo_ts + 1031, - 48: __ccgo_ts + 1053, - 49: __ccgo_ts + 1074, - 50: __ccgo_ts + 1085, - 51: __ccgo_ts + 1093, - 52: __ccgo_ts + 1107, - 53: __ccgo_ts + 1120, + 2: __ccgo_ts + 40, + 3: __ccgo_ts + 59, + 4: __ccgo_ts + 84, + 5: __ccgo_ts + 106, + 6: __ccgo_ts + 136, + 7: __ccgo_ts + 156, + 8: __ccgo_ts + 176, + 9: __ccgo_ts + 199, + 10: __ccgo_ts + 224, + 11: __ccgo_ts + 251, + 12: __ccgo_ts + 276, + 13: __ccgo_ts + 298, + 14: __ccgo_ts + 330, + 15: __ccgo_ts + 356, + 16: __ccgo_ts + 381, + 17: __ccgo_ts + 402, + 18: __ccgo_ts + 425, + 19: __ccgo_ts + 444, + 20: __ccgo_ts + 456, + 21: __ccgo_ts + 471, + 22: __ccgo_ts + 493, + 23: __ccgo_ts + 518, + 24: __ccgo_ts + 541, + 25: __ccgo_ts + 563, + 26: __ccgo_ts + 574, + 27: __ccgo_ts + 587, + 28: __ccgo_ts + 602, + 29: __ccgo_ts + 618, + 30: __ccgo_ts + 631, + 31: __ccgo_ts + 652, + 32: __ccgo_ts + 676, + 33: __ccgo_ts + 699, + 34: __ccgo_ts + 715, + 35: __ccgo_ts + 731, + 36: __ccgo_ts + 755, + 37: __ccgo_ts + 782, + 38: __ccgo_ts + 802, + 39: __ccgo_ts + 824, + 40: __ccgo_ts + 846, + 41: __ccgo_ts + 876, + 42: __ccgo_ts + 901, + 43: __ccgo_ts + 927, + 44: __ccgo_ts + 947, + 45: __ccgo_ts + 973, + 46: __ccgo_ts + 996, + 47: __ccgo_ts + 1022, + 48: __ccgo_ts + 1044, + 49: __ccgo_ts + 1065, + 50: __ccgo_ts + 1080, + 51: __ccgo_ts + 1088, + 52: __ccgo_ts + 1102, + 53: __ccgo_ts + 1115, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -12157,12 +9409,12 @@ var _sqlite3StdTypeAffinity = [6]uint8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1133, - 1: __ccgo_ts + 1137, - 2: __ccgo_ts + 1142, - 3: __ccgo_ts + 1146, - 4: __ccgo_ts + 1154, - 5: __ccgo_ts + 1159, + 0: __ccgo_ts + 1128, + 1: __ccgo_ts + 1132, + 2: __ccgo_ts + 1137, + 3: __ccgo_ts + 1141, + 4: __ccgo_ts + 1149, + 5: __ccgo_ts + 1154, } /************** End of global.c **********************************************/ @@ -12262,7 +9514,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -12340,72 +9591,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -12451,163 +9640,10 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - -/* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - /* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ // C documentation // @@ -12634,18 +9670,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -12662,100 +9686,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]uint8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -12777,13 +9707,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -12803,14 +9726,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -12889,7 +9805,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= libc.Int32FromUint64(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -13061,7 +9977,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + libc.Uint32FromInt32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -13119,7 +10035,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -13254,24 +10170,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD uint8 - FvalidYMD uint8 - FvalidHMS uint8 - FnFloor uint8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -13402,7 +10300,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1164, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1159, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -13434,13 +10332,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1172, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1167, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1180, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1175, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -13448,7 +10346,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zDate))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*uint8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -13519,10 +10417,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(0) @@ -13590,7 +10488,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1184, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1179, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -13658,7 +10556,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) } } @@ -13691,14 +10589,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1196) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1191) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1200) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1207) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1195) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -13755,7 +10653,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -13896,13 +10794,13 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*(*TDateTime)(unsafe.Pointer(bp + 64))).FY += iYearDiff (*(*TDateTime)(unsafe.Pointer(bp + 64))).FvalidJD = uint8(0) _computeJD(tls, bp+64) - *(*Ttime_t)(unsafe.Pointer(bp)) = (*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*(*TDateTime)(unsafe.Pointer(bp + 64))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } else { iYearDiff = 0 - *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) + *(*Ttime_t)(unsafe.Pointer(bp)) = int64((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1217, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1212, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -13910,7 +10808,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = uint8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) @@ -13988,7 +10886,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(1) @@ -14057,7 +10955,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1235) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -14072,7 +10970,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1245) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1240) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -14085,7 +10983,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1253) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1248) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(libc.Int32FromUint8((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -14100,7 +10998,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1259) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -14115,7 +11013,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1269) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1264) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -14132,11 +11030,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1279) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1274) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -14145,7 +11043,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1289) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1284) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -14192,7 +11090,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1293, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1288, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -14222,8 +11120,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1302, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1200) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1207) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1297, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1195) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -14242,16 +11140,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = uint8(0) - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1312) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1307) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1323) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1318) == 0 { rc = 0 } } @@ -14293,10 +11191,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1327, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1322, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1331, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1326, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -14317,11 +11215,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1335, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1330, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1347, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1342, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -14359,7 +11257,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1172, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 11))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1167, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -14439,7 +11337,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -14596,7 +11494,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(16)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(17)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(18)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(19)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[32]uint8)(unsafe.Pointer(bp + 48)))[int32(20)] = uint8('.') @@ -14644,7 +11542,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(4)] = libc.Uint8FromInt32(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(5)] = uint8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(6)] = libc.Uint8FromInt32(int32('0') + s/int32(10000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(7)] = libc.Uint8FromInt32(int32('0') + s/int32(1000)%int32(10)) (*(*[16]uint8)(unsafe.Pointer(bp + 48)))[int32(8)] = uint8('.') @@ -14749,7 +11647,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -14836,9 +11734,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if libc.Int32FromUint8(cf) == int32('d') { - v3 = __ccgo_ts + 1359 + v3 = __ccgo_ts + 1354 } else { - v3 = __ccgo_ts + 1364 + v3 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -14846,9 +11744,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1368, libc.VaList(bp+184, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1363, libc.VaList(bp+184, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1375, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -14858,17 +11756,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FvalidYMD = uint8(0) _computeYMD(tls, bp+80) if libc.Int32FromUint8(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) } case int32('H'): fallthrough case int32('k'): if libc.Int32FromUint8(cf) == int32('H') { - v4 = __ccgo_ts + 1359 + v4 = __ccgo_ts + 1354 } else { - v4 = __ccgo_ts + 1364 + v4 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -14882,50 +11780,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if libc.Int32FromUint8(cf) == int32('I') { - v5 = __ccgo_ts + 1359 + v5 = __ccgo_ts + 1354 } else { - v5 = __ccgo_ts + 1364 + v5 = __ccgo_ts + 1359 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+184, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1400, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1395, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if libc.Int32FromUint8(cf) == int32('p') { - v6 = __ccgo_ts + 1406 + v6 = __ccgo_ts + 1401 } else { - v6 = __ccgo_ts + 1409 + v6 = __ccgo_ts + 1404 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if libc.Int32FromUint8(cf) == int32('p') { - v7 = __ccgo_ts + 1412 + v7 = __ccgo_ts + 1407 } else { - v7 = __ccgo_ts + 1415 + v7 = __ccgo_ts + 1410 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1418, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1413, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1423, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+184, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1428, libc.VaList(bp+184, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1438, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1433, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -14935,18 +11833,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 128)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 128))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 128))).FvalidYMD = uint8(0) _computeYMD(tls, bp+128) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1359, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1354, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1390, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1385, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), uint8('%')) default: @@ -15102,7 +12000,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1453, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1448, libc.VaList(bp+136, libc.Int32FromUint8(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -15135,55 +12033,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1259, + FzName: __ccgo_ts + 1254, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1279, + FzName: __ccgo_ts + 1274, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1487, + FzName: __ccgo_ts + 1482, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1492, + FzName: __ccgo_ts + 1487, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1497, + FzName: __ccgo_ts + 1492, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1506, + FzName: __ccgo_ts + 1501, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1515, + FzName: __ccgo_ts + 1510, }, 7: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1524, + FzName: __ccgo_ts + 1519, }, 8: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1537, + FzName: __ccgo_ts + 1532, }, 9: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1555, + FzName: __ccgo_ts + 1550, }, } @@ -15265,28 +12163,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -15294,19 +12192,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -15323,12 +12221,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -15336,7 +12234,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -15349,34 +12247,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -15478,7 +12376,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -15689,14 +12587,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -15711,9 +12602,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -15854,7 +12745,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1568, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1563, libc.VaList(bp+8, nByte)) } return p } @@ -15916,7 +12807,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1606, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1601, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -16127,7 +13018,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -16147,9 +13042,11 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld + _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) + _sqlite3MemoryBarrier(tls) return rc } @@ -16332,40 +13229,320 @@ func init() { *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_noopMutexLeave) } +type Tpthread_t = uintptr + +type pthread_t = Tpthread_t + +type Tpthread_once_t = int32 + +type pthread_once_t = Tpthread_once_t + +type Tpthread_key_t = uint32 + +type pthread_key_t = Tpthread_key_t + +type Tpthread_spinlock_t = int32 + +type pthread_spinlock_t = Tpthread_spinlock_t + +type Tpthread_mutexattr_t = struct { + F__attr uint32 +} + +type pthread_mutexattr_t = Tpthread_mutexattr_t + +type Tpthread_condattr_t = struct { + F__attr uint32 +} + +type pthread_condattr_t = Tpthread_condattr_t + +type Tpthread_barrierattr_t = struct { + F__attr uint32 +} + +type pthread_barrierattr_t = Tpthread_barrierattr_t + +type Tpthread_rwlockattr_t = struct { + F__attr [2]uint32 +} + +type pthread_rwlockattr_t = Tpthread_rwlockattr_t + +type Tsigset_t = struct { + F__bits [16]uint64 +} + +type sigset_t = Tsigset_t + +type t__sigset_t = Tsigset_t + +type Tpthread_attr_t = struct { + F__u struct { + F__vi [0][14]int32 + F__s [0][7]uint64 + F__i [14]int32 + } +} + +type pthread_attr_t = Tpthread_attr_t + +type Tpthread_mutex_t = struct { + F__u struct { + F__vi [0][10]int32 + F__p [0][5]uintptr + F__i [10]int32 + } +} + +type pthread_mutex_t = Tpthread_mutex_t + +type Tpthread_cond_t = struct { + F__u struct { + F__vi [0][12]int32 + F__p [0][6]uintptr + F__i [12]int32 + } +} + +type pthread_cond_t = Tpthread_cond_t + +type Tpthread_rwlock_t = struct { + F__u struct { + F__vi [0][14]int32 + F__p [0][7]uintptr + F__i [14]int32 + } +} + +type pthread_rwlock_t = Tpthread_rwlock_t + +type Tpthread_barrier_t = struct { + F__u struct { + F__vi [0][8]int32 + F__p [0][4]uintptr + F__i [8]int32 + } +} + +type pthread_barrier_t = Tpthread_barrier_t + +type Tsched_param = struct { + Fsched_priority int32 + F__reserved1 int32 + F__reserved2 [2]struct { + F__reserved1 Ttime_t + F__reserved2 int64 + } + F__reserved3 int32 +} + +type sched_param = Tsched_param + +type Tcpu_set_t = struct { + F__bits [16]uint64 +} + +type cpu_set_t = Tcpu_set_t + +type t__ptcb = struct { + F__f uintptr + F__x uintptr + F__next uintptr +} + +/* +** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are +** intended for use only inside assert() statements. On some platforms, +** there might be race conditions that can cause these routines to +** deliver incorrect results. In particular, if pthread_equal() is +** not an atomic operation, then these routines might delivery +** incorrect results. On most platforms, pthread_equal() is a +** comparison of two integers and is therefore atomic. But we are +** told that HPUX is not such a platform. If so, then these routines +** will not always work correctly on HPUX. +** +** On those platforms where pthread_equal() is not atomic, SQLite +** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to +** make sure no assert() statements are evaluated and hence these +** routines are never called. + */ + +// C documentation +// +// /* +// ** Try to provide a memory barrier operation, needed for initialization +// ** and also for the implementation of xShmBarrier in the VFS in cases +// ** where SQLite is compiled without mutexes. +// */ +func _sqlite3MemoryBarrier(tls *libc.TLS) { + libc.X__sync_synchronize(tls) +} + +// C documentation +// +// /* +// ** Initialize and deinitialize the mutex subsystem. +// */ +func _pthreadMutexInit(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +func _pthreadMutexEnd(tls *libc.TLS) (r int32) { + return SQLITE_OK +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_alloc() routine allocates a new +// ** mutex and returns a pointer to it. If it returns NULL +// ** that means that a mutex could not be allocated. SQLite +// ** will unwind its stack and return an error. The argument +// ** to sqlite3_mutex_alloc() is one of these integer constants: +// ** +// **
      +// **
    • SQLITE_MUTEX_FAST +// **
    • SQLITE_MUTEX_RECURSIVE +// **
    • SQLITE_MUTEX_STATIC_MAIN +// **
    • SQLITE_MUTEX_STATIC_MEM +// **
    • SQLITE_MUTEX_STATIC_OPEN +// **
    • SQLITE_MUTEX_STATIC_PRNG +// **
    • SQLITE_MUTEX_STATIC_LRU +// **
    • SQLITE_MUTEX_STATIC_PMEM +// **
    • SQLITE_MUTEX_STATIC_APP1 +// **
    • SQLITE_MUTEX_STATIC_APP2 +// **
    • SQLITE_MUTEX_STATIC_APP3 +// **
    • SQLITE_MUTEX_STATIC_VFS1 +// **
    • SQLITE_MUTEX_STATIC_VFS2 +// **
    • SQLITE_MUTEX_STATIC_VFS3 +// **
    +// ** +// ** The first two constants cause sqlite3_mutex_alloc() to create +// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE +// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. +// ** The mutex implementation does not need to make a distinction +// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does +// ** not want to. But SQLite will only request a recursive mutex in +// ** cases where it really needs one. If a faster non-recursive mutex +// ** implementation is available on the host platform, the mutex subsystem +// ** might return such a mutex in response to SQLITE_MUTEX_FAST. +// ** +// ** The other allowed parameters to sqlite3_mutex_alloc() each return +// ** a pointer to a static preexisting mutex. Six static mutexes are +// ** used by the current version of SQLite. Future versions of SQLite +// ** may add additional static mutexes. Static mutexes are for internal +// ** use by SQLite only. Applications that use SQLite mutexes should +// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or +// ** SQLITE_MUTEX_RECURSIVE. +// ** +// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST +// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() +// ** returns a different mutex on every call. But for the static +// ** mutex types, the same mutex is returned on every call that has +// ** the same type number. +// */ +func _pthreadMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { + bp := tls.Alloc(16) + defer tls.Free(16) + var p uintptr + var _ /* recursiveAttr at bp+0 */ Tpthread_mutexattr_t + _ = p + switch iType { + case int32(SQLITE_MUTEX_RECURSIVE): + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutexattr_init(tls, bp) + libc.Xpthread_mutexattr_settype(tls, bp, int32(PTHREAD_MUTEX_RECURSIVE)) + libc.Xpthread_mutex_init(tls, p, bp) + libc.Xpthread_mutexattr_destroy(tls, bp) + } + case SQLITE_MUTEX_FAST: + p = _sqlite3MallocZero(tls, uint64(40)) + if p != 0 { + libc.Xpthread_mutex_init(tls, p, uintptr(0)) + } + default: + p = uintptr(unsafe.Pointer(&_staticMutexes)) + uintptr(iType-int32(2))*40 + break + } + return p +} + +var _staticMutexes = [12]Tsqlite3_mutex{} + +// C documentation +// +// /* +// ** This routine deallocates a previously +// ** allocated mutex. SQLite is careful to deallocate every +// ** mutex that it allocates. +// */ +func _pthreadMutexFree(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_destroy(tls, p) + Xsqlite3_free(tls, p) +} + +// C documentation +// +// /* +// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt +// ** to enter a mutex. If another thread is already within the mutex, +// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return +// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK +// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can +// ** be entered multiple times by the same thread. In such cases the, +// ** mutex must be exited an equal number of times before another thread +// ** can enter. If the same thread tries to enter any other kind of mutex +// ** more than once, the behavior is undefined. +// */ +func _pthreadMutexEnter(tls *libc.TLS, p uintptr) { + /* Use the built-in recursive mutexes if they are available. + */ + libc.Xpthread_mutex_lock(tls, p) +} + +func _pthreadMutexTry(tls *libc.TLS, p uintptr) (r int32) { + var rc int32 + _ = rc + /* Use the built-in recursive mutexes if they are available. + */ + if libc.Xpthread_mutex_trylock(tls, p) == 0 { + rc = SQLITE_OK + } else { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* -// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation -// ** is used regardless of the run-time threadsafety setting. +// ** The sqlite3_mutex_leave() routine exits a mutex that was +// ** previously entered by the same thread. The behavior +// ** is undefined if the mutex is not currently entered or +// ** is not currently allocated. SQLite will never do either. // */ +func _pthreadMutexLeave(tls *libc.TLS, p uintptr) { + libc.Xpthread_mutex_unlock(tls, p) +} + func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return _sqlite3NoopMutex(tls) + return uintptr(unsafe.Pointer(&_sMutex1)) } -/************** End of mutex_noop.c ******************************************/ -/************** Begin file mutex_unix.c **************************************/ -/* -** 2007 August 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the C functions that implement mutexes for pthreads - */ -/* #include "sqliteInt.h" */ +var _sMutex1 = Tsqlite3_mutex_methods{} -/* -** The code in this file is only used if we are compiling threadsafe -** under unix with pthreads. -** -** Note that this implementation requires a version of pthreads that -** supports recursive mutexes. - */ +func init() { + p := unsafe.Pointer(&_sMutex1) + *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_pthreadMutexInit) + *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_pthreadMutexEnd) + *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_pthreadMutexAlloc) + *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_pthreadMutexFree) + *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_pthreadMutexEnter) + *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_pthreadMutexTry) + *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_pthreadMutexLeave) +} /************** End of mutex_unix.c ******************************************/ /************** Begin file mutex_w32.c ***************************************/ @@ -16457,6 +13634,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -16464,8 +13643,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -17284,7 +14463,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -17452,17 +14631,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: uint8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: uint8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: uint8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: uint8('c'), @@ -17659,22 +14838,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 uint8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 uint8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]uint8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -17706,7 +14886,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1656, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1651, int32(1)) break } /* Find out what flags are present */ @@ -17923,11 +15103,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -17955,7 +15135,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { v = libc.VaInt64(&ap) } else { - v = libc.VaInt64(&ap) + v = int64(libc.VaInt64(&ap)) } } else { v = int64(libc.VaInt32(&ap)) @@ -17977,7 +15157,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if libc.Int32FromUint8(flag_long) == int32(2) { longvalue = libc.VaUint64(&ap) } else { - longvalue = libc.VaUint64(&ap) + longvalue = uint64(libc.VaUint64(&ap)) } } else { longvalue = uint64(libc.VaUint32(&ap)) @@ -18121,9 +15301,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1658 + v57 = __ccgo_ts + 1653 } else { - v57 = __ccgo_ts + 1663 + v57 = __ccgo_ts + 1658 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -18134,7 +15314,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1667, uint64(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1662, uint64(5)) bufpt = bp if libc.Int32FromUint8((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -18404,29 +15584,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = uint8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]uint8)(unsafe.Pointer(bp)))[0] = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(1)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(2)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]uint8)(unsafe.Pointer(bp)))[int32(3)] = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -18467,7 +15625,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1672 + bufpt = __ccgo_ts + 1667 } else { if libc.Int32FromUint8(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && libc.Int32FromUint8((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -18541,25 +15699,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = libc.Uint8FromInt32(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1673 + if escarg == uintptr(0) { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1668 } else { - v98 = __ccgo_ts + 1678 + v97 = __ccgo_ts + 1673 } - escarg = v98 + escarg = v97 + } else { + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) + } + } + if libc.Int32FromUint8(xtype) == int32(etESCAPE_w) { + q = uint8('"') + flag_alternateform = uint8(0) + } else { + q = uint8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -18567,15 +15729,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && libc.Int32FromUint8(v101) != 0) { + if !(v101 && libc.Int32FromUint8(v100) != 0) { break } if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { @@ -18586,13 +15748,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && libc.Int32FromUint8(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || libc.Int32FromUint8(xtype) == int32(etESCAPE_q) { + n1 += libc.Int64FromUint32(nBack + uint32(5)*nCtrl) + if libc.Int32FromUint8(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -18606,35 +15801,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1680, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v104))) = uint8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v108 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if libc.Int32FromUint8(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = uint8('\\') + } else { + if libc.Int32FromUint8(ch1) <= int32(0x1f) { + *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = uint8('\\') + v110 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v110))) = uint8('u') + v111 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v111))) = uint8('0') + v112 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v112))) = uint8('0') + v113 = j1 + j1++ + if libc.Int32FromUint8(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v113))) = libc.Uint8FromInt32(v114) + v115 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*uint8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if libc.Int32FromUint8(ch1) == libc.Int32FromUint8(q) { + v119 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*uint8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v120))) = uint8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*uint8)(unsafe.Pointer(bufpt + uintptr(v121))) = uint8(')') + } } *(*uint8)(unsafe.Pointer(bufpt + uintptr(j1))) = uint8(0) length = int32(j1) @@ -18659,9 +15917,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -18675,7 +15933,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1685, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1706, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -18685,21 +15943,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1687, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1708, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1697, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1718, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1739, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -18938,7 +16196,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -18974,7 +16232,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if libc.Int32FromUint8((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1672, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -19237,6 +16495,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -19254,11 +16514,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]uint8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]uint8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -19692,76 +16952,34 @@ func _sqlite3PrngRestoreState(tls *libc.TLS) { libc.Xmemcpy(tls, uintptr(unsafe.Pointer(&_sqlite3Prng)), uintptr(unsafe.Pointer(&_sqlite3SavedPrng)), uint64(132)) } -/************** End of random.c **********************************************/ -/************** Begin file threads.c *****************************************/ -/* -** 2012 July 21 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This file presents a simple cross-platform threading interface for -** use internally by SQLite. -** -** A "thread" can be created using sqlite3ThreadCreate(). This thread -** runs independently of its creator until it is joined using -** sqlite3ThreadJoin(), at which point it terminates. -** -** Threads do not have to be real. It could be that the work of the -** "thread" is done by the main thread at either the sqlite3ThreadCreate() -** or sqlite3ThreadJoin() call. This is, in fact, what happens in -** single threaded systems. Nothing in SQLite requires multiple threads. -** This interface exists so that applications that want to take advantage -** of multiple cores can do so, while also allowing applications to stay -** single-threaded if desired. - */ -/* #include "sqliteInt.h" */ - -/********************************* Unix Pthreads ****************************/ -/******************************** End Unix Pthreads *************************/ - -/********************************* Win32 Threads ****************************/ -/******************************** End Win32 Threads *************************/ - -/********************************* Single-Threaded **************************/ -/* -** This implementation does not actually create a new thread. It does the -** work of the thread in the main thread, when either the thread is created -** or when it is joined - */ - -/* A running thread */ -type TSQLiteThread1 = struct { - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr - _ = p + var rc int32 + _, _ = p, rc + /* This routine is never used in single-threaded mode */ *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) - p = _sqlite3Malloc(tls, uint64(24)) + p = _sqlite3Malloc(tls, uint64(40)) if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if int32(int64(p))/int32(17)&int32(1) != 0 { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask - (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + libc.Xmemset(tls, p, 0, uint64(40)) + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn + /* If the SQLITE_TESTCTRL_FAULT_INSTALL callback is registered to a + ** function that returns SQLITE_ERROR when passed the argument 200, that + ** forces worker threads to run sequentially and deterministically + ** for testing purposes. */ + if _sqlite3FaultSim(tls, int32(200)) != 0 { + rc = int32(1) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = uintptr(0) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + rc = libc.Xpthread_create(tls, p, uintptr(0), __ccgo_fp_xTask, pIn) + } + if rc != 0 { + (*TSQLiteThread)(unsafe.Pointer(p)).Fdone = int32(1) + (*TSQLiteThread)(unsafe.Pointer(p)).FpOut = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -19771,18 +16989,32 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui // // /* Get the results of the thread */ func _sqlite3ThreadJoin(tls *libc.TLS, p uintptr, ppOut uintptr) (r int32) { + var rc, v1 int32 + _, _ = rc, v1 if p == uintptr(0) { return int32(SQLITE_NOMEM) } - if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask != 0 { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{(*TSQLiteThread)(unsafe.Pointer(p)).FxTask})))(tls, (*TSQLiteThread)(unsafe.Pointer(p)).FpIn) + if (*TSQLiteThread)(unsafe.Pointer(p)).Fdone != 0 { + *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpOut + rc = SQLITE_OK } else { - *(*uintptr)(unsafe.Pointer(ppOut)) = (*TSQLiteThread)(unsafe.Pointer(p)).FpResult + if libc.Xpthread_join(tls, (*TSQLiteThread)(unsafe.Pointer(p)).Ftid, ppOut) != 0 { + v1 = int32(SQLITE_ERROR) + } else { + v1 = SQLITE_OK + } + rc = v1 } Xsqlite3_free(tls, p) - return SQLITE_OK + return rc } +/******************************** End Unix Pthreads *************************/ + +/********************************* Win32 Threads ****************************/ +/******************************** End Win32 Threads *************************/ + +/********************************* Single-Threaded **************************/ /****************************** End Single-Threaded *************************/ /************** End of threads.c *********************************************/ @@ -19892,6 +17124,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*uint8)(unsafe.Pointer(zOut)) = uint8(v & libc.Uint32FromInt32(0xff)) + return int32(1) + } + if v < uint32(0x00800) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xc0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xe0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*uint8)(unsafe.Pointer(zOut)) = libc.Uint8FromInt32(int32(0xf0) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*uint8)(unsafe.Pointer(zOut + 1)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 2)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*uint8)(unsafe.Pointer(zOut + 3)) = libc.Uint8FromInt32(int32(0x80) + libc.Int32FromUint8(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -20642,7 +17905,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -20817,7 +18080,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x04) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1))))])&libc.Int32FromInt32(0x08) != 0) || !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(pIn + 1))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1732, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1753, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -21029,11 +18292,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -21269,7 +18532,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -21359,7 +18622,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1757 + pow63 = __ccgo_ts + 1778 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -21586,7 +18849,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1776)) + n = libc.Int32FromUint64(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1797)) if *(*uint8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -21746,7 +19009,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1792 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1813 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = uint8('+') @@ -21855,7 +19118,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -22270,7 +19533,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1794, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1815, libc.VaList(bp+8, zType)) } // C documentation @@ -22293,13 +19556,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1673) + _logBadConnection(tls, __ccgo_ts+1668) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1839) + _logBadConnection(tls, __ccgo_ts+1860) } return 0 } else { @@ -22313,7 +19576,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_SICK) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_OPEN) && libc.Int32FromUint8(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1848) + _logBadConnection(tls, __ccgo_ts+1869) return 0 } else { return int32(1) @@ -22344,7 +19607,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -22695,23 +19958,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = *(*uint8)(unsafe.Pointer(v2)) - c = v1 - if !(libc.Int32FromUint8(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*uint8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += libc.Uint32FromInt32(int32(0xdf) & libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(v1)))) h *= uint32(0x9e3779b1) } return h @@ -22766,8 +20027,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -22800,9 +20061,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -22822,13 +20082,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -22836,7 +20095,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -22852,7 +20111,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -22864,7 +20123,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -22913,7 +20172,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -22923,20 +20182,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -22955,196 +20213,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1856, - 1: __ccgo_ts + 1866, - 2: __ccgo_ts + 1877, - 3: __ccgo_ts + 1889, - 4: __ccgo_ts + 1900, - 5: __ccgo_ts + 1912, - 6: __ccgo_ts + 1919, - 7: __ccgo_ts + 1927, - 8: __ccgo_ts + 1935, - 9: __ccgo_ts + 1940, - 10: __ccgo_ts + 1945, - 11: __ccgo_ts + 1951, - 12: __ccgo_ts + 1965, - 13: __ccgo_ts + 1971, - 14: __ccgo_ts + 1981, - 15: __ccgo_ts + 1986, - 16: __ccgo_ts + 1991, - 17: __ccgo_ts + 1994, - 18: __ccgo_ts + 2000, - 19: __ccgo_ts + 2007, - 20: __ccgo_ts + 2011, - 21: __ccgo_ts + 2021, - 22: __ccgo_ts + 2028, - 23: __ccgo_ts + 2035, - 24: __ccgo_ts + 2042, - 25: __ccgo_ts + 2049, - 26: __ccgo_ts + 2059, - 27: __ccgo_ts + 2068, - 28: __ccgo_ts + 2079, - 29: __ccgo_ts + 2088, - 30: __ccgo_ts + 2094, - 31: __ccgo_ts + 2104, - 32: __ccgo_ts + 2114, - 33: __ccgo_ts + 2119, - 34: __ccgo_ts + 2133, - 35: __ccgo_ts + 2144, - 36: __ccgo_ts + 2149, - 37: __ccgo_ts + 2156, - 38: __ccgo_ts + 2167, - 39: __ccgo_ts + 2172, - 40: __ccgo_ts + 2177, - 41: __ccgo_ts + 2183, - 42: __ccgo_ts + 2189, - 43: __ccgo_ts + 2195, - 44: __ccgo_ts + 2198, - 45: __ccgo_ts + 2202, - 46: __ccgo_ts + 2208, - 47: __ccgo_ts + 2219, - 48: __ccgo_ts + 2230, - 49: __ccgo_ts + 2238, - 50: __ccgo_ts + 2247, - 51: __ccgo_ts + 2253, - 52: __ccgo_ts + 2260, - 53: __ccgo_ts + 2268, - 54: __ccgo_ts + 2271, - 55: __ccgo_ts + 2274, - 56: __ccgo_ts + 2277, - 57: __ccgo_ts + 2280, - 58: __ccgo_ts + 2283, - 59: __ccgo_ts + 2286, - 60: __ccgo_ts + 2293, - 61: __ccgo_ts + 2303, - 62: __ccgo_ts + 2316, - 63: __ccgo_ts + 2327, - 64: __ccgo_ts + 2333, - 65: __ccgo_ts + 2340, - 66: __ccgo_ts + 2349, - 67: __ccgo_ts + 2358, - 68: __ccgo_ts + 2365, - 69: __ccgo_ts + 2378, - 70: __ccgo_ts + 2389, - 71: __ccgo_ts + 2394, - 72: __ccgo_ts + 2402, - 73: __ccgo_ts + 2408, - 74: __ccgo_ts + 2415, - 75: __ccgo_ts + 2427, - 76: __ccgo_ts + 2432, - 77: __ccgo_ts + 2441, - 78: __ccgo_ts + 2446, - 79: __ccgo_ts + 2455, - 80: __ccgo_ts + 2460, - 81: __ccgo_ts + 2465, - 82: __ccgo_ts + 2471, - 83: __ccgo_ts + 2479, - 84: __ccgo_ts + 2487, - 85: __ccgo_ts + 2497, - 86: __ccgo_ts + 2505, - 87: __ccgo_ts + 2512, - 88: __ccgo_ts + 2525, - 89: __ccgo_ts + 2530, - 90: __ccgo_ts + 2542, - 91: __ccgo_ts + 2550, - 92: __ccgo_ts + 2557, - 93: __ccgo_ts + 2568, - 94: __ccgo_ts + 2575, - 95: __ccgo_ts + 2582, - 96: __ccgo_ts + 2592, - 97: __ccgo_ts + 2601, - 98: __ccgo_ts + 2612, - 99: __ccgo_ts + 2618, - 100: __ccgo_ts + 2629, - 101: __ccgo_ts + 2639, - 102: __ccgo_ts + 2649, - 103: __ccgo_ts + 2658, - 104: __ccgo_ts + 2665, - 105: __ccgo_ts + 2671, - 106: __ccgo_ts + 2681, - 107: __ccgo_ts + 2692, - 108: __ccgo_ts + 2696, - 109: __ccgo_ts + 2705, - 110: __ccgo_ts + 2714, - 111: __ccgo_ts + 2721, - 112: __ccgo_ts + 2731, - 113: __ccgo_ts + 2738, - 114: __ccgo_ts + 2748, - 115: __ccgo_ts + 2756, - 116: __ccgo_ts + 2763, - 117: __ccgo_ts + 2777, - 118: __ccgo_ts + 2791, - 119: __ccgo_ts + 2799, - 120: __ccgo_ts + 2810, - 121: __ccgo_ts + 2823, - 122: __ccgo_ts + 2834, - 123: __ccgo_ts + 2840, - 124: __ccgo_ts + 2852, - 125: __ccgo_ts + 2861, - 126: __ccgo_ts + 2869, - 127: __ccgo_ts + 2878, - 128: __ccgo_ts + 2887, - 129: __ccgo_ts + 2894, - 130: __ccgo_ts + 2902, - 131: __ccgo_ts + 2909, - 132: __ccgo_ts + 2920, - 133: __ccgo_ts + 2934, - 134: __ccgo_ts + 2945, - 135: __ccgo_ts + 2953, - 136: __ccgo_ts + 2959, - 137: __ccgo_ts + 2967, - 138: __ccgo_ts + 2975, - 139: __ccgo_ts + 2985, - 140: __ccgo_ts + 2998, - 141: __ccgo_ts + 3008, - 142: __ccgo_ts + 3021, - 143: __ccgo_ts + 3030, - 144: __ccgo_ts + 3041, - 145: __ccgo_ts + 3049, - 146: __ccgo_ts + 3055, - 147: __ccgo_ts + 3067, - 148: __ccgo_ts + 3079, - 149: __ccgo_ts + 3087, - 150: __ccgo_ts + 3099, - 151: __ccgo_ts + 3112, - 152: __ccgo_ts + 3122, - 153: __ccgo_ts + 3132, - 154: __ccgo_ts + 3144, - 155: __ccgo_ts + 3149, - 156: __ccgo_ts + 3161, - 157: __ccgo_ts + 3171, - 158: __ccgo_ts + 3177, - 159: __ccgo_ts + 3187, - 160: __ccgo_ts + 3194, - 161: __ccgo_ts + 3206, - 162: __ccgo_ts + 3217, - 163: __ccgo_ts + 3225, - 164: __ccgo_ts + 3234, - 165: __ccgo_ts + 3243, - 166: __ccgo_ts + 3252, - 167: __ccgo_ts + 3259, - 168: __ccgo_ts + 3270, - 169: __ccgo_ts + 3283, - 170: __ccgo_ts + 3293, - 171: __ccgo_ts + 3300, - 172: __ccgo_ts + 3308, - 173: __ccgo_ts + 3317, - 174: __ccgo_ts + 3323, - 175: __ccgo_ts + 3330, - 176: __ccgo_ts + 3338, - 177: __ccgo_ts + 3346, - 178: __ccgo_ts + 3354, - 179: __ccgo_ts + 3364, - 180: __ccgo_ts + 3373, - 181: __ccgo_ts + 3384, - 182: __ccgo_ts + 3395, - 183: __ccgo_ts + 3406, - 184: __ccgo_ts + 3416, - 185: __ccgo_ts + 3422, - 186: __ccgo_ts + 3433, - 187: __ccgo_ts + 3444, - 188: __ccgo_ts + 3449, - 189: __ccgo_ts + 3457, + 0: __ccgo_ts + 1877, + 1: __ccgo_ts + 1887, + 2: __ccgo_ts + 1898, + 3: __ccgo_ts + 1910, + 4: __ccgo_ts + 1921, + 5: __ccgo_ts + 1933, + 6: __ccgo_ts + 1940, + 7: __ccgo_ts + 1948, + 8: __ccgo_ts + 1956, + 9: __ccgo_ts + 1961, + 10: __ccgo_ts + 1966, + 11: __ccgo_ts + 1972, + 12: __ccgo_ts + 1986, + 13: __ccgo_ts + 1992, + 14: __ccgo_ts + 2002, + 15: __ccgo_ts + 2007, + 16: __ccgo_ts + 2012, + 17: __ccgo_ts + 2015, + 18: __ccgo_ts + 2021, + 19: __ccgo_ts + 2028, + 20: __ccgo_ts + 2032, + 21: __ccgo_ts + 2042, + 22: __ccgo_ts + 2049, + 23: __ccgo_ts + 2056, + 24: __ccgo_ts + 2063, + 25: __ccgo_ts + 2070, + 26: __ccgo_ts + 2080, + 27: __ccgo_ts + 2089, + 28: __ccgo_ts + 2100, + 29: __ccgo_ts + 2109, + 30: __ccgo_ts + 2115, + 31: __ccgo_ts + 2125, + 32: __ccgo_ts + 2135, + 33: __ccgo_ts + 2140, + 34: __ccgo_ts + 2154, + 35: __ccgo_ts + 2165, + 36: __ccgo_ts + 2170, + 37: __ccgo_ts + 2177, + 38: __ccgo_ts + 2188, + 39: __ccgo_ts + 2193, + 40: __ccgo_ts + 2198, + 41: __ccgo_ts + 2204, + 42: __ccgo_ts + 2210, + 43: __ccgo_ts + 2216, + 44: __ccgo_ts + 2219, + 45: __ccgo_ts + 2223, + 46: __ccgo_ts + 2229, + 47: __ccgo_ts + 2240, + 48: __ccgo_ts + 2251, + 49: __ccgo_ts + 2259, + 50: __ccgo_ts + 2268, + 51: __ccgo_ts + 2274, + 52: __ccgo_ts + 2281, + 53: __ccgo_ts + 2289, + 54: __ccgo_ts + 2292, + 55: __ccgo_ts + 2295, + 56: __ccgo_ts + 2298, + 57: __ccgo_ts + 2301, + 58: __ccgo_ts + 2304, + 59: __ccgo_ts + 2307, + 60: __ccgo_ts + 2314, + 61: __ccgo_ts + 2324, + 62: __ccgo_ts + 2337, + 63: __ccgo_ts + 2348, + 64: __ccgo_ts + 2354, + 65: __ccgo_ts + 2361, + 66: __ccgo_ts + 2370, + 67: __ccgo_ts + 2379, + 68: __ccgo_ts + 2386, + 69: __ccgo_ts + 2399, + 70: __ccgo_ts + 2410, + 71: __ccgo_ts + 2415, + 72: __ccgo_ts + 2423, + 73: __ccgo_ts + 2429, + 74: __ccgo_ts + 2436, + 75: __ccgo_ts + 2448, + 76: __ccgo_ts + 2453, + 77: __ccgo_ts + 2462, + 78: __ccgo_ts + 2467, + 79: __ccgo_ts + 2476, + 80: __ccgo_ts + 2481, + 81: __ccgo_ts + 2486, + 82: __ccgo_ts + 2492, + 83: __ccgo_ts + 2500, + 84: __ccgo_ts + 2508, + 85: __ccgo_ts + 2518, + 86: __ccgo_ts + 2526, + 87: __ccgo_ts + 2533, + 88: __ccgo_ts + 2546, + 89: __ccgo_ts + 2551, + 90: __ccgo_ts + 2563, + 91: __ccgo_ts + 2571, + 92: __ccgo_ts + 2578, + 93: __ccgo_ts + 2589, + 94: __ccgo_ts + 2596, + 95: __ccgo_ts + 2603, + 96: __ccgo_ts + 2613, + 97: __ccgo_ts + 2622, + 98: __ccgo_ts + 2633, + 99: __ccgo_ts + 2639, + 100: __ccgo_ts + 2650, + 101: __ccgo_ts + 2660, + 102: __ccgo_ts + 2670, + 103: __ccgo_ts + 2679, + 104: __ccgo_ts + 2686, + 105: __ccgo_ts + 2692, + 106: __ccgo_ts + 2702, + 107: __ccgo_ts + 2713, + 108: __ccgo_ts + 2717, + 109: __ccgo_ts + 2726, + 110: __ccgo_ts + 2735, + 111: __ccgo_ts + 2742, + 112: __ccgo_ts + 2752, + 113: __ccgo_ts + 2759, + 114: __ccgo_ts + 2769, + 115: __ccgo_ts + 2777, + 116: __ccgo_ts + 2784, + 117: __ccgo_ts + 2798, + 118: __ccgo_ts + 2812, + 119: __ccgo_ts + 2820, + 120: __ccgo_ts + 2831, + 121: __ccgo_ts + 2844, + 122: __ccgo_ts + 2855, + 123: __ccgo_ts + 2861, + 124: __ccgo_ts + 2873, + 125: __ccgo_ts + 2882, + 126: __ccgo_ts + 2890, + 127: __ccgo_ts + 2899, + 128: __ccgo_ts + 2908, + 129: __ccgo_ts + 2915, + 130: __ccgo_ts + 2923, + 131: __ccgo_ts + 2930, + 132: __ccgo_ts + 2941, + 133: __ccgo_ts + 2955, + 134: __ccgo_ts + 2966, + 135: __ccgo_ts + 2974, + 136: __ccgo_ts + 2980, + 137: __ccgo_ts + 2988, + 138: __ccgo_ts + 2996, + 139: __ccgo_ts + 3006, + 140: __ccgo_ts + 3019, + 141: __ccgo_ts + 3029, + 142: __ccgo_ts + 3042, + 143: __ccgo_ts + 3051, + 144: __ccgo_ts + 3062, + 145: __ccgo_ts + 3070, + 146: __ccgo_ts + 3076, + 147: __ccgo_ts + 3088, + 148: __ccgo_ts + 3100, + 149: __ccgo_ts + 3108, + 150: __ccgo_ts + 3120, + 151: __ccgo_ts + 3133, + 152: __ccgo_ts + 3143, + 153: __ccgo_ts + 3153, + 154: __ccgo_ts + 3165, + 155: __ccgo_ts + 3170, + 156: __ccgo_ts + 3182, + 157: __ccgo_ts + 3192, + 158: __ccgo_ts + 3198, + 159: __ccgo_ts + 3208, + 160: __ccgo_ts + 3215, + 161: __ccgo_ts + 3227, + 162: __ccgo_ts + 3238, + 163: __ccgo_ts + 3246, + 164: __ccgo_ts + 3255, + 165: __ccgo_ts + 3264, + 166: __ccgo_ts + 3273, + 167: __ccgo_ts + 3280, + 168: __ccgo_ts + 3291, + 169: __ccgo_ts + 3304, + 170: __ccgo_ts + 3314, + 171: __ccgo_ts + 3321, + 172: __ccgo_ts + 3329, + 173: __ccgo_ts + 3338, + 174: __ccgo_ts + 3344, + 175: __ccgo_ts + 3351, + 176: __ccgo_ts + 3359, + 177: __ccgo_ts + 3367, + 178: __ccgo_ts + 3375, + 179: __ccgo_ts + 3385, + 180: __ccgo_ts + 3394, + 181: __ccgo_ts + 3405, + 182: __ccgo_ts + 3416, + 183: __ccgo_ts + 3427, + 184: __ccgo_ts + 3437, + 185: __ccgo_ts + 3443, + 186: __ccgo_ts + 3454, + 187: __ccgo_ts + 3465, + 188: __ccgo_ts + 3470, + 189: __ccgo_ts + 3478, } type Tregister_t = int64 @@ -23227,96 +20485,6 @@ type Tuseconds_t = uint32 type useconds_t = Tuseconds_t -type Tpthread_t = uintptr - -type pthread_t = Tpthread_t - -type Tpthread_once_t = int32 - -type pthread_once_t = Tpthread_once_t - -type Tpthread_key_t = uint32 - -type pthread_key_t = Tpthread_key_t - -type Tpthread_spinlock_t = int32 - -type pthread_spinlock_t = Tpthread_spinlock_t - -type Tpthread_mutexattr_t = struct { - F__attr uint32 -} - -type pthread_mutexattr_t = Tpthread_mutexattr_t - -type Tpthread_condattr_t = struct { - F__attr uint32 -} - -type pthread_condattr_t = Tpthread_condattr_t - -type Tpthread_barrierattr_t = struct { - F__attr uint32 -} - -type pthread_barrierattr_t = Tpthread_barrierattr_t - -type Tpthread_rwlockattr_t = struct { - F__attr [2]uint32 -} - -type pthread_rwlockattr_t = Tpthread_rwlockattr_t - -type Tpthread_attr_t = struct { - F__u struct { - F__vi [0][14]int32 - F__s [0][7]uint64 - F__i [14]int32 - } -} - -type pthread_attr_t = Tpthread_attr_t - -type Tpthread_mutex_t = struct { - F__u struct { - F__vi [0][10]int32 - F__p [0][5]uintptr - F__i [10]int32 - } -} - -type pthread_mutex_t = Tpthread_mutex_t - -type Tpthread_cond_t = struct { - F__u struct { - F__vi [0][12]int32 - F__p [0][6]uintptr - F__i [12]int32 - } -} - -type pthread_cond_t = Tpthread_cond_t - -type Tpthread_rwlock_t = struct { - F__u struct { - F__vi [0][14]int32 - F__p [0][7]uintptr - F__i [14]int32 - } -} - -type pthread_rwlock_t = Tpthread_rwlock_t - -type Tpthread_barrier_t = struct { - F__u struct { - F__vi [0][8]int32 - F__p [0][4]uintptr - F__i [8]int32 - } -} - -type pthread_barrier_t = Tpthread_barrier_t - type Tu_int8_t = uint8 type u_int8_t = Tu_int8_t @@ -23388,14 +20556,6 @@ type Ttimeval = struct { type timeval = Ttimeval -type Tsigset_t = struct { - F__bits [16]uint64 -} - -type sigset_t = Tsigset_t - -type t__sigset_t = Tsigset_t - type Tfd_mask = uint64 type fd_mask = Tfd_mask @@ -23626,22 +20786,6 @@ type TUnixUnusedFd = struct { type UnixUnusedFd = TUnixUnusedFd -/* An unused file descriptor */ - -/* -** Sometimes, after a file handle is closed by SQLite, the file descriptor -** cannot be closed immediately. In these cases, instances of the following -** structure are used to store the file descriptor while waiting for an -** opportunity to either close or reuse it. - */ -type TUnixUnusedFd1 = struct { - Ffd int32 - Fflags int32 - FpNext uintptr -} - -type UnixUnusedFd1 = TUnixUnusedFd1 - // C documentation // // /* @@ -23672,30 +20816,6 @@ type TunixFile = struct { type unixFile = TunixFile -type TunixFile1 = struct { - FpMethod uintptr - FpVfs uintptr - FpInode uintptr - Fh int32 - FeFileLock uint8 - FctrlFlags uint16 - FlastErrno int32 - FlockingContext uintptr - FpPreallocatedUnused uintptr - FzPath uintptr - FpShm uintptr - FszChunk int32 - FnFetchOut int32 - FmmapSize Tsqlite3_int64 - FmmapSizeActual Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 - FpMapRegion uintptr - FsectorSize int32 - FdeviceCharacteristics int32 -} - -type unixFile1 = TunixFile1 - // C documentation // // /* This variable holds the process id (pid) from when the xRandomness() @@ -23777,91 +20897,91 @@ type unix_syscall = Tunix_syscall // */ var _aSyscall = [29]Tunix_syscall{ 0: { - FzName: __ccgo_ts + 3467, + FzName: __ccgo_ts + 3488, }, 1: { - FzName: __ccgo_ts + 3472, + FzName: __ccgo_ts + 3493, }, 2: { - FzName: __ccgo_ts + 3478, + FzName: __ccgo_ts + 3499, }, 3: { - FzName: __ccgo_ts + 3485, + FzName: __ccgo_ts + 3506, }, 4: { - FzName: __ccgo_ts + 3492, + FzName: __ccgo_ts + 3513, }, 5: { - FzName: __ccgo_ts + 3497, + FzName: __ccgo_ts + 3518, }, 6: { - FzName: __ccgo_ts + 3503, + FzName: __ccgo_ts + 3524, }, 7: { - FzName: __ccgo_ts + 3513, + FzName: __ccgo_ts + 3534, }, 8: { - FzName: __ccgo_ts + 3519, + FzName: __ccgo_ts + 3540, }, 9: { - FzName: __ccgo_ts + 3524, + FzName: __ccgo_ts + 3545, }, 10: { - FzName: __ccgo_ts + 3530, + FzName: __ccgo_ts + 3551, }, 11: { - FzName: __ccgo_ts + 3538, + FzName: __ccgo_ts + 3559, }, 12: { - FzName: __ccgo_ts + 3544, + FzName: __ccgo_ts + 3565, }, 13: { - FzName: __ccgo_ts + 3551, + FzName: __ccgo_ts + 3572, }, 14: { - FzName: __ccgo_ts + 3560, + FzName: __ccgo_ts + 3581, }, 15: { - FzName: __ccgo_ts + 3567, + FzName: __ccgo_ts + 3588, }, 16: { - FzName: __ccgo_ts + 3577, + FzName: __ccgo_ts + 3598, }, 17: { - FzName: __ccgo_ts + 3584, + FzName: __ccgo_ts + 3605, }, 18: { - FzName: __ccgo_ts + 3598, + FzName: __ccgo_ts + 3619, }, 19: { - FzName: __ccgo_ts + 3604, + FzName: __ccgo_ts + 3625, }, 20: { - FzName: __ccgo_ts + 3610, + FzName: __ccgo_ts + 3631, }, 21: { - FzName: __ccgo_ts + 3617, + FzName: __ccgo_ts + 3638, }, 22: { - FzName: __ccgo_ts + 3625, + FzName: __ccgo_ts + 3646, }, 23: { - FzName: __ccgo_ts + 3630, + FzName: __ccgo_ts + 3651, }, 24: { - FzName: __ccgo_ts + 3637, + FzName: __ccgo_ts + 3658, }, 25: { - FzName: __ccgo_ts + 3644, + FzName: __ccgo_ts + 3665, }, 26: { - FzName: __ccgo_ts + 3656, + FzName: __ccgo_ts + 3677, }, 27: { - FzName: __ccgo_ts + 3665, + FzName: __ccgo_ts + 3686, }, 28: { - FzName: __ccgo_ts + 3671, + FzName: __ccgo_ts + 3692, }, } @@ -23922,7 +21042,7 @@ func _robustFchown(tls *libc.TLS, fd int32, uid Tuid_t, gid Tgid_t) (r int32) { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -23960,10 +21080,10 @@ func _unixSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -24100,9 +21220,9 @@ func _robust_open(tls *libc.TLS, z uintptr, f int32, m Tmode_t) (r int32) { (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(16)].FpCurrent})))(tls, z) } (*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(1)].FpCurrent})))(tls, fd) - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3677, libc.VaList(bp+152, z, fd)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3698, libc.VaList(bp+152, z, fd)) fd = -int32(1) - if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3720, O_RDONLY, libc.Int32FromUint32(m)) < 0 { + if (*(*func(*libc.TLS, uintptr, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls, __ccgo_ts+3741, O_RDONLY, libc.Int32FromUint32(m)) < 0 { break } } @@ -24338,47 +21458,6 @@ type TunixFileId = struct { type unixFileId = TunixFileId -/* -** An instance of the following structure is allocated for each open -** inode. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -** -** Mutex rules: -** -** (1) Only the pLockMutex mutex must be held in order to read or write -** any of the locking fields: -** nShared, nLock, eFileLock, bProcessLock, pUnused -** -** (2) When nRef>0, then the following fields are unchanging and can -** be read (but not written) without holding any mutex: -** fileId, pLockMutex -** -** (3) With the exceptions above, all the fields may only be read -** or written while holding the global unixBigLock mutex. -** -** Deadlock prevention: The global unixBigLock mutex may not -** be acquired while holding the pLockMutex mutex. If both unixBigLock -** and pLockMutex are needed, then unixBigLock must be acquired first. - */ -type TunixInodeInfo1 = struct { - FfileId TunixFileId - FpLockMutex uintptr - FnShared int32 - FnLock int32 - FeFileLock uint8 - FbProcessLock uint8 - FpUnused uintptr - FnRef int32 - FpShmNode uintptr - FpNext uintptr - FpPrev uintptr -} - -type unixInodeInfo1 = TunixInodeInfo1 - // C documentation // // /* @@ -24418,11 +21497,11 @@ func _unixLogErrorAtLine(tls *libc.TLS, errcode int32, zFunc uintptr, zPath uint ** equivalent to errno. Otherwise, use strerror_r(). */ /* This is a threadsafe build, but strerror_r() is not available. */ - zErr = __ccgo_ts + 1672 + zErr = __ccgo_ts + 1667 if zPath == uintptr(0) { - zPath = __ccgo_ts + 1672 + zPath = __ccgo_ts + 1667 } - Xsqlite3_log(tls, errcode, __ccgo_ts+3730, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) + Xsqlite3_log(tls, errcode, __ccgo_ts+3751, libc.VaList(bp+8, iLine, iErrno, zFunc, zPath, zErr)) return errcode } @@ -24450,7 +21529,7 @@ func _robust_close(tls *libc.TLS, pFile uintptr, h int32, lineno int32) { } else { v1 = uintptr(0) } - _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< uint64(1) { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3814, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3835, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } if _fileHasMoved(tls, pFile) != 0 { - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3841, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+3862, libc.VaList(bp+152, (*TunixFile)(unsafe.Pointer(pFile)).FzPath)) return } } @@ -25109,7 +22188,7 @@ func _closeUnixFile(tls *libc.TLS, id uintptr) (r int32) { pFile = id _unixUnmapfile(tls, pFile) if (*TunixFile)(unsafe.Pointer(pFile)).Fh >= 0 { - _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40743)) + _robust_close(tls, pFile, (*TunixFile)(unsafe.Pointer(pFile)).Fh, int32(40998)) (*TunixFile)(unsafe.Pointer(pFile)).Fh = -int32(1) } Xsqlite3_free(tls, (*TunixFile)(unsafe.Pointer(pFile)).FpPreallocatedUnused) @@ -25714,7 +22793,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { var _ /* zDirname at bp+0 */ [513]uint8 _, _ = fd, ii fd = -int32(1) - Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3869, libc.VaList(bp+528, zFilename)) + Xsqlite3_snprintf(tls, int32(MAX_PATHNAME), bp, __ccgo_ts+3890, libc.VaList(bp+528, zFilename)) ii = libc.Int32FromUint64(libc.Xstrlen(tls, bp)) for { if !(ii > 0 && libc.Int32FromUint8((*(*[513]uint8)(unsafe.Pointer(bp)))[ii]) != int32('/')) { @@ -25740,7 +22819,7 @@ func _openDirectory(tls *libc.TLS, zFilename uintptr, pFd uintptr) (r int32) { if fd >= 0 { return SQLITE_OK } - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42324)), __ccgo_ts+3584, bp, int32(42324)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(42579)), __ccgo_ts+3605, bp, int32(42579)) } // C documentation @@ -25777,7 +22856,7 @@ func _unixSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { rc = _full_fsync(tls, (*TunixFile)(unsafe.Pointer(pFile)).Fh, isFullsync, isDataOnly) if rc != 0 { _storeLastErrno(tls, pFile, *(*int32)(unsafe.Pointer(libc.X__errno_location(tls)))) - return _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(4)<= nSize { iWrite = nSize - int64(1) } - nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1672, int32(1)) + nWrite = _seekAndWrite(tls, pFile, iWrite, __ccgo_ts+1667, int32(1)) if nWrite != int32(1) { return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(3)<pShmMutex must -** be held while accessing any read/write fields. - */ -type TunixShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - Fid Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type unixShm1 = TunixShm1 - /* ** Constants used for locking */ @@ -26325,7 +23315,7 @@ func _unixShmPurge(tls *libc.TLS, pFd uintptr) { } Xsqlite3_free(tls, (*TunixShmNode)(unsafe.Pointer(p)).FapRegion) if (*TunixShmNode)(unsafe.Pointer(p)).FhShm >= 0 { - _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43135)) + _robust_close(tls, pFd, (*TunixShmNode)(unsafe.Pointer(p)).FhShm, int32(43396)) (*TunixShmNode)(unsafe.Pointer(p)).FhShm = -int32(1) } (*TunixInodeInfo)(unsafe.Pointer((*TunixShmNode)(unsafe.Pointer(p)).FpInode)).FpShmNode = uintptr(0) @@ -26388,7 +23378,7 @@ func _unixLockSharedMemory(tls *libc.TLS, pDbFd uintptr, pShmNode uintptr) (r in ** help detect if a -shm file truncation is legitimate or is the work ** or a rogue process. */ if rc == SQLITE_OK && _robust_ftruncate(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(3)) != 0 { - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(18)<pFirst. This must be done while holding the ** pShmNode->pShmMutex. */ - Xsqlite3_mutex_enter(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) - (*TunixShm1)(unsafe.Pointer(p)).FpNext = (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst - (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TunixShmNode1)(unsafe.Pointer(pShmNode)).FpShmMutex) + Xsqlite3_mutex_enter(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) + (*TunixShm)(unsafe.Pointer(p)).FpNext = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst + (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p + Xsqlite3_mutex_leave(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FpShmMutex) return rc /* Jump here on any error */ goto shm_open_err @@ -26619,9 +23609,9 @@ func _unixShmMap(tls *libc.TLS, fd uintptr, iRegion int32, szRegion int32, bExte break } *(*int32)(unsafe.Pointer(bp + 144)) = 0 - if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1672, int32(1), bp+144) != int32(1) { + if _seekAndWriteFd(tls, (*TunixShmNode)(unsafe.Pointer(pShmNode)).FhShm, int64(iPg*_pgsz+_pgsz-int32(1)), __ccgo_ts+1667, int32(1), bp+144) != int32(1) { zFile = (*TunixShmNode)(unsafe.Pointer(pShmNode)).FzFilename - rc = _unixLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(19)<=3 && ofst=3 && ofst= 0 { - _robust_close(tls, pNew, h, int32(44546)) + _robust_close(tls, pNew, h, int32(44806)) } } else { (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = pLockingStyle @@ -27389,10 +24378,10 @@ func _fillInUnixFile(tls *libc.TLS, pVfs uintptr, h int32, pId uintptr, zFilenam // ** Directories to consider for temp files. // */ var _azTempDirs = [6]uintptr{ - 2: __ccgo_ts + 3926, - 3: __ccgo_ts + 3935, - 4: __ccgo_ts + 3944, - 5: __ccgo_ts + 1685, + 2: __ccgo_ts + 3947, + 3: __ccgo_ts + 3956, + 4: __ccgo_ts + 3965, + 5: __ccgo_ts + 1706, } // C documentation @@ -27401,8 +24390,8 @@ var _azTempDirs = [6]uintptr{ // ** Initialize first two members of azTempDirs[] array. // */ func _unixTempFileInit(tls *libc.TLS) { - _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3949) - _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3963) + _azTempDirs[0] = libc.Xgetenv(tls, __ccgo_ts+3970) + _azTempDirs[int32(1)] = libc.Xgetenv(tls, __ccgo_ts+3984) } // C documentation @@ -27464,7 +24453,7 @@ func _unixGetTempname(tls *libc.TLS, nBuf int32, zBuf uintptr) (r int32) { for cond := true; cond; cond = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(2)].FpCurrent})))(tls, zBuf, 0) == 0 { Xsqlite3_randomness(tls, int32(8), bp) *(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2)))) = uint8(0) - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3970, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+3991, libc.VaList(bp+16, zDir, *(*Tu64)(unsafe.Pointer(bp)), 0)) if v2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zBuf + uintptr(nBuf-int32(2))))) != 0; !v2 { v1 = iLimit iLimit++ @@ -27636,7 +24625,7 @@ func _findCreateFileMode(tls *libc.TLS, zPath uintptr, flags int32, pMode uintpt ** filename, check for the "modeof" parameter. If present, interpret ** its value as a filename and try to copy the mode, uid and gid from ** that file. */ - z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+3987) + z = Xsqlite3_uri_parameter(tls, zPath, __ccgo_ts+4008) if z != 0 { rc = _getFileMode(tls, z, pMode, pUid, pGid) } @@ -27791,7 +24780,7 @@ func _unixOpen(tls *libc.TLS, pVfs uintptr, zPath uintptr, pFile uintptr, flags } } if fd < 0 { - rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(44994)), __ccgo_ts+3467, zName, int32(44994)) + rc2 = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45254)), __ccgo_ts+3488, zName, int32(45254)) if rc == SQLITE_OK { rc = rc2 } @@ -27868,7 +24857,7 @@ func _unixDelete(tls *libc.TLS, NotUsed uintptr, zPath uintptr, dirSync int32) ( if *(*int32)(unsafe.Pointer(libc.X__errno_location(tls))) == int32(ENOENT) { rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(23)< int32(SQLITE_MAX_SYMLINK) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45245)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _sqlite3CantopenError(tls, int32(45505)) return } got = (*(*func(*libc.TLS, uintptr, uintptr, Tsize_t) Tssize_t)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls, zIn, bp+144, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) if got <= 0 || got >= libc.Int64FromInt64(4098)-libc.Int64FromInt32(2) { - (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45250)), __ccgo_ts+3656, zIn, int32(45250)) + (*TDbPath)(unsafe.Pointer(pPath)).Frc = _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45510)), __ccgo_ts+3677, zIn, int32(45510)) return } (*(*[4098]uint8)(unsafe.Pointer(bp + 144)))[got] = uint8(0) @@ -28066,14 +25045,14 @@ func _unixFullPathname(tls *libc.TLS, pVfs uintptr, zPath uintptr, nOut int32, z (*(*TDbPath)(unsafe.Pointer(bp))).FzOut = zOut if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) != int32('/') { if (*(*func(*libc.TLS, uintptr, Tsize_t) uintptr)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, bp+24, libc.Uint64FromInt64(4098)-libc.Uint64FromInt32(2)) == uintptr(0) { - return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45308)), __ccgo_ts+3485, zPath, int32(45308)) + return _unixLogErrorAtLine(tls, _sqlite3CantopenError(tls, int32(45568)), __ccgo_ts+3506, zPath, int32(45568)) } _appendAllPathElements(tls, bp, bp+24) } _appendAllPathElements(tls, bp, zPath) *(*uint8)(unsafe.Pointer(zOut + uintptr((*(*TDbPath)(unsafe.Pointer(bp))).FnUsed))) = uint8(0) if (*(*TDbPath)(unsafe.Pointer(bp))).Frc != 0 || (*(*TDbPath)(unsafe.Pointer(bp))).FnUsed < int32(2) { - return _sqlite3CantopenError(tls, int32(45314)) + return _sqlite3CantopenError(tls, int32(45574)) } if (*(*TDbPath)(unsafe.Pointer(bp))).FnSymlink != 0 { return libc.Int32FromInt32(SQLITE_OK) | libc.Int32FromInt32(2)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -29878,7 +26697,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -29932,7 +26757,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<(i&libc.Uint32FromInt32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -29976,7 +26801,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -30051,7 +26876,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, libc.Uint32FromInt32(sz)) - pV = _sqlite3MallocZero(tls, libc.Uint64FromInt32((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, libc.Uint64FromInt64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -30105,7 +26930,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^libc.Int32FromUint8(libc.Uint8FromInt32(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, libc.Uint32FromInt32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -30139,66 +26964,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -30372,14 +27137,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = libc.Uint8FromInt32(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -31195,123 +27960,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -31392,7 +28040,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -31486,7 +28134,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -31527,7 +28175,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -31655,7 +28303,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -31675,17 +28323,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -31703,7 +28353,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -31715,7 +28365,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -31916,10 +28566,11 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = libc.Int32FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) - pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt32(sz)) + sz = libc.Int64FromUint64(uint64(88) + uint64(80)*libc.Uint64FromInt32(_pcache1_g.FseparateCache)) + pCache = _sqlite3MallocZero(tls, libc.Uint64FromInt64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { pGroup = pCache + 1*88 @@ -32505,25 +29156,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -33485,258 +30117,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]uint8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -33835,7 +30215,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -34064,7 +30444,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -34082,7 +30462,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -34655,6 +31035,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -35301,7 +31690,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 uint8 var _ /* exists at bp+8 */ int32 @@ -35313,7 +31703,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt32((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, libc.Uint64FromInt64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -35334,11 +31724,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, libc.Uint64FromInt64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Uint8FromInt32(0) *(*uint8)(unsafe.Pointer(zFree + 3)) = v3 @@ -35367,7 +31758,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint32FromInt32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, libc.Uint64FromInt64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -35600,7 +31991,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*uint8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -35737,7 +32128,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint32FromInt32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, libc.Uint64FromInt64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || libc.Int32FromUint8((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -35753,7 +32144,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -36500,10 +32891,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -37404,7 +33795,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -37448,7 +33839,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*uint8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -37479,7 +33870,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -37530,7 +33921,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+libc.Uint64FromInt32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+libc.Uint64FromInt32(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+libc.Uint64FromInt32(nPathname)+uint64(1)+libc.Uint64FromInt32(nUriByte)+libc.Uint64FromInt32(nPathname)+uint64(8)+uint64(1)+libc.Uint64FromInt32(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -37565,7 +33956,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4152, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4173, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -37575,7 +33966,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, libc.Uint64FromInt32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+4161, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+4182, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -37617,8 +34008,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4166, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4173, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = libc.Uint8FromInt32(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4187, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+4194, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -37701,7 +34092,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -37957,7 +34348,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -38132,7 +34523,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -38163,7 +34554,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -38235,7 +34626,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -39295,7 +35686,7 @@ func _pagerOpenSavepoint(tls *libc.TLS, pPager uintptr, nSavepoint int32) (r int ** if the allocation fails. Otherwise, zero the new portion in case a ** malloc failure occurs while populating it in the for(...) loop below. */ - aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(56)*libc.Uint64FromInt32(nSavepoint)) + aNew = _sqlite3Realloc(tls, (*TPager)(unsafe.Pointer(pPager)).FaSavepoint, uint64(uint64(56)*libc.Uint64FromInt32(nSavepoint))) if !(aNew != 0) { return int32(SQLITE_NOMEM) } @@ -39592,7 +35983,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromUint16((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -39860,7 +36251,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+4183, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+4204, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -40424,9 +36815,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -40441,227 +36832,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -40680,28 +36850,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -40760,7 +36909,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt32(iPage+libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(8) * libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, libc.Uint64FromInt64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -40772,7 +36921,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp } /* Request a pointer to the required page from the VFS */ if libc.Int32FromUint8((*TWal)(unsafe.Pointer(pWal)).FexclusiveMode) == int32(WAL_HEAPMEMORY_MODE) { - *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)) + *(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) = _sqlite3MallocZero(tls, uint64(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) if !(*(*uintptr)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FapWiData + uintptr(iPage)*8)) != 0) { rc = int32(SQLITE_NOMEM) } @@ -40861,6 +37010,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -41128,14 +37278,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -41302,7 +37444,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -41390,12 +37532,12 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ szFrame = szPage + int32(WAL_FRAME_HDRSIZE) - aFrame = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4))) + aFrame = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(szFrame)+(libc.Uint64FromInt64(2)*libc.Uint64FromInt32(libc.Int32FromInt32(HASHTABLE_NPAGE)*libc.Int32FromInt32(2))+libc.Uint64FromInt32(HASHTABLE_NPAGE)*libc.Uint64FromInt64(4)))) if !(aFrame != 0) { rc = int32(SQLITE_NOMEM) goto recovery_error @@ -41529,7 +37671,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -41970,10 +38112,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -42071,7 +38213,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -42110,7 +38252,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -42123,7 +38265,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -42139,7 +38281,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -42160,7 +38302,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -42226,7 +38368,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -42276,7 +38418,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+4238, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+4259, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -42491,7 +38633,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -42517,7 +38666,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -43240,8 +39389,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -43328,7 +39477,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -43474,7 +39623,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -43501,7 +39650,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -43510,6 +39659,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -43554,6 +39704,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -43825,7 +39978,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if libc.Int32FromUint32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -44006,7 +40159,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -44015,7 +40168,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -44067,14 +40220,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -44620,283 +40773,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -45029,27 +40905,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -45212,10 +41067,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -45224,14 +41080,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = libc.Uint8FromInt32(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -45931,11 +41787,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || libc.Int32FromUint16((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -46109,7 +41965,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -46122,12 +41978,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -46171,7 +42027,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = libc.Int32FromUint32(libc.Uint32FromInt32(5) * (key - libc.Uint32FromInt32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -46179,7 +42035,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -46367,7 +42223,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46400,7 +42256,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = libc.Uint16FromInt32(libc.Int32FromUint16(uint16(nPayload)) + libc.Int32FromUint16(libc.Uint16FromInt64(int64(pIter)-int64(pCell)))) if libc.Int32FromUint16((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -46599,7 +42455,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(libc.Int32FromUint16((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -46639,12 +42495,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -46652,21 +42508,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), libc.Uint64FromInt32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -46713,12 +42569,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = libc.Uint8FromInt32(cbrk) @@ -46734,7 +42590,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = libc.Uint8FromInt32(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = libc.Uint8FromInt32(cbrk) @@ -46794,7 +42650,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -46811,14 +42667,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -46861,11 +42717,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -46879,7 +42735,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -46932,42 +42788,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iStart) + libc.Int32FromUint16(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + int32(1)) - if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = libc.Int32FromUint8(hdr) + int32(1) + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -46975,70 +42829,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = libc.Uint32FromInt32(libc.Int32FromUint16(iFreeBlk) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< libc.Int32FromUint32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = libc.Uint16FromInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< libc.Int32FromUint8(hdr)+int32(1) { - iPtrEnd = libc.Int32FromUint16(iPtr) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iPtr)+int32(2)))))<= libc.Int32FromUint16(iStart) { - if iPtrEnd > libc.Int32FromUint16(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) + if iPtr > libc.Int32FromUint8(hdr)+int32(1) { + iPtrEnd = iPtr + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) } - nFrag = Tu8(int32(nFrag) + (libc.Int32FromUint16(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if libc.Int32FromUint8(nFrag) > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(libc.Int32FromUint8(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - libc.Int32FromUint8(libc.Uint8FromInt32(nFrag))) } pTmp = data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) - x = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8(iEnd) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(1)) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = libc.Uint8FromInt32(iEnd >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = libc.Uint8FromInt32(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(libc.Int32FromUint16(iStart) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(libc.Int32FromUint16(iFreeBlk) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint16(iStart)+int32(2)) + 1)) = uint8(iSize) - } - *(*int32)(unsafe.Pointer(pPage + 20)) += libc.Int32FromUint16(iOrigSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = libc.Uint8FromInt32(iStart >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = libc.Uint8FromInt32(iStart) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = libc.Uint8FromInt32(iFreeBlk >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = libc.Uint8FromInt32(iFreeBlk) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = libc.Uint8FromInt32(libc.Int32FromUint16(libc.Uint16FromInt32(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(libc.Uint16FromInt32(iSize)) + } + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -47084,7 +42938,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -47110,7 +42964,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -47149,12 +43003,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if libc.Uint32FromInt32(pc)+size > libc.Uint32FromInt32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -47181,7 +43035,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(libc.Uint16FromInt32(nFree - iCellFirst)) return SQLITE_OK @@ -47212,11 +43066,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -47245,11 +43099,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47258,7 +43112,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = libc.Uint16FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -47280,30 +43134,28 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if libc.Int32FromUint16((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { - libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) + libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-libc.Uint32FromInt32(hdr))) } - *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = libc.Uint8FromInt32(flags) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr))) = uint8(libc.Uint8FromInt32(flags)) if flags&int32(PTF_LEAF) == 0 { v1 = int32(12) } else { v1 = int32(8) } - first = libc.Uint16FromInt32(libc.Int32FromUint8(hdr) + v1) - libc.Xmemset(tls, data+uintptr(libc.Int32FromUint8(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(libc.Int32FromUint8(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) - (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + (*TMemPage)(unsafe.Pointer(pPage)).FnFree = libc.Int32FromUint16(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - libc.Uint32FromInt32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = libc.Uint16FromInt32(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -47411,7 +43263,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -47473,7 +43325,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -47561,7 +43413,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4264) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+4285) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -48185,7 +44037,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromUint16(libc.Uint16FromInt32(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = libc.Int32FromUint16((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -48347,7 +44199,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4273, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+4294, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -48385,7 +44237,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -48826,7 +44678,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if libc.Int32FromUint8(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -48850,7 +44702,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -48859,7 +44711,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -48873,7 +44725,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if libc.Int32FromUint8(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -48903,7 +44755,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -48999,7 +44851,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -49037,7 +44889,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -49104,7 +44956,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49147,7 +44999,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -49177,7 +45029,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -49643,7 +45495,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -50035,7 +45887,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -50045,7 +45897,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -50076,7 +45928,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin if _sqlite3FaultSim(tls, int32(413)) != 0 { aNew = uintptr(0) } else { - aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4)) + aNew = _sqlite3Realloc(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow, uint64(libc.Uint64FromInt32(nOvfl*int32(2))*uint64(4))) } if aNew == uintptr(0) { return int32(SQLITE_NOMEM) @@ -50102,7 +45954,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -50176,7 +46028,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -50311,7 +46163,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -50323,7 +46175,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -50439,7 +46291,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -50453,7 +46305,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -50687,7 +46539,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -50771,7 +46623,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -50783,7 +46635,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, libc.Uint64FromInt32(nCell)+libc.Uint64FromInt32(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -50985,7 +46837,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = libc.Uint16FromInt32(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -51018,7 +46870,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = libc.Uint16FromInt32(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -51027,7 +46879,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (libc.Int32FromUint16((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || libc.Int32FromUint8((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -51156,7 +47008,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -51266,7 +47118,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -51354,7 +47206,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -51409,7 +47261,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -51435,7 +47287,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51462,7 +47314,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -51533,7 +47385,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && libc.Int32FromUint8(eMode) == int32(BTALLOC_LE)) { @@ -51671,7 +47523,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -51722,7 +47574,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -51731,7 +47583,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -51821,7 +47673,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -51839,7 +47691,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -51862,7 +47714,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -52083,10 +47935,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), libc.Uint16FromInt32(sz)) + rc = _freeSpace(tls, pPage, libc.Int32FromUint32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -52377,17 +48229,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -52477,12 +48318,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -52490,7 +48331,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = libc.Uint8FromInt64(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -52585,7 +48426,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), libc.Uint64FromInt32(sz)) @@ -52666,7 +48507,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -52693,7 +48534,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, libc.Uint16FromInt32(aOfst[j]), libc.Uint16FromInt32(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -52733,7 +48574,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), libc.Uint64FromInt32(nCell*int32(2))) nCell -= nShift @@ -52804,7 +48645,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -52849,7 +48690,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -53045,10 +48886,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -53171,8 +49013,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = libc.Int32FromUint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(szScratch)) + szScratch = uint64(libc.Uint64FromInt32(nMaxCells)*uint64(8) + libc.Uint64FromInt32(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -53212,7 +49054,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -53235,7 +49077,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*libc.Uint64FromInt32(limit+libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -53366,7 +49208,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -53409,7 +49251,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -53468,7 +49310,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -53500,7 +49342,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -53730,7 +49572,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -53976,7 +49818,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -54049,7 +49891,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -54208,7 +50050,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if libc.Uint32FromInt32(iOffset)+ovflPageSize < libc.Uint32FromInt32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -54239,7 +50081,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -54324,7 +50166,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -54416,7 +50258,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if libc.Int32FromUint8((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -54452,7 +50294,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -54482,10 +50324,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -54603,12 +50445,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nIn + libc.Uint32FromInt32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -54618,14 +50460,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = libc.Uint32FromInt32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, libc.Int64FromUint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(libc.Int64FromUint32(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = libc.Int32FromUint32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -54725,21 +50567,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = libc.Int32FromUint16((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -54833,7 +50675,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&libc.Int32FromUint16(*(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(libc.Int32FromUint16((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = libc.Int32FromUint16((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -54943,7 +50785,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -54984,7 +50826,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -55065,14 +50907,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if libc.Int32FromUint8((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = libc.Int32FromUint8((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -55209,7 +51051,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, libc.Int32FromUint32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -55474,7 +51316,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4277, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+4298, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -55522,11 +51364,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4279, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4300, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4302, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4323, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -55552,11 +51394,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4432, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4453, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -55628,11 +51470,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 4471 + v2 = __ccgo_ts + 4492 } else { - v2 = __ccgo_ts + 4476 + v2 = __ccgo_ts + 4497 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+4497, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4518, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -55768,12 +51610,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4523 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 4544 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4541, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4562, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4695, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4716, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4725, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4746, 0) doCoverageCheck = 0 goto _4 } @@ -55858,7 +51700,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4749, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4770, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -55881,7 +51723,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, libc.Uint32FromInt32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4773, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4794, 0) depth = d2 } } else { @@ -55958,7 +51800,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4798, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4819, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -55972,7 +51814,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+4835, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+4856, libc.VaList(bp+56, nFrag, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -56063,7 +51905,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4887 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 4908 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -56087,11 +51929,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+4898, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+4919, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+4943, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+4964, 0) } } } @@ -56128,10 +51970,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+4998, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5019, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+5018, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+5039, libc.VaList(bp+248, i)) } goto _3 _3: @@ -56261,14 +52103,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), libc.Uint64FromInt32(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -56479,45 +52321,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -56570,7 +52373,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3869, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -56580,7 +52383,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5050, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+5071, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -56609,7 +52412,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5070, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+5091, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -56639,7 +52442,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5101, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+5122, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -57317,7 +53120,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5141, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5162, libc.VaList(bp+48, v1)) *(*uint8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = uint8(0) /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = libc.Int32FromUint32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -57455,9 +53258,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if libc.Int32FromUint8((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= libc.Uint64FromInt32((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = uint8(0) @@ -57632,20 +53432,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -57660,10 +53460,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -58122,21 +53922,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } *(*uintptr)(unsafe.Pointer(pMem)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -58295,7 +54095,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -58337,11 +54137,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -58351,7 +54151,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if libc.Int32FromUint16(flags)&int32(MEM_Term) != 0 { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF8) { @@ -58373,12 +54173,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -58417,7 +54217,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < libc.Int64FromUint32(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, libc.Int32FromUint32(amt+uint32(1))) rc = v1 @@ -58529,8 +54329,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -58581,7 +54381,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -58589,8 +54390,8 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = libc.Int32FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + nByte = libc.Int64FromUint64(uint64(56)*libc.Uint64FromInt32(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pRec = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) if (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo != 0 { @@ -58647,14 +54448,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -58668,7 +54469,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, return SQLITE_OK } if pList != 0 { - apVal = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32(nVal)) + apVal = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32(nVal))) if apVal == uintptr(0) { rc = int32(SQLITE_NOMEM) goto value_from_function_out @@ -58693,14 +54494,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3869, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+3890, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, libc.Int32FromUint8(enc)) @@ -58758,7 +54559,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1672 + zNeg = __ccgo_ts + 1667 rc = SQLITE_OK for { v1 = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -58800,7 +54601,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 5148 + zNeg = __ccgo_ts + 5169 } } } @@ -58815,7 +54616,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5150, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+5171, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -59119,7 +54920,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(libc.Uint8FromInt32(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > libc.Uint32FromInt32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = libc.Int64FromUint32(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -59135,7 +54936,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(libc.Uint8FromInt32(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += libc.Int64FromUint32(szField) @@ -59145,7 +54946,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -59196,9 +54997,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -59272,7 +55073,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -59606,12 +55407,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(nArg)*libc.Uint64FromInt64(8))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -59785,7 +55585,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -59802,7 +55602,7 @@ func _resizeResolveLabel(tls *libc.TLS, p uintptr, v uintptr, j int32) { var nNewSize int32 _ = nNewSize nNewSize = int32(10) - (*TParse)(unsafe.Pointer(p)).FnLabel - (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, libc.Uint64FromInt32(nNewSize)*uint64(4)) + (*TParse)(unsafe.Pointer(p)).FaLabel = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(p)).Fdb, (*TParse)(unsafe.Pointer(p)).FaLabel, uint64(libc.Uint64FromInt32(nNewSize)*uint64(4))) if (*TParse)(unsafe.Pointer(p)).FaLabel == uintptr(0) { (*TParse)(unsafe.Pointer(p)).FnLabelAlloc = 0 } else { @@ -59870,8 +55670,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -59884,11 +55684,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -59925,13 +55725,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -59962,7 +55765,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -60464,7 +56267,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5155, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5176, libc.VaList(bp+40, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -60474,66 +56277,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+5160) == 0 { - zColl = __ccgo_ts + 5167 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+5181) == 0 { + zColl = __ccgo_ts + 5188 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 5148 + v3 = __ccgo_ts + 5169 } else { - v3 = __ccgo_ts + 1672 + v3 = __ccgo_ts + 1667 } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 5169 + v4 = __ccgo_ts + 5190 } else { - v4 = __ccgo_ts + 1672 + v4 = __ccgo_ts + 1667 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5172, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5193, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5196, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5217, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5205, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5205, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5226, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1433, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5212, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5233, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1400, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1433, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1428, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1400, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1395, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1673 + zP4 = __ccgo_ts + 1668 } else { - zP4 = __ccgo_ts + 5215 + zP4 = __ccgo_ts + 5236 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5222, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5243, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -60548,20 +56351,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5230, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5251, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5235, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5256, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 5237 + zP4 = __ccgo_ts + 5258 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5245, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+5266, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -60575,10 +56378,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 5182, - 1: __ccgo_ts + 5184, - 2: __ccgo_ts + 5186, - 3: __ccgo_ts + 5191, + 0: __ccgo_ts + 5203, + 1: __ccgo_ts + 5205, + 2: __ccgo_ts + 5207, + 3: __ccgo_ts + 5212, } // C documentation @@ -61375,7 +57178,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { v1 = libc.Uint16FromInt32(nResColumn) (*TVdbe)(unsafe.Pointer(p)).FnResAlloc = v1 (*TVdbe)(unsafe.Pointer(p)).FnResColumn = v1 - (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(56)*libc.Uint64FromInt32(n)) + (*TVdbe)(unsafe.Pointer(p)).FaColName = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(56)*libc.Uint64FromInt32(n))) if (*TVdbe)(unsafe.Pointer(p)).FaColName == uintptr(0) { return } @@ -61394,7 +57197,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -61402,7 +57205,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*libc.Int32FromUint16((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -61529,7 +57332,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5261, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+5282, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -61537,18 +57340,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5273, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5294, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5287, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+5308, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5302, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+5323, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -61779,7 +57582,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -63167,7 +58970,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -63202,7 +59005,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = libc.Int32FromUint32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+libc.Uint32FromInt32(nStr) > libc.Uint32FromInt32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -63256,7 +59059,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += libc.Uint32FromInt32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -63388,7 +59191,7 @@ vrcs_restart: szHdr = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = libc.Uint8FromInt32(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -63540,7 +59343,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -63571,7 +59374,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, libc.Uint32FromInt64(nCellKey), bp) @@ -63722,15 +59525,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 5345 + zContext = __ccgo_ts + 5366 } else { if libc.Int32FromUint16((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 5364 + zContext = __ccgo_ts + 5385 } else { - zContext = __ccgo_ts + 5383 + zContext = __ccgo_ts + 5404 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5392, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+5413, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -63825,10 +59628,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = libc.Uint16FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -63837,9 +59641,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -63919,7 +59723,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5428, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5449, 0) return int32(1) } else { return 0 @@ -63929,7 +59733,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5473, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5494, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -63987,7 +59791,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -64314,12 +60118,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -64336,29 +60140,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), uint8(0), __ccgo_fp_xDel) } } @@ -64388,13 +60196,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -64406,11 +60216,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16BE) @@ -64418,23 +60232,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, libc.Int32FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -64490,7 +60310,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5513, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+5534, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -64691,7 +60511,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -64821,7 +60641,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if libc.Int32FromUint16((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -64990,6 +60810,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -65003,7 +60825,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -65041,13 +60863,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -65281,18 +61103,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 5536, - 1: __ccgo_ts + 5541, - 2: __ccgo_ts + 5548, - 3: __ccgo_ts + 5551, - 4: __ccgo_ts + 5554, - 5: __ccgo_ts + 5557, - 6: __ccgo_ts + 5560, - 7: __ccgo_ts + 5563, - 8: __ccgo_ts + 5571, - 9: __ccgo_ts + 5574, - 10: __ccgo_ts + 5581, - 11: __ccgo_ts + 5589, + 0: __ccgo_ts + 5557, + 1: __ccgo_ts + 5562, + 2: __ccgo_ts + 5569, + 3: __ccgo_ts + 5572, + 4: __ccgo_ts + 5575, + 5: __ccgo_ts + 5578, + 6: __ccgo_ts + 5581, + 7: __ccgo_ts + 5584, + 8: __ccgo_ts + 5592, + 9: __ccgo_ts + 5595, + 10: __ccgo_ts + 5602, + 11: __ccgo_ts + 5610, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -65547,14 +61369,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if libc.Int32FromUint8((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5596, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+5617, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= libc.Uint32FromInt16((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -65592,7 +61414,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -65602,7 +61424,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && libc.Int32FromUint8(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -65613,24 +61435,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -65678,7 +61504,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -65686,32 +61514,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, libc.Uint32FromInt32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { if libc.Int32FromUint8(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16BE) } - nData &= libc.Uint64FromInt32(^libc.Int32FromUint16(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16BE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, libc.Int64FromUint64(libc.Uint64FromInt32(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16BE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -66128,11 +61962,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66141,7 +61975,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -66155,7 +61989,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, libc.Int32FromUint32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, libc.Int32FromUint32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -66190,7 +62024,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, (*TColumn)(unsafe.Pointer(pCol)).Faffinity, bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -66225,7 +62059,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = libc.Int32FromUint16((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -66291,11 +62125,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -66318,7 +62152,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66340,7 +62174,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp ** caller may modify the value text encoding. */ if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { - (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField)) + (*TPreUpdate)(unsafe.Pointer(p)).FaNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(56)*libc.Uint64FromInt16((*TVdbeCursor)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr)).FnField))) if !((*TPreUpdate)(unsafe.Pointer(p)).FaNew != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -66467,7 +62301,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5636, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5657, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -66499,13 +62333,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*56 if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1673, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1668, int32(4)) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1433, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1428, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5141, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5162, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -66520,28 +62354,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5640, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5661, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if libc.Int32FromUint8(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if libc.Int32FromUint16((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5647, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5668, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5660, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5681, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5663, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+5684, libc.VaList(bp+104, libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5668, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+5689, int32(1)) } } } @@ -66705,9 +62539,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -66733,12 +62567,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = libc.Int64FromUint64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = libc.Int32FromUint64(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField) + libc.Uint64FromInt32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -66747,28 +62579,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt32(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, libc.Uint64FromInt64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if libc.Int32FromUint8(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*libc.Uint64FromInt32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -67141,11 +62973,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1142, - 1: __ccgo_ts + 1154, - 2: __ccgo_ts + 1159, - 3: __ccgo_ts + 1137, - 4: __ccgo_ts + 1673, + 0: __ccgo_ts + 1137, + 1: __ccgo_ts + 1149, + 2: __ccgo_ts + 1154, + 3: __ccgo_ts + 1132, + 4: __ccgo_ts + 1668, } // C documentation @@ -67159,12 +62991,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity uint8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -67181,7 +63013,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -67199,7 +63031,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -67913,19 +63745,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+5704, libc.VaList(bp+944, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+5725, libc.VaList(bp+936, _azType[libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5725, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+5746, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5732, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+5753, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -69139,7 +64971,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -69155,6 +64987,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -69648,7 +65486,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -69751,7 +65589,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+5756, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+5775, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5870, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5889, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -70347,7 +66185,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+5924, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+5943, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -70377,12 +66215,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 5979 + v250 = __ccgo_ts + 5998 } else { if iRollback != 0 { - v251 = __ccgo_ts + 6027 + v251 = __ccgo_ts + 6046 } else { - v251 = __ccgo_ts + 6070 + v251 = __ccgo_ts + 6089 } v250 = v251 } @@ -70474,7 +66312,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6111) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+6130) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -70792,7 +66630,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1672 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1667 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -71558,7 +67396,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, uint8(SQLITE_AFF_NUMERIC), encoding) if libc.Int32FromUint16((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -71585,7 +67423,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -72044,7 +67882,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -72477,7 +68315,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -72807,7 +68645,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -72838,13 +68676,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 6156 + zSchema = __ccgo_ts + 6175 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6170, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+6189, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -72859,7 +68697,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -73096,7 +68934,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+6213, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+6232, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -73113,15 +68951,15 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = libc.Int32FromUint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + libc.Uint64FromInt32(nMem)*uint64(56) + libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + libc.Uint64FromInt32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) - pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte2)) + nByte2 = libc.Int64FromUint64(uint64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))+libc.Uint64FromInt32(nMem)*uint64(56)+libc.Uint64FromInt32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8)) + libc.Uint64FromInt64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) + pFrame2 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte2)) if !(pFrame2 != 0) { goto no_mem } _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -73202,11 +69040,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -73418,7 +69256,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + libc.Uint64FromInt32(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(n4)*libc.Uint64FromInt64(8)) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -73468,7 +69306,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -73524,7 +69362,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, libc.Int32FromUint8(encoding)) @@ -73603,11 +69441,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 6250 + v286 = __ccgo_ts + 6269 } else { - v286 = __ccgo_ts + 6255 + v286 = __ccgo_ts + 6274 } - _sqlite3VdbeError(tls, p, __ccgo_ts+6262, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6281, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -73760,7 +69598,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+6314, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+6333, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -73922,7 +69760,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6343, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+6362, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -74002,12 +69840,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = libc.Uint16FromInt32(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -74018,7 +69856,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, libc.Int32FromUint8(encoding)) @@ -74112,7 +69950,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -74140,11 +69978,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if libc.Int32FromUint16((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -74272,7 +70110,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+3869, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+3890, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -74423,7 +70261,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6353, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -74510,15 +70348,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -74984,11 +70801,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 3869 + v8 = __ccgo_ts + 3890 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -75067,14 +70884,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75093,11 +70910,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), libc.Int32FromUint16((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, libc.Uint32FromInt32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), libc.Uint32FromInt32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -75173,7 +70990,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -75187,7 +71004,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 3869 + v1 = __ccgo_ts + 3890 } else { v1 = libc.UintptrFromInt32(0) } @@ -75454,108 +71271,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -75919,7 +71471,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -76245,8 +71797,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -76260,9 +71812,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = libc.Int32FromUint64(uint64(40) + libc.Uint64FromInt32(libc.Int32FromUint16((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = libc.Int32FromUint64(uint64(192) + libc.Uint64FromInt32(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(sz+szKeyInfo)) + szKeyInfo = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+96) + libc.Uint64FromInt32(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -76410,8 +71962,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -76460,18 +72012,19 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = libc.Int32FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { - v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt32(nByte)) + v1 = _sqlite3MallocZero(tls, libc.Uint64FromInt64(nByte)) } pNew = v1 if pNew != 0 { @@ -76605,7 +72158,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -76759,6 +72312,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -78254,57 +73810,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -78601,7 +74106,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -79304,25 +74809,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6660, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+6680, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6668+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6687+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+6688+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6707+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6156+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6175+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6706+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6706+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+6726+7) == 0 { return int32(1) } } @@ -79361,23 +74866,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -79409,7 +74913,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6720, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+6740, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -79503,7 +75007,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6725) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+6745) != 0 { goto _2 } } @@ -79525,57 +75029,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -79620,11 +75111,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6727, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6747, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6731, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6751, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -79633,36 +75124,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6735, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+6755, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -79691,18 +75171,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -79749,15 +75229,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6744, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6764, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6775, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6795, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -79768,8 +75248,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -79809,7 +75289,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6830, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+6850, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -79829,7 +75309,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -79838,7 +75318,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6865 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 6885 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -79848,26 +75328,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 6874 + v8 = __ccgo_ts + 6894 } else { - v10 = __ccgo_ts + 6889 + v8 = __ccgo_ts + 6909 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6911, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6931, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6934, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6954, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6995, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -79916,8 +75396,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -79991,19 +75471,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 7002 + zIn = __ccgo_ts + 7022 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 7030 + zIn = __ccgo_ts + 7050 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 7048 + zIn = __ccgo_ts + 7068 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 7066 + zIn = __ccgo_ts + 7086 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7084, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7104, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -80029,7 +75509,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -80175,7 +75655,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7104, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7124, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -80230,7 +75710,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7121, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7141, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -80254,7 +75734,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7185, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7205, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -80268,13 +75748,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -80294,16 +75774,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7221, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7241, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = libc.Uint8FromInt32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -80314,35 +75791,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7249, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7269, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 7292 + zType = __ccgo_ts + 7312 } else { - zType = __ccgo_ts + 7299 + zType = __ccgo_ts + 7319 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7309, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7329, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7337, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7357, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7359, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7379, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7403, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7423, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -80427,7 +75907,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7451, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7471, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -80439,7 +75919,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+7462, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+7482, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -80485,7 +75965,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -80610,7 +76090,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7473, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7493, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -80645,7 +76125,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7529, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7549, 0) return int32(1) } i = 0 @@ -80683,7 +76163,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7563, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+7583, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -80753,7 +76233,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7569, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7589, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -80787,7 +76267,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7630, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7650, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -81100,7 +76580,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7661, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7681, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -81167,7 +76647,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7563) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -81178,7 +76658,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7700) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+7720) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -81188,7 +76668,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7706, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7726, 0) return int32(WRC_Abort) } goto _6 @@ -81410,33 +76890,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -81488,7 +76970,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r uint8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -81696,7 +77178,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -82171,7 +77653,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) return } if libc.Int32FromUint8(op) == int32(TK_LE) { @@ -82250,7 +77732,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7765, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7785, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -82437,7 +77919,7 @@ func _sqlite3ExprAlloc(tls *libc.TLS, db uintptr, op int32, pToken uintptr, dequ nExtra = libc.Int32FromUint32((*TToken)(unsafe.Pointer(pToken)).Fn + uint32(1)) /* tag-20240227-a */ } } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(72)+libc.Uint64FromInt32(nExtra)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(nExtra))) if pNew != 0 { libc.Xmemset(tls, pNew, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pNew)).Fop = libc.Uint8FromInt32(op) @@ -82595,11 +78077,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 7813 + v2 = __ccgo_ts + 7833 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7815, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7835, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -82645,10 +78127,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1792) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -82676,7 +78158,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7859, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7879, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) @@ -82696,7 +78178,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7893, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7913, libc.VaList(bp+8, p)) } // C documentation @@ -82767,7 +78249,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7943, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+8, pExpr)) } } } @@ -82819,7 +78301,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, libc.Int32FromUint32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7963, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7983, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -82852,7 +78334,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8006, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8026, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -83088,12 +78570,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -83235,7 +78711,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = libc.Int64FromUint64(uint64(64) + uint64(48)*libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+16) + libc.Uint64FromInt32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -83375,7 +78851,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -83396,27 +78871,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = libc.Int32FromUint64(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80))) if pNew == uintptr(0) { return uintptr(0) } - v2 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v2) + v1 = libc.Uint32FromInt32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = libc.Int32FromUint32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -83462,9 +78930,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -83474,8 +78942,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -83489,7 +78957,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { return uintptr(0) } @@ -83540,7 +79008,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -83621,7 +79089,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -83639,7 +79107,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -83720,7 +79188,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8029, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -83849,7 +79317,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8059, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8079, libc.VaList(bp+8, zObject)) } } @@ -83947,10 +79415,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8082) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8102) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8087) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+8107) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -84628,13 +80096,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff uint8) (r i // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+8093) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8113) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8101) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8121) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+8107) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+8127) == 0 { return int32(1) } return 0 @@ -84649,32 +80117,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 8093, - 1: __ccgo_ts + 8101, - 2: __ccgo_ts + 8107, + 0: __ccgo_ts + 8113, + 1: __ccgo_ts + 8121, + 2: __ccgo_ts + 8127, } ii = 0 for { if !(ii < libc.Int32FromUint64(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -84883,7 +80338,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -84936,7 +80391,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8111, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+8131, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -85036,12 +80491,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1792) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = uint8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -85633,7 +81089,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8326) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+8346) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -85729,14 +81185,14 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return } zAff = _exprINAffinity(tls, pParse, pExpr) nVector = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nVector)*uint64(4)) + aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nVector)*uint64(4))) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { goto sqlite3ExprCodeIN_oom_error } @@ -85764,9 +81220,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -85899,7 +81355,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if libc.Int32FromUint8((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -86029,13 +81485,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -86815,7 +82276,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8419, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8439, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -86827,7 +82288,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -86842,7 +82303,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8446, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8466, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -86871,7 +82332,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -86947,7 +82408,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8029, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8049, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -87010,7 +82471,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6812, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6832, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -87020,7 +82481,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -87028,7 +82489,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -87041,9 +82502,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -87125,7 +82586,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8470, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8490, 0) return 0 } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -87196,17 +82657,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -87215,7 +82676,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -87227,6 +82688,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = libc.Uint8FromInt32(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -87246,7 +82728,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -87316,7 +82798,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -87360,7 +82842,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -87433,7 +82915,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -87460,8 +82942,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -87627,7 +83109,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -87836,7 +83320,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -88543,7 +84029,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -88772,10 +84258,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -88813,7 +84299,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88827,7 +84313,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -88841,10 +84327,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -88854,25 +84343,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -88885,7 +84378,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -88895,11 +84388,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int16FromUint16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = libc.Int32FromUint32(v3) } goto fix_up_expr fix_up_expr: @@ -88919,13 +84412,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -88995,7 +84488,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -89031,6 +84524,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -89048,44 +84542,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8540, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -89165,7 +84664,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -89173,7 +84672,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -89191,7 +84690,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -89210,11 +84709,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -89332,8 +84831,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8520, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8569, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89351,10 +84850,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8548, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8597, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8723, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8772, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -89370,9 +84869,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+8897, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+8946, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9044, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9093, 0) } } @@ -89428,7 +84927,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9195, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9244, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -89437,11 +84936,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9254, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+9303, zName) { goto exit_rename_table } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9260, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9309, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -89471,21 +84970,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9287, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9336, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9471, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9520, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+9776, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9792, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+9825, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9841, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9850, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9899, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -89493,7 +84992,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -89501,7 +85000,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10115, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+10164, 0) goto exit_rename_table exit_rename_table: ; @@ -89518,7 +85017,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10128, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10177, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -89558,11 +85057,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10166, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10215, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10198, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10247, 0) return } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -89578,10 +85077,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10225) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10274) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10284) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10333) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -89593,13 +85092,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10337) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10386) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10383) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+10432) } } /* Modify the CREATE TABLE statement. */ @@ -89613,7 +85112,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10410, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10459, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -89641,7 +85140,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10556, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10605, libc.VaList(bp+16, zTab, zDb)) } } } @@ -89679,12 +85178,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10909, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10958, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10943, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10992, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -89699,7 +85198,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -89707,8 +85206,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+10973, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(libc.Uint32FromInt32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+11022, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -89769,18 +85268,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11041 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 10997 + zType = __ccgo_ts + 11046 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 11011 + v1 = __ccgo_ts + 11060 } else { - v1 = __ccgo_ts + 11028 + v1 = __ccgo_ts + 11077 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11046, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11095, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -89827,25 +85326,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11064, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1672, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -89857,11 +85344,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11085, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11267, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11134, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11316, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10115, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+10164, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -89871,31 +85358,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -89912,16 +85374,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -90224,9 +85676,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -90337,11 +85789,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*uint8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 11398 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11400, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+11449, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -90412,30 +85864,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11423, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+11472, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -90456,9 +85912,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -90474,15 +85929,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11431, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+11480, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nSql)+libc.Uint64FromInt32((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*libc.Uint64FromInt64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*libc.Uint64FromInt64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -90493,16 +85948,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, libc.Uint64FromInt64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, *(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { - nReplace = libc.Uint32FromInt64(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = libc.Uint32FromInt64(nQuot) + nReplace = nQuot zReplace = zQuot if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -90519,21 +85974,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*uint8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = uint8(0) _sqlite3Dequote(tls, zBuf1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 11398 + v1 = __ccgo_ts + 11447 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+11437, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+11486, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = libc.Uint32FromInt32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(libc.Uint32FromInt32(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(libc.Uint32FromInt32(nOut)-(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), libc.Uint64FromInt64(nOut-libc.Int64FromUint32(libc.Uint32FromInt32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - libc.Int64FromUint32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*uint8)(unsafe.Pointer(zOut + uintptr(nOut))) = uint8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, libc.Uint64FromInt64(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -90559,7 +86014,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, libc.Uint32FromInt32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -90869,7 +86324,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91011,7 +86466,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 32))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1672, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91136,7 +86591,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -91237,7 +86692,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*8))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1672, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1667, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -91319,7 +86774,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -91403,8 +86858,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -91420,12 +86876,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = libc.Int32FromUint64((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= libc.Uint64FromInt32(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -91499,7 +86955,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -91516,7 +86972,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11442, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+11491, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -91571,23 +87027,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11064, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11113, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 11449 + v1 = __ccgo_ts + 11498 } else { - v1 = __ccgo_ts + 5679 + v1 = __ccgo_ts + 5700 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11461, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11510, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11489, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11538, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -91597,33 +87053,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1672, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1667, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11537, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11586, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11658, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11707, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -91637,7 +87093,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -91648,8 +87104,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -91710,27 +87166,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11676, + FzName: __ccgo_ts + 11725, }, 1: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11697, + FzName: __ccgo_ts + 11746, }, 2: { FnArg: int16(7), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11717, + FzName: __ccgo_ts + 11766, }, 3: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11736, + FzName: __ccgo_ts + 11785, }, 4: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 11755, + FzName: __ccgo_ts + 11804, }, } @@ -91941,8 +87397,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11858, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = libc.Uint32FromInt32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11907, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = libc.Uint32FromInt32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -91952,10 +87413,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11881, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11911, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11960, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), libc.Int32FromUint32(aRoot[i]), iDb) @@ -91987,15 +87448,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 11778, - FzCols: __ccgo_ts + 11791, + FzName: __ccgo_ts + 11827, + FzCols: __ccgo_ts + 11840, }, 1: { - FzName: __ccgo_ts + 11804, - FzCols: __ccgo_ts + 11817, + FzName: __ccgo_ts + 11853, + FzCols: __ccgo_ts + 11866, }, 2: { - FzName: __ccgo_ts + 11845, + FzName: __ccgo_ts + 11894, }, } @@ -92048,44 +87509,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -92209,7 +87632,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -92225,12 +87649,12 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = libc.Int32FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anEq */ + n = libc.Int64FromUint64(uint64(136) + uint64(8)*libc.Uint64FromInt32(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp))) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp) + libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) + n = Ti64(uint64(n) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nColUp)+libc.Uint64FromInt64(48)*libc.Uint64FromInt32(nCol+mxSample)+libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nColUp)*libc.Uint64FromInt32(nCol+mxSample))) } - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(n)) + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(n)) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -92238,7 +87662,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = libc.Uint64FromInt64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -92297,7 +87721,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11929, + FzName: __ccgo_ts + 11978, } func init() { @@ -92671,7 +88095,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11939, + FzName: __ccgo_ts + 11988, } func init() { @@ -92721,7 +88145,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11949, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11998, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -92732,7 +88156,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+11954, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+12003, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -92771,7 +88195,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+11960, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+12009, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -92789,7 +88213,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 11966, + FzName: __ccgo_ts + 12015, } func init() { @@ -92855,7 +88279,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+11975, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+12024, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -92864,12 +88288,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11778, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+11827, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -92991,7 +88415,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrNextRow = _sqlite3VdbeCurrentAddr(tls, v) if nColTest > 0 { endDistinctTest = _sqlite3VdbeMakeLabel(tls, pParse) /* Array of jump instruction addresses */ - aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nColTest)) + aGotoChng = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nColTest))) if aGotoChng == uintptr(0) { goto _13 } @@ -93071,7 +88495,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -93102,7 +88526,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11985, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -93193,7 +88617,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+11985, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+12034, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -93230,7 +88654,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -93263,11 +88687,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+11989) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+12038) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+11993) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+12042) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -93375,13 +88799,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -93396,7 +88813,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1672 + z = __ccgo_ts + 1667 } i = 0 for { @@ -93431,17 +88848,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*uint8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+11997, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12046, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12008, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12057, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, libc.Uint64FromInt32(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+12018, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+12067, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -93453,13 +88870,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -93510,7 +88920,7 @@ func _analysisLoader(tls *libc.TLS, pData uintptr, argc int32, argv uintptr, Not ** sqlite_stat1 entries for this index. In that case just clobber ** the old data with the new instead of allocating a new array. */ if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { - (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(8)*libc.Uint64FromInt32(nCol)) + (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst = _sqlite3MallocZero(tls, uint64(uint64(8)*libc.Uint64FromInt32(nCol))) if (*TIndex)(unsafe.Pointer(pIndex)).FaiRowEst == uintptr(0) { _sqlite3OomFault(tls, (*TanalysisInfo)(unsafe.Pointer(pInfo)).Fdb) } @@ -93713,8 +89123,8 @@ func _loadStatTbl(tls *libc.TLS, db uintptr, zSql1 uintptr, zSql2 uintptr, zDb u (*TIndex)(unsafe.Pointer(pIdx)).FnSampleCol = nIdxCol (*TIndex)(unsafe.Pointer(pIdx)).FmxSample = nSample nByte = libc.Int64FromUint64((libc.Uint64FromInt64(40)*libc.Uint64FromInt32(nSample) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample)) - nByte = Ti64(uint64(nByte) + libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8)) /* Space for Index.aAvgEq[] */ + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt32(3)*libc.Uint64FromInt32(nSample))) + nByte = Ti64(uint64(nByte) + uint64(libc.Uint64FromInt32(nIdxCol)*libc.Uint64FromInt64(8))) /* Space for Index.aAvgEq[] */ (*TIndex)(unsafe.Pointer(pIdx)).FaSample = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte)) if (*TIndex)(unsafe.Pointer(pIdx)).FaSample == uintptr(0) { Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -93820,11 +89230,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11804, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+11853, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+12030, __ccgo_ts+12099, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+12079, __ccgo_ts+12148, zDb) } return rc } @@ -93890,10 +89300,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11778, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+11827, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12151, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+12200, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -94006,7 +89416,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6720, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+6740, zName) == 0) } // C documentation @@ -94048,21 +89458,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1672 + zFile = __ccgo_ts + 1667 } if zName == uintptr(0) { - zName = __ccgo_ts + 1672 + zName = __ccgo_ts + 1667 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4041) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+4062) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12192, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+12241, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -94093,7 +89503,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12195, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12244, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -94102,7 +89512,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12232, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12281, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -94114,13 +89524,13 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** hash tables. */ if (*Tsqlite3)(unsafe.Pointer(db)).FaDb == db+696 { - aNew = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3)) + aNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt64(32)*libc.Uint64FromInt32(3))) if aNew == uintptr(0) { return } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*libc.Uint64FromInt64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -94158,7 +89568,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12262, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12311, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -94166,7 +89576,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12291, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+12340, 0) rc = int32(SQLITE_ERROR) } } @@ -94210,10 +89620,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12387, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12436, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12408, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12457, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12434, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+12483, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -94378,7 +89788,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12456, + FzName: __ccgo_ts + 12505, } func init() { @@ -94400,7 +89810,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 12470, + FzName: __ccgo_ts + 12519, } func init() { @@ -94426,7 +89836,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12484, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12533, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -94460,7 +89870,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if libc.Int32FromUint8((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12508, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+12557, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -94587,6 +89997,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -94659,9 +90071,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -94677,7 +90089,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12554, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12603, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -94705,11 +90117,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12577, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12626, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+12583, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+12632, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12589, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12638, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -94769,7 +90181,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 8101 + zCol = __ccgo_ts + 8121 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -94804,7 +90216,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12616, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12665, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -94841,47 +90253,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -94922,7 +90293,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, libc.Uint64FromInt32(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -95020,7 +90391,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -95098,7 +90471,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -95112,7 +90485,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -95225,21 +90600,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6720) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+6740) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6687+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6706+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6156+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6668) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6706+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6156) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+6175) } } } @@ -95269,12 +90644,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6706+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6156) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6726+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+6175) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6687+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6668) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6707+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+6688) } } } @@ -95312,7 +90687,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12631, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+12680, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -95322,7 +90697,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -95330,15 +90705,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 12639 + v1 = __ccgo_ts + 12688 } else { - v1 = __ccgo_ts + 12652 + v1 = __ccgo_ts + 12701 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6924, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6944, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+6995, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+7015, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -95376,12 +90751,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6156+7) == 0 { - return __ccgo_ts + 6706 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6175+7) == 0 { + return __ccgo_ts + 6726 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6668+7) == 0 { - return __ccgo_ts + 6687 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+6688+7) == 0 { + return __ccgo_ts + 6707 } } return zName @@ -95505,9 +90880,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -95906,7 +91281,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6156) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+6175) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -95938,7 +91313,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6720, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+6740, zName) { break } goto _1 @@ -95996,13 +91371,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12666, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12715, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12683, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12732, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -96046,12 +91421,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*8))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*8))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1672, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6660, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12703, libc.VaList(bp+8, zName)) + if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+6680, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12752, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -96087,23 +91462,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -96223,7 +91600,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -96266,9 +91643,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -96281,7 +91658,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12745, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12794, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -96297,9 +91674,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 10992 + v2 = __ccgo_ts + 11041 } else { - v2 = __ccgo_ts + 9254 + v2 = __ccgo_ts + 9303 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -96309,9 +91686,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 6668 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6156 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -96335,11 +91712,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 10992 + v4 = __ccgo_ts + 11041 } else { - v4 = __ccgo_ts + 9254 + v4 = __ccgo_ts + 9303 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12786, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12835, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -96347,11 +91724,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12807, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12856, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -96383,19 +91760,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -96415,15 +91802,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -96438,7 +91830,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -96499,7 +91891,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12842, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12891, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -96508,14 +91900,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12876, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+12925, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -96547,11 +91941,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity uint8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -96562,7 +91956,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12896, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -96572,12 +91966,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12919, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+12968, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12926, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+12975, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -96619,21 +92013,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*uint8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = uint8(0) _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12936, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12985, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, libc.Uint64FromInt64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -96644,7 +92027,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -96657,12 +92040,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*uint8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = uint8(0) _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = libc.Uint8FromInt16((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -96834,10 +92226,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, libc.Uint8FromInt32(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12962, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13011, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13007, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13056, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -96895,7 +92287,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13048, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13097, 0) } } @@ -96923,8 +92315,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -96932,7 +92324,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13100, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13149, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -96951,21 +92343,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -96988,7 +92369,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13141, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13190, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -97016,8 +92397,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -97104,17 +92490,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13197, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13246, 0) goto generated_done } if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13240, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+13289, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13248, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+13297, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -97146,7 +92532,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13255, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13304, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -97287,9 +92673,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -97300,31 +92687,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1672 - zSep2 = __ccgo_ts + 13286 - zEnd = __ccgo_ts + 5180 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1667 + zSep2 = __ccgo_ts + 13335 + zEnd = __ccgo_ts + 5201 } else { - zSep = __ccgo_ts + 13288 - zSep2 = __ccgo_ts + 13292 - zEnd = __ccgo_ts + 13297 + zSep = __ccgo_ts + 13337 + zSep2 = __ccgo_ts + 13341 + zEnd = __ccgo_ts + 13346 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) - zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt32(n)) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) + zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), libc.Uint64FromInt64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+13300, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+13349, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -97335,8 +92722,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, libc.Uint64FromInt32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -97349,17 +92737,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+3869, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, libc.Uint64FromInt32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1672, - 1: __ccgo_ts + 13314, - 2: __ccgo_ts + 13320, - 3: __ccgo_ts + 13325, - 4: __ccgo_ts + 13330, - 5: __ccgo_ts + 13320, + 0: __ccgo_ts + 1667, + 1: __ccgo_ts + 13363, + 2: __ccgo_ts + 13369, + 3: __ccgo_ts + 13374, + 4: __ccgo_ts + 13379, + 5: __ccgo_ts + 13369, } // C documentation @@ -97368,15 +92757,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(2)+libc.Uint64FromInt64(2)+libc.Uint64FromInt32(1)) * libc.Uint64FromInt32(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -97391,7 +92781,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * libc.Uint64FromInt32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = libc.Uint16FromInt32(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -97624,8 +93014,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -97725,7 +93125,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -97738,8 +93138,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -97769,7 +93169,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -97961,7 +93361,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1672, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1667, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -97988,9 +93388,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13336, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1672))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13385, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13369, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13418, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -98011,11 +93411,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13396, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13445, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13446, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13495, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -98062,7 +93462,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13478, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13527, 0) return } } @@ -98096,16 +93496,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 9254 - zType2 = __ccgo_ts + 13522 + zType = __ccgo_ts + 9303 + zType2 = __ccgo_ts + 13571 } else { /* A view */ - zType = __ccgo_ts + 10992 - zType2 = __ccgo_ts + 13528 + zType = __ccgo_ts + 11041 + zType2 = __ccgo_ts + 13577 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -98122,24 +93522,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -98187,13 +93592,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13533, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+13582, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13548, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13597, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -98202,15 +93617,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13646, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13695, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13688, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+13737, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13722, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+13771, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -98228,7 +93643,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9776) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+9825) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -98261,7 +93676,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13743, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13792, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -98278,7 +93693,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+10992, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+11041, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -98375,7 +93790,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13779, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13828, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -98559,7 +93974,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13809, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13858, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -98572,7 +93987,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13824, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13873, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -98655,9 +94070,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13891, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+13940, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11881, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11930, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -98698,7 +94113,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13905, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13954, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -98707,7 +94122,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13950, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13999, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -98742,11 +94157,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3492, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+3513, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7462, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+7482, int32(10)) == 0 { return 0 } return int32(1) @@ -98801,9 +94216,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -98836,18 +94251,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14017, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14066, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14045, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14094, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14079, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14128, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -98857,7 +94272,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11993, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12042, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -98905,19 +94320,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14111, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14160, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14174, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = libc.Int64FromUint64(uint64(80) + libc.Uint64FromInt32(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+64) + libc.Uint64FromInt32(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -98974,7 +94389,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14268, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14317, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -99089,11 +94504,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -99115,7 +94530,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -99160,13 +94575,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -99189,23 +94604,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = libc.Int32FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt16(nCol)+uint64(1)*libc.Uint64FromInt16(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt32(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = libc.Int64FromUint64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(8)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7)) + (uint64(2)*libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))+uint64(2)*libc.Uint64FromInt32(nCol)+uint64(1)*libc.Uint64FromInt32(nCol)+uint64(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra - pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt16(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pExtra += uintptr((libc.Uint64FromInt64(8)*libc.Uint64FromInt32(nCol) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra - pExtra += uintptr(uint64(2) * libc.Uint64FromInt16(nCol)) + pExtra += uintptr(uint64(2) * libc.Uint64FromInt32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra - (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnColumn = libc.Uint16FromInt32(nCol) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = libc.Uint16FromInt32(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -99234,11 +94649,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if libc.Int32FromUint8(sf) == 0 || libc.Int32FromUint8(sf) == int32(3) { - v2 = __ccgo_ts + 14314 + v2 = __ccgo_ts + 14363 } else { - v2 = __ccgo_ts + 14320 + v2 = __ccgo_ts + 14369 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14325, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14374, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -99316,7 +94731,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14353, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+14402, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -99326,7 +94741,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14359, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14408, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -99340,16 +94755,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14409, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14458, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14437, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14486, 0) goto exit_create_index } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14462, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14511, 0) goto exit_create_index } /* @@ -99370,19 +94785,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14353, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+14402, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14496, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14545, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14530, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14579, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -99403,7 +94818,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14554, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+14603, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -99421,9 +94836,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6668 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6156 + v2 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -99451,7 +94866,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14353) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+14402) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -99483,7 +94898,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -99535,7 +94950,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14577, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14626, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -99545,7 +94960,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -99555,8 +94970,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -99634,7 +95049,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -99682,7 +95097,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14638, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14687, libc.VaList(bp+136, 0)) } if libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -99712,8 +95127,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14680, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14729, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -99726,7 +95141,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -99753,11 +95168,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1672 + v13 = __ccgo_ts + 1667 } else { - v13 = __ccgo_ts + 14697 + v13 = __ccgo_ts + 14746 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14705, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14754, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -99765,7 +95180,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14725, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14774, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -99773,7 +95188,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14784, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -99936,16 +95351,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14811, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14860, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14829, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14878, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -99953,9 +95368,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -99971,8 +95386,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14902, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+11989, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14951, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+12038, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, libc.Int32FromUint32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -100045,12 +95460,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -100162,13 +95577,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14962, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15011, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+libc.Uint64FromInt64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -100249,7 +95664,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pList == uintptr(0) { return uintptr(0) } @@ -100299,7 +95714,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -100470,11 +95885,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 14998 + v1 = __ccgo_ts + 15047 } else { - v1 = __ccgo_ts + 15001 + v1 = __ccgo_ts + 15050 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15007, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15056, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -100673,7 +96088,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15043, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+15092, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -100720,9 +96135,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 15049 + v1 = __ccgo_ts + 15098 } else { - v1 = __ccgo_ts + 15058 + v1 = __ccgo_ts + 15107 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -100754,9 +96169,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 15043, - 1: __ccgo_ts + 15065, - 2: __ccgo_ts + 15049, + 0: __ccgo_ts + 15092, + 1: __ccgo_ts + 15114, + 2: __ccgo_ts + 15098, } // C documentation @@ -100776,7 +96191,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15073, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15122, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -100801,7 +96216,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12577, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -101232,7 +96647,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15273, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -102114,11 +97527,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15306, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15355, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15335, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -102222,7 +97635,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -102279,7 +97692,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15409, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15458, -int32(1)) return } if argc == int32(3) { @@ -103998,7 +99416,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+15442, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15491, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -104080,7 +99498,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -104152,32 +99570,32 @@ var _hexdigits = [16]uint8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15487, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15536, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15495, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15544, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1433, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1428, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -104205,13 +99623,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+15503, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 15552 + } else { + v2 = __ccgo_ts + 15556 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1673, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1668, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i)))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), libc.Uint64FromInt32(n)) + j += n + i += n + } + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*uint8)(unsafe.Pointer(zOut + uintptr(v2))) = uint8('\\') + } else { + if libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*uint8)(unsafe.Pointer(zOut + uintptr(j))) = uint8(0) + Xsqlite3_result_text64(tls, context, zOut, libc.Uint64FromInt32(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+15559, -int32(1)) + return +} + // C documentation // // /* @@ -104223,6 +99777,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -104233,7 +99791,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), libc.Int32FromUint32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if libc.Int32FromUint8((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -104444,7 +100002,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1672 + zPass = __ccgo_ts + 1667 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -104668,7 +100226,7 @@ func _trimFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nChar++ } if nChar > 0 { - azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) + azChar = _contextMalloc(tls, context, libc.Int64FromUint64(libc.Uint64FromInt64(int64(nChar))*uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt64(4)))) if azChar == uintptr(0) { return } @@ -104757,7 +100315,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 11398, + 0: __ccgo_ts + 11447, } // C documentation @@ -104769,8 +100327,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -104785,7 +100343,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -104797,16 +100355,16 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { libc.Xmemcpy(tls, z+uintptr(j), zSep, libc.Uint64FromInt32(nSep)) j += int64(nSep) } - libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt64(k)) - j += k + libc.Xmemcpy(tls, z+uintptr(j), v, libc.Uint64FromInt32(k)) + j += int64(k) } } goto _2 @@ -104825,7 +100383,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1672) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1667) } // C documentation @@ -104871,7 +100429,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1672 + zIn = __ccgo_ts + 1667 } i = 0 for { @@ -104917,7 +100475,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+15506, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+15582, int32(4), libc.UintptrFromInt32(0)) } } @@ -104978,7 +100536,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+12616, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+12665, -int32(1)) return } if argc == int32(2) { @@ -105009,17 +100567,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -105088,7 +100635,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -105170,7 +100717,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+15386, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+15435, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -105233,12 +100780,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -105402,7 +100943,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) pnsl = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FpnSepLengths if pnsl == uintptr(0) { /* First separator length variation seen, start tracking them. */ - pnsl = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4)) + pnsl = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum+libc.Int32FromInt32(1))*uint64(4))) if pnsl != uintptr(0) { i = 0 nA = (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum - int32(1) @@ -105413,7 +100954,7 @@ func _groupConcatStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } } } else { - pnsl = Xsqlite3_realloc64(tls, pnsl, libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4)) + pnsl = Xsqlite3_realloc64(tls, pnsl, uint64(libc.Uint64FromInt32((*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum)*uint64(4))) } if pnsl != uintptr(0) { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 { @@ -105500,7 +101041,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1672, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1667, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, libc.Int32FromUint32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -105520,7 +101061,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15511, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+15587, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -105549,8 +101090,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+15517, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15517, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+15593, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+15593, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= libc.Uint32FromInt32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -105730,11 +101271,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -105838,7 +101379,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), libc.Int32FromUint64(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -105851,542 +101392,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 15522, + FzName: __ccgo_ts + 15598, }, 1: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 15542, + FzName: __ccgo_ts + 15618, }, 2: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 15555, + FzName: __ccgo_ts + 15631, }, 3: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 15573, + FzName: __ccgo_ts + 15649, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15582, + FzName: __ccgo_ts + 15658, }, 5: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15590, + FzName: __ccgo_ts + 15666, }, 6: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 15590, + FzName: __ccgo_ts + 15666, }, 7: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15605, + FzName: __ccgo_ts + 15681, }, 8: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15631, + FzName: __ccgo_ts + 15707, }, 9: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15656, + FzName: __ccgo_ts + 15732, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15665, + FzName: __ccgo_ts + 15741, }, 11: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 15676, + FzName: __ccgo_ts + 15752, }, 12: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 15683, + FzName: __ccgo_ts + 15759, }, 13: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15697, + FzName: __ccgo_ts + 15773, }, 14: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15697, + FzName: __ccgo_ts + 15773, }, 15: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15703, + FzName: __ccgo_ts + 15779, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 15703, + FzName: __ccgo_ts + 15779, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15785, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 15709, + FzName: __ccgo_ts + 15785, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15714, + FzName: __ccgo_ts + 15790, }, 20: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 15714, + FzName: __ccgo_ts + 15790, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15718, + FzName: __ccgo_ts + 15794, }, 22: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 15718, + FzName: __ccgo_ts + 15794, }, 23: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 15722, + FzName: __ccgo_ts + 15798, }, 24: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 15729, + FzName: __ccgo_ts + 15805, }, 25: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 15737, + FzName: __ccgo_ts + 15813, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 15744, + FzName: __ccgo_ts + 15820, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15757, + FzName: __ccgo_ts + 15833, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15763, + FzName: __ccgo_ts + 15839, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15770, + FzName: __ccgo_ts + 15846, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15777, + FzName: __ccgo_ts + 15853, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15785, + FzName: __ccgo_ts + 15861, }, 32: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15790, + FzName: __ccgo_ts + 15866, }, 33: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15794, + FzName: __ccgo_ts + 15870, }, 34: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15794, + FzName: __ccgo_ts + 15870, }, 35: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15800, + FzName: __ccgo_ts + 15876, }, 36: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15806, + FzName: __ccgo_ts + 15882, }, 37: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15812, + FzName: __ccgo_ts + 15888, }, 38: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15816, + FzName: __ccgo_ts + 15892, }, 39: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15816, + FzName: __ccgo_ts + 15892, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15822, + FzName: __ccgo_ts + 15898, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15829, + FzName: __ccgo_ts + 15905, }, 42: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15839, + FzName: __ccgo_ts + 15915, }, 43: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15846, + FzName: __ccgo_ts + 15922, }, 44: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15853, + FzName: __ccgo_ts + 15929, }, 45: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15864, + FzName: __ccgo_ts + 15940, }, 46: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15871, + FzName: __ccgo_ts + 15947, }, 47: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 15886, + FzName: __ccgo_ts + 15962, }, 48: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15903, + FzName: __ccgo_ts + 15979, }, 49: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15914, + FzName: __ccgo_ts + 15990, }, 50: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15920, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 15997, }, 51: { - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15938, + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16003, }, 52: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15946, + FzName: __ccgo_ts + 16016, }, 53: { - FnArg: int16(3), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15960, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16034, }, 54: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15968, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16042, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16056, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15977, + FzName: __ccgo_ts + 16064, }, 57: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15984, + FzName: __ccgo_ts + 16073, }, 58: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 15984, + FzName: __ccgo_ts + 16073, }, 59: { + FnArg: int16(2), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 60: { + FnArg: int16(3), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16080, + }, + 61: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15994, + FzName: __ccgo_ts + 16090, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 15998, + FzName: __ccgo_ts + 16094, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16004, + FzName: __ccgo_ts + 16100, }, - 62: { + 64: { FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16008, + FzName: __ccgo_ts + 16104, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 16008, + FzName: __ccgo_ts + 16104, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16014, + FzName: __ccgo_ts + 16110, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16014, + FzName: __ccgo_ts + 16110, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 16027, + FzName: __ccgo_ts + 16123, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 16038, + FzName: __ccgo_ts + 16134, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15517, + FzName: __ccgo_ts + 15593, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 15517, - }, - 70: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16043, - }, - 71: { - FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1245, + FzName: __ccgo_ts + 15593, }, 72: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1253, + FzName: __ccgo_ts + 16139, }, 73: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16048, + FzName: __ccgo_ts + 1240, }, 74: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16054, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1248, }, 75: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16057, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16144, }, 76: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 16061, + FzName: __ccgo_ts + 16150, }, 77: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 16067, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16153, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16057, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 16157, }, 79: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16072, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 16163, }, 80: { FnArg: int16(2), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16076, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16153, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16080, + FzName: __ccgo_ts + 16168, }, 82: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16086, + FzName: __ccgo_ts + 16172, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16090, + FzName: __ccgo_ts + 16176, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16095, + FzName: __ccgo_ts + 16182, }, 85: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16100, + FzName: __ccgo_ts + 16186, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16105, + FzName: __ccgo_ts + 16191, }, 87: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16111, + FzName: __ccgo_ts + 16196, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16115, + FzName: __ccgo_ts + 16201, }, 89: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16119, + FzName: __ccgo_ts + 16207, }, 90: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16123, + FzName: __ccgo_ts + 16211, }, 91: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16128, + FzName: __ccgo_ts + 16215, }, 92: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16133, + FzName: __ccgo_ts + 16219, }, 93: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16138, + FzName: __ccgo_ts + 16224, }, 94: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16144, + FzName: __ccgo_ts + 16229, }, 95: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16150, + FzName: __ccgo_ts + 16234, }, 96: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16156, + FzName: __ccgo_ts + 16240, }, 97: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16161, + FzName: __ccgo_ts + 16246, }, 98: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16169, + FzName: __ccgo_ts + 16252, }, 99: { + FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16177, + FzName: __ccgo_ts + 16257, }, 100: { FnArg: int16(1), - FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16180, + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16265, }, 101: { + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 16273, + }, + 102: { + FnArg: int16(1), + FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 16276, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 6865, + FzName: __ccgo_ts + 6885, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16185, + FzName: __ccgo_ts + 16281, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 16189, + FzName: __ccgo_ts + 16285, }, } @@ -106445,109 +101997,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -106771,7 +102325,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } } else { if paiCol != 0 { - aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, libc.Uint64FromInt32(nCol)*uint64(4)) + aiCol = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.Uint64FromInt32(nCol)*uint64(4))) if !(aiCol != 0) { return int32(1) } @@ -106864,7 +102418,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16192, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16288, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -107688,7 +103242,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -107975,11 +103529,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 6731, + Fz: __ccgo_ts + 6751, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 6727, + Fz: __ccgo_ts + 6747, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -108043,7 +103597,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5315) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+5336) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = uint8(OE_Abort) @@ -108059,7 +103613,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr /* Disable lookaside memory allocation */ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) - pTrigger = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1)) + pTrigger = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt64(72)+libc.Uint64FromInt64(96)+libc.Uint64FromInt32(nFrom)+uint64(1))) if pTrigger != 0 { v4 = pTrigger + 1*72 (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list = v4 @@ -108507,7 +104061,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -108625,7 +104179,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8358, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8378, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -108691,11 +104245,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -109020,7 +104574,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -109034,7 +104588,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), libc.Uint32FromInt32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -109069,7 +104623,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -109082,7 +104636,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -109209,27 +104763,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -109310,7 +104864,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -109337,7 +104891,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin */ bIdListInOrder = libc.BoolUint8((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(libc.Int32FromInt32(TF_OOOHidden)|libc.Int32FromInt32(TF_HasStored)) == uint32(0)) if pColumn != 0 { - aTabColMap = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4)) + aTabColMap = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint64FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol)*uint64(4))) if aTabColMap == uintptr(0) { goto insert_cleanup } @@ -109346,44 +104900,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != libc.Int32FromUint8(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16237, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16333, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16278, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16374, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -109405,31 +104943,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16310, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+16406, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -109453,10 +104991,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -109497,8 +105035,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -109515,34 +105053,34 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16318, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16414, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16370, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16466, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -109649,18 +105187,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -109670,13 +105208,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -109687,14 +105225,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -109711,16 +105249,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -109831,11 +105369,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v23)) + _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -109894,7 +105432,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16462) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+16558) } goto insert_cleanup insert_cleanup: @@ -110017,33 +105555,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -110290,7 +105801,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12577, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zFile + uintptr(iFile)))) == libc.Int32FromUint8('/'))) { @@ -112524,7 +107715,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16511, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+16607, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -112544,19 +107735,19 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16515, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+16611, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } if xInit == uintptr(0) { if pzErrMsg != 0 { - nMsg += libc.Xstrlen(tls, zEntry) + uint64(300) + nMsg += uint64(libc.Xstrlen(tls, zEntry) + uint64(300)) v7 = Xsqlite3_malloc64(tls, nMsg) *(*uintptr)(unsafe.Pointer(bp)) = v7 *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16521, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16617, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112571,14 +107762,14 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16564, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+16660, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) return int32(SQLITE_ERROR) } /* Append the new shared library handle to the db->aExtension array. */ - aHandle = _sqlite3DbMallocZero(tls, db, uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1))) + aHandle = _sqlite3DbMallocZero(tls, db, uint64(uint64(8)*libc.Uint64FromInt32((*Tsqlite3)(unsafe.Pointer(db)).FnExtension+libc.Int32FromInt32(1)))) if aHandle == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -112602,7 +107793,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16596, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+16692, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, libc.Int32FromUint64(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -112611,7 +107802,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 16476, + 0: __ccgo_ts + 16572, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -112680,14 +107871,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -112702,7 +107888,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -112720,7 +107906,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -112735,7 +107921,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -112745,6 +107931,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -112756,7 +107944,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -112768,7 +107956,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -112844,7 +108032,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16633, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+16729, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -112898,63 +108086,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 5571, - 1: __ccgo_ts + 16672, - 2: __ccgo_ts + 9254, - 3: __ccgo_ts + 16676, - 4: __ccgo_ts + 16681, - 5: __ccgo_ts + 16684, - 6: __ccgo_ts + 16694, - 7: __ccgo_ts + 16704, - 8: __ccgo_ts + 16710, - 9: __ccgo_ts + 16714, - 10: __ccgo_ts + 16719, - 11: __ccgo_ts + 16724, - 12: __ccgo_ts + 16732, - 13: __ccgo_ts + 16743, - 14: __ccgo_ts + 16746, - 15: __ccgo_ts + 16753, - 16: __ccgo_ts + 16714, - 17: __ccgo_ts + 16719, - 18: __ccgo_ts + 16760, - 19: __ccgo_ts + 16765, - 20: __ccgo_ts + 16768, - 21: __ccgo_ts + 16775, - 22: __ccgo_ts + 16710, - 23: __ccgo_ts + 16714, - 24: __ccgo_ts + 16781, - 25: __ccgo_ts + 16786, - 26: __ccgo_ts + 16791, - 27: __ccgo_ts + 16714, - 28: __ccgo_ts + 16795, - 29: __ccgo_ts + 16719, - 30: __ccgo_ts + 16803, - 31: __ccgo_ts + 16807, - 32: __ccgo_ts + 16812, - 33: __ccgo_ts + 11993, - 34: __ccgo_ts + 11989, - 35: __ccgo_ts + 16818, - 36: __ccgo_ts + 16823, - 37: __ccgo_ts + 16828, - 38: __ccgo_ts + 16672, - 39: __ccgo_ts + 16714, - 40: __ccgo_ts + 16833, - 41: __ccgo_ts + 16840, - 42: __ccgo_ts + 16847, - 43: __ccgo_ts + 9254, - 44: __ccgo_ts + 16855, - 45: __ccgo_ts + 5574, - 46: __ccgo_ts + 16861, - 47: __ccgo_ts + 16672, - 48: __ccgo_ts + 16714, - 49: __ccgo_ts + 16866, - 50: __ccgo_ts + 16871, - 51: __ccgo_ts + 16057, - 52: __ccgo_ts + 16876, - 53: __ccgo_ts + 16889, - 54: __ccgo_ts + 16898, - 55: __ccgo_ts + 16905, - 56: __ccgo_ts + 16916, + 0: __ccgo_ts + 5592, + 1: __ccgo_ts + 16768, + 2: __ccgo_ts + 9303, + 3: __ccgo_ts + 16772, + 4: __ccgo_ts + 16777, + 5: __ccgo_ts + 16780, + 6: __ccgo_ts + 16790, + 7: __ccgo_ts + 16800, + 8: __ccgo_ts + 16806, + 9: __ccgo_ts + 16810, + 10: __ccgo_ts + 16815, + 11: __ccgo_ts + 16820, + 12: __ccgo_ts + 16828, + 13: __ccgo_ts + 16839, + 14: __ccgo_ts + 16842, + 15: __ccgo_ts + 16810, + 16: __ccgo_ts + 16849, + 17: __ccgo_ts + 16815, + 18: __ccgo_ts + 16857, + 19: __ccgo_ts + 16861, + 20: __ccgo_ts + 16866, + 21: __ccgo_ts + 16872, + 22: __ccgo_ts + 16810, + 23: __ccgo_ts + 16815, + 24: __ccgo_ts + 16879, + 25: __ccgo_ts + 16884, + 26: __ccgo_ts + 16887, + 27: __ccgo_ts + 16894, + 28: __ccgo_ts + 16806, + 29: __ccgo_ts + 16810, + 30: __ccgo_ts + 16900, + 31: __ccgo_ts + 16905, + 32: __ccgo_ts + 16910, + 33: __ccgo_ts + 16768, + 34: __ccgo_ts + 16810, + 35: __ccgo_ts + 16914, + 36: __ccgo_ts + 16921, + 37: __ccgo_ts + 16928, + 38: __ccgo_ts + 12042, + 39: __ccgo_ts + 12038, + 40: __ccgo_ts + 16936, + 41: __ccgo_ts + 16941, + 42: __ccgo_ts + 16946, + 43: __ccgo_ts + 9303, + 44: __ccgo_ts + 16951, + 45: __ccgo_ts + 5595, + 46: __ccgo_ts + 16957, + 47: __ccgo_ts + 16962, + 48: __ccgo_ts + 16153, + 49: __ccgo_ts + 16967, + 50: __ccgo_ts + 16768, + 51: __ccgo_ts + 16810, + 52: __ccgo_ts + 16980, + 53: __ccgo_ts + 16985, + 54: __ccgo_ts + 16994, + 55: __ccgo_ts + 17001, + 56: __ccgo_ts + 17012, } // C documentation @@ -112973,338 +108161,338 @@ type PragmaName = TPragmaName var _aPragmaName = [66]TPragmaName{ 0: { - FzName: __ccgo_ts + 16924, + FzName: __ccgo_ts + 17020, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 16939, + FzName: __ccgo_ts + 17035, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 16954, + FzName: __ccgo_ts + 17050, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 16966, + FzName: __ccgo_ts + 17062, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 16982, + FzName: __ccgo_ts + 17078, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 16905, + FzName: __ccgo_ts + 17001, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 16995, + FzName: __ccgo_ts + 17091, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 17007, + FzName: __ccgo_ts + 17103, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 17027, + FzName: __ccgo_ts + 17123, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 17043, + FzName: __ccgo_ts + 17139, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 17064, + FzName: __ccgo_ts + 17160, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 17079, + FzName: __ccgo_ts + 17175, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 17095, + FzName: __ccgo_ts + 17191, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 17109, + FzName: __ccgo_ts + 17205, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 14: { - FzName: __ccgo_ts + 17122, + FzName: __ccgo_ts + 17218, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 15: { - FzName: __ccgo_ts + 17136, + FzName: __ccgo_ts + 17232, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 16: { - FzName: __ccgo_ts + 17155, + FzName: __ccgo_ts + 17251, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 17: { - FzName: __ccgo_ts + 17174, + FzName: __ccgo_ts + 17270, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 18: { - FzName: __ccgo_ts + 17197, + FzName: __ccgo_ts + 17293, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 19: { - FzName: __ccgo_ts + 17206, + FzName: __ccgo_ts + 17302, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 20: { - FzName: __ccgo_ts + 17224, + FzName: __ccgo_ts + 17320, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 21: { - FzName: __ccgo_ts + 17241, + FzName: __ccgo_ts + 17337, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 22: { - FzName: __ccgo_ts + 17254, + FzName: __ccgo_ts + 17350, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 23: { - FzName: __ccgo_ts + 17269, + FzName: __ccgo_ts + 17365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 24: { - FzName: __ccgo_ts + 17287, + FzName: __ccgo_ts + 17383, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 25: { - FzName: __ccgo_ts + 17297, + FzName: __ccgo_ts + 17393, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 26: { - FzName: __ccgo_ts + 17311, + FzName: __ccgo_ts + 17407, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 27: { - FzName: __ccgo_ts + 17327, + FzName: __ccgo_ts + 17423, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 28: { - FzName: __ccgo_ts + 17352, + FzName: __ccgo_ts + 17448, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 29: { - FzName: __ccgo_ts + 17371, + FzName: __ccgo_ts + 17467, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 30: { - FzName: __ccgo_ts + 17382, + FzName: __ccgo_ts + 17478, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 31: { - FzName: __ccgo_ts + 17393, + FzName: __ccgo_ts + 17489, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 32: { - FzName: __ccgo_ts + 17405, + FzName: __ccgo_ts + 17501, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 33: { - FzName: __ccgo_ts + 17421, + FzName: __ccgo_ts + 17517, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 34: { - FzName: __ccgo_ts + 17434, + FzName: __ccgo_ts + 17530, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 17453, + FzName: __ccgo_ts + 17549, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 36: { - FzName: __ccgo_ts + 17472, + FzName: __ccgo_ts + 17568, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 37: { - FzName: __ccgo_ts + 17485, + FzName: __ccgo_ts + 17581, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 17500, + FzName: __ccgo_ts + 17596, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 39: { - FzName: __ccgo_ts + 17510, + FzName: __ccgo_ts + 17606, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 40: { - FzName: __ccgo_ts + 17522, + FzName: __ccgo_ts + 17618, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 41: { - FzName: __ccgo_ts + 17531, + FzName: __ccgo_ts + 17627, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 42: { - FzName: __ccgo_ts + 17542, + FzName: __ccgo_ts + 17638, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 43: { - FzName: __ccgo_ts + 17552, + FzName: __ccgo_ts + 17648, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 44: { - FzName: __ccgo_ts + 17564, + FzName: __ccgo_ts + 17660, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 45: { - FzName: __ccgo_ts + 17575, + FzName: __ccgo_ts + 17671, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 46: { - FzName: __ccgo_ts + 17587, + FzName: __ccgo_ts + 17683, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 47: { - FzName: __ccgo_ts + 17604, + FzName: __ccgo_ts + 17700, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 48: { - FzName: __ccgo_ts + 17623, + FzName: __ccgo_ts + 17719, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 49: { - FzName: __ccgo_ts + 17649, + FzName: __ccgo_ts + 17745, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 50: { - FzName: __ccgo_ts + 17664, + FzName: __ccgo_ts + 17760, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 51: { - FzName: __ccgo_ts + 17678, + FzName: __ccgo_ts + 17774, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 52: { - FzName: __ccgo_ts + 17697, + FzName: __ccgo_ts + 17793, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 53: { - FzName: __ccgo_ts + 17711, + FzName: __ccgo_ts + 17807, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 54: { - FzName: __ccgo_ts + 17727, + FzName: __ccgo_ts + 17823, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 55: { - FzName: __ccgo_ts + 17739, + FzName: __ccgo_ts + 17835, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 56: { - FzName: __ccgo_ts + 17750, + FzName: __ccgo_ts + 17846, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 17761, + FzName: __ccgo_ts + 17857, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -113312,45 +108500,45 @@ var _aPragmaName = [66]TPragmaName{ FiArg: uint64(1), }, 58: { - FzName: __ccgo_ts + 17773, + FzName: __ccgo_ts + 17869, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 59: { - FzName: __ccgo_ts + 17784, + FzName: __ccgo_ts + 17880, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 60: { - FzName: __ccgo_ts + 17805, + FzName: __ccgo_ts + 17901, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 61: { - FzName: __ccgo_ts + 17813, + FzName: __ccgo_ts + 17909, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 62: { - FzName: __ccgo_ts + 17828, + FzName: __ccgo_ts + 17924, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 63: { - FzName: __ccgo_ts + 17841, + FzName: __ccgo_ts + 17937, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 64: { - FzName: __ccgo_ts + 17860, + FzName: __ccgo_ts + 17956, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 65: { - FzName: __ccgo_ts + 17875, + FzName: __ccgo_ts + 17971, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: libc.Uint8FromInt32(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -113368,7 +108556,7 @@ var _aPragmaName = [66]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -113476,10 +108664,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17891) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17987) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17901) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17997) { return PAGER_LOCKINGMODE_NORMAL } } @@ -113497,13 +108685,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8414) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+8434) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17908) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18004) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+17913) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+18009) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -113526,10 +108714,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) <= int32('2') { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+16866) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+16980) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+17925) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18021) == 0 { return int32(2) } else { return 0 @@ -113551,7 +108739,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17932, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18028, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -113681,15 +108869,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch libc.Int32FromUint8(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 17994 + zName = __ccgo_ts + 18090 case int32(OE_SetDflt): - zName = __ccgo_ts + 18003 + zName = __ccgo_ts + 18099 case int32(OE_Cascade): - zName = __ccgo_ts + 18015 + zName = __ccgo_ts + 18111 case int32(OE_Restrict): - zName = __ccgo_ts + 18023 + zName = __ccgo_ts + 18119 default: - zName = __ccgo_ts + 18032 + zName = __ccgo_ts + 18128 break } return zName @@ -113710,12 +108898,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 18042, - 1: __ccgo_ts + 18049, - 2: __ccgo_ts + 18057, - 3: __ccgo_ts + 18061, - 4: __ccgo_ts + 17925, - 5: __ccgo_ts + 18070, + 0: __ccgo_ts + 18138, + 1: __ccgo_ts + 18145, + 2: __ccgo_ts + 18153, + 3: __ccgo_ts + 18157, + 4: __ccgo_ts + 18021, + 5: __ccgo_ts + 18166, } // C documentation @@ -113777,15 +108965,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 18095 + zType = __ccgo_ts + 18191 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 18097 + zType = __ccgo_ts + 18193 } else { - zType = __ccgo_ts + 7813 + zType = __ccgo_ts + 7833 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18099, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18195, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -113794,9 +108982,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 18074, - 2: __ccgo_ts + 18079, - 3: __ccgo_ts + 18087, + 1: __ccgo_ts + 18170, + 2: __ccgo_ts + 18175, + 3: __ccgo_ts + 18183, } // C documentation @@ -113895,7 +109083,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18106, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+18202, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -113938,7 +109126,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3869, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -113983,7 +109171,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, libc.Int32FromUint64(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -114042,7 +109230,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18110) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18206) == 0 { b = int32(2) } else { b = libc.Int32FromUint8(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -114085,7 +109273,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -114113,7 +109301,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 17901 + zRet = __ccgo_ts + 17997 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -114141,7 +109329,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 17891 + zRet = __ccgo_ts + 17987 } _returnSingleText(tls, v, zRet) break @@ -114431,7 +109619,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*uint8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18115, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18211, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -114441,7 +109629,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*uint8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -114463,7 +109651,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(libc.Int32FromUint8((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18140, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18236, 0) } else { if iDb != int32(1) { iLevel = (libc.Int32FromUint8(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -114495,8 +109683,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18193) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+18289) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -114576,9 +109765,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 18199 + v14 = __ccgo_ts + 18295 } else { - v14 = __ccgo_ts + 18207 + v14 = __ccgo_ts + 18303 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -114590,7 +109779,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1672), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1667), v15, v16, k, isHidden)) goto _12 _12: ; @@ -114649,7 +109838,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18214, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18310, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -114657,7 +109846,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1637, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FpSchema + 8 @@ -114679,19 +109868,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 10992 + zType = __ccgo_ts + 11041 } else { if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 13240 + zType = __ccgo_ts + 13289 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 18230 + zType = __ccgo_ts + 18326 } else { - zType = __ccgo_ts + 9254 + zType = __ccgo_ts + 9303 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18237, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18333, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -114738,9 +109927,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18244, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18340, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18249, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+18345, libc.VaList(bp+176, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -114764,11 +109953,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 18254, - 1: __ccgo_ts + 18256, - 2: __ccgo_ts + 16743, + 0: __ccgo_ts + 18350, + 1: __ccgo_ts + 18352, + 2: __ccgo_ts + 16839, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18258, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18354, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -114787,7 +109976,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18264, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18360, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -114804,7 +109993,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18268, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18364, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -114854,7 +110043,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7813, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -114866,7 +110055,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < libc.Int32FromUint64(libc.Uint64FromInt64(1584)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7813, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+7833, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -114892,7 +110081,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18271, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18280)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+18367, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+18376)) goto _32 _32: ; @@ -114906,8 +110095,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -115033,7 +110222,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18285, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+18381, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -115129,7 +110318,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -115173,7 +110362,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pObjTab != 0 { cnt++ } - aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1))) + aRoot = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(cnt+libc.Int32FromInt32(1)))) if aRoot == uintptr(0) { break } @@ -115224,7 +110413,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18289, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+18385, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -115235,7 +110424,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18313) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+18409) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -115371,7 +110560,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18342, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+18438, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -115433,7 +110622,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -115455,7 +110644,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18378, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18474, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -115468,7 +110657,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18398, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18494, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -115476,7 +110665,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18420, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18516, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -115487,10 +110676,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18443, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+18539, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18445, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+18541, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -115524,7 +110713,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18465, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+18561, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -115548,9 +110737,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18495) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18500) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18596) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -115563,9 +110752,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18521) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18617) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18557) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18653) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -115593,9 +110782,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18495) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18591) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18568) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+18664) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -115623,7 +110812,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18595) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+18691) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -115720,7 +110909,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18622 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 18718 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -115799,7 +110988,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18683, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+18779, libc.VaList(bp+176, zRight)) } } } @@ -115904,13 +111093,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+17908) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18004) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18708) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18804) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18061) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+18157) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -116045,7 +111234,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -116075,7 +111264,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6660, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+6680, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -116137,7 +111326,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, libc.Int32FromUint32(libc.Uint32FromInt32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18716, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+18812, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -116410,34 +111599,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 18625, + FzName: __ccgo_ts + 18721, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 18630, + FzName: __ccgo_ts + 18726, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 18636, + FzName: __ccgo_ts + 18732, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 18645, + FzName: __ccgo_ts + 18741, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 18654, + FzName: __ccgo_ts + 18750, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 18662, + FzName: __ccgo_ts + 18758, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 18670, + FzName: __ccgo_ts + 18766, }, 7: { - FzName: __ccgo_ts + 18677, + FzName: __ccgo_ts + 18773, }, 8: {}, } @@ -116494,25 +111683,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -116533,14 +111703,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18734) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18830) i = 0 j = libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18749, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18845, libc.VaList(bp+240, libc.Int32FromUint8(cSep), _pragCName[j])) cSep = uint8(',') goto _1 _1: @@ -116549,19 +111719,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18756, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18852, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18762) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18858) j++ } if libc.Int32FromUint8((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18774) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18870) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -116576,7 +111746,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = libc.Uint8FromInt32(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -116757,7 +111927,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -116769,13 +111939,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18789) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+18885) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18797, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18893, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18801, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+18897, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -116784,7 +111954,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -116910,24 +112080,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&libc.Uint32FromInt32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18835, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+18931, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 5182 + v1 = __ccgo_ts + 5203 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18863, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18959, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*uint8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+18894, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+18990, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -116935,9 +112105,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 18805, - 1: __ccgo_ts + 18812, - 2: __ccgo_ts + 18824, + 0: __ccgo_ts + 18901, + 1: __ccgo_ts + 18908, + 2: __ccgo_ts + 18920, } // C documentation @@ -117013,7 +112183,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14680) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -117046,11 +112216,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+18902) + _corruptSchema(tls, pData, argv, __ccgo_ts+18998) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+14680) + _corruptSchema(tls, pData, argv, __ccgo_ts+14729) } } } @@ -117089,18 +112259,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9254 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 9303 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 6668 + v2 = __ccgo_ts + 6688 } else { - v2 = __ccgo_ts + 6156 + v2 = __ccgo_ts + 6175 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8326 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 18915 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 8346 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 19011 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -117184,7 +112354,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12291) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+12340) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117210,7 +112380,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if libc.Int32FromUint8((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+18987) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+19083) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -117225,7 +112395,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19011, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19107, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -117521,7 +112691,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -117534,9 +112704,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -117554,13 +112724,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1637, 0) } } @@ -117583,7 +112753,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -117594,7 +112764,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1642, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1637, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -117643,7 +112813,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19045, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+19141, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -117659,7 +112829,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19075, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+19171, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -117682,10 +112852,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -117693,7 +112863,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3869, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+3890, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -117723,7 +112893,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -117857,7 +113027,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -117979,15 +113149,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -118023,21 +113184,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -118117,7 +113263,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v2) @@ -118125,7 +113271,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -118281,15 +113427,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 11398 - zSp2 = __ccgo_ts + 11398 + zSp1 = __ccgo_ts + 11447 + zSp2 = __ccgo_ts + 11447 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19094, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19190, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -118346,25 +113492,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == libc.Int32FromUint8(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -118496,13 +113645,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -118580,7 +113729,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19124, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19220, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -118630,12 +113779,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19174, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19270, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -118650,9 +113799,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19238, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19334, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -118662,6 +113812,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = uint8(SQLITE_AFF_DEFER) + } + } + } else { + if libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -118696,7 +113853,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 6865, + Fz: __ccgo_ts + 6885, Fn: uint32(8), } @@ -118713,13 +113870,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -118744,7 +113894,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -118789,7 +113939,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -118813,7 +113963,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -118834,7 +113984,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -118957,7 +114107,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -119084,10 +114234,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -119095,7 +114245,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -119272,7 +114422,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19275, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -119383,8 +114533,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+libc.Uint64FromInt32(nExtra)) + nExtra = libc.Int32FromUint64(libc.Uint64FromInt32(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+libc.Uint64FromInt32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = libc.Uint16FromInt32(N) @@ -119392,7 +114542,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, libc.Uint64FromInt32(nExtra)) + libc.Xmemset(tls, p+32, 0, libc.Uint64FromInt32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -119477,13 +114627,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 19295 + z = __ccgo_ts + 19391 case int32(TK_INTERSECT): - z = __ccgo_ts + 19305 + z = __ccgo_ts + 19401 case int32(TK_EXCEPT): - z = __ccgo_ts + 19315 + z = __ccgo_ts + 19411 default: - z = __ccgo_ts + 19322 + z = __ccgo_ts + 19418 break } return z @@ -119504,7 +114654,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19328, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+8, zUsage)) } /* @@ -119541,13 +114691,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 19351 + v1 = __ccgo_ts + 19447 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19365, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19461, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19396, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19492, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -119571,11 +114721,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if libc.Int32FromUint8((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -119790,8 +114940,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1146 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16855 + zType = __ccgo_ts + 1141 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 16951 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -119904,7 +115054,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -119913,7 +115063,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -119937,13 +115087,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 16855 + zCol = __ccgo_ts + 16951 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12577, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -119951,7 +115101,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -120005,7 +115155,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, _sqlite3HashInit(tls, bp+8) if pEList != 0 { nCol = (*TExprList)(unsafe.Pointer(pEList)).FnExpr - aCol = _sqlite3DbMallocZero(tls, db, uint64(16)*libc.Uint64FromInt32(nCol)) + aCol = _sqlite3DbMallocZero(tls, db, uint64(uint64(16)*libc.Uint64FromInt32(nCol))) if nCol > int32(32767) { nCol = int32(32767) } @@ -120043,7 +115193,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 16855 + v3 = __ccgo_ts + 16951 } zName = v3 } else { @@ -120058,7 +115208,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19442, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19538, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -120094,7 +115244,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19451, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+19547, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -120213,7 +115363,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != libc.Int32FromUint8(_sqlite3AffinityType(tls, zType, uintptr(0))) { if libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || libc.Int32FromUint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 19459 + zType = __ccgo_ts + 19555 } else { zType = uintptr(0) j = int32(1) @@ -120279,7 +115429,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -120307,7 +115457,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -120357,7 +115507,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -120380,7 +115530,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -120528,7 +115678,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19463, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19559, 0) return } /* Obtain authorization to do a recursive query */ @@ -120565,7 +115715,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -120576,7 +115726,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -120590,7 +115740,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -120621,7 +115771,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19512, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19608, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -120636,7 +115786,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19554, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19650, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -120664,7 +115814,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19560, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19656, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -120717,11 +115867,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } else { - v1 = __ccgo_ts + 19575 + v1 = __ccgo_ts + 19671 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19577, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19673, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -120829,8 +115979,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19600, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19615, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19696, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19711, 0) } /* Generate code for the left and right SELECT statements. */ @@ -120855,7 +116005,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19295, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19391, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120881,7 +116031,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -120907,7 +116057,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19634, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -120939,11 +116089,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -120965,7 +116115,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19634, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19730, libc.VaList(bp+136, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -121072,6 +116222,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -121088,9 +116239,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19655, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19751, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19701, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19797, libc.VaList(bp+8, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -121161,7 +116312,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19275, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19371, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -121377,7 +116528,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr ** to the right and the left are evaluated, they use the correct ** collation. */ - aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1))) + aPermute = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nOrderBy+libc.Int32FromInt32(1)))) if aPermute != 0 { *(*Tu32)(unsafe.Pointer(aPermute)) = libc.Uint32FromInt32(nOrderBy) i = int32(1) @@ -121409,7 +116560,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -121463,16 +116614,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7563) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7563) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+7583) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+7583) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -121490,32 +116641,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19783, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19879, libc.VaList(bp+88, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19794, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19890, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -121528,7 +116679,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19799, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+19895, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -121738,11 +116889,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 5160 + v1 = __ccgo_ts + 5181 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -121903,7 +117054,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -122093,9 +117244,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -122307,7 +117458,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -122454,7 +117605,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = libc.Uint32FromInt32(v4) @@ -122693,18 +117844,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -122744,11 +117883,11 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ - (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8)) + (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr, uint64(libc.Uint64FromInt32((*TWhereConst)(unsafe.Pointer(pConst)).FnConst*int32(2))*uint64(8))) if (*TWhereConst)(unsafe.Pointer(pConst)).FapExpr == uintptr(0) { (*TWhereConst)(unsafe.Pointer(pConst)).FnConst = 0 } else { @@ -122813,7 +117952,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -122831,12 +117970,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && libc.Int32FromUint8(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -123318,7 +118457,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -123364,13 +118503,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return libc.Uint8FromInt32(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15714) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15790) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15718) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+15794) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -123458,8 +118597,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19805, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19901, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -123483,7 +118622,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -123565,7 +118704,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -123583,7 +118722,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19823, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19919, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -123731,7 +118870,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -123759,7 +118898,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19846, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19942, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -123781,12 +118920,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19866, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19962, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -123803,7 +118942,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19909 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20005 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -123834,7 +118973,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19932, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20028, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -123843,9 +118982,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 19970 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20066 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20004 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 20100 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -123894,7 +119033,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -123904,7 +119043,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20042, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+20138, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -124000,7 +119139,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = libc.Uint32FromInt32(v1) @@ -124009,7 +119148,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+16)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -124060,7 +119199,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20046, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20142, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -124075,7 +119214,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20085, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20181, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -124090,7 +119229,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15273, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -124214,7 +119353,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 6725 + v10 = __ccgo_ts + 6745 } zSchemaName = v10 } @@ -124231,7 +119370,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20116, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20212, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -124310,7 +119449,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20121, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+20217, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -124323,7 +119462,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12577, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+12626, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -124343,9 +119482,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20130, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20226, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20148, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20244, 0) } } } @@ -124359,7 +119498,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20168, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20264, 0) return int32(WRC_Abort) } if elistFlags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -124556,14 +119695,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -124572,7 +119711,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -124604,11 +119743,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -124661,7 +119800,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -124698,12 +119837,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20199, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20295, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20250, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20346, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -124724,7 +119863,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20283, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20379, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -124863,7 +120002,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -124971,7 +120110,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -125015,7 +120154,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -125038,16 +120177,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 20316 + v1 = __ccgo_ts + 20412 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20339, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20435, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -125079,7 +120218,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8326) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -125208,6 +120347,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -125236,7 +120376,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16008) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+16104) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -125269,9 +120409,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -125281,13 +120421,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -125307,7 +120447,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -125480,8 +120620,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -125490,11 +120630,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -125510,7 +120650,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -125534,14 +120674,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20351, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20447, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -125642,7 +120782,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20405, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20501, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -125800,7 +120940,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 72)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1672, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1667, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -125843,14 +120983,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20445, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20541, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -125882,7 +121022,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -125897,7 +121037,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20460, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20556, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -125951,7 +121091,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -125984,7 +121124,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -126043,7 +121183,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -126072,6 +121212,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && libc.Int32FromUint8((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = libc.Uint8FromInt32(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -126094,10 +121241,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -126131,8 +121278,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -126147,8 +121294,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -126177,8 +121324,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = libc.Uint8FromInt32(libc.Int32FromUint8((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -126195,7 +121342,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -126208,11 +121355,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint16FromInt32(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = libc.Uint32FromInt32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -126246,49 +121393,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = libc.Uint16FromInt32(v33) + distFlag = libc.Uint16FromInt32(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) - addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint16((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) + addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, libc.Int32FromUint32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -126296,16 +121444,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v44|v45|libc.Int32FromUint16(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, libc.Uint16FromInt32(v45|v46|libc.Int32FromUint16(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -126323,11 +121471,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 20476 + v47 = __ccgo_ts + 20572 } else { - v46 = __ccgo_ts + 20485 + v47 = __ccgo_ts + 20581 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19328, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+19424, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -126337,12 +121485,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -126355,13 +121503,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -126372,12 +121520,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -126426,12 +121574,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -126501,9 +121653,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -126520,10 +121672,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -126550,8 +121702,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -126591,32 +121743,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = libc.Uint16FromInt32(v60) + distFlag1 = libc.Uint16FromInt32(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -126658,7 +121810,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if libc.Int32FromUint8((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+20476) + _explainTempTable(tls, pParse, __ccgo_ts+20572) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -126764,7 +121916,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -126780,7 +121932,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if libc.Int32FromUint32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20494, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+20590, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -126870,7 +122022,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -127032,7 +122184,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20559, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20655, 0) goto trigger_cleanup } iDb = int32(1) @@ -127072,7 +122224,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20605, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+20701, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -127082,11 +122234,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20613, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20709, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20654, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20750, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -127095,13 +122247,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20605, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+20701, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20694, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20790, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -127109,8 +122261,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6660, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20720, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+6680, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20816, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -127118,15 +122270,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 20758 + v1 = __ccgo_ts + 20854 } else { - v1 = __ccgo_ts + 20765 + v1 = __ccgo_ts + 20861 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20771, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20867, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20808, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20904, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(libc.Int32FromUint8((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -127146,9 +122298,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 6668 + v3 = __ccgo_ts + 6688 } else { - v3 = __ccgo_ts + 6156 + v3 = __ccgo_ts + 6175 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -127248,7 +122400,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20605, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+20701, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -127270,7 +122422,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20854, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20950, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -127286,10 +122438,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+20902, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+20998, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+20977, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+21073, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -127557,11 +122709,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21006, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -127599,9 +122751,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 6668 + v1 = __ccgo_ts + 6688 } else { - v1 = __ccgo_ts + 6156 + v1 = __ccgo_ts + 6175 } zTab = v1 if iDb == int32(1) { @@ -127616,7 +122768,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21026, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -127749,11 +122901,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 21088 + v1 = __ccgo_ts + 21184 } else { - v1 = __ccgo_ts + 21095 + v1 = __ccgo_ts + 21191 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21102, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21198, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -127855,7 +123007,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21150, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21246, 0) return int32(1) } @@ -128003,12 +123155,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -128016,19 +123168,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -128039,7 +123194,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -128053,7 +123208,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -128121,7 +123276,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = libc.Uint8FromInt32(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6353, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+6372, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch libc.Int32FromUint8((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -128220,10 +123375,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21192, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+21288, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -128245,7 +123402,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -128317,7 +123474,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -128733,13 +123890,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -128747,21 +123904,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -128808,7 +123965,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -128847,7 +124004,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui /* Allocate space for aXRef[], aRegIdx[], and aToOpen[]. ** Initialize aXRef[] and aToOpen[] to their default values. */ - aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2)) + aXRef = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+nIdx+libc.Int32FromInt32(1))+libc.Uint64FromInt32(nIdx)+uint64(2))) if aXRef == uintptr(0) { goto update_cleanup } @@ -128891,58 +124048,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if libc.Int32FromUint8((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == libc.Int32FromUint8(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21206, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21302, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21242, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 8101 + v10 = __ccgo_ts + 8121 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -128972,17 +124117,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if libc.Int32FromUint16((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, libc.Int32FromUint8(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -128994,11 +124139,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if libc.Int32FromUint8((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) + v12 = libc.Uint64FromInt32(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, libc.Int32FromUint8(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -129014,11 +124159,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -129027,18 +124172,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, libc.Int32FromUint8(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && libc.Int32FromUint8((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -129047,16 +124192,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -129074,24 +124219,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -129117,50 +124262,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -129458,8 +124603,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -129509,8 +124654,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -129557,11 +124702,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -129573,11 +124718,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -129620,7 +124765,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21261) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+21357) } goto update_cleanup update_cleanup: @@ -129677,13 +124822,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -129725,11 +124870,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -130054,9 +125199,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]uint8)(unsafe.Pointer(bp + 200)))[0] = uint8(0) } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21274, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+21370, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21278, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21374, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -130145,13 +125290,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -130159,7 +125304,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12666, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+12715, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -130241,7 +125386,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21351, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21355, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21447, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+21451, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -130332,7 +125477,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -130371,24 +125516,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21359) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21455) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21399) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21495) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21442) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21538) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 76)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 76)) |= libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1672 + zOut = __ccgo_ts + 1667 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -130398,7 +125543,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= libc.Uint64FromInt32(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21491) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+21587) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -130451,7 +125596,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15043) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+15092) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130482,11 +125627,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = libc.Uint8FromInt32(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21518, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21614, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21626, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21722, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -130495,7 +125640,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21680, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21776, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -130505,7 +125650,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21817, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+21913, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -130596,39 +125741,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -130639,7 +125751,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -130648,7 +125760,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule pMod = uintptr(0) } else { nName = _sqlite3Strlen30(tls, zName) - pMod = _sqlite3Malloc(tls, uint64(48)+libc.Uint64FromInt32(nName)+uint64(1)) + pMod = _sqlite3Malloc(tls, uint64(uint64(48)+libc.Uint64FromInt32(nName)+uint64(1))) if pMod == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) @@ -130658,7 +125770,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -130683,15 +125795,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -130706,13 +125818,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -131032,7 +126146,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12896, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12945, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -131155,24 +126269,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = libc.Uint32FromInt32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+21940, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+22036, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+21964, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22060, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22063, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+22159, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -131229,7 +126348,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -131256,7 +126375,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22082, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22178, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -131290,7 +126409,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -131298,9 +126417,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22124, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22220, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3869, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+3890, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -131313,7 +126432,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 22154 + zFormat = __ccgo_ts + 22250 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -131339,7 +126458,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1672) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1667) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -131347,7 +126466,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16746, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+16842, zType+uintptr(i), int32(6)) && (i == 0 || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -131428,13 +126547,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22200, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22296, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3869, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -131515,7 +126634,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22200, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+22296, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -131563,7 +126682,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != libc.Int32FromUint8(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22219, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+22315, 0) return int32(SQLITE_ERROR) } goto _1 @@ -131574,9 +126693,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -131618,7 +126737,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 3869 + v3 = __ccgo_ts + 3890 } else { v3 = uintptr(0) } @@ -131984,7 +127103,7 @@ func _sqlite3VtabOverloadFunction(tls *libc.TLS, db uintptr, pDef uintptr, nArg } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(uint64(72)+libc.Uint64FromInt32(_sqlite3Strlen30(tls, (*TFuncDef)(unsafe.Pointer(pDef)).FzName))+uint64(1))) if pNew == uintptr(0) { return pDef } @@ -132074,7 +127193,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -132094,7 +127213,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3869, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+3890, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -132158,7 +127277,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -132171,7 +127290,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -132331,271 +127450,9 @@ type TWhereLoop = struct { FaLTermSpace [3]uintptr } -type WhereLoop = TWhereLoop - -type TWherePath = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath = TWherePath - -type TWhereTerm = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm = TWhereTerm - -type TWhereLoopBuilder = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder = TWhereLoopBuilder - -type TWhereScan = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff uint8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan = TWhereScan - -type TWhereOrCost = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost = TWhereOrCost - -type TWhereOrSet = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet = TWhereOrSet - -type TWhereMemBlock = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock = TWhereMemBlock - -type TWhereRightJoin = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin = TWhereRightJoin - -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 +type WhereLoop = TWhereLoop -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { +type TWherePath = struct { FmaskLoop TBitmask FrevLoop TBitmask FnRow TLogEst @@ -132605,60 +127462,9 @@ type TWherePath1 = struct { FaLoop uintptr } -type WherePath1 = TWherePath1 +type WherePath = TWherePath -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { +type TWhereTerm = struct { FpExpr uintptr FpWC uintptr FtruthProb TLogEst @@ -132680,17 +127486,23 @@ type TWhereTerm1 = struct { FprereqAll TBitmask } -type WhereTerm1 = TWhereTerm1 +type WhereTerm = TWhereTerm -/* -** Allowed values of WhereTerm.wtFlags - */ +type TWhereLoopBuilder = struct { + FpWInfo uintptr + FpWC uintptr + FpNew uintptr + FpOrSet uintptr + FpRec uintptr + FnRecValid int32 + FbldFlags1 uint8 + FbldFlags2 uint8 + FiPlanLimit uint32 +} -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { +type WhereLoopBuilder = TWhereLoopBuilder + +type TWhereScan = struct { FpOrigWC uintptr FpWC uintptr FzCollName uintptr @@ -132704,162 +127516,39 @@ type TWhereScan1 = struct { FaiColumn [11]Ti16 } -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 +type WhereScan = TWhereScan -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause +type TWhereOrCost = struct { + Fprereq TBitmask + FrRun TLogEst + FnOut TLogEst } -type WhereAndInfo1 = TWhereAndInfo1 +type WhereOrCost = TWhereOrCost -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 +type TWhereOrSet = struct { + Fn Tu16 + Fa [3]TWhereOrCost } -type WhereMaskSet1 = TWhereMaskSet1 +type WhereOrSet = TWhereOrSet -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 +type TWhereMemBlock = struct { + FpNext uintptr + Fsz Tu64 } -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ +type WhereMemBlock = TWhereMemBlock -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel +type TWhereRightJoin = struct { + FiMatch int32 + FregBloom int32 + FregReturn int32 + FaddrSubrtn int32 + FendSubrtn int32 } -type WhereInfo1 = TWhereInfo1 +type WhereRightJoin = TWhereRightJoin /* ** Bitmasks for the operators on WhereTerm objects. These are all @@ -132892,10 +127581,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 22232 + return __ccgo_ts + 22328 } if i == -int32(1) { - return __ccgo_ts + 16855 + return __ccgo_ts + 16951 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -132914,10 +127603,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22239, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22245, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -132925,7 +127614,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13286, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -132934,11 +127623,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22245, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22341, int32(1)) } i = 0 for { @@ -132946,16 +127635,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+13286, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+13335, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5182, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5203, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } } @@ -133002,7 +127691,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if libc.Int32FromUint16(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22247, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22343, int32(2)) i = 0 for { if !(i < libc.Int32FromUint16(nEq)) { @@ -133010,12 +127699,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+22239, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+22335, int32(5)) } if i >= libc.Int32FromUint16(nSkip) { - v2 = __ccgo_ts + 22250 + v2 = __ccgo_ts + 22346 } else { - v2 = __ccgo_ts + 22255 + v2 = __ccgo_ts + 22351 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -133032,7 +127721,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22263) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+22359) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -133043,9 +127732,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22265) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+22361) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+5201, int32(1)) } // C documentation @@ -133090,11 +127779,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 22267 + v2 = __ccgo_ts + 22363 } else { - v2 = __ccgo_ts + 22274 + v2 = __ccgo_ts + 22370 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22279, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22375, libc.VaList(bp+144, v2, pItem)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -133107,37 +127796,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 11449 + zFmt = __ccgo_ts + 11498 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 22285 + zFmt = __ccgo_ts + 22381 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 22318 + zFmt = __ccgo_ts + 22414 } else { if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 22343 + zFmt = __ccgo_ts + 22439 } else { - zFmt = __ccgo_ts + 22361 + zFmt = __ccgo_ts + 22457 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22370, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22466, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 16855 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22378, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 16951 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22474, libc.VaList(bp+144, zRowid)) if flags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = uint8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22409, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22505, libc.VaList(bp+144, zRowid)) cRangeOp = uint8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -133147,14 +127836,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22419, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22515, libc.VaList(bp+144, libc.Int32FromUint8(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22424) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+22520) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 22446 + v3 = __ccgo_ts + 22542 } else { - v3 = __ccgo_ts + 22454 + v3 = __ccgo_ts + 22550 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -133175,7 +127864,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22460, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22556, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -133205,10 +127894,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if libc.Int32FromUint8((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && libc.Int32FromUint16(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -133241,14 +127930,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22471, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22567, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22250, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22492, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22588, 0) } } else { i = libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -133272,16 +127961,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > libc.Int32FromUint16((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+22239, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+22335, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22250, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+22346, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+5180, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+5201, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -133486,7 +128175,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -133542,8 +128231,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -133565,7 +128254,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = libc.Uint32FromInt32(v3) /* Req'd for SubrtnSig validity */ @@ -133622,10 +128311,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -133680,37 +128369,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint64(4)*libc.Uint64FromInt32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -133735,10 +128410,10 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i })(unsafe.Pointer(pLevel + 72))).FaInLoop = _sqlite3WhereRealloc(tls, (*TWhereClause)(unsafe.Pointer((*TWhereTerm)(unsafe.Pointer(pTerm)).FpWC)).FpWInfo, (*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(20)*libc.Uint64FromInt32((*(*struct { + })(unsafe.Pointer(pLevel + 72))).FaInLoop, uint64(uint64(20)*libc.Uint64FromInt32((*(*struct { FnIn int32 FaInLoop uintptr - })(unsafe.Pointer(pLevel + 72))).FnIn)) + })(unsafe.Pointer(pLevel + 72))).FnIn))) pIn = (*(*struct { FnIn int32 FaInLoop uintptr @@ -133757,24 +128432,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = libc.Uint8FromInt32(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -133786,8 +128461,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -133845,7 +128520,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -133927,7 +128602,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = libc.Int32FromUint16(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -134058,7 +128733,7 @@ func _codeDeferredSeek(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iCur int32, } if v2 && (*TParse)(unsafe.Pointer(v1)).FwriteMask == uint32(0) { pTab = (*TIndex)(unsafe.Pointer(pIdx)).FpTable - ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1))) + ai = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint64(4)*libc.Uint64FromInt32(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+libc.Int32FromInt32(1)))) if ai != 0 { *(*Tu32)(unsafe.Pointer(ai)) = libc.Uint32FromInt16((*TTable)(unsafe.Pointer(pTab)).FnCol) i = 0 @@ -134195,7 +128870,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -134340,7 +129015,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -134401,11 +129076,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -134436,6 +129111,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -134574,7 +129252,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -134654,7 +129332,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -134688,7 +129366,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -134810,7 +129488,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&libc.Uint32FromInt32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -135003,7 +129681,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -135017,12 +129695,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -135060,11 +129739,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -135084,7 +129763,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+libc.Uint64FromInt32(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt32(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80))) if pOrTab == uintptr(0) { return notReady } @@ -135120,21 +129799,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -135152,7 +129831,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -135207,7 +129886,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22500, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22596, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -135230,7 +129909,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22515, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22611, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -135719,9 +130398,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -135730,14 +130409,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22524, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+22620, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -135776,15 +130455,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -135796,7 +130476,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -135869,7 +130549,7 @@ func _whereClauseInsert(tls *libc.TLS, pWC uintptr, p uintptr, wtFlags Tu16) (r if (*TWhereClause)(unsafe.Pointer(pWC)).FnTerm >= (*TWhereClause)(unsafe.Pointer(pWC)).FnSlot { pOld = (*TWhereClause)(unsafe.Pointer(pWC)).Fa db = (*TParse)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer((*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo)).FpParse)).Fdb - (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2)) + (*TWhereClause)(unsafe.Pointer(pWC)).Fa = _sqlite3WhereMalloc(tls, (*TWhereClause)(unsafe.Pointer(pWC)).FpWInfo, uint64(uint64(56)*libc.Uint64FromInt32((*TWhereClause)(unsafe.Pointer(pWC)).FnSlot)*uint64(2))) if (*TWhereClause)(unsafe.Pointer(pWC)).Fa == uintptr(0) { if libc.Int32FromUint16(wtFlags)&int32(TERM_DYNAMIC) != 0 { _sqlite3ExprDelete(tls, db, p) @@ -136267,19 +130947,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 16704, + FzOp: __ccgo_ts + 16800, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 16038, + FzOp: __ccgo_ts + 16134, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 15517, + FzOp: __ccgo_ts + 15593, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 22538, + FzOp: __ccgo_ts + 22634, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -136799,37 +131479,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 uint8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if libc.Int32FromUint8(aff1) != libc.Int32FromUint8(aff2) && (!(libc.Int32FromUint8(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(libc.Int32FromUint8(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -137067,7 +131751,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } } else { @@ -137079,10 +131763,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && libc.Int32FromUint8((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22545, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22641, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -137141,7 +131825,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -137163,7 +131847,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8087 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8107 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -137264,7 +131948,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 22586 + v13 = __ccgo_ts + 22682 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -137795,7 +132479,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22593, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22689, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -137867,22 +132551,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -137995,7 +132667,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -138911,7 +133583,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -141162,13 +135835,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -141268,6 +135936,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if libc.Int32FromUint16(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -141281,12 +135950,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -141732,7 +136418,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (libc.Int32FromUint8(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && libc.Int32FromUint16((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -141783,15 +136469,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -141823,7 +136500,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -141842,7 +136519,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -141879,7 +136556,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -141887,7 +136564,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < libc.Int32FromUint16((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -141908,19 +136585,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -142016,7 +136693,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -142194,7 +136871,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -142222,6 +136899,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -142298,7 +136983,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -142535,7 +137220,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || libc.Int32FromUint8((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142610,7 +137295,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22666, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22762, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -142764,7 +137449,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -143200,7 +137885,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22692, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+22788, 0) rc = SQLITE_OK } else { break @@ -143429,17 +138114,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -144408,7 +139082,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22727, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22823, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -144986,7 +139660,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -145142,7 +139816,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22745, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22841, libc.VaList(bp+64, libc.Int32FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -145163,11 +139837,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = libc.Int32FromUint64(libc.Uint64FromInt32(nByteWInfo) + libc.Uint64FromInt32(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } - pWInfo = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt32(nByteWInfo)+uint64(104)) + nByteWInfo = libc.Int32FromUint64((uint64(libc.UintptrFromInt32(0)+856) + libc.Uint64FromInt32(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & libc.Uint64FromInt32(^libc.Int32FromInt32(7))) + pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint64FromInt32(nByteWInfo)+uint64(104))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) pWInfo = uintptr(0) @@ -145215,7 +139886,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22773, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+22869, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -145360,7 +140031,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if libc.Int32FromUint16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -145394,7 +140066,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint8((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -145416,7 +140088,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(libc.Int32FromUint8((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || libc.Int32FromUint16(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -145429,7 +140101,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if libc.Int32FromUint16(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = libc.Uint32FromInt32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -145520,11 +140192,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && libc.Int32FromUint8((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -145551,16 +140223,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -145608,7 +140280,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = libc.Int32FromUint32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = libc.Int32FromUint32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -145739,7 +140411,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if libc.Int32FromUint8((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -145917,7 +140589,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -145946,7 +140618,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -145956,7 +140628,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22791, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22887, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -146006,7 +140678,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -146275,7 +140947,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22820, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22916, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -146457,7 +141129,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22876, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+22972, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -146783,7 +141455,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22921, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23017, libc.VaList(bp+8, zName)) } return p } @@ -146834,12 +141506,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22940, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23036, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23011, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23107, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -146912,7 +141584,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = libc.Uint8FromInt32(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8326) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+8346) } break } @@ -146943,16 +141615,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -146971,17 +141633,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -146999,7 +141661,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -147023,13 +141685,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -147044,23 +141706,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = libc.Int32FromUint32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^libc.Uint32FromInt32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = libc.Uint32FromInt32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -147076,13 +141738,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -147194,7 +141856,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if libc.Int32FromUint8((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23074, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+23170, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -147230,7 +141892,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -147245,7 +141907,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -147264,11 +141926,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -147314,11 +141976,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -147335,7 +141997,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1792)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1813)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -147357,7 +142019,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -147481,7 +142143,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23100, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23196, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -147549,18 +142211,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 23132 + zErr = __ccgo_ts + 23228 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 23149 + zErr = __ccgo_ts + 23245 } else { if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 23165 + zErr = __ccgo_ts + 23261 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23185, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -147584,7 +142246,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= libc.Uint32FromInt32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23218, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23314, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -147690,24 +142352,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -147725,12 +142387,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -147742,15 +142404,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -147783,7 +142445,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1672, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, libc.Uint16FromInt32(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -147802,11 +142464,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 23265, - 1: __ccgo_ts + 23318, - 2: __ccgo_ts + 22820, - 3: __ccgo_ts + 23369, - 4: __ccgo_ts + 23421, + 0: __ccgo_ts + 23361, + 1: __ccgo_ts + 23414, + 2: __ccgo_ts + 22916, + 3: __ccgo_ts + 23465, + 4: __ccgo_ts + 23517, } var _aOp1 = [5]int32{ @@ -147859,87 +142521,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -148386,7 +142967,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -148482,7 +143063,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -148558,7 +143139,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1672, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1667, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -149199,12 +143780,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -149212,13 +143793,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || libc.Int32FromUint8((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -149238,13 +143819,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -149271,7 +143852,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -149490,6 +144071,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -149550,7 +144135,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23471, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23567, libc.VaList(bp+8, p)) } // C documentation @@ -149564,6 +144149,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -149597,11 +144183,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 23495 + v1 = __ccgo_ts + 23591 } else { - v1 = __ccgo_ts + 23504 + v1 = __ccgo_ts + 23600 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23510, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23606, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, libc.Int32FromUint8((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -149610,7 +144196,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23552, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23648, 0) } } } @@ -149716,7 +144302,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23586, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23682, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -156183,14 +150769,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -156201,16 +150779,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -156237,13 +150805,13 @@ func _yyGrowStack(tls *libc.TLS, p uintptr) (r int32) { newSize = oldSize*int32(2) + int32(100) idx = int32((int64((*TyyParser)(unsafe.Pointer(p)).Fyytos) - int64((*TyyParser)(unsafe.Pointer(p)).Fyystack)) / 24) if (*TyyParser)(unsafe.Pointer(p)).Fyystack == p+32 { - pNew = _parserStackRealloc(tls, uintptr(0), libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, uintptr(0), uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } libc.Xmemcpy(tls, pNew, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(oldSize)*uint64(24)) } else { - pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, libc.Uint64FromInt32(newSize)*uint64(24)) + pNew = _parserStackRealloc(tls, (*TyyParser)(unsafe.Pointer(p)).Fyystack, uint64(libc.Uint64FromInt32(newSize)*uint64(24))) if pNew == uintptr(0) { return int32(1) } @@ -157358,19 +151926,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -158173,20 +152741,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16855, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16951, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = libc.Uint32FromInt32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23624, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16768, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+16887, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23624, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23720, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -158227,7 +152795,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -158372,7 +152945,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -158462,9 +153040,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = libc.Uint8FromInt32(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= libc.Uint32FromInt32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -158819,7 +153397,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23651) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+23747) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -159159,23 +153737,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 8102 + } else { + v347 = __ccgo_ts + 8107 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 8082 - } else { - v347 = __ccgo_ts + 8087 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&libc.Uint32FromInt32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -159233,11 +153825,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -159247,9 +153839,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -159257,11 +153849,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -159359,11 +153951,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -159413,15 +154005,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23660, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23756, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23755, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23851, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23839, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23935, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -159563,7 +154155,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -159757,7 +154349,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*uint8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23924, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24020, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -161883,7 +156475,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -162488,14 +157080,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(libc.Uint64FromInt32(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -163357,22 +157954,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, libc.Uint64FromInt64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -163383,11 +157989,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -163966,7 +158572,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if libc.Int32FromUint8((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -163986,7 +158592,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24011, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24107, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -164111,11 +158717,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -164287,14 +158893,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 24554 + zErr = __ccgo_ts + 24650 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < libc.Int32FromUint64(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -164306,31 +158912,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 24079, - 1: __ccgo_ts + 24092, - 3: __ccgo_ts + 24108, - 4: __ccgo_ts + 24133, - 5: __ccgo_ts + 24147, - 6: __ccgo_ts + 24166, - 7: __ccgo_ts + 1642, - 8: __ccgo_ts + 24191, - 9: __ccgo_ts + 24228, - 10: __ccgo_ts + 24240, - 11: __ccgo_ts + 24255, - 12: __ccgo_ts + 24288, - 13: __ccgo_ts + 24306, - 14: __ccgo_ts + 24331, - 15: __ccgo_ts + 24360, - 17: __ccgo_ts + 6111, - 18: __ccgo_ts + 5513, - 19: __ccgo_ts + 24377, - 20: __ccgo_ts + 24395, - 21: __ccgo_ts + 24413, - 23: __ccgo_ts + 24447, - 25: __ccgo_ts + 24468, - 26: __ccgo_ts + 24494, - 27: __ccgo_ts + 24517, - 28: __ccgo_ts + 24538, + 0: __ccgo_ts + 24175, + 1: __ccgo_ts + 24188, + 3: __ccgo_ts + 24204, + 4: __ccgo_ts + 24229, + 5: __ccgo_ts + 24243, + 6: __ccgo_ts + 24262, + 7: __ccgo_ts + 1637, + 8: __ccgo_ts + 24287, + 9: __ccgo_ts + 24324, + 10: __ccgo_ts + 24336, + 11: __ccgo_ts + 24351, + 12: __ccgo_ts + 24384, + 13: __ccgo_ts + 24402, + 14: __ccgo_ts + 24427, + 15: __ccgo_ts + 24456, + 17: __ccgo_ts + 6130, + 18: __ccgo_ts + 5534, + 19: __ccgo_ts + 24473, + 20: __ccgo_ts + 24491, + 21: __ccgo_ts + 24509, + 23: __ccgo_ts + 24543, + 25: __ccgo_ts + 24564, + 26: __ccgo_ts + 24590, + 27: __ccgo_ts + 24613, + 28: __ccgo_ts + 24634, } // C documentation @@ -164424,15 +159030,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -164440,6 +159048,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164447,10 +159057,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = libc.Uint32FromInt32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -164477,6 +159087,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -164504,12 +159128,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -164527,9 +159151,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16BE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -164552,13 +159176,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, libc.Uint8FromInt32(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == libc.Uint32FromInt32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24635, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24731, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -164576,15 +159200,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | libc.Uint32FromInt32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = libc.Int16FromUint16(libc.Uint16FromInt32(nArg)) return SQLITE_OK @@ -164599,27 +159223,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -164630,30 +159254,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16BE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -164678,7 +159332,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24698, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+24794, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -164709,13 +159363,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -164726,43 +159382,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = libc.Uint8FromInt32(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -164773,12 +159433,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -164790,6 +159450,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -164797,82 +159459,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -164916,18 +159588,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -164953,7 +159627,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*uint8)(unsafe.Pointer(zDb)) != 0 { @@ -164963,7 +159637,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24749, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+24845, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -165085,7 +159759,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165217,7 +159891,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165227,7 +159901,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -165263,7 +159937,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -165276,7 +159950,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16BE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -165285,7 +159959,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, libc.Uint8FromInt32(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24770, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+24866, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -165320,9 +159994,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = libc.Uint8FromInt32(enc2 | libc.Int32FromUint8(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -165432,7 +160106,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24838, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+24934, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = libc.Uint64FromInt32(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -165462,8 +160136,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*uint8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24844, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24854, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+24940, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24950, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -165552,24 +160226,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24882, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+24978, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24886, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+24982, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 24886 + zModeType = __ccgo_ts + 24982 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+24907, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+25003, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = libc.Int32FromUint32(libc.Uint32FromInt32(mask) & flags) - zModeType = __ccgo_ts + 3478 + zModeType = __ccgo_ts + 3499 } if aMode != 0 { mode = 0 @@ -165598,12 +160272,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24922, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25018, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24942, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25038, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -165627,7 +160301,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+24966, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+25062, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -165647,11 +160321,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24892, + Fz: __ccgo_ts + 24988, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 24899, + Fz: __ccgo_ts + 24995, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -165662,19 +160336,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 24912, + Fz: __ccgo_ts + 25008, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 24915, + Fz: __ccgo_ts + 25011, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 24918, + Fz: __ccgo_ts + 25014, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 17925, + Fz: __ccgo_ts + 18021, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -165802,8 +160476,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+22586, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+24982, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+22682, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+25078, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -165824,10 +160498,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 4264 + zFilename = __ccgo_ts + 4285 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -165836,7 +160510,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 3869 + v2 = __ccgo_ts + 3890 } else { v2 = uintptr(0) } @@ -165863,9 +160537,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6720 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 6740 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = libc.Uint8FromInt32(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 23984 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 24080 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -165959,7 +160633,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 24988 + zFilename = __ccgo_ts + 25084 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16BE), libc.UintptrFromInt32(0)) @@ -165978,36 +160652,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -166015,7 +160697,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16BE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, libc.Uint8FromInt32(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -166023,31 +160705,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -166081,12 +160767,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -166119,10 +160807,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -166133,7 +160821,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -166176,20 +160864,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+24991, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+25087, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25016) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+25112) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25036) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+25132) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25043) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+25139) } // C documentation @@ -166214,9 +160902,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -166243,29 +160931,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -166289,7 +160966,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(libc.Int32FromUint16((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1146 + zDataType = __ccgo_ts + 1141 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -166320,15 +160997,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25060, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+25156, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 3869 + v2 = __ccgo_ts + 3890 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -166507,8 +161184,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -166952,7 +161629,7 @@ func Xsqlite3_create_filename(tls *libc.TLS, zDatabase uintptr, zJournal uintptr if !(i < nParam*int32(2)) { break } - nByte = Tsqlite3_int64(uint64(nByte) + (libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8))) + libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(azParam + uintptr(i)*8)))+libc.Uint64FromInt32(1))) goto _1 _1: ; @@ -167348,7 +162025,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25088, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+25184, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -167496,6 +162173,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -167519,7 +162198,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -167529,7 +162208,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -167541,7 +162220,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -167557,7 +162236,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -167566,7 +162245,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 25096 + v2 = __ccgo_ts + 25192 } else { v2 = uintptr(0) } @@ -167645,7 +162324,7 @@ func _sqlite3ConnectionUnlocked(tls *libc.TLS, db uintptr) { _sqlite3BeginBenignMalloc(tls) if !(aDyn != 0) && nArg == libc.Int32FromUint64(libc.Uint64FromInt64(128)/libc.Uint64FromInt64(8)) || aDyn != 0 && nArg == libc.Int32FromUint64(libc.Uint64FromInt32(_sqlite3MallocSize(tls, aDyn))/libc.Uint64FromInt64(8)) { /* The aArg[] array needs to grow. */ - pNew = _sqlite3Malloc(tls, libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2)) + pNew = _sqlite3Malloc(tls, uint64(libc.Uint64FromInt32(nArg)*uint64(8)*uint64(2))) if pNew != 0 { libc.Xmemcpy(tls, pNew, aArg, libc.Uint64FromInt32(nArg)*uint64(8)) Xsqlite3_free(tls, aDyn) @@ -167812,7 +162491,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -168029,6 +162708,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -168341,8 +163027,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -168399,7 +163085,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -168409,7 +163095,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -168446,23 +163132,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1658, - 1: __ccgo_ts + 8082, - 2: __ccgo_ts + 8087, - 3: __ccgo_ts + 6396, - 4: __ccgo_ts + 6396, - 5: __ccgo_ts + 6391, - 6: __ccgo_ts + 6391, - 7: __ccgo_ts + 8393, - 8: __ccgo_ts + 8393, - 9: __ccgo_ts + 8393, - 10: __ccgo_ts + 8393, - 11: __ccgo_ts + 25119, - 12: __ccgo_ts + 25125, - 13: __ccgo_ts + 1672, - 14: __ccgo_ts + 1672, - 15: __ccgo_ts + 1672, - 16: __ccgo_ts + 1672, + 0: __ccgo_ts + 1653, + 1: __ccgo_ts + 8102, + 2: __ccgo_ts + 8107, + 3: __ccgo_ts + 6416, + 4: __ccgo_ts + 6416, + 5: __ccgo_ts + 6411, + 6: __ccgo_ts + 6411, + 7: __ccgo_ts + 8413, + 8: __ccgo_ts + 8413, + 9: __ccgo_ts + 8413, + 10: __ccgo_ts + 8413, + 11: __ccgo_ts + 25215, + 12: __ccgo_ts + 25221, + 13: __ccgo_ts + 1667, + 14: __ccgo_ts + 1667, + 15: __ccgo_ts + 1667, + 16: __ccgo_ts + 1667, } // C documentation @@ -168766,106 +163452,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]uint8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -168945,7 +163531,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -169243,8 +163829,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = uint8('u') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = uint8('0') *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = uint8('0') - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25132 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) - *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 25132 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)>>int32(4)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*uint8)(unsafe.Pointer(__ccgo_ts + 1689 + uintptr(libc.Int32FromUint8(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -169378,9 +163964,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1658, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1653, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+15487, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+15536, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) @@ -169394,14 +163980,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25149, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25228, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -169455,7 +164039,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if libc.Int32FromUint8((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+25257, -int32(1)) } } } @@ -169738,8 +164322,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(3), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25193, - FzRepl: __ccgo_ts + 25197, + FzMatch: __ccgo_ts + 25272, + FzRepl: __ccgo_ts + 25276, }, 1: { Fc1: uint8('i'), @@ -169747,32 +164331,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: uint8(8), FeType: uint8(JSONB_FLOAT), FnRepl: uint8(7), - FzMatch: __ccgo_ts + 25205, - FzRepl: __ccgo_ts + 25197, + FzMatch: __ccgo_ts + 25284, + FzRepl: __ccgo_ts + 25276, }, 2: { Fc1: uint8('n'), Fc2: uint8('N'), Fn: uint8(3), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 1663, - FzRepl: __ccgo_ts + 1658, + FzMatch: __ccgo_ts + 1658, + FzRepl: __ccgo_ts + 1653, }, 3: { Fc1: uint8('q'), Fc2: uint8('Q'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25214, - FzRepl: __ccgo_ts + 1658, + FzMatch: __ccgo_ts + 25293, + FzRepl: __ccgo_ts + 1653, }, 4: { Fc1: uint8('s'), Fc2: uint8('S'), Fn: uint8(4), FnRepl: uint8(4), - FzMatch: __ccgo_ts + 25219, - FzRepl: __ccgo_ts + 1658, + FzMatch: __ccgo_ts + 25298, + FzRepl: __ccgo_ts + 1653, }, } @@ -169787,7 +164371,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25224, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25303, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -169805,23 +164389,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -169899,7 +164483,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -169970,7 +164554,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if libc.Int32FromUint8(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if libc.Int32FromUint8(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -170245,7 +164833,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+25267, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+25346, libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -170675,7 +165263,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('0') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if libc.Int32FromUint8(c) == int32('\'') || libc.Int32FromUint8(c) == int32('v') || libc.Int32FromUint8(c) == int32('\n') || libc.Int32FromUint8(c) == int32('0') && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == libc.Int32FromUint8(c) && int32(0x80) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) && (int32(0xa8) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2))))) || int32(0xa9) == libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || libc.Int32FromUint8(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -170714,7 +165302,7 @@ parse_string: return libc.Int32FromUint32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8082, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8102, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return libc.Int32FromUint32(i + uint32(4)) } @@ -170722,7 +165310,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8087, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+8107, uint64(5)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(5))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return libc.Int32FromUint32(i + uint32(5)) } @@ -170799,14 +165387,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25193, int32(3)) == 0 { + if (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+25272, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25283) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25289, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+25368, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -170967,7 +165555,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1658, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1653, uint64(4)) == 0 && !(libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + uintptr(i+uint32(4))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return libc.Int32FromUint32(i + uint32(4)) } @@ -170991,7 +165579,7 @@ _38: goto _51 } if libc.Int32FromUint8(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25283) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -171036,7 +165624,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*uint8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -171049,7 +165637,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -171098,10 +165686,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = libc.Uint8FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if libc.Int32FromUint8(x) <= int32(11) { sz = uint32(x) @@ -171135,15 +165719,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = libc.Uint32FromInt32(libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && libc.Int64FromUint32(i)+libc.Int64FromUint32(sz)+libc.Int64FromUint32(n) > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-libc.Uint32FromInt32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -171212,15 +165796,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1658, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1653, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8082, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8102, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8087, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+8107, uint32(5)) return i + uint32(1) _6: ; @@ -171269,9 +165853,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 25197 + v19 = __ccgo_ts + 25276 } else { - v19 = __ccgo_ts + 11949 + v19 = __ccgo_ts + 11998 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -171307,9 +165891,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, uint8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, uint8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = uint8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*uint8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = uint8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -171336,7 +165923,7 @@ _11: sz2 -= k2 } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25295, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25374, uint32(2)) zIn2++ sz2-- continue @@ -171359,7 +165946,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, uint8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25298, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25377, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -171367,12 +165954,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25305, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25384, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25310, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25389, uint32(6)) case int32('\r'): if sz2 > uint32(2) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -171475,16 +166062,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -171552,7 +166129,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25317, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171575,12 +166152,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25320, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25399, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25317, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+25396, uint32(2)) } _jsonAppendChar(tls, pOut, uint8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -171595,50 +166172,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = libc.Uint32FromInt32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != libc.Uint32FromInt32(nBlob) { - return 0 - } - if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == libc.Uint32FromInt32(nBlob)) -} - // C documentation // // /* @@ -171690,6 +166223,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -171710,6 +166321,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = libc.Int64FromUint32(nIns) - libc.Int64FromUint32(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, libc.Uint32FromInt32(int32(-d))) != 0 { + return + } if d != 0 { if libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, libc.Uint32FromInt64(libc.Int64FromUint32((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -171782,9 +166396,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -171827,7 +166441,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && libc.Int32FromUint8(_sqlite3CtypeMap[*(*uint8)(unsafe.Pointer(z + 2))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = libc.Uint32FromInt32(v3) return uint32(2) case int32('\''): fallthrough @@ -172315,7 +166940,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } switch libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -172450,7 +167075,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -172551,7 +167176,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+25257, -int32(1)) return } @@ -172588,11 +167213,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25149, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25228, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -172605,7 +167227,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -172624,10 +167246,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25283) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+25362) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z))) == int32('-') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25276) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+25355) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), libc.Uint32FromInt32(n), z) } @@ -172666,7 +167288,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25323, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25402, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -172682,7 +167304,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -172763,7 +167385,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -172775,34 +167397,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && libc.Int32FromUint8(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (libc.Int32FromUint8(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || libc.Int32FromUint8(c) != int32(0x7b) && libc.Int32FromUint8(c) != int32(0x5b) && !(libc.Int32FromUint8(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -172885,7 +167527,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -172945,7 +167587,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -173080,7 +167722,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 25341 + v1 = __ccgo_ts + 25420 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -173090,7 +167732,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } eErr = uint8(1) @@ -173200,23 +167842,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25343, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25422, uint32(1)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25345, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25424, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+5235, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+5256, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1685, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1706, uint32(1)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25347, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25426, uint32(2)) _jsonAppendRaw(tls, bp, zPath, libc.Uint32FromInt32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+25350, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+25429, uint32(1)) } } } @@ -173252,11 +167894,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1658, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1653, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -173524,7 +168166,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -173548,7 +168190,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25352, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25431, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -173559,7 +168201,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25403, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25482, -int32(1)) _jsonStringReset(tls, bp) return } @@ -173631,7 +168273,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_remove_done @@ -173668,7 +168310,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+15960) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+16056) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -173699,9 +168341,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 25437 + v1 = __ccgo_ts + 25516 } else { - v1 = __ccgo_ts + 25441 + v1 = __ccgo_ts + 25520 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -173749,7 +168391,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25178, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25257, -int32(1)) } } goto json_type_done @@ -173796,7 +168438,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25448 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 25527 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -173870,17 +168512,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+25453, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+25532, -int32(1)) return } flags = libc.Uint8FromInt64(f & int64(0x0f)) @@ -173889,18 +168530,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if libc.Int32FromUint8(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if libc.Int32FromUint8(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -173962,9 +168602,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = libc.Int64FromUint32(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174071,7 +168709,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25510, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25589, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174163,20 +168801,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, uint8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, uint8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = libc.Uint32FromInt32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, uint8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, uint8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -174220,7 +168860,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+25513, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+25592, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -174248,16 +168888,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -174276,24 +168906,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -174301,13 +168913,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -174323,7 +168928,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25516) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+25595) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -174457,7 +169062,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if libc.Int32FromUint8((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25599, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+25678, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -174483,9 +169088,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25606, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+25685, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25614, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, libc.Int32FromUint32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+25693, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -174796,9 +169401,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = libc.Uint32FromInt32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -174871,7 +169475,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+25620, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+25699, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -174895,7 +169499,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25178, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+25257, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -174956,186 +169560,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25622, + FzName: __ccgo_ts + 25701, }, 1: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25627, + FzName: __ccgo_ts + 25706, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25633, + FzName: __ccgo_ts + 25712, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25644, + FzName: __ccgo_ts + 25723, }, 4: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25656, + FzName: __ccgo_ts + 25735, }, 5: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25656, + FzName: __ccgo_ts + 25735, }, 6: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25674, + FzName: __ccgo_ts + 25753, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25694, + FzName: __ccgo_ts + 25773, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25707, + FzName: __ccgo_ts + 25786, }, 9: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25721, + FzName: __ccgo_ts + 25800, }, 10: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25724, + FzName: __ccgo_ts + 25803, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25728, + FzName: __ccgo_ts + 25807, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25740, + FzName: __ccgo_ts + 25819, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25753, + FzName: __ccgo_ts + 25832, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25765, + FzName: __ccgo_ts + 25844, }, 15: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25778, + FzName: __ccgo_ts + 25857, }, 16: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25789, + FzName: __ccgo_ts + 25868, }, 17: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25801, + FzName: __ccgo_ts + 25880, }, 18: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25801, + FzName: __ccgo_ts + 25880, }, 19: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25813, + FzName: __ccgo_ts + 25892, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25824, + FzName: __ccgo_ts + 25903, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25836, + FzName: __ccgo_ts + 25915, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25849, + FzName: __ccgo_ts + 25928, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25862, + FzName: __ccgo_ts + 25941, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25876, + FzName: __ccgo_ts + 25955, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25885, + FzName: __ccgo_ts + 25964, }, 26: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25895, + FzName: __ccgo_ts + 25974, }, 27: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25895, + FzName: __ccgo_ts + 25974, }, 28: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25905, + FzName: __ccgo_ts + 25984, }, 29: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 25905, + FzName: __ccgo_ts + 25984, }, 30: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25916, + FzName: __ccgo_ts + 25995, }, 31: { FnArg: int16(1), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25933, + FzName: __ccgo_ts + 26012, }, 32: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 25951, + FzName: __ccgo_ts + 26030, }, 33: { FnArg: int16(2), FfuncFlags: libc.Uint32FromInt32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 25969, + FzName: __ccgo_ts + 26048, }, } @@ -175218,17 +169822,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 25988, + FzName: __ccgo_ts + 26067, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 25998, + FzName: __ccgo_ts + 26077, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -175278,224 +169884,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -175513,33 +169904,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type RtreeCell = TRtreeCell + +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -175550,79 +169935,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue +} + +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -175804,7 +170174,7 @@ func _nodeHashDelete(tls *libc.TLS, pRtree uintptr, pNode uintptr) { func _nodeNew(tls *libc.TLS, pRtree uintptr, pParent uintptr) (r uintptr) { var pNode uintptr _ = pNode - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if pNode != 0 { libc.Xmemset(tls, pNode, 0, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) (*TRtreeNode)(unsafe.Pointer(pNode)).FzData = pNode + 1*40 @@ -175867,7 +170237,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26008, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+26087, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -175878,7 +170248,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize == Xsqlite3_blob_bytes(tls, (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob) { - pNode = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + pNode = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize))) if !(pNode != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176172,7 +170542,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26013, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+26092, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -176709,7 +171079,7 @@ func _rtreeEnqueue(tls *libc.TLS, pCur uintptr, rScore TRtreeDValue, iLevel Tu8) _, _, _, _, _, _, _ = i, j, nNew, pNew, pParent, v1, v2 if (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPoint >= (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc { nNew = (*TRtreeCursor)(unsafe.Pointer(pCur)).FnPointAlloc*int32(2) + int32(8) - pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, libc.Uint64FromInt32(nNew)*uint64(24)) + pNew = Xsqlite3_realloc64(tls, (*TRtreeCursor)(unsafe.Pointer(pCur)).FaPoint, uint64(libc.Uint64FromInt32(nNew)*uint64(24))) if pNew == uintptr(0) { return uintptr(0) } @@ -177089,7 +171459,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26095) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+26174) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -177167,7 +171537,7 @@ func _rtreeFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr uintp */ rc = _nodeAcquire(tls, pRtree, int64(1), uintptr(0), bp) if rc == SQLITE_OK && argc > 0 { - (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(24)*libc.Uint64FromInt32(argc)) + (*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint = Xsqlite3_malloc64(tls, uint64(uint64(24)*libc.Uint64FromInt32(argc))) (*TRtreeCursor)(unsafe.Pointer(pCsr)).FnConstraint = argc if !((*TRtreeCursor)(unsafe.Pointer(pCsr)).FaConstraint != 0) { rc = int32(SQLITE_NOMEM) @@ -177398,7 +171768,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, libc.Uint64FromInt32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -177406,7 +171776,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -177644,7 +172014,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -178066,7 +172436,7 @@ func _SplitNode(tls *libc.TLS, pRtree uintptr, pNode uintptr, pCell uintptr, iHe /* Allocate an array and populate it with a copy of pCell and ** all cells from node pLeft. Then zero the original node. */ - aCell = Xsqlite3_malloc64(tls, (libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1))) + aCell = Xsqlite3_malloc64(tls, uint64((libc.Uint64FromInt64(48)+libc.Uint64FromInt64(4))*libc.Uint64FromInt32(nCell+libc.Int32FromInt32(1)))) if !(aCell != 0) { rc = int32(SQLITE_NOMEM) goto splitnode_out @@ -178575,11 +172945,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178592,11 +172962,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -178624,7 +172994,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26109, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26188, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -178634,11 +173004,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26129, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26208, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26161, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26240, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -178852,7 +173222,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26198, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+26277, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -178906,9 +173276,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 26343 + zFmt = __ccgo_ts + 26422 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11778, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+11827, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -178966,9 +173336,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 26399, - 1: __ccgo_ts + 5574, - 2: __ccgo_ts + 16855, + 0: __ccgo_ts + 26478, + 1: __ccgo_ts + 5595, + 2: __ccgo_ts + 16951, } var _rtreeModule = Tsqlite3_module{ @@ -179012,21 +173382,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26813, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26892, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26875, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26954, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26880, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+26944, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+27014, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+26959, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27023, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+27093, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -179056,7 +173426,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 27063 + zFormat = __ccgo_ts + 27142 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -179071,31 +173441,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27171, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+27250, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27216, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27295, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+13286, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+13335, int32(1)) } if ii1 < libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27243, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27322, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27265, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27344, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27273, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+27352, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -179109,14 +173479,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 26404, - 1: __ccgo_ts + 26457, - 2: __ccgo_ts + 26502, - 3: __ccgo_ts + 26554, - 4: __ccgo_ts + 26608, - 5: __ccgo_ts + 26653, - 6: __ccgo_ts + 26711, - 7: __ccgo_ts + 26766, + 0: __ccgo_ts + 26483, + 1: __ccgo_ts + 26536, + 2: __ccgo_ts + 26581, + 3: __ccgo_ts + 26633, + 4: __ccgo_ts + 26687, + 5: __ccgo_ts + 26732, + 6: __ccgo_ts + 26790, + 7: __ccgo_ts + 26845, } // C documentation @@ -179174,7 +173544,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27289, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27368, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -179182,17 +173552,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27309, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27388, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -179255,7 +173625,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt /* Allocate the sqlite3_vtab structure */ nDb = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8)))) nName = libc.Int32FromUint64(libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) - pRtree = Xsqlite3_malloc64(tls, uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8)) + pRtree = Xsqlite3_malloc64(tls, uint64(uint64(968)+libc.Uint64FromInt32(nDb)+libc.Uint64FromInt32(nName*int32(2))+uint64(8))) if !(pRtree != 0) { return int32(SQLITE_NOMEM) } @@ -179269,13 +173639,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27552, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27558, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27637, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -179284,7 +173654,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27582, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27661, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -179298,19 +173668,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27609, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -179333,7 +173703,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = libc.Uint8FromInt32(int32(8) + libc.Int32FromUint8((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -179344,7 +173714,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -179360,8 +173730,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 27588, - 1: __ccgo_ts + 27599, + 0: __ccgo_ts + 27667, + 1: __ccgo_ts + 27678, } // C documentation @@ -179419,21 +173789,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+11398, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+11447, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27612, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27691, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < libc.Int32FromUint8((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27618, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+27697, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+27622, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+27701, int32(1)) goto _1 _1: ; @@ -179460,7 +173830,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+27624, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+27703, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -179494,23 +173864,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -179563,7 +173916,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -179578,11 +173931,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 4277 + v1 = __ccgo_ts + 4298 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27657, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+27736, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -179616,7 +173969,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27664, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+27743, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -179633,7 +173986,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27709, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27788, libc.VaList(bp+8, iNode)) } } return pRet @@ -179662,8 +174015,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 27741, - 1: __ccgo_ts + 27795, + 0: __ccgo_ts + 27820, + 1: __ccgo_ts + 27874, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -179676,21 +174029,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 27843 + v1 = __ccgo_ts + 27922 } else { - v1 = __ccgo_ts + 27851 + v1 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27860, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27939, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 27843 + v2 = __ccgo_ts + 27922 } else { - v2 = __ccgo_ts + 27851 + v2 = __ccgo_ts + 27930 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27905, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27984, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -179735,7 +174088,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+27963, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28042, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -179753,7 +174106,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28011, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28090, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -179786,19 +174139,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28078, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28157, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28112, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28191, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28142, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28221, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -179843,12 +174196,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28197, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28276, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28228, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+28307, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -179877,7 +174230,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28295, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+28374, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -179887,11 +174240,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26109, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+26188, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28323, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+28402, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -179907,8 +174260,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+28354, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+28361, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28433, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+28440, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -179935,7 +174288,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28369, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+28448, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -179986,13 +174339,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28388, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+28467, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 6720 + zDb = __ccgo_ts + 6740 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -180001,7 +174354,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 18622 + v1 = __ccgo_ts + 18718 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -180095,14 +174448,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -180127,16 +174472,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -180268,7 +174603,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { (*(*TGeoParse)(unsafe.Pointer(bp))).Fz++ if (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex >= (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc { (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc = (*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc*int32(2) + int32(16) - aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2)) + aNew = Xsqlite3_realloc64(tls, (*(*TGeoParse)(unsafe.Pointer(bp))).Fa, uint64(libc.Uint64FromInt32((*(*TGeoParse)(unsafe.Pointer(bp))).FnAlloc)*uint64(4)*uint64(2))) if aNew == uintptr(0) { rc = int32(SQLITE_NOMEM) (*(*TGeoParse)(unsafe.Pointer(bp))).FnErr++ @@ -180313,7 +174648,7 @@ func _geopolyParseJson(tls *libc.TLS, z uintptr, pRc uintptr) (r uintptr) { if v2 && libc.Int32FromUint8(_geopolySkipSpace(tls, bp)) == libc.Int32FromInt32(0) { *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) (*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex-- /* Remove the redundant vertex at the end */ - pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) + pOut = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(40)+uint64(libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2))*libc.Uint64FromInt64(int64((*(*TGeoParse)(unsafe.Pointer(bp))).FnVertex)-libc.Int64FromInt32(4))) *(*int32)(unsafe.Pointer(bp + 32)) = int32(1) if pOut == uintptr(0) { goto parse_json_err @@ -180375,7 +174710,7 @@ func _geopolyFuncParam(tls *libc.TLS, pCtx uintptr, pVal uintptr, pRc uintptr) ( } nVertex = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(a + 1)))<= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -180743,7 +175078,7 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if n > int32(1000) { n = int32(1000) } - p = Xsqlite3_malloc64(tls, uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4)) + p = Xsqlite3_malloc64(tls, uint64(uint64(40)+libc.Uint64FromInt32((n-int32(1))*int32(2))*uint64(4))) if p == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) return @@ -180758,9 +175093,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -180845,7 +175180,7 @@ func _geopolyBBox(tls *libc.TLS, context uintptr, pPoly uintptr, aCoord uintptr, goto geopolyBboxFill geopolyBboxFill: ; - pOut = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4))) + pOut = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(40)+libc.Uint64FromInt64(4)*libc.Uint64FromInt32(2)*libc.Uint64FromInt32(libc.Int32FromInt32(4)-libc.Int32FromInt32(4)))) if pOut == uintptr(0) { Xsqlite3_free(tls, p) if context != 0 { @@ -180919,13 +175254,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -180986,7 +175314,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -181025,7 +175353,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -181129,7 +175457,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -181160,36 +175488,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -181213,7 +175511,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -181497,7 +175795,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != libc.Int32FromUint8((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -181654,7 +175952,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint if !(pRtree != 0) { return int32(SQLITE_NOMEM) } - libc.Xmemset(tls, pRtree, 0, uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8)) + libc.Xmemset(tls, pRtree, 0, uint64(uint64(968)+libc.Uint64FromInt64(nDb)+libc.Uint64FromInt64(nName*int64(2))+uint64(8))) (*TRtree)(unsafe.Pointer(pRtree)).FnBusy = uint32(1) (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FpModule = uintptr(unsafe.Pointer(&_rtreeModule)) (*TRtree)(unsafe.Pointer(pRtree)).FzDb = pRtree + 1*968 @@ -181666,13 +175964,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), libc.Uint64FromInt64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), libc.Uint64FromInt64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27552, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+27631, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28512, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28591, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -181681,13 +175979,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28534, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28613, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27609, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+27688, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -181695,7 +175993,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -181710,7 +176008,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -181922,7 +176220,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16855 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 16951 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -181932,7 +176230,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28538 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28617 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -181940,7 +176238,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28544 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 28623 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -182060,7 +176358,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28553, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+28632, 0) } goto geopoly_update_end } @@ -182160,16 +176458,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28593) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28672) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28609) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+28688) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -182239,7 +176537,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28786, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28865, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -182253,61 +176551,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28624, + FzName: __ccgo_ts + 28703, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28637, + FzName: __ccgo_ts + 28716, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28650, + FzName: __ccgo_ts + 28729, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 28663, + FzName: __ccgo_ts + 28742, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28609, + FzName: __ccgo_ts + 28688, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 28675, + FzName: __ccgo_ts + 28754, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 28593, + FzName: __ccgo_ts + 28672, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 28698, + FzName: __ccgo_ts + 28777, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28712, + FzName: __ccgo_ts + 28791, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 28725, + FzName: __ccgo_ts + 28804, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 28739, + FzName: __ccgo_ts + 28818, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 28755, + FzName: __ccgo_ts + 28834, }, } @@ -182333,7 +176631,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 28767, + FzName: __ccgo_ts + 28846, }, } @@ -182358,20 +176656,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28794, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28873, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28804, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28883, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28815, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+28894, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28538, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28617, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28826, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+28905, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -182445,7 +176743,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt32(nArg-libc.Int32FromInt32(1))*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) + nBlob = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nArg)*uint64(8) + libc.Uint64FromInt32(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -182473,17 +176771,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26095, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+26174, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -182491,33 +176791,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -182714,7 +177018,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -183135,248 +177439,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]uint8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -183690,7 +177752,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+28836, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -183700,7 +177762,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+28836, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+28915, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -183726,7 +177788,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -183749,7 +177811,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -183881,7 +177943,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28857, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+28936, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -183970,7 +178032,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26008, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+26087, zIn, uint64(4)) == 0 { i = int32(4) for { if !(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -184007,13 +178069,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 29028 + v1 = __ccgo_ts + 29107 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29069, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29148, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29219) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+29298) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -184180,7 +178242,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -184241,7 +178303,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29344, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29423, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -184251,7 +178313,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29463, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29542, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -184259,7 +178321,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29484, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29563, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -184271,7 +178333,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29535, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29614, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -184315,7 +178377,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29556, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -184328,7 +178390,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*libc.Uint64FromInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -184381,7 +178443,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20130, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+20226, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -184392,7 +178454,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29613, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29692, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -184403,7 +178465,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+29632, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+29711, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -184411,7 +178473,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29637, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+29716, zName) { bRbuRowid = int32(1) } } @@ -184425,17 +178487,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 29647 + v4 = __ccgo_ts + 29726 } else { - v4 = __ccgo_ts + 29660 + v4 = __ccgo_ts + 29739 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29669, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29748, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29698, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29777, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184457,7 +178519,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29720, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+29799, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -184496,15 +178558,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+29747, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+29826, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -184529,7 +178591,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 for int32(1) != 0 { i = 0 for { @@ -184538,7 +178600,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29756, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29835, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -184586,21 +178648,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29769, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29848, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29801, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29880, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1672, __ccgo_ts+15154, __ccgo_ts+29824) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29830, __ccgo_ts+29837, __ccgo_ts+5180) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1672, __ccgo_ts+15154, __ccgo_ts+1672) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+29903) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+29909, __ccgo_ts+29916, __ccgo_ts+5201) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29845, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29924, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+29887, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+29966, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -184649,10 +178711,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -184674,15 +178736,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 29907 + zCol = __ccgo_ts + 29986 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29915, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29936, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+29972, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 15154 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+29994, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+30015, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+30051, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 15203 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -184691,9 +178753,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29999, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30078, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -184708,15 +178770,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+30047, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 15154 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+30126, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 15203 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+30054, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+30133, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -184770,11 +178832,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1672 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1672 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1667 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1667 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -184783,8 +178845,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30066, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) - zType = __ccgo_ts + 1672 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30145, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zType = __ccgo_ts + 1667 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -184803,34 +178865,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 29907 + zCol = __ccgo_ts + 29986 } else { - zCol = __ccgo_ts + 29637 + zCol = __ccgo_ts + 29716 } } - zType = __ccgo_ts + 1146 + zType = __ccgo_ts + 1141 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30088, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+30167, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 29824 + v2 = __ccgo_ts + 29903 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30108, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+30187, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30129, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30162, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+30208, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+30241, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 15154 - zAnd = __ccgo_ts + 22239 + zCom = __ccgo_ts + 15203 + zAnd = __ccgo_ts + 22335 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -184876,7 +178938,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1672 + zS = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -184884,11 +178946,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30186, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30265, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+30198, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+30277, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 15154 + zS = __ccgo_ts + 15203 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -184900,7 +178962,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30207, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30286, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -184926,27 +178988,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30222, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30301, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30236, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 22239 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30315, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 22335 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+30248, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+30327, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1672 + zSep1 = __ccgo_ts + 1667 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -184954,8 +179016,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 22239 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 22335 } goto _2 _2: @@ -184978,7 +179040,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30311, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30390, 0) } // C documentation @@ -185012,7 +179074,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if libc.Int32FromUint64(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -185020,16 +179082,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*uint8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if libc.Int32FromUint8(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30298, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30377, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30337, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30416, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } else { if libc.Int32FromUint8(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+30367, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 15154 + zList = _rbuMPrintf(tls, p, __ccgo_ts+30446, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 15203 } } } @@ -185113,16 +179175,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 30404 + zSep = __ccgo_ts + 30483 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29556, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29635, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16743) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+16839) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } break } @@ -185133,16 +179195,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 29824 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+30417, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 15154 + z = _rbuMPrintf(tls, p, __ccgo_ts+30496, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 15203 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+30428, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+30507, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -185182,13 +179244,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1672 + zComma = __ccgo_ts + 1667 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30432) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30511) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -185196,7 +179258,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29584, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+29663, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -185205,21 +179267,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30482, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30561, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 29824 + v1 = __ccgo_ts + 29903 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+30504, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 15154 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+30583, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 15203 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+30514, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+30593, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30529, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30608, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185254,30 +179316,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1672 + zComma = __ccgo_ts + 1667 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1672 + zPk = __ccgo_ts + 1667 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 30591 + zPk = __ccgo_ts + 30670 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 30604 + v2 = __ccgo_ts + 30683 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30614, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 15154 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30693, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 15203 goto _1 _1: ; @@ -185286,17 +179348,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+30641, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+30720, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 30648 + v3 = __ccgo_ts + 30727 } else { - v3 = __ccgo_ts + 1672 + v3 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30663, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30742, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) } } @@ -185322,7 +179384,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30695, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30774, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -185368,7 +179430,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30752) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+30831) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -185537,7 +179599,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30818, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+30897, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -185554,18 +179616,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30838, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30917, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30903, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30982, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30939, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31018, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185580,26 +179642,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 30973 + v2 = __ccgo_ts + 31052 } else { - v2 = __ccgo_ts + 30977 + v2 = __ccgo_ts + 31056 } v1 = v2 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+30983, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31062, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31044, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31123, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 30973 + v3 = __ccgo_ts + 31052 } else { - v3 = __ccgo_ts + 30977 + v3 = __ccgo_ts + 31056 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31105, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+31184, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -185618,62 +179680,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6731) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6727) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6751) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+6747) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1672 + v4 = __ccgo_ts + 1667 } else { - v4 = __ccgo_ts + 31264 + v4 = __ccgo_ts + 31343 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 31273 + v5 = __ccgo_ts + 31352 } else { - v5 = __ccgo_ts + 1672 + v5 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31283, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31362, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31319, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31398, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1672 + zRbuRowid = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 31347 + zRbuRowid = __ccgo_ts + 31426 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 31359 + v6 = __ccgo_ts + 31438 } else { - v6 = __ccgo_ts + 1672 + v6 = __ccgo_ts + 1667 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31376, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31452, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+31455, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31531, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31751, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31830, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1672 + zRbuRowid1 = __ccgo_ts + 1667 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 31850 + v7 = __ccgo_ts + 31929 } else { - v7 = __ccgo_ts + 31860 + v7 = __ccgo_ts + 31939 } zRbuRowid1 = v7 } @@ -185686,28 +179748,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29907, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+29986, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1672, __ccgo_ts+15154, __ccgo_ts+1672) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1667, __ccgo_ts+15203, __ccgo_ts+1667) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 31871 + v8 = __ccgo_ts + 31950 } else { - v8 = __ccgo_ts + 1672 + v8 = __ccgo_ts + 1667 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1672 + v9 = __ccgo_ts + 1667 } if zOrder != 0 { - v10 = __ccgo_ts + 23495 + v10 = __ccgo_ts + 23591 } else { - v10 = __ccgo_ts + 1672 + v10 = __ccgo_ts + 1667 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31877, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+31956, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -185793,11 +179855,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1672 + zPrefix = __ccgo_ts + 1667 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 31264 + zPrefix = __ccgo_ts + 31343 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+31925, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+32004, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -185824,7 +179886,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -185871,7 +179933,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31955, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32034, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -185930,27 +179992,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+31985, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+32064, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32013, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+3492, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32092, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+3513, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+6720, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+6740, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32031, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32110, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -185983,10 +180045,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32097, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32176, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24838, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+24934, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*uint8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -186000,16 +180062,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 32129 + v2 = __ccgo_ts + 32208 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1672 + v3 = __ccgo_ts + 1667 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32131, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+32210, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -186020,27 +180082,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32163, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32242, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32178, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32257, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32195, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32274, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32211, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32290, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32239, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32318, 0) } } @@ -186090,7 +180152,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = libc.Int64FromUint64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -186192,7 +180254,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -186222,7 +180284,7 @@ func _rbuCaptureWalRead(tls *libc.TLS, pRbu uintptr, iOff Ti64, iAmt int32) (r i v1 = int32(64) } nNew = v1 * int32(2) - aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, libc.Uint64FromInt32(nNew)*uint64(8)) + aNew = Xsqlite3_realloc64(tls, (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FaFrame, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -186265,12 +180327,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = libc.Int64FromUint32((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -186292,21 +180354,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -186323,7 +180385,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32292, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+32371, 0) } // C documentation @@ -186340,13 +180402,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6720) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+6740) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32317, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32324, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+32396, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+32403, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -186478,7 +180540,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24395, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+24491, 0) return } if eType == int32(RBU_DELETE) && libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -186614,7 +180676,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32331) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+32410) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -186627,7 +180689,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32353, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32432, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -186654,7 +180716,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32380, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32459, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), libc.Int64FromUint32((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -186690,9 +180752,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32540, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32619, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32555, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32634, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -186715,9 +180777,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32575, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32654, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32600) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32679) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -186728,10 +180790,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32708) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32787) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32773) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+32852) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -186749,7 +180811,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32817, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32896, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -186776,8 +180838,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+17828) - _rbuCopyPragma(tls, p, __ccgo_ts+16939) + _rbuCopyPragma(tls, p, __ccgo_ts+17924) + _rbuCopyPragma(tls, p, __ccgo_ts+17035) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -186785,7 +180847,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32842, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32921, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -186807,10 +180869,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -186824,10 +180886,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -186897,7 +180959,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32870, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+32949, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -186920,10 +180982,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+32317, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+32396, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6720, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+6740, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -186945,7 +181007,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]uint8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32895, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+32974, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -186992,7 +181054,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32906, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+32985, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -187037,11 +181099,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32978, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33057, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+32992) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33071) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -187050,7 +181112,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33049) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33128) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -187098,7 +181160,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3869, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+3890, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -187130,7 +181192,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33123, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33202, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -187152,17 +181214,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 33155 + v3 = __ccgo_ts + 33234 } else { - v3 = __ccgo_ts + 33162 + v3 = __ccgo_ts + 33241 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33169, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33248, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15043, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15092, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -187174,21 +181236,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+17542) - _rbuCopyPragma(tls, p, __ccgo_ts+16954) + _rbuCopyPragma(tls, p, __ccgo_ts+17638) + _rbuCopyPragma(tls, p, __ccgo_ts+17050) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33201, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33280, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6720, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+6740, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33217, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+33296, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -187266,7 +181328,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33241, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+33320, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -187313,7 +181375,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31264, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+31343, uint64(8)) == 0 { nDel = int32(8) for libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) >= int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+libc.Uint32FromInt32(nDel))))) <= int32('9') { nDel++ @@ -187341,16 +181403,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15058, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -187360,7 +181422,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33249, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33328, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -187461,32 +181523,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15058, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15058, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+15107, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 15043 + v1 = __ccgo_ts + 15092 } else { - v1 = __ccgo_ts + 33201 + v1 = __ccgo_ts + 33280 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33201, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33280, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -187512,9 +181574,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -187586,7 +181650,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -187789,7 +181853,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -187840,14 +181904,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, libc.Uint64FromInt32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= libc.Int32FromUint64(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -189423,7 +183426,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33344, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+33423, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -189446,13 +183449,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33352 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33431 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33361 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33440 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33366 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 33445 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -189461,7 +183464,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -189550,12 +183553,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33376, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33455, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33531, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33610, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33545, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+33624, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -189632,7 +183635,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+33560, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+33639, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -189772,315 +183775,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -190833,7 +184527,7 @@ func _sessionGrowHash(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab uin } return SQLITE_OK } - libc.Xmemset(tls, apNew, 0, uint64(8)*libc.Uint64FromInt64(nNew)) + libc.Xmemset(tls, apNew, 0, uint64(uint64(8)*libc.Uint64FromInt64(nNew))) i = 0 for { if !(i < (*TSessionTable)(unsafe.Pointer(pTab)).FnChange) { @@ -190926,20 +184620,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11778, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33567, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33646, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1672, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1667, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33697, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+33776, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -190965,10 +184659,10 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+29907)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Xstrlen(tls, __ccgo_ts+29986))) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(libc.Uint64FromInt32(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1)))) pAlloc = _sessionMalloc64(tls, pSession, nByte) if pAlloc == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -190989,8 +184683,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+29907) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29907, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+29986) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+29986, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -191054,7 +184748,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -191071,6 +184765,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -191092,12 +184788,12 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11778, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { p3 = pSession + 64 - *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + (libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol) + libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) + libc.Uint64FromInt32(1))) + *(*Ti64)(unsafe.Pointer(p3)) = Ti64(uint64(*(*Ti64)(unsafe.Pointer(p3))) + uint64(libc.Uint64FromInt32(libc.Int32FromInt32(1)+_sessionVarintLen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+(*TSessionTable)(unsafe.Pointer(pTab)).FnCol)+libc.Xstrlen(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FzName)+libc.Uint64FromInt32(1))) } } } @@ -191387,10 +185083,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 11398 + zSep = __ccgo_ts + 11447 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33727, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+33806, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -191399,11 +185095,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1668 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5150, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 15154 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+5171, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 15203 goto _1 _1: ; @@ -191484,13 +185180,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -191722,7 +185411,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1672, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1667, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -191982,14 +185671,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -192049,7 +185730,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) i = 0 for { @@ -192057,8 +185738,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33734, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 22239 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33813, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 22335 if zRet == uintptr(0) { break } @@ -192077,7 +185758,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 zRet = uintptr(0) bHave = 0 i = 0 @@ -192087,8 +185768,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33768, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 33809 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33847, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 33888 if zRet == uintptr(0) { break } @@ -192099,7 +185780,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1792, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1813, 0) } return zRet } @@ -192110,12 +185791,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 33814 + v1 = __ccgo_ts + 33893 } else { - v1 = __ccgo_ts + 6725 + v1 = __ccgo_ts + 6745 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33825, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -192176,11 +185857,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 15154 + v2 = __ccgo_ts + 15203 } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33904, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+33983, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -192208,7 +185889,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+33923, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+34002, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -192237,17 +185918,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -192260,7 +185942,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -192271,18 +185955,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+34059, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34090, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -192308,7 +186018,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+33980, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+34111, 0) } rc = int32(SQLITE_SCHEMA) } @@ -192356,7 +186066,7 @@ func Xsqlite3session_create(tls *libc.TLS, db uintptr, zDb uintptr, ppSession ui /* Zero the output value in case an error occurs. */ *(*uintptr)(unsafe.Pointer(ppSession)) = uintptr(0) /* Allocate and populate the new session object. */ - pNew = Xsqlite3_malloc64(tls, uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(136)+libc.Uint64FromInt32(nDb)+uint64(1))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -192468,15 +186178,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -192640,7 +186352,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]uint8 - Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5212, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, libc.Int32FromUint64(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+5233, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -192934,18 +186646,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+34007, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11778, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+34011, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+34035, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+34044, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34089, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+34138, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+11827, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+34142, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+34166, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+34175, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34220, bp) } else { i = 0 for { @@ -192953,17 +186665,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15154, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 15154 + zSep = __ccgo_ts + 15203 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34103, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+34234, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34107, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+34238, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -192975,9 +186687,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34134, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+34265, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -193098,7 +186810,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -193112,14 +186824,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34176, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+34307, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193188,8 +186900,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -193214,18 +186926,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+34196, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+34327, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -193249,28 +186961,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -193409,7 +187125,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -193424,9 +187140,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -193455,20 +187171,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -193480,13 +187200,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), libc.Uint64FromInt32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), libc.Uint64FromInt32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -193642,7 +187363,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -193666,7 +187387,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -193681,7 +187402,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -193737,7 +187458,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -193842,7 +187563,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -193913,8 +187634,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -193948,7 +187669,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -193958,7 +187679,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -194037,7 +187758,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -194298,7 +188019,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -194375,7 +188096,7 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu } case int32(SQLITE_UPDATE): if uintptr(0) == apVal { - apVal = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2)) + apVal = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 24)))*uint64(2))) if uintptr(0) == apVal { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto finished_invert @@ -194447,11 +188168,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -194463,8 +188184,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -194492,12 +188213,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -194505,9 +188230,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -194520,14 +188245,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -194551,29 +188268,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -194650,18 +188344,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = libc.Int32FromUint64(uint64(24) * libc.Uint64FromInt32(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11778) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+11827) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, libc.Uint64FromInt32(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34214, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34345, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34227, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34358, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -194671,9 +188365,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 15154 + zSep = __ccgo_ts + 15203 } goto _2 _2: @@ -194681,8 +188375,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1672 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34238, bp) + zSep = __ccgo_ts + 1667 + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -194691,13 +188385,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34246, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34377, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34321, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 22239 + zSep = __ccgo_ts + 22335 } goto _3 _3: @@ -194780,13 +188474,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+8 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1672 + zSep = __ccgo_ts + 1667 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+34327, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34458, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34238, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34369, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194796,9 +188490,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34233, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34364, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 22239 + zSep = __ccgo_ts + 22335 } goto _1 _1: @@ -194806,10 +188500,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+34345, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34476, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+33809, bp) - zSep = __ccgo_ts + 1672 + _sessionAppendStr(tls, bp+8, __ccgo_ts+33888, bp) + zSep = __ccgo_ts + 1667 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -194818,16 +188512,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+34321, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34452, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 34353 + zSep = __ccgo_ts + 34484 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5180, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -194853,7 +188547,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6720, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+6740, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -194876,16 +188570,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+34358, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34489, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+22245, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+22341, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+15154, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+15203, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -194893,19 +188587,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34376, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34507, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+34387, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+34518, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+5180, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+5201, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -194928,12 +188622,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+11778, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+11827, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34391) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+34522) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34504) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+34635) } return rc } @@ -194977,7 +188671,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -194995,11 +188689,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -195176,7 +188870,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -195200,7 +188894,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -195215,7 +188909,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -195266,7 +188960,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -195306,10 +189000,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && libc.Int32FromUint8((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195347,11 +189041,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -195374,7 +189068,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -195393,7 +189087,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -195402,7 +189096,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -195412,10 +189106,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34648, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34779, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -195425,10 +189119,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34669, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34800, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -195441,7 +189135,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -195468,7 +189162,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -195496,7 +189190,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -195528,15 +189222,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34688, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34819, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34714, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+34845, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -195560,9 +189254,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -195572,7 +189266,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6720, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+6740, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -195591,18 +189285,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34744, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34875, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34788, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34919, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34859, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+34990, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11778) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+11827) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -195636,7 +189330,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -195645,7 +189339,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -195653,23 +189347,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+34919, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+35050, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+34949, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+34973, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+34949, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35104, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35080, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -195692,13 +189386,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -195707,11 +189405,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195719,10 +189421,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -195730,37 +189438,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -195783,7 +189483,7 @@ func _sessionChangeMerge(tls *libc.TLS, pTab uintptr, bRebase int32, bPatchset i pNew = uintptr(0) rc = SQLITE_OK if !(pExist != 0) { - pNew = Xsqlite3_malloc64(tls, uint64(32)+libc.Uint64FromInt32(nRec)) + pNew = Xsqlite3_malloc64(tls, uint64(uint64(32)+libc.Uint64FromInt32(nRec))) if !(pNew != 0) { return int32(SQLITE_NOMEM) } @@ -196153,7 +189853,7 @@ func _sessionChangesetFindTable(tls *libc.TLS, pGrp uintptr, zTab uintptr, pIter } /* If one was not found above, create a new table now */ if !(pTab != 0) { - pTab = Xsqlite3_malloc64(tls, uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1)) + pTab = Xsqlite3_malloc64(tls, uint64(uint64(88)+libc.Uint64FromInt32(*(*int32)(unsafe.Pointer(bp + 8)))+libc.Uint64FromInt32(nTab)+uint64(1))) if !(pTab != 0) { return int32(SQLITE_NOMEM) } @@ -196336,7 +190036,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -196371,8 +190071,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -196391,9 +190091,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -196445,7 +190145,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -196481,11 +190181,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -196498,18 +190204,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -196517,13 +190225,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -196565,12 +190275,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -196578,27 +190294,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -196753,7 +190460,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -196861,8 +190568,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, libc.Uint8FromInt32((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -196874,9 +190581,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -196950,21 +190657,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -197070,6 +190781,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -197115,24 +190827,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -197191,99 +190891,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -197305,14 +190912,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -197324,29 +190923,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -197402,15 +190984,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -197432,14 +191005,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -197510,7 +191075,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -197538,27 +191102,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -197589,7 +191144,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -198125,14 +191680,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -198143,16 +191690,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -198204,10 +191741,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -198313,12 +191850,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -198393,7 +191930,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35001, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35132, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -198749,7 +192286,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35029, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -198905,18 +192442,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -198999,22 +192524,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -199033,7 +192542,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = libc.Int32FromUint64(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35060, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+35191, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -199132,7 +192641,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 35067 + zErr = __ccgo_ts + 35198 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199143,7 +192652,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+24, bp+32) if *(*int32)(unsafe.Pointer(bp + 104)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1672, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1667, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 104)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -199192,16 +192701,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -199220,7 +192719,7 @@ func _fts5SentenceFinderAdd(tls *libc.TLS, p uintptr, iAdd int32) (r int32) { v1 = int32(64) } nNew = v1 - aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SFinder)(unsafe.Pointer(p)).FaFirst, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -199349,7 +192848,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } return v1 } @@ -199387,7 +192886,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 35117 + zErr = __ccgo_ts + 35248 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -199569,15 +193068,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -199658,7 +193148,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -199750,13 +193240,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -199782,13 +193272,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 35165 + z = __ccgo_ts + 35296 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 35221 + z1 = __ccgo_ts + 35352 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -199821,19 +193311,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 35279, + FzFunc: __ccgo_ts + 35410, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 35287, + FzFunc: __ccgo_ts + 35418, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 35297, + FzFunc: __ccgo_ts + 35428, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 35302, + FzFunc: __ccgo_ts + 35433, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -200221,7 +193711,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t uint8) (r int32) { var aBareword [128]Tu8 @@ -200308,21 +193798,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -200493,7 +193968,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1658, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1653, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -200631,13 +194106,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -200697,7 +194165,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = libc.Int32FromUint64(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+35318, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35449, zCmd, nCmd) == 0 { nByte = libc.Int32FromUint64(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -200723,12 +194191,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) < int32('0') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35325, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35456, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35356, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35487, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200737,7 +194205,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35389, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35520, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -200747,14 +194215,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35426, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35557, zCmd, nCmd) == 0 { p1 = zArg nArg = libc.Int64FromUint64(libc.Xstrlen(tls, zArg) + uint64(1)) - azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) + azArg = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*libc.Uint64FromInt64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35435, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35566, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -200781,7 +194249,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35468, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35599, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -200793,76 +194261,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35502, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35633, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35510, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35641, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*uint8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35542, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+35673, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35548, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35679, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35567, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35610, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35741, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35567, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35698, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35632, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35763, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35646, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35777, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35684, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35815, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35695, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35826, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35730, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35861, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35737, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35868, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+5589, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+5610, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 8414, + FzName: __ccgo_ts + 8434, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 17908, + FzName: __ccgo_ts + 18004, }, 2: { - FzName: __ccgo_ts + 35768, + FzName: __ccgo_ts + 35899, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -200870,20 +194338,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35776, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35907, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+35807, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+35938, zCmd, nCmd) == 0 { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35817, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35948, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35851, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35982, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -200944,16 +194412,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+35879) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16855) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35884, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+36010) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+16951) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36015, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+35914) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+36045) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35924, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36055, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -200979,7 +194447,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35955, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36086, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -200987,12 +194455,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35960, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36091, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35967, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36098, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35975, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } } goto _1 @@ -201008,9 +194476,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35982, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36113, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+35975, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+36106, 0) } goto _2 _2: @@ -201073,8 +194541,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+35879) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+35990, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+36010) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36121, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -201105,19 +194573,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36019, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36150, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1672 + v4 = __ccgo_ts + 1667 } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 16)) } else { - v5 = __ccgo_ts + 1672 + v5 = __ccgo_ts + 1667 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -201135,7 +194603,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36039, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36170, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -201143,37 +194611,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36089, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36220, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36144, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36275, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 35502 + zTail = __ccgo_ts + 35633 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 35502 + zTail = __ccgo_ts + 35633 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 36197 + zTail = __ccgo_ts + 36328 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36205, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36336, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16855, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+16951, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -201242,25 +194710,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36216, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36347, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } else { - v2 = __ccgo_ts + 15154 + v2 = __ccgo_ts + 15203 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36232, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36363, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36239, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+35879)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36370, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+36010)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -201293,7 +194761,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -201303,9 +194771,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -201418,7 +194886,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36265) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36396) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -201429,7 +194897,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36270) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36401) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -201440,7 +194908,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36279) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36410) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -201454,7 +194922,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36289) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36420) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -201465,7 +194933,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36299) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36430) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -201482,7 +194950,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36311) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36442) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -201497,7 +194965,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+35879) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36010) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -201512,7 +194980,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36323) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36454) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -201528,7 +194996,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36337) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+36468) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -201571,7 +195039,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 36347 + zSelect = __ccgo_ts + 36478 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -201591,7 +195059,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36379) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+36510) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -201602,7 +195070,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36387, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+36518, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -201667,112 +195135,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -201848,7 +195210,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36458, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36589, 0) return FTS5_EOF } goto _1 @@ -201859,7 +195221,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*uint8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36478, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36609, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -201874,13 +195236,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36509, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36640, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36512, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+36643, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+30973, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+31052, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -201924,7 +195286,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = libc.Int32FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -202457,16 +195819,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -202491,14 +195843,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -203563,7 +196907,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(SZALLOC)*uint64(8)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203573,7 +196917,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = libc.Int64FromUint64(uint64(32) + libc.Uint64FromInt32(nNew)*uint64(8)) + nByte1 = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, libc.Uint64FromInt64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -203619,14 +196963,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -203679,12 +197015,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*libc.Uint64FromInt32(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -203818,7 +197154,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = libc.Uint8FromInt32(bPrefix) @@ -203858,15 +197194,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24)+libc.Uint64FromInt32(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, libc.Uint64FromInt64(nByte)) @@ -203907,7 +197243,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -203945,8 +197281,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36516, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35029, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+36647, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+35160, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -203966,10 +197302,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if libc.Int32FromUint8(c) < int32('0') || libc.Int32FromUint8(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36521, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36652, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (libc.Int32FromUint8(*(*uint8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -204003,7 +197342,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol)) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -204053,7 +197392,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(8)+uint64(4)*libc.Uint64FromInt32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(libc.Uint64FromInt64(8)*libc.Uint64FromInt32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -204104,7 +197443,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21242, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+21338, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -204131,7 +197470,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = libc.Int64FromUint64(uint64(8) + libc.Uint64FromInt32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = libc.Int64FromUint64(libc.Uint64FromInt64(8) * libc.Uint64FromInt32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, libc.Uint64FromInt64(nByte)) @@ -204228,7 +197567,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36550, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36681, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -204313,7 +197652,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = libc.Int32FromUint64(uint64(56) + libc.Uint64FromInt32(nTerm)*uint64(8)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -204326,7 +197665,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -204400,7 +197739,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = libc.Int64FromUint64(uint64(56) + uint64(8)*libc.Uint64FromInt32(nChild-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+48) + libc.Uint64FromInt32(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -204426,11 +197765,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 36603 + v2 = __ccgo_ts + 36734 } else { - v2 = __ccgo_ts + 36516 + v2 = __ccgo_ts + 36647 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36610, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36741, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -204443,7 +197782,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36660, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36791, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -204564,14 +197903,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -204587,7 +197918,7 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r var i int32 var pBuf, pNode, pRet uintptr _, _, _, _ = i, pBuf, pNode, pRet - pRet = Xsqlite3_malloc64(tls, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) + pRet = Xsqlite3_malloc64(tls, uint64(uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase))) if pRet != 0 { libc.Xmemset(tls, pRet, 0, uint64(16)*libc.Uint64FromInt32((*TFts5Expr)(unsafe.Pointer(pExpr)).FnPhrase)) i = 0 @@ -204611,14 +197942,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -204920,7 +198243,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -204983,67 +198306,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -205181,7 +198444,7 @@ func _fts5HashResize(tls *libc.TLS, pHash uintptr) (r int32) { _, _, _, _, _, _ = apNew, apOld, i, iHash, nNew, p nNew = (*TFts5Hash)(unsafe.Pointer(pHash)).FnSlot * int32(2) apOld = (*TFts5Hash)(unsafe.Pointer(pHash)).FaSlot - apNew = Xsqlite3_malloc64(tls, libc.Uint64FromInt32(nNew)*uint64(8)) + apNew = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32(nNew)*uint64(8))) if !(apNew != 0) { return int32(SQLITE_NOMEM) } @@ -205493,7 +198756,7 @@ func _fts5HashEntrySort(tls *libc.TLS, pHash uintptr, pTerm uintptr, nTerm int32 _, _, _, _, _, _, _ = ap, i, iSlot, nMergeSlot, pEntry, pIter, pList nMergeSlot = int32(32) *(*uintptr)(unsafe.Pointer(ppSorted)) = uintptr(0) - ap = Xsqlite3_malloc64(tls, uint64(8)*libc.Uint64FromInt32(nMergeSlot)) + ap = Xsqlite3_malloc64(tls, uint64(uint64(8)*libc.Uint64FromInt32(nMergeSlot))) if !(ap != 0) { return int32(SQLITE_NOMEM) } @@ -205925,9 +199188,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -205964,7 +199227,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -206037,7 +199299,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -206072,7 +199333,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -206087,149 +199347,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -206237,187 +199361,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = libc.Uint8FromInt32(libc.Int32FromUint16(iVal) >> libc.Int32FromInt32(8)) @@ -206597,7 +199541,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36713, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -206702,7 +199646,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36719, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+36850, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -206731,7 +199675,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36770, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+36901, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -206765,7 +199709,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36819, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+36950, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -206843,7 +199787,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = libc.Int64FromUint64(uint64(48) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, libc.Uint64FromInt64(nByte)) @@ -206934,7 +199878,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36859, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+36990, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -206945,7 +199889,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36859, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+36990, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -207626,7 +200570,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = libc.Int64FromUint64(uint64(40) + libc.Uint64FromInt32(i)*uint64(32)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt32(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, libc.Uint64FromInt64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -207871,15 +200815,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+8) + libc.Uint64FromInt64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -207980,7 +200924,7 @@ func _fts5SegIterReverseInitPage(tls *libc.TLS, p uintptr, pIter uintptr) { /* If necessary, grow the pIter->aRowidOffset[] array. */ if iRowidOffset >= (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset { nNew = (*TFts5SegIter)(unsafe.Pointer(pIter)).FnRowidOffset + int32(8) - aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, libc.Uint64FromInt32(nNew)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TFts5SegIter)(unsafe.Pointer(pIter)).FaRowidOffset, uint64(libc.Uint64FromInt32(nNew)*uint64(4))) if aNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -208586,7 +201530,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+36887, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+37018, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -208675,7 +201619,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+36971, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+37102, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -209322,7 +202266,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(232)+uint64(128)*libc.Uint64FromInt64(nSlot-libc.Int64FromInt32(1))+uint64(4)*libc.Uint64FromInt64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+104)+libc.Uint64FromInt64(nSlot)*uint64(128)+uint64(4)*libc.Uint64FromInt64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -209348,14 +202292,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -209365,15 +202301,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -209487,7 +202414,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -209508,7 +202435,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -210232,7 +203159,7 @@ func _fts5WriteDlidxGrow(tls *libc.TLS, p uintptr, pWriter uintptr, nLvl int32) var nByte Tsize_t _, _ = aDlidx, nByte if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && nLvl >= (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FnDlidx { - aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(32)*libc.Uint64FromInt32(nLvl)) + aDlidx = Xsqlite3_realloc64(tls, (*TFts5SegWriter)(unsafe.Pointer(pWriter)).FaDlidx, uint64(uint64(32)*libc.Uint64FromInt32(nLvl))) if aDlidx == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -210291,7 +203218,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -210646,7 +203573,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, libc.Uint32FromInt32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37053, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+37184, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -211101,13 +204028,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -211152,7 +204072,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37110, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+37241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -211321,7 +204241,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -211639,7 +204559,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37171, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+37302, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -211914,7 +204834,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+32) + libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -211949,7 +204869,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Uint64FromInt64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = libc.Int64FromUint64(libc.Uint64FromInt32(nSeg) * uint64(56)) @@ -212228,16 +205148,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -212455,7 +205365,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -212492,7 +205402,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -212503,70 +205413,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -212635,7 +205482,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -212734,14 +205581,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -212788,19 +205627,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -212879,7 +205705,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -212929,7 +205755,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, libc.Int64FromUint64(uint64(16)+libc.Uint64FromInt64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -213011,15 +205837,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1672, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1667, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -213045,11 +205874,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37222, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37353, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26008, __ccgo_ts+37230, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+26087, __ccgo_ts+37361, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+11989, __ccgo_ts+37265, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+12038, __ccgo_ts+37396, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -213247,7 +206076,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = libc.Int32FromUint64(libc.Uint64FromInt32(nAlloc)*uint64(8) + uint64(64)) + nByte = libc.Int32FromUint64(uint64(libc.UintptrFromInt32(0)+56) + libc.Uint64FromInt32(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -213502,7 +206331,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37309) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+37440) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -213853,7 +206682,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+libc.Uint32FromInt32(nToken+libc.Int32FromInt32(1)) <= libc.Uint32FromInt32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, libc.Uint32FromInt32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -213975,7 +206804,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+56)+libc.Uint64FromInt32(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -214095,7 +206924,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36713, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+36844, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -214689,7 +207518,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37311, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+37442, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -214920,7 +207749,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37397) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+37528) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -215059,7 +207888,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -215114,87 +207942,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -215202,96 +207949,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -215542,7 +208199,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37402, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37533, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -215579,7 +208236,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*uint8)(unsafe.Pointer(idxStr + uintptr(v3))) = uint8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5212, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -215598,7 +208255,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*uint8)(unsafe.Pointer(idxStr + uintptr(v5))) = libc.Uint8FromInt32(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5212, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+5233, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -216048,7 +208705,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -216076,7 +208733,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3869, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+3890, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -216096,7 +208753,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = libc.Int64FromUint64(uint64(32) + uint64(4)*libc.Uint64FromInt32(nPhrase-libc.Int32FromInt32(1))) + nByte = libc.Int64FromUint64(uint64(libc.UintptrFromInt32(0)+24) + libc.Uint64FromInt32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, libc.Uint64FromInt64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -216111,21 +208768,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 15154 + v1 = __ccgo_ts + 15203 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1672 + v2 = __ccgo_ts + 1667 } if bDesc != 0 { - v3 = __ccgo_ts + 37441 + v3 = __ccgo_ts + 37572 } else { - v3 = __ccgo_ts + 37446 + v3 = __ccgo_ts + 37577 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37450, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+37581, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -216183,14 +208840,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37505, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+37636, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5571, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+5592, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37511, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37642, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -216240,7 +208897,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37539, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37670, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -216273,7 +208930,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37549, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37680, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -216307,7 +208964,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37570, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+37701, libc.VaList(bp+24, z)) } } } else { @@ -216315,7 +208972,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35297 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 35428 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -216472,7 +209129,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37603, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37734, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -216543,7 +209200,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1672 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1667 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -216672,7 +209329,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+37608, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+37739, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -216805,10 +209462,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -219344,12 +211938,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+38957, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39088, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39061, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39192, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39099, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39230, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -219358,7 +211952,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39137, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39268, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -219370,14 +211964,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26008, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+11989, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38291, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+26087, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+12038, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+38422, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36197, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36328, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35502, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+35633, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -219397,13 +211991,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 30648 + v1 = __ccgo_ts + 30727 } else { - v1 = __ccgo_ts + 1672 + v1 = __ccgo_ts + 1667 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39179, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+39310, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39209, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39340, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -219444,7 +212038,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39253, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+39384, 0) iOff = libc.Int32FromUint64(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -219452,7 +212046,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39276, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39407, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -219467,7 +212061,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39282, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+39413, libc.VaList(bp+8, i)) iOff += libc.Int32FromUint64(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -219476,22 +212070,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35502, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+35633, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 39288 + zCols = __ccgo_ts + 39419 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 39320 + zCols = __ccgo_ts + 39451 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36197, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36328, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38291, __ccgo_ts+39368, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+38422, __ccgo_ts+39499, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36379, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -219536,14 +212130,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -219613,14 +212199,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -219648,6 +212234,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if libc.Int32FromUint8(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -219660,11 +212247,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -219677,6 +212277,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -219911,12 +212512,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39385, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39516, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39435, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39566, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39464, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+39595, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -219924,7 +212525,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36379, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+36510, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -220226,7 +212827,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39493, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+39624, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -220259,17 +212860,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -220356,7 +212946,7 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 rc = SQLITE_OK libc.Xmemset(tls, bp, 0, uint64(40)) (*(*TFts5IntegrityCtx)(unsafe.Pointer(bp))).FpConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - aTotalSize = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8))) + aTotalSize = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TFts5Config)(unsafe.Pointer(pConfig)).FnCol)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(8)))) if !(aTotalSize != 0) { return int32(SQLITE_NOMEM) } @@ -220458,14 +213048,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+35502, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+35633, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { - aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4)) + aNew = Xsqlite3_realloc64(tls, (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaiException, uint64(libc.Uint64FromInt32(n+(*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException)*uint64(4))) if aNew != 0 { nNew = (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnException zCsr = z @@ -221117,11 +213689,11 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 } else { p = Xsqlite3_malloc(tls, int32(192)) if p != 0 { - zCat = __ccgo_ts + 39547 + zCat = __ccgo_ts + 39678 libc.Xmemset(tls, p, 0, uint64(192)) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = int32(FTS5_REMOVE_DIACRITICS_SIMPLE) (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold = int32(64) - (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1)) + (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold = Xsqlite3_malloc64(tls, uint64(libc.Uint64FromInt32((*TUnicode61Tokenizer)(unsafe.Pointer(p)).FnFold)*uint64(1))) if (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FaFold == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -221131,7 +213703,7 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 if !(rc == SQLITE_OK && i < nArg) { break } - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39556) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { zCat = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) } goto _1 @@ -221148,20 +213720,20 @@ func _fts5UnicodeCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int3 break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39567) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TUnicode61Tokenizer)(unsafe.Pointer(p)).FeRemoveDiacritic = libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) - int32('0') } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39525) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39656) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, int32(1)) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39536) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39667) { rc = _fts5UnicodeAddExceptions(tls, p, zArg, 0) } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39556) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39687) { /* no-op */ } else { rc = int32(SQLITE_ERROR) @@ -221197,7 +213769,7 @@ func _fts5UnicodeIsAlnum(tls *libc.TLS, p uintptr, iCode int32) (r int32) { return libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(p + 160 + uintptr(_sqlite3Fts5UnicodeCategory(tls, libc.Uint32FromInt32(iCode)))))) ^ _fts5UnicodeIsException(tls, p, iCode) } -func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5UnicodeTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, iUnused int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { var a, aFold, p, pEnd, zCsr, zOut, zTerm, v10, v11, v14, v15, v16, v17, v18, v19, v20, v21, v22, v23, v26, v27, v3, v4 uintptr var iCode Tu32 var ie, is, nFold, rc, v7 int32 @@ -221384,7 +213956,7 @@ _9: _5: ; /* Invoke the token callback */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, aFold, int32(int64(zOut)-int64(aFold)), is, ie) goto _2 _1: ; @@ -221412,14 +213984,6 @@ type TPorterTokenizer = struct { type PorterTokenizer = TPorterTokenizer -type TPorterTokenizer1 = struct { - Ftokenizer_v2 Tfts5_tokenizer_v2 - FpTokenizer uintptr - FaBuf [128]uint8 -} - -type PorterTokenizer1 = TPorterTokenizer1 - // C documentation // // /* @@ -221453,7 +214017,7 @@ func _fts5PorterCreate(tls *libc.TLS, pCtx uintptr, azArg uintptr, nArg int32, p pApi = pCtx rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zBase = __ccgo_ts + 39585 + zBase = __ccgo_ts + 39716 *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if nArg > 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -221497,14 +214061,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -221515,16 +214071,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c uint8, bYIsVowel int32) (r int32) { return libc.BoolInt32(libc.Int32FromUint8(c) == int32('a') || libc.Int32FromUint8(c) == int32('e') || libc.Int32FromUint8(c) == int32('i') || libc.Int32FromUint8(c) == int32('o') || libc.Int32FromUint8(c) == int32('u') || bYIsVowel != 0 && libc.Int32FromUint8(c) == int32('y')) } @@ -221670,64 +214216,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39595, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39726, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39598, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39729, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39603, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39734, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39608, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39739, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39611, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39614, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39745, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39619, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39750, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39624, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39755, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39628, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39759, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39634, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39765, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39639, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39770, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221736,49 +214282,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39643, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39774, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39647, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39778, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39650, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39781, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39654, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39785, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39658, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39789, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39662, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39793, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39666, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39797, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39670, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39801, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -221795,20 +214341,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39674, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39654, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39805, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39677, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39680, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39808, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39684, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39670, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39815, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -221824,75 +214370,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39687, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39818, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39654, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39695, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39702, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39833, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39707, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39838, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39603, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39734, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39712, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39843, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39598, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39729, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39717, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39670, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39722, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39853, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16057, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+16153, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39727, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39858, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39680, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39731, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39862, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39736, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39639, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39770, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39742, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39873, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39746, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39877, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39748, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39879, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39662, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -221901,48 +214447,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39754, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39885, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39670, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39801, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39762, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39893, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39654, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39768, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39899, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39654, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39785, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39773, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39904, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39779, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39910, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39666, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39787, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39918, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39795, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39926, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39799, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39930, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39662, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+39793, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -221950,21 +214496,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39807, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39938, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39813, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39944, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39666, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39797, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39819, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39950, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39680, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+39811, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -221982,48 +214528,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39826, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39957, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39611, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39831, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39962, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39836, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39967, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39611, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39842, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39973, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39611, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39742, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39795, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39926, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39848, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39979, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39854, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39985, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39595, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+39726, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -222039,13 +214585,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39860, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39991, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39864, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+39995, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39867, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39998, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -222053,7 +214599,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+39870, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40001, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -222150,14 +214696,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -222175,13 +214721,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -222218,14 +214757,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39874) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40005) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39567) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+39698) { if libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('0') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('1') && libc.Int32FromUint8(*(*uint8)(unsafe.Pointer(zArg))) != int32('2') || *(*uint8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -222263,7 +214802,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -222391,7 +214930,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -222467,11 +215006,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -222493,7 +215032,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+39889)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+40020)) } // C documentation @@ -222519,7 +215058,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 39585, + FzName: __ccgo_ts + 39716, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -222527,7 +215066,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 39897, + FzName: __ccgo_ts + 40028, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -222535,7 +215074,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 39889, + FzName: __ccgo_ts + 40020, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -222565,7 +215104,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+39903, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+40034, pApi, bp+96, uintptr(0)) } return rc } @@ -228026,39 +220565,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -228081,16 +220587,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39910) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40041) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39914) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40045) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+39918) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+40049) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+39927, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40058, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -228153,21 +220659,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 39961, - 1: __ccgo_ts + 40001, - 2: __ccgo_ts + 40036, + 0: __ccgo_ts + 40092, + 1: __ccgo_ts + 40132, + 2: __ccgo_ts + 40167, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+23984, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+24080, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40079, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40210, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -228188,23 +220695,23 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = libc.Int32FromUint64(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = libc.Int32FromUint64(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = libc.Int64FromUint64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = libc.Int64FromUint64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = libc.Int32FromUint64(uint64(64) + libc.Uint64FromInt32(nDb) + libc.Uint64FromInt32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = libc.Int64FromUint64(uint64(64) + libc.Uint64FromInt64(nDb) + libc.Uint64FromInt64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) (*TFts5VocabTable)(unsafe.Pointer(pRet)).Fdb = db (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl = pRet + 1*64 (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db = (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl + uintptr(nTab) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt32(nTab)) - libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt32(nDb)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl, zTab, libc.Uint64FromInt64(nTab)) + libc.Xmemcpy(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db, zDb, libc.Uint64FromInt64(nDb)) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Tbl) _sqlite3Fts5Dequote(tls, (*TFts5VocabTable)(unsafe.Pointer(pRet)).FzFts5Db) } @@ -228337,10 +220844,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40112, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40243, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40143, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+40274, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -228359,7 +220866,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40194, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+40325, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -228685,7 +221192,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1672 + zCopy = __ccgo_ts + 1667 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -228809,7 +221316,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40220, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+40351, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -228864,15 +221371,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 40230 + return __ccgo_ts + 40361 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -229094,7 +221601,7 @@ var Xsqlite3_temp_directory uintptr ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -229142,11 +221649,11 @@ var Xsqlite3_temp_directory uintptr // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]uint8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]uint8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-10.2.1 20210110\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12.2.0\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_PTHREADS\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00open\x00close\x00access\x00getcwd\x00stat\x00fstat\x00ftruncate\x00fcntl\x00read\x00pread\x00pread64\x00write\x00pwrite\x00pwrite64\x00fchmod\x00fallocate\x00unlink\x00openDirectory\x00mkdir\x00rmdir\x00fchown\x00geteuid\x00mmap\x00munmap\x00mremap\x00getpagesize\x00readlink\x00lstat\x00ioctl\x00attempt to open \"%s\" as file descriptor %d\x00/dev/null\x00os_unix.c:%d: (%d) %s(%s) - %s\x00cannot fstat db file %s\x00file unlinked while open: %s\x00multiple links to file: %s\x00file renamed while open: %s\x00%s\x00full_fsync\x00%s-shm\x00readonly_shm\x00psow\x00unix-excl\x00%s.lock\x00/var/tmp\x00/usr/tmp\x00/tmp\x00SQLITE_TMPDIR\x00TMPDIR\x00%s/etilqs_%llx%c\x00modeof\x00fsync\x00/dev/urandom\x00unix\x00unix-none\x00unix-dotfile\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00so\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00exclusive\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_openbsd_amd64.go b/vendor/modernc.org/sqlite/lib/sqlite_openbsd_amd64.go index 184d08c..bed28f2 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_openbsd_amd64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_openbsd_amd64.go @@ -113181,8 +113181,8 @@ var mu mutex func init() { mu.recursive = true } func Xsqlite3_initialize(tls *libc.TLS) int32 { - mu.enter(tls.ID) - defer mu.leave(tls.ID) + mutexEnter(tls, uintptr(unsafe.Pointer(&mu))) + defer mutexLeave(tls, uintptr(unsafe.Pointer(&mu))) var pMainMtx uintptr var rc int32 diff --git a/vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go b/vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go index 349839c..3764e7a 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_openbsd_arm64.go @@ -113186,8 +113186,8 @@ var mu mutex func init() { mu.recursive = true } func Xsqlite3_initialize(tls *libc.TLS) int32 { - mu.enter(tls.ID) - defer mu.leave(tls.ID) + mutexEnter(tls, uintptr(unsafe.Pointer(&mu))) + defer mutexLeave(tls, uintptr(unsafe.Pointer(&mu))) var pMainMtx uintptr var rc int32 diff --git a/vendor/modernc.org/sqlite/lib/sqlite_windows.go b/vendor/modernc.org/sqlite/lib/sqlite_windows.go index 6e155c2..5b3a68f 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_windows.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_windows.go @@ -1,4 +1,4 @@ -// Code generated for windows/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/windows/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/windows/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/windows/amd64 -extended-errors -o sqlite3.go sqlite3.c --cpp /usr/bin/x86_64-w64-mingw32-gcc --goarch amd64 --goos windows -DSQLITE_HAVE_C99_MATH_FUNCS=(1) -DSQLITE_OS_WIN=1 -DSQLITE_OMIT_SEH -build-lines \/\/go:build windows && (amd64 || arm64)\n -map gcc=x86_64-w64-mingw32-gcc -eval-all-macros', DO NOT EDIT. +// Code generated for windows/amd64 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/windows/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/windows/amd64 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/windows/amd64 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP --cpp /usr/bin/x86_64-w64-mingw32-gcc --goarch amd64 --goos windows -DSQLITE_HAVE_C99_MATH_FUNCS=(1) -DSQLITE_OS_WIN=1 -DSQLITE_OMIT_SEH -build-lines \/\/go:build windows && (amd64 || arm64)\n -map gcc=x86_64-w64-mingw32-gcc -eval-all-macros', DO NOT EDIT. //go:build windows && (amd64 || arm64) @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -724,7 +726,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -872,6 +873,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 512 const BackupEventLog = 0 const BeginUpdateResource = 0 @@ -12206,6 +12208,7 @@ const NONZEROLHND = 2 const NONZEROLPTR = 0 const NON_PAGED_DEBUG_SIGNATURE = 18766 const NOPARITY = 0 +const NORETRY = 16384 const NORMAL_PRINT = 0 const NORMAL_PRIORITY_CLASS = 32 const NORM_IGNORECASE = 1 @@ -16873,6 +16876,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -17110,6 +17114,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -17321,6 +17326,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -17342,6 +17348,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 +const SQLITE_MUTEX_NOOP = 1 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -17485,6 +17492,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -17493,7 +17501,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -17604,8 +17612,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -20072,9 +20080,6 @@ const WINPERF_LOG_NONE = 0 const WINPERF_LOG_USER = 1 const WINPERF_LOG_VERBOSE = 3 const WINSHELLAPI = "DECLSPEC_IMPORT" -const WINSHM_RDLCK = 2 -const WINSHM_UNLCK = 1 -const WINSHM_WRLCK = 3 const WINSPOOLAPI = "DECLSPEC_IMPORT" const WINSTA_ACCESSCLIPBOARD = 4 const WINSTA_ACCESSGLOBALATOMS = 32 @@ -21704,6 +21709,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -21713,9 +21721,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -22843,12 +22848,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -22977,400 +22976,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - -/* -** CAPI3REF: Standard File Control Opcodes -** KEYWORDS: {file control opcodes} {file control opcode} -** -** These integer constants are opcodes for the xFileControl method -** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] -** interface. -** -**
      -**
    • [[SQLITE_FCNTL_LOCKSTATE]] -** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This -** opcode causes the xFileControl method to write the current state of -** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], -** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) -** into an integer that the pArg argument points to. -** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. -** -**
    • [[SQLITE_FCNTL_SIZE_HINT]] -** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS -** layer a hint of how large the database file will grow to be during the -** current transaction. This hint is not guaranteed to be accurate but it -** is often close. The underlying VFS might choose to preallocate database -** file space based on this hint in order to help writes to the database -** file run faster. -** -**
    • [[SQLITE_FCNTL_SIZE_LIMIT]] -** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that -** implements [sqlite3_deserialize()] to set an upper bound on the size -** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. -** If the integer pointed to is negative, then it is filled in with the -** current limit. Otherwise the limit is set to the larger of the value -** of the integer pointed to and the current database size. The integer -** pointed to is set to the new limit. -** -**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] -** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS -** extends and truncates the database file in chunks of a size specified -** by the user. The fourth argument to [sqlite3_file_control()] should -** point to an integer (type int) containing the new chunk-size to use -** for the nominated database. Allocating database file space in large -** chunks (say 1MB at a time), may reduce file-system fragmentation and -** improve performance on some systems. -** -**
    • [[SQLITE_FCNTL_FILE_POINTER]] -** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer -** to the [sqlite3_file] object associated with a particular database -** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. -** -**
    • [[SQLITE_FCNTL_JOURNAL_POINTER]] -** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer -** to the [sqlite3_file] object associated with the journal file (either -** the [rollback journal] or the [write-ahead log]) for a particular database -** connection. See also [SQLITE_FCNTL_FILE_POINTER]. -** -**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] -** No longer in use. -** -**
    • [[SQLITE_FCNTL_SYNC]] -** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and -** sent to the VFS immediately before the xSync method is invoked on a -** database file descriptor. Or, if the xSync method is not invoked -** because the user has configured SQLite with -** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place -** of the xSync method. In most cases, the pointer argument passed with -** this file-control is NULL. However, if the database file is being synced -** as part of a multi-database commit, the argument points to a nul-terminated -** string containing the transactions super-journal file name. VFSes that -** do not need this signal should silently ignore this opcode. Applications -** should not call [sqlite3_file_control()] with this opcode as doing so may -** disrupt the operation of the specialized VFSes that do require it. -** -**
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] -** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite -** and sent to the VFS after a transaction has been committed immediately -** but before the database is unlocked. VFSes that do not need this signal -** should silently ignore this opcode. Applications should not call -** [sqlite3_file_control()] with this opcode as doing so may disrupt the -** operation of the specialized VFSes that do require it. -** -**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] -** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic -** retry counts and intervals for certain disk I/O operations for the -** windows [VFS] in order to provide robustness in the presence of -** anti-virus programs. By default, the windows VFS will retry file read, -** file write, and file delete operations up to 10 times, with a delay -** of 25 milliseconds before the first retry and with the delay increasing -** by an additional 25 milliseconds with each subsequent retry. This -** opcode allows these two values (10 retries and 25 milliseconds of delay) -** to be adjusted. The values are changed for all database connections -** within the same process. The argument is a pointer to an array of two -** integers where the first integer is the new retry count and the second -** integer is the delay. If either integer is negative, then the setting -** is not changed but instead the prior value of that setting is written -** into the array entry, allowing the current retry settings to be -** interrogated. The zDbName parameter is ignored. -** -**
    • [[SQLITE_FCNTL_PERSIST_WAL]] -** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the -** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary -** write ahead log ([WAL file]) and shared memory -** files used for transaction control -** are automatically deleted when the latest connection to the database -** closes. Setting persistent WAL mode causes those files to persist after -** close. Persisting the files is useful when other processes that do not -** have write permission on the directory containing the database file want -** to read the database file, as the WAL and shared memory files must exist -** in order for the database to be readable. The fourth parameter to -** [sqlite3_file_control()] for this opcode should be a pointer to an integer. -** That integer is 0 to disable persistent WAL mode or 1 to enable persistent -** WAL mode. If the integer is -1, then it is overwritten with the current -** WAL persistence setting. -** -**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] -** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the -** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting -** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the -** xDeviceCharacteristics methods. The fourth parameter to -** [sqlite3_file_control()] for this opcode should be a pointer to an integer. -** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage -** mode. If the integer is -1, then it is overwritten with the current -** zero-damage mode setting. -** -**
    • [[SQLITE_FCNTL_OVERWRITE]] -** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening -** a write transaction to indicate that, unless it is rolled back for some -** reason, the entire database file will be overwritten by the current -** transaction. This is used by VACUUM operations. -** -**
    • [[SQLITE_FCNTL_VFSNAME]] -** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of -** all [VFSes] in the VFS stack. The names are of all VFS shims and the -** final bottom-level VFS are written into memory obtained from -** [sqlite3_malloc()] and the result is stored in the char* variable -** that the fourth parameter of [sqlite3_file_control()] points to. -** The caller is responsible for freeing the memory when done. As with -** all file-control actions, there is no guarantee that this will actually -** do anything. Callers should initialize the char* variable to a NULL -** pointer in case this file-control is not implemented. This file-control -** is intended for diagnostic use only. -** -**
    • [[SQLITE_FCNTL_VFS_POINTER]] -** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level -** [VFSes] currently in use. ^(The argument X in -** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be -** of type "[sqlite3_vfs] **". This opcodes will set *X -** to a pointer to the top-level VFS.)^ -** ^When there are multiple VFS shims in the stack, this opcode finds the -** upper-most shim only. -** -**
    • [[SQLITE_FCNTL_PRAGMA]] -** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] -** file control is sent to the open [sqlite3_file] object corresponding -** to the database file to which the pragma statement refers. ^The argument -** to the [SQLITE_FCNTL_PRAGMA] file control is an array of -** pointers to strings (char**) in which the second element of the array -** is the name of the pragma and the third element is the argument to the -** pragma or NULL if the pragma has no argument. ^The handler for an -** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element -** of the char** argument point to a string obtained from [sqlite3_mprintf()] -** or the equivalent and that string will become the result of the pragma or -** the error message if the pragma fails. ^If the -** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal -** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] -** file control returns [SQLITE_OK], then the parser assumes that the -** VFS has handled the PRAGMA itself and the parser generates a no-op -** prepared statement if result string is NULL, or that returns a copy -** of the result string if the string is non-NULL. -** ^If the [SQLITE_FCNTL_PRAGMA] file control returns -** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means -** that the VFS encountered an error while handling the [PRAGMA] and the -** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] -** file control occurs at the beginning of pragma statement analysis and so -** it is able to override built-in [PRAGMA] statements. -** -**
    • [[SQLITE_FCNTL_BUSYHANDLER]] -** ^The [SQLITE_FCNTL_BUSYHANDLER] -** file-control may be invoked by SQLite on the database file handle -** shortly after it is opened in order to provide a custom VFS with access -** to the connection's busy-handler callback. The argument is of type (void**) -** - an array of two (void *) values. The first (void *) actually points -** to a function of type (int (*)(void *)). In order to invoke the connection's -** busy-handler, this function should be invoked with the second (void *) in -** the array as the only argument. If it returns non-zero, then the operation -** should be retried. If it returns zero, the custom VFS should abandon the -** current operation. -** -**
    • [[SQLITE_FCNTL_TEMPFILENAME]] -** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control -** to have SQLite generate a -** temporary filename using the same algorithm that is followed to generate -** temporary filenames for TEMP tables and other internal uses. The -** argument should be a char** which will be filled with the filename -** written into memory obtained from [sqlite3_malloc()]. The caller should -** invoke [sqlite3_free()] on the result to avoid a memory leak. -** -**
    • [[SQLITE_FCNTL_MMAP_SIZE]] -** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the -** maximum number of bytes that will be used for memory-mapped I/O. -** The argument is a pointer to a value of type sqlite3_int64 that -** is an advisory maximum number of bytes in the file to memory map. The -** pointer is overwritten with the old value. The limit is not changed if -** the value originally pointed to is negative, and so the current limit -** can be queried by passing in a pointer to a negative number. This -** file-control is used internally to implement [PRAGMA mmap_size]. -** -**
    • [[SQLITE_FCNTL_TRACE]] -** The [SQLITE_FCNTL_TRACE] file control provides advisory information -** to the VFS about what the higher layers of the SQLite stack are doing. -** This file control is used by some VFS activity tracing [shims]. -** The argument is a zero-terminated string. Higher layers in the -** SQLite stack may generate instances of this file control if -** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. -** -**
    • [[SQLITE_FCNTL_HAS_MOVED]] -** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a -** pointer to an integer and it writes a boolean into that integer depending -** on whether or not the file has been renamed, moved, or deleted since it -** was first opened. -** -**
    • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] -** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the -** underlying native file handle associated with a file handle. This file -** control interprets its argument as a pointer to a native file handle and -** writes the resulting value there. -** -**
    • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] -** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This -** opcode causes the xFileControl method to swap the file handle with the one -** pointed to by the pArg argument. This capability is used during testing -** and only needs to be supported when SQLITE_TEST is defined. -** -**
    • [[SQLITE_FCNTL_NULL_IO]] -** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor -** or file handle for the [sqlite3_file] object such that it will no longer -** read or write to the database file. -** -**
    • [[SQLITE_FCNTL_WAL_BLOCK]] -** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might -** be advantageous to block on the next WAL lock if the lock is not immediately -** available. The WAL subsystem issues this signal during rare -** circumstances in order to fix a problem with priority inversion. -** Applications should not use this file-control. -** -**
    • [[SQLITE_FCNTL_ZIPVFS]] -** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other -** VFS should return SQLITE_NOTFOUND for this opcode. -** -**
    • [[SQLITE_FCNTL_RBU]] -** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by -** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for -** this opcode. -** -**
    • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] -** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then -** the file descriptor is placed in "batch write mode", which -** means all subsequent write operations will be deferred and done -** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems -** that do not support batch atomic writes will return SQLITE_NOTFOUND. -** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to -** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or -** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make -** no VFS interface calls on the same [sqlite3_file] file descriptor -** except for calls to the xWrite method and the xFileControl method -** with [SQLITE_FCNTL_SIZE_HINT]. -** -**
    • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] -** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write -** operations since the previous successful call to -** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. -** This file control returns [SQLITE_OK] if and only if the writes were -** all performed successfully and have been committed to persistent storage. -** ^Regardless of whether or not it is successful, this file control takes -** the file descriptor out of batch write mode so that all subsequent -** write operations are independent. -** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without -** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. -** -**
    • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] -** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write -** operations since the previous successful call to -** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. -** ^This file control takes the file descriptor out of batch write mode -** so that all subsequent write operations are independent. -** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without -** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. -** -**
    • [[SQLITE_FCNTL_LOCK_TIMEOUT]] -** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS -** to block for up to M milliseconds before failing when attempting to -** obtain a file lock using the xLock or xShmLock methods of the VFS. -** The parameter is a pointer to a 32-bit signed integer that contains -** the value that M is to be set to. Before returning, the 32-bit signed -** integer is overwritten with the previous value of M. -** -**
    • [[SQLITE_FCNTL_DATA_VERSION]] -** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to -** a database file. The argument is a pointer to a 32-bit unsigned integer. -** The "data version" for the pager is written into the pointer. The -** "data version" changes whenever any change occurs to the corresponding -** database file, either through SQL statements on the same database -** connection or through transactions committed by separate database -** connections possibly in other processes. The [sqlite3_total_changes()] -** interface can be used to find if any database on the connection has changed, -** but that interface responds to changes on TEMP as well as MAIN and does -** not provide a mechanism to detect changes to MAIN only. Also, the -** [sqlite3_total_changes()] interface responds to internal changes only and -** omits changes made by other database connections. The -** [PRAGMA data_version] command provides a mechanism to detect changes to -** a single attached database that occur due to other database connections, -** but omits changes implemented by the database connection on which it is -** called. This file control is the only mechanism to detect changes that -** happen either internally or externally and that are associated with -** a particular attached database. -** -**
    • [[SQLITE_FCNTL_CKPT_START]] -** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint -** in wal mode before the client starts to copy pages from the wal -** file to the database file. -** -**
    • [[SQLITE_FCNTL_CKPT_DONE]] -** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint -** in wal mode after the client has finished copying pages from the wal -** file to the database file, but before the *-shm file is updated to -** record the fact that the pages have been checkpointed. -** -**
    • [[SQLITE_FCNTL_EXTERNAL_READER]] -** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect -** whether or not there is a database client in another process with a wal-mode -** transaction open on the database or not. It is only available on unix.The -** (void*) argument passed with this file-control should be a pointer to a -** value of type (int). The integer value is set to 1 if the database is a wal -** mode database and there exists at least one client in another process that -** currently has an SQL transaction open on the database. It is set to 0 if -** the database is not a wal-mode db, or if there is no such connection in any -** other process. This opcode cannot be used to detect transactions opened -** by clients within the current process, only within other processes. -** -**
    • [[SQLITE_FCNTL_CKSM_FILE]] -** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the -** [checksum VFS shim] only. -** -**
    • [[SQLITE_FCNTL_RESET_CACHE]] -** If there is currently no transaction open on the database, and the -** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control -** purges the contents of the in-memory page cache. If there is an open -** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. -**
    - */ - -/* deprecated names */ - -// C documentation -// -// /* -// ** CAPI3REF: Mutex Handle -// ** -// ** The mutex module within SQLite defines [sqlite3_mutex] to be an -// ** abstract type for a mutex object. The SQLite core never looks -// ** at the internal representation of an [sqlite3_mutex]. It only -// ** deals with pointers to the [sqlite3_mutex] object. -// ** -// ** Mutexes are created using [sqlite3_mutex_alloc()]. -// */ -type Tsqlite3_mutex = struct { - Fmutex TCRITICAL_SECTION - Fid int32 -} - -type sqlite3_mutex = Tsqlite3_mutex - // C documentation // // /* @@ -23652,6 +23257,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -23882,33 +23488,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -23987,19 +23566,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -24084,7 +23650,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -24176,223 +23741,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -24474,20 +23822,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -24537,13 +23871,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -24602,9 +23929,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -24612,17 +23939,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -24649,12 +23976,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -24671,7 +23998,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -24689,7 +24016,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -24723,24 +24050,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -24764,22 +24073,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -24840,7 +24133,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -24920,50 +24213,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -25360,340 +24609,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -25703,15 +24618,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -25727,14 +24633,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -25760,17 +24658,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -25825,11 +24712,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -26203,55 +25096,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint64 type size_t = Tsize_t @@ -26602,6 +25451,11 @@ type max_align_t = Tmax_align_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -26660,6 +25514,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -26769,14 +25634,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -26861,7 +25718,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -26963,7 +25820,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -27022,6 +25878,7 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 @@ -27033,9 +25890,9 @@ type TExpr = struct { type Expr = TExpr type TExprList = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item + F__ccgo_align [0]uint64 + FnExpr int32 + FnAlloc int32 } type ExprList = TExprList @@ -27050,7 +25907,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -27099,8 +25955,8 @@ type TFuncDefHash = struct { type FuncDefHash = TFuncDefHash type TIdList = struct { - FnId int32 - Fa [1]TIdList_item + F__ccgo_align [0]uint64 + FnId int32 } type IdList = TIdList @@ -27164,7 +26020,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -27236,19 +26091,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo44 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -27262,11 +26120,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -27277,40 +26132,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -27328,7 +26184,7 @@ type TPreUpdate = struct { FpCsr uintptr Fop int32 FaRecord uintptr - Fkeyinfo TKeyInfo + FpKeyinfo uintptr FpUnpacked uintptr FpNewUnpacked uintptr FiNewReg int32 @@ -27340,6 +26196,7 @@ type TPreUpdate = struct { FpTab uintptr FpPk uintptr FapDflt uintptr + FkeyinfoSpace [32]Tu8 } type PreUpdate = TPreUpdate @@ -27490,9 +26347,9 @@ type TSrcItem = struct { type SrcItem = TSrcItem type TSrcList = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem + F__ccgo_align [0]uint64 + FnSrc int32 + FnAlloc Tu32 } type SrcList = TSrcList @@ -27509,10 +26366,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -27547,6 +26400,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -27727,7 +26581,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -27769,7 +26622,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -27942,9 +26794,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -28071,53 +26923,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - FpKey uintptr - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -28221,16 +27026,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -28254,38 +27049,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -28298,34 +27066,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -28339,90 +27083,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { FpDirty uintptr FpDirtyTail uintptr @@ -28441,187 +27101,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -28631,913 +27110,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - Fu1 struct { - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - FzName uintptr - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo8 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - Fi [0]Ti64 - Fz uintptr - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo100 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -29562,611 +27134,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -30176,317 +27143,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - F__ccgo_pad2 [4]byte - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -30572,228 +27228,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -30937,11 +27371,11 @@ var _sqlite3azCompileOpt = [55]uintptr{ 47: __ccgo_ts + 1024, 48: __ccgo_ts + 1046, 49: __ccgo_ts + 1067, - 50: __ccgo_ts + 1077, - 51: __ccgo_ts + 1086, - 52: __ccgo_ts + 1094, - 53: __ccgo_ts + 1108, - 54: __ccgo_ts + 1121, + 50: __ccgo_ts + 1078, + 51: __ccgo_ts + 1087, + 52: __ccgo_ts + 1095, + 53: __ccgo_ts + 1109, + 54: __ccgo_ts + 1122, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -31772,12 +28206,12 @@ var _sqlite3StdTypeAffinity = [6]int8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1134, - 1: __ccgo_ts + 1138, - 2: __ccgo_ts + 1143, - 3: __ccgo_ts + 1147, - 4: __ccgo_ts + 1155, - 5: __ccgo_ts + 1160, + 0: __ccgo_ts + 1135, + 1: __ccgo_ts + 1139, + 2: __ccgo_ts + 1144, + 3: __ccgo_ts + 1148, + 4: __ccgo_ts + 1156, + 5: __ccgo_ts + 1161, } /************** End of global.c **********************************************/ @@ -31877,7 +28311,6 @@ type TVdbeSorter = struct { FiPrev Tu8 FnTask Tu8 FtypeMask Tu8 - FaTask [1]TSortSubtask } type VdbeSorter = TVdbeSorter @@ -31955,72 +28388,10 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - FpCValue uintptr - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -32066,164 +28437,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - -/* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. - */ - /* -** Clear any existing type flags from a Mem and replace them with f +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -32249,18 +28467,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -32277,100 +28483,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo200 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -32392,13 +28504,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -32418,14 +28523,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -32504,7 +28602,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= int32(libc.Uint64FromInt64(80)/libc.Uint64FromInt64(8)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -32676,7 +28774,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*32))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + uint32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(32)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + uint32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(40)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -32734,7 +28832,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -32906,24 +29004,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -33054,7 +29134,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1165, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1166, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -33086,13 +29166,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1173, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1174, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if int32(*(*int8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1181, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1182, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -33100,7 +29180,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -33171,10 +29251,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -33242,7 +29322,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1185, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1186, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -33310,7 +29390,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -33343,14 +29423,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1197) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1198) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1201) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1208) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1209) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -33407,7 +29487,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -33557,7 +29637,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { *(*Ttime_t)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) } if _osLocaltime(tls, bp, bp+8) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1218, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1219, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_year + int32(1900) - iYearDiff @@ -33565,7 +29645,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 8))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -33643,7 +29723,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -33712,7 +29792,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1241) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1242) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -33727,7 +29807,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1246) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1247) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -33740,7 +29820,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1255) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(int32((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -33755,7 +29835,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1260) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1261) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -33770,7 +29850,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1270) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1271) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -33787,11 +29867,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1280) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1281) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -33800,7 +29880,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1290) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1291) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -33847,7 +29927,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1294, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1295, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -33877,8 +29957,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1303, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1201) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1208) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1304, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1209) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -33897,16 +29977,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1314) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1319) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1320) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1324) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1325) == 0 { rc = 0 } } @@ -33948,10 +30028,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1328, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1329, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1332, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1333, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -33972,11 +30052,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1336, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1337, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1348, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1349, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -34014,7 +30094,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1173, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1174, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -34094,7 +30174,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -34251,7 +30331,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -34299,7 +30379,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -34404,7 +30484,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -34491,9 +30571,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if int32(cf) == int32('d') { - v3 = __ccgo_ts + 1360 + v3 = __ccgo_ts + 1361 } else { - v3 = __ccgo_ts + 1365 + v3 = __ccgo_ts + 1366 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -34501,9 +30581,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1369, libc.VaList(bp+184, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+184, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1376, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1377, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -34513,17 +30593,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 80))).FvalidYMD = 0 _computeYMD(tls, bp+80) if int32(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1392, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp + 80))).FY)) } case int32('H'): fallthrough case int32('k'): if int32(cf) == int32('H') { - v4 = __ccgo_ts + 1360 + v4 = __ccgo_ts + 1361 } else { - v4 = __ccgo_ts + 1365 + v4 = __ccgo_ts + 1366 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -34537,50 +30617,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if int32(cf) == int32('I') { - v5 = __ccgo_ts + 1360 + v5 = __ccgo_ts + 1361 } else { - v5 = __ccgo_ts + 1365 + v5 = __ccgo_ts + 1366 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+184, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1396, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1397, libc.VaList(bp+184, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1401, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1402, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if int32(cf) == int32('p') { - v6 = __ccgo_ts + 1407 + v6 = __ccgo_ts + 1408 } else { - v6 = __ccgo_ts + 1410 + v6 = __ccgo_ts + 1411 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if int32(cf) == int32('p') { - v7 = __ccgo_ts + 1413 + v7 = __ccgo_ts + 1414 } else { - v7 = __ccgo_ts + 1416 + v7 = __ccgo_ts + 1417 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1419, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1420, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1429, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1430, libc.VaList(bp+184, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1434, libc.VaList(bp+184, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1435, libc.VaList(bp+184, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+184, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1439, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1440, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -34590,18 +30670,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 128)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 128))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 128))).FvalidYMD = 0 _computeYMD(tls, bp+128) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+184, _daysAfterJan01(tls, bp+128)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+184, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1392, libc.VaList(bp+184, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), int8('%')) default: @@ -34757,7 +30837,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1454, libc.VaList(bp+136, int32(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1455, libc.VaList(bp+136, int32(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -34790,55 +30870,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1260, + FzName: __ccgo_ts + 1261, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1280, + FzName: __ccgo_ts + 1281, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1488, + FzName: __ccgo_ts + 1489, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1493, + FzName: __ccgo_ts + 1494, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1498, + FzName: __ccgo_ts + 1499, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1507, + FzName: __ccgo_ts + 1508, }, 6: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1516, + FzName: __ccgo_ts + 1517, }, 7: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1525, + FzName: __ccgo_ts + 1526, }, 8: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1538, + FzName: __ccgo_ts + 1539, }, 9: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1556, + FzName: __ccgo_ts + 1557, }, } @@ -34920,28 +31000,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -34949,19 +31029,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -34978,12 +31058,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -34991,7 +31071,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -35004,34 +31084,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -35133,7 +31213,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -35344,14 +31424,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -35366,9 +31439,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -35509,7 +31582,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1569, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1570, libc.VaList(bp+8, nByte)) } return p } @@ -35571,7 +31644,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1607, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1608, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -35782,7 +31855,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -35802,11 +31879,9 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld - _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) - _sqlite3MemoryBarrier(tls) return rc } @@ -35989,6 +32064,16 @@ func init() { *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_noopMutexLeave) } +// C documentation +// +// /* +// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation +// ** is used regardless of the run-time threadsafety setting. +// */ +func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { + return _sqlite3NoopMutex(tls) +} + type T_EXCEPTION_POINTERS = struct { FExceptionRecord TPEXCEPTION_RECORD FContextRecord TPCONTEXT @@ -40624,21 +36709,6 @@ type TPMEM_EXTENDED_PARAMETER = uintptr type PMEM_EXTENDED_PARAMETER = TPMEM_EXTENDED_PARAMETER -type TMEM_EXTENDED_PARAMETER1 = struct { - F__ccgo0_0 struct { - F__ccgo0 uint64 - } - F__ccgo1_8 struct { - FPointer [0]TPVOID - FSize [0]TSIZE_T - FHandle [0]THANDLE - FULong [0]TDWORD - FULong64 TDWORD64 - } -} - -type MEM_EXTENDED_PARAMETER1 = TMEM_EXTENDED_PARAMETER1 - type TMEM_SECTION_EXTENDED_PARAMETER_TYPE = int32 type MEM_SECTION_EXTENDED_PARAMETER_TYPE = TMEM_SECTION_EXTENDED_PARAMETER_TYPE @@ -40664,12 +36734,6 @@ type TPFILE_ID_128 = uintptr type PFILE_ID_128 = TPFILE_ID_128 -type TFILE_ID_1281 = struct { - FIdentifier [16]TBYTE -} - -type FILE_ID_1281 = TFILE_ID_1281 - type TFILE_NOTIFY_INFORMATION = struct { FNextEntryOffset TDWORD FAction TDWORD @@ -42273,15 +38337,6 @@ type TPIMAGE_AUX_SYMBOL_TOKEN_DEF = uintptr type PIMAGE_AUX_SYMBOL_TOKEN_DEF = TPIMAGE_AUX_SYMBOL_TOKEN_DEF -type TIMAGE_AUX_SYMBOL_TOKEN_DEF1 = struct { - FbAuxType TBYTE - FbReserved TBYTE - FSymbolTableIndex TDWORD - FrgbReserved [12]TBYTE -} - -type IMAGE_AUX_SYMBOL_TOKEN_DEF1 = TIMAGE_AUX_SYMBOL_TOKEN_DEF1 - type TIMAGE_AUX_SYMBOL = struct { FFile [0]struct { FName [18]TBYTE @@ -42969,17 +39024,6 @@ type T_PIMAGE_RUNTIME_FUNCTION_ENTRY = uintptr type _PIMAGE_RUNTIME_FUNCTION_ENTRY = T_PIMAGE_RUNTIME_FUNCTION_ENTRY -type T_IMAGE_RUNTIME_FUNCTION_ENTRY1 = struct { - FBeginAddress TDWORD - FEndAddress TDWORD - F__ccgo2_8 struct { - FUnwindData [0]TDWORD - FUnwindInfoAddress TDWORD - } -} - -type _IMAGE_RUNTIME_FUNCTION_ENTRY1 = T_IMAGE_RUNTIME_FUNCTION_ENTRY1 - type TIMAGE_IA64_RUNTIME_FUNCTION_ENTRY = struct { FBeginAddress TDWORD FEndAddress TDWORD @@ -43291,26 +39335,6 @@ type TPIMAGE_COR20_HEADER = uintptr type PIMAGE_COR20_HEADER = TPIMAGE_COR20_HEADER -type TIMAGE_COR20_HEADER1 = struct { - Fcb TDWORD - FMajorRuntimeVersion TWORD - FMinorRuntimeVersion TWORD - FMetaData TIMAGE_DATA_DIRECTORY - FFlags TDWORD - F__ccgo5_20 struct { - FEntryPointRVA [0]TDWORD - FEntryPointToken TDWORD - } - FResources TIMAGE_DATA_DIRECTORY - FStrongNameSignature TIMAGE_DATA_DIRECTORY - FCodeManagerTable TIMAGE_DATA_DIRECTORY - FVTableFixups TIMAGE_DATA_DIRECTORY - FExportAddressTableJumps TIMAGE_DATA_DIRECTORY - FManagedNativeHeader TIMAGE_DATA_DIRECTORY -} - -type IMAGE_COR20_HEADER1 = TIMAGE_COR20_HEADER1 - type TSLIST_ENTRY = struct { FNext uintptr } @@ -48203,19 +44227,6 @@ type TLPFILE_ID_DESCRIPTOR = uintptr type LPFILE_ID_DESCRIPTOR = TLPFILE_ID_DESCRIPTOR -type TFILE_ID_DESCRIPTOR1 = struct { - FdwSize TDWORD - FType TFILE_ID_TYPE - F__ccgo2_8 struct { - FObjectId [0]TGUID - FExtendedFileId [0]TFILE_ID_128 - FFileId TLARGE_INTEGER - F__ccgo_pad3 [8]byte - } -} - -type FILE_ID_DESCRIPTOR1 = TFILE_ID_DESCRIPTOR1 - type TDRAWPATRECT = struct { FptPosition TPOINT FptSize TPOINT @@ -59281,15 +55292,6 @@ type TPDRVCONFIGINFOEX = uintptr type PDRVCONFIGINFOEX = TPDRVCONFIGINFOEX -type TDRVCONFIGINFOEX1 = struct { - FdwDCISize TDWORD - FlpszDCISectionName TLPCWSTR - FlpszDCIAliasName TLPCWSTR - FdnDevNode TDWORD -} - -type DRVCONFIGINFOEX1 = TDRVCONFIGINFOEX1 - type TNPDRVCONFIGINFOEX = uintptr type NPDRVCONFIGINFOEX = TNPDRVCONFIGINFOEX @@ -64862,10 +60864,6 @@ type TFD_SET = struct { type FD_SET = TFD_SET -type Tfd_set1 = TFD_SET - -type fd_set1 = Tfd_set1 - type TPFD_SET = uintptr type PFD_SET = TPFD_SET @@ -72121,11 +68119,11 @@ const _PROXY_MARSHAL = 2 const _PROXY_SENDRECEIVE = 3 const _PROXY_UNMARSHAL = 4 -type TIRpcStubBuffer1 = struct { +type TIRpcStubBuffer = struct { FlpVtbl uintptr } -type IRpcStubBuffer1 = TIRpcStubBuffer1 +type IRpcStubBuffer = TIRpcStubBuffer type TRPC_SS_THREAD_HANDLE = uintptr @@ -72171,12 +68169,6 @@ const _REGCLS_MULTI_SEPARATE = 2 const _REGCLS_SUSPENDED = 4 const _REGCLS_SURROGATE = 8 -type TIRpcStubBuffer = struct { - FlpVtbl uintptr -} - -type IRpcStubBuffer = TIRpcStubBuffer - type TIRpcChannelBuffer = struct { FlpVtbl uintptr } @@ -72483,12 +68475,6 @@ type TIUnknownVtbl = struct { type IUnknownVtbl = TIUnknownVtbl -type TIUnknown1 = struct { - FlpVtbl uintptr -} - -type IUnknown1 = TIUnknown1 - type TAsyncIUnknownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72503,12 +68489,6 @@ type TAsyncIUnknownVtbl = struct { type AsyncIUnknownVtbl = TAsyncIUnknownVtbl -type TAsyncIUnknown1 = struct { - FlpVtbl uintptr -} - -type AsyncIUnknown1 = TAsyncIUnknown1 - type TLPCLASSFACTORY = uintptr type LPCLASSFACTORY = TLPCLASSFACTORY @@ -72523,12 +68503,6 @@ type TIClassFactoryVtbl = struct { type IClassFactoryVtbl = TIClassFactoryVtbl -type TIClassFactory1 = struct { - FlpVtbl uintptr -} - -type IClassFactory1 = TIClassFactory1 - type TIMarshal = struct { FlpVtbl uintptr } @@ -72848,12 +68822,6 @@ type TIMarshalVtbl = struct { type IMarshalVtbl = TIMarshalVtbl -type TIMarshal1 = struct { - FlpVtbl uintptr -} - -type IMarshal1 = TIMarshal1 - type TINoMarshalVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72862,12 +68830,6 @@ type TINoMarshalVtbl = struct { type INoMarshalVtbl = TINoMarshalVtbl -type TINoMarshal1 = struct { - FlpVtbl uintptr -} - -type INoMarshal1 = TINoMarshal1 - type TIAgileObjectVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72876,12 +68838,6 @@ type TIAgileObjectVtbl = struct { type IAgileObjectVtbl = TIAgileObjectVtbl -type TIAgileObject1 = struct { - FlpVtbl uintptr -} - -type IAgileObject1 = TIAgileObject1 - type TIAgileReferenceVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72891,12 +68847,6 @@ type TIAgileReferenceVtbl = struct { type IAgileReferenceVtbl = TIAgileReferenceVtbl -type TIAgileReference1 = struct { - FlpVtbl uintptr -} - -type IAgileReference1 = TIAgileReference1 - type TLPMARSHAL2 = uintptr type LPMARSHAL2 = TLPMARSHAL2 @@ -72915,12 +68865,6 @@ type TIMarshal2Vtbl = struct { type IMarshal2Vtbl = TIMarshal2Vtbl -type TIMarshal21 = struct { - FlpVtbl uintptr -} - -type IMarshal21 = TIMarshal21 - type TLPMALLOC = uintptr type LPMALLOC = TLPMALLOC @@ -72939,12 +68883,6 @@ type TIMallocVtbl = struct { type IMallocVtbl = TIMallocVtbl -type TIMalloc1 = struct { - FlpVtbl uintptr -} - -type IMalloc1 = TIMalloc1 - type TLPSTDMARSHALINFO = uintptr type LPSTDMARSHALINFO = TLPSTDMARSHALINFO @@ -72958,12 +68896,6 @@ type TIStdMarshalInfoVtbl = struct { type IStdMarshalInfoVtbl = TIStdMarshalInfoVtbl -type TIStdMarshalInfo1 = struct { - FlpVtbl uintptr -} - -type IStdMarshalInfo1 = TIStdMarshalInfo1 - type TLPEXTERNALCONNECTION = uintptr type LPEXTERNALCONNECTION = TLPEXTERNALCONNECTION @@ -72988,12 +68920,6 @@ type TIExternalConnectionVtbl = struct { type IExternalConnectionVtbl = TIExternalConnectionVtbl -type TIExternalConnection1 = struct { - FlpVtbl uintptr -} - -type IExternalConnection1 = TIExternalConnection1 - type TLPMULTIQI = uintptr type LPMULTIQI = TLPMULTIQI @@ -73019,12 +68945,6 @@ type TIMultiQIVtbl = struct { type IMultiQIVtbl = TIMultiQIVtbl -type TIMultiQI1 = struct { - FlpVtbl uintptr -} - -type IMultiQI1 = TIMultiQI1 - type TAsyncIMultiQIVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73035,12 +68955,6 @@ type TAsyncIMultiQIVtbl = struct { type AsyncIMultiQIVtbl = TAsyncIMultiQIVtbl -type TAsyncIMultiQI1 = struct { - FlpVtbl uintptr -} - -type AsyncIMultiQI1 = TAsyncIMultiQI1 - type TIInternalUnknownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73050,12 +68964,6 @@ type TIInternalUnknownVtbl = struct { type IInternalUnknownVtbl = TIInternalUnknownVtbl -type TIInternalUnknown1 = struct { - FlpVtbl uintptr -} - -type IInternalUnknown1 = TIInternalUnknown1 - type TLPENUMUNKNOWN = uintptr type LPENUMUNKNOWN = TLPENUMUNKNOWN @@ -73072,12 +68980,6 @@ type TIEnumUnknownVtbl = struct { type IEnumUnknownVtbl = TIEnumUnknownVtbl -type TIEnumUnknown1 = struct { - FlpVtbl uintptr -} - -type IEnumUnknown1 = TIEnumUnknown1 - type TLPENUMSTRING = uintptr type LPENUMSTRING = TLPENUMSTRING @@ -73094,12 +68996,6 @@ type TIEnumStringVtbl = struct { type IEnumStringVtbl = TIEnumStringVtbl -type TIEnumString1 = struct { - FlpVtbl uintptr -} - -type IEnumString1 = TIEnumString1 - type TISequentialStreamVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73110,12 +69006,6 @@ type TISequentialStreamVtbl = struct { type ISequentialStreamVtbl = TISequentialStreamVtbl -type TISequentialStream1 = struct { - FlpVtbl uintptr -} - -type ISequentialStream1 = TISequentialStream1 - type TLPSTREAM = uintptr type LPSTREAM = TLPSTREAM @@ -73190,12 +69080,6 @@ type TIStreamVtbl = struct { type IStreamVtbl = TIStreamVtbl -type TIStream1 = struct { - FlpVtbl uintptr -} - -type IStream1 = TIStream1 - type TRPCOLEDATAREP = uint32 type RPCOLEDATAREP = TRPCOLEDATAREP @@ -73233,12 +69117,6 @@ type TIRpcChannelBufferVtbl = struct { type IRpcChannelBufferVtbl = TIRpcChannelBufferVtbl -type TIRpcChannelBuffer1 = struct { - FlpVtbl uintptr -} - -type IRpcChannelBuffer1 = TIRpcChannelBuffer1 - type TIRpcChannelBuffer2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73253,12 +69131,6 @@ type TIRpcChannelBuffer2Vtbl = struct { type IRpcChannelBuffer2Vtbl = TIRpcChannelBuffer2Vtbl -type TIRpcChannelBuffer21 = struct { - FlpVtbl uintptr -} - -type IRpcChannelBuffer21 = TIRpcChannelBuffer21 - type TIAsyncRpcChannelBufferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73276,12 +69148,6 @@ type TIAsyncRpcChannelBufferVtbl = struct { type IAsyncRpcChannelBufferVtbl = TIAsyncRpcChannelBufferVtbl -type TIAsyncRpcChannelBuffer1 = struct { - FlpVtbl uintptr -} - -type IAsyncRpcChannelBuffer1 = TIAsyncRpcChannelBuffer1 - type TIRpcChannelBuffer3Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73303,12 +69169,6 @@ type TIRpcChannelBuffer3Vtbl = struct { type IRpcChannelBuffer3Vtbl = TIRpcChannelBuffer3Vtbl -type TIRpcChannelBuffer31 = struct { - FlpVtbl uintptr -} - -type IRpcChannelBuffer31 = TIRpcChannelBuffer31 - type TIRpcSyntaxNegotiateVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73318,12 +69178,6 @@ type TIRpcSyntaxNegotiateVtbl = struct { type IRpcSyntaxNegotiateVtbl = TIRpcSyntaxNegotiateVtbl -type TIRpcSyntaxNegotiate1 = struct { - FlpVtbl uintptr -} - -type IRpcSyntaxNegotiate1 = TIRpcSyntaxNegotiate1 - type TIRpcProxyBufferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73334,12 +69188,6 @@ type TIRpcProxyBufferVtbl = struct { type IRpcProxyBufferVtbl = TIRpcProxyBufferVtbl -type TIRpcProxyBuffer1 = struct { - FlpVtbl uintptr -} - -type IRpcProxyBuffer1 = TIRpcProxyBuffer1 - type TIRpcStubBufferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73365,12 +69213,6 @@ type TIPSFactoryBufferVtbl = struct { type IPSFactoryBufferVtbl = TIPSFactoryBufferVtbl -type TIPSFactoryBuffer1 = struct { - FlpVtbl uintptr -} - -type IPSFactoryBuffer1 = TIPSFactoryBuffer1 - type TSChannelHookCallInfo = struct { Fiid TIID FcbSize TDWORD @@ -73396,12 +69238,6 @@ type TIChannelHookVtbl = struct { type IChannelHookVtbl = TIChannelHookVtbl -type TIChannelHook1 = struct { - FlpVtbl uintptr -} - -type IChannelHook1 = TIChannelHook1 - type TSOLE_AUTHENTICATION_SERVICE = struct { FdwAuthnSvc TDWORD FdwAuthzSvc TDWORD @@ -73483,12 +69319,6 @@ type TIClientSecurityVtbl = struct { type IClientSecurityVtbl = TIClientSecurityVtbl -type TIClientSecurity1 = struct { - FlpVtbl uintptr -} - -type IClientSecurity1 = TIClientSecurity1 - type TIServerSecurityVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73501,12 +69331,6 @@ type TIServerSecurityVtbl = struct { type IServerSecurityVtbl = TIServerSecurityVtbl -type TIServerSecurity1 = struct { - FlpVtbl uintptr -} - -type IServerSecurity1 = TIServerSecurity1 - type TRPCOPT_PROPERTIES = int32 type RPCOPT_PROPERTIES = TRPCOPT_PROPERTIES @@ -73537,12 +69361,6 @@ type TIRpcOptionsVtbl = struct { type IRpcOptionsVtbl = TIRpcOptionsVtbl -type TIRpcOptions1 = struct { - FlpVtbl uintptr -} - -type IRpcOptions1 = TIRpcOptions1 - type TGLOBALOPT_PROPERTIES = int32 type GLOBALOPT_PROPERTIES = TGLOBALOPT_PROPERTIES @@ -73610,12 +69428,6 @@ type TIGlobalOptionsVtbl = struct { type IGlobalOptionsVtbl = TIGlobalOptionsVtbl -type TIGlobalOptions1 = struct { - FlpVtbl uintptr -} - -type IGlobalOptions1 = TIGlobalOptions1 - type TLPSURROGATE = uintptr type LPSURROGATE = TLPSURROGATE @@ -73630,12 +69442,6 @@ type TISurrogateVtbl = struct { type ISurrogateVtbl = TISurrogateVtbl -type TISurrogate1 = struct { - FlpVtbl uintptr -} - -type ISurrogate1 = TISurrogate1 - type TLPGLOBALINTERFACETABLE = uintptr type LPGLOBALINTERFACETABLE = TLPGLOBALINTERFACETABLE @@ -73651,12 +69457,6 @@ type TIGlobalInterfaceTableVtbl = struct { type IGlobalInterfaceTableVtbl = TIGlobalInterfaceTableVtbl -type TIGlobalInterfaceTable1 = struct { - FlpVtbl uintptr -} - -type IGlobalInterfaceTable1 = TIGlobalInterfaceTable1 - type TISynchronizeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73668,12 +69468,6 @@ type TISynchronizeVtbl = struct { type ISynchronizeVtbl = TISynchronizeVtbl -type TISynchronize1 = struct { - FlpVtbl uintptr -} - -type ISynchronize1 = TISynchronize1 - type TISynchronizeHandleVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73683,12 +69477,6 @@ type TISynchronizeHandleVtbl = struct { type ISynchronizeHandleVtbl = TISynchronizeHandleVtbl -type TISynchronizeHandle1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeHandle1 = TISynchronizeHandle1 - type TISynchronizeEventVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73699,12 +69487,6 @@ type TISynchronizeEventVtbl = struct { type ISynchronizeEventVtbl = TISynchronizeEventVtbl -type TISynchronizeEvent1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeEvent1 = TISynchronizeEvent1 - type TISynchronizeContainerVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73715,12 +69497,6 @@ type TISynchronizeContainerVtbl = struct { type ISynchronizeContainerVtbl = TISynchronizeContainerVtbl -type TISynchronizeContainer1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeContainer1 = TISynchronizeContainer1 - type TISynchronizeMutexVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73733,12 +69509,6 @@ type TISynchronizeMutexVtbl = struct { type ISynchronizeMutexVtbl = TISynchronizeMutexVtbl -type TISynchronizeMutex1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeMutex1 = TISynchronizeMutex1 - type TLPCANCELMETHODCALLS = uintptr type LPCANCELMETHODCALLS = TLPCANCELMETHODCALLS @@ -73753,12 +69523,6 @@ type TICancelMethodCallsVtbl = struct { type ICancelMethodCallsVtbl = TICancelMethodCallsVtbl -type TICancelMethodCalls1 = struct { - FlpVtbl uintptr -} - -type ICancelMethodCalls1 = TICancelMethodCalls1 - type TDCOM_CALL_STATE = int32 type DCOM_CALL_STATE = TDCOM_CALL_STATE @@ -73780,12 +69544,6 @@ type TIAsyncManagerVtbl = struct { type IAsyncManagerVtbl = TIAsyncManagerVtbl -type TIAsyncManager1 = struct { - FlpVtbl uintptr -} - -type IAsyncManager1 = TIAsyncManager1 - type TICallFactoryVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73795,12 +69553,6 @@ type TICallFactoryVtbl = struct { type ICallFactoryVtbl = TICallFactoryVtbl -type TICallFactory1 = struct { - FlpVtbl uintptr -} - -type ICallFactory1 = TICallFactory1 - type TIRpcHelperVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73811,12 +69563,6 @@ type TIRpcHelperVtbl = struct { type IRpcHelperVtbl = TIRpcHelperVtbl -type TIRpcHelper1 = struct { - FlpVtbl uintptr -} - -type IRpcHelper1 = TIRpcHelper1 - type TIReleaseMarshalBuffersVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73826,12 +69572,6 @@ type TIReleaseMarshalBuffersVtbl = struct { type IReleaseMarshalBuffersVtbl = TIReleaseMarshalBuffersVtbl -type TIReleaseMarshalBuffers1 = struct { - FlpVtbl uintptr -} - -type IReleaseMarshalBuffers1 = TIReleaseMarshalBuffers1 - type TIWaitMultipleVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73842,12 +69582,6 @@ type TIWaitMultipleVtbl = struct { type IWaitMultipleVtbl = TIWaitMultipleVtbl -type TIWaitMultiple1 = struct { - FlpVtbl uintptr -} - -type IWaitMultiple1 = TIWaitMultiple1 - type TLPADDRTRACKINGCONTROL = uintptr type LPADDRTRACKINGCONTROL = TLPADDRTRACKINGCONTROL @@ -73862,12 +69596,6 @@ type TIAddrTrackingControlVtbl = struct { type IAddrTrackingControlVtbl = TIAddrTrackingControlVtbl -type TIAddrTrackingControl1 = struct { - FlpVtbl uintptr -} - -type IAddrTrackingControl1 = TIAddrTrackingControl1 - type TLPADDREXCLUSIONCONTROL = uintptr type LPADDREXCLUSIONCONTROL = TLPADDREXCLUSIONCONTROL @@ -73882,12 +69610,6 @@ type TIAddrExclusionControlVtbl = struct { type IAddrExclusionControlVtbl = TIAddrExclusionControlVtbl -type TIAddrExclusionControl1 = struct { - FlpVtbl uintptr -} - -type IAddrExclusionControl1 = TIAddrExclusionControl1 - type TIPipeByteVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73898,12 +69620,6 @@ type TIPipeByteVtbl = struct { type IPipeByteVtbl = TIPipeByteVtbl -type TIPipeByte1 = struct { - FlpVtbl uintptr -} - -type IPipeByte1 = TIPipeByte1 - type TIPipeLongVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73914,12 +69630,6 @@ type TIPipeLongVtbl = struct { type IPipeLongVtbl = TIPipeLongVtbl -type TIPipeLong1 = struct { - FlpVtbl uintptr -} - -type IPipeLong1 = TIPipeLong1 - type TIPipeDoubleVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73930,12 +69640,6 @@ type TIPipeDoubleVtbl = struct { type IPipeDoubleVtbl = TIPipeDoubleVtbl -type TIPipeDouble1 = struct { - FlpVtbl uintptr -} - -type IPipeDouble1 = TIPipeDouble1 - type TAPTTYPEQUALIFIER = int32 type APTTYPEQUALIFIER = TAPTTYPEQUALIFIER @@ -73987,12 +69691,6 @@ type TIComThreadingInfoVtbl = struct { type IComThreadingInfoVtbl = TIComThreadingInfoVtbl -type TIComThreadingInfo1 = struct { - FlpVtbl uintptr -} - -type IComThreadingInfo1 = TIComThreadingInfo1 - type TIProcessInitControlVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -74002,12 +69700,6 @@ type TIProcessInitControlVtbl = struct { type IProcessInitControlVtbl = TIProcessInitControlVtbl -type TIProcessInitControl1 = struct { - FlpVtbl uintptr -} - -type IProcessInitControl1 = TIProcessInitControl1 - type TIFastRundownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -74016,12 +69708,6 @@ type TIFastRundownVtbl = struct { type IFastRundownVtbl = TIFastRundownVtbl -type TIFastRundown1 = struct { - FlpVtbl uintptr -} - -type IFastRundown1 = TIFastRundown1 - type TCO_MARSHALING_CONTEXT_ATTRIBUTES = int32 type CO_MARSHALING_CONTEXT_ATTRIBUTES = TCO_MARSHALING_CONTEXT_ATTRIBUTES @@ -74050,12 +69736,6 @@ type TIMarshalingStreamVtbl = struct { type IMarshalingStreamVtbl = TIMarshalingStreamVtbl -type TIMarshalingStream1 = struct { - FlpVtbl uintptr -} - -type IMarshalingStream1 = TIMarshalingStream1 - type TServerInformation = struct { FdwServerPid TDWORD FdwServerTid TDWORD @@ -75030,12 +70710,6 @@ type TIMallocSpyVtbl = struct { type IMallocSpyVtbl = TIMallocSpyVtbl -type TIMallocSpy1 = struct { - FlpVtbl uintptr -} - -type IMallocSpy1 = TIMallocSpy1 - type TLPBC = uintptr type LPBC = TLPBC @@ -75131,12 +70805,6 @@ type TIBindCtxVtbl = struct { type IBindCtxVtbl = TIBindCtxVtbl -type TIBindCtx1 = struct { - FlpVtbl uintptr -} - -type IBindCtx1 = TIBindCtx1 - type TLPENUMMONIKER = uintptr type LPENUMMONIKER = TLPENUMMONIKER @@ -75153,12 +70821,6 @@ type TIEnumMonikerVtbl = struct { type IEnumMonikerVtbl = TIEnumMonikerVtbl -type TIEnumMoniker1 = struct { - FlpVtbl uintptr -} - -type IEnumMoniker1 = TIEnumMoniker1 - type TLPRUNNABLEOBJECT = uintptr type LPRUNNABLEOBJECT = TLPRUNNABLEOBJECT @@ -75176,12 +70838,6 @@ type TIRunnableObjectVtbl = struct { type IRunnableObjectVtbl = TIRunnableObjectVtbl -type TIRunnableObject1 = struct { - FlpVtbl uintptr -} - -type IRunnableObject1 = TIRunnableObject1 - type TLPRUNNINGOBJECTTABLE = uintptr type LPRUNNINGOBJECTTABLE = TLPRUNNINGOBJECTTABLE @@ -75201,12 +70857,6 @@ type TIRunningObjectTableVtbl = struct { type IRunningObjectTableVtbl = TIRunningObjectTableVtbl -type TIRunningObjectTable1 = struct { - FlpVtbl uintptr -} - -type IRunningObjectTable1 = TIRunningObjectTable1 - type TLPPERSIST = uintptr type LPPERSIST = TLPPERSIST @@ -75220,12 +70870,6 @@ type TIPersistVtbl = struct { type IPersistVtbl = TIPersistVtbl -type TIPersist1 = struct { - FlpVtbl uintptr -} - -type IPersist1 = TIPersist1 - type TLPPERSISTSTREAM = uintptr type LPPERSISTSTREAM = TLPPERSISTSTREAM @@ -75243,12 +70887,6 @@ type TIPersistStreamVtbl = struct { type IPersistStreamVtbl = TIPersistStreamVtbl -type TIPersistStream1 = struct { - FlpVtbl uintptr -} - -type IPersistStream1 = TIPersistStream1 - type TLPMONIKER = uintptr type LPMONIKER = TLPMONIKER @@ -75309,12 +70947,6 @@ type TIMonikerVtbl = struct { type IMonikerVtbl = TIMonikerVtbl -type TIMoniker1 = struct { - FlpVtbl uintptr -} - -type IMoniker1 = TIMoniker1 - type TIROTDataVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75324,12 +70956,6 @@ type TIROTDataVtbl = struct { type IROTDataVtbl = TIROTDataVtbl -type TIROTData1 = struct { - FlpVtbl uintptr -} - -type IROTData1 = TIROTData1 - type TLPENUMSTATSTG = uintptr type LPENUMSTATSTG = TLPENUMSTATSTG @@ -75346,12 +70972,6 @@ type TIEnumSTATSTGVtbl = struct { type IEnumSTATSTGVtbl = TIEnumSTATSTGVtbl -type TIEnumSTATSTG1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATSTG1 = TIEnumSTATSTG1 - type TLPSTORAGE = uintptr type LPSTORAGE = TLPSTORAGE @@ -75399,12 +71019,6 @@ type TIStorageVtbl = struct { type IStorageVtbl = TIStorageVtbl -type TIStorage1 = struct { - FlpVtbl uintptr -} - -type IStorage1 = TIStorage1 - type TLPPERSISTFILE = uintptr type LPPERSISTFILE = TLPPERSISTFILE @@ -75423,12 +71037,6 @@ type TIPersistFileVtbl = struct { type IPersistFileVtbl = TIPersistFileVtbl -type TIPersistFile1 = struct { - FlpVtbl uintptr -} - -type IPersistFile1 = TIPersistFile1 - type TLPPERSISTSTORAGE = uintptr type LPPERSISTSTORAGE = TLPPERSISTSTORAGE @@ -75448,12 +71056,6 @@ type TIPersistStorageVtbl = struct { type IPersistStorageVtbl = TIPersistStorageVtbl -type TIPersistStorage1 = struct { - FlpVtbl uintptr -} - -type IPersistStorage1 = TIPersistStorage1 - type TLPLOCKBYTES = uintptr type LPLOCKBYTES = TLPLOCKBYTES @@ -75473,12 +71075,6 @@ type TILockBytesVtbl = struct { type ILockBytesVtbl = TILockBytesVtbl -type TILockBytes1 = struct { - FlpVtbl uintptr -} - -type ILockBytes1 = TILockBytes1 - type TLPENUMFORMATETC = uintptr type LPENUMFORMATETC = TLPENUMFORMATETC @@ -75532,12 +71128,6 @@ type TIEnumFORMATETCVtbl = struct { type IEnumFORMATETCVtbl = TIEnumFORMATETCVtbl -type TIEnumFORMATETC1 = struct { - FlpVtbl uintptr -} - -type IEnumFORMATETC1 = TIEnumFORMATETC1 - type TLPENUMSTATDATA = uintptr type LPENUMSTATDATA = TLPENUMSTATDATA @@ -75585,12 +71175,6 @@ type TIEnumSTATDATAVtbl = struct { type IEnumSTATDATAVtbl = TIEnumSTATDATAVtbl -type TIEnumSTATDATA1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATDATA1 = TIEnumSTATDATA1 - type TLPROOTSTORAGE = uintptr type LPROOTSTORAGE = TLPROOTSTORAGE @@ -75604,12 +71188,6 @@ type TIRootStorageVtbl = struct { type IRootStorageVtbl = TIRootStorageVtbl -type TIRootStorage1 = struct { - FlpVtbl uintptr -} - -type IRootStorage1 = TIRootStorage1 - type TLPADVISESINK = uintptr type LPADVISESINK = TLPADVISESINK @@ -75771,12 +71349,6 @@ type TIAdviseSinkVtbl = struct { type IAdviseSinkVtbl = TIAdviseSinkVtbl -type TIAdviseSink1 = struct { - FlpVtbl uintptr -} - -type IAdviseSink1 = TIAdviseSink1 - type TAsyncIAdviseSinkVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75795,12 +71367,6 @@ type TAsyncIAdviseSinkVtbl = struct { type AsyncIAdviseSinkVtbl = TAsyncIAdviseSinkVtbl -type TAsyncIAdviseSink1 = struct { - FlpVtbl uintptr -} - -type AsyncIAdviseSink1 = TAsyncIAdviseSink1 - type TLPADVISESINK2 = uintptr type LPADVISESINK2 = TLPADVISESINK2 @@ -75819,12 +71385,6 @@ type TIAdviseSink2Vtbl = struct { type IAdviseSink2Vtbl = TIAdviseSink2Vtbl -type TIAdviseSink21 = struct { - FlpVtbl uintptr -} - -type IAdviseSink21 = TIAdviseSink21 - type TAsyncIAdviseSink2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75845,12 +71405,6 @@ type TAsyncIAdviseSink2Vtbl = struct { type AsyncIAdviseSink2Vtbl = TAsyncIAdviseSink2Vtbl -type TAsyncIAdviseSink21 = struct { - FlpVtbl uintptr -} - -type AsyncIAdviseSink21 = TAsyncIAdviseSink21 - type TLPDATAOBJECT = uintptr type LPDATAOBJECT = TLPDATAOBJECT @@ -75881,12 +71435,6 @@ type TIDataObjectVtbl = struct { type IDataObjectVtbl = TIDataObjectVtbl -type TIDataObject1 = struct { - FlpVtbl uintptr -} - -type IDataObject1 = TIDataObject1 - type TLPDATAADVISEHOLDER = uintptr type LPDATAADVISEHOLDER = TLPDATAADVISEHOLDER @@ -75903,12 +71451,6 @@ type TIDataAdviseHolderVtbl = struct { type IDataAdviseHolderVtbl = TIDataAdviseHolderVtbl -type TIDataAdviseHolder1 = struct { - FlpVtbl uintptr -} - -type IDataAdviseHolder1 = TIDataAdviseHolder1 - type TLPMESSAGEFILTER = uintptr type LPMESSAGEFILTER = TLPMESSAGEFILTER @@ -75981,12 +71523,6 @@ type TIMessageFilterVtbl = struct { type IMessageFilterVtbl = TIMessageFilterVtbl -type TIMessageFilter1 = struct { - FlpVtbl uintptr -} - -type IMessageFilter1 = TIMessageFilter1 - type TIClassActivatorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75996,12 +71532,6 @@ type TIClassActivatorVtbl = struct { type IClassActivatorVtbl = TIClassActivatorVtbl -type TIClassActivator1 = struct { - FlpVtbl uintptr -} - -type IClassActivator1 = TIClassActivator1 - type TIFillLockBytesVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76014,12 +71544,6 @@ type TIFillLockBytesVtbl = struct { type IFillLockBytesVtbl = TIFillLockBytesVtbl -type TIFillLockBytes1 = struct { - FlpVtbl uintptr -} - -type IFillLockBytes1 = TIFillLockBytes1 - type TIProgressNotifyVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76029,12 +71553,6 @@ type TIProgressNotifyVtbl = struct { type IProgressNotifyVtbl = TIProgressNotifyVtbl -type TIProgressNotify1 = struct { - FlpVtbl uintptr -} - -type IProgressNotify1 = TIProgressNotify1 - type TStorageLayout = struct { FLayoutType TDWORD FpwcsElementName uintptr @@ -76061,12 +71579,6 @@ type TILayoutStorageVtbl = struct { type ILayoutStorageVtbl = TILayoutStorageVtbl -type TILayoutStorage1 = struct { - FlpVtbl uintptr -} - -type ILayoutStorage1 = TILayoutStorage1 - type TIBlockingLockVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76077,12 +71589,6 @@ type TIBlockingLockVtbl = struct { type IBlockingLockVtbl = TIBlockingLockVtbl -type TIBlockingLock1 = struct { - FlpVtbl uintptr -} - -type IBlockingLock1 = TIBlockingLock1 - type TITimeAndNoticeControlVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76092,12 +71598,6 @@ type TITimeAndNoticeControlVtbl = struct { type ITimeAndNoticeControlVtbl = TITimeAndNoticeControlVtbl -type TITimeAndNoticeControl1 = struct { - FlpVtbl uintptr -} - -type ITimeAndNoticeControl1 = TITimeAndNoticeControl1 - type TIOplockStorageVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76108,12 +71608,6 @@ type TIOplockStorageVtbl = struct { type IOplockStorageVtbl = TIOplockStorageVtbl -type TIOplockStorage1 = struct { - FlpVtbl uintptr -} - -type IOplockStorage1 = TIOplockStorage1 - type TIDirectWriterLockVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76125,12 +71619,6 @@ type TIDirectWriterLockVtbl = struct { type IDirectWriterLockVtbl = TIDirectWriterLockVtbl -type TIDirectWriterLock1 = struct { - FlpVtbl uintptr -} - -type IDirectWriterLock1 = TIDirectWriterLock1 - type TIUrlMonVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76140,12 +71628,6 @@ type TIUrlMonVtbl = struct { type IUrlMonVtbl = TIUrlMonVtbl -type TIUrlMon1 = struct { - FlpVtbl uintptr -} - -type IUrlMon1 = TIUrlMon1 - type TIForegroundTransferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76155,12 +71637,6 @@ type TIForegroundTransferVtbl = struct { type IForegroundTransferVtbl = TIForegroundTransferVtbl -type TIForegroundTransfer1 = struct { - FlpVtbl uintptr -} - -type IForegroundTransfer1 = TIForegroundTransfer1 - type TIThumbnailExtractorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76171,12 +71647,6 @@ type TIThumbnailExtractorVtbl = struct { type IThumbnailExtractorVtbl = TIThumbnailExtractorVtbl -type TIThumbnailExtractor1 = struct { - FlpVtbl uintptr -} - -type IThumbnailExtractor1 = TIThumbnailExtractor1 - type TIDummyHICONIncluderVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76186,12 +71656,6 @@ type TIDummyHICONIncluderVtbl = struct { type IDummyHICONIncluderVtbl = TIDummyHICONIncluderVtbl -type TIDummyHICONIncluder1 = struct { - FlpVtbl uintptr -} - -type IDummyHICONIncluder1 = TIDummyHICONIncluder1 - type TApplicationType = int32 type ApplicationType = TApplicationType @@ -76220,12 +71684,6 @@ type TIProcessLockVtbl = struct { type IProcessLockVtbl = TIProcessLockVtbl -type TIProcessLock1 = struct { - FlpVtbl uintptr -} - -type IProcessLock1 = TIProcessLock1 - type TISurrogateServiceVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76239,12 +71697,6 @@ type TISurrogateServiceVtbl = struct { type ISurrogateServiceVtbl = TISurrogateServiceVtbl -type TISurrogateService1 = struct { - FlpVtbl uintptr -} - -type ISurrogateService1 = TISurrogateService1 - type TLPINITIALIZESPY = uintptr type LPINITIALIZESPY = TLPINITIALIZESPY @@ -76261,12 +71713,6 @@ type TIInitializeSpyVtbl = struct { type IInitializeSpyVtbl = TIInitializeSpyVtbl -type TIInitializeSpy1 = struct { - FlpVtbl uintptr -} - -type IInitializeSpy1 = TIInitializeSpy1 - type TIApartmentShutdownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -76276,12 +71722,6 @@ type TIApartmentShutdownVtbl = struct { type IApartmentShutdownVtbl = TIApartmentShutdownVtbl -type TIApartmentShutdown1 = struct { - FlpVtbl uintptr -} - -type IApartmentShutdown1 = TIApartmentShutdown1 - type TCOMSD = int32 type COMSD = TCOMSD @@ -76780,12 +72220,6 @@ type TIOleAdviseHolderVtbl = struct { type IOleAdviseHolderVtbl = TIOleAdviseHolderVtbl -type TIOleAdviseHolder1 = struct { - FlpVtbl uintptr -} - -type IOleAdviseHolder1 = TIOleAdviseHolder1 - type TLPOLECACHE = uintptr type LPOLECACHE = TLPOLECACHE @@ -76803,12 +72237,6 @@ type TIOleCacheVtbl = struct { type IOleCacheVtbl = TIOleCacheVtbl -type TIOleCache1 = struct { - FlpVtbl uintptr -} - -type IOleCache1 = TIOleCache1 - type TLPOLECACHE2 = uintptr type LPOLECACHE2 = TLPOLECACHE2 @@ -76837,12 +72265,6 @@ type TIOleCache2Vtbl = struct { type IOleCache2Vtbl = TIOleCache2Vtbl -type TIOleCache21 = struct { - FlpVtbl uintptr -} - -type IOleCache21 = TIOleCache21 - type TLPOLECACHECONTROL = uintptr type LPOLECACHECONTROL = TLPOLECACHECONTROL @@ -76857,12 +72279,6 @@ type TIOleCacheControlVtbl = struct { type IOleCacheControlVtbl = TIOleCacheControlVtbl -type TIOleCacheControl1 = struct { - FlpVtbl uintptr -} - -type IOleCacheControl1 = TIOleCacheControl1 - type TLPPARSEDISPLAYNAME = uintptr type LPPARSEDISPLAYNAME = TLPPARSEDISPLAYNAME @@ -76876,12 +72292,6 @@ type TIParseDisplayNameVtbl = struct { type IParseDisplayNameVtbl = TIParseDisplayNameVtbl -type TIParseDisplayName1 = struct { - FlpVtbl uintptr -} - -type IParseDisplayName1 = TIParseDisplayName1 - type TLPOLECONTAINER = uintptr type LPOLECONTAINER = TLPOLECONTAINER @@ -76897,12 +72307,6 @@ type TIOleContainerVtbl = struct { type IOleContainerVtbl = TIOleContainerVtbl -type TIOleContainer1 = struct { - FlpVtbl uintptr -} - -type IOleContainer1 = TIOleContainer1 - type TLPOLECLIENTSITE = uintptr type LPOLECLIENTSITE = TLPOLECLIENTSITE @@ -76921,12 +72325,6 @@ type TIOleClientSiteVtbl = struct { type IOleClientSiteVtbl = TIOleClientSiteVtbl -type TIOleClientSite1 = struct { - FlpVtbl uintptr -} - -type IOleClientSite1 = TIOleClientSite1 - type TLPOLEOBJECT = uintptr type LPOLEOBJECT = TLPOLEOBJECT @@ -77030,12 +72428,6 @@ type TIOleObjectVtbl = struct { type IOleObjectVtbl = TIOleObjectVtbl -type TIOleObject1 = struct { - FlpVtbl uintptr -} - -type IOleObject1 = TIOleObject1 - type TOLERENDER = int32 type OLERENDER = TOLERENDER @@ -77111,12 +72503,6 @@ type TIOleWindowVtbl = struct { type IOleWindowVtbl = TIOleWindowVtbl -type TIOleWindow1 = struct { - FlpVtbl uintptr -} - -type IOleWindow1 = TIOleWindow1 - type TLPOLELINK = uintptr type LPOLELINK = TLPOLELINK @@ -77165,12 +72551,6 @@ type TIOleLinkVtbl = struct { type IOleLinkVtbl = TIOleLinkVtbl -type TIOleLink1 = struct { - FlpVtbl uintptr -} - -type IOleLink1 = TIOleLink1 - type TLPOLEITEMCONTAINER = uintptr type LPOLEITEMCONTAINER = TLPOLEITEMCONTAINER @@ -77211,12 +72591,6 @@ type TIOleItemContainerVtbl = struct { type IOleItemContainerVtbl = TIOleItemContainerVtbl -type TIOleItemContainer1 = struct { - FlpVtbl uintptr -} - -type IOleItemContainer1 = TIOleItemContainer1 - type TLPOLEINPLACEUIWINDOW = uintptr type LPOLEINPLACEUIWINDOW = TLPOLEINPLACEUIWINDOW @@ -77252,12 +72626,6 @@ type TIOleInPlaceUIWindowVtbl = struct { type IOleInPlaceUIWindowVtbl = TIOleInPlaceUIWindowVtbl -type TIOleInPlaceUIWindow1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceUIWindow1 = TIOleInPlaceUIWindow1 - type TLPOLEINPLACEACTIVEOBJECT = uintptr type LPOLEINPLACEACTIVEOBJECT = TLPOLEINPLACEACTIVEOBJECT @@ -77277,12 +72645,6 @@ type TIOleInPlaceActiveObjectVtbl = struct { type IOleInPlaceActiveObjectVtbl = TIOleInPlaceActiveObjectVtbl -type TIOleInPlaceActiveObject1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceActiveObject1 = TIOleInPlaceActiveObject1 - type TLPOLEINPLACEFRAME = uintptr type LPOLEINPLACEFRAME = TLPOLEINPLACEFRAME @@ -77343,12 +72705,6 @@ type TIOleInPlaceFrameVtbl = struct { type IOleInPlaceFrameVtbl = TIOleInPlaceFrameVtbl -type TIOleInPlaceFrame1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceFrame1 = TIOleInPlaceFrame1 - type TLPOLEINPLACEOBJECT = uintptr type LPOLEINPLACEOBJECT = TLPOLEINPLACEOBJECT @@ -77367,12 +72723,6 @@ type TIOleInPlaceObjectVtbl = struct { type IOleInPlaceObjectVtbl = TIOleInPlaceObjectVtbl -type TIOleInPlaceObject1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceObject1 = TIOleInPlaceObject1 - type TLPOLEINPLACESITE = uintptr type LPOLEINPLACESITE = TLPOLEINPLACESITE @@ -77397,12 +72747,6 @@ type TIOleInPlaceSiteVtbl = struct { type IOleInPlaceSiteVtbl = TIOleInPlaceSiteVtbl -type TIOleInPlaceSite1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceSite1 = TIOleInPlaceSite1 - type TIContinueVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -77412,12 +72756,6 @@ type TIContinueVtbl = struct { type IContinueVtbl = TIContinueVtbl -type TIContinue1 = struct { - FlpVtbl uintptr -} - -type IContinue1 = TIContinue1 - type TLPVIEWOBJECT = uintptr type LPVIEWOBJECT = TLPVIEWOBJECT @@ -77436,12 +72774,6 @@ type TIViewObjectVtbl = struct { type IViewObjectVtbl = TIViewObjectVtbl -type TIViewObject1 = struct { - FlpVtbl uintptr -} - -type IViewObject1 = TIViewObject1 - type TLPVIEWOBJECT2 = uintptr type LPVIEWOBJECT2 = TLPVIEWOBJECT2 @@ -77461,12 +72793,6 @@ type TIViewObject2Vtbl = struct { type IViewObject2Vtbl = TIViewObject2Vtbl -type TIViewObject21 = struct { - FlpVtbl uintptr -} - -type IViewObject21 = TIViewObject21 - type TLPDROPSOURCE = uintptr type LPDROPSOURCE = TLPDROPSOURCE @@ -77481,12 +72807,6 @@ type TIDropSourceVtbl = struct { type IDropSourceVtbl = TIDropSourceVtbl -type TIDropSource1 = struct { - FlpVtbl uintptr -} - -type IDropSource1 = TIDropSource1 - type TLPDROPTARGET = uintptr type LPDROPTARGET = TLPDROPTARGET @@ -77503,12 +72823,6 @@ type TIDropTargetVtbl = struct { type IDropTargetVtbl = TIDropTargetVtbl -type TIDropTarget1 = struct { - FlpVtbl uintptr -} - -type IDropTarget1 = TIDropTarget1 - type TIDropSourceNotifyVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -77519,12 +72833,6 @@ type TIDropSourceNotifyVtbl = struct { type IDropSourceNotifyVtbl = TIDropSourceNotifyVtbl -type TIDropSourceNotify1 = struct { - FlpVtbl uintptr -} - -type IDropSourceNotify1 = TIDropSourceNotify1 - type TLPENUMOLEVERB = uintptr type LPENUMOLEVERB = TLPENUMOLEVERB @@ -77567,12 +72875,6 @@ type TIEnumOLEVERBVtbl = struct { type IEnumOLEVERBVtbl = TIEnumOLEVERBVtbl -type TIEnumOLEVERB1 = struct { - FlpVtbl uintptr -} - -type IEnumOLEVERB1 = TIEnumOLEVERB1 - type TIServiceProvider = struct { FlpVtbl uintptr } @@ -77592,12 +72894,6 @@ type TIServiceProviderVtbl = struct { type IServiceProviderVtbl = TIServiceProviderVtbl -type TIServiceProvider1 = struct { - FlpVtbl uintptr -} - -type IServiceProvider1 = TIServiceProvider1 - type TICreateTypeInfo = struct { FlpVtbl uintptr } @@ -78515,12 +73811,6 @@ type TICreateTypeInfoVtbl = struct { type ICreateTypeInfoVtbl = TICreateTypeInfoVtbl -type TICreateTypeInfo1 = struct { - FlpVtbl uintptr -} - -type ICreateTypeInfo1 = TICreateTypeInfo1 - type TLPCREATETYPEINFO2 = uintptr type LPCREATETYPEINFO2 = TLPCREATETYPEINFO2 @@ -78571,12 +73861,6 @@ type TICreateTypeInfo2Vtbl = struct { type ICreateTypeInfo2Vtbl = TICreateTypeInfo2Vtbl -type TICreateTypeInfo21 = struct { - FlpVtbl uintptr -} - -type ICreateTypeInfo21 = TICreateTypeInfo21 - type TLPCREATETYPELIB = uintptr type LPCREATETYPELIB = TLPCREATETYPELIB @@ -78599,12 +73883,6 @@ type TICreateTypeLibVtbl = struct { type ICreateTypeLibVtbl = TICreateTypeLibVtbl -type TICreateTypeLib1 = struct { - FlpVtbl uintptr -} - -type ICreateTypeLib1 = TICreateTypeLib1 - type TLPCREATETYPELIB2 = uintptr type LPCREATETYPELIB2 = TLPCREATETYPELIB2 @@ -78631,12 +73909,6 @@ type TICreateTypeLib2Vtbl = struct { type ICreateTypeLib2Vtbl = TICreateTypeLib2Vtbl -type TICreateTypeLib21 = struct { - FlpVtbl uintptr -} - -type ICreateTypeLib21 = TICreateTypeLib21 - type TLPDISPATCH = uintptr type LPDISPATCH = TLPDISPATCH @@ -78653,12 +73925,6 @@ type TIDispatchVtbl = struct { type IDispatchVtbl = TIDispatchVtbl -type TIDispatch1 = struct { - FlpVtbl uintptr -} - -type IDispatch1 = TIDispatch1 - type TLPENUMVARIANT = uintptr type LPENUMVARIANT = TLPENUMVARIANT @@ -78675,12 +73941,6 @@ type TIEnumVARIANTVtbl = struct { type IEnumVARIANTVtbl = TIEnumVARIANTVtbl -type TIEnumVARIANT1 = struct { - FlpVtbl uintptr -} - -type IEnumVARIANT1 = TIEnumVARIANT1 - type TLPTYPECOMP = uintptr type LPTYPECOMP = TLPTYPECOMP @@ -78724,12 +73984,6 @@ type TITypeCompVtbl = struct { type ITypeCompVtbl = TITypeCompVtbl -type TITypeComp1 = struct { - FlpVtbl uintptr -} - -type ITypeComp1 = TITypeComp1 - type TLPTYPEINFO = uintptr type LPTYPEINFO = TLPTYPEINFO @@ -78761,12 +74015,6 @@ type TITypeInfoVtbl = struct { type ITypeInfoVtbl = TITypeInfoVtbl -type TITypeInfo1 = struct { - FlpVtbl uintptr -} - -type ITypeInfo1 = TITypeInfo1 - type TLPTYPEINFO2 = uintptr type LPTYPEINFO2 = TLPTYPEINFO2 @@ -78813,12 +74061,6 @@ type TITypeInfo2Vtbl = struct { type ITypeInfo2Vtbl = TITypeInfo2Vtbl -type TITypeInfo21 = struct { - FlpVtbl uintptr -} - -type ITypeInfo21 = TITypeInfo21 - type TSYSKIND = int32 type SYSKIND = TSYSKIND @@ -78882,12 +74124,6 @@ type TITypeLibVtbl = struct { type ITypeLibVtbl = TITypeLibVtbl -type TITypeLib1 = struct { - FlpVtbl uintptr -} - -type ITypeLib1 = TITypeLib1 - type TLPTYPELIB2 = uintptr type LPTYPELIB2 = TLPTYPELIB2 @@ -78914,12 +74150,6 @@ type TITypeLib2Vtbl = struct { type ITypeLib2Vtbl = TITypeLib2Vtbl -type TITypeLib21 = struct { - FlpVtbl uintptr -} - -type ITypeLib21 = TITypeLib21 - type TLPTYPECHANGEEVENTS = uintptr type LPTYPECHANGEEVENTS = TLPTYPECHANGEEVENTS @@ -78949,12 +74179,6 @@ type TITypeChangeEventsVtbl = struct { type ITypeChangeEventsVtbl = TITypeChangeEventsVtbl -type TITypeChangeEvents1 = struct { - FlpVtbl uintptr -} - -type ITypeChangeEvents1 = TITypeChangeEvents1 - type TLPERRORINFO = uintptr type LPERRORINFO = TLPERRORINFO @@ -78972,12 +74196,6 @@ type TIErrorInfoVtbl = struct { type IErrorInfoVtbl = TIErrorInfoVtbl -type TIErrorInfo1 = struct { - FlpVtbl uintptr -} - -type IErrorInfo1 = TIErrorInfo1 - type TLPCREATEERRORINFO = uintptr type LPCREATEERRORINFO = TLPCREATEERRORINFO @@ -78995,12 +74213,6 @@ type TICreateErrorInfoVtbl = struct { type ICreateErrorInfoVtbl = TICreateErrorInfoVtbl -type TICreateErrorInfo1 = struct { - FlpVtbl uintptr -} - -type ICreateErrorInfo1 = TICreateErrorInfo1 - type TLPSUPPORTERRORINFO = uintptr type LPSUPPORTERRORINFO = TLPSUPPORTERRORINFO @@ -79014,12 +74226,6 @@ type TISupportErrorInfoVtbl = struct { type ISupportErrorInfoVtbl = TISupportErrorInfoVtbl -type TISupportErrorInfo1 = struct { - FlpVtbl uintptr -} - -type ISupportErrorInfo1 = TISupportErrorInfo1 - type TITypeFactoryVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79029,12 +74235,6 @@ type TITypeFactoryVtbl = struct { type ITypeFactoryVtbl = TITypeFactoryVtbl -type TITypeFactory1 = struct { - FlpVtbl uintptr -} - -type ITypeFactory1 = TITypeFactory1 - type TITypeMarshalVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79047,12 +74247,6 @@ type TITypeMarshalVtbl = struct { type ITypeMarshalVtbl = TITypeMarshalVtbl -type TITypeMarshal1 = struct { - FlpVtbl uintptr -} - -type ITypeMarshal1 = TITypeMarshal1 - type TLPRECORDINFO = uintptr type LPRECORDINFO = TLPRECORDINFO @@ -79081,12 +74275,6 @@ type TIRecordInfoVtbl = struct { type IRecordInfoVtbl = TIRecordInfoVtbl -type TIRecordInfo1 = struct { - FlpVtbl uintptr -} - -type IRecordInfo1 = TIRecordInfo1 - type TLPERRORLOG = uintptr type LPERRORLOG = TLPERRORLOG @@ -79100,12 +74288,6 @@ type TIErrorLogVtbl = struct { type IErrorLogVtbl = TIErrorLogVtbl -type TIErrorLog1 = struct { - FlpVtbl uintptr -} - -type IErrorLog1 = TIErrorLog1 - type TLPPROPERTYBAG = uintptr type LPPROPERTYBAG = TLPPROPERTYBAG @@ -79120,12 +74302,6 @@ type TIPropertyBagVtbl = struct { type IPropertyBagVtbl = TIPropertyBagVtbl -type TIPropertyBag1 = struct { - FlpVtbl uintptr -} - -type IPropertyBag1 = TIPropertyBag1 - type TIXMLDOMImplementation = struct { FlpVtbl uintptr } @@ -79364,12 +74540,6 @@ type TIXMLDOMImplementationVtbl = struct { type IXMLDOMImplementationVtbl = TIXMLDOMImplementationVtbl -type TIXMLDOMImplementation1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMImplementation1 = TIXMLDOMImplementation1 - type TIXMLDOMNodeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79418,12 +74588,6 @@ type TIXMLDOMNodeVtbl = struct { type IXMLDOMNodeVtbl = TIXMLDOMNodeVtbl -type TIXMLDOMNode1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNode1 = TIXMLDOMNode1 - type TIXMLDOMDocumentFragmentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79472,12 +74636,6 @@ type TIXMLDOMDocumentFragmentVtbl = struct { type IXMLDOMDocumentFragmentVtbl = TIXMLDOMDocumentFragmentVtbl -type TIXMLDOMDocumentFragment1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMDocumentFragment1 = TIXMLDOMDocumentFragment1 - type TIXMLDOMDocumentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79559,12 +74717,6 @@ type TIXMLDOMDocumentVtbl = struct { type IXMLDOMDocumentVtbl = TIXMLDOMDocumentVtbl -type TIXMLDOMDocument1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMDocument1 = TIXMLDOMDocument1 - type TIXMLDOMNodeListVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79582,12 +74734,6 @@ type TIXMLDOMNodeListVtbl = struct { type IXMLDOMNodeListVtbl = TIXMLDOMNodeListVtbl -type TIXMLDOMNodeList1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNodeList1 = TIXMLDOMNodeList1 - type TIXMLDOMNamedNodeMapVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79610,12 +74756,6 @@ type TIXMLDOMNamedNodeMapVtbl = struct { type IXMLDOMNamedNodeMapVtbl = TIXMLDOMNamedNodeMapVtbl -type TIXMLDOMNamedNodeMap1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNamedNodeMap1 = TIXMLDOMNamedNodeMap1 - type TIXMLDOMCharacterDataVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79672,12 +74812,6 @@ type TIXMLDOMCharacterDataVtbl = struct { type IXMLDOMCharacterDataVtbl = TIXMLDOMCharacterDataVtbl -type TIXMLDOMCharacterData1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMCharacterData1 = TIXMLDOMCharacterData1 - type TIXMLDOMAttributeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79729,12 +74863,6 @@ type TIXMLDOMAttributeVtbl = struct { type IXMLDOMAttributeVtbl = TIXMLDOMAttributeVtbl -type TIXMLDOMAttribute1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMAttribute1 = TIXMLDOMAttribute1 - type TIXMLDOMElementVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79792,12 +74920,6 @@ type TIXMLDOMElementVtbl = struct { type IXMLDOMElementVtbl = TIXMLDOMElementVtbl -type TIXMLDOMElement1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMElement1 = TIXMLDOMElement1 - type TIXMLDOMTextVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79855,12 +74977,6 @@ type TIXMLDOMTextVtbl = struct { type IXMLDOMTextVtbl = TIXMLDOMTextVtbl -type TIXMLDOMText1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMText1 = TIXMLDOMText1 - type TIXMLDOMCommentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79917,12 +75033,6 @@ type TIXMLDOMCommentVtbl = struct { type IXMLDOMCommentVtbl = TIXMLDOMCommentVtbl -type TIXMLDOMComment1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMComment1 = TIXMLDOMComment1 - type TIXMLDOMProcessingInstructionVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79974,12 +75084,6 @@ type TIXMLDOMProcessingInstructionVtbl = struct { type IXMLDOMProcessingInstructionVtbl = TIXMLDOMProcessingInstructionVtbl -type TIXMLDOMProcessingInstruction1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMProcessingInstruction1 = TIXMLDOMProcessingInstruction1 - type TIXMLDOMCDATASectionVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80037,12 +75141,6 @@ type TIXMLDOMCDATASectionVtbl = struct { type IXMLDOMCDATASectionVtbl = TIXMLDOMCDATASectionVtbl -type TIXMLDOMCDATASection1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMCDATASection1 = TIXMLDOMCDATASection1 - type TIXMLDOMDocumentTypeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80094,12 +75192,6 @@ type TIXMLDOMDocumentTypeVtbl = struct { type IXMLDOMDocumentTypeVtbl = TIXMLDOMDocumentTypeVtbl -type TIXMLDOMDocumentType1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMDocumentType1 = TIXMLDOMDocumentType1 - type TIXMLDOMNotationVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80150,12 +75242,6 @@ type TIXMLDOMNotationVtbl = struct { type IXMLDOMNotationVtbl = TIXMLDOMNotationVtbl -type TIXMLDOMNotation1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNotation1 = TIXMLDOMNotation1 - type TIXMLDOMEntityVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80207,12 +75293,6 @@ type TIXMLDOMEntityVtbl = struct { type IXMLDOMEntityVtbl = TIXMLDOMEntityVtbl -type TIXMLDOMEntity1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMEntity1 = TIXMLDOMEntity1 - type TIXMLDOMEntityReferenceVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80261,12 +75341,6 @@ type TIXMLDOMEntityReferenceVtbl = struct { type IXMLDOMEntityReferenceVtbl = TIXMLDOMEntityReferenceVtbl -type TIXMLDOMEntityReference1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMEntityReference1 = TIXMLDOMEntityReference1 - type TIXMLDOMParseErrorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80286,12 +75360,6 @@ type TIXMLDOMParseErrorVtbl = struct { type IXMLDOMParseErrorVtbl = TIXMLDOMParseErrorVtbl -type TIXMLDOMParseError1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMParseError1 = TIXMLDOMParseError1 - type TIXTLRuntimeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80349,12 +75417,6 @@ type TIXTLRuntimeVtbl = struct { type IXTLRuntimeVtbl = TIXTLRuntimeVtbl -type TIXTLRuntime1 = struct { - FlpVtbl uintptr -} - -type IXTLRuntime1 = TIXTLRuntime1 - type TXMLDOMDocumentEventsVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80367,12 +75429,6 @@ type TXMLDOMDocumentEventsVtbl = struct { type XMLDOMDocumentEventsVtbl = TXMLDOMDocumentEventsVtbl -type TXMLDOMDocumentEvents1 = struct { - FlpVtbl uintptr -} - -type XMLDOMDocumentEvents1 = TXMLDOMDocumentEvents1 - type TIXMLHttpRequestVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80399,12 +75455,6 @@ type TIXMLHttpRequestVtbl = struct { type IXMLHttpRequestVtbl = TIXMLHttpRequestVtbl -type TIXMLHttpRequest1 = struct { - FlpVtbl uintptr -} - -type IXMLHttpRequest1 = TIXMLHttpRequest1 - type TIXMLDSOControlVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80422,12 +75472,6 @@ type TIXMLDSOControlVtbl = struct { type IXMLDSOControlVtbl = TIXMLDSOControlVtbl -type TIXMLDSOControl1 = struct { - FlpVtbl uintptr -} - -type IXMLDSOControl1 = TIXMLDSOControl1 - type TIXMLElementCollectionVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80444,12 +75488,6 @@ type TIXMLElementCollectionVtbl = struct { type IXMLElementCollectionVtbl = TIXMLElementCollectionVtbl -type TIXMLElementCollection1 = struct { - FlpVtbl uintptr -} - -type IXMLElementCollection1 = TIXMLElementCollection1 - type TIXMLDocumentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80476,12 +75514,6 @@ type TIXMLDocumentVtbl = struct { type IXMLDocumentVtbl = TIXMLDocumentVtbl -type TIXMLDocument1 = struct { - FlpVtbl uintptr -} - -type IXMLDocument1 = TIXMLDocument1 - type TIXMLDocument2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80510,12 +75542,6 @@ type TIXMLDocument2Vtbl = struct { type IXMLDocument2Vtbl = TIXMLDocument2Vtbl -type TIXMLDocument21 = struct { - FlpVtbl uintptr -} - -type IXMLDocument21 = TIXMLDocument21 - type TIXMLElementVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80540,12 +75566,6 @@ type TIXMLElementVtbl = struct { type IXMLElementVtbl = TIXMLElementVtbl -type TIXMLElement1 = struct { - FlpVtbl uintptr -} - -type IXMLElement1 = TIXMLElement1 - type TIXMLElement2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80571,12 +75591,6 @@ type TIXMLElement2Vtbl = struct { type IXMLElement2Vtbl = TIXMLElement2Vtbl -type TIXMLElement21 = struct { - FlpVtbl uintptr -} - -type IXMLElement21 = TIXMLElement21 - type TIXMLAttributeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80591,12 +75605,6 @@ type TIXMLAttributeVtbl = struct { type IXMLAttributeVtbl = TIXMLAttributeVtbl -type TIXMLAttribute1 = struct { - FlpVtbl uintptr -} - -type IXMLAttribute1 = TIXMLAttribute1 - type TIXMLErrorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80606,12 +75614,6 @@ type TIXMLErrorVtbl = struct { type IXMLErrorVtbl = TIXMLErrorVtbl -type TIXMLError1 = struct { - FlpVtbl uintptr -} - -type IXMLError1 = TIXMLError1 - type TLPPERSISTMONIKER = uintptr type LPPERSISTMONIKER = TLPPERSISTMONIKER @@ -80630,12 +75632,6 @@ type TIPersistMonikerVtbl = struct { type IPersistMonikerVtbl = TIPersistMonikerVtbl -type TIPersistMoniker1 = struct { - FlpVtbl uintptr -} - -type IPersistMoniker1 = TIPersistMoniker1 - type TLPMONIKERPROP = uintptr type LPMONIKERPROP = TLPMONIKERPROP @@ -80661,12 +75657,6 @@ type TIMonikerPropVtbl = struct { type IMonikerPropVtbl = TIMonikerPropVtbl -type TIMonikerProp1 = struct { - FlpVtbl uintptr -} - -type IMonikerProp1 = TIMonikerProp1 - type TLPBINDPROTOCOL = uintptr type LPBINDPROTOCOL = TLPBINDPROTOCOL @@ -80680,12 +75670,6 @@ type TIBindProtocolVtbl = struct { type IBindProtocolVtbl = TIBindProtocolVtbl -type TIBindProtocol1 = struct { - FlpVtbl uintptr -} - -type IBindProtocol1 = TIBindProtocol1 - type TLPBINDING = uintptr type LPBINDING = TLPBINDING @@ -80704,12 +75688,6 @@ type TIBindingVtbl = struct { type IBindingVtbl = TIBindingVtbl -type TIBinding1 = struct { - FlpVtbl uintptr -} - -type IBinding1 = TIBinding1 - type TLPBINDSTATUSCALLBACK = uintptr type LPBINDSTATUSCALLBACK = TLPBINDSTATUSCALLBACK @@ -80993,12 +75971,6 @@ type TIBindStatusCallbackVtbl = struct { type IBindStatusCallbackVtbl = TIBindStatusCallbackVtbl -type TIBindStatusCallback1 = struct { - FlpVtbl uintptr -} - -type IBindStatusCallback1 = TIBindStatusCallback1 - type TLPBINDSTATUSCALLBACKEX = uintptr type LPBINDSTATUSCALLBACKEX = TLPBINDSTATUSCALLBACKEX @@ -81050,12 +76022,6 @@ type TIBindStatusCallbackExVtbl = struct { type IBindStatusCallbackExVtbl = TIBindStatusCallbackExVtbl -type TIBindStatusCallbackEx1 = struct { - FlpVtbl uintptr -} - -type IBindStatusCallbackEx1 = TIBindStatusCallbackEx1 - type TLPAUTHENTICATION = uintptr type LPAUTHENTICATION = TLPAUTHENTICATION @@ -81069,12 +76035,6 @@ type TIAuthenticateVtbl = struct { type IAuthenticateVtbl = TIAuthenticateVtbl -type TIAuthenticate1 = struct { - FlpVtbl uintptr -} - -type IAuthenticate1 = TIAuthenticate1 - type TLPAUTHENTICATIONEX = uintptr type LPAUTHENTICATIONEX = TLPAUTHENTICATIONEX @@ -81110,12 +76070,6 @@ type TIAuthenticateExVtbl = struct { type IAuthenticateExVtbl = TIAuthenticateExVtbl -type TIAuthenticateEx1 = struct { - FlpVtbl uintptr -} - -type IAuthenticateEx1 = TIAuthenticateEx1 - type TLPHTTPNEGOTIATE = uintptr type LPHTTPNEGOTIATE = TLPHTTPNEGOTIATE @@ -81130,12 +76084,6 @@ type TIHttpNegotiateVtbl = struct { type IHttpNegotiateVtbl = TIHttpNegotiateVtbl -type TIHttpNegotiate1 = struct { - FlpVtbl uintptr -} - -type IHttpNegotiate1 = TIHttpNegotiate1 - type TLPHTTPNEGOTIATE2 = uintptr type LPHTTPNEGOTIATE2 = TLPHTTPNEGOTIATE2 @@ -81151,12 +76099,6 @@ type TIHttpNegotiate2Vtbl = struct { type IHttpNegotiate2Vtbl = TIHttpNegotiate2Vtbl -type TIHttpNegotiate21 = struct { - FlpVtbl uintptr -} - -type IHttpNegotiate21 = TIHttpNegotiate21 - type TLPHTTPNEGOTIATE3 = uintptr type LPHTTPNEGOTIATE3 = TLPHTTPNEGOTIATE3 @@ -81173,12 +76115,6 @@ type TIHttpNegotiate3Vtbl = struct { type IHttpNegotiate3Vtbl = TIHttpNegotiate3Vtbl -type TIHttpNegotiate31 = struct { - FlpVtbl uintptr -} - -type IHttpNegotiate31 = TIHttpNegotiate31 - type TLPWININETFILESTREAM = uintptr type LPWININETFILESTREAM = TLPWININETFILESTREAM @@ -81193,12 +76129,6 @@ type TIWinInetFileStreamVtbl = struct { type IWinInetFileStreamVtbl = TIWinInetFileStreamVtbl -type TIWinInetFileStream1 = struct { - FlpVtbl uintptr -} - -type IWinInetFileStream1 = TIWinInetFileStream1 - type TLPWINDOWFORBINDINGUI = uintptr type LPWINDOWFORBINDINGUI = TLPWINDOWFORBINDINGUI @@ -81212,12 +76142,6 @@ type TIWindowForBindingUIVtbl = struct { type IWindowForBindingUIVtbl = TIWindowForBindingUIVtbl -type TIWindowForBindingUI1 = struct { - FlpVtbl uintptr -} - -type IWindowForBindingUI1 = TIWindowForBindingUI1 - type TLPCODEINSTALL = uintptr type LPCODEINSTALL = TLPCODEINSTALL @@ -81249,12 +76173,6 @@ type TICodeInstallVtbl = struct { type ICodeInstallVtbl = TICodeInstallVtbl -type TICodeInstall1 = struct { - FlpVtbl uintptr -} - -type ICodeInstall1 = TICodeInstall1 - type TUri_PROPERTY = int32 type Uri_PROPERTY = TUri_PROPERTY @@ -81330,12 +76248,6 @@ type TIUriVtbl = struct { type IUriVtbl = TIUriVtbl -type TIUri1 = struct { - FlpVtbl uintptr -} - -type IUri1 = TIUri1 - type TIUriContainerVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81345,12 +76257,6 @@ type TIUriContainerVtbl = struct { type IUriContainerVtbl = TIUriContainerVtbl -type TIUriContainer1 = struct { - FlpVtbl uintptr -} - -type IUriContainer1 = TIUriContainer1 - type TIUriBuilderVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81382,12 +76288,6 @@ type TIUriBuilderVtbl = struct { type IUriBuilderVtbl = TIUriBuilderVtbl -type TIUriBuilder1 = struct { - FlpVtbl uintptr -} - -type IUriBuilder1 = TIUriBuilder1 - type TIUriBuilderFactoryVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81398,12 +76298,6 @@ type TIUriBuilderFactoryVtbl = struct { type IUriBuilderFactoryVtbl = TIUriBuilderFactoryVtbl -type TIUriBuilderFactory1 = struct { - FlpVtbl uintptr -} - -type IUriBuilderFactory1 = TIUriBuilderFactory1 - type TLPWININETINFO = uintptr type LPWININETINFO = TLPWININETINFO @@ -81417,12 +76311,6 @@ type TIWinInetInfoVtbl = struct { type IWinInetInfoVtbl = TIWinInetInfoVtbl -type TIWinInetInfo1 = struct { - FlpVtbl uintptr -} - -type IWinInetInfo1 = TIWinInetInfo1 - type TLPHTTPSECURITY = uintptr type LPHTTPSECURITY = TLPHTTPSECURITY @@ -81437,12 +76325,6 @@ type TIHttpSecurityVtbl = struct { type IHttpSecurityVtbl = TIHttpSecurityVtbl -type TIHttpSecurity1 = struct { - FlpVtbl uintptr -} - -type IHttpSecurity1 = TIHttpSecurity1 - type TLPWININETHTTPINFO = uintptr type LPWININETHTTPINFO = TLPWININETHTTPINFO @@ -81457,12 +76339,6 @@ type TIWinInetHttpInfoVtbl = struct { type IWinInetHttpInfoVtbl = TIWinInetHttpInfoVtbl -type TIWinInetHttpInfo1 = struct { - FlpVtbl uintptr -} - -type IWinInetHttpInfo1 = TIWinInetHttpInfo1 - type TIWinInetHttpTimeoutsVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81472,12 +76348,6 @@ type TIWinInetHttpTimeoutsVtbl = struct { type IWinInetHttpTimeoutsVtbl = TIWinInetHttpTimeoutsVtbl -type TIWinInetHttpTimeouts1 = struct { - FlpVtbl uintptr -} - -type IWinInetHttpTimeouts1 = TIWinInetHttpTimeouts1 - type TLPWININETCACHEHINTS = uintptr type LPWININETCACHEHINTS = TLPWININETCACHEHINTS @@ -81491,12 +76361,6 @@ type TIWinInetCacheHintsVtbl = struct { type IWinInetCacheHintsVtbl = TIWinInetCacheHintsVtbl -type TIWinInetCacheHints1 = struct { - FlpVtbl uintptr -} - -type IWinInetCacheHints1 = TIWinInetCacheHints1 - type TLPWININETCACHEHINTS2 = uintptr type LPWININETCACHEHINTS2 = TLPWININETCACHEHINTS2 @@ -81511,12 +76375,6 @@ type TIWinInetCacheHints2Vtbl = struct { type IWinInetCacheHints2Vtbl = TIWinInetCacheHints2Vtbl -type TIWinInetCacheHints21 = struct { - FlpVtbl uintptr -} - -type IWinInetCacheHints21 = TIWinInetCacheHints21 - type TLPBINDHOST = uintptr type LPBINDHOST = TLPBINDHOST @@ -81532,12 +76390,6 @@ type TIBindHostVtbl = struct { type IBindHostVtbl = TIBindHostVtbl -type TIBindHost1 = struct { - FlpVtbl uintptr -} - -type IBindHost1 = TIBindHost1 - type TLPIINTERNET = uintptr type LPIINTERNET = TLPIINTERNET @@ -81550,12 +76402,6 @@ type TIInternetVtbl = struct { type IInternetVtbl = TIInternetVtbl -type TIInternet1 = struct { - FlpVtbl uintptr -} - -type IInternet1 = TIInternet1 - type TLPIINTERNETBINDINFO = uintptr type LPIINTERNETBINDINFO = TLPIINTERNETBINDINFO @@ -81600,12 +76446,6 @@ type TIInternetBindInfoVtbl = struct { type IInternetBindInfoVtbl = TIInternetBindInfoVtbl -type TIInternetBindInfo1 = struct { - FlpVtbl uintptr -} - -type IInternetBindInfo1 = TIInternetBindInfo1 - type TLPIINTERNETBINDINFOEX = uintptr type LPIINTERNETBINDINFOEX = TLPIINTERNETBINDINFOEX @@ -81621,12 +76461,6 @@ type TIInternetBindInfoExVtbl = struct { type IInternetBindInfoExVtbl = TIInternetBindInfoExVtbl -type TIInternetBindInfoEx1 = struct { - FlpVtbl uintptr -} - -type IInternetBindInfoEx1 = TIInternetBindInfoEx1 - type TLPIINTERNETPROTOCOLROOT = uintptr type LPIINTERNETPROTOCOLROOT = TLPIINTERNETPROTOCOLROOT @@ -81692,12 +76526,6 @@ type TIInternetProtocolRootVtbl = struct { type IInternetProtocolRootVtbl = TIInternetProtocolRootVtbl -type TIInternetProtocolRoot1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolRoot1 = TIInternetProtocolRoot1 - type TLPIINTERNETPROTOCOL = uintptr type LPIINTERNETPROTOCOL = TLPIINTERNETPROTOCOL @@ -81720,12 +76548,6 @@ type TIInternetProtocolVtbl = struct { type IInternetProtocolVtbl = TIInternetProtocolVtbl -type TIInternetProtocol1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocol1 = TIInternetProtocol1 - type TIInternetProtocolExVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81745,12 +76567,6 @@ type TIInternetProtocolExVtbl = struct { type IInternetProtocolExVtbl = TIInternetProtocolExVtbl -type TIInternetProtocolEx1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolEx1 = TIInternetProtocolEx1 - type TLPIINTERNETPROTOCOLSINK = uintptr type LPIINTERNETPROTOCOLSINK = TLPIINTERNETPROTOCOLSINK @@ -81767,12 +76583,6 @@ type TIInternetProtocolSinkVtbl = struct { type IInternetProtocolSinkVtbl = TIInternetProtocolSinkVtbl -type TIInternetProtocolSink1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolSink1 = TIInternetProtocolSink1 - type TLPIINTERNETPROTOCOLSINKStackable = uintptr type LPIINTERNETPROTOCOLSINKStackable = TLPIINTERNETPROTOCOLSINKStackable @@ -81788,12 +76598,6 @@ type TIInternetProtocolSinkStackableVtbl = struct { type IInternetProtocolSinkStackableVtbl = TIInternetProtocolSinkStackableVtbl -type TIInternetProtocolSinkStackable1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolSinkStackable1 = TIInternetProtocolSinkStackable1 - type TLPIINTERNETSESSION = uintptr type LPIINTERNETSESSION = TLPIINTERNETSESSION @@ -81822,12 +76626,6 @@ type TIInternetSessionVtbl = struct { type IInternetSessionVtbl = TIInternetSessionVtbl -type TIInternetSession1 = struct { - FlpVtbl uintptr -} - -type IInternetSession1 = TIInternetSession1 - type TLPIINTERNETTHREADSWITCH = uintptr type LPIINTERNETTHREADSWITCH = TLPIINTERNETTHREADSWITCH @@ -81842,12 +76640,6 @@ type TIInternetThreadSwitchVtbl = struct { type IInternetThreadSwitchVtbl = TIInternetThreadSwitchVtbl -type TIInternetThreadSwitch1 = struct { - FlpVtbl uintptr -} - -type IInternetThreadSwitch1 = TIInternetThreadSwitch1 - type TLPIINTERNETPRIORITY = uintptr type LPIINTERNETPRIORITY = TLPIINTERNETPRIORITY @@ -81862,12 +76654,6 @@ type TIInternetPriorityVtbl = struct { type IInternetPriorityVtbl = TIInternetPriorityVtbl -type TIInternetPriority1 = struct { - FlpVtbl uintptr -} - -type IInternetPriority1 = TIInternetPriority1 - type TLPIINTERNETPROTOCOLINFO = uintptr type LPIINTERNETPROTOCOLINFO = TLPIINTERNETPROTOCOLINFO @@ -81942,12 +76728,6 @@ type TIInternetProtocolInfoVtbl = struct { type IInternetProtocolInfoVtbl = TIInternetProtocolInfoVtbl -type TIInternetProtocolInfo1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolInfo1 = TIInternetProtocolInfo1 - type TINTERNETFEATURELIST = int32 type INTERNETFEATURELIST = TINTERNETFEATURELIST @@ -81994,12 +76774,6 @@ type TIInternetSecurityMgrSiteVtbl = struct { type IInternetSecurityMgrSiteVtbl = TIInternetSecurityMgrSiteVtbl -type TIInternetSecurityMgrSite1 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityMgrSite1 = TIInternetSecurityMgrSite1 - type TPUAF = int32 type PUAF = TPUAF @@ -82062,12 +76836,6 @@ type TIInternetSecurityManagerVtbl = struct { type IInternetSecurityManagerVtbl = TIInternetSecurityManagerVtbl -type TIInternetSecurityManager1 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityManager1 = TIInternetSecurityManager1 - type TIInternetSecurityManagerExVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -82085,12 +76853,6 @@ type TIInternetSecurityManagerExVtbl = struct { type IInternetSecurityManagerExVtbl = TIInternetSecurityManagerExVtbl -type TIInternetSecurityManagerEx1 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityManagerEx1 = TIInternetSecurityManagerEx1 - type TIInternetSecurityManagerEx2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -82112,12 +76874,6 @@ type TIInternetSecurityManagerEx2Vtbl = struct { type IInternetSecurityManagerEx2Vtbl = TIInternetSecurityManagerEx2Vtbl -type TIInternetSecurityManagerEx21 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityManagerEx21 = TIInternetSecurityManagerEx21 - type TIZoneIdentifierVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -82129,12 +76885,6 @@ type TIZoneIdentifierVtbl = struct { type IZoneIdentifierVtbl = TIZoneIdentifierVtbl -type TIZoneIdentifier1 = struct { - FlpVtbl uintptr -} - -type IZoneIdentifier1 = TIZoneIdentifier1 - type TIInternetHostSecurityManagerVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -82146,12 +76896,6 @@ type TIInternetHostSecurityManagerVtbl = struct { type IInternetHostSecurityManagerVtbl = TIInternetHostSecurityManagerVtbl -type TIInternetHostSecurityManager1 = struct { - FlpVtbl uintptr -} - -type IInternetHostSecurityManager1 = TIInternetHostSecurityManager1 - type TLPURLZONEMANAGER = uintptr type LPURLZONEMANAGER = TLPURLZONEMANAGER @@ -82260,12 +77004,6 @@ type TIInternetZoneManagerVtbl = struct { type IInternetZoneManagerVtbl = TIInternetZoneManagerVtbl -type TIInternetZoneManager1 = struct { - FlpVtbl uintptr -} - -type IInternetZoneManager1 = TIInternetZoneManager1 - type TIInternetZoneManagerExVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -82288,12 +77026,6 @@ type TIInternetZoneManagerExVtbl = struct { type IInternetZoneManagerExVtbl = TIInternetZoneManagerExVtbl -type TIInternetZoneManagerEx1 = struct { - FlpVtbl uintptr -} - -type IInternetZoneManagerEx1 = TIInternetZoneManagerEx1 - type TIInternetZoneManagerEx2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -82320,12 +77052,6 @@ type TIInternetZoneManagerEx2Vtbl = struct { type IInternetZoneManagerEx2Vtbl = TIInternetZoneManagerEx2Vtbl -type TIInternetZoneManagerEx21 = struct { - FlpVtbl uintptr -} - -type IInternetZoneManagerEx21 = TIInternetZoneManagerEx21 - type TCODEBASEHOLD = struct { FcbSize TULONG FszDistUnit TLPWSTR @@ -82383,12 +77109,6 @@ type TISoftDistExtVtbl = struct { type ISoftDistExtVtbl = TISoftDistExtVtbl -type TISoftDistExt1 = struct { - FlpVtbl uintptr -} - -type ISoftDistExt1 = TISoftDistExt1 - type TLPCATALOGFILEINFO = uintptr type LPCATALOGFILEINFO = TLPCATALOGFILEINFO @@ -82403,12 +77123,6 @@ type TICatalogFileInfoVtbl = struct { type ICatalogFileInfoVtbl = TICatalogFileInfoVtbl -type TICatalogFileInfo1 = struct { - FlpVtbl uintptr -} - -type ICatalogFileInfo1 = TICatalogFileInfo1 - type TLPDATAFILTER = uintptr type LPDATAFILTER = TLPDATAFILTER @@ -82424,12 +77138,6 @@ type TIDataFilterVtbl = struct { type IDataFilterVtbl = TIDataFilterVtbl -type TIDataFilter1 = struct { - FlpVtbl uintptr -} - -type IDataFilter1 = TIDataFilter1 - type TPROTOCOLFILTERDATA = struct { FcbSize TDWORD FpProtocolSink uintptr @@ -82471,12 +77179,6 @@ type TIEncodingFilterFactoryVtbl = struct { type IEncodingFilterFactoryVtbl = TIEncodingFilterFactoryVtbl -type TIEncodingFilterFactory1 = struct { - FlpVtbl uintptr -} - -type IEncodingFilterFactory1 = TIEncodingFilterFactory1 - type THIT_LOGGING_INFO = struct { FdwStructSize TDWORD FlpszLoggedUrlName TLPSTR @@ -82516,12 +77218,6 @@ type TIWrappedProtocolVtbl = struct { type IWrappedProtocolVtbl = TIWrappedProtocolVtbl -type TIWrappedProtocol1 = struct { - FlpVtbl uintptr -} - -type IWrappedProtocol1 = TIWrappedProtocol1 - type TLPGETBINDHANDLE = uintptr type LPGETBINDHANDLE = TLPGETBINDHANDLE @@ -82545,12 +77241,6 @@ type TIGetBindHandleVtbl = struct { type IGetBindHandleVtbl = TIGetBindHandleVtbl -type TIGetBindHandle1 = struct { - FlpVtbl uintptr -} - -type IGetBindHandle1 = TIGetBindHandle1 - type TPROTOCOL_ARGUMENT = struct { FszMethod TLPCWSTR FszTargetUrl TLPCWSTR @@ -82579,12 +77269,6 @@ type TIBindCallbackRedirectVtbl = struct { type IBindCallbackRedirectVtbl = TIBindCallbackRedirectVtbl -type TIBindCallbackRedirect1 = struct { - FlpVtbl uintptr -} - -type IBindCallbackRedirect1 = TIBindCallbackRedirect1 - type TIPropertyStorage = struct { FlpVtbl uintptr } @@ -82958,12 +77642,6 @@ type TIPropertyStorageVtbl = struct { type IPropertyStorageVtbl = TIPropertyStorageVtbl -type TIPropertyStorage1 = struct { - FlpVtbl uintptr -} - -type IPropertyStorage1 = TIPropertyStorage1 - type TLPPROPERTYSETSTORAGE = uintptr type LPPROPERTYSETSTORAGE = TLPPROPERTYSETSTORAGE @@ -82980,12 +77658,6 @@ type TIPropertySetStorageVtbl = struct { type IPropertySetStorageVtbl = TIPropertySetStorageVtbl -type TIPropertySetStorage1 = struct { - FlpVtbl uintptr -} - -type IPropertySetStorage1 = TIPropertySetStorage1 - type TLPENUMSTATPROPSTG = uintptr type LPENUMSTATPROPSTG = TLPENUMSTATPROPSTG @@ -83002,12 +77674,6 @@ type TIEnumSTATPROPSTGVtbl = struct { type IEnumSTATPROPSTGVtbl = TIEnumSTATPROPSTGVtbl -type TIEnumSTATPROPSTG1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATPROPSTG1 = TIEnumSTATPROPSTG1 - type TLPENUMSTATPROPSETSTG = uintptr type LPENUMSTATPROPSETSTG = TLPENUMSTATPROPSETSTG @@ -83024,12 +77690,6 @@ type TIEnumSTATPROPSETSTGVtbl = struct { type IEnumSTATPROPSETSTGVtbl = TIEnumSTATPROPSETSTGVtbl -type TIEnumSTATPROPSETSTG1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATPROPSETSTG1 = TIEnumSTATPROPSETSTG1 - type TLPPROPERTYSTORAGE = uintptr type LPPROPERTYSTORAGE = TLPPROPERTYSTORAGE @@ -83437,16 +78097,6 @@ type TPSTORAGE_BREAK_RESERVATION_REQUEST = uintptr type PSTORAGE_BREAK_RESERVATION_REQUEST = TPSTORAGE_BREAK_RESERVATION_REQUEST -type TSTORAGE_BREAK_RESERVATION_REQUEST1 = struct { - FLength TDWORD - F_unused TBYTE - FPathId TBYTE - FTargetId TBYTE - FLun TBYTE -} - -type STORAGE_BREAK_RESERVATION_REQUEST1 = TSTORAGE_BREAK_RESERVATION_REQUEST1 - type TPREVENT_MEDIA_REMOVAL = struct { FPreventMediaRemoval TBOOLEAN } @@ -85009,17 +79659,6 @@ type TPRETRIEVAL_POINTERS_BUFFER = uintptr type PRETRIEVAL_POINTERS_BUFFER = TPRETRIEVAL_POINTERS_BUFFER -type TRETRIEVAL_POINTERS_BUFFER1 = struct { - FExtentCount TDWORD - FStartingVcn TLARGE_INTEGER - FExtents [1]struct { - FNextVcn TLARGE_INTEGER - FLcn TLARGE_INTEGER - } -} - -type RETRIEVAL_POINTERS_BUFFER1 = TRETRIEVAL_POINTERS_BUFFER1 - type TNTFS_FILE_RECORD_INPUT_BUFFER = struct { FFileReferenceNumber TLARGE_INTEGER } @@ -91462,17 +86101,6 @@ type TIPrintDialogCallbackVtbl = struct { type IPrintDialogCallbackVtbl = TIPrintDialogCallbackVtbl -type TIPrintDialogCallbackVtbl1 = struct { - FQueryInterface uintptr - FAddRef uintptr - FRelease uintptr - FInitDone uintptr - FSelectionChange uintptr - FHandleMessage uintptr -} - -type IPrintDialogCallbackVtbl1 = TIPrintDialogCallbackVtbl1 - type TIPrintDialogServices = struct { FlpVtbl uintptr } @@ -91490,17 +86118,6 @@ type TIPrintDialogServicesVtbl = struct { type IPrintDialogServicesVtbl = TIPrintDialogServicesVtbl -type TIPrintDialogServicesVtbl1 = struct { - FQueryInterface uintptr - FAddRef uintptr - FRelease uintptr - FGetCurrentDevMode uintptr - FGetCurrentPrinterName uintptr - FGetCurrentPortName uintptr -} - -type IPrintDialogServicesVtbl1 = TIPrintDialogServicesVtbl1 - type TPRINTPAGERANGE = struct { FnFromPage TDWORD FnToPage TDWORD @@ -92863,293 +87480,6 @@ type REGISTERWORDENUMPROCW = TREGISTERWORDENUMPROCW ** on a Win32 system. */ -/* -** Each recursive mutex is an instance of the following structure. - */ -type Tsqlite3_mutex1 = struct { - Fmutex TCRITICAL_SECTION - Fid int32 -} - -type sqlite3_mutex1 = Tsqlite3_mutex1 - -/* -** These are the initializer values used when declaring a "static" mutex -** on Win32. It should be noted that all mutexes require initialization -** on the Win32 platform. - */ - -// C documentation -// -// /* -// ** Try to provide a memory barrier operation, needed for initialization -// ** and also for the xShmBarrier method of the VFS in cases when SQLite is -// ** compiled without mutexes (SQLITE_THREADSAFE=0). -// */ -func _sqlite3MemoryBarrier(tls *libc.TLS) { - libc.X__sync_synchronize(tls) -} - -// C documentation -// -// /* -// ** Initialize and deinitialize the mutex subsystem. -// */ -var _winMutex_staticMutexes = [12]Tsqlite3_mutex{ - 0: { - Fid: int32(2), - }, - 1: { - Fid: int32(3), - }, - 2: { - Fid: int32(4), - }, - 3: { - Fid: int32(5), - }, - 4: { - Fid: int32(6), - }, - 5: { - Fid: int32(7), - }, - 6: { - Fid: int32(8), - }, - 7: { - Fid: int32(9), - }, - 8: { - Fid: int32(10), - }, - 9: { - Fid: int32(11), - }, - 10: { - Fid: int32(12), - }, - 11: { - Fid: int32(13), - }, -} - -var _winMutex_isInit = int32(0) -var _winMutex_isNt = -int32(1) - -// C documentation -// -// /* As the winMutexInit() and winMutexEnd() functions are called as part -// ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the -// ** "interlocked" magic used here is probably not strictly necessary. -// */ -var _winMutex_lock = int32(0) - -func _winMutexInit(tls *libc.TLS) (r int32) { - var i int32 - _ = i - /* The first to increment to 1 does actual initialization */ - if libc.X_InterlockedCompareExchange(tls, uintptr(unsafe.Pointer(&_winMutex_lock)), int32(1), 0) == 0 { - i = 0 - for { - if !(i < int32(libc.Uint64FromInt64(576)/libc.Uint64FromInt64(48))) { - break - } - libc.XInitializeCriticalSection(tls, uintptr(unsafe.Pointer(&_winMutex_staticMutexes))+uintptr(i)*48) - goto _1 - _1: - ; - i++ - } - _winMutex_isInit = int32(1) - } else { - /* Another thread is (in the process of) initializing the static - ** mutexes */ - for !(_winMutex_isInit != 0) { - Xsqlite3_win32_sleep(tls, uint32(1)) - } - } - return SQLITE_OK -} - -func _winMutexEnd(tls *libc.TLS) (r int32) { - var i int32 - _ = i - /* The first to decrement to 0 does actual shutdown - ** (which should be the last to shutdown.) */ - if libc.X_InterlockedCompareExchange(tls, uintptr(unsafe.Pointer(&_winMutex_lock)), 0, int32(1)) == int32(1) { - if _winMutex_isInit == int32(1) { - i = 0 - for { - if !(i < int32(libc.Uint64FromInt64(576)/libc.Uint64FromInt64(48))) { - break - } - libc.XDeleteCriticalSection(tls, uintptr(unsafe.Pointer(&_winMutex_staticMutexes))+uintptr(i)*48) - goto _1 - _1: - ; - i++ - } - _winMutex_isInit = 0 - } - } - return SQLITE_OK -} - -// C documentation -// -// /* -// ** The sqlite3_mutex_alloc() routine allocates a new -// ** mutex and returns a pointer to it. If it returns NULL -// ** that means that a mutex could not be allocated. SQLite -// ** will unwind its stack and return an error. The argument -// ** to sqlite3_mutex_alloc() is one of these integer constants: -// ** -// **
      -// **
    • SQLITE_MUTEX_FAST -// **
    • SQLITE_MUTEX_RECURSIVE -// **
    • SQLITE_MUTEX_STATIC_MAIN -// **
    • SQLITE_MUTEX_STATIC_MEM -// **
    • SQLITE_MUTEX_STATIC_OPEN -// **
    • SQLITE_MUTEX_STATIC_PRNG -// **
    • SQLITE_MUTEX_STATIC_LRU -// **
    • SQLITE_MUTEX_STATIC_PMEM -// **
    • SQLITE_MUTEX_STATIC_APP1 -// **
    • SQLITE_MUTEX_STATIC_APP2 -// **
    • SQLITE_MUTEX_STATIC_APP3 -// **
    • SQLITE_MUTEX_STATIC_VFS1 -// **
    • SQLITE_MUTEX_STATIC_VFS2 -// **
    • SQLITE_MUTEX_STATIC_VFS3 -// **
    -// ** -// ** The first two constants cause sqlite3_mutex_alloc() to create -// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE -// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. -// ** The mutex implementation does not need to make a distinction -// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does -// ** not want to. But SQLite will only request a recursive mutex in -// ** cases where it really needs one. If a faster non-recursive mutex -// ** implementation is available on the host platform, the mutex subsystem -// ** might return such a mutex in response to SQLITE_MUTEX_FAST. -// ** -// ** The other allowed parameters to sqlite3_mutex_alloc() each return -// ** a pointer to a static preexisting mutex. Six static mutexes are -// ** used by the current version of SQLite. Future versions of SQLite -// ** may add additional static mutexes. Static mutexes are for internal -// ** use by SQLite only. Applications that use SQLite mutexes should -// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or -// ** SQLITE_MUTEX_RECURSIVE. -// ** -// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST -// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -// ** returns a different mutex on every call. But for the static -// ** mutex types, the same mutex is returned on every call that has -// ** the same type number. -// */ -func _winMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { - var p uintptr - _ = p - switch iType { - case SQLITE_MUTEX_FAST: - fallthrough - case int32(SQLITE_MUTEX_RECURSIVE): - p = _sqlite3MallocZero(tls, uint64(48)) - if p != 0 { - (*Tsqlite3_mutex)(unsafe.Pointer(p)).Fid = iType - libc.XInitializeCriticalSection(tls, p) - } - default: - p = uintptr(unsafe.Pointer(&_winMutex_staticMutexes)) + uintptr(iType-int32(2))*48 - break - } - return p -} - -// C documentation -// -// /* -// ** This routine deallocates a previously -// ** allocated mutex. SQLite is careful to deallocate every -// ** mutex that it allocates. -// */ -func _winMutexFree(tls *libc.TLS, p uintptr) { - if (*Tsqlite3_mutex)(unsafe.Pointer(p)).Fid == SQLITE_MUTEX_FAST || (*Tsqlite3_mutex)(unsafe.Pointer(p)).Fid == int32(SQLITE_MUTEX_RECURSIVE) { - libc.XDeleteCriticalSection(tls, p) - Xsqlite3_free(tls, p) - } else { - } -} - -// C documentation -// -// /* -// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt -// ** to enter a mutex. If another thread is already within the mutex, -// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return -// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK -// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can -// ** be entered multiple times by the same thread. In such cases the, -// ** mutex must be exited an equal number of times before another thread -// ** can enter. If the same thread tries to enter any other kind of mutex -// ** more than once, the behavior is undefined. -// */ -func _winMutexEnter(tls *libc.TLS, p uintptr) { - libc.XEnterCriticalSection(tls, p) -} - -func _winMutexTry(tls *libc.TLS, p uintptr) (r int32) { - var rc int32 - _ = rc - rc = int32(SQLITE_BUSY) - /* - ** The sqlite3_mutex_try() routine is very rarely used, and when it - ** is used it is merely an optimization. So it is OK for it to always - ** fail. - ** - ** The TryEnterCriticalSection() interface is only available on WinNT. - ** And some windows compilers complain if you try to use it without - ** first doing some #defines that prevent SQLite from building on Win98. - ** For that reason, we will omit this optimization for now. See - ** ticket #2685. - */ - if _winMutex_isNt < 0 { - _winMutex_isNt = Xsqlite3_win32_is_nt(tls) - } - if _winMutex_isNt != 0 && libc.XTryEnterCriticalSection(tls, p) != 0 { - rc = SQLITE_OK - } - return rc -} - -// C documentation -// -// /* -// ** The sqlite3_mutex_leave() routine exits a mutex that was -// ** previously entered by the same thread. The behavior -// ** is undefined if the mutex is not currently entered or -// ** is not currently allocated. SQLite will never do either. -// */ -func _winMutexLeave(tls *libc.TLS, p uintptr) { - libc.XLeaveCriticalSection(tls, p) -} - -func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return uintptr(unsafe.Pointer(&_sMutex1)) -} - -var _sMutex1 = Tsqlite3_mutex_methods{} - -func init() { - p := unsafe.Pointer(&_sMutex1) - *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_winMutexInit) - *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_winMutexEnd) - *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_winMutexAlloc) - *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_winMutexFree) - *(*uintptr)(unsafe.Add(p, 32)) = __ccgo_fp(_winMutexEnter) - *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_winMutexTry) - *(*uintptr)(unsafe.Add(p, 48)) = __ccgo_fp(_winMutexLeave) -} - /************** End of mutex_w32.c *******************************************/ /************** Begin file malloc.c ******************************************/ /* @@ -93218,6 +87548,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -93225,8 +87557,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -94045,7 +88377,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1644, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -94213,17 +88545,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -94420,22 +88752,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(144) defer tls.Free(144) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -94467,7 +88800,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = int32(*(*int8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1657, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1658, int32(1)) break } /* Find out what flags are present */ @@ -94684,11 +89017,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -94882,9 +89215,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1659 + v57 = __ccgo_ts + 1660 } else { - v57 = __ccgo_ts + 1664 + v57 = __ccgo_ts + 1665 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -94895,7 +89228,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1668, uint64(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1669, uint64(5)) bufpt = bp if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -95165,29 +89498,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + int32(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + int32(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -95228,7 +89539,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1673 + bufpt = __ccgo_ts + 1674 } else { if int32(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -95302,25 +89613,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if int32(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if int32(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1674 + if escarg == uintptr(0) { + if int32(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1675 } else { - v98 = __ccgo_ts + 1679 + v97 = __ccgo_ts + 1680 + } + escarg = v97 + } else { + if int32(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if int32(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -95328,15 +89643,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -95347,13 +89662,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && int32(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if int32(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || int32(xtype) == int32(etESCAPE_q) { + n1 += int64(nBack + uint32(5)*nCtrl) + if int32(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -95367,35 +89715,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1687, uint64(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if int32(uint8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1696 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -95420,9 +89831,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -95436,7 +89847,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 72))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1686, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1713, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -95446,21 +89857,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 72)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1688, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1715, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1698, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1725, libc.VaList(bp+128, *(*Tu32)(unsafe.Pointer(&(*TSrcItem)(unsafe.Pointer(pItem)).Fu1)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1719, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1746, libc.VaList(bp+128, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -95699,7 +90110,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) p1 = p + 29 @@ -95735,7 +90146,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if int32((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, int32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1673, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1674, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -95998,6 +90409,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -96015,11 +90428,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(256) - defer tls.Free(256) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+32 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(210), 0) + var _ /* zMsg at bp+32 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -96525,17 +90938,6 @@ type T_tls_callback_type = uintptr type _tls_callback_type = T_tls_callback_type -/* A running thread */ -type TSQLiteThread1 = struct { - Ftid uintptr - Fid uint32 - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Thread procedure Win32 compatibility shim */ @@ -96551,7 +90953,7 @@ func _sqlite3ThreadProc(tls *libc.TLS, pArg uintptr) (r uint32) { // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr _ = p *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -96567,7 +90969,7 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui if int32(_sqlite3Config.FbCoreMutex) == 0 || _sqlite3FaultSim(tls, int32(200)) != 0 { libc.Xmemset(tls, p, 0, uint64(40)) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn (*TSQLiteThread)(unsafe.Pointer(p)).Ftid = uintptr(libc.X_beginthreadex(tls, uintptr(0), uint32(0), __ccgo_fp(_sqlite3ThreadProc), p, uint32(0), p+8)) if (*TSQLiteThread)(unsafe.Pointer(p)).Ftid == uintptr(0) { @@ -96576,7 +90978,7 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui } if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask == uintptr(0) { (*TSQLiteThread)(unsafe.Pointer(p)).Fid = uint32(libc.XGetCurrentThreadId(tls)) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -96726,6 +91128,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = int8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + int32(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + int32(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + int32(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + int32(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + int32(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + int32(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + int32(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + int32(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + int32(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -97522,7 +91955,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 152 + v2 = p + 136 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -97697,7 +92130,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1733, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1760, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -97909,11 +92342,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint64(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -98149,7 +92582,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -98239,7 +92672,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1758 + pow63 = __ccgo_ts + 1785 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -98466,7 +92899,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = int32(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1777)) + n = int32(libc.Uint64FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1804)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -98626,7 +93059,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1793 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1820 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -98735,7 +93168,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 24 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -99151,7 +93584,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1795, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1822, libc.VaList(bp+8, zType)) } // C documentation @@ -99174,13 +93607,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1674) + _logBadConnection(tls, __ccgo_ts+1675) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if int32(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1840) + _logBadConnection(tls, __ccgo_ts+1867) } return 0 } else { @@ -99194,7 +93627,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if int32(eOpenState) != int32(SQLITE_STATE_SICK) && int32(eOpenState) != int32(SQLITE_STATE_OPEN) && int32(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1849) + _logBadConnection(tls, __ccgo_ts+1876) return 0 } else { return int32(1) @@ -99225,7 +93658,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -99576,23 +94009,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = uint8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(int32(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += uint32(int32(0xdf) & int32(uint8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -99647,8 +94078,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if uint64(new_size)*uint64(16) > uint64(SQLITE_MALLOC_SOFT_LIMIT) { new_size = uint32(libc.Uint64FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint64FromInt64(16)) } @@ -99681,9 +94112,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*16, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*16, elem) goto _2 _2: ; @@ -99703,13 +94133,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -99717,7 +94146,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -99733,7 +94162,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -99745,7 +94174,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*16 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -99794,7 +94223,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -99804,20 +94233,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(32)) + new_elem = _sqlite3Malloc(tls, uint64(40)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*16 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*16 } else { v1 = uintptr(0) } @@ -99836,196 +94264,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1857, - 1: __ccgo_ts + 1867, - 2: __ccgo_ts + 1878, - 3: __ccgo_ts + 1890, - 4: __ccgo_ts + 1901, - 5: __ccgo_ts + 1913, - 6: __ccgo_ts + 1920, - 7: __ccgo_ts + 1928, - 8: __ccgo_ts + 1936, - 9: __ccgo_ts + 1941, - 10: __ccgo_ts + 1946, - 11: __ccgo_ts + 1952, - 12: __ccgo_ts + 1966, - 13: __ccgo_ts + 1972, - 14: __ccgo_ts + 1982, - 15: __ccgo_ts + 1987, - 16: __ccgo_ts + 1992, - 17: __ccgo_ts + 1995, - 18: __ccgo_ts + 2001, - 19: __ccgo_ts + 2008, - 20: __ccgo_ts + 2012, - 21: __ccgo_ts + 2022, - 22: __ccgo_ts + 2029, - 23: __ccgo_ts + 2036, - 24: __ccgo_ts + 2043, - 25: __ccgo_ts + 2050, - 26: __ccgo_ts + 2060, - 27: __ccgo_ts + 2069, - 28: __ccgo_ts + 2080, - 29: __ccgo_ts + 2089, - 30: __ccgo_ts + 2095, - 31: __ccgo_ts + 2105, - 32: __ccgo_ts + 2115, - 33: __ccgo_ts + 2120, - 34: __ccgo_ts + 2134, - 35: __ccgo_ts + 2145, - 36: __ccgo_ts + 2150, - 37: __ccgo_ts + 2157, - 38: __ccgo_ts + 2168, - 39: __ccgo_ts + 2173, - 40: __ccgo_ts + 2178, - 41: __ccgo_ts + 2184, - 42: __ccgo_ts + 2190, - 43: __ccgo_ts + 2196, - 44: __ccgo_ts + 2199, - 45: __ccgo_ts + 2203, - 46: __ccgo_ts + 2209, - 47: __ccgo_ts + 2220, - 48: __ccgo_ts + 2231, - 49: __ccgo_ts + 2239, - 50: __ccgo_ts + 2248, - 51: __ccgo_ts + 2254, - 52: __ccgo_ts + 2261, - 53: __ccgo_ts + 2269, - 54: __ccgo_ts + 2272, - 55: __ccgo_ts + 2275, - 56: __ccgo_ts + 2278, - 57: __ccgo_ts + 2281, - 58: __ccgo_ts + 2284, - 59: __ccgo_ts + 2287, - 60: __ccgo_ts + 2294, - 61: __ccgo_ts + 2304, - 62: __ccgo_ts + 2317, - 63: __ccgo_ts + 2328, - 64: __ccgo_ts + 2334, - 65: __ccgo_ts + 2341, - 66: __ccgo_ts + 2350, - 67: __ccgo_ts + 2359, - 68: __ccgo_ts + 2366, - 69: __ccgo_ts + 2379, - 70: __ccgo_ts + 2390, - 71: __ccgo_ts + 2395, - 72: __ccgo_ts + 2403, - 73: __ccgo_ts + 2409, - 74: __ccgo_ts + 2416, - 75: __ccgo_ts + 2428, - 76: __ccgo_ts + 2433, - 77: __ccgo_ts + 2442, - 78: __ccgo_ts + 2447, - 79: __ccgo_ts + 2456, - 80: __ccgo_ts + 2461, - 81: __ccgo_ts + 2466, - 82: __ccgo_ts + 2472, - 83: __ccgo_ts + 2480, - 84: __ccgo_ts + 2488, - 85: __ccgo_ts + 2498, - 86: __ccgo_ts + 2506, - 87: __ccgo_ts + 2513, - 88: __ccgo_ts + 2526, - 89: __ccgo_ts + 2531, - 90: __ccgo_ts + 2543, - 91: __ccgo_ts + 2551, - 92: __ccgo_ts + 2558, - 93: __ccgo_ts + 2569, - 94: __ccgo_ts + 2576, - 95: __ccgo_ts + 2583, - 96: __ccgo_ts + 2593, - 97: __ccgo_ts + 2602, - 98: __ccgo_ts + 2613, - 99: __ccgo_ts + 2619, - 100: __ccgo_ts + 2630, - 101: __ccgo_ts + 2640, - 102: __ccgo_ts + 2650, - 103: __ccgo_ts + 2659, - 104: __ccgo_ts + 2666, - 105: __ccgo_ts + 2672, - 106: __ccgo_ts + 2682, - 107: __ccgo_ts + 2693, - 108: __ccgo_ts + 2697, - 109: __ccgo_ts + 2706, - 110: __ccgo_ts + 2715, - 111: __ccgo_ts + 2722, - 112: __ccgo_ts + 2732, - 113: __ccgo_ts + 2739, - 114: __ccgo_ts + 2749, - 115: __ccgo_ts + 2757, - 116: __ccgo_ts + 2764, - 117: __ccgo_ts + 2778, - 118: __ccgo_ts + 2792, - 119: __ccgo_ts + 2800, - 120: __ccgo_ts + 2811, - 121: __ccgo_ts + 2824, - 122: __ccgo_ts + 2835, - 123: __ccgo_ts + 2841, - 124: __ccgo_ts + 2853, - 125: __ccgo_ts + 2862, - 126: __ccgo_ts + 2870, - 127: __ccgo_ts + 2879, - 128: __ccgo_ts + 2888, - 129: __ccgo_ts + 2895, - 130: __ccgo_ts + 2903, - 131: __ccgo_ts + 2910, - 132: __ccgo_ts + 2921, - 133: __ccgo_ts + 2935, - 134: __ccgo_ts + 2946, - 135: __ccgo_ts + 2954, - 136: __ccgo_ts + 2960, - 137: __ccgo_ts + 2968, - 138: __ccgo_ts + 2976, - 139: __ccgo_ts + 2986, - 140: __ccgo_ts + 2999, - 141: __ccgo_ts + 3009, - 142: __ccgo_ts + 3022, - 143: __ccgo_ts + 3031, - 144: __ccgo_ts + 3042, - 145: __ccgo_ts + 3050, - 146: __ccgo_ts + 3056, - 147: __ccgo_ts + 3068, - 148: __ccgo_ts + 3080, - 149: __ccgo_ts + 3088, - 150: __ccgo_ts + 3100, - 151: __ccgo_ts + 3113, - 152: __ccgo_ts + 3123, - 153: __ccgo_ts + 3133, - 154: __ccgo_ts + 3145, - 155: __ccgo_ts + 3150, - 156: __ccgo_ts + 3162, - 157: __ccgo_ts + 3172, - 158: __ccgo_ts + 3178, - 159: __ccgo_ts + 3188, - 160: __ccgo_ts + 3195, - 161: __ccgo_ts + 3207, - 162: __ccgo_ts + 3218, - 163: __ccgo_ts + 3226, - 164: __ccgo_ts + 3235, - 165: __ccgo_ts + 3244, - 166: __ccgo_ts + 3253, - 167: __ccgo_ts + 3260, - 168: __ccgo_ts + 3271, - 169: __ccgo_ts + 3284, - 170: __ccgo_ts + 3294, - 171: __ccgo_ts + 3301, - 172: __ccgo_ts + 3309, - 173: __ccgo_ts + 3318, - 174: __ccgo_ts + 3324, - 175: __ccgo_ts + 3331, - 176: __ccgo_ts + 3339, - 177: __ccgo_ts + 3347, - 178: __ccgo_ts + 3355, - 179: __ccgo_ts + 3365, - 180: __ccgo_ts + 3374, - 181: __ccgo_ts + 3385, - 182: __ccgo_ts + 3396, - 183: __ccgo_ts + 3407, - 184: __ccgo_ts + 3417, - 185: __ccgo_ts + 3423, - 186: __ccgo_ts + 3434, - 187: __ccgo_ts + 3445, - 188: __ccgo_ts + 3450, - 189: __ccgo_ts + 3458, + 0: __ccgo_ts + 1884, + 1: __ccgo_ts + 1894, + 2: __ccgo_ts + 1905, + 3: __ccgo_ts + 1917, + 4: __ccgo_ts + 1928, + 5: __ccgo_ts + 1940, + 6: __ccgo_ts + 1947, + 7: __ccgo_ts + 1955, + 8: __ccgo_ts + 1963, + 9: __ccgo_ts + 1968, + 10: __ccgo_ts + 1973, + 11: __ccgo_ts + 1979, + 12: __ccgo_ts + 1993, + 13: __ccgo_ts + 1999, + 14: __ccgo_ts + 2009, + 15: __ccgo_ts + 2014, + 16: __ccgo_ts + 2019, + 17: __ccgo_ts + 2022, + 18: __ccgo_ts + 2028, + 19: __ccgo_ts + 2035, + 20: __ccgo_ts + 2039, + 21: __ccgo_ts + 2049, + 22: __ccgo_ts + 2056, + 23: __ccgo_ts + 2063, + 24: __ccgo_ts + 2070, + 25: __ccgo_ts + 2077, + 26: __ccgo_ts + 2087, + 27: __ccgo_ts + 2096, + 28: __ccgo_ts + 2107, + 29: __ccgo_ts + 2116, + 30: __ccgo_ts + 2122, + 31: __ccgo_ts + 2132, + 32: __ccgo_ts + 2142, + 33: __ccgo_ts + 2147, + 34: __ccgo_ts + 2161, + 35: __ccgo_ts + 2172, + 36: __ccgo_ts + 2177, + 37: __ccgo_ts + 2184, + 38: __ccgo_ts + 2195, + 39: __ccgo_ts + 2200, + 40: __ccgo_ts + 2205, + 41: __ccgo_ts + 2211, + 42: __ccgo_ts + 2217, + 43: __ccgo_ts + 2223, + 44: __ccgo_ts + 2226, + 45: __ccgo_ts + 2230, + 46: __ccgo_ts + 2236, + 47: __ccgo_ts + 2247, + 48: __ccgo_ts + 2258, + 49: __ccgo_ts + 2266, + 50: __ccgo_ts + 2275, + 51: __ccgo_ts + 2281, + 52: __ccgo_ts + 2288, + 53: __ccgo_ts + 2296, + 54: __ccgo_ts + 2299, + 55: __ccgo_ts + 2302, + 56: __ccgo_ts + 2305, + 57: __ccgo_ts + 2308, + 58: __ccgo_ts + 2311, + 59: __ccgo_ts + 2314, + 60: __ccgo_ts + 2321, + 61: __ccgo_ts + 2331, + 62: __ccgo_ts + 2344, + 63: __ccgo_ts + 2355, + 64: __ccgo_ts + 2361, + 65: __ccgo_ts + 2368, + 66: __ccgo_ts + 2377, + 67: __ccgo_ts + 2386, + 68: __ccgo_ts + 2393, + 69: __ccgo_ts + 2406, + 70: __ccgo_ts + 2417, + 71: __ccgo_ts + 2422, + 72: __ccgo_ts + 2430, + 73: __ccgo_ts + 2436, + 74: __ccgo_ts + 2443, + 75: __ccgo_ts + 2455, + 76: __ccgo_ts + 2460, + 77: __ccgo_ts + 2469, + 78: __ccgo_ts + 2474, + 79: __ccgo_ts + 2483, + 80: __ccgo_ts + 2488, + 81: __ccgo_ts + 2493, + 82: __ccgo_ts + 2499, + 83: __ccgo_ts + 2507, + 84: __ccgo_ts + 2515, + 85: __ccgo_ts + 2525, + 86: __ccgo_ts + 2533, + 87: __ccgo_ts + 2540, + 88: __ccgo_ts + 2553, + 89: __ccgo_ts + 2558, + 90: __ccgo_ts + 2570, + 91: __ccgo_ts + 2578, + 92: __ccgo_ts + 2585, + 93: __ccgo_ts + 2596, + 94: __ccgo_ts + 2603, + 95: __ccgo_ts + 2610, + 96: __ccgo_ts + 2620, + 97: __ccgo_ts + 2629, + 98: __ccgo_ts + 2640, + 99: __ccgo_ts + 2646, + 100: __ccgo_ts + 2657, + 101: __ccgo_ts + 2667, + 102: __ccgo_ts + 2677, + 103: __ccgo_ts + 2686, + 104: __ccgo_ts + 2693, + 105: __ccgo_ts + 2699, + 106: __ccgo_ts + 2709, + 107: __ccgo_ts + 2720, + 108: __ccgo_ts + 2724, + 109: __ccgo_ts + 2733, + 110: __ccgo_ts + 2742, + 111: __ccgo_ts + 2749, + 112: __ccgo_ts + 2759, + 113: __ccgo_ts + 2766, + 114: __ccgo_ts + 2776, + 115: __ccgo_ts + 2784, + 116: __ccgo_ts + 2791, + 117: __ccgo_ts + 2805, + 118: __ccgo_ts + 2819, + 119: __ccgo_ts + 2827, + 120: __ccgo_ts + 2838, + 121: __ccgo_ts + 2851, + 122: __ccgo_ts + 2862, + 123: __ccgo_ts + 2868, + 124: __ccgo_ts + 2880, + 125: __ccgo_ts + 2889, + 126: __ccgo_ts + 2897, + 127: __ccgo_ts + 2906, + 128: __ccgo_ts + 2915, + 129: __ccgo_ts + 2922, + 130: __ccgo_ts + 2930, + 131: __ccgo_ts + 2937, + 132: __ccgo_ts + 2948, + 133: __ccgo_ts + 2962, + 134: __ccgo_ts + 2973, + 135: __ccgo_ts + 2981, + 136: __ccgo_ts + 2987, + 137: __ccgo_ts + 2995, + 138: __ccgo_ts + 3003, + 139: __ccgo_ts + 3013, + 140: __ccgo_ts + 3026, + 141: __ccgo_ts + 3036, + 142: __ccgo_ts + 3049, + 143: __ccgo_ts + 3058, + 144: __ccgo_ts + 3069, + 145: __ccgo_ts + 3077, + 146: __ccgo_ts + 3083, + 147: __ccgo_ts + 3095, + 148: __ccgo_ts + 3107, + 149: __ccgo_ts + 3115, + 150: __ccgo_ts + 3127, + 151: __ccgo_ts + 3140, + 152: __ccgo_ts + 3150, + 153: __ccgo_ts + 3160, + 154: __ccgo_ts + 3172, + 155: __ccgo_ts + 3177, + 156: __ccgo_ts + 3189, + 157: __ccgo_ts + 3199, + 158: __ccgo_ts + 3205, + 159: __ccgo_ts + 3215, + 160: __ccgo_ts + 3222, + 161: __ccgo_ts + 3234, + 162: __ccgo_ts + 3245, + 163: __ccgo_ts + 3253, + 164: __ccgo_ts + 3262, + 165: __ccgo_ts + 3271, + 166: __ccgo_ts + 3280, + 167: __ccgo_ts + 3287, + 168: __ccgo_ts + 3298, + 169: __ccgo_ts + 3311, + 170: __ccgo_ts + 3321, + 171: __ccgo_ts + 3328, + 172: __ccgo_ts + 3336, + 173: __ccgo_ts + 3345, + 174: __ccgo_ts + 3351, + 175: __ccgo_ts + 3358, + 176: __ccgo_ts + 3366, + 177: __ccgo_ts + 3374, + 178: __ccgo_ts + 3382, + 179: __ccgo_ts + 3392, + 180: __ccgo_ts + 3401, + 181: __ccgo_ts + 3412, + 182: __ccgo_ts + 3423, + 183: __ccgo_ts + 3434, + 184: __ccgo_ts + 3444, + 185: __ccgo_ts + 3450, + 186: __ccgo_ts + 3461, + 187: __ccgo_ts + 3472, + 188: __ccgo_ts + 3477, + 189: __ccgo_ts + 3485, } /************** End of opcodes.c *********************************************/ @@ -100222,10 +94650,10 @@ var _azName = [190]uintptr{ // /* Forward references to structures used for WAL */ type TwinShm = struct { FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 FsharedMask Tu16 FexclMask Tu16 + FhShm THANDLE + FbReadonly int32 } type winShm = TwinShm @@ -100234,15 +94662,14 @@ type winShm = TwinShm type TwinShmNode = struct { Fmutex uintptr FzFilename uintptr - FhFile TwinFile + FhSharedShm THANDLE + FisUnlocked int32 + FisReadonly int32 FszRegion int32 FnRegion int32 - FisReadonly Tu8 - FisUnlocked Tu8 FaRegion uintptr FlastErrno TDWORD FnRef int32 - FpFirst uintptr FpNext uintptr } @@ -100281,26 +94708,6 @@ type TwinFile = struct { type winFile = TwinFile -type TwinFile1 = struct { - FpMethod uintptr - FpVfs uintptr - Fh THANDLE - Flocktype Tu8 - FsharedLockByte int16 - FctrlFlags Tu8 - FlastErrno TDWORD - FpShm uintptr - FzPath uintptr - FszChunk int32 - FnFetchOut int32 - FhMap THANDLE - FpMapRegion uintptr - FmmapSize Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 -} - -type winFile1 = TwinFile1 - // C documentation // // /* @@ -100315,14 +94722,6 @@ type TwinVfsAppData = struct { type winVfsAppData = TwinVfsAppData -type TwinVfsAppData1 = struct { - FpMethod uintptr - FpAppData uintptr - FbNoLock TBOOL -} - -type winVfsAppData1 = TwinVfsAppData1 - /* ** Allowed values for winFile.ctrlFlags */ @@ -100384,246 +94783,273 @@ type win_syscall = Twin_syscall // ** testing and sandboxing. The following array holds the names and pointers // ** to all overrideable system calls. // */ -var _aSyscall = [80]Twin_syscall{ +var _aSyscall = [89]Twin_syscall{ 0: { - FzName: __ccgo_ts + 3468, + FzName: __ccgo_ts + 3495, }, 1: { - FzName: __ccgo_ts + 3484, + FzName: __ccgo_ts + 3511, }, 2: { - FzName: __ccgo_ts + 3495, + FzName: __ccgo_ts + 3522, }, 3: { - FzName: __ccgo_ts + 3506, + FzName: __ccgo_ts + 3533, }, 4: { - FzName: __ccgo_ts + 3518, + FzName: __ccgo_ts + 3545, }, 5: { - FzName: __ccgo_ts + 3530, + FzName: __ccgo_ts + 3557, }, 6: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3569, }, 7: { - FzName: __ccgo_ts + 3561, + FzName: __ccgo_ts + 3588, }, 8: { - FzName: __ccgo_ts + 3580, + FzName: __ccgo_ts + 3607, }, 9: { - FzName: __ccgo_ts + 3593, + FzName: __ccgo_ts + 3620, }, 10: { - FzName: __ccgo_ts + 3605, + FzName: __ccgo_ts + 3632, }, 11: { - FzName: __ccgo_ts + 3617, + FzName: __ccgo_ts + 3644, }, 12: { - FzName: __ccgo_ts + 3641, + FzName: __ccgo_ts + 3668, }, 13: { - FzName: __ccgo_ts + 3662, + FzName: __ccgo_ts + 3689, }, 14: { - FzName: __ccgo_ts + 3679, + FzName: __ccgo_ts + 3706, }, 15: { - FzName: __ccgo_ts + 3694, + FzName: __ccgo_ts + 3721, }, 16: { - FzName: __ccgo_ts + 3709, + FzName: __ccgo_ts + 3736, }, 17: { - FzName: __ccgo_ts + 3721, + FzName: __ccgo_ts + 3748, }, 18: { - FzName: __ccgo_ts + 3741, + FzName: __ccgo_ts + 3768, }, 19: { - FzName: __ccgo_ts + 3759, + FzName: __ccgo_ts + 3786, }, 20: { - FzName: __ccgo_ts + 3777, + FzName: __ccgo_ts + 3804, }, 21: { - FzName: __ccgo_ts + 3796, + FzName: __ccgo_ts + 3823, }, 22: { - FzName: __ccgo_ts + 3815, + FzName: __ccgo_ts + 3842, }, 23: { - FzName: __ccgo_ts + 3836, + FzName: __ccgo_ts + 3863, }, 24: { - FzName: __ccgo_ts + 3848, + FzName: __ccgo_ts + 3875, }, 25: { - FzName: __ccgo_ts + 3865, + FzName: __ccgo_ts + 3892, }, 26: { - FzName: __ccgo_ts + 3882, + FzName: __ccgo_ts + 3909, }, 27: { - FzName: __ccgo_ts + 3895, + FzName: __ccgo_ts + 3922, }, 28: { - FzName: __ccgo_ts + 3911, + FzName: __ccgo_ts + 3938, }, 29: { - FzName: __ccgo_ts + 3925, + FzName: __ccgo_ts + 3952, }, 30: { - FzName: __ccgo_ts + 3939, + FzName: __ccgo_ts + 3966, }, 31: { - FzName: __ccgo_ts + 3963, + FzName: __ccgo_ts + 3990, }, 32: { - FzName: __ccgo_ts + 3976, + FzName: __ccgo_ts + 4003, }, 33: { - FzName: __ccgo_ts + 3989, + FzName: __ccgo_ts + 4016, }, 34: { - FzName: __ccgo_ts + 4002, + FzName: __ccgo_ts + 4029, }, 35: { - FzName: __ccgo_ts + 4016, + FzName: __ccgo_ts + 4043, }, 36: { - FzName: __ccgo_ts + 4030, + FzName: __ccgo_ts + 4057, }, 37: { - FzName: __ccgo_ts + 4040, + FzName: __ccgo_ts + 4067, }, 38: { - FzName: __ccgo_ts + 4051, + FzName: __ccgo_ts + 4078, }, 39: { - FzName: __ccgo_ts + 4063, + FzName: __ccgo_ts + 4090, }, 40: { - FzName: __ccgo_ts + 4072, + FzName: __ccgo_ts + 4099, }, 41: { - FzName: __ccgo_ts + 4084, + FzName: __ccgo_ts + 4111, }, 42: { - FzName: __ccgo_ts + 4093, + FzName: __ccgo_ts + 4120, }, 43: { - FzName: __ccgo_ts + 4106, + FzName: __ccgo_ts + 4133, }, 44: { - FzName: __ccgo_ts + 4118, + FzName: __ccgo_ts + 4145, }, 45: { - FzName: __ccgo_ts + 4131, + FzName: __ccgo_ts + 4158, }, 46: { - FzName: __ccgo_ts + 4144, + FzName: __ccgo_ts + 4171, }, 47: { - FzName: __ccgo_ts + 4154, + FzName: __ccgo_ts + 4181, }, 48: { - FzName: __ccgo_ts + 4163, + FzName: __ccgo_ts + 4190, }, 49: { - FzName: __ccgo_ts + 4174, + FzName: __ccgo_ts + 4201, }, 50: { - FzName: __ccgo_ts + 4188, + FzName: __ccgo_ts + 4215, }, 51: { - FzName: __ccgo_ts + 4208, + FzName: __ccgo_ts + 4235, }, 52: { - FzName: __ccgo_ts + 4232, + FzName: __ccgo_ts + 4259, }, 53: { - FzName: __ccgo_ts + 4241, + FzName: __ccgo_ts + 4268, }, 54: { - FzName: __ccgo_ts + 4254, + FzName: __ccgo_ts + 4281, }, 55: { - FzName: __ccgo_ts + 4269, + FzName: __ccgo_ts + 4296, }, 56: { - FzName: __ccgo_ts + 4275, + FzName: __ccgo_ts + 4302, }, 57: { - FzName: __ccgo_ts + 4296, + FzName: __ccgo_ts + 4323, }, 58: { - FzName: __ccgo_ts + 4307, + FzName: __ccgo_ts + 4334, }, 59: { - FzName: __ccgo_ts + 4320, + FzName: __ccgo_ts + 4347, }, 60: { - FzName: __ccgo_ts + 4336, + FzName: __ccgo_ts + 4363, }, 61: { - FzName: __ccgo_ts + 4356, + FzName: __ccgo_ts + 4383, }, 62: { - FzName: __ccgo_ts + 4366, + FzName: __ccgo_ts + 4393, }, 63: { - FzName: __ccgo_ts + 4381, + FzName: __ccgo_ts + 4408, }, 64: { - FzName: __ccgo_ts + 4401, + FzName: __ccgo_ts + 4428, }, 65: { - FzName: __ccgo_ts + 4423, + FzName: __ccgo_ts + 4450, }, 66: { - FzName: __ccgo_ts + 4440, + FzName: __ccgo_ts + 4467, }, 67: { - FzName: __ccgo_ts + 4469, + FzName: __ccgo_ts + 4496, }, 68: { - FzName: __ccgo_ts + 4490, + FzName: __ccgo_ts + 4517, }, 69: { - FzName: __ccgo_ts + 4502, + FzName: __ccgo_ts + 4529, }, 70: { - FzName: __ccgo_ts + 4522, + FzName: __ccgo_ts + 4549, }, 71: { - FzName: __ccgo_ts + 4537, + FzName: __ccgo_ts + 4564, }, 72: { - FzName: __ccgo_ts + 4557, + FzName: __ccgo_ts + 4584, }, 73: { - FzName: __ccgo_ts + 4576, + FzName: __ccgo_ts + 4603, }, 74: { - FzName: __ccgo_ts + 4595, + FzName: __ccgo_ts + 4622, }, 75: { - FzName: __ccgo_ts + 4610, + FzName: __ccgo_ts + 4637, }, 76: { - FzName: __ccgo_ts + 4635, + FzName: __ccgo_ts + 4662, }, 77: { - FzName: __ccgo_ts + 4662, + FzName: __ccgo_ts + 4689, }, 78: { - FzName: __ccgo_ts + 4673, + FzName: __ccgo_ts + 4700, }, 79: { - FzName: __ccgo_ts + 4694, + FzName: __ccgo_ts + 4721, + }, + 80: { + FzName: __ccgo_ts + 4737, + }, + 81: { + FzName: __ccgo_ts + 4749, + }, + 82: { + FzName: __ccgo_ts + 4758, + }, + 83: { + FzName: __ccgo_ts + 4775, + }, + 84: { + FzName: __ccgo_ts + 4782, + }, + 85: { + FzName: __ccgo_ts + 4789, + }, + 86: { + FzName: __ccgo_ts + 4798, + }, + 87: { + FzName: __ccgo_ts + 4804, + }, + 88: { + FzName: __ccgo_ts + 4812, }, } @@ -100690,6 +95116,7 @@ func init() { *(*uintptr)(unsafe.Add(p, 1760)) = __ccgo_fp(libc.XOutputDebugStringW) *(*uintptr)(unsafe.Add(p, 1784)) = __ccgo_fp(libc.XGetProcessHeap) *(*uintptr)(unsafe.Add(p, 1904)) = __ccgo_fp(libc.XFlushViewOfFile) + *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(libc.XGetModuleHandleW) } /* End of the overrideable system calls */ @@ -100702,7 +95129,7 @@ func init() { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -100715,7 +95142,7 @@ func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc rc = SQLITE_OK i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(1920)/libc.Uint64FromInt64(24)) { + if !(uint64(i) < libc.Uint64FromInt64(2136)/libc.Uint64FromInt64(24)) { break } if _aSyscall[i].FpDefault != 0 { @@ -100732,7 +95159,7 @@ func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc */ i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(1920)/libc.Uint64FromInt64(24)) { + if !(uint64(i) < libc.Uint64FromInt64(2136)/libc.Uint64FromInt64(24)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -100740,10 +95167,10 @@ func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -100768,7 +95195,7 @@ func _winGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) (r Tsqlit _ = pNotUsed i = uint32(0) for { - if !(uint64(i) < libc.Uint64FromInt64(1920)/libc.Uint64FromInt64(24)) { + if !(uint64(i) < libc.Uint64FromInt64(2136)/libc.Uint64FromInt64(24)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -100798,7 +95225,7 @@ func _winNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) (r uintptr) { if zName != 0 { i = 0 for { - if !(i < int32(libc.Uint64FromInt64(1920)/libc.Uint64FromInt64(24))-libc.Int32FromInt32(1)) { + if !(i < int32(libc.Uint64FromInt64(2136)/libc.Uint64FromInt64(24))-libc.Int32FromInt32(1)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -100812,7 +95239,7 @@ func _winNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) (r uintptr) { } i++ for { - if !(i < int32(libc.Uint64FromInt64(1920)/libc.Uint64FromInt64(24))) { + if !(i < int32(libc.Uint64FromInt64(2136)/libc.Uint64FromInt64(24))) { break } if _aSyscall[i].FpCurrent != uintptr(0) { @@ -100964,25 +95391,25 @@ func _winUnicodeToUtf8(tls *libc.TLS, zWideText TLPCWSTR) (r uintptr) { // ** Space to hold the returned string is obtained from sqlite3_malloc(). // */ func _winMbcsToUnicode(tls *libc.TLS, zText uintptr, useAnsi int32) (r TLPWSTR) { - var codepage, nByte, v1 int32 + var codepage, nWideChar, v1 int32 var zMbcsText TLPWSTR - _, _, _, _ = codepage, nByte, zMbcsText, v1 + _, _, _, _ = codepage, nWideChar, zMbcsText, v1 if useAnsi != 0 { v1 = CP_ACP } else { v1 = int32(CP_OEMCP) } codepage = v1 - nByte = int32(uint64((*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), libc.UintptrFromInt32(0), 0)) * uint64(2)) - if nByte == 0 { + nWideChar = (*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), libc.UintptrFromInt32(0), 0) + if nWideChar == 0 { return uintptr(0) } - zMbcsText = _sqlite3MallocZero(tls, uint64(nByte)*uint64(2)) + zMbcsText = _sqlite3MallocZero(tls, uint64(nWideChar)*uint64(2)) if zMbcsText == uintptr(0) { return uintptr(0) } - nByte = (*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), zMbcsText, nByte) - if nByte == 0 { + nWideChar = (*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), zMbcsText, nWideChar) + if nWideChar == 0 { Xsqlite3_free(tls, zMbcsText) zMbcsText = uintptr(0) } @@ -101163,7 +95590,7 @@ func Xsqlite3_win32_set_directory8(tls *libc.TLS, type1 uint32, zValue uintptr) if ppDirectory != 0 { zCopy = uintptr(0) if zValue != 0 && *(*int8)(unsafe.Pointer(zValue)) != 0 { - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, zValue)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, zValue)) if zCopy == uintptr(0) { rc = int32(SQLITE_NOMEM) goto set_directory8_done @@ -101264,10 +95691,10 @@ func _winGetLastErrorMsg(tls *libc.TLS, lastErrno TDWORD, nBuf int32, zBuf uintp } } if uint32(0) == dwLen { - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4713, libc.VaList(bp+24, lastErrno, lastErrno)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4832, libc.VaList(bp+24, lastErrno, lastErrno)) } else { /* copy a maximum of nBuf chars to output buffer */ - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4710, libc.VaList(bp+24, zOut)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4829, libc.VaList(bp+24, zOut)) /* free the UTF8 buffer */ Xsqlite3_free(tls, zOut) } @@ -101300,7 +95727,7 @@ func _winLogErrorAtLine(tls *libc.TLS, errcode int32, lastErrno TDWORD, zFunc ui (*(*[500]int8)(unsafe.Pointer(bp)))[0] = 0 _winGetLastErrorMsg(tls, lastErrno, int32(500), bp) if zPath == uintptr(0) { - zPath = __ccgo_ts + 1673 + zPath = __ccgo_ts + 1674 } i = 0 for { @@ -101313,7 +95740,7 @@ func _winLogErrorAtLine(tls *libc.TLS, errcode int32, lastErrno TDWORD, zFunc ui i++ } (*(*[500]int8)(unsafe.Pointer(bp)))[i] = 0 - Xsqlite3_log(tls, errcode, __ccgo_ts+4733, libc.VaList(bp+512, iLine, lastErrno, zFunc, zPath, bp)) + Xsqlite3_log(tls, errcode, __ccgo_ts+4852, libc.VaList(bp+512, iLine, lastErrno, zFunc, zPath, bp)) return errcode } @@ -101382,7 +95809,7 @@ func _winLogIoerr(tls *libc.TLS, nRetry int32, lineno int32) { bp := tls.Alloc(32) defer tls.Free(32) if nRetry != 0 { - Xsqlite3_log(tls, int32(SQLITE_NOTICE), __ccgo_ts+4764, libc.VaList(bp+8, _winIoerrRetryDelay*nRetry*(nRetry+int32(1))/int32(2), lineno)) + Xsqlite3_log(tls, int32(SQLITE_NOTICE), __ccgo_ts+4883, libc.VaList(bp+8, _winIoerrRetryDelay*nRetry*(nRetry+int32(1))/int32(2), lineno)) } } @@ -101411,6 +95838,47 @@ func _winLockFile(tls *libc.TLS, phFile TLPHANDLE, flags TDWORD, offsetLow TDWOR return r } +// C documentation +// +// /* +// ** Lock a region of nByte bytes starting at offset offset of file hFile. +// ** Take an EXCLUSIVE lock if parameter bExclusive is true, or a SHARED lock +// ** otherwise. If nMs is greater than zero and the lock cannot be obtained +// ** immediately, block for that many ms before giving up. +// ** +// ** This function returns SQLITE_OK if the lock is obtained successfully. If +// ** some other process holds the lock, SQLITE_BUSY is returned if nMs==0, or +// ** SQLITE_BUSY_TIMEOUT otherwise. Or, if an error occurs, SQLITE_IOERR. +// */ +func _winHandleLockTimeout(tls *libc.TLS, _hFile THANDLE, offset TDWORD, nByte TDWORD, bExcl int32, nMs TDWORD) (r int32) { + bp := tls.Alloc(48) + defer tls.Free(48) + *(*THANDLE)(unsafe.Pointer(bp)) = _hFile + var flags TDWORD + var rc, v1 int32 + var ret TBOOL + var _ /* ovlp at bp+8 */ TOVERLAPPED + _, _, _, _ = flags, rc, ret, v1 + if bExcl != 0 { + v1 = int32(LOCKFILE_EXCLUSIVE_LOCK) + } else { + v1 = 0 + } + flags = uint32(int32(LOCKFILE_FAIL_IMMEDIATELY) | v1) + rc = SQLITE_OK + if !(libc.Int32FromInt32(1) != 0) { + ret = _winLockFile(tls, bp, flags, offset, uint32(0), nByte, uint32(0)) + } else { + libc.Xmemset(tls, bp+8, 0, uint64(32)) + (*(*TOVERLAPPED)(unsafe.Pointer(bp + 8))).F__ccgo2_16.F__ccgo0_0.FOffset = offset + ret = (*(*func(*libc.TLS, THANDLE, TDWORD, TDWORD, TDWORD, TDWORD, TLPOVERLAPPED) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(48)].FpCurrent})))(tls, *(*THANDLE)(unsafe.Pointer(bp)), flags, uint32(0), nByte, uint32(0), bp+8) + } + if rc == SQLITE_OK && !(ret != 0) { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* @@ -101431,6 +95899,27 @@ func _winUnlockFile(tls *libc.TLS, phFile TLPHANDLE, offsetLow TDWORD, offsetHig return r } +// C documentation +// +// /* +// ** Remove an nByte lock starting at offset iOff from HANDLE h. +// */ +func _winHandleUnlock(tls *libc.TLS, _h THANDLE, iOff int32, nByte int32) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + *(*THANDLE)(unsafe.Pointer(bp)) = _h + var ret TBOOL + var v1 int32 + _, _ = ret, v1 + ret = _winUnlockFile(tls, bp, uint32(iOff), uint32(0), uint32(nByte), uint32(0)) + if ret != 0 { + v1 = SQLITE_OK + } else { + v1 = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(8)<lastErrno and return non-zero. +// ** Seek the file handle h to offset nByte of the file. +// ** +// ** If successful, return SQLITE_OK. Or, if an error occurs, return an SQLite +// ** error code. // */ -func _winSeekFile(tls *libc.TLS, pFile uintptr, iOffset Tsqlite3_int64) (r int32) { +func _winHandleSeek(tls *libc.TLS, h THANDLE, iOffset Tsqlite3_int64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var dwRet, lastErrno, v1 TDWORD + var dwRet, lastErrno TDWORD var lowerBits TLONG - var v2 bool + var rc int32 var _ /* upperBits at bp+0 */ TLONG - _, _, _, _, _ = dwRet, lastErrno, lowerBits, v1, v2 /* Value returned by GetLastError() */ + _, _, _, _ = dwRet, lastErrno, lowerBits, rc + rc = SQLITE_OK /* Value returned by SetFilePointer() */ *(*TLONG)(unsafe.Pointer(bp)) = int32(iOffset >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7fffffff)) lowerBits = int32(iOffset & libc.Int64FromUint32(0xffffffff)) + dwRet = (*(*func(*libc.TLS, THANDLE, TLONG, TPLONG, TDWORD) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(54)].FpCurrent})))(tls, h, lowerBits, bp, uint32(FILE_BEGIN)) /* API oddity: If successful, SetFilePointer() returns a dword ** containing the lower 32-bits of the new file-offset. Or, if it fails, ** it returns INVALID_SET_FILE_POINTER. However according to MSDN, ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine ** whether an error has actually occurred, it is also necessary to call - ** GetLastError(). - */ - dwRet = (*(*func(*libc.TLS, THANDLE, TLONG, TPLONG, TDWORD) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(54)].FpCurrent})))(tls, (*TwinFile)(unsafe.Pointer(pFile)).Fh, lowerBits, bp, uint32(FILE_BEGIN)) - if v2 = dwRet == uint32(-libc.Int32FromInt32(1)); v2 { - v1 = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - lastErrno = v1 + ** GetLastError(). */ + if dwRet == uint32(-libc.Int32FromInt32(1)) { + lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) + if lastErrno != uint32(0) { + rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(22)<lastErrno and return non-zero. +// */ +func _winSeekFile(tls *libc.TLS, pFile uintptr, iOffset Tsqlite3_int64) (r int32) { + var rc int32 + _ = rc + rc = _winHandleSeek(tls, (*TwinFile)(unsafe.Pointer(pFile)).Fh, iOffset) + if rc != SQLITE_OK { + (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) + _winLogErrorAtLine(tls, rc, (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno, __ccgo_ts+4933, (*TwinFile)(unsafe.Pointer(pFile)).FzPath, int32(49992)) } - return 0 + return rc } // C documentation @@ -101520,7 +96025,7 @@ func _winClose(tls *libc.TLS, id uintptr) (r int32) { if rc != 0 { v5 = SQLITE_OK } else { - v5 = _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< 0 { @@ -101732,7 +96290,7 @@ func _winSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { if (*(*func(*libc.TLS, TLPCVOID, TSIZE_T) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(79)].FpCurrent})))(tls, (*TwinFile)(unsafe.Pointer(pFile)).FpMapRegion, uint64(0)) != 0 { } else { (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - return _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(24)<locktype to this value before exiting */ gotPendingLock = 0 /* True if we acquired a PENDING lock this time */ @@ -101897,48 +96461,48 @@ func _winLock(tls *libc.TLS, id uintptr, locktype int32) (r int32) { } /* Make sure the locking sequence is correct */ - /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or + /* Lock the PENDING_LOCK byte if we need to acquire an EXCLUSIVE lock or ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of ** the PENDING_LOCK byte is temporary. */ newLocktype = int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) - if int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) == NO_LOCK || locktype == int32(EXCLUSIVE_LOCK) && int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) <= int32(RESERVED_LOCK) { + if locktype == int32(SHARED_LOCK) || locktype == int32(EXCLUSIVE_LOCK) && int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) == int32(RESERVED_LOCK) { cnt = int32(3) - for { - v1 = cnt - cnt-- - if v3 = v1 > 0; v3 { - v2 = _winLockFile(tls, pFile+16, uint32(libc.Int32FromInt32(LOCKFILE_FAIL_IMMEDIATELY)|libc.Int32FromInt32(LOCKFILE_EXCLUSIVE_LOCK)), uint32(_sqlite3PendingByte), uint32(0), uint32(1), uint32(0)) - res = v2 - } - if !(v3 && v2 == 0) { - break - } + /* Flags for the LockFileEx() call. This should be an exclusive lock if + ** this call is to obtain EXCLUSIVE, or a shared lock if this call is to + ** obtain SHARED. */ + flags = int32(LOCKFILE_FAIL_IMMEDIATELY) + if locktype == int32(EXCLUSIVE_LOCK) { + flags |= int32(LOCKFILE_EXCLUSIVE_LOCK) + } + for cnt > 0 { /* Try 3 times to get the pending lock. This is needed to work ** around problems caused by indexing and/or anti-virus software on ** Windows systems. + ** ** If you are using this code as a model for alternative VFSes, do not - ** copy this retry logic. It is a hack intended for Windows only. - */ + ** copy this retry logic. It is a hack intended for Windows only. */ + res = _winLockFile(tls, pFile+16, uint32(flags), uint32(_sqlite3PendingByte), uint32(0), uint32(1), uint32(0)) + if res != 0 { + break + } lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) if lastErrno == uint32(6) { (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(15)< 0 { Xsqlite3_win32_sleep(tls, uint32(1)) } } gotPendingLock = res - if !(res != 0) { - lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - } } /* Acquire a shared lock */ if locktype == int32(SHARED_LOCK) && res != 0 { - res = _winGetReadLock(tls, pFile) + res = _winGetReadLock(tls, pFile, 0) if res != 0 { newLocktype = int32(SHARED_LOCK) } else { @@ -101970,7 +96534,7 @@ func _winLock(tls *libc.TLS, id uintptr, locktype int32) (r int32) { newLocktype = int32(EXCLUSIVE_LOCK) } else { lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - _winGetReadLock(tls, pFile) + _winGetReadLock(tls, pFile, 0) } } /* If we are holding a PENDING lock that ought to be released, then @@ -102039,10 +96603,10 @@ func _winUnlock(tls *libc.TLS, id uintptr, locktype int32) (r int32) { type1 = int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) if type1 >= int32(EXCLUSIVE_LOCK) { _winUnlockFile(tls, pFile+16, uint32(_sqlite3PendingByte+libc.Int32FromInt32(2)), uint32(0), uint32(SHARED_SIZE), uint32(0)) - if locktype == int32(SHARED_LOCK) && !(_winGetReadLock(tls, pFile) != 0) { + if locktype == int32(SHARED_LOCK) && !(_winGetReadLock(tls, pFile, 0) != 0) { /* This should never happen. We should always be able to ** reacquire the read lock */ - rc = _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(8)<= int32(RESERVED_LOCK) { @@ -102166,7 +96730,7 @@ func _winFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int32 _winModeBit(tls, pFile, uint8(WINFILE_PSOW), pArg) return SQLITE_OK case int32(SQLITE_FCNTL_VFSNAME): - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+24, (*Tsqlite3_vfs)(unsafe.Pointer((*TwinFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+24, (*Tsqlite3_vfs)(unsafe.Pointer((*TwinFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) return SQLITE_OK case int32(SQLITE_FCNTL_WIN32_AV_RETRY): a = pArg @@ -102291,46 +96855,6 @@ func _winShmLeaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _winBigLock) } -/* -** Object used to represent a single file opened and mmapped to provide -** shared memory. When multiple threads all reference the same -** log-summary, each thread has its own winFile object, but they all -** point to a single instance of this object. In other words, each -** log-summary is opened only once per process. -** -** winShmMutexHeld() must be true when creating or destroying -** this object or while reading or writing the following fields: -** -** nRef -** pNext -** -** The following fields are read-only after the object is created: -** -** fid -** zFilename -** -** Either winShmNode.mutex must be held or winShmNode.nRef==0 and -** winShmMutexHeld() is true when reading or writing any other field -** in this structure. -** - */ -type TwinShmNode1 = struct { - Fmutex uintptr - FzFilename uintptr - FhFile TwinFile - FszRegion int32 - FnRegion int32 - FisReadonly Tu8 - FisUnlocked Tu8 - FaRegion uintptr - FlastErrno TDWORD - FnRef int32 - FpFirst uintptr - FpNext uintptr -} - -type winShmNode1 = TwinShmNode1 - // C documentation // // /* @@ -102340,64 +96864,6 @@ type winShmNode1 = TwinShmNode1 // */ var _winShmNodeList = uintptr(0) -/* -** Structure used internally by this VFS to record the state of an -** open shared memory connection. -** -** The following fields are initialized when this object is created and -** are read-only thereafter: -** -** winShm.pShmNode -** winShm.id -** -** All other fields are read/write. The winShm.pShmNode->mutex must be held -** while accessing any read/write fields. - */ -type TwinShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type winShm1 = TwinShm1 - -/* -** Constants used for locking - */ - -// C documentation -// -// /* -// ** Apply advisory locks for all n bytes beginning at ofst. -// */ -func _winShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, nByte int32) (r int32) { - var dwFlags TDWORD - var rc int32 - _, _ = dwFlags, rc - rc = 0 /* Result code form Lock/UnlockFileEx() */ - /* Access to the winShmNode object is serialized by the caller */ - /* Release/Acquire the system-level lock */ - if lockType == int32(WINSHM_UNLCK) { - rc = _winUnlockFile(tls, pFile+16+16, uint32(ofst), uint32(0), uint32(nByte), uint32(0)) - } else { - /* Initialize the locking parameters */ - dwFlags = uint32(LOCKFILE_FAIL_IMMEDIATELY) - if lockType == int32(WINSHM_WRLCK) { - dwFlags |= uint32(LOCKFILE_EXCLUSIVE_LOCK) - } - rc = _winLockFile(tls, pFile+16+16, dwFlags, uint32(ofst), uint32(0), uint32(nByte), uint32(0)) - } - if rc != 0 { - rc = SQLITE_OK - } else { - (*TwinShmNode)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - rc = int32(SQLITE_BUSY) - } - return rc -} - // C documentation // // /* @@ -102436,9 +96902,7 @@ func _winShmPurge(tls *libc.TLS, pVfs uintptr, deleteFlag int32) { ; i++ } - if (*TwinShmNode)(unsafe.Pointer(p)).FhFile.Fh != libc.UintptrFromInt32(0) && (*TwinShmNode)(unsafe.Pointer(p)).FhFile.Fh != uintptr(int64(-libc.Int32FromInt32(1))) { - _winClose(tls, p+16) - } + _winHandleClose(tls, (*TwinShmNode)(unsafe.Pointer(p)).FhSharedShm) if deleteFlag != 0 { _sqlite3BeginBenignMalloc(tls) _winDelete(tls, pVfs, (*TwinShmNode)(unsafe.Pointer(p)).FzFilename, 0) @@ -102448,7 +96912,7 @@ func _winShmPurge(tls *libc.TLS, pVfs uintptr, deleteFlag int32) { Xsqlite3_free(tls, (*TwinShmNode)(unsafe.Pointer(p)).FaRegion) Xsqlite3_free(tls, p) } else { - pp = p + 152 + pp = p + 56 } } } @@ -102456,73 +96920,187 @@ func _winShmPurge(tls *libc.TLS, pVfs uintptr, deleteFlag int32) { // C documentation // // /* -// ** The DMS lock has not yet been taken on shm file pShmNode. Attempt to -// ** take it now. Return SQLITE_OK if successful, or an SQLite error -// ** code otherwise. -// ** -// ** If the DMS cannot be locked because this is a readonly_shm=1 -// ** connection and no other process already holds a lock, return -// ** SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1. +// ** The DMS lock has not yet been taken on the shm file associated with +// ** pShmNode. Take the lock. Truncate the *-shm file if required. +// ** Return SQLITE_OK if successful, or an SQLite error code otherwise. // */ -func _winLockSharedMemory(tls *libc.TLS, pShmNode uintptr) (r int32) { +func _winLockSharedMemory(tls *libc.TLS, pShmNode uintptr, nMs TDWORD) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) var rc int32 + var _ /* h at bp+0 */ THANDLE _ = rc - rc = _winShmSystemLock(tls, pShmNode, int32(WINSHM_WRLCK), (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) + *(*THANDLE)(unsafe.Pointer(bp)) = (*TwinShmNode)(unsafe.Pointer(pShmNode)).FhSharedShm + rc = SQLITE_OK + rc = _winHandleLockTimeout(tls, *(*THANDLE)(unsafe.Pointer(bp)), uint32((libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK)), uint32(1), int32(1), uint32(0)) if rc == SQLITE_OK { + /* We have an EXCLUSIVE lock on the DMS byte. This means that this + ** is the first process to open the file. Truncate it to zero bytes + ** in this case. */ if (*TwinShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 { - (*TwinShmNode)(unsafe.Pointer(pShmNode)).FisUnlocked = uint8(1) - _winShmSystemLock(tls, pShmNode, int32(WINSHM_UNLCK), (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) - return libc.Int32FromInt32(SQLITE_READONLY) | libc.Int32FromInt32(5)<:/" or ":\", +// ** it is converted to UTF-16 as-is. +// ** - If the filename contains '/', it is assumed to be a +// ** Cygwin absolute path, it is converted to a win32 +// ** absolute path in UTF-16. +// ** - Otherwise it must be a filename only, the win32 filename +// ** is returned in UTF-16. +// ** Note: If the function cygwin_conv_path() fails, only +// ** UTF-8 -> UTF-16 conversion will be done. This can only +// ** happen when the file path >32k, in which case winUtf8ToUnicode() +// ** will fail too. +// */ +func _winConvertFromUtf8Filename(tls *libc.TLS, zFilename uintptr) (r uintptr) { + var zConverted uintptr + _ = zConverted + zConverted = uintptr(0) + if int32(1) != 0 { + zConverted = _winUtf8ToUnicode(tls, zFilename) + } else { + zConverted = _winUtf8ToMbcs(tls, zFilename, (*(*func(*libc.TLS) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls)) + } + /* caller will handle out of memory */ + return zConverted +} + +// C documentation +// +// /* +// ** This function is used to open a handle on a *-shm file. // ** -// ** When opening a new shared-memory file, if no other instances of that -// ** file are currently open, in this process or in other processes, then -// ** the file must be truncated to zero length or have its header cleared. +// ** If SQLITE_ENABLE_SETLK_TIMEOUT is defined at build time, then the file +// ** is opened with FILE_FLAG_OVERLAPPED specified. If not, it is not. +// */ +func _winHandleOpen(tls *libc.TLS, zUtf8 uintptr, pbReadonly uintptr, ph uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var flag_overlapped TDWORD + var rc, v1, v2 int32 + var zConverted uintptr + var _ /* bReadonly at bp+0 */ int32 + var _ /* h at bp+8 */ THANDLE + _, _, _, _, _ = flag_overlapped, rc, zConverted, v1, v2 + rc = SQLITE_OK + zConverted = uintptr(0) + *(*int32)(unsafe.Pointer(bp)) = *(*int32)(unsafe.Pointer(pbReadonly)) + *(*THANDLE)(unsafe.Pointer(bp + 8)) = uintptr(int64(-libc.Int32FromInt32(1))) + flag_overlapped = uint32(0) + /* Convert the filename to the system encoding. */ + zConverted = _winConvertFromUtf8Filename(tls, zUtf8) + if zConverted == uintptr(0) { + rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)<pFirst. This must be done while holding the pShmNode->mutex - ** mutex. - */ - Xsqlite3_mutex_enter(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - (*TwinShm1)(unsafe.Pointer(p)).FpNext = (*TwinShmNode)(unsafe.Pointer(pShmNode)).FpFirst - (*TwinShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - return rc - /* Jump here on any error */ - goto shm_open_err -shm_open_err: - ; - _winShmSystemLock(tls, pShmNode, int32(WINSHM_UNLCK), (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) - _winShmPurge(tls, (*TwinFile)(unsafe.Pointer(pDbFd)).FpVfs, 0) /* This call frees pShmNode if required */ - Xsqlite3_free(tls, p) Xsqlite3_free(tls, pNew) - _winShmLeaveMutex(tls) return rc } @@ -102611,40 +97170,28 @@ shm_open_err: // ** storage if deleteFlag is true. // */ func _winShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) (r int32) { - var p, pDbFd, pShmNode, pp uintptr - _, _, _, _ = p, pDbFd, pShmNode, pp /* For looping over sibling connections */ + var p, pDbFd, pShmNode uintptr + _, _, _ = p, pDbFd, pShmNode /* The underlying shared-memory file */ pDbFd = fd p = (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm if p == uintptr(0) { return SQLITE_OK } - pShmNode = (*TwinShm)(unsafe.Pointer(p)).FpShmNode - /* Remove connection p from the set of connections associated - ** with pShmNode */ - Xsqlite3_mutex_enter(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - pp = pShmNode + 144 - for { - if !(*(*uintptr)(unsafe.Pointer(pp)) != p) { - break - } - goto _1 - _1: - ; - pp = *(*uintptr)(unsafe.Pointer(pp)) + 8 + if (*TwinShm)(unsafe.Pointer(p)).FhShm != uintptr(int64(-libc.Int32FromInt32(1))) { + (*(*func(*libc.TLS, THANDLE) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, (*TwinShm)(unsafe.Pointer(p)).FhShm) } - *(*uintptr)(unsafe.Pointer(pp)) = (*TwinShm)(unsafe.Pointer(p)).FpNext - /* Free the connection p */ - Xsqlite3_free(tls, p) - (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm = uintptr(0) - Xsqlite3_mutex_leave(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - /* If pShmNode->nRef has reached 0, then close the underlying - ** shared-memory file, too */ + pShmNode = (*TwinShm)(unsafe.Pointer(p)).FpShmNode _winShmEnterMutex(tls) + /* If pShmNode->nRef has reached 0, then close the underlying + ** shared-memory file, too. */ (*TwinShmNode)(unsafe.Pointer(pShmNode)).FnRef-- if (*TwinShmNode)(unsafe.Pointer(pShmNode)).FnRef == 0 { _winShmPurge(tls, (*TwinFile)(unsafe.Pointer(pDbFd)).FpVfs, deleteFlag) } _winShmLeaveMutex(tls) + /* Free the connection p */ + Xsqlite3_free(tls, p) + (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm = uintptr(0) return SQLITE_OK } @@ -102654,13 +97201,15 @@ func _winShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) (r int32) { // ** Change the lock state for a shared-memory segment. // */ func _winShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) (r int32) { - var allMask, allShared, mask Tu16 - var p, pDbFd, pShmNode, pX, p2, p3, p5, p7 uintptr - var rc int32 - _, _, _, _, _, _, _, _, _, _, _, _ = allMask, allShared, mask, p, pDbFd, pShmNode, pX, rc, p2, p3, p5, p7 + var bExcl, rc, v1 int32 + var mask Tu16 + var nMs TDWORD + var p, pDbFd, pShmNode uintptr + _, _, _, _, _, _, _, _ = bExcl, mask, nMs, p, pDbFd, pShmNode, rc, v1 pDbFd = fd /* Connection holding shared memory */ p = (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm - rc = SQLITE_OK /* Mask of locks to take or release */ + rc = SQLITE_OK /* Result code */ + mask = uint16(libc.Uint32FromUint32(1)<<(ofst+n) - libc.Uint32FromUint32(1)<=3 && ofst>libc.Int32FromInt32(32)&libc.Int64FromUint32(0xffffffff)), uint32(*(*Tsqlite3_int64)(unsafe.Pointer(bp))&libc.Int64FromUint32(0xffffffff)), libc.UintptrFromInt32(0)) if (*TwinFile)(unsafe.Pointer(pFd)).FhMap == libc.UintptrFromInt32(0) { (*TwinFile)(unsafe.Pointer(pFd)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - rc = _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(24)< 0 { if !(int32(*(*int8)(unsafe.Pointer(Xsqlite3_temp_directory + uintptr(nDirLen-int32(1))))) == int32('/') || int32(*(*int8)(unsafe.Pointer(Xsqlite3_temp_directory + uintptr(nDirLen-int32(1))))) == int32('\\')) { nDirLen++ } - if nDirLen > nDir { + if int64(nDirLen) > nDir { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) Xsqlite3_free(tls, zBuf) - return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5091, uintptr(0), int32(51668)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5179, uintptr(0), int32(52323)) } - Xsqlite3_snprintf(tls, nMax, zBuf, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_temp_directory)) + Xsqlite3_snprintf(tls, int32(nMax), zBuf, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_temp_directory)) } Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) } else { @@ -103289,11 +97776,11 @@ func _winGetTempname(tls *libc.TLS, pVfs uintptr, pzBuf uintptr) (r int32) { if (*(*func(*libc.TLS, TDWORD, TLPWSTR) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(32)].FpCurrent})))(tls, uint32(nMax), zWidePath) == uint32(0) { Xsqlite3_free(tls, zWidePath) Xsqlite3_free(tls, zBuf) - return _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(25)< nBuf { + nLen = int64(_sqlite3Strlen30(tls, zBuf)) + if nLen+int64(nPre)+int64(17) > nBuf { Xsqlite3_free(tls, zBuf) - return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5155, uintptr(0), int32(51837)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5243, uintptr(0), int32(52460)) } - Xsqlite3_snprintf(tls, nBuf-int32(16)-nLen, zBuf+uintptr(nLen), __ccgo_ts+5083, 0) + Xsqlite3_snprintf(tls, int32(nBuf-int64(16)-nLen), zBuf+uintptr(nLen), __ccgo_ts+5171, 0) j = uint64(_sqlite3Strlen30(tls, zBuf)) Xsqlite3_randomness(tls, int32(15), zBuf+uintptr(j)) pid = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(17)].FpCurrent})))(tls) @@ -103410,6 +97897,11 @@ func _winIsDir(tls *libc.TLS, zConverted uintptr) (r int32) { return libc.BoolInt32(attr != uint32(-libc.Int32FromInt32(1)) && attr&uint32(FILE_ATTRIBUTE_DIRECTORY) != 0) } +/* +** The Windows version of xAccess() accepts an extra bit in the flags +** parameter that prevents an anti-virus retry loop. + */ + // C documentation // // /* @@ -103423,21 +97915,21 @@ func _winOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, id uintptr, flags int3 var isCreate, isDelete, isExclusive, isReadWrite, isReadonly, rc, rc2, rc21 int32 var pAppData, pFile, zConverted, zUtf8Name, v1, p2, p3 uintptr var _ /* cnt at bp+4 */ int32 - var _ /* isRO at bp+16 */ int32 - var _ /* isRO at bp+20 */ int32 + var _ /* isRO at bp+8 */ int32 var _ /* lastErrno at bp+0 */ TDWORD - var _ /* zTmpname at bp+8 */ uintptr + var _ /* zTmpname at bp+16 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dwCreationDisposition, dwDesiredAccess, dwFlagsAndAttributes, dwShareMode, h, isCreate, isDelete, isExclusive, isReadWrite, isReadonly, pAppData, pFile, rc, rc2, rc21, zConverted, zUtf8Name, v1, p2, p3 *(*TDWORD)(unsafe.Pointer(bp)) = uint32(0) dwFlagsAndAttributes = uint32(0) pFile = id /* Filename in OS encoding */ zUtf8Name = zName /* Filename in UTF-8 encoding */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 + *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* file is known to be accessible readonly */ /* If argument zPath is a NULL pointer, this function is required to open ** a temporary file. Use this buffer to store the file name in. */ - *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* For temporary filename, if necessary. */ - rc = SQLITE_OK /* Function Return Code */ + *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) /* For temporary filename, if necessary. */ + rc = SQLITE_OK /* Function Return Code */ isExclusive = flags & int32(SQLITE_OPEN_EXCLUSIVE) isDelete = flags & int32(SQLITE_OPEN_DELETEONCLOSE) isCreate = flags & int32(SQLITE_OPEN_CREATE) @@ -103459,11 +97951,11 @@ func _winOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, id uintptr, flags int3 ** temporary file name to use */ if !(zUtf8Name != 0) { - rc = _winGetTempname(tls, pVfs, bp+8) + rc = _winGetTempname(tls, pVfs, bp+16) if rc != SQLITE_OK { return rc } - zUtf8Name = *(*uintptr)(unsafe.Pointer(bp + 8)) + zUtf8Name = *(*uintptr)(unsafe.Pointer(bp + 16)) } /* Database filenames are double-zero terminated if they are not ** URIs with parameters. Hence, they can always be passed into @@ -103472,12 +97964,12 @@ func _winOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, id uintptr, flags int3 /* Convert the filename to the system encoding. */ zConverted = _winConvertFromUtf8Filename(tls, zUtf8Name) if zConverted == uintptr(0) { - Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) + Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][124]Tu32 - FapSub [0][62]uintptr - FaBitmap [496]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -105530,7 +99854,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) libc.Xmemset(tls, p+16, 0, uint64(496)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) + (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8) - uint64(1)) / ((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(8))) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if uint64((*TBitvec)(unsafe.Pointer(p)).FiDivisor) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = uint32((libc.Uint64FromInt32(BITVEC_SZ) - libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) / libc.Uint64FromInt64(8) * libc.Uint64FromInt64(8) / libc.Uint64FromInt64(1) * libc.Uint64FromInt32(BITVEC_SZELEM)) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -105584,7 +99914,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if uint64((*TBitvec)(unsafe.Pointer(p)).FiSize) <= (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(1)*libc.Uint64FromInt32(BITVEC_SZELEM) { p1 = p + 16 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & uint32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^int32(uint8(libc.Int32FromInt32(1)<<(i&uint32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+16, uint64(496)) @@ -105628,7 +99958,7 @@ func _sqlite3BitvecDestroy(tls *libc.TLS, p uintptr) { if (*TBitvec)(unsafe.Pointer(p)).FiDivisor != 0 { i = uint32(0) for { - if !(uint64(i) < (libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8)) { + if !(i < uint32((libc.Uint64FromInt32(BITVEC_SZ)-libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4))/libc.Uint64FromInt64(8)*libc.Uint64FromInt64(8)/libc.Uint64FromInt64(8))) { break } _sqlite3BitvecDestroy(tls, *(*uintptr)(unsafe.Pointer(p + 16 + uintptr(i)*8))) @@ -105703,7 +100033,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, uint32(sz)) - pV = _sqlite3MallocZero(tls, uint64((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, uint64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -105757,7 +100087,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^int32(uint8(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -105791,66 +100121,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -106024,14 +100294,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint64(80)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = uint8(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -106847,123 +101117,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -107044,7 +101197,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -107138,7 +101291,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -107179,7 +101332,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -107307,7 +101460,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+140, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -107327,17 +101480,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(8)*uint64(nNew)) + apNew = _sqlite3MallocZero(tls, uint64(8)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -107355,7 +101510,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*8)) = pPage @@ -107367,7 +101522,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -107568,9 +101723,10 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = int32(uint64(88) + uint64(80)*uint64(_pcache1_g.FseparateCache)) + sz = int64(uint64(88) + uint64(80)*uint64(_pcache1_g.FseparateCache)) pCache = _sqlite3MallocZero(tls, uint64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { @@ -108157,25 +102313,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -109137,258 +103274,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -109487,7 +103372,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -109716,7 +103601,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -109734,7 +103619,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || int64(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || int64(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -110307,6 +104192,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -110953,7 +104847,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -110965,7 +104860,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, uint64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, uint64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -110986,11 +104881,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, uint64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, uint64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -111019,7 +104915,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, uint32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, uint64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -111252,7 +105148,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -111389,7 +105285,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (int32((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -111405,7 +105301,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -112152,10 +106048,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 232 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -113056,7 +106952,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -113100,7 +106996,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -113131,7 +107027,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -113182,7 +107078,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))+uint64((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(journalFileSize*int32(2))+uint64(__SIZEOF_POINTER__)+uint64(4)+uint64(nPathname)+uint64(1)+uint64(nUriByte)+uint64(nPathname)+uint64(8)+uint64(1)+uint64(nPathname)+uint64(4)+uint64(1)+uint64(3)) + pPtr = _sqlite3MallocZero(tls, (libc.Uint64FromInt64(312)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))+uint64((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint64(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+uint64(nPathname)+uint64(1)+uint64(nUriByte)+uint64(nPathname)+uint64(8)+uint64(1)+uint64(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -113217,7 +107113,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+5452, uint64(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+5540, uint64(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -113227,7 +107123,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint64(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+5461, uint64(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+5549, uint64(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -113269,8 +107165,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = uint8(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5466, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5473, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = uint8(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5554, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5561, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -113353,7 +107249,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -113609,7 +107505,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -113784,7 +107680,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -113815,7 +107711,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -113887,7 +107783,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+8) @@ -115244,7 +109140,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 52 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -115512,7 +109408,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+5483, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+5571, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -116076,9 +109972,9 @@ type TWalIndexHdr = struct { type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment + F__ccgo_align [0]uint64 + FiPrior Tu32 + FnSegment int32 } type WalIterator = TWalIterator @@ -116093,227 +109989,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -116332,28 +110007,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -116412,7 +110066,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = int64(uint64(8) * uint64(iPage+libc.Int32FromInt32(1))) + nByte = int64(uint64(8) * uint64(libc.Int64FromInt32(1)+int64(iPage))) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, uint64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -116513,6 +110167,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -116780,14 +110435,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -116954,7 +110601,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -117042,7 +110689,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ @@ -117181,7 +110828,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -117622,10 +111269,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -117723,7 +111370,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -117762,7 +111409,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -117775,7 +111422,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -117791,7 +111438,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -117812,7 +111459,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -117878,7 +111525,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -117928,7 +111575,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+5538, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+5626, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -118143,7 +111790,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -118169,7 +111823,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -118892,8 +112546,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -118980,7 +112634,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -119126,7 +112780,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -119153,7 +112807,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -119162,6 +112816,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -119206,6 +112861,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 72 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 72 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -119477,7 +113135,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if int32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -119658,7 +113316,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -119667,7 +113325,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -119719,14 +113377,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -120272,283 +113930,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -120681,27 +114062,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -120864,10 +114224,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -120876,14 +114237,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -121583,11 +114944,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -121761,7 +115122,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -121774,12 +115135,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = int32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -121823,7 +115184,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = int32(libc.Uint32FromInt32(5) * (key - uint32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -121831,7 +115192,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if int32(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || int32(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -122019,7 +115380,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(uint16(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(uint16(nPayload)) + int32(uint16(int64(pIter)-int64(pCell)))) if int32((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -122052,7 +115413,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(uint16(int64(pIter)-int64(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(uint16(nPayload)) + int32(uint16(int64(pIter)-int64(pCell)))) if int32((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -122251,7 +115612,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint64(pCell) < uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint64(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint64((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(int32((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -122291,12 +115652,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -122304,21 +115665,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), uint64(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -122365,12 +115726,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = uint8(cbrk) @@ -122386,7 +115747,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8(cbrk) @@ -122446,7 +115807,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -122463,14 +115824,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -122513,11 +115874,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -122531,7 +115892,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -122584,42 +115945,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = uint32(int32(iStart) + int32(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = uint16(int32(hdr) + int32(1)) - if int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(1))))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = int32(hdr) + int32(1) + if int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -122627,70 +115986,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = uint32(int32(iFreeBlk) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< int32(hdr)+int32(1) { - iPtrEnd = int32(iPtr) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(2)))))<= int32(iStart) { - if iPtrEnd > int32(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) - } - nFrag = Tu8(int32(nFrag) + (int32(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + if iPtr > int32(hdr)+int32(1) { + iPtrEnd = iPtr + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) + } + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(int32(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - int32(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - int32(uint8(nFrag))) } pTmp = data + uintptr(int32(hdr)+int32(5)) - x = uint16(int32(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)))) = uint8(iFreeBlk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = uint8(int32(iStart) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = uint8(iStart >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = uint8(int32(iFreeBlk) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = uint8(iFreeBlk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)))) = uint8(int32(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)) + 1)) = uint8(iSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = uint8(int32(uint16(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(uint16(iSize)) } - *(*int32)(unsafe.Pointer(pPage + 20)) += int32(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -122736,7 +116095,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -122762,7 +116121,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -122801,12 +116160,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = uint32(int32(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if uint32(pc)+size > uint32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -122833,7 +116192,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16(nFree - iCellFirst)) return SQLITE_OK @@ -122864,11 +116223,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -122897,11 +116256,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, int32(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = uint16(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + int32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = uint16(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + int32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -122910,7 +116269,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = uint16(int32(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -122932,13 +116291,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { libc.Xmemset(tls, data+uintptr(hdr), 0, uint64((*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr))) } @@ -122948,14 +116305,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = uint16(int32(hdr) + v1) - libc.Xmemset(tls, data+uintptr(int32(hdr)+int32(1)), 0, uint64(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint64(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = uint16(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -123063,7 +116420,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -123125,7 +116482,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -123213,7 +116570,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+5564) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+5652) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -123837,7 +117194,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 40 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | int32(uint16(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -123999,7 +117356,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+5573, uint64(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+5661, uint64(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -124037,7 +117394,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 8)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 8)) @@ -124478,7 +117835,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if int32(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -124502,7 +117859,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -124511,7 +117868,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -124525,7 +117882,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if int32(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -124555,7 +117912,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -124651,7 +118008,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -124689,7 +118046,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if *(*TPgno)(unsafe.Pointer(bp + 24)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 32)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 24)), bCommit) @@ -124756,7 +118113,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -124799,7 +118156,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -124829,7 +118186,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -125295,7 +118652,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -125687,7 +119044,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -125697,7 +119054,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -125754,7 +119111,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -125828,7 +119185,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -125963,7 +119320,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -125975,7 +119332,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+136, int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 84 @@ -126091,7 +119448,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if int32((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != int32((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -126105,7 +119462,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -126339,7 +119696,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -126423,7 +119780,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -126435,7 +119792,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(int32(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, uint64(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, uint64(nCell)+uint64(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -126637,7 +119994,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -126670,7 +120027,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = uint16(lwr) *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*8)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -126679,7 +120036,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+136, int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 84 @@ -126808,7 +120165,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -126918,7 +120275,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -127006,7 +120363,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -127061,7 +120418,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -127087,7 +120444,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -127114,7 +120471,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+16, 0) @@ -127185,7 +120542,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -127323,7 +120680,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = pMemPage @@ -127374,7 +120731,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 16)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -127383,7 +120740,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 16)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -127473,7 +120830,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -127491,7 +120848,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+8, bp) @@ -127514,7 +120871,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 8)), ovflPgno) } @@ -127735,10 +121092,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = uint32(int32(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), uint16(sz)) + rc = _freeSpace(tls, pPage, int32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -128029,17 +121386,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -128129,12 +121475,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint64(pCell) >= uint64(aData+uintptr(j)) && uint64(pCell) < uint64(pEnd) { if uint64(pCell+uintptr(sz)) > uint64(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int64(pCell)-int64(aData)) } else { if uint64(pCell+uintptr(sz)) > uint64(pSrcEnd) && uint64(pCell) < uint64(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -128142,7 +121488,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int64(pData) - int64(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint64(sz)) i++ @@ -128237,7 +121583,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))+uintptr(sz)) > uint64(pEnd) && uint64(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8))) < uint64(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*8)), uint64(sz)) @@ -128318,7 +121664,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, uint16(aOfst[j]), uint16(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -128345,7 +121691,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, uint16(aOfst[j]), uint16(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -128385,7 +121731,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), uint64(nCell*int32(2))) nCell -= nShift @@ -128456,7 +121802,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -128501,7 +121847,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -128697,10 +122043,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+100 */ [5]Tu8 @@ -128823,8 +122170,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = int32(uint64(nMaxCells)*uint64(8) + uint64(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize)) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(szScratch)) + szScratch = uint64(nMaxCells)*uint64(8) + uint64(nMaxCells)*uint64(2) + uint64((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 112))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -128864,7 +122211,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 8)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -128887,7 +122234,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 112))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 112))).FnCell)*2, 0, uint64(2)*uint64(limit+int32((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if int32((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -129018,7 +122365,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 72)))[k-int32(1)] = 0 @@ -129061,7 +122408,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -129120,7 +122467,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -129152,7 +122499,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 216)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -129382,7 +122729,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 112 + 32 + uintptr(k)*8)) if uint64(pCell1) < uint64(pSrcEnd) && uint64(pCell1+uintptr(sz2)) > uint64(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -129628,7 +122975,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && int32((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -129701,7 +123048,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 144 + uintptr(iPage-int32(1))*8)) iIdx = int32(*(*Tu16)(unsafe.Pointer(pCur + 88 + uintptr(iPage-int32(1))*2))) @@ -129860,7 +123207,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if uint32(iOffset)+ovflPageSize < uint32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -129891,7 +123238,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -129976,7 +123323,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -130068,7 +123415,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -130104,7 +123451,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -130134,10 +123481,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, uint64(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -130255,12 +123602,12 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { libc.Xmemcpy(tls, aOut, aIn, uint64(nIn)) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(int64(nIn) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nIn + uint32(int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)))) return SQLITE_OK } else { *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK @@ -130270,14 +123617,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = uint32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, int64((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(int64(nOut) + (int64(aOut) - int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nOut) + int32(int64(aOut)-int64((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 144)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -130377,21 +123724,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -130485,7 +123832,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -130595,7 +123942,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+8) if *(*TPgno)(unsafe.Pointer(bp + 8)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 8))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -130636,7 +123983,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 12)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 8)), bp+32, bp+36) if int32(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_ROOTPAGE) || int32(*(*Tu8)(unsafe.Pointer(bp + 32))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 12)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -130717,14 +124064,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+8 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 8)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { return *(*int32)(unsafe.Pointer(bp + 8)) } if int32((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -130861,7 +124208,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -131126,7 +124473,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+5577, int32(1)) + Xsqlite3_str_append(tls, pCheck+72, __ccgo_ts+5665, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+72, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -131174,11 +124521,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5579, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5667, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5602, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5690, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -131204,11 +124551,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5732, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5820, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -131280,11 +124627,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 5771 + v2 = __ccgo_ts + 5859 } else { - v2 = __ccgo_ts + 5776 + v2 = __ccgo_ts + 5864 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+5797, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5885, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -131420,12 +124767,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 5823 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 5911 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5841, libc.VaList(bp+56, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5929, libc.VaList(bp+56, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5995, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6083, libc.VaList(bp+56, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+24) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6025, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6113, 0) doCoverageCheck = 0 goto _4 } @@ -131510,7 +124857,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6049, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6137, libc.VaList(bp+56, (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 24))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -131533,7 +124880,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, uint32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6073, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6161, 0) depth = d2 } } else { @@ -131610,7 +124957,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+16) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6098, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6186, libc.VaList(bp+56, *(*Tu32)(unsafe.Pointer(bp + 16))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 16))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -131624,7 +124971,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6135, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6223, libc.VaList(bp+56, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -131715,7 +125062,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 6187 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 6275 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -131739,11 +125086,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+6198, libc.VaList(bp+248, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+6286, libc.VaList(bp+248, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+6243, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+6331, 0) } } } @@ -131780,10 +125127,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+6298, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+6386, libc.VaList(bp+248, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+6318, libc.VaList(bp+248, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+6406, libc.VaList(bp+248, i)) } goto _3 _3: @@ -131913,14 +125260,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), uint64(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -132131,45 +125478,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -132222,7 +125530,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+4710, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+4829, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -132232,7 +125540,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+6350, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+6438, libc.VaList(bp+432, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*32))).FpBt @@ -132261,7 +125569,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+6370, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+6458, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -132291,7 +125599,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+6401, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+6489, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -132969,7 +126277,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6441, libc.VaList(bp+48, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6529, libc.VaList(bp+48, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = int32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -133107,9 +126415,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= uint64((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -133284,20 +126589,20 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 bp := tls.Alloc(112) defer tls.Free(112) var _ /* ctx at bp+0 */ Tsqlite3_context - var _ /* t at bp+56 */ TMem - libc.Xmemset(tls, bp, 0, uint64(56)) - libc.Xmemset(tls, bp+56, 0, uint64(56)) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fflags = uint16(MEM_Null) - (*(*TMem)(unsafe.Pointer(bp + 56))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 56 + var _ /* t at bp+48 */ TMem + libc.Xmemset(tls, bp, 0, uint64(48)) + libc.Xmemset(tls, bp+48, 0, uint64(56)) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fflags = uint16(MEM_Null) + (*(*TMem)(unsafe.Pointer(bp + 48))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = bp + 48 (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pMem (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc - (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 56))).Fdb)).Fenc + (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer((*(*TMem)(unsafe.Pointer(bp + 48))).Fdb)).Fenc (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxFinalize})))(tls, bp) /* IMP: R-24505-23230 */ if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - libc.Xmemcpy(tls, pMem, bp+56, uint64(56)) + libc.Xmemcpy(tls, pMem, bp+48, uint64(56)) return (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError } @@ -133312,10 +126617,10 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 // ** otherwise. // */ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(48) + defer tls.Free(48) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -133774,21 +127079,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } *(*uintptr)(unsafe.Pointer(pMem)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -133947,7 +127252,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -133989,11 +127294,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -134003,7 +127308,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if int32(flags)&int32(MEM_Term) != 0 { if int32(enc) == int32(SQLITE_UTF8) { @@ -134025,12 +127330,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -134069,7 +127374,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < int64(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, int32(amt+uint32(1))) rc = v1 @@ -134181,8 +127486,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -134233,7 +127538,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -134241,7 +127547,7 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = int32(uint64(56)*uint64(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) + nByte = int64(uint64(56)*uint64(nCol) + (libc.Uint64FromInt64(40)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) pRec = _sqlite3DbMallocZero(tls, db, uint64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) @@ -134299,14 +127605,14 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { // ** NULL and an SQLite error code returned. // */ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, ppVal uintptr, pCtx uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(64) + defer tls.Free(64) var apVal, pFunc, pList, pVal uintptr var i, nVal, rc int32 var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -134345,14 +127651,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint64(56)) + libc.Xmemset(tls, bp, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+4710, libc.VaList(bp+64, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+4829, libc.VaList(bp+56, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) @@ -134410,7 +127716,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1673 + zNeg = __ccgo_ts + 1674 rc = SQLITE_OK for { v1 = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -134452,7 +127758,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 6448 + zNeg = __ccgo_ts + 6536 } } } @@ -134467,7 +127773,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+6450, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+6538, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -134771,7 +128077,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(uint8(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > uint32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = int64(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -134787,7 +128093,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(uint8(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += int64(szField) @@ -134797,7 +128103,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -134848,9 +128154,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -134924,7 +128230,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+136, 0, libc.Uint64FromInt64(304)-uint64(libc.UintptrFromInt32(0)+136)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 16 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 8 @@ -135258,12 +128564,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = int32(uint64(56) + uint64(nArg-libc.Int32FromInt32(1))*uint64(8)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.UintptrFromInt32(0)+48)+uint64(nArg)*libc.Uint64FromInt64(8)) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -135437,7 +128742,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 72 + v2 = pParse + 76 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -135522,8 +128827,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -135536,11 +128841,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -135577,13 +128882,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*24))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -135614,7 +128922,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -136116,7 +129424,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6455, libc.VaList(bp+40, int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6543, libc.VaList(bp+40, int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -136126,66 +129434,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+6460) == 0 { - zColl = __ccgo_ts + 6467 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+6548) == 0 { + zColl = __ccgo_ts + 6555 } if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 6448 + v3 = __ccgo_ts + 6536 } else { - v3 = __ccgo_ts + 1673 + v3 = __ccgo_ts + 1674 } if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 6469 + v4 = __ccgo_ts + 6557 } else { - v4 = __ccgo_ts + 1673 + v4 = __ccgo_ts + 1674 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6472, libc.VaList(bp+40, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6560, libc.VaList(bp+40, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6568, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6496, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6584, libc.VaList(bp+40, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6505, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6593, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6505, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6593, libc.VaList(bp+40, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1434, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1435, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6512, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6600, libc.VaList(bp+40, (*TOp)(unsafe.Pointer(pOp)).Fp4.Fi)) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1401, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1402, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1434, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1435, libc.VaList(bp+40, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1401, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1402, libc.VaList(bp+40, *(*float64)(unsafe.Pointer(pMem)))) } else { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1674 + zP4 = __ccgo_ts + 1675 } else { - zP4 = __ccgo_ts + 6515 + zP4 = __ccgo_ts + 6603 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6522, libc.VaList(bp+40, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6610, libc.VaList(bp+40, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -136200,20 +129508,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6530, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6618, libc.VaList(bp+40, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6535, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6623, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 6537 + zP4 = __ccgo_ts + 6625 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6545, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6633, libc.VaList(bp+40, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -136227,10 +129535,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 6482, - 1: __ccgo_ts + 6484, - 2: __ccgo_ts + 6486, - 3: __ccgo_ts + 6491, + 0: __ccgo_ts + 6570, + 1: __ccgo_ts + 6572, + 2: __ccgo_ts + 6574, + 3: __ccgo_ts + 6579, } // C documentation @@ -137046,7 +130354,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -137054,7 +130362,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*int32((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*56 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -137181,7 +130489,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+6561, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+6649, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -137189,18 +130497,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6573, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6661, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6587, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6675, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+12) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+6602, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+6690, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 12))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+8) @@ -137431,7 +130739,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< uint32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -138819,7 +132127,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || int32((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 32 + uintptr(i)*8)) != 0 { @@ -138854,7 +132162,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = int32((*(*Tu32)(unsafe.Pointer(bp + 68)) - uint32(12)) / uint32(2)) if d1+uint32(nStr) > uint32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -138908,7 +132216,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += uint32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 68))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -139040,7 +132348,7 @@ vrcs_restart: szHdr = int32(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -139192,7 +132500,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -139223,7 +132531,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp) @@ -139374,15 +132682,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*24 if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 6645 + zContext = __ccgo_ts + 6733 } else { if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 6664 + zContext = __ccgo_ts + 6752 } else { - zContext = __ccgo_ts + 6683 + zContext = __ccgo_ts + 6771 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+6692, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+6780, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -139477,10 +132785,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = uint16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 168 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = uint16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -139489,9 +132798,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, int32((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, int32((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+112) + _vdbeFreeUnpacked(tls, db, int32((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, int32((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+80) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -139571,7 +132880,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6728, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6816, 0) return int32(1) } else { return 0 @@ -139581,7 +132890,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6773, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6861, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -139639,7 +132948,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -139966,12 +133275,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -139988,29 +133297,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), __ccgo_fp_xDel) } } @@ -140040,13 +133353,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -140058,11 +133373,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if int32(enc) != int32(SQLITE_UTF8) { if int32(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -140070,23 +133389,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, int32(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -140142,7 +133467,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+6813, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+6901, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -140343,7 +133668,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -140473,7 +133798,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -140642,6 +133967,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -140655,7 +133982,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -140693,13 +134020,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -140933,18 +134260,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 6836, - 1: __ccgo_ts + 6841, - 2: __ccgo_ts + 6848, - 3: __ccgo_ts + 6851, - 4: __ccgo_ts + 6854, - 5: __ccgo_ts + 6857, - 6: __ccgo_ts + 6860, - 7: __ccgo_ts + 6863, - 8: __ccgo_ts + 6871, - 9: __ccgo_ts + 6874, - 10: __ccgo_ts + 6881, - 11: __ccgo_ts + 6889, + 0: __ccgo_ts + 6924, + 1: __ccgo_ts + 6929, + 2: __ccgo_ts + 6936, + 3: __ccgo_ts + 6939, + 4: __ccgo_ts + 6942, + 5: __ccgo_ts + 6945, + 6: __ccgo_ts + 6948, + 7: __ccgo_ts + 6951, + 8: __ccgo_ts + 6959, + 9: __ccgo_ts + 6962, + 10: __ccgo_ts + 6969, + 11: __ccgo_ts + 6977, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -141199,14 +134526,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6896, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6984, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= uint32((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -141244,7 +134571,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -141254,7 +134581,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*56 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && int32(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, int32((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -141265,24 +134592,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -141330,7 +134661,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -141338,32 +134671,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*56, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if int32(enc) != int32(SQLITE_UTF8) { if int32(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= uint64(^int32(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(uint64(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(uint64(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -141780,11 +135119,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -141793,7 +135132,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 112 + v1 = p + 80 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -141807,7 +135146,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 48)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+32, int32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, int32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -141842,7 +135181,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 64))).FpDfltList + 8 + uintptr(int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*32))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*8)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -141877,7 +135216,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = int32((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = int32((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -141943,11 +135282,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -141970,7 +135309,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+32, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -142119,7 +135458,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6936, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7024, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(int64(zRawSql)-int64(zStart))) } } else { @@ -142151,13 +135490,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*56 if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1674, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1675, int32(4)) } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1434, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1435, libc.VaList(bp+104, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6441, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6529, libc.VaList(bp+104, *(*float64)(unsafe.Pointer(pVar)))) } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -142172,28 +135511,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 40 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6940, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+7028, libc.VaList(bp+104, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if int32(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+40) } } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6947, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+7035, libc.VaList(bp+104, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6960, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7048, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6963, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+7051, libc.VaList(bp+104, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6968, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7056, int32(1)) } } } @@ -142357,9 +135696,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*56 } else { @@ -142385,12 +135724,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = int64((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + uint64(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if int32(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = int32(libc.Uint64FromInt64(128) + libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*uint64(nField) + uint64(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = uintptr(0) @@ -142399,28 +135736,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*8)) = v3 libc.Xmemset(tls, pCx, 0, uint64(libc.UintptrFromInt32(0)+40)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 120 + uintptr(nField)*4 if int32(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr(libc.Uint64FromInt64(128)+libc.Uint64FromInt32(2)*libc.Uint64FromInt64(4)*uint64(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 48)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint64(libc.UintptrFromInt32(0)+120)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))+uint64(nField+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 48))) } return pCx @@ -142793,11 +136130,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1143, - 1: __ccgo_ts + 1155, - 2: __ccgo_ts + 1160, - 3: __ccgo_ts + 1138, - 4: __ccgo_ts + 1674, + 0: __ccgo_ts + 1144, + 1: __ccgo_ts + 1156, + 2: __ccgo_ts + 1161, + 3: __ccgo_ts + 1139, + 4: __ccgo_ts + 1675, } // C documentation @@ -142811,12 +136148,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(976) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -142833,7 +136170,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+616 */ Ti64 var _ /* nEntry at bp+96 */ Ti64 var _ /* nErr at bp+680 */ int32 - var _ /* nullFunc at bp+856 */ TFuncDef + var _ /* nullFunc at bp+848 */ TFuncDef var _ /* pVCur at bp+784 */ uintptr var _ /* pgno at bp+624 */ TPgno var _ /* r at bp+120 */ TUnpackedRecord @@ -142851,7 +136188,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* res at bp+400 */ int32 var _ /* res at bp+456 */ int32 var _ /* rowid at bp+504 */ Ti64 - var _ /* rowid at bp+928 */ Tsqlite_int64 + var _ /* rowid at bp+920 */ Tsqlite_int64 var _ /* sContext at bp+800 */ Tsqlite3_context var _ /* sMem at bp+24 */ TMem var _ /* sMem at bp+728 */ TMem @@ -143565,19 +136902,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+944, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+936, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+7004, libc.VaList(bp+944, _azType[int32((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+7092, libc.VaList(bp+936, _azType[int32((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+7025, libc.VaList(bp+944, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+7113, libc.VaList(bp+936, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = int32((int64(pOp) - int64(aOp)) / 24) - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+7032, libc.VaList(bp+944, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+7120, libc.VaList(bp+936, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -144791,7 +138128,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -144807,6 +138144,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -145300,7 +138643,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*24 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -145403,7 +138746,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+7056, libc.VaList(bp+944, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7142, libc.VaList(bp+936, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*16 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+7170, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7256, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -145999,7 +139342,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+7224, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7310, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -146029,12 +139372,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 7279 + v250 = __ccgo_ts + 7365 } else { if iRollback != 0 { - v251 = __ccgo_ts + 7327 + v251 = __ccgo_ts + 7413 } else { - v251 = __ccgo_ts + 7370 + v251 = __ccgo_ts + 7456 } v250 = v251 } @@ -146126,7 +139469,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+7411) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+7497) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -146444,7 +139787,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1673 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56))).Fz = __ccgo_ts + 1674 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*8)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -147210,7 +140553,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 256)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+256, int8(SQLITE_AFF_NUMERIC), encoding) if int32((*(*TMem)(unsafe.Pointer(bp + 256))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -147237,7 +140580,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 248)) if *(*int32)(unsafe.Pointer(bp + 248)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -147696,7 +141039,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -148129,7 +141472,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+552, db, uint16(0)) @@ -148459,7 +141802,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 632)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+944, *(*uintptr)(unsafe.Pointer(bp + 632)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+936, *(*uintptr)(unsafe.Pointer(bp + 632)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 632))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -148490,13 +141833,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+200, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 7456 + zSchema = __ccgo_ts + 7542 (*(*TInitData)(unsafe.Pointer(bp + 640))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 640))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 640))).FpzErrMsg = p + 168 (*(*TInitData)(unsafe.Pointer(bp + 640))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 640))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+7470, libc.VaList(bp+944, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+7556, libc.VaList(bp+936, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*32))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -148511,7 +141854,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -148748,7 +142091,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 136 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+7513, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7599, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -148765,7 +142108,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = int32((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + uint64(nMem)*uint64(56) + uint64((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + uint64(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) + nByte2 = int64((libc.Uint64FromInt64(112)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + uint64(nMem)*uint64(56) + uint64((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint64(8) + uint64((int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8))) pFrame2 = _sqlite3DbMallocZero(tls, db, uint64(nByte2)) if !(pFrame2 != 0) { goto no_mem @@ -148773,7 +142116,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -148854,11 +142197,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 784)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 792)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 80)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -149070,7 +142413,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = libc.Uint64FromInt64(56) + uint64(n4-libc.Int32FromInt32(1))*libc.Uint64FromInt64(8) + nAlloc = uint64(libc.UintptrFromInt32(0)+48) + uint64(n4)*libc.Uint64FromInt64(8) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(56)) if pCtx == uintptr(0) { goto no_mem @@ -149120,7 +142463,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+944, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+936, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -149176,7 +142519,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+944, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+936, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, int32(encoding)) @@ -149255,11 +142598,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 7550 + v286 = __ccgo_ts + 7636 } else { - v286 = __ccgo_ts + 7555 + v286 = __ccgo_ts + 7641 } - _sqlite3VdbeError(tls, p, __ccgo_ts+7562, libc.VaList(bp+944, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7648, libc.VaList(bp+936, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -149412,7 +142755,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+7614, libc.VaList(bp+944, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7700, libc.VaList(bp+936, z1)) } goto abort_due_to_error } @@ -149574,7 +142917,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*56 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+7643, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+7729, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -149654,12 +142997,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 48)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+800, 0, uint64(56)) + libc.Xmemset(tls, bp+800, 0, uint64(48)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 856))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 856 + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 848))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FpFunc = bp + 848 if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = uint16(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -149670,7 +143013,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 48)), bp+800, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+944, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+936, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 800))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding)) @@ -149764,7 +143107,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _174: ; - *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) = 0 + *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) = 0 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto no_mem } @@ -149792,11 +143135,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { i7++ } (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = uint8((*TOp)(unsafe.Pointer(pOp)).Fp5) - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+928) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule6)).FxUpdate})))(tls, pVtab7, nArg1, apArg1, bp+920) (*Tsqlite3)(unsafe.Pointer(db)).FvtabOnConflict = vtabOnConflict _sqlite3VtabImportErrmsg(tls, p, pVtab7) if rc == SQLITE_OK && (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 928)) + (*Tsqlite3)(unsafe.Pointer(db)).FlastRowid = *(*Tsqlite_int64)(unsafe.Pointer(bp + 920)) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) && (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FbConstraint != 0 { if int32((*TOp)(unsafe.Pointer(pOp)).Fp5) == int32(OE_Ignore) { @@ -149924,7 +143267,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+944, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+936, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+296, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -150075,7 +143418,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+7653, libc.VaList(bp+944, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+7739, libc.VaList(bp+936, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -150162,15 +143505,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+8) @@ -150636,11 +143958,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 4710 + v8 = __ccgo_ts + 4829 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+440, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+8) rc = _sqlite3ApiExit(tls, db, rc) @@ -150719,14 +144041,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -150745,11 +144067,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), int32((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -150825,7 +144147,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -150839,7 +144161,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 4710 + v1 = __ccgo_ts + 4829 } else { v1 = libc.UintptrFromInt32(0) } @@ -151106,108 +144428,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - FpFd uintptr - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - FiWriteOff Ti64 - FpFd uintptr -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -151571,7 +144628,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -151897,8 +144954,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -151912,9 +144969,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = int32(uint64(40) + uint64(int32((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint64(8)) - sz = int32(uint64(192) + uint64(nWorker)*uint64(96)) - pSorter = _sqlite3DbMallocZero(tls, db, uint64(sz+szKeyInfo)) + szKeyInfo = int32(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint64FromInt64(8)) + sz = int64(uint64(libc.UintptrFromInt32(0)+96) + uint64(nWorker+libc.Int32FromInt32(1))*libc.Uint64FromInt64(96)) + pSorter = _sqlite3DbMallocZero(tls, db, uint64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 48)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -152062,8 +145119,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -152112,14 +145169,15 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = int32(uint64(32) + uint64(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) + nByte = int64(uint64(32) + uint64(N)*(libc.Uint64FromInt64(4)+libc.Uint64FromInt64(80))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { @@ -152257,7 +145315,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+16 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+16) @@ -152411,6 +145469,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -153906,57 +146967,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - FiOffset Tsqlite3_int64 - FpChunk uintptr -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -154253,7 +147263,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -154956,25 +147966,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+7960, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+8047, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+7968+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7987+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+8055+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8074+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7456+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7542+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8006+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8093+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8006+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8093+7) == 0 { return int32(1) } } @@ -155013,23 +148023,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+8 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -155061,7 +148070,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+8020, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+8107, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -155155,7 +148164,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+8025) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+8112) != 0 { goto _2 } } @@ -155177,57 +148186,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+64) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 64)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 16 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -155272,11 +148268,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8027, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8114, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8031, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8118, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -155285,36 +148281,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 16)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8035, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8122, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 16 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -155343,18 +148328,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 216)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 248)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 220)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 252)) |= v6 } } } @@ -155401,15 +148386,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*32 + 16 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*32))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&uint32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8044, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8131, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&uint32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8075, libc.VaList(bp+24, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8162, libc.VaList(bp+24, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -155420,8 +148405,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -155461,7 +148446,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+8130, libc.VaList(bp+24, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+8217, libc.VaList(bp+24, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+64, 0, uint64(8)) return int32(WRC_Prune) @@ -155481,7 +148466,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -155490,7 +148475,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8165 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8252 *(*uintptr)(unsafe.Pointer(pExpr + 32)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -155500,26 +148485,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 8174 + v8 = __ccgo_ts + 8261 } else { - v10 = __ccgo_ts + 8189 + v8 = __ccgo_ts + 8276 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8211, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8298, libc.VaList(bp+24, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8224, libc.VaList(bp+24, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8311, libc.VaList(bp+24, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&uint32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8234, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8321, libc.VaList(bp+24, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8295, libc.VaList(bp+24, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8382, libc.VaList(bp+24, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -155568,8 +148553,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -155643,19 +148628,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 8302 + zIn = __ccgo_ts + 8389 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 8330 + zIn = __ccgo_ts + 8417 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 8348 + zIn = __ccgo_ts + 8435 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 8366 + zIn = __ccgo_ts + 8453 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8384, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8471, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -155681,7 +148666,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -155827,7 +148812,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8404, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8491, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if int32((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -155882,7 +148867,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*32))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8421, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8508, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -155906,7 +148891,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8485, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8572, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -155920,13 +148905,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*32))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -155946,16 +148931,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8521, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8608, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = uint8((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -155966,35 +148948,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8549, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8636, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 8592 + zType = __ccgo_ts + 8679 } else { - zType = __ccgo_ts + 8599 + zType = __ccgo_ts + 8686 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8609, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8696, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8637, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8724, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8659, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8746, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8703, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8790, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -156079,7 +149064,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8751, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8838, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 32))) } @@ -156091,7 +149076,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8762, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8849, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -156137,7 +149122,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -156262,7 +149247,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8773, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8860, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -156297,7 +149282,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8829, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8916, 0) return int32(1) } i = 0 @@ -156335,7 +149320,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+8863, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+8950, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -156405,7 +149390,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*32 + 16 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8869, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8956, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -156439,7 +149424,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8930, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9017, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -156752,7 +149737,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8961, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9048, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -156819,7 +149804,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8863) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8950) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -156830,7 +149815,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+9000) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+9087) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -156840,7 +149825,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9006, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9093, 0) return int32(WRC_Abort) } goto _6 @@ -157062,33 +150047,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(144) defer tls.Free(144) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+88 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+88, 0, uint64(56)) - libc.Xmemset(tls, bp, 0, uint64(88)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+56 */ [88]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint64(56)) + pSrc = bp + 56 + libc.Xmemset(tls, pSrc, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*32))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 88))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+88, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+88, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -157140,7 +150127,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*32))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -157348,7 +150335,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 32)) + 8))).FpExpr continue } @@ -157823,7 +150810,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return } if int32(op) == int32(TK_LE) { @@ -157902,7 +150889,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9065, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9152, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -158247,11 +151234,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 9113 + v2 = __ccgo_ts + 9200 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9115, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9202, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 32)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -158297,10 +151284,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1793) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -158328,7 +151315,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 52)) = int32(int64((*TToken)(unsafe.Pointer(pToken)).Fz) - int64((*TParse)(unsafe.Pointer(pParse)).FzTail)) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9159, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9246, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 32)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_HasFunc)) @@ -158348,7 +151335,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9193, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9280, libc.VaList(bp+8, p)) } // C documentation @@ -158419,7 +151406,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9243, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9330, libc.VaList(bp+8, pExpr)) } } } @@ -158471,7 +151458,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, int32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 136 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9263, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9350, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 136 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -158504,7 +151491,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 136 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9306, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9393, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -158740,12 +151727,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -158887,7 +151868,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = int64(uint64(64) + uint64(48)*uint64((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = int64(uint64(libc.UintptrFromInt32(0)+16) + uint64((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint64FromInt64(48)) pRet = _sqlite3DbMallocZero(tls, db, uint64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -159027,7 +152008,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+16+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -159048,27 +152028,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint64 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint64(80) * uint64((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint64(0) - } - nByte = int32(uint64(88) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.UintptrFromInt32(0)+8)+uint64((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } - v2 = uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = int32(v2) + v1 = uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = int32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -159114,9 +152087,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 24 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 56)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -159126,8 +152099,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 64)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 64)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -159141,7 +152114,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(16)+uint64((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint64(8)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(libc.UintptrFromInt32(0)+8)+uint64((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint64FromInt64(8)) if pNew == uintptr(0) { return uintptr(0) } @@ -159192,7 +152165,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & uint32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -159273,7 +152246,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, libc.Uint64FromInt64(40)+libc.Uint64FromInt64(32)*libc.Uint64FromInt32(4)) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(libc.UintptrFromInt32(0)+8)+uint64(libc.Int32FromInt32(4))*libc.Uint64FromInt64(32)) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -159291,7 +152264,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(40)+uint64((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint64(32)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(libc.UintptrFromInt32(0)+8)+uint64((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint64FromInt64(32)) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -159372,7 +152345,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9329, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9416, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -159501,7 +152474,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9359, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9446, libc.VaList(bp+8, zObject)) } } @@ -159599,10 +152572,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9382) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9469) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9387) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9474) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -160280,13 +153253,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+9393) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9480) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9401) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9488) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9407) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9494) == 0 { return int32(1) } return 0 @@ -160301,32 +153274,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 9393, - 1: __ccgo_ts + 9401, - 2: __ccgo_ts + 9407, + 0: __ccgo_ts + 9480, + 1: __ccgo_ts + 9488, + 2: __ccgo_ts + 9494, } ii = 0 for { if !(ii < int32(libc.Uint64FromInt64(24)/libc.Uint64FromInt64(8))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -160535,7 +153495,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -160588,7 +153548,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+9411, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+9498, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -160688,12 +153648,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1793) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -161285,7 +154246,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+9626) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+9713) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -161381,7 +154342,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = uint8(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return @@ -161416,9 +154377,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -161551,7 +154512,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 64))).FiAddr) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -161681,13 +154642,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -162467,7 +155433,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9719, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9806, libc.VaList(bp+160, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -162479,7 +155445,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 64)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -162494,7 +155460,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9746, libc.VaList(bp+160, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9833, libc.VaList(bp+160, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -162523,7 +155489,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 64)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -162599,7 +155565,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9329, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9416, libc.VaList(bp+160, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -162662,7 +155628,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -162672,7 +155638,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = uint8(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -162680,7 +155646,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32))).FiSorterColumn, target) inReg = target break } @@ -162693,9 +155659,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -162777,7 +155743,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9770, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9857, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -162848,17 +155814,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -162867,7 +155833,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*32 libc.SetBitFieldPtr16Uint32(pItem1+16+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -162879,6 +155845,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(80) + defer tls.Free(80) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = uint8(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint64(72)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 64)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+44, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -162898,7 +155885,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && pExpr != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -162968,7 +155955,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -163012,7 +155999,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -163085,7 +156072,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(224) defer tls.Free(224) var db, pDel uintptr @@ -163112,8 +156099,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 144))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 144))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8 + 1*32))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+216)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -163279,7 +156266,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -163488,7 +156477,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -164195,7 +157186,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -164424,10 +157415,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*32))).FpCExpr = pExpr } } } else { @@ -164465,7 +157456,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(24), pInfo+32, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(32), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -164479,7 +157470,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+48, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(32), pInfo+56, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -164493,10 +157484,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -164506,25 +157500,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 24 + pCol += 32 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*24 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9907, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*32 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = *(*uintptr)(unsafe.Pointer(pExpr + 64)) (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -164537,7 +157535,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -164547,11 +157545,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 32 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int32(v3) } goto fix_up_expr fix_up_expr: @@ -164571,13 +157569,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) + bp := tls.Alloc(96) + defer tls.Free(96) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 40)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -164647,7 +157645,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*24))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*32))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -164683,6 +157681,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 136 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -164700,44 +157699,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 32 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 56 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9907, libc.VaList(bp+80, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 60 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 32)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 60 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -164817,7 +157821,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if int32((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -164825,7 +157829,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 31 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v3)*4)) } // C documentation @@ -164843,7 +157847,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 31 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 232 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 192 + uintptr(v1)*4)) = iReg } } } @@ -164862,11 +157866,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg - *(*int32)(unsafe.Pointer(pParse + 44)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg + *(*int32)(unsafe.Pointer(pParse + 48)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg } return i } @@ -164984,8 +157988,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9820, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9936, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -165003,10 +158007,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9848, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9964, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10023, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10139, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -165022,9 +158026,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10197, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10313, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10344, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10460, 0) } } @@ -165080,7 +158084,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10495, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10611, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -165089,11 +158093,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+10554, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+10670, zName) { goto exit_rename_table } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10560, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10676, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -165123,21 +158127,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10587, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10703, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10771, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10887, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+11076, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11092, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+11192, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11208, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11150, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11266, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -165145,7 +158149,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -165153,7 +158157,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11415, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11531, 0) goto exit_rename_table exit_rename_table: ; @@ -165170,7 +158174,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11428, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11544, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -165210,11 +158214,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11466, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11582, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11498, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11614, 0) return } if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -165230,10 +158234,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 64))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11525) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11641) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11584) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11700) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -165245,13 +158249,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11637) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11753) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11683) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11799) } } /* Modify the CREATE TABLE statement. */ @@ -165265,7 +158269,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11710, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11826, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -165293,7 +158297,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 && int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11856, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11972, libc.VaList(bp+16, zTab, zDb)) } } } @@ -165331,12 +158335,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12209, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12325, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12243, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12359, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -165351,7 +158355,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(104)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(120)) if !(pNew != 0) { goto exit_begin_add_column } @@ -165359,8 +158363,8 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnTabRef = uint32(1) (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) - (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(nAlloc)) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+12273, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(16)*uint64(uint32(nAlloc))) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+12389, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -165421,18 +158425,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 12292 + zType = __ccgo_ts + 12408 } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 12297 + zType = __ccgo_ts + 12413 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 12311 + v1 = __ccgo_ts + 12427 } else { - v1 = __ccgo_ts + 12328 + v1 = __ccgo_ts + 12444 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12346, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12462, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -165479,25 +158483,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12364, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12480, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1673, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1674, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -165509,11 +158501,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12385, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12567, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12501, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12683, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+11415, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+11531, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -165523,31 +158515,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -165564,16 +158531,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -165876,9 +158833,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -165989,11 +158946,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 12698 + v1 = __ccgo_ts + 12814 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12700, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12816, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -166064,30 +159021,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+12723, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+12839, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -166108,9 +159069,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -166126,15 +159086,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+12731, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+12847, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, uint64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, uint64(nSql)+uint64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*uint64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, uint64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*uint64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -166145,16 +159105,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, uint64(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = uint32(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = uint32(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -166171,18 +159131,18 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 12698 + v1 = __ccgo_ts + 12814 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+12737, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+12853, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = uint32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32(int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int64(zSql)) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(uint32(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(uint32(nOut)-(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint64(nOut-int64(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint64(nReplace)) @@ -166211,7 +159171,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, uint32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*32+16+4, uint32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -166521,7 +159481,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 32))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 32))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+32, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166663,7 +159623,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 32))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1673, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) + _renameColumnParseError(tls, context, __ccgo_ts+1674, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp+32) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -166788,7 +159748,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect libc.Xmemset(tls, bp+504, 0, uint64(56)) (*(*TNameContext)(unsafe.Pointer(bp + 504))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+504) @@ -166889,7 +159849,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*8))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1673, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1674, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -166971,7 +159931,7 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -167055,8 +160015,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { bp := tls.Alloc(480) defer tls.Free(480) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth var _ /* sNC at bp+424 */ TNameContext var _ /* sParse at bp+0 */ TParse @@ -167072,12 +160033,12 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = int32((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 48)) &= uint64(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { libc.Xmemset(tls, bp+424, 0, uint64(56)) @@ -167151,7 +160112,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) @@ -167168,7 +160129,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12742, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12858, libc.VaList(bp+432, int64((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int64(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -167223,23 +160184,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12364, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12480, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 12749 + v1 = __ccgo_ts + 12865 } else { - v1 = __ccgo_ts + 6979 + v1 = __ccgo_ts + 7067 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12761, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12877, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12789, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12905, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -167249,33 +160210,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1673, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1674, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12837, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+12958, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+13074, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -167289,7 +160250,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -167300,8 +160261,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -167362,27 +160323,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12976, + FzName: __ccgo_ts + 13092, }, 1: { FnArg: int16(7), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12997, + FzName: __ccgo_ts + 13113, }, 2: { FnArg: int16(7), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 13017, + FzName: __ccgo_ts + 13133, }, 3: { FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 13036, + FzName: __ccgo_ts + 13152, }, 4: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 13055, + FzName: __ccgo_ts + 13171, }, } @@ -167593,8 +160554,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13158, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = uint32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13274, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = uint32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -167604,10 +160570,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13181, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13297, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13211, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13327, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), int32(aRoot[i]), iDb) @@ -167639,15 +160605,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 13078, - FzCols: __ccgo_ts + 13091, + FzName: __ccgo_ts + 13194, + FzCols: __ccgo_ts + 13207, }, 1: { - FzName: __ccgo_ts + 13104, - FzCols: __ccgo_ts + 13117, + FzName: __ccgo_ts + 13220, + FzCols: __ccgo_ts + 13233, }, 2: { - FzName: __ccgo_ts + 13145, + FzName: __ccgo_ts + 13261, }, } @@ -167700,44 +160666,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - FanDLt uintptr - FanEq uintptr - FanLt uintptr - Fu struct { - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - Fdb uintptr - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -167861,7 +160789,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -167877,10 +160806,10 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) /* Allocate the space required for the StatAccum object */ - n = int32(uint64(136) + uint64(8)*uint64(nColUp)) /* StatAccum.anDLt */ - n = int32(uint64(n) + libc.Uint64FromInt64(8)*uint64(nColUp)) /* StatAccum.anEq */ + n = int64(uint64(136) + uint64(8)*uint64(nColUp)) /* StatAccum.anDLt */ + n = Ti64(uint64(n) + libc.Uint64FromInt64(8)*uint64(nColUp)) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint64(n) + (libc.Uint64FromInt64(8)*uint64(nColUp) + libc.Uint64FromInt64(48)*uint64(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*uint64(nColUp)*uint64(nCol+mxSample))) + n = Ti64(uint64(n) + (libc.Uint64FromInt64(8)*uint64(nColUp) + libc.Uint64FromInt64(48)*uint64(nCol+mxSample) + libc.Uint64FromInt64(8)*libc.Uint64FromInt32(3)*uint64(nColUp)*uint64(nCol+mxSample))) } p = _sqlite3DbMallocZero(tls, db, uint64(n)) if p == uintptr(0) { @@ -167890,7 +160819,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = uint64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*8)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -167949,7 +160878,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13229, + FzName: __ccgo_ts + 13345, } func init() { @@ -168323,7 +161252,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13239, + FzName: __ccgo_ts + 13355, } func init() { @@ -168373,7 +161302,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13249, libc.VaList(bp+72, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13365, libc.VaList(bp+72, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -168384,7 +161313,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13254, libc.VaList(bp+72, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13370, libc.VaList(bp+72, iVal)) goto _2 _2: ; @@ -168423,7 +161352,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+13260, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+32, __ccgo_ts+13376, libc.VaList(bp+72, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -168441,7 +161370,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13266, + FzName: __ccgo_ts + 13382, } func init() { @@ -168507,7 +161436,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+13275, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+13391, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -168516,12 +161445,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(104)+libc.Uint64FromInt32(13)) + pStat1 = _sqlite3DbMallocZero(tls, db, libc.Uint64FromInt64(120)+libc.Uint64FromInt32(13)) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*104 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+13078, uint64(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*120 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+13194, uint64(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -168723,7 +161652,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -168754,7 +161683,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13285, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13401, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -168845,7 +161774,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13285, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13401, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -168882,7 +161811,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -168915,11 +161844,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+13289) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+13405) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13293) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13409) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -169027,13 +161956,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -169048,7 +161970,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1673 + z = __ccgo_ts + 1674 } i = 0 for { @@ -169083,17 +162005,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+13297, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13413, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+13308, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13424, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, uint64(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+13318, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13434, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -169105,13 +162027,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -169472,11 +162387,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+13104, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+13220, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && int32((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+13330, __ccgo_ts+13399, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+13446, __ccgo_ts+13515, zDb) } return rc } @@ -169542,10 +162457,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+13078, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+13194, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && int32((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13451, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13567, libc.VaList(bp+24, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -169658,7 +162573,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+8020, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+8107, zName) == 0) } // C documentation @@ -169700,21 +162615,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1673 + zFile = __ccgo_ts + 1674 } if zName == uintptr(0) { - zName = __ccgo_ts + 1673 + zName = __ccgo_ts + 1674 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 192 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+5341) + *(*uintptr)(unsafe.Pointer(bp + 32)) = Xsqlite3_vfs_find(tls, __ccgo_ts+5429) if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+13492, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 32)), __ccgo_ts+13608, db, bp+40, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 40))) if pNewSchema != 0 { @@ -169745,7 +162660,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 136 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13495, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13611, libc.VaList(bp+56, *(*int32)(unsafe.Pointer(db + 136 + 7*4)))) goto attach_error } i = 0 @@ -169754,7 +162669,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13532, libc.VaList(bp+56, zName)) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13648, libc.VaList(bp+56, zName)) goto attach_error } goto _1 @@ -169772,7 +162687,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint64FromInt64(32)*libc.Uint64FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*uint64((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(32)*uint64(libc.Int64FromInt32(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb))) if aNew == uintptr(0) { return } @@ -169810,7 +162725,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13562, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13678, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -169818,7 +162733,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13591, 0) + *(*uintptr)(unsafe.Pointer(bp + 24)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13707, 0) rc = int32(SQLITE_ERROR) } } @@ -169862,10 +162777,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13687, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13803, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13708, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13824, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13734, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13850, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -170030,7 +162945,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13756, + FzName: __ccgo_ts + 13872, } func init() { @@ -170052,7 +162967,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13770, + FzName: __ccgo_ts + 13886, } func init() { @@ -170078,7 +162993,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13784, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13900, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -170112,7 +163027,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if int32((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 72)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13808, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13924, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 72)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 72))) @@ -170239,6 +163154,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -170311,9 +163228,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -170329,7 +163246,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13854, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13970, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -170357,11 +163274,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+13877, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13993, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+13883, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13999, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13889, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14005, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -170421,7 +163338,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName } else { - zCol = __ccgo_ts + 9401 + zCol = __ccgo_ts + 9488 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -170456,7 +163373,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13916, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14032, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -170493,47 +163410,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -170574,7 +163450,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = int32(uint64(24) * uint64((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 156 + v4 = pToplevel + 140 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*24 @@ -170672,7 +163548,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -170750,7 +163628,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -170764,7 +163642,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -170877,21 +163757,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+8020) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+8107) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7987+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8006+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7456+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7968) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8074+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8093+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7542+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+8055) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8006+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+7456) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8093+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FpSchema+8, __ccgo_ts+7542) } } } @@ -170921,12 +163801,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8006+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+7456) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8093+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+7542) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7987+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+7968) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8074+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema+8, __ccgo_ts+8055) } } } @@ -170964,7 +163844,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if int32((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+576, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+13931, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+14047, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -170974,7 +163854,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) } else { if int32((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && int32((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -170982,15 +163862,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 13939 + v1 = __ccgo_ts + 14055 } else { - v1 = __ccgo_ts + 13952 + v1 = __ccgo_ts + 14068 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8224, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8311, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8295, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8382, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -171028,12 +163908,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7456+7) == 0 { - return __ccgo_ts + 8006 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7542+7) == 0 { + return __ccgo_ts + 8093 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7968+7) == 0 { - return __ccgo_ts + 7987 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8055+7) == 0 { + return __ccgo_ts + 8074 } } return zName @@ -171157,9 +164037,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -171558,7 +164438,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+7456) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+7542) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -171590,7 +164470,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+8020, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+8107, zName) { break } goto _1 @@ -171648,13 +164528,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13966, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14082, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13983, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14099, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -171698,12 +164578,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*8))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*8))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1673, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1674, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14003, libc.VaList(bp+8, zName)) + if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14119, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -171739,23 +164619,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -171875,7 +164757,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -171918,9 +164800,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -171933,7 +164815,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14045, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14161, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -171949,9 +164831,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 12292 + v2 = __ccgo_ts + 12408 } else { - v2 = __ccgo_ts + 10554 + v2 = __ccgo_ts + 10670 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -171961,9 +164843,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 7968 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7456 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -171987,11 +164869,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 12292 + v4 = __ccgo_ts + 12408 } else { - v4 = __ccgo_ts + 10554 + v4 = __ccgo_ts + 10670 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14086, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14202, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -171999,11 +164881,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14107, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -172035,19 +164917,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid = v7 reg1 = v7 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot = v10 reg2 = v10 - v14 = pParse + 60 + v14 = pParse + 64 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -172067,15 +164959,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -172090,7 +164987,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -172151,7 +165048,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14142, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14258, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -172160,14 +165057,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 208)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+14176, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+196, __ccgo_ts+14292, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 196 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -172199,11 +165098,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(48) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 16)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -172214,7 +165113,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14196, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14312, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -172224,12 +165123,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+14219, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+14335, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+14226, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 16))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+14342, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 16))).Fn > uint32(0) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 16))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 16))).Fn-- @@ -172271,21 +165170,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, uint64((*(*TToken)(unsafe.Pointer(bp))).Fn)) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FhName) == int32(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*16))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14236, libc.VaList(bp+40, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14352, libc.VaList(bp+40, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, uint64(int64((*TTable)(unsafe.Pointer(p)).FnCol)+libc.Int64FromInt32(1))*uint64(16)) if aNew == uintptr(0) { @@ -172296,7 +165184,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*16 libc.Xmemset(tls, pCol, 0, uint64(16)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 16))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -172309,12 +165197,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 16))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 14 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 14 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint64((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint64(16)) + *(*Tu8)(unsafe.Pointer(p + 104 + uintptr(h))) = uint8((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) } // C documentation @@ -172486,10 +165383,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*16 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14262, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14378, libc.VaList(bp+80, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14307, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14423, 0) } else { libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -172547,7 +165444,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 14 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14348, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14464, 0) } } @@ -172575,8 +165472,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -172584,7 +165481,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14400, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14516, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_HasPrimaryKey) @@ -172603,21 +165500,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).FpExpr) _sqlite3StringToId(tls, pCExpr) if int32((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -172640,7 +165526,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14441, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14557, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -172668,8 +165554,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*32))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+112, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+256+16, int32(1)) } else { zStart++ for { @@ -172756,17 +165647,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*16 if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14497, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14613, 0) goto generated_done } if int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+14540, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+14656, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14548, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14664, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -172798,7 +165689,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14555, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14671, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -172939,9 +165830,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -172952,31 +165844,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 16 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1673 - zSep2 = __ccgo_ts + 14586 - zEnd = __ccgo_ts + 6480 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1674 + zSep2 = __ccgo_ts + 14702 + zEnd = __ccgo_ts + 6568 } else { - zSep = __ccgo_ts + 14588 - zSep2 = __ccgo_ts + 14592 - zEnd = __ccgo_ts + 14597 + zSep = __ccgo_ts + 14704 + zSep2 = __ccgo_ts + 14708 + zEnd = __ccgo_ts + 14713 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+14600, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+14716, uint64(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -172987,8 +165879,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, uint64(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -173001,17 +165894,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 16 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+4710, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, uint64(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1673, - 1: __ccgo_ts + 14614, - 2: __ccgo_ts + 14620, - 3: __ccgo_ts + 14625, - 4: __ccgo_ts + 14630, - 5: __ccgo_ts + 14620, + 0: __ccgo_ts + 1674, + 1: __ccgo_ts + 14730, + 2: __ccgo_ts + 14736, + 3: __ccgo_ts + 14741, + 4: __ccgo_ts + 14746, + 5: __ccgo_ts + 14736, } // C documentation @@ -173020,15 +165914,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = int32((libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * uint64(N)) - zExtra = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = (libc.Uint64FromInt64(8) + libc.Uint64FromInt64(2) + libc.Uint64FromInt64(2) + libc.Uint64FromInt32(1)) * uint64(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -173043,7 +165938,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint64(2) * uint64(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint64((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = uint16(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = uint16(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -173276,8 +166171,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab != 0 { - _sqlite3VdbeChangeP3(tls, v, (*TParse)(unsafe.Pointer(pParse)).Fu1.FaddrCrTab, int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -173377,7 +166282,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -173390,8 +166295,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*8)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*8)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -173421,7 +166326,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -173613,7 +166518,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(int32((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1673, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1674, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -173640,9 +166545,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*16 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf0>>4)) == COLTYPE_CUSTOM { if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14636, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1673))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14752, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1674))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14669, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14785, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -173663,11 +166568,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14696, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14812, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14746, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14862, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -173714,7 +166619,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14778, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14894, 0) return } } @@ -173748,16 +166653,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if int32((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 10554 - zType2 = __ccgo_ts + 14822 + zType = __ccgo_ts + 10670 + zType2 = __ccgo_ts + 14938 } else { /* A view */ - zType = __ccgo_ts + 12292 - zType2 = __ccgo_ts + 14828 + zType = __ccgo_ts + 12408 + zType2 = __ccgo_ts + 14944 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -173774,24 +166679,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 60 + v9 = pParse + 64 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 60 + v11 = pParse + 64 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -173839,13 +166749,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14949, libc.VaList(bp+48, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14848, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14964, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -173854,15 +166774,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14946, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15062, libc.VaList(bp+48, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14988, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15104, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+15022, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+15138, libc.VaList(bp+48, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -173880,7 +166800,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+11076) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+11192) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -173913,7 +166833,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 112)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15043, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15159, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -173930,7 +166850,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 48)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+112) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+12292, *(*uintptr)(unsafe.Pointer(bp + 112))) + _sqlite3FixInit(tls, bp+16, pParse, iDb, __ccgo_ts+12408, *(*uintptr)(unsafe.Pointer(bp + 112))) if _sqlite3FixSelect(tls, bp+16, pSelect) != 0 { goto create_view_fail } @@ -174027,7 +166947,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15079, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15195, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -174211,7 +167131,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15109, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15225, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -174224,7 +167144,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15124, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15240, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*32))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -174307,9 +167227,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+15191, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+15307, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13181, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13297, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -174350,7 +167270,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15205, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15321, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -174359,7 +167279,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15250, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15366, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -174394,11 +167314,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+15317, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+15433, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+8762, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+8849, int32(10)) == 0 { return 0 } return int32(1) @@ -174453,9 +167373,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName @@ -174488,18 +167408,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15438, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15350, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15466, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15500, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -174509,7 +167429,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13293, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13409, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -174557,19 +167477,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15416, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15532, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*16))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15479, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15595, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = int64(uint64(80) + uint64(nCol-libc.Int32FromInt32(1))*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) + nByte = int64(uint64(libc.UintptrFromInt32(0)+64) + uint64(nCol)*uint64(16) + uint64((*TToken)(unsafe.Pointer(pTo)).Fn) + uint64(1)) if pToCol != 0 { i = 0 for { @@ -174626,7 +167546,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15573, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15689, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*32))).FzEName)) goto fk_end } if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -174741,11 +167661,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -174767,7 +167687,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -174812,13 +167732,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -174841,23 +167761,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = int32((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(8)*uint64(nCol)+uint64(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(2)*uint64(int32(nCol)+libc.Int32FromInt32(1))+uint64(2)*uint64(nCol)+uint64(1)*uint64(nCol)+uint64(7))&uint64(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, uint64(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = int64((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(8)*uint64(nCol)+uint64(7))&uint64(^libc.Int32FromInt32(7)) + (uint64(2)*uint64(nCol+libc.Int32FromInt32(1))+uint64(2)*uint64(nCol)+uint64(1)*uint64(nCol)+uint64(7))&uint64(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, uint64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint64FromInt64(160)+libc.Uint64FromInt32(7))&uint64(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra pExtra += uintptr((libc.Uint64FromInt64(8)*uint64(nCol) + libc.Uint64FromInt32(7)) & uint64(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint64(2) * uint64(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint64(2) * uint64(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra pExtra += uintptr(uint64(2) * uint64(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra (*TIndex)(unsafe.Pointer(p)).FnColumn = uint16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = uint16(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = uint16(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -174886,11 +167806,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*32 + 16 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*32))).Ffg.FsortFlags if int32(sf) == 0 || int32(sf) == int32(3) { - v2 = __ccgo_ts + 15619 + v2 = __ccgo_ts + 15735 } else { - v2 = __ccgo_ts + 15625 + v2 = __ccgo_ts + 15741 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15630, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15746, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -174968,7 +167888,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15658, *(*uintptr)(unsafe.Pointer(bp + 96))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15774, *(*uintptr)(unsafe.Pointer(bp + 96))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -174978,7 +167898,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15664, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15780, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -174992,16 +167912,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15714, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15830, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15742, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15858, 0) goto exit_create_index } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15767, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15883, 0) goto exit_create_index } /* @@ -175022,19 +167942,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+15658, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+15774, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15801, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15917, libc.VaList(bp+136, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15835, libc.VaList(bp+136, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15951, libc.VaList(bp+136, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -175055,7 +167975,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+15859, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+15975, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -175073,9 +167993,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7968 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7456 + v2 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -175103,7 +168023,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+15658) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+15774) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -175135,7 +168055,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+104) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+104) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -175187,7 +168107,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if int32((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15882, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15998, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -175197,7 +168117,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -175207,8 +168127,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 3, 0x8) } if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -175286,7 +168206,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+100, libc.Uint32FromInt32(0), 5, 0x20) @@ -175334,7 +168254,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || int32((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15943, libc.VaList(bp+136, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16059, libc.VaList(bp+136, 0)) } if int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -175364,8 +168284,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15985, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16101, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -175378,7 +168298,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -175405,11 +168325,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1673 + v13 = __ccgo_ts + 1674 } else { - v13 = __ccgo_ts + 16002 + v13 = __ccgo_ts + 16118 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16010, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16126, libc.VaList(bp+136, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 96)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -175417,7 +168337,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+16030, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+16146, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -175425,7 +168345,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+16089, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+16205, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -175588,16 +168508,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16116, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16232, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 72))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 100))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16134, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16250, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -175605,9 +168525,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -175623,8 +168543,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+16207, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13289, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+16323, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13405, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -175697,12 +168617,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(16)) + pList = _sqlite3DbMallocZero(tls, db, uint64(libc.UintptrFromInt32(0)+8)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(16)+uint64((*TIdList)(unsafe.Pointer(pList)).FnId)*uint64(8)) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(libc.UintptrFromInt32(0)+8)+uint64((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -175814,13 +168734,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16267, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16383, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(88)+uint64(nAlloc-libc.Int64FromInt32(1))*uint64(80)) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(libc.UintptrFromInt32(0)+8)+uint64(nAlloc)*libc.Uint64FromInt64(80)) if pNew == uintptr(0) { return uintptr(0) } @@ -175901,7 +168821,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.UintptrFromInt32(0)+8)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(80)) if pList == uintptr(0) { return uintptr(0) } @@ -175951,7 +168871,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -176122,11 +169042,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 16303 + v1 = __ccgo_ts + 16419 } else { - v1 = __ccgo_ts + 16306 + v1 = __ccgo_ts + 16422 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16312, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16428, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -176325,7 +169245,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+16348, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+16464, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -176372,9 +169292,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 16354 + v1 = __ccgo_ts + 16470 } else { - v1 = __ccgo_ts + 16363 + v1 = __ccgo_ts + 16479 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -176406,9 +169326,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 16348, - 1: __ccgo_ts + 16370, - 2: __ccgo_ts + 16354, + 0: __ccgo_ts + 16464, + 1: __ccgo_ts + 16486, + 2: __ccgo_ts + 16470, } // C documentation @@ -176428,7 +169348,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16378, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16494, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -176453,7 +169373,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+13877, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+13993, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -176884,7 +169804,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+100, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16578, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16694, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -177766,11 +170684,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16611, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16727, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16640, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16756, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -177874,7 +170792,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -177931,7 +170849,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 136 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+16714, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16830, -int32(1)) return } if argc == int32(3) { @@ -179650,7 +172573,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+16747, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16863, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+8) @@ -179732,7 +172655,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))))) } // C documentation @@ -179804,32 +172727,32 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16792, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16908, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, int32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16800, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16916, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1434, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1435, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -179857,13 +172780,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16808, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 16924 + } else { + v2 = __ccgo_ts + 16928 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1674, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1675, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), uint64(n)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, uint64(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+16931, -int32(1)) + return +} + // C documentation // // /* @@ -179875,6 +172934,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -179885,7 +172948,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 136))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(int64(Xsqlite3_user_data(tls, context)))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), int32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if int32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -180096,7 +173159,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1673 + zPass = __ccgo_ts + 1674 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -180409,7 +173472,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 12698, + 0: __ccgo_ts + 12814, } // C documentation @@ -180421,8 +173484,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -180437,7 +173500,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, uint64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -180449,8 +173512,8 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if v != uintptr(0) { if j > 0 && nSep > 0 { @@ -180458,7 +173521,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n j += int64(nSep) } libc.Xmemcpy(tls, z+uintptr(j), v, uint64(k)) - j += k + j += int64(k) } } goto _2 @@ -180477,7 +173540,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1673) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1674) } // C documentation @@ -180523,7 +173586,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1673 + zIn = __ccgo_ts + 1674 } i = 0 for { @@ -180569,7 +173632,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+16811, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+16954, int32(4), libc.UintptrFromInt32(0)) } } @@ -180630,7 +173693,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+13916, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+14032, -int32(1)) return } if argc == int32(2) { @@ -180661,17 +173724,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -180740,7 +173792,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -180822,7 +173874,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+16691, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16807, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -180885,12 +173937,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -181152,7 +174198,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1673, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1674, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, int32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -181172,7 +174218,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+16816, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+16959, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -181201,8 +174247,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+16822, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16822, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+16965, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16965, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= uint32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= uint32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -181382,11 +174428,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -181490,7 +174536,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), int32(libc.Uint64FromInt64(7488)/libc.Uint64FromInt64(72))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), int32(libc.Uint64FromInt64(7632)/libc.Uint64FromInt64(72))) } /* @@ -181503,542 +174549,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row))), - FzName: __ccgo_ts + 16827, + FzName: __ccgo_ts + 16970, }, 1: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_compare))), - FzName: __ccgo_ts + 16847, + FzName: __ccgo_ts + 16990, }, 2: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr))), - FzName: __ccgo_ts + 16860, + FzName: __ccgo_ts + 17003, }, 3: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_affinity))), - FzName: __ccgo_ts + 16878, + FzName: __ccgo_ts + 17021, }, 4: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16887, + FzName: __ccgo_ts + 17030, }, 5: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 16895, + FzName: __ccgo_ts + 17038, }, 6: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 16895, + FzName: __ccgo_ts + 17038, }, 7: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16910, + FzName: __ccgo_ts + 17053, }, 8: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16936, + FzName: __ccgo_ts + 17079, }, 9: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 16961, + FzName: __ccgo_ts + 17104, }, 10: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 16970, + FzName: __ccgo_ts + 17113, }, 11: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_unlikely))), - FzName: __ccgo_ts + 16981, + FzName: __ccgo_ts + 17124, }, 12: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_sqlite_offset))), - FzName: __ccgo_ts + 16988, + FzName: __ccgo_ts + 17131, }, 13: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 17002, + FzName: __ccgo_ts + 17145, }, 14: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 17002, + FzName: __ccgo_ts + 17145, }, 15: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 17008, + FzName: __ccgo_ts + 17151, }, 16: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 17008, + FzName: __ccgo_ts + 17151, }, 17: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 17014, + FzName: __ccgo_ts + 17157, }, 18: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(3))), - FzName: __ccgo_ts + 17014, + FzName: __ccgo_ts + 17157, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17019, + FzName: __ccgo_ts + 17162, }, 20: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17019, + FzName: __ccgo_ts + 17162, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 17023, + FzName: __ccgo_ts + 17166, }, 22: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 17023, + FzName: __ccgo_ts + 17166, }, 23: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 17027, + FzName: __ccgo_ts + 17170, }, 24: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 17034, + FzName: __ccgo_ts + 17177, }, 25: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 17042, + FzName: __ccgo_ts + 17185, }, 26: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 17049, + FzName: __ccgo_ts + 17192, }, 27: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17062, + FzName: __ccgo_ts + 17205, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17068, + FzName: __ccgo_ts + 17211, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17075, + FzName: __ccgo_ts + 17218, }, 30: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17082, + FzName: __ccgo_ts + 17225, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17233, }, 32: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17095, + FzName: __ccgo_ts + 17238, }, 33: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17099, + FzName: __ccgo_ts + 17242, }, 34: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17099, + FzName: __ccgo_ts + 17242, }, 35: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17105, + FzName: __ccgo_ts + 17248, }, 36: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17111, + FzName: __ccgo_ts + 17254, }, 37: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17117, + FzName: __ccgo_ts + 17260, }, 38: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17121, + FzName: __ccgo_ts + 17264, }, 39: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17121, + FzName: __ccgo_ts + 17264, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17127, + FzName: __ccgo_ts + 17270, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17134, + FzName: __ccgo_ts + 17277, }, 42: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17144, + FzName: __ccgo_ts + 17287, }, 43: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17151, + FzName: __ccgo_ts + 17294, }, 44: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17158, + FzName: __ccgo_ts + 17301, }, 45: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17169, + FzName: __ccgo_ts + 17312, }, 46: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17176, + FzName: __ccgo_ts + 17319, }, 47: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17191, + FzName: __ccgo_ts + 17334, }, 48: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17208, + FzName: __ccgo_ts + 17351, }, 49: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17219, + FzName: __ccgo_ts + 17362, }, 50: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17225, + FnArg: int16(1), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17369, }, 51: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17243, + FnArg: int16(1), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 17375, }, 52: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17251, + FzName: __ccgo_ts + 17388, }, 53: { - FnArg: int16(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17265, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17406, }, 54: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17273, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17414, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17282, + FzName: __ccgo_ts + 17428, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17282, + FzName: __ccgo_ts + 17436, }, 57: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17289, + FzName: __ccgo_ts + 17445, }, 58: { FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17289, + FzName: __ccgo_ts + 17445, }, 59: { + FnArg: int16(2), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17452, + }, + 60: { + FnArg: int16(3), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17452, + }, + 61: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17299, + FzName: __ccgo_ts + 17462, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17303, + FzName: __ccgo_ts + 17466, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17309, + FzName: __ccgo_ts + 17472, }, - 62: { + 64: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17313, + FzName: __ccgo_ts + 17476, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17313, + FzName: __ccgo_ts + 17476, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17319, + FzName: __ccgo_ts + 17482, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17319, + FzName: __ccgo_ts + 17482, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17332, + FzName: __ccgo_ts + 17495, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 17343, + FzName: __ccgo_ts + 17506, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 16822, + FzName: __ccgo_ts + 16965, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 16822, - }, - 70: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17348, - }, - 71: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1246, + FzName: __ccgo_ts + 16965, }, 72: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1254, + FzName: __ccgo_ts + 17511, }, 73: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17353, + FzName: __ccgo_ts + 1247, }, 74: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17359, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1255, }, 75: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 17362, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17516, }, 76: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(1))), - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17522, }, 77: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(int64(libc.Int32FromInt32(2))), - FzName: __ccgo_ts + 17372, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 17525, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17362, + FpUserData: uintptr(int64(libc.Int32FromInt32(1))), + FzName: __ccgo_ts + 17529, }, 79: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17377, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(int64(libc.Int32FromInt32(2))), + FzName: __ccgo_ts + 17535, }, 80: { FnArg: int16(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17381, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17525, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17385, + FzName: __ccgo_ts + 17540, }, 82: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17391, + FzName: __ccgo_ts + 17544, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17395, + FzName: __ccgo_ts + 17548, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17400, + FzName: __ccgo_ts + 17554, }, 85: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17405, + FzName: __ccgo_ts + 17558, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17410, + FzName: __ccgo_ts + 17563, }, 87: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17416, + FzName: __ccgo_ts + 17568, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17420, + FzName: __ccgo_ts + 17573, }, 89: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17424, + FzName: __ccgo_ts + 17579, }, 90: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17428, + FzName: __ccgo_ts + 17583, }, 91: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17433, + FzName: __ccgo_ts + 17587, }, 92: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17438, + FzName: __ccgo_ts + 17591, }, 93: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17443, + FzName: __ccgo_ts + 17596, }, 94: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17449, + FzName: __ccgo_ts + 17601, }, 95: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17455, + FzName: __ccgo_ts + 17606, }, 96: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17461, + FzName: __ccgo_ts + 17612, }, 97: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17466, + FzName: __ccgo_ts + 17618, }, 98: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17474, + FzName: __ccgo_ts + 17624, }, 99: { + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17482, + FzName: __ccgo_ts + 17629, }, 100: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17485, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17637, }, 101: { + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17645, + }, + 102: { + FnArg: int16(1), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17648, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 8165, + FzName: __ccgo_ts + 8252, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 17490, + FzName: __ccgo_ts + 17653, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(int64(libc.Int32FromInt32(INLINEFUNC_iif))), - FzName: __ccgo_ts + 17494, + FzName: __ccgo_ts + 17657, }, } @@ -182097,109 +175154,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 3480)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 3552)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 3624)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 3840)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 3912)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 3984)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 4128)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4200)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4280)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4288)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 4296)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4352)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4360)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 4368)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4272)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 4344)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 4416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4424)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 4432)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 4440)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4488)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4496)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 4512)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4560)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 4568)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4576)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 4584)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 4632)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4640)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4648)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4656)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 4704)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 4712)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4720)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 4728)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 4776)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 4784)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 4792)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 4800)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 4848)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4856)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4864)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4872)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 4920)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 4928)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 4936)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 4944)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 4992)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 5048)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5120)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5064)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5136)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 5192)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5208)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5264)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 5280)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5336)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 5352)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 5408)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 5424)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 5496)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5568)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 5640)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 5696)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 5768)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 5712)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5784)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 5840)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 5856)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 5912)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 5928)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 5984)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 6000)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6056)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 6072)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6128)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 6144)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 6200)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 6216)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 6272)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 6288)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 6344)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 6360)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 6416)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 6432)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 6488)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 6504)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 6560)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 6576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 6632)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 6648)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 6704)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 6720)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 6776)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 6792)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 6848)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 6864)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 6920)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 6936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 6992)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 7008)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7064)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 7080)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7136)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 7152)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7208)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 7224)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 7296)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 7368)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 7440)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7512)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 7584)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -182516,7 +175575,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17497, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17660, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -183340,7 +176399,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -183627,11 +176686,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 8031, + Fz: __ccgo_ts + 8118, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 32)) = TToken{ - Fz: __ccgo_ts + 8027, + Fz: __ccgo_ts + 8114, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { @@ -183695,7 +176754,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+6615) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+6703) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -184159,7 +177218,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 36 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | int32((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 40)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*16))).FcolFlags)) } return WRC_Continue } @@ -184277,7 +177336,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9658, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9745, libc.VaList(bp+56, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -184343,11 +177402,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 60 + v3 = pToplevel + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 60)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 64)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -184672,7 +177731,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -184686,7 +177745,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -184721,7 +177780,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 72)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -184734,7 +177793,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -184861,27 +177920,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(160) defer tls.Free(160) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+112 */ int32 var _ /* sNC at bp+56 */ TNameContext var _ /* tmask at bp+48 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -184962,7 +178021,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -184998,44 +178057,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) != int32(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17542, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17705, libc.VaList(bp+128, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17583, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17746, libc.VaList(bp+128, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 8 + uintptr(i)*8))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -185057,31 +178100,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+17615, libc.VaList(bp+128, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+17778, libc.VaList(bp+128, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 60 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 64 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -185105,10 +178148,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 56 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 60 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -185149,8 +178192,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -185167,28 +178210,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17623, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17786, libc.VaList(bp+128, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17675, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17838, libc.VaList(bp+128, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -185301,18 +178344,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -185322,13 +178365,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 48))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } } } @@ -185339,14 +178382,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -185363,16 +178406,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&uint32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -185483,11 +178526,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, uint16(v23)) + _sqlite3VdbeChangeP5(tls, v, uint16(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 112)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -185546,7 +178589,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17767) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17930) } goto insert_cleanup insert_cleanup: @@ -185669,33 +178712,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [8]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -185942,7 +178958,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+13877, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+13993, libc.VaList(bp+64, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == int32('/') || int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == int32('\\'))) { @@ -188176,7 +180872,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17817, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17980, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -188196,7 +180892,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17821, uint64(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17984, uint64(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -188208,7 +180904,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17827, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17990, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -188223,7 +180919,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+17870, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+18033, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -188254,7 +180950,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17902, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+18065, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -188263,7 +180959,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 17781, + 0: __ccgo_ts + 17944, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -188332,14 +181028,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -188354,7 +181045,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -188372,7 +181063,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { break } goto _1 @@ -188387,7 +181078,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -188397,6 +181088,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -188408,7 +181101,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -188420,7 +181113,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*8)) n++ @@ -188496,7 +181189,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+17939, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+18102, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -188550,63 +181243,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 6871, - 1: __ccgo_ts + 17978, - 2: __ccgo_ts + 10554, - 3: __ccgo_ts + 17982, - 4: __ccgo_ts + 17987, - 5: __ccgo_ts + 17990, - 6: __ccgo_ts + 18000, - 7: __ccgo_ts + 18010, - 8: __ccgo_ts + 18016, - 9: __ccgo_ts + 18020, - 10: __ccgo_ts + 18025, - 11: __ccgo_ts + 18030, - 12: __ccgo_ts + 18038, - 13: __ccgo_ts + 18049, - 14: __ccgo_ts + 18052, - 15: __ccgo_ts + 18059, - 16: __ccgo_ts + 18020, - 17: __ccgo_ts + 18025, - 18: __ccgo_ts + 18066, - 19: __ccgo_ts + 18071, - 20: __ccgo_ts + 18074, - 21: __ccgo_ts + 18081, - 22: __ccgo_ts + 18016, - 23: __ccgo_ts + 18020, - 24: __ccgo_ts + 18087, - 25: __ccgo_ts + 18092, - 26: __ccgo_ts + 18097, - 27: __ccgo_ts + 18020, - 28: __ccgo_ts + 18101, - 29: __ccgo_ts + 18025, - 30: __ccgo_ts + 18109, - 31: __ccgo_ts + 18113, - 32: __ccgo_ts + 18118, - 33: __ccgo_ts + 13293, - 34: __ccgo_ts + 13289, - 35: __ccgo_ts + 18124, - 36: __ccgo_ts + 18129, - 37: __ccgo_ts + 18134, - 38: __ccgo_ts + 17978, - 39: __ccgo_ts + 18020, - 40: __ccgo_ts + 18139, - 41: __ccgo_ts + 18146, - 42: __ccgo_ts + 18153, - 43: __ccgo_ts + 10554, - 44: __ccgo_ts + 18161, - 45: __ccgo_ts + 6874, - 46: __ccgo_ts + 18167, - 47: __ccgo_ts + 17978, - 48: __ccgo_ts + 18020, - 49: __ccgo_ts + 18172, - 50: __ccgo_ts + 18177, - 51: __ccgo_ts + 17362, - 52: __ccgo_ts + 18182, - 53: __ccgo_ts + 18195, - 54: __ccgo_ts + 18204, - 55: __ccgo_ts + 18211, - 56: __ccgo_ts + 18222, + 0: __ccgo_ts + 6959, + 1: __ccgo_ts + 18141, + 2: __ccgo_ts + 10670, + 3: __ccgo_ts + 18145, + 4: __ccgo_ts + 18150, + 5: __ccgo_ts + 18153, + 6: __ccgo_ts + 18163, + 7: __ccgo_ts + 18173, + 8: __ccgo_ts + 18179, + 9: __ccgo_ts + 18183, + 10: __ccgo_ts + 18188, + 11: __ccgo_ts + 18193, + 12: __ccgo_ts + 18201, + 13: __ccgo_ts + 18212, + 14: __ccgo_ts + 18215, + 15: __ccgo_ts + 18183, + 16: __ccgo_ts + 18222, + 17: __ccgo_ts + 18188, + 18: __ccgo_ts + 18230, + 19: __ccgo_ts + 18234, + 20: __ccgo_ts + 18239, + 21: __ccgo_ts + 18245, + 22: __ccgo_ts + 18183, + 23: __ccgo_ts + 18188, + 24: __ccgo_ts + 18252, + 25: __ccgo_ts + 18257, + 26: __ccgo_ts + 18260, + 27: __ccgo_ts + 18267, + 28: __ccgo_ts + 18179, + 29: __ccgo_ts + 18183, + 30: __ccgo_ts + 18273, + 31: __ccgo_ts + 18278, + 32: __ccgo_ts + 18283, + 33: __ccgo_ts + 18141, + 34: __ccgo_ts + 18183, + 35: __ccgo_ts + 18287, + 36: __ccgo_ts + 18294, + 37: __ccgo_ts + 18301, + 38: __ccgo_ts + 13409, + 39: __ccgo_ts + 13405, + 40: __ccgo_ts + 18309, + 41: __ccgo_ts + 18314, + 42: __ccgo_ts + 18319, + 43: __ccgo_ts + 10670, + 44: __ccgo_ts + 18324, + 45: __ccgo_ts + 6962, + 46: __ccgo_ts + 18330, + 47: __ccgo_ts + 18335, + 48: __ccgo_ts + 17525, + 49: __ccgo_ts + 18340, + 50: __ccgo_ts + 18141, + 51: __ccgo_ts + 18183, + 52: __ccgo_ts + 18353, + 53: __ccgo_ts + 18358, + 54: __ccgo_ts + 18367, + 55: __ccgo_ts + 18374, + 56: __ccgo_ts + 18385, } // C documentation @@ -188625,343 +181318,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 18230, + FzName: __ccgo_ts + 18393, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 18245, + FzName: __ccgo_ts + 18408, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 18260, + FzName: __ccgo_ts + 18423, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 18272, + FzName: __ccgo_ts + 18435, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 18288, + FzName: __ccgo_ts + 18451, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 18211, + FzName: __ccgo_ts + 18374, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 18301, + FzName: __ccgo_ts + 18464, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 18313, + FzName: __ccgo_ts + 18476, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 18333, + FzName: __ccgo_ts + 18496, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 18349, + FzName: __ccgo_ts + 18512, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 18370, + FzName: __ccgo_ts + 18533, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 18385, + FzName: __ccgo_ts + 18548, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 18401, + FzName: __ccgo_ts + 18564, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 18415, + FzName: __ccgo_ts + 18578, FePragTyp: uint8(PragTyp_DATA_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 14: { - FzName: __ccgo_ts + 18436, + FzName: __ccgo_ts + 18599, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 15: { - FzName: __ccgo_ts + 18449, + FzName: __ccgo_ts + 18612, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 16: { - FzName: __ccgo_ts + 18463, + FzName: __ccgo_ts + 18626, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 17: { - FzName: __ccgo_ts + 18482, + FzName: __ccgo_ts + 18645, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 18: { - FzName: __ccgo_ts + 18501, + FzName: __ccgo_ts + 18664, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 19: { - FzName: __ccgo_ts + 18524, + FzName: __ccgo_ts + 18687, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 20: { - FzName: __ccgo_ts + 18533, + FzName: __ccgo_ts + 18696, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 21: { - FzName: __ccgo_ts + 18551, + FzName: __ccgo_ts + 18714, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 22: { - FzName: __ccgo_ts + 18568, + FzName: __ccgo_ts + 18731, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 23: { - FzName: __ccgo_ts + 18581, + FzName: __ccgo_ts + 18744, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 24: { - FzName: __ccgo_ts + 18596, + FzName: __ccgo_ts + 18759, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 25: { - FzName: __ccgo_ts + 18614, + FzName: __ccgo_ts + 18777, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 26: { - FzName: __ccgo_ts + 18624, + FzName: __ccgo_ts + 18787, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 27: { - FzName: __ccgo_ts + 18638, + FzName: __ccgo_ts + 18801, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 28: { - FzName: __ccgo_ts + 18654, + FzName: __ccgo_ts + 18817, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 29: { - FzName: __ccgo_ts + 18679, + FzName: __ccgo_ts + 18842, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 30: { - FzName: __ccgo_ts + 18698, + FzName: __ccgo_ts + 18861, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 31: { - FzName: __ccgo_ts + 18709, + FzName: __ccgo_ts + 18872, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 32: { - FzName: __ccgo_ts + 18720, + FzName: __ccgo_ts + 18883, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 33: { - FzName: __ccgo_ts + 18732, + FzName: __ccgo_ts + 18895, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 34: { - FzName: __ccgo_ts + 18748, + FzName: __ccgo_ts + 18911, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 18761, + FzName: __ccgo_ts + 18924, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 36: { - FzName: __ccgo_ts + 18780, + FzName: __ccgo_ts + 18943, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 37: { - FzName: __ccgo_ts + 18799, + FzName: __ccgo_ts + 18962, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 18812, + FzName: __ccgo_ts + 18975, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 39: { - FzName: __ccgo_ts + 18827, + FzName: __ccgo_ts + 18990, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 18837, + FzName: __ccgo_ts + 19000, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 18849, + FzName: __ccgo_ts + 19012, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 18858, + FzName: __ccgo_ts + 19021, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 43: { - FzName: __ccgo_ts + 18869, + FzName: __ccgo_ts + 19032, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 44: { - FzName: __ccgo_ts + 18879, + FzName: __ccgo_ts + 19042, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 18891, + FzName: __ccgo_ts + 19054, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 46: { - FzName: __ccgo_ts + 18902, + FzName: __ccgo_ts + 19065, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 47: { - FzName: __ccgo_ts + 18914, + FzName: __ccgo_ts + 19077, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 48: { - FzName: __ccgo_ts + 18931, + FzName: __ccgo_ts + 19094, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 49: { - FzName: __ccgo_ts + 18950, + FzName: __ccgo_ts + 19113, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 50: { - FzName: __ccgo_ts + 18976, + FzName: __ccgo_ts + 19139, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 51: { - FzName: __ccgo_ts + 18991, + FzName: __ccgo_ts + 19154, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 19005, + FzName: __ccgo_ts + 19168, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 53: { - FzName: __ccgo_ts + 19024, + FzName: __ccgo_ts + 19187, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 19038, + FzName: __ccgo_ts + 19201, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 19054, + FzName: __ccgo_ts + 19217, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 56: { - FzName: __ccgo_ts + 19066, + FzName: __ccgo_ts + 19229, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 19077, + FzName: __ccgo_ts + 19240, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 58: { - FzName: __ccgo_ts + 19088, + FzName: __ccgo_ts + 19251, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -188969,45 +181662,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 19100, + FzName: __ccgo_ts + 19263, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 19111, + FzName: __ccgo_ts + 19274, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 19132, + FzName: __ccgo_ts + 19295, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 19140, + FzName: __ccgo_ts + 19303, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 63: { - FzName: __ccgo_ts + 19155, + FzName: __ccgo_ts + 19318, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 64: { - FzName: __ccgo_ts + 19168, + FzName: __ccgo_ts + 19331, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 19187, + FzName: __ccgo_ts + 19350, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 66: { - FzName: __ccgo_ts + 19202, + FzName: __ccgo_ts + 19365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -189025,7 +181718,7 @@ var _aPragmaName = [67]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -189133,10 +181826,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+5171) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+5259) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19218) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19381) { return PAGER_LOCKINGMODE_NORMAL } } @@ -189154,13 +181847,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+9714) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+9801) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19225) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19388) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19230) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19393) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -189183,10 +181876,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+18172) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18353) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+19242) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+19405) == 0 { return int32(2) } else { return 0 @@ -189208,7 +181901,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19249, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19412, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpBt) @@ -189338,15 +182031,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch int32(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 19311 + zName = __ccgo_ts + 19474 case int32(OE_SetDflt): - zName = __ccgo_ts + 19320 + zName = __ccgo_ts + 19483 case int32(OE_Cascade): - zName = __ccgo_ts + 19332 + zName = __ccgo_ts + 19495 case int32(OE_Restrict): - zName = __ccgo_ts + 19340 + zName = __ccgo_ts + 19503 default: - zName = __ccgo_ts + 19349 + zName = __ccgo_ts + 19512 break } return zName @@ -189367,12 +182060,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 19359, - 1: __ccgo_ts + 19366, - 2: __ccgo_ts + 19374, - 3: __ccgo_ts + 19378, - 4: __ccgo_ts + 19242, - 5: __ccgo_ts + 19387, + 0: __ccgo_ts + 19522, + 1: __ccgo_ts + 19529, + 2: __ccgo_ts + 19537, + 3: __ccgo_ts + 19541, + 4: __ccgo_ts + 19405, + 5: __ccgo_ts + 19550, } // C documentation @@ -189434,15 +182127,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 19412 + zType = __ccgo_ts + 19575 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 19414 + zType = __ccgo_ts + 19577 } else { - zType = __ccgo_ts + 9113 + zType = __ccgo_ts + 9200 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19416, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19579, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -189451,9 +182144,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 19391, - 2: __ccgo_ts + 19396, - 3: __ccgo_ts + 19404, + 1: __ccgo_ts + 19554, + 2: __ccgo_ts + 19559, + 3: __ccgo_ts + 19567, } // C documentation @@ -189553,7 +182246,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19423, libc.VaList(bp+176, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19586, libc.VaList(bp+176, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -189596,7 +182289,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4710, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4829, libc.VaList(bp+176, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 8)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -189641,7 +182334,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint64FromInt64(36)/libc.Uint64FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -189700,7 +182393,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19427) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19590) == 0 { b = int32(2) } else { b = int32(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -189743,7 +182436,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 40)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -189771,7 +182464,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 19218 + zRet = __ccgo_ts + 19381 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -189799,7 +182492,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 5171 + zRet = __ccgo_ts + 5259 } _returnSingleText(tls, v, zRet) break @@ -190089,7 +182782,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+72) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 72)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19432, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19595, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -190099,7 +182792,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+176, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+176, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -190128,14 +182821,14 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+76) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 76)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19432, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19595, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } } Xsqlite3_free(tls, Xsqlite3_data_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_data_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+176, zRight)) + Xsqlite3_data_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+176, zRight)) } else { Xsqlite3_data_directory = uintptr(0) } @@ -190157,7 +182850,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(int32((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19457, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19620, 0) } else { if iDb != int32(1) { iLevel = (int32(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -190189,8 +182882,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 48)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19510) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19673) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -190270,9 +182964,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 19516 + v14 = __ccgo_ts + 19679 } else { - v14 = __ccgo_ts + 19524 + v14 = __ccgo_ts + 19687 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 8))&0xf>>0)) != 0 { v15 = int32(1) @@ -190284,7 +182978,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1673), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+176, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1674), v15, v16, k, isHidden)) goto _12 _12: ; @@ -190343,7 +183037,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19531, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19694, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 80)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+80, uintptr(0)) @@ -190351,7 +183045,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1644, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FpSchema + 8 @@ -190373,19 +183067,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 12292 + zType = __ccgo_ts + 12408 } else { if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 14540 + zType = __ccgo_ts + 14656 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 19547 + zType = __ccgo_ts + 19710 } else { - zType = __ccgo_ts + 10554 + zType = __ccgo_ts + 10670 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19554, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19717, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*32))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -190432,9 +183126,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*16))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19561, libc.VaList(bp+176, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19724, libc.VaList(bp+176, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+19566, libc.VaList(bp+176, int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+19729, libc.VaList(bp+176, int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*8)), libc.BoolInt32(i1 < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -190458,11 +183152,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 19571, - 1: __ccgo_ts + 19573, - 2: __ccgo_ts + 18049, + 0: __ccgo_ts + 19734, + 1: __ccgo_ts + 19736, + 2: __ccgo_ts + 18212, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19575, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(int32((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19738, libc.VaList(bp+176, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(int32((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -190481,7 +183175,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19581, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19744, libc.VaList(bp+176, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*32))).FpBt))) goto _24 _24: ; @@ -190498,7 +183192,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19585, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19748, libc.VaList(bp+176, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -190548,7 +183242,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9113, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9200, libc.VaList(bp+176, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -190560,7 +183254,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < int32(libc.Uint64FromInt64(1608)/libc.Uint64FromInt64(24))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9113, libc.VaList(bp+176, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9200, libc.VaList(bp+176, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -190586,7 +183280,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19588, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+19597)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19751, libc.VaList(bp+176, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FiFrom)*16))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 64 + uintptr(j2)*16))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 45))), __ccgo_ts+19760)) goto _32 _32: ; @@ -190600,8 +183294,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(4) - v34 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(4) + v34 = pParse + 64 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -190727,7 +183421,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+19602, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+19765, libc.VaList(bp+176, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 96))) @@ -190823,7 +183517,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -190918,7 +183612,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, uint16(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+19606, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+19769, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*32))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -190929,7 +183623,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19630) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19793) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -191065,7 +183759,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 108)), 0, r2, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+19659, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+19822, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -191127,7 +183821,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 108)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -191149,7 +183843,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19695, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19858, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -191162,7 +183856,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19715, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19878, libc.VaList(bp+176, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 8))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -191170,7 +183864,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19737, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19900, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -191181,10 +183875,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 108)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+19760, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+19923, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19762, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19925, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*16))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -191218,7 +183912,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19782, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19945, libc.VaList(bp+176, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -191242,9 +183936,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 112))+j4, ckUniq, r1, int32((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19812) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19975) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19817) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19980) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -191257,9 +183951,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 112))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+int32((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19838) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+20001) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19874) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20037) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -191287,9 +183981,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19812) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19975) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19885) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20048) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -191317,7 +184011,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 112))+j4, uniqOk, r1, int32((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19912) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+20075) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -191414,7 +184108,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 104)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*24))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 19939 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*24 + 16)) = __ccgo_ts + 20102 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*24))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*24 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -191493,7 +184187,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20000, libc.VaList(bp+176, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20163, libc.VaList(bp+176, zRight)) } } } @@ -191598,13 +184292,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19225) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19388) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20025) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20188) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19378) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19541) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -191739,7 +184433,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 56 + v70 = pParse + 60 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -191769,7 +184463,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+7960, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+8047, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -191831,7 +184525,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20033, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20196, libc.VaList(bp+176, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -192104,34 +184798,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19942, + FzName: __ccgo_ts + 20105, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19947, + FzName: __ccgo_ts + 20110, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19953, + FzName: __ccgo_ts + 20116, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19962, + FzName: __ccgo_ts + 20125, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19971, + FzName: __ccgo_ts + 20134, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19979, + FzName: __ccgo_ts + 20142, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19987, + FzName: __ccgo_ts + 20150, }, 7: { - FzName: __ccgo_ts + 19994, + FzName: __ccgo_ts + 20157, }, 8: {}, } @@ -192188,25 +184882,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -192227,14 +184902,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+32, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20051) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20214) i = 0 j = int32((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < int32((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20066, libc.VaList(bp+240, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20229, libc.VaList(bp+240, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -192243,19 +184918,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20073, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20236, libc.VaList(bp+240, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20079) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20242) j++ } if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20091) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20254) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6568, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+32) if rc == SQLITE_OK { @@ -192270,7 +184945,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = uint8(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+240, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -192451,7 +185126,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+40, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+40, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + uintptr(j)*8)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -192463,13 +185138,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 136 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20106) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20269) if *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20114, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20277, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24 + 1*8)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 24)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20118, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20281, libc.VaList(bp+40, *(*uintptr)(unsafe.Pointer(pCsr + 24)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -192478,7 +185153,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+8, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+40, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -192604,24 +185279,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+20152, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+20315, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*8)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*8)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*8)) } else { - v1 = __ccgo_ts + 6482 + v1 = __ccgo_ts + 6570 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20180, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20343, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20211, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20374, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -192629,9 +185304,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 20122, - 1: __ccgo_ts + 20129, - 2: __ccgo_ts + 20141, + 0: __ccgo_ts + 20285, + 1: __ccgo_ts + 20292, + 2: __ccgo_ts + 20304, } // C documentation @@ -192707,7 +185382,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), db+192) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15985) + _corruptSchema(tls, pData, argv, __ccgo_ts+16101) } } libc.SetBitFieldPtr8Uint32(db+192+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -192740,11 +185415,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+20219) + _corruptSchema(tls, pData, argv, __ccgo_ts+20382) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8)), pIndex+88) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15985) + _corruptSchema(tls, pData, argv, __ccgo_ts+16101) } } } @@ -192783,18 +185458,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 10554 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 10670 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7968 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7456 + v2 = __ccgo_ts + 7542 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 9626 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20232 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 9713 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20395 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 72))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 72))).FiDb = iDb @@ -192878,7 +185553,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 48)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+13591) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+13707) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192904,7 +185579,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+20304) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+20467) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192919,7 +185594,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 72))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20328, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20491, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+72, uintptr(0)) @@ -193215,7 +185890,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -193228,9 +185903,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -193248,13 +185923,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, pParse+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1644, 0) } } @@ -193277,7 +185952,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+232)-uint64(libc.UintptrFromInt32(0)+8)) + libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+8)), 0, uint64(libc.UintptrFromInt32(0)+192)-uint64(libc.UintptrFromInt32(0)+8)) libc.Xmemset(tls, bp+uintptr(uint64(libc.UintptrFromInt32(0)+288)), 0, libc.Uint64FromInt64(424)-uint64(libc.UintptrFromInt32(0)+288)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp @@ -193288,7 +185963,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1644, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -193337,7 +186012,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*32))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+20362, libc.VaList(bp+432, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+20525, libc.VaList(bp+432, zDb)) goto end_prepare } } @@ -193353,7 +186028,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 136 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+20392, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+20555, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -193376,10 +186051,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+44, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 44))&0x8>>3)) != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -193387,7 +186062,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+4710, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+4829, libc.VaList(bp+432, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -193417,7 +186092,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -193551,7 +186226,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -193673,15 +186348,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -193717,21 +186383,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -193811,7 +186462,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 148 + v3 = pParse + 132 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = uint32(v2) @@ -193819,7 +186470,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -193975,15 +186626,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 12698 - zSp2 = __ccgo_ts + 12698 + zSp1 = __ccgo_ts + 12814 + zSp2 = __ccgo_ts + 12814 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20411, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20574, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -194040,25 +186691,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = int32(*(*Tu8)(unsafe.Pointer(pTab + 104 + uintptr(uint64(h)%uint64(16))))) + if int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == int32(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FhName) == int32(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*16))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 16 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -194190,13 +186844,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 52)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^uint32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(libc.Int32FromInt32(EP_InnerON)) } } if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^uint32(libc.Int32FromInt32(EP_CanBeNull)) } if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 32)) != 0 { @@ -194274,7 +186928,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if int32((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 64)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20441, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20604, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -194324,12 +186978,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 8 + uintptr(j)*8))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20491, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20654, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*80, *(*int32)(unsafe.Pointer(bp + 4))) - if int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -194344,9 +186998,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= uint32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 24 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*80 + 64)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20555, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20718, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -194356,6 +187011,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*80))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= uint32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -194390,7 +187052,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 8165, + Fz: __ccgo_ts + 8252, Fn: uint32(8), } @@ -194407,13 +187069,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -194438,7 +187093,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -194483,7 +187138,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nBase + *(*int32)(unsafe.Pointer(pParse + 64)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -194507,7 +187162,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -194528,7 +187183,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -194651,7 +187306,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -194778,10 +187433,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -194789,7 +187444,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 60)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 64)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -194966,7 +187621,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20592, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20755, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -195077,8 +187732,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = int32(uint64(N+X)*(libc.Uint64FromInt64(8)+libc.Uint64FromInt32(1)) - uint64(8)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(40)+uint64(nExtra)) + nExtra = int32(uint64(N+X) * (libc.Uint64FromInt64(8) + libc.Uint64FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(libc.UintptrFromInt32(0)+32)+uint64(libc.Int32FromInt32(0))*libc.Uint64FromInt64(8)+uint64(nExtra)) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 32 + uintptr(N+X)*8 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = uint16(N) @@ -195086,7 +187741,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*40, 0, uint64(nExtra)) + libc.Xmemset(tls, p+32, 0, uint64(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -195171,13 +187826,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 20612 + z = __ccgo_ts + 20775 case int32(TK_INTERSECT): - z = __ccgo_ts + 20622 + z = __ccgo_ts + 20785 case int32(TK_EXCEPT): - z = __ccgo_ts + 20632 + z = __ccgo_ts + 20795 default: - z = __ccgo_ts + 20639 + z = __ccgo_ts + 20802 break } return z @@ -195198,7 +187853,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20645, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20808, libc.VaList(bp+8, zUsage)) } /* @@ -195235,13 +187890,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 20668 + v1 = __ccgo_ts + 20831 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20682, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20845, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20713, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20876, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -195265,11 +187920,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 56 + v5 = pParse + 60 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -195484,8 +188139,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1147 - *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 18161 + zType = __ccgo_ts + 1148 + *(*uintptr)(unsafe.Pointer(bp + 16)) = __ccgo_ts + 18324 } else { *(*uintptr)(unsafe.Pointer(bp + 16)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, uintptr(0)) @@ -195598,7 +188253,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 44))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -195607,7 +188262,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -195631,13 +188286,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 18161 + zCol = __ccgo_ts + 18324 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+13877, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+13993, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -195645,7 +188300,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*32))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+20759, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+20922, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -195737,7 +188392,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16))).FzCnName } else { - v3 = __ccgo_ts + 18161 + v3 = __ccgo_ts + 18324 } zName = v3 } else { @@ -195752,7 +188407,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20759, libc.VaList(bp+40, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20922, libc.VaList(bp+40, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -195788,7 +188443,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20768, libc.VaList(bp+40, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20931, libc.VaList(bp+40, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -195907,7 +188562,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 20776 + zType = __ccgo_ts + 20939 } else { zType = uintptr(0) j = int32(1) @@ -195973,7 +188628,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return uintptr(0) } @@ -196001,7 +188656,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -196051,7 +188706,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -196074,7 +188729,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -196222,7 +188877,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20780, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20943, 0) return } /* Obtain authorization to do a recursive query */ @@ -196259,7 +188914,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -196270,7 +188925,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 56 + v7 = pParse + 60 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -196284,7 +188939,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -196315,7 +188970,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20829, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20992, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -196330,7 +188985,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20871, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21034, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -196358,7 +189013,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20877, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21040, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -196411,11 +189066,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } else { - v1 = __ccgo_ts + 20892 + v1 = __ccgo_ts + 21055 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20894, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21057, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -196523,8 +189178,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20917, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20932, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21080, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21095, 0) } /* Generate code for the left and right SELECT statements. */ @@ -196549,7 +189204,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20612, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20775, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -196575,7 +189230,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -196601,7 +189256,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 48))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20951, libc.VaList(bp+136, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21114, libc.VaList(bp+136, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+48) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -196633,11 +189288,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 56 + v6 = pParse + 60 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -196659,7 +189314,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 88))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20951, libc.VaList(bp+136, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21114, libc.VaList(bp+136, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+88) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -196766,6 +189421,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -196782,9 +189438,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20972, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21135, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21018, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21181, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -196855,7 +189511,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20592, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20755, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -197103,7 +189759,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -197157,16 +189813,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8863) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+8863) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8950) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+8950) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -197184,32 +189840,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 60 + v18 = pParse + 64 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 60 + v20 = pParse + 64 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 60 + v22 = pParse + 64 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+40, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21100, libc.VaList(bp+88, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21263, libc.VaList(bp+88, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21111, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21274, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -197222,7 +189878,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21116, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21279, 0) _sqlite3Select(tls, pParse, p, bp+40) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -197432,11 +190088,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 6460 + v1 = __ccgo_ts + 6548 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= uint32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^uint32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 52)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -197597,7 +190253,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 24 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 56 + v3 = pParse + 60 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -197787,9 +190443,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -198001,7 +190657,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -198148,7 +190804,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 148 + v5 = pParse + 132 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = uint32(v4) @@ -198387,18 +191043,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -198438,7 +191082,7 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ @@ -198507,7 +191151,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -198525,12 +191169,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*8)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -199012,7 +191656,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= uint32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^uint32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -199058,13 +191702,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return uint8(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17019) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17162) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17023) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17166) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -199152,8 +191796,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21285, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 56)) = pIdx @@ -199177,7 +191821,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -199259,7 +191903,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -199277,7 +191921,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21140, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21303, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -199425,7 +192069,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return int32(2) } @@ -199453,7 +192097,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 24 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21163, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21326, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 48)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+24+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -199475,12 +192119,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+24+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21183, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21346, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -199497,7 +192141,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21226 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21389 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -199528,7 +192172,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21249, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21412, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -199537,9 +192181,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+54, pTab+8) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21287 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21450 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21321 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21484 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -199588,7 +192232,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 72)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(104)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(120)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -199598,7 +192242,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+21359, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+21522, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -199694,7 +192338,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 148 + v2 = pParse + 132 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = uint32(v1) @@ -199703,7 +192347,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(64)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(libc.UintptrFromInt32(0)+16)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(48)) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -199754,7 +192398,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21363, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21526, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -199769,7 +192413,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21402, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21565, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -199784,7 +192428,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16578, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16694, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -199908,7 +192552,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName } else { - v10 = __ccgo_ts + 8025 + v10 = __ccgo_ts + 8112 } zSchemaName = v10 } @@ -199925,7 +192569,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*32 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21433, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21596, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+16+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -200004,7 +192648,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*32))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21438, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21601, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -200017,7 +192661,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+13877, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+13993, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+16+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -200037,9 +192681,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21447, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21610, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21465, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21628, 0) } } } @@ -200053,7 +192697,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21485, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21648, 0) return int32(WRC_Abort) } if elistFlags&uint32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -200250,14 +192894,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if int32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*24))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*32))).FiSorterColumn if k > mx { mx = k } @@ -200266,7 +192910,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint16(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -200298,11 +192942,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*24 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*32 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -200355,7 +192999,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -200392,12 +193036,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 32)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 32)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21516, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21679, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 32)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21567, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21730, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -200418,7 +193062,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21600, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21763, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -200557,7 +193201,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 60 + v3 = pParse + 64 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -200665,7 +193309,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -200709,7 +193353,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 24 + pC += 32 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -200732,16 +193376,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if int32((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 21633 + v1 = __ccgo_ts + 21796 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21656, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21819, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -200773,7 +193417,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9626) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -200902,6 +193546,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -200930,7 +193575,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+17313) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+17476) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != uintptr(0) { @@ -200963,9 +193608,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -200975,13 +193620,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(88)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= uint32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -201001,7 +193646,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -201174,8 +193819,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(208) defer tls.Free(208) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -201184,11 +193829,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+112 */ TNameContext var _ /* sSort at bp+16 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -201204,7 +193849,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -201228,14 +193873,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21668, libc.VaList(bp+176, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21831, libc.VaList(bp+176, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -201336,7 +193981,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21722, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21885, libc.VaList(bp+176, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -201494,7 +194139,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 72)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1673, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1674, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -201537,14 +194182,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 60 + v13 = pParse + 64 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+72, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21762, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21925, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+24+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -201576,7 +194221,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 60 + v16 = pParse + 64 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -201591,7 +194236,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+72, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21777, libc.VaList(bp+176, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21940, libc.VaList(bp+176, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+72) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -201645,7 +194290,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -201678,7 +194323,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 56 + v20 = pParse + 60 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FiECursor = v19 @@ -201737,7 +194382,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 56 + v25 = pParse + 60 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -201766,6 +194411,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = uint8(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -201788,10 +194440,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 60 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 64 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -201825,8 +194477,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 32 @@ -201841,8 +194493,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 24))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 32 @@ -201871,8 +194523,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = uint8(int32((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*32))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -201889,7 +194541,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(56)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(64)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -201902,11 +194554,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 112))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 112 + 16)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint16(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+112, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+112, (*(*TSortCtx)(unsafe.Pointer(bp + 16))).FpOrderBy) @@ -201940,49 +194592,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = uint16(v33) + distFlag = uint16(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 56 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 60 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, int32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 60 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 60 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 60 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 64 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 64 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 64 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 60 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 64 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -201990,16 +194643,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if int32((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, uint16(v44|v45|int32(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, uint16(v45|v46|int32(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -202017,11 +194670,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 21793 + v47 = __ccgo_ts + 21956 } else { - v46 = __ccgo_ts + 21802 + v47 = __ccgo_ts + 21965 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20645, libc.VaList(bp+176, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20808, libc.VaList(bp+176, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -202031,12 +194684,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -202049,13 +194702,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*24 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*32 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -202066,12 +194719,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 56 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 60 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -202120,12 +194773,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*32))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && int32((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -202195,9 +194852,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -202214,10 +194871,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 56 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 60 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -202244,8 +194901,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -202285,32 +194942,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*32))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 60 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 64 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 32)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = uint16(v60) + distFlag1 = uint16(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -202352,7 +195009,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if int32((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+21793) + _explainTempTable(tls, pParse, __ccgo_ts+21956) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -202458,7 +195115,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*8)))) if z == uintptr(0) { goto malloc_failed } @@ -202474,7 +195131,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if int32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+21811, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+21974, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -202564,7 +195221,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+48, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -202726,7 +195383,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21876, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22039, 0) goto trigger_cleanup } iDb = int32(1) @@ -202766,7 +195423,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+21922, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+22085, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+8, pTableName) != 0 { goto trigger_cleanup } @@ -202776,11 +195433,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21930, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22093, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21971, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22134, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -202789,13 +195446,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+21922, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+22085, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FpSchema+56, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22011, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22174, libc.VaList(bp+112, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -202803,8 +195460,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22037, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22200, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -202812,15 +195469,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 22075 + v1 = __ccgo_ts + 22238 } else { - v1 = __ccgo_ts + 22082 + v1 = __ccgo_ts + 22245 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22088, libc.VaList(bp+112, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22251, libc.VaList(bp+112, v1, pTableName+8)) goto trigger_orphan_error } if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22125, libc.VaList(bp+112, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22288, libc.VaList(bp+112, pTableName+8)) goto trigger_orphan_error } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -202840,9 +195497,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 7968 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7456 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -202942,7 +195599,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+96, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+21922, bp+96) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+22085, bp+96) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -202964,7 +195621,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22171, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22334, libc.VaList(bp+120, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -202980,10 +195637,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+22219, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22382, libc.VaList(bp+120, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+22294, libc.VaList(bp+120, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+22457, libc.VaList(bp+120, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -203251,11 +195908,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22323, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22486, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -203293,9 +195950,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zTab = v1 if iDb == int32(1) { @@ -203310,7 +195967,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+22343, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22506, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -203443,11 +196100,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 22405 + v1 = __ccgo_ts + 22568 } else { - v1 = __ccgo_ts + 22412 + v1 = __ccgo_ts + 22575 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22419, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22582, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -203549,7 +196206,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22467, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22630, 0) return int32(1) } @@ -203697,12 +196354,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(272) defer tls.Free(272) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+128 */ TSrcList + var _ /* fromSpace at bp+128 */ [88]Tu8 var _ /* sNC at bp+216 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -203710,19 +196367,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 208)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+16 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint64(128)) - libc.Xmemset(tls, bp+128, 0, uint64(88)) + pFrom = bp + 128 + libc.Xmemset(tls, pFrom, 0, uint64(libc.UintptrFromInt32(0)+8)+libc.Uint64FromInt64(80)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 128 - (*(*TSrcList)(unsafe.Pointer(bp + 128))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 128 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -203733,7 +196393,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab libc.Xmemset(tls, bp+216, 0, uint64(56)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 @@ -203747,7 +196407,7 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 60)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -203815,7 +196475,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = uint8(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+7653, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+7739, libc.VaList(bp+48, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch int32((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -203914,10 +196574,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 56))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 56))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 56))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 56))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 56))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+56) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+22509, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+22672, libc.VaList(bp+488, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -203939,7 +196601,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+56) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+144) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+8, pTop+128) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 56))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 56))).FnTab @@ -204011,7 +196673,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -204427,13 +197089,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(128) defer tls.Free(128) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+80 */ [2]int32 var _ /* bReplace at bp+88 */ int32 var _ /* iNotUsed1 at bp+92 */ int32 @@ -204441,21 +197103,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+16 */ TNameContext var _ /* tmask at bp+72 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 88)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -204502,7 +197164,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 56 + v4 = pParse + 60 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -204585,58 +197247,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+16, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22523, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) - goto update_cleanup - } + if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22686, libc.VaList(bp+112, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22559, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22722, libc.VaList(bp+112, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*32))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 9401 + v10 = __ccgo_ts + 9488 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*16))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -204666,17 +197316,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*16))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*16), aXRef, int32(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -204688,11 +197338,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = uint64(-libc.Int32FromInt32(1)) + v12 = uint64(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, int32(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -204708,11 +197358,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0 { - v16 = pParse + 60 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 64 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -204721,18 +197371,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, int32(chngRowid)) != 0 { - v19 = pParse + 60 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 64 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 88)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -204741,16 +197391,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 60 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 64 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 88)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -204768,24 +197418,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 60 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 64 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 60 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 64 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -204811,50 +197461,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*32))).FpExpr, k) @@ -205152,8 +197802,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -205203,8 +197853,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -205251,11 +197901,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -205267,11 +197917,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -205314,7 +197964,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22578) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22741) } goto update_cleanup update_cleanup: @@ -205371,13 +198021,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -205419,11 +198069,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 60 + v7 = pParse + 64 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -205748,9 +198398,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 200)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+22591, libc.VaList(bp+224, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+200, __ccgo_ts+22754, libc.VaList(bp+224, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22595, libc.VaList(bp+224, bp+200)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22758, libc.VaList(bp+224, bp+200)) return int32(SQLITE_ERROR) } goto _1 @@ -205839,13 +198489,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -205853,7 +198503,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+13966, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+14082, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -205935,7 +198585,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22668, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22672, uint64(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22831, uint64(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22835, uint64(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -206026,7 +198676,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -206065,24 +198715,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22676) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22839) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22716) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22879) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22759) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22922) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 76)) &= uint32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 76)) |= uint32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1673 + zOut = __ccgo_ts + 1674 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -206092,7 +198742,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 48)) |= uint64(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | uint64(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22808) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22971) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 44)) |= uint32(DBFLAG_VacuumInto) @@ -206145,7 +198795,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+16348) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+16464) if rc != SQLITE_OK { goto end_of_vacuum } @@ -206176,11 +198826,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22835, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22998, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22943, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23106, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -206189,7 +198839,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22997, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23160, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 44)) &= uint32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -206199,7 +198849,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23134, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23297, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -206290,39 +198940,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -206333,7 +198950,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -206352,7 +198969,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -206377,15 +198994,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -206400,13 +199017,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -206726,7 +199345,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 64))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 136 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14196, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14312, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -206849,24 +199468,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32(int32(int64((*TToken)(unsafe.Pointer(pEnd)).Fz)-int64((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz))) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+23257, libc.VaList(bp+8, pParse+272)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+23420, libc.VaList(bp+8, pParse+232)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+23444, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*32))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+23380, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+23543, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -206923,7 +199547,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -206950,7 +199574,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23399, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23562, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -206984,7 +199608,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+16, bp+32) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -206992,9 +199616,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 32)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23441, libc.VaList(bp+48, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23604, libc.VaList(bp+48, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+4710, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+4829, libc.VaList(bp+48, *(*uintptr)(unsafe.Pointer(bp + 32)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) } _sqlite3DbFree(tls, db, pVTable) @@ -207007,7 +199631,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 23471 + zFormat = __ccgo_ts + 23634 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+48, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -207033,7 +199657,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1673) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*16, __ccgo_ts+1674) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -207041,7 +199665,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+18052, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+18215, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -207122,13 +199746,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 64))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23517, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23680, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4710, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4829, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -207209,7 +199833,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23517, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23680, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -207257,7 +199881,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i z += uintptr(_sqlite3GetToken(tls, z, bp+424)) } if *(*int32)(unsafe.Pointer(bp + 424)) != int32(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+23536, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+23699, 0) return int32(SQLITE_ERROR) } goto _1 @@ -207268,9 +199892,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -207312,7 +199936,7 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 4710 + v3 = __ccgo_ts + 4829 } else { v3 = uintptr(0) } @@ -207768,7 +200392,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return 0 } @@ -207788,7 +200412,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4710, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4829, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -207852,7 +200476,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -207865,7 +200489,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -208025,271 +200649,9 @@ type TWhereLoop = struct { FaLTermSpace [3]uintptr } -type WhereLoop = TWhereLoop - -type TWherePath = struct { - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr -} - -type WherePath = TWherePath - -type TWhereTerm = struct { - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm = TWhereTerm - -type TWhereLoopBuilder = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder = TWhereLoopBuilder - -type TWhereScan = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan = TWhereScan - -type TWhereOrCost = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost = TWhereOrCost - -type TWhereOrSet = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet = TWhereOrSet - -type TWhereMemBlock = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock = TWhereMemBlock - -type TWhereRightJoin = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin = TWhereRightJoin - -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - FpNext uintptr - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - Fn Tu16 - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 +type WhereLoop = TWhereLoop -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { +type TWherePath = struct { FmaskLoop TBitmask FrevLoop TBitmask FnRow TLogEst @@ -208299,60 +200661,9 @@ type TWherePath1 = struct { FaLoop uintptr } -type WherePath1 = TWherePath1 +type WherePath = TWherePath -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { +type TWhereTerm = struct { FpExpr uintptr FpWC uintptr FtruthProb TLogEst @@ -208374,17 +200685,23 @@ type TWhereTerm1 = struct { FprereqAll TBitmask } -type WhereTerm1 = TWhereTerm1 +type WhereTerm = TWhereTerm -/* -** Allowed values of WhereTerm.wtFlags - */ +type TWhereLoopBuilder = struct { + FpWInfo uintptr + FpWC uintptr + FpNew uintptr + FpOrSet uintptr + FpRec uintptr + FnRecValid int32 + FbldFlags1 uint8 + FbldFlags2 uint8 + FiPlanLimit uint32 +} -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { +type WhereLoopBuilder = TWhereLoopBuilder + +type TWhereScan = struct { FpOrigWC uintptr FpWC uintptr FzCollName uintptr @@ -208398,162 +200715,39 @@ type TWhereScan1 = struct { FaiColumn [11]Ti16 } -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 +type WhereScan = TWhereScan -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - Fwc TWhereClause +type TWhereOrCost = struct { + Fprereq TBitmask + FrRun TLogEst + FnOut TLogEst } -type WhereAndInfo1 = TWhereAndInfo1 +type WhereOrCost = TWhereOrCost -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 +type TWhereOrSet = struct { + Fn Tu16 + Fa [3]TWhereOrCost } -type WhereMaskSet1 = TWhereMaskSet1 +type WhereOrSet = TWhereOrSet -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 +type TWhereMemBlock = struct { + FpNext uintptr + Fsz Tu64 } -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ +type WhereMemBlock = TWhereMemBlock -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo68 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel +type TWhereRightJoin = struct { + FiMatch int32 + FregBloom int32 + FregReturn int32 + FaddrSubrtn int32 + FendSubrtn int32 } -type WhereInfo1 = TWhereInfo1 +type WhereRightJoin = TWhereRightJoin /* ** Bitmasks for the operators on WhereTerm objects. These are all @@ -208586,10 +200780,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 23549 + return __ccgo_ts + 23712 } if i == -int32(1) { - return __ccgo_ts + 18161 + return __ccgo_ts + 18324 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*16))).FzCnName } @@ -208608,10 +200802,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23556, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23719, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23562, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23725, int32(1)) } i = 0 for { @@ -208619,7 +200813,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14586, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14702, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -208628,11 +200822,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23562, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23725, int32(1)) } i = 0 for { @@ -208640,16 +200834,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14586, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14702, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6482, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6570, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } } @@ -208696,7 +200890,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if int32(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23564, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23727, int32(2)) i = 0 for { if !(i < int32(nEq)) { @@ -208704,12 +200898,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23556, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23719, int32(5)) } if i >= int32(nSkip) { - v2 = __ccgo_ts + 23567 + v2 = __ccgo_ts + 23730 } else { - v2 = __ccgo_ts + 23572 + v2 = __ccgo_ts + 23735 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -208726,7 +200920,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+23580) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+23743) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -208737,9 +200931,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+23582) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+23745) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } // C documentation @@ -208784,11 +200978,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 23584 + v2 = __ccgo_ts + 23747 } else { - v2 = __ccgo_ts + 23591 + v2 = __ccgo_ts + 23754 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23596, libc.VaList(bp+144, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23759, libc.VaList(bp+144, v2, pItem)) if flags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -208801,37 +200995,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 12749 + zFmt = __ccgo_ts + 12865 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 23602 + zFmt = __ccgo_ts + 23765 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 23635 + zFmt = __ccgo_ts + 23798 } else { if flags&uint32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 23660 + zFmt = __ccgo_ts + 23823 } else { - zFmt = __ccgo_ts + 23678 + zFmt = __ccgo_ts + 23841 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+23687, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23850, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+144, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 18161 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23695, libc.VaList(bp+144, zRowid)) + zRowid = __ccgo_ts + 18324 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23858, libc.VaList(bp+144, zRowid)) if flags&uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23726, libc.VaList(bp+144, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23889, libc.VaList(bp+144, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -208841,14 +201035,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23736, libc.VaList(bp+144, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23899, libc.VaList(bp+144, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23741) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23904) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 23763 + v3 = __ccgo_ts + 23926 } else { - v3 = __ccgo_ts + 23771 + v3 = __ccgo_ts + 23934 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+144, (*(*struct { FidxNum int32 @@ -208869,7 +201063,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23777, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23940, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -208899,10 +201093,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if int32((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -208935,14 +201129,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+32, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23788, libc.VaList(bp+144, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23951, libc.VaList(bp+144, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23567, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23730, libc.VaList(bp+144, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*16))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23809, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23972, 0) } } else { i = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -208966,16 +201160,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+23556, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23719, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23567, libc.VaList(bp+144, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23730, libc.VaList(bp+144, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6568, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -209180,7 +201374,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -209236,8 +201430,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*8)) + 32))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*32))).FpExpr = uintptr(0) if pRhs != 0 { @@ -209259,7 +201453,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 32)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 148 + v4 = pParse + 132 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = uint32(v3) /* Req'd for SubrtnSig validity */ @@ -209316,10 +201510,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -209374,37 +201568,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 32)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*uint64(nEq)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(4)*uint64(v3)) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(4)*uint64(nEq)) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 48)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -209451,24 +201631,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = uint8(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = uint8(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -209480,8 +201660,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -209539,7 +201719,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -209621,7 +201801,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = int32(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 60)) += nReg + *(*int32)(unsafe.Pointer(pParse + 64)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -209889,7 +202069,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -210034,7 +202214,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && int32((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 60 + v5 = pParse + 64 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -210095,11 +202275,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 56 + v10 = pParse + 60 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -210130,6 +202310,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -210268,7 +202451,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 60 + v21 = pParse + 64 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -210348,7 +202531,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 60 + v28 = pParse + 64 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -210382,7 +202565,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 60 + v33 = pParse + 64 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -210504,7 +202687,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 60 + v40 = pParse + 64 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -210697,7 +202880,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -210711,12 +202894,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -210754,11 +202938,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 56 + v45 = pParse + 60 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 60 + v47 = pParse + 64 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -210778,7 +202962,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(88)+uint64(nNotReady)*uint64(80)) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(libc.UintptrFromInt32(0)+8)+uint64(nNotReady+libc.Int32FromInt32(1))*libc.Uint64FromInt64(80)) if pOrTab == uintptr(0) { return notReady } @@ -210814,21 +202998,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 60 + v50 = pParse + 64 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 56 + v52 = pParse + 60 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 60 + v54 = pParse + 64 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -210846,7 +203030,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -210901,7 +203085,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23817, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23980, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -210924,7 +203108,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23832, libc.VaList(bp+96, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23995, libc.VaList(bp+96, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+856, uint16(0)) @@ -211413,9 +203597,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(112) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [88]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -211424,14 +203608,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23841, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+24004, libc.VaList(bp+96, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FiFrom)*80 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856 + uintptr(k)*104))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 24 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 72)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -211470,15 +203654,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint64(80)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint64(80)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -211490,7 +203675,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -211961,19 +204146,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 18010, + FzOp: __ccgo_ts + 18173, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 17343, + FzOp: __ccgo_ts + 17506, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 16822, + FzOp: __ccgo_ts + 16965, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 23855, + FzOp: __ccgo_ts + 24018, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -212493,37 +204678,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -212761,7 +204950,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23862, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24025, 0) return } } else { @@ -212773,10 +204962,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23862, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24025, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -212835,7 +205024,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*56 p5 = pTerm + 18 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 20 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -212857,7 +205046,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 9387 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 9474 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -212958,7 +205147,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 12)) != 0 { - v13 = __ccgo_ts + 23903 + v13 = __ccgo_ts + 24066 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -213489,7 +205678,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23910, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24073, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -213561,22 +205750,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -213689,7 +205866,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 856 + uintptr(i)*104 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -214605,7 +206782,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -216856,13 +209034,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -216962,6 +209135,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if int32(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -216975,12 +209149,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) + 32))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 32))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 32)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 32)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -217426,7 +209617,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (int32(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 52)) == iTab) && (int32(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -217477,15 +209668,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -217517,7 +209699,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -217536,7 +209718,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 40)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -217573,7 +209755,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(64) defer tls.Free(64) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+16 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -217581,7 +209763,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 100))&0x800>>11)) == 0 { i = 0 for { if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -217602,19 +209784,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+16, 0, uint64(48)) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 16))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 16 + 40)) = bp _sqlite3WalkSelect(tls, bp+16, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -217710,7 +209892,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 104 + pArg = pParse + 112 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -217888,7 +210070,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -217916,6 +210098,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -217992,7 +210182,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+168, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 168)) == libc.Uint64FromInt32(1)<<(int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 100))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 168)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -218229,7 +210419,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*8)) != uintptr(0) || int32((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23983, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24146, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -218304,7 +210494,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*8)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23983, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24146, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -218458,7 +210648,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 32 + uintptr(iCons)*8)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -218894,7 +211084,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+24009, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+24172, 0) rc = SQLITE_OK } else { break @@ -219123,17 +211313,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if int32(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*80))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -220102,7 +212281,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24044, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24207, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -220680,7 +212859,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 96 + pArg = pParse + 104 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -220836,7 +213015,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24062, libc.VaList(bp+64, int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24225, libc.VaList(bp+64, int32(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -220857,10 +213036,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = int32(libc.Uint64FromInt64(960)) - if nTabList > int32(1) { - nByteWInfo = int32(uint64(nByteWInfo) + uint64(nTabList-libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) - } + nByteWInfo = int32((uint64(libc.UintptrFromInt32(0)+856) + uint64(nTabList)*libc.Uint64FromInt64(104) + libc.Uint64FromInt32(7)) & uint64(^libc.Int32FromInt32(7))) pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(nByteWInfo)+uint64(104)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) @@ -220909,7 +213085,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+24090, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+24253, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -221054,7 +213230,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 70 @@ -221088,7 +213265,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 224 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 28 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -221110,7 +213287,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if int32(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = int32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) + wsFlags = int32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || int32(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -221123,7 +213300,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = uint32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 856))).FpWLoop)).FwsFlags = uint32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -221214,11 +213391,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 56 + v17 = pParse + 60 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 100))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -221245,16 +213422,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 56 + v21 = pParse + 60 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 60 + v23 = pParse + 64 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 60 + v25 = pParse + 64 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -221302,7 +213479,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 856 + uintptr(ii)*104 - wsFlags1 = int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*80 if int32(*(*uint32)(unsafe.Pointer(pSrc + 24 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -221433,7 +213610,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 60)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 64)) += n + int32(1) if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -221611,7 +213788,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 100))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -221640,7 +213817,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -221650,7 +213827,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24108, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24271, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -221700,7 +213877,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 38 + p12 = pParse + 37 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -221969,7 +214146,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24137, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24300, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -222151,7 +214328,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24193, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24356, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -222477,7 +214654,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24238, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24401, libc.VaList(bp+8, zName)) } return p } @@ -222528,12 +214705,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if int32((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24257, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24420, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24328, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24491, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -222606,7 +214783,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = uint8(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9626) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) } break } @@ -222637,16 +214814,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -222665,17 +214832,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*80))).FiCursor { break } goto _1 @@ -222693,7 +214860,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -222717,13 +214884,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*32))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -222738,23 +214905,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && int32((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = int32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint64(72)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + *(*uintptr)(unsafe.Pointer(pExpr + 64)) = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = uint32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -222770,13 +214937,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 40)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -222888,7 +215055,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+24391, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+24554, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -222924,7 +215091,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(104)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(120)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -222939,7 +215106,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -222958,11 +215125,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 56 + v2 = pParse + 60 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 56)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -223008,11 +215175,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 60 + v10 = pParse + 64 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -223029,7 +215196,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1793)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -223051,7 +215218,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint64(104)) + libc.Xmemcpy(tls, pTab, pTab2, uint64(120)) *(*Tu32)(unsafe.Pointer(pTab + 48)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -223175,7 +215342,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24417, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24580, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(144)) @@ -223243,18 +215410,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 24449 + zErr = __ccgo_ts + 24612 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 24466 + zErr = __ccgo_ts + 24629 } else { if int32((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 24482 + zErr = __ccgo_ts + 24645 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24502, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24665, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -223278,7 +215445,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24535, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24698, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -223384,24 +215551,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 64)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 56 + v8 = pParse + 60 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -223419,12 +215586,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 32)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 56 + v11 = pParse + 60 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -223436,15 +215603,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 56 + v13 = pParse + 60 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 60)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 64)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 56 + v15 = pParse + 60 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -223477,7 +215644,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1673, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1674, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, uint16(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -223496,11 +215663,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 24582, - 1: __ccgo_ts + 24635, - 2: __ccgo_ts + 24137, - 3: __ccgo_ts + 24686, - 4: __ccgo_ts + 24738, + 0: __ccgo_ts + 24745, + 1: __ccgo_ts + 24798, + 2: __ccgo_ts + 24300, + 3: __ccgo_ts + 24849, + 4: __ccgo_ts + 24901, } var _aOp1 = [5]int32{ @@ -223553,87 +215720,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -224080,7 +216166,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nArg + *(*int32)(unsafe.Pointer(pParse + 64)) += nArg return regArg } @@ -224176,7 +216262,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -224252,7 +216338,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1673, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1674, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -224893,12 +216979,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nInput - v2 = pParse + 60 + *(*int32)(unsafe.Pointer(pParse + 64)) += nInput + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 60 + v4 = pParse + 64 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -224906,13 +216992,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 60 + v6 = pParse + 64 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 60 + v8 = pParse + 64 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -224932,13 +217018,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 60)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 64)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -224965,7 +217051,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 60 + v12 = pParse + 64 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -225184,6 +217270,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -225244,7 +217334,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24788, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24951, libc.VaList(bp+8, p)) } // C documentation @@ -225258,6 +217348,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+256, 0, uint64(32)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -225291,11 +217382,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 24812 + v1 = __ccgo_ts + 24975 } else { - v1 = __ccgo_ts + 24821 + v1 = __ccgo_ts + 24984 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24827, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24990, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -225304,7 +217395,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24869, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25032, 0) } } } @@ -225410,7 +217501,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24903, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25066, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -231877,14 +223968,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -231895,16 +223978,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -233052,19 +225125,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(144) defer tls.Free(144) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+104 */ TToken var _ /* as at bp+72 */ TToken var _ /* dest at bp+16 */ TSelectDest var _ /* t at bp+88 */ TToken var _ /* x at bp+56 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -233867,20 +225940,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+18161, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+18324, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24941, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25104, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+18074, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 8)), __ccgo_ts+18260, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24941, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25104, libc.VaList(bp+128, *(*uint32)(unsafe.Pointer(yymsp + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)))) } *(*Tu32)(unsafe.Pointer(yymsp + 8)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -233921,7 +225994,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 8)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -234066,7 +226144,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 256))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -234156,9 +226239,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -234513,7 +226596,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), yymsp+uintptr(-libc.Int32FromInt32(4))*24+8) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+24968) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), __ccgo_ts+25131) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -234853,23 +226936,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v347 = __ccgo_ts + 9469 + } else { + v347 = __ccgo_ts + 9474 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { - v347 = __ccgo_ts + 9382 - } else { - v347 = __ccgo_ts + 9387 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)))).Fflags&uint32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) + 8))).FpExpr @@ -234927,11 +227024,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 8)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 8))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 8))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), pSelect) @@ -234941,9 +227038,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) goto _346 _242: @@ -234951,11 +227048,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*24 + 8)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*24 + 8))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)) + 32)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8))) @@ -235053,11 +227150,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*24+8, yymsp+uintptr(-libc.Int32FromInt32(6))*24+8, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*24 + 8 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)), *(*uintptr)(unsafe.Pointer(yymsp + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*24 + 8))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8 + 8)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*24 + 8)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*24 + 8)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*24 + 8)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -235107,15 +227204,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*24 + 8)) = *(*TToken)(unsafe.Pointer(yymsp + 8)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24977, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25140, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25072, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25235, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25156, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25319, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -235257,7 +227354,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+44, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -235451,7 +227548,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25241, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25404, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -237577,7 +229674,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -238182,14 +230279,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -239053,22 +231151,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(8) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, uint64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, uint64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -239079,11 +231186,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -239662,7 +231769,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -239682,7 +231789,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25328, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25491, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -239807,11 +231914,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*32 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -239983,14 +232090,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 25871 + zErr = __ccgo_ts + 26034 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < int32(libc.Uint64FromInt64(232)/libc.Uint64FromInt64(8)) && _aMsg[rc] != uintptr(0) { @@ -240002,31 +232109,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 25396, - 1: __ccgo_ts + 25409, - 3: __ccgo_ts + 25425, - 4: __ccgo_ts + 25450, - 5: __ccgo_ts + 25464, - 6: __ccgo_ts + 25483, - 7: __ccgo_ts + 1643, - 8: __ccgo_ts + 25508, - 9: __ccgo_ts + 25545, - 10: __ccgo_ts + 25557, - 11: __ccgo_ts + 25572, - 12: __ccgo_ts + 25605, - 13: __ccgo_ts + 25623, - 14: __ccgo_ts + 25648, - 15: __ccgo_ts + 25677, - 17: __ccgo_ts + 7411, - 18: __ccgo_ts + 6813, - 19: __ccgo_ts + 25694, - 20: __ccgo_ts + 25712, - 21: __ccgo_ts + 25730, - 23: __ccgo_ts + 25764, - 25: __ccgo_ts + 25785, - 26: __ccgo_ts + 25811, - 27: __ccgo_ts + 25834, - 28: __ccgo_ts + 25855, + 0: __ccgo_ts + 25559, + 1: __ccgo_ts + 25572, + 3: __ccgo_ts + 25588, + 4: __ccgo_ts + 25613, + 5: __ccgo_ts + 25627, + 6: __ccgo_ts + 25646, + 7: __ccgo_ts + 1644, + 8: __ccgo_ts + 25671, + 9: __ccgo_ts + 25708, + 10: __ccgo_ts + 25720, + 11: __ccgo_ts + 25735, + 12: __ccgo_ts + 25768, + 13: __ccgo_ts + 25786, + 14: __ccgo_ts + 25811, + 15: __ccgo_ts + 25840, + 17: __ccgo_ts + 7497, + 18: __ccgo_ts + 6901, + 19: __ccgo_ts + 25857, + 20: __ccgo_ts + 25875, + 21: __ccgo_ts + 25893, + 23: __ccgo_ts + 25927, + 25: __ccgo_ts + 25948, + 26: __ccgo_ts + 25974, + 27: __ccgo_ts + 25997, + 28: __ccgo_ts + 26018, } // C documentation @@ -240120,15 +232227,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -240136,6 +232245,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -240143,10 +232254,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = uint32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -240173,6 +232284,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -240200,12 +232325,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -240223,9 +232348,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -240248,13 +232373,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == uint32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25952, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26115, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -240272,15 +232397,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 64)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | uint32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = int16(uint16(nArg)) return SQLITE_OK @@ -240295,27 +232420,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(24)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -240326,30 +232451,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -240374,7 +232529,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+26015, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+26178, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -240405,13 +232560,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -240422,43 +232579,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(v1) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 248)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 248)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -240469,12 +232630,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 110 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -240486,6 +232647,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -240493,82 +232656,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -240612,18 +232785,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -240649,7 +232824,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -240659,7 +232834,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+26066, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+26229, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -240781,7 +232956,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -240913,7 +233088,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240923,7 +233098,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240959,7 +233134,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -240972,7 +233147,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -240981,7 +233156,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, uint8(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26087, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26250, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -241016,9 +233191,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = uint8(enc2 | int32(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -241128,7 +233303,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+26155, uint64(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+26318, uint64(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = uint64(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -241158,8 +233333,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+26161, zUri+7, uint64(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26171, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+26324, zUri+7, uint64(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26334, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -241248,24 +233423,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+26199, zOpt, uint64(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+26362, zOpt, uint64(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+26203, zOpt, uint64(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+26366, zOpt, uint64(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 26203 + zModeType = __ccgo_ts + 26366 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26224, zOpt, uint64(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26387, zOpt, uint64(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = int32(uint32(mask) & flags) - zModeType = __ccgo_ts + 26239 + zModeType = __ccgo_ts + 26402 } if aMode != 0 { mode = 0 @@ -241294,12 +233469,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26246, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26409, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26266, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26429, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -241323,7 +233498,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26290, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26453, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -241343,11 +233518,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26209, + Fz: __ccgo_ts + 26372, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 26216, + Fz: __ccgo_ts + 26379, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -241358,19 +233533,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26229, + Fz: __ccgo_ts + 26392, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 26232, + Fz: __ccgo_ts + 26395, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 26235, + Fz: __ccgo_ts + 26398, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 19242, + Fz: __ccgo_ts + 19405, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -241498,8 +233673,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+23903, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+26306, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+24066, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+26469, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -241520,10 +233695,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 5564 + zFilename = __ccgo_ts + 5652 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+8, bp+16) } @@ -241532,7 +233707,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { - v2 = __ccgo_ts + 4710 + v2 = __ccgo_ts + 4829 } else { v2 = uintptr(0) } @@ -241559,9 +233734,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 8020 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 8107 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = uint8(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 25301 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).FzDbSName = __ccgo_ts + 25464 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*32))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -241655,7 +233830,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 26312 + zFilename = __ccgo_ts + 26475 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -241674,36 +233849,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, uint8(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, uint8(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -241711,7 +233894,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, uint8(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, uint8(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -241719,31 +233902,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -241777,12 +233964,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -241815,10 +234004,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(32)+n+uint64(1)) + p = Xsqlite3_malloc64(tls, uint64(libc.UintptrFromInt32(0)+24)+(n+libc.Uint64FromInt32(1))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -241829,7 +234018,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -241872,20 +234061,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+26315, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+26478, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+26340) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+26503) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26360) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26523) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26367) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26530) } // C documentation @@ -241910,9 +234099,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -241939,29 +234128,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*16 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -241985,7 +234163,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1147 + zDataType = __ccgo_ts + 1148 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -242016,15 +234194,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+26384, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+26547, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 4710 + v2 = __ccgo_ts + 4829 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -242203,8 +234381,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -243044,7 +235222,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+26412, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+26575, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -243192,6 +235370,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -243215,7 +235395,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -243225,7 +235405,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -243237,7 +235417,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -243253,7 +235433,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -243262,7 +235442,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 26420 + v2 = __ccgo_ts + 26583 } else { v2 = uintptr(0) } @@ -243508,7 +235688,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -243725,6 +235905,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -244037,8 +236224,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -244095,7 +236282,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -244105,7 +236292,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -244142,23 +236329,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1659, - 1: __ccgo_ts + 9382, - 2: __ccgo_ts + 9387, - 3: __ccgo_ts + 7696, - 4: __ccgo_ts + 7696, - 5: __ccgo_ts + 7691, - 6: __ccgo_ts + 7691, - 7: __ccgo_ts + 9693, - 8: __ccgo_ts + 9693, - 9: __ccgo_ts + 9693, - 10: __ccgo_ts + 9693, - 11: __ccgo_ts + 26443, - 12: __ccgo_ts + 26449, - 13: __ccgo_ts + 1673, - 14: __ccgo_ts + 1673, - 15: __ccgo_ts + 1673, - 16: __ccgo_ts + 1673, + 0: __ccgo_ts + 1660, + 1: __ccgo_ts + 9469, + 2: __ccgo_ts + 9474, + 3: __ccgo_ts + 7783, + 4: __ccgo_ts + 7783, + 5: __ccgo_ts + 7778, + 6: __ccgo_ts + 7778, + 7: __ccgo_ts + 9780, + 8: __ccgo_ts + 9780, + 9: __ccgo_ts + 9780, + 10: __ccgo_ts + 9780, + 11: __ccgo_ts + 26606, + 12: __ccgo_ts + 26612, + 13: __ccgo_ts + 1674, + 14: __ccgo_ts + 1674, + 15: __ccgo_ts + 1674, + 16: __ccgo_ts + 1674, } // C documentation @@ -244462,106 +236649,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -244641,7 +236728,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -244939,8 +237026,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 26456 + uintptr(int32(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 26456 + uintptr(int32(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1696 + uintptr(int32(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1696 + uintptr(int32(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 24)) += uint64(6) } } @@ -245074,9 +237161,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1659, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1660, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+16792, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+16908, libc.VaList(bp+80, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = uint32(Xsqlite3_value_bytes(tls, pValue)) @@ -245090,14 +237177,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if int32((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26473, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26619, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -245151,7 +237236,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if int32((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26648, -int32(1)) } } } @@ -245434,8 +237519,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26517, - FzRepl: __ccgo_ts + 26521, + FzMatch: __ccgo_ts + 26663, + FzRepl: __ccgo_ts + 26667, }, 1: { Fc1: int8('i'), @@ -245443,32 +237528,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26529, - FzRepl: __ccgo_ts + 26521, + FzMatch: __ccgo_ts + 26675, + FzRepl: __ccgo_ts + 26667, }, 2: { Fc1: int8('n'), Fc2: int8('N'), Fn: int8(3), FnRepl: int8(4), - FzMatch: __ccgo_ts + 1664, - FzRepl: __ccgo_ts + 1659, + FzMatch: __ccgo_ts + 1665, + FzRepl: __ccgo_ts + 1660, }, 3: { Fc1: int8('q'), Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26538, - FzRepl: __ccgo_ts + 1659, + FzMatch: __ccgo_ts + 26684, + FzRepl: __ccgo_ts + 1660, }, 4: { Fc1: int8('s'), Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26543, - FzRepl: __ccgo_ts + 1659, + FzMatch: __ccgo_ts + 26689, + FzRepl: __ccgo_ts + 1660, }, } @@ -245483,7 +237568,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26548, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26694, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -245501,23 +237586,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -245595,7 +237680,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -245666,7 +237751,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if int32(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if int32(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -245941,7 +238030,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+26591, int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+26737, int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -246371,7 +238460,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -246410,7 +238499,7 @@ parse_string: return int32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9382, uint64(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9469, uint64(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return int32(i + uint32(4)) } @@ -246418,7 +238507,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9387, uint64(5)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9474, uint64(5)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return int32(i + uint32(5)) } @@ -246495,14 +238584,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+26517, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+26663, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26600) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26746) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26607) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26753) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26613, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26759, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -246663,7 +238752,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1659, uint64(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1660, uint64(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return int32(i + uint32(4)) } @@ -246687,7 +238776,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26607) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26753) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -246732,7 +238821,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -246745,7 +238834,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -246794,10 +238883,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if int32(x) <= int32(11) { sz = uint32(x) @@ -246831,15 +238916,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = uint32(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && int64(i)+int64(sz)+int64(n) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-uint32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -246908,15 +238993,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1659, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1660, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9382, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9469, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9387, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9474, uint32(5)) return i + uint32(1) _6: ; @@ -246965,9 +239050,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 26521 + v19 = __ccgo_ts + 26667 } else { - v19 = __ccgo_ts + 13249 + v19 = __ccgo_ts + 13365 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -247003,9 +239088,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), uint64(*(*Tu32)(unsafe.Pointer(bp)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 24)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -247032,7 +239120,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26619, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26765, uint32(2)) zIn2++ sz2-- continue @@ -247055,7 +239143,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26622, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26768, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 33 @@ -247063,12 +239151,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26629, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26775, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26634, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26780, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -247171,16 +239259,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -247248,7 +239326,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26641, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -247271,12 +239349,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26644, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26790, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26641, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -247291,50 +239369,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(80) - defer tls.Free(80) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+8 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || int32(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+8, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 8))).FnBlob = uint32(nBlob) - n = _jsonbPayloadSize(tls, bp+8, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != uint32(nBlob) { - return 0 - } - if int32(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == uint32(nBlob)) -} - // C documentation // // /* @@ -247386,6 +239420,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 52)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if int32(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch int32(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -247406,6 +239518,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = int64(nIns) - int64(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, uint32(int32(-d))) != 0 { + return + } if d != 0 { if int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, uint32(int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -247478,9 +239593,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -247523,7 +239638,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = uint32(v3) return uint32(2) case int32('\''): fallthrough @@ -248011,7 +240137,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) return } switch int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -248146,7 +240272,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -248247,7 +240373,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) return } @@ -248284,11 +240410,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26473, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -248301,7 +240424,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint64(72)) return int32(1) @@ -248320,10 +240443,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26607) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26753) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26600) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26746) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(n), z) } @@ -248362,7 +240485,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26647, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26793, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -248378,7 +240501,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -248459,7 +240582,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -248471,34 +240594,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && int32(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (int32(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || int32(c) != int32(0x7b) && int32(c) != int32(0x5b) && !(int32(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -248581,7 +240724,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -248641,7 +240784,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -248776,7 +240919,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 26665 + v1 = __ccgo_ts + 26811 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -248786,7 +240929,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } eErr = uint8(1) @@ -248896,23 +241039,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26667, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26813, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26669, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26815, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+6535, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+6623, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1686, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1713, uint32(1)) _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26671, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26817, uint32(2)) _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26674, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26820, uint32(1)) } } } @@ -248948,11 +241091,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1659, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1660, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -249220,7 +241363,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -249244,7 +241387,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26676, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26822, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -249255,7 +241398,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26727, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26873, -int32(1)) _jsonStringReset(tls, bp) return } @@ -249327,7 +241470,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } goto json_remove_done @@ -249364,7 +241507,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17265) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17428) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -249395,9 +241538,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 26761 + v1 = __ccgo_ts + 26907 } else { - v1 = __ccgo_ts + 26765 + v1 = __ccgo_ts + 26911 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -249445,7 +241588,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } goto json_type_done @@ -249492,7 +241635,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 26772 + (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent = __ccgo_ts + 26918 (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FszIndent = uint32(libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 136))).FzIndent)) @@ -249566,17 +241709,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(144) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+72 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26777, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26923, -int32(1)) return } flags = uint8(f & int64(0x0f)) @@ -249585,18 +241727,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint64(72)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if int32(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if int32(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -249658,9 +241799,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint64(72)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = int64(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -249767,7 +241906,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26834, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26980, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249859,20 +241998,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(136)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = uint32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = uint32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*8))) + } } } @@ -249916,7 +242057,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26837, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26983, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249944,16 +242085,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { Fbase Tsqlite3_vtab_cursor FiRowid Tu32 @@ -249972,24 +242103,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -249997,13 +242110,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -250019,7 +242125,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26840) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26986) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(32)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -250153,7 +242259,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if int32((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+26923, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+56, __ccgo_ts+27069, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -250179,9 +242285,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+26930, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+56, __ccgo_ts+27076, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+26938, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+56, __ccgo_ts+27084, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -250492,9 +242598,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+192, 0, uint64(72)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+192) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -250567,7 +242672,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+56, __ccgo_ts+26944, uint32(1)) + _jsonAppendRaw(tls, p+56, __ccgo_ts+27090, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+192, i, bp) @@ -250591,7 +242696,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26502, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26648, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -250652,186 +242757,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26946, + FzName: __ccgo_ts + 27092, }, 1: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26951, + FzName: __ccgo_ts + 27097, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26957, + FzName: __ccgo_ts + 27103, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 26968, + FzName: __ccgo_ts + 27114, }, 4: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26980, + FzName: __ccgo_ts + 27126, }, 5: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26980, + FzName: __ccgo_ts + 27126, }, 6: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26998, + FzName: __ccgo_ts + 27144, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27018, + FzName: __ccgo_ts + 27164, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27031, + FzName: __ccgo_ts + 27177, }, 9: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27045, + FzName: __ccgo_ts + 27191, }, 10: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27048, + FzName: __ccgo_ts + 27194, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27052, + FzName: __ccgo_ts + 27198, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27064, + FzName: __ccgo_ts + 27210, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27077, + FzName: __ccgo_ts + 27223, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27089, + FzName: __ccgo_ts + 27235, }, 15: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27102, + FzName: __ccgo_ts + 27248, }, 16: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27113, + FzName: __ccgo_ts + 27259, }, 17: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27125, + FzName: __ccgo_ts + 27271, }, 18: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27125, + FzName: __ccgo_ts + 27271, }, 19: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27137, + FzName: __ccgo_ts + 27283, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27148, + FzName: __ccgo_ts + 27294, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27160, + FzName: __ccgo_ts + 27306, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27173, + FzName: __ccgo_ts + 27319, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27186, + FzName: __ccgo_ts + 27332, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27200, + FzName: __ccgo_ts + 27346, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27209, + FzName: __ccgo_ts + 27355, }, 26: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27219, + FzName: __ccgo_ts + 27365, }, 27: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27219, + FzName: __ccgo_ts + 27365, }, 28: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27229, + FzName: __ccgo_ts + 27375, }, 29: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27229, + FzName: __ccgo_ts + 27375, }, 30: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 27240, + FzName: __ccgo_ts + 27386, }, 31: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27257, + FzName: __ccgo_ts + 27403, }, 32: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 27275, + FzName: __ccgo_ts + 27421, }, 33: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(int64(libc.Int32FromInt32(JSON_BLOB))), - FzName: __ccgo_ts + 27293, + FzName: __ccgo_ts + 27439, }, } @@ -250914,17 +243019,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 27312, + FzName: __ccgo_ts + 27458, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 27322, + FzName: __ccgo_ts + 27468, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -250974,224 +243081,9 @@ type TRtree = struct { FaHash [97]uintptr } -type Rtree = TRtree - -type TRtreeCursor = struct { - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor = TRtreeCursor - -type TRtreeNode = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode = TRtreeNode - -type TRtreeCell = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell = TRtreeCell - -type TRtreeConstraint = struct { - FiCoord int32 - Fop int32 - Fu struct { - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr -} - -type RtreeConstraint = TRtreeConstraint - -type TRtreeMatchArg = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg = TRtreeMatchArg - -type TRtreeGeomCallback = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback = TRtreeGeomCallback - -type TRtreeCoord = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord = TRtreeCoord - -type TRtreeSearchPoint = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint = TRtreeSearchPoint - -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr -} - -type Rtree1 = TRtree1 - -/* Possible values for Rtree.eCoordType: */ - -// C documentation -// -// /* -// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will -// ** only deal with integer coordinates. No floating point operations -// ** will be done. -// */ -type TRtreeDValue = float64 - -type RtreeDValue = TRtreeDValue - -/* High accuracy coordinate */ - -type TRtreeValue = float32 - -type RtreeValue = TRtreeValue - -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ +type Rtree = TRtree -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { +type TRtreeCursor = struct { Fbase Tsqlite3_vtab_cursor FatEOF Tu8 FbPoint Tu8 @@ -251209,33 +243101,27 @@ type TRtreeCursor1 = struct { FanQueue [41]Tu32 } -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ +type RtreeCursor = TRtreeCursor -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue +type TRtreeNode = struct { + FpParent uintptr + FiNode Ti64 + FnRef int32 + FisDirty int32 + FzData uintptr + FpNext uintptr } -type RtreeCoord1 = TRtreeCoord1 +type RtreeNode = TRtreeNode + +type TRtreeCell = struct { + FiRowid Ti64 + FaCoord [10]TRtreeCoord +} -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ +type RtreeCell = TRtreeCell -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { +type TRtreeConstraint = struct { FiCoord int32 Fop int32 Fu struct { @@ -251246,79 +243132,64 @@ type TRtreeConstraint1 = struct { FpInfo uintptr } -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - FpParent uintptr - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ +type RtreeConstraint = TRtreeConstraint -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - FiRowid Ti64 - FaCoord [10]TRtreeCoord +type TRtreeMatchArg = struct { + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr } -type RtreeCell1 = TRtreeCell1 +type RtreeMatchArg = TRtreeMatchArg -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { +type TRtreeGeomCallback = struct { FxGeom uintptr FxQueryFunc uintptr FxDestructor uintptr FpContext uintptr } -type RtreeGeomCallback1 = TRtreeGeomCallback1 +type RtreeGeomCallback = TRtreeGeomCallback -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - FaParam [1]TRtreeDValue +type TRtreeCoord = struct { + Fi [0]int32 + Fu [0]Tu32 + Ff TRtreeValue } -type RtreeMatchArg1 = TRtreeMatchArg1 +type RtreeCoord = TRtreeCoord + +type TRtreeSearchPoint = struct { + FrScore TRtreeDValue + Fid Tsqlite3_int64 + FiLevel Tu8 + FeWithin Tu8 + FiCell Tu8 +} + +type RtreeSearchPoint = TRtreeSearchPoint + +/* Possible values for Rtree.eCoordType: */ + +// C documentation +// +// /* +// ** If SQLITE_RTREE_INT_ONLY is defined, then this virtual table will +// ** only deal with integer coordinates. No floating point operations +// ** will be done. +// */ +type TRtreeDValue = float64 + +type RtreeDValue = TRtreeDValue + +/* High accuracy coordinate */ + +type TRtreeValue = float32 + +type RtreeValue = TRtreeValue + +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -251564,7 +243435,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+27332, iNode, 0, pRtree+112) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+27478, iNode, 0, pRtree+112) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -251869,7 +243740,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+27337, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+27483, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -252786,7 +244657,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+27419) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+27565) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -253095,7 +244966,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, uint64(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -253103,7 +244974,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -253341,7 +245212,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -254272,11 +246143,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -254289,11 +246160,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -254321,7 +246192,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27433, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27579, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -254331,11 +246202,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27453, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27599, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27485, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27631, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -254549,7 +246420,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27522, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27668, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -254603,9 +246474,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 27667 + zFmt = __ccgo_ts + 27813 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+13078, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+13194, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -254663,9 +246534,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 27723, - 1: __ccgo_ts + 6874, - 2: __ccgo_ts + 18161, + 0: __ccgo_ts + 27869, + 1: __ccgo_ts + 6962, + 2: __ccgo_ts + 18324, } var _rtreeModule = Tsqlite3_module{ @@ -254709,21 +246580,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28137, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28283, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28199, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28345, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28204, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28268, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28338, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28350, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28414, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28484, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -254753,7 +246624,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 28387 + zFormat = __ccgo_ts + 28533 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -254768,31 +246639,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+28495, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+28641, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28540, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28686, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+14586, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+14702, int32(1)) } if ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28567, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28713, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28589, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28735, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28597, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28743, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -254806,14 +246677,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 27728, - 1: __ccgo_ts + 27781, - 2: __ccgo_ts + 27826, - 3: __ccgo_ts + 27878, - 4: __ccgo_ts + 27932, - 5: __ccgo_ts + 27977, - 6: __ccgo_ts + 28035, - 7: __ccgo_ts + 28090, + 0: __ccgo_ts + 27874, + 1: __ccgo_ts + 27927, + 2: __ccgo_ts + 27972, + 3: __ccgo_ts + 28024, + 4: __ccgo_ts + 28078, + 5: __ccgo_ts + 28123, + 6: __ccgo_ts + 28181, + 7: __ccgo_ts + 28236, } // C documentation @@ -254871,7 +246742,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28613, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28759, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -254879,17 +246750,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28633, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28779, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+32) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -254966,13 +246837,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28876, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+29022, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28882, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29028, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*8))), *(*uintptr)(unsafe.Pointer(argv + 3*8)))) ii = int32(4) for { if !(ii < argc) { @@ -254981,7 +246852,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28906, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29052, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -254995,19 +246866,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28933, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -255030,7 +246901,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = uint8(int32(8) + int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -255041,7 +246912,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -255057,8 +246928,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 28912, - 1: __ccgo_ts + 28923, + 0: __ccgo_ts + 29058, + 1: __ccgo_ts + 29069, } // C documentation @@ -255116,21 +246987,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+40, bp, ii, bp+1008) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+12698, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+12814, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28936, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29082, libc.VaList(bp+1064, (*(*TRtreeCell)(unsafe.Pointer(bp + 1008))).FiRowid)) jj = 0 for { if !(jj < int32((*(*TRtree)(unsafe.Pointer(bp + 40))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28942, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29088, libc.VaList(bp+1064, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 1008 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+28946, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+29092, int32(1)) goto _1 _1: ; @@ -255157,7 +247028,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28948, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29094, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -255191,23 +247062,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -255260,7 +247114,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -255275,11 +247129,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 5577 + v1 = __ccgo_ts + 5665 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28981, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+29127, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -255313,7 +247167,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28988, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29134, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -255330,7 +247184,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29033, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29179, libc.VaList(bp+8, iNode)) } } return pRet @@ -255359,8 +247213,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 29065, - 1: __ccgo_ts + 29119, + 0: __ccgo_ts + 29211, + 1: __ccgo_ts + 29265, } if *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 40 + uintptr(bLeaf)*8)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -255373,21 +247227,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 29167 + v1 = __ccgo_ts + 29313 } else { - v1 = __ccgo_ts + 29175 + v1 = __ccgo_ts + 29321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29184, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29330, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 29167 + v2 = __ccgo_ts + 29313 } else { - v2 = __ccgo_ts + 29175 + v2 = __ccgo_ts + 29321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29229, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29375, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -255432,7 +247286,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29287, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29433, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -255450,7 +247304,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29335, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29481, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -255483,19 +247337,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29402, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29548, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29436, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29582, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29466, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29612, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -255540,12 +247394,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29521, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29667, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29552, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29698, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -255574,7 +247428,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+29619, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+29765, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -255584,11 +247438,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+27433, libc.VaList(bp+96, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+27579, libc.VaList(bp+96, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+29647, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+29793, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -255604,8 +247458,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+29678, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+29685, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29824, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29831, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -255632,7 +247486,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+29693, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+29839, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -255683,13 +247537,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+29712, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29858, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 8020 + zDb = __ccgo_ts + 8107 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*8))) } @@ -255698,7 +247552,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 19939 + v1 = __ccgo_ts + 20102 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -255792,14 +247646,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -255824,16 +247670,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -256165,19 +248001,19 @@ func _geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if p != 0 { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) - Xsqlite3_str_append(tls, x, __ccgo_ts+26667, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+26813, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29763, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29909, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29774, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29920, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -256206,20 +248042,20 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) cSep = int8('\'') - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29785, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29931, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29803, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29949, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) cSep = int8(' ') goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29811, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29957, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) i = int32(1) for { if !(i < argc) { @@ -256227,14 +248063,14 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*8))) if z != 0 && *(*int8)(unsafe.Pointer(z)) != 0 { - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29819, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29965, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29823, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29969, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -256280,8 +248116,8 @@ func _geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } x0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) y0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) - x1 = float32(A*float64(x0) + B*float64(y0) + E) - y1 = float32(C*float64(x0) + D*float64(y0) + F) + x1 = float32(float64(A*float64(x0)) + float64(B*float64(y0)) + E) + y1 = float32(float64(C*float64(x0)) + float64(D*float64(y0)) + F) *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) = x1 *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) = y1 goto _1 @@ -256313,13 +248149,13 @@ func _geopolyArea(tls *libc.TLS, p uintptr) (r float64) { if !(ii < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex-int32(1)) { break } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5)) goto _1 _1: ; ii++ } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5)) return rArea } @@ -256399,16 +248235,16 @@ func _geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { func _geopolySine(tls *libc.TLS, r float64) (r1 float64) { var r2, r3, r5 float64 _, _, _ = r2, r3, r5 - if r >= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -256455,9 +248291,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -256616,13 +248452,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -256683,7 +248512,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -256722,7 +248551,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -256826,7 +248655,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { Fx float64 FeType int32 @@ -256857,36 +248686,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -256910,7 +248709,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*48 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -257194,7 +248993,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && int32((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != int32((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -257363,13 +249162,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*8)), uint64(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28876, uint64(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+29022, uint64(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29836, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29982, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -257378,13 +249177,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29858, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+30004, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*8)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28933, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -257392,7 +249191,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -257407,7 +249206,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*8)), *(*uintptr)(unsafe.Pointer(argv + 2*8)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -257619,7 +249418,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 18161 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 18324 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -257629,7 +249428,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29862 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 30008 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -257637,7 +249436,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29868 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 30014 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -257757,7 +249556,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*8)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+29877, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+30023, 0) } goto geopoly_update_end } @@ -257857,16 +249656,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29917) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30063) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29933) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30079) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -257936,7 +249735,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30110, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30256, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -257950,61 +249749,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29948, + FzName: __ccgo_ts + 30094, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29961, + FzName: __ccgo_ts + 30107, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29974, + FzName: __ccgo_ts + 30120, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29987, + FzName: __ccgo_ts + 30133, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29933, + FzName: __ccgo_ts + 30079, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 29999, + FzName: __ccgo_ts + 30145, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29917, + FzName: __ccgo_ts + 30063, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 30022, + FzName: __ccgo_ts + 30168, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30036, + FzName: __ccgo_ts + 30182, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 30049, + FzName: __ccgo_ts + 30195, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 30063, + FzName: __ccgo_ts + 30209, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30079, + FzName: __ccgo_ts + 30225, }, } @@ -258030,7 +249829,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 30091, + FzName: __ccgo_ts + 30237, }, } @@ -258055,20 +249854,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30118, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30264, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30128, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30274, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30139, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30285, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29862, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30008, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30150, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30296, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -258142,7 +249941,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = int64(uint64(64) + uint64(nArg-libc.Int32FromInt32(1))*uint64(8) + uint64(nArg)*uint64(8)) + nBlob = int64(uint64(libc.UintptrFromInt32(0)+56) + uint64(nArg)*uint64(8) + uint64(nArg)*uint64(8)) pBlob = Xsqlite3_malloc64(tls, uint64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -258170,17 +249969,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+27419, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+27565, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -258188,33 +249989,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(32)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -258411,7 +250216,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -258768,274 +250573,31 @@ type TRbuObjIter = struct { FpRbuUpdate uintptr } -type RbuObjIter = TRbuObjIter - -type TRbuState = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState = TRbuState - -type TRbuSpan = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan = TRbuSpan - -type Trbu_vfs = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs = Trbu_vfs - -type Trbu_file = struct { - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file = Trbu_file - -type TRbuUpdateStmt = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt = TRbuUpdateStmt - -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - FnProgress Ti64 - FiCookie Tu32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ +type RbuObjIter = TRbuObjIter -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 +type TRbuState = struct { + FeStage int32 + FzTbl uintptr + FzDataTbl uintptr + FzIdx uintptr + FiWalCksum Ti64 + FnRow int32 + FnProgress Ti64 + FiCookie Tu32 + FiOalSz Ti64 + FnPhaseOneStep Ti64 } -type RbuFrame1 = TRbuFrame1 +type RbuState = TRbuState -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr +type TRbuSpan = struct { + FzSpan uintptr + FnSpan int32 } -type sqlite3rbu1 = Tsqlite3rbu1 +type RbuSpan = TRbuSpan -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { +type Trbu_vfs = struct { Fbase Tsqlite3_vfs FpRealVfs uintptr Fmutex uintptr @@ -259044,16 +250606,9 @@ type Trbu_vfs1 = struct { FpMainRbu uintptr } -type rbu_vfs1 = Trbu_vfs1 +type rbu_vfs = Trbu_vfs -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { +type Trbu_file = struct { Fbase Tsqlite3_file FpReal uintptr FpRbuVfs uintptr @@ -259072,7 +250627,15 @@ type Trbu_file1 = struct { FpMainRbuNext uintptr } -type rbu_file1 = Trbu_file1 +type rbu_file = Trbu_file + +type TRbuUpdateStmt = struct { + FzMask uintptr + FpUpdate uintptr + FpNext uintptr +} + +type RbuUpdateStmt = TRbuUpdateStmt /* ** True for an RBU vacuum handle, or false otherwise. @@ -259387,7 +250950,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+30160, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30306, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -259397,7 +250960,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+30160, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30306, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -259423,7 +250986,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -259446,7 +251009,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -259578,7 +251141,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30181, uintptr(0), uintptr(0), p+64) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30327, uintptr(0), uintptr(0), p+64) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -259667,7 +251230,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+27332, zIn, uint64(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+27478, zIn, uint64(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -259704,13 +251267,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint64(192)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 30352 + v1 = __ccgo_ts + 30498 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30393, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30539, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+30543) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+8, p+64, __ccgo_ts+30689) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -259877,7 +251440,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -259938,7 +251501,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30668, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30814, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -259948,7 +251511,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30787, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30933, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -259956,7 +251519,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && int32(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30808, libc.VaList(bp+40, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30954, libc.VaList(bp+40, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -259968,7 +251531,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30859, libc.VaList(bp+40, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31005, libc.VaList(bp+40, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -260012,7 +251575,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint64(1)*uint64((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30880, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31026, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -260025,7 +251588,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint64(1)*uint64((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+24, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) if iCid >= 0 { @@ -260078,7 +251641,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+72, bp+8, pIter+108) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+21447, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+21610, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -260089,7 +251652,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30937, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31083, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -260100,7 +251663,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+30956, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+31102, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+56) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 16 @@ -260108,7 +251671,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*8)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+30961, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+31107, zName) { bRbuRowid = int32(1) } } @@ -260122,17 +251685,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 30971 + v4 = __ccgo_ts + 31117 } else { - v4 = __ccgo_ts + 30984 + v4 = __ccgo_ts + 31130 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30993, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31139, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31022, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31168, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -260154,7 +251717,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31044, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31190, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -260193,15 +251756,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+31071, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31217, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 16575 goto _1 _1: ; @@ -260226,7 +251789,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 for int32(1) != 0 { i = 0 for { @@ -260235,7 +251798,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31080, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31226, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -260283,21 +251846,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31093, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31239, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31125, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31271, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1673, __ccgo_ts+16459, __ccgo_ts+31148) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31154, __ccgo_ts+31161, __ccgo_ts+6480) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1673, __ccgo_ts+16459, __ccgo_ts+1673) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16575, __ccgo_ts+31294) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31300, __ccgo_ts+31307, __ccgo_ts+6568) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16575, __ccgo_ts+1674) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31169, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31315, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31211, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31357, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -260346,10 +251909,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -260371,15 +251934,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { - zCol = __ccgo_ts + 31231 + zCol = __ccgo_ts + 31377 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31239, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31260, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31296, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 16459 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31385, libc.VaList(bp+24, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31406, libc.VaList(bp+24, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31442, libc.VaList(bp+24, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 16575 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -260388,9 +251951,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31323, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31469, libc.VaList(bp+24, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -260405,15 +251968,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+31371, libc.VaList(bp+24, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 16459 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+31517, libc.VaList(bp+24, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 16575 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31378, libc.VaList(bp+24, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31524, libc.VaList(bp+24, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -260467,11 +252030,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1673 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1673 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1674 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1674 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -260480,8 +252043,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31390, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) - zType = __ccgo_ts + 1673 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31536, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*16))).FzSpan, zCollate)) + zType = __ccgo_ts + 1674 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -260500,34 +252063,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 31231 + zCol = __ccgo_ts + 31377 } else { - zCol = __ccgo_ts + 30961 + zCol = __ccgo_ts + 31107 } } - zType = __ccgo_ts + 1147 + zType = __ccgo_ts + 1148 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*8)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31412, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31558, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 31148 + v2 = __ccgo_ts + 31294 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31432, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31578, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31453, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31486, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31599, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31632, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 16459 - zAnd = __ccgo_ts + 23556 + zCom = __ccgo_ts + 16575 + zAnd = __ccgo_ts + 23719 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -260573,7 +252136,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1673 + zS = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -260581,11 +252144,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+31510, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31656, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+31522, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31668, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 16459 + zS = __ccgo_ts + 16575 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -260597,7 +252160,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31531, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31677, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -260623,27 +252186,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31546, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31692, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31560, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 23556 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31706, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 23719 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+31572, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31718, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1673 + zSep1 = __ccgo_ts + 1674 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -260651,8 +252214,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*8)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+31622, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 23556 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31768, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 23719 } goto _2 _2: @@ -260675,7 +252238,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31635, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31781, 0) } // C documentation @@ -260709,7 +252272,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if int32(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -260717,16 +252280,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31622, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31768, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 16575 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31661, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31807, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 16575 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31691, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31837, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*8)), i+int32(1))) + zSep = __ccgo_ts + 16575 } } } @@ -260810,16 +252373,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 31728 + zSep = __ccgo_ts + 31874 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30880, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31026, libc.VaList(bp+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+18049) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+18212) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+24, zIdx))) } break } @@ -260830,16 +252393,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) != 0 { - v1 = __ccgo_ts + 31148 + v1 = __ccgo_ts + 31294 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+31741, libc.VaList(bp+24, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 16459 + z = _rbuMPrintf(tls, p, __ccgo_ts+31887, libc.VaList(bp+24, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 16575 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+31752, libc.VaList(bp+24, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+31898, libc.VaList(bp+24, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) } return z @@ -260879,13 +252442,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1673 + zComma = __ccgo_ts + 1674 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+31756) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+31902) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -260893,7 +252456,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+24, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { @@ -260902,21 +252465,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+31806, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+31952, libc.VaList(bp+24, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*8)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 31148 + v1 = __ccgo_ts + 31294 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+31828, libc.VaList(bp+24, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 16459 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+31974, libc.VaList(bp+24, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 16575 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+31838, libc.VaList(bp+24, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+31984, libc.VaList(bp+24, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31853, libc.VaList(bp+24, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31999, libc.VaList(bp+24, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, 0)) } } @@ -260951,30 +252514,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1673 + zComma = __ccgo_ts + 1674 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1673 + zPk = __ccgo_ts + 1674 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*8)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 31915 + zPk = __ccgo_ts + 32061 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 31928 + v2 = __ccgo_ts + 32074 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31938, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 16459 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32084, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*8)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 16575 goto _1 _1: ; @@ -260983,17 +252546,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31965, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32111, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 31972 + v3 = __ccgo_ts + 32118 } else { - v3 = __ccgo_ts + 1673 + v3 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31987, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32133, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, 0)) } } @@ -261019,7 +252582,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32019, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+152, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32165, libc.VaList(bp+8, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -261065,7 +252628,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 8)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+32076) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+64, __ccgo_ts+32222) } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 8)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -261234,7 +252797,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+32142, libc.VaList(bp+40, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+32288, libc.VaList(bp+40, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -261251,18 +252814,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+8, bp+16, bp+24) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 24))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32162, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32308, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+40, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32227, libc.VaList(bp+40, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32373, libc.VaList(bp+40, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32263, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+32409, libc.VaList(bp+40, zTbl, *(*uintptr)(unsafe.Pointer(bp + 16))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -261277,26 +252840,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 32297 + v2 = __ccgo_ts + 32443 } else { - v2 = __ccgo_ts + 32301 + v2 = __ccgo_ts + 32447 } v1 = v2 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32307, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32453, libc.VaList(bp+40, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32368, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32514, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 32297 + v3 = __ccgo_ts + 32443 } else { - v3 = __ccgo_ts + 32301 + v3 = __ccgo_ts + 32447 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32429, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32575, libc.VaList(bp+40, zCollist, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -261315,62 +252878,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8031) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8027) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8118) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8114) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1673 + v4 = __ccgo_ts + 1674 } else { - v4 = __ccgo_ts + 32588 + v4 = __ccgo_ts + 32734 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 32597 + v5 = __ccgo_ts + 32743 } else { - v5 = __ccgo_ts + 1673 + v5 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32607, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+136, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32753, libc.VaList(bp+40, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32643, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+144, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32789, libc.VaList(bp+40, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1673 + zRbuRowid = __ccgo_ts + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 32671 + zRbuRowid = __ccgo_ts + 32817 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 32683 + v6 = __ccgo_ts + 32829 } else { - v6 = __ccgo_ts + 1673 + v6 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32700, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32776, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32846, libc.VaList(bp+40, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32922, libc.VaList(bp+40, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33075, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33221, libc.VaList(bp+40, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1673 + zRbuRowid1 = __ccgo_ts + 1674 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 33174 + v7 = __ccgo_ts + 33320 } else { - v7 = __ccgo_ts + 33184 + v7 = __ccgo_ts + 33330 } zRbuRowid1 = v7 } @@ -261383,28 +252946,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31231, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31377, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1673, __ccgo_ts+16459, __ccgo_ts+1673) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16575, __ccgo_ts+1674) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 33195 + v8 = __ccgo_ts + 33341 } else { - v8 = __ccgo_ts + 1673 + v8 = __ccgo_ts + 1674 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1673 + v9 = __ccgo_ts + 1674 } if zOrder != 0 { - v10 = __ccgo_ts + 24812 + v10 = __ccgo_ts + 24975 } else { - v10 = __ccgo_ts + 1673 + v10 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+33201, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+128, pz, Xsqlite3_mprintf(tls, __ccgo_ts+33347, libc.VaList(bp+40, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -261490,11 +253053,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1673 + zPrefix = __ccgo_ts + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 32588 + zPrefix = __ccgo_ts + 32734 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33249, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33395, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+8, p+64, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -261521,7 +253084,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -261568,7 +253131,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+33279, libc.VaList(bp+24, p+48))) + *(*int32)(unsafe.Pointer(bp + 8)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+33425, libc.VaList(bp+24, p+48))) for *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -261627,27 +253190,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+33309, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+33455, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33337, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+48, __ccgo_ts+15317, uint64(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33483, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+15433, uint64(4)) } else { - libc.Xmemcpy(tls, p+48, __ccgo_ts+8020, uint64(4)) + libc.Xmemcpy(tls, p+48, __ccgo_ts+8107, uint64(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33355, libc.VaList(bp+8, p+48)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33501, libc.VaList(bp+8, p+48)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -261680,10 +253243,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33421, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33567, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26155, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint64(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26318, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint64(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -261697,16 +253260,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 33453 + v2 = __ccgo_ts + 33599 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1673 + v3 = __ccgo_ts + 1674 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33455, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33601, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -261717,27 +253280,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33487, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33633, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33502, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33648, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33519, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33665, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33535, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33681, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33563, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33709, 0) } } @@ -261787,7 +253350,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = int64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -261889,7 +253452,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -261962,12 +253525,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = int64((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = int64((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -261989,21 +253552,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -262020,7 +253583,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+33616, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+33762, 0) } // C documentation @@ -262037,13 +253600,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33641, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33648, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33787, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33794, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -262175,7 +253738,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+25712, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+25875, 0) return } if eType == int32(RBU_DELETE) && int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -262311,7 +253874,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+33655) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+64, __ccgo_ts+33801) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -262324,7 +253887,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33677, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33823, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -262351,7 +253914,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+33704, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), int64((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+33850, libc.VaList(bp+16, p+48, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), int64((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -262387,9 +253950,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+33864, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+34010, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33879, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34025, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -262412,9 +253975,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33899, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34045, uintptr(0), uintptr(0), p+64) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+33924) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34070) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -262425,10 +253988,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34032) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34178) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+34097) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+8, p+64, __ccgo_ts+34243) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -262446,7 +254009,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34141, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34287, uintptr(0), uintptr(0), p+64) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -262473,8 +254036,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+19155) - _rbuCopyPragma(tls, p, __ccgo_ts+18245) + _rbuCopyPragma(tls, p, __ccgo_ts+19318) + _rbuCopyPragma(tls, p, __ccgo_ts+18408) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -262482,7 +254045,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34166, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34312, libc.VaList(bp+16, p+48, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -262504,10 +254067,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16363, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16479, uintptr(0), uintptr(0), p+64) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16363, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16479, uintptr(0), uintptr(0), p+64) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -262521,10 +254084,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -262594,7 +254157,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34194, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34340, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -262617,10 +254180,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+33641, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+33787, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -262642,7 +254205,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+34219, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+34365, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -262689,7 +254252,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+34230, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+34376, libc.VaList(bp+24, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 8)), -int32(1)) } else { @@ -262734,11 +254297,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34302, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34448, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34316) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34462) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -262747,7 +254310,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34373) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+64, __ccgo_ts+34519) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -262795,7 +254358,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint64(1)) pCsr += uintptr(nRbu + uint64(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+4710, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+4829, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -262827,7 +254390,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34447, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34593, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -262849,17 +254412,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 34479 + v3 = __ccgo_ts + 34625 } else { - v3 = __ccgo_ts + 34486 + v3 = __ccgo_ts + 34632 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34493, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34639, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16348, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16464, uintptr(0), uintptr(0), p+64) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+88) @@ -262871,21 +254434,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+18869) - _rbuCopyPragma(tls, p, __ccgo_ts+18260) + _rbuCopyPragma(tls, p, __ccgo_ts+19032) + _rbuCopyPragma(tls, p, __ccgo_ts+18423) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34525, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34671, uintptr(0), uintptr(0), p+64) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34541, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34687, uintptr(0), uintptr(0), p+64) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -262963,7 +254526,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+34565, zState+uintptr(n-uint64(7)), uint64(7)) { + if n >= uint64(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+34711, zState+uintptr(n-uint64(7)), uint64(7)) { return _rbuMisuseError(tls) } } @@ -263010,7 +254573,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(uint64(i) < nErrmsg-uint64(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+32588, uint64(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+32734, uint64(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) <= int32('9') { nDel++ @@ -263038,16 +254601,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16363, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16479, uintptr(0), uintptr(0), p+64) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16363, uintptr(0), uintptr(0), p+64) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16479, uintptr(0), uintptr(0), p+64) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+88) @@ -263057,7 +254620,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34573, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34719, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -263158,32 +254721,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16363, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16479, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16363, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16479, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 16348 + v1 = __ccgo_ts + 16464 } else { - v1 = __ccgo_ts + 34525 + v1 = __ccgo_ts + 34671 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34525, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34671, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -263209,9 +254772,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -263283,7 +254848,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -263486,7 +255051,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -263537,14 +255102,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, uint64(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= int32(libc.Uint64FromInt64(2048)/libc.Uint64FromInt64(64)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -265120,7 +256624,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+34668, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+34814, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*64))).FzPath = v4 if z == uintptr(0) { @@ -265143,13 +256647,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34676 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34822 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34685 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34831 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34690 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34836 break } *(*int32)(unsafe.Pointer(pCsr + 2108)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -265158,7 +256662,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -265247,12 +256751,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34700, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34846, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*32))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34855, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+35001, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34869, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+35015, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -265329,7 +256833,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+34884, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+35030, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -265469,315 +256973,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -266623,20 +257818,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13078, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13194, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34891, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35037, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1673, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1674, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35021, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35167, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -266662,7 +257857,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+31231)) + nByte = Tsqlite3_int64(uint64(nByte) + libc.Xstrlen(tls, __ccgo_ts+31377)) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { nByte = Tsqlite3_int64(uint64(nByte) + uint64(nDbCol)*(libc.Uint64FromInt64(8)*libc.Uint64FromInt32(2)+libc.Uint64FromInt64(4)+libc.Uint64FromInt64(1)+libc.Uint64FromInt32(1)+libc.Uint64FromInt32(1))) @@ -266686,8 +257881,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+31231) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31231, nName+uint64(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+31377) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31377, nName+uint64(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)) = pAlloc pAlloc += uintptr(nName + uint64(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -266751,7 +257946,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -266768,6 +257963,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _, _ = i, rc, v1, p3 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 28 } else { @@ -266789,7 +257986,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13078, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13194, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -267084,10 +258281,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 16)) = SQLITE_OK - zSep = __ccgo_ts + 12698 + zSep = __ccgo_ts + 12814 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+35051, 0) + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+35197, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -267096,11 +258293,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*8)) } else { - v2 = __ccgo_ts + 1674 + v2 = __ccgo_ts + 1675 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+6450, libc.VaList(bp+32, zSep, zDflt)) - zSep = __ccgo_ts + 16459 + _sessionAppendPrintf(tls, bp, bp+16, __ccgo_ts+6538, libc.VaList(bp+32, zSep, zDflt)) + zSep = __ccgo_ts + 16575 goto _1 _1: ; @@ -267181,13 +258378,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -267419,7 +258609,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1673, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1674, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -267679,14 +258869,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -267746,7 +258928,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 zRet = uintptr(0) i = 0 for { @@ -267754,8 +258936,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35058, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 23556 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35204, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 23719 if zRet == uintptr(0) { break } @@ -267774,7 +258956,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 zRet = uintptr(0) bHave = 0 i = 0 @@ -267784,8 +258966,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if int32(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35092, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) - zSep = __ccgo_ts + 35133 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35238, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + zSep = __ccgo_ts + 35279 if zRet == uintptr(0) { break } @@ -267796,7 +258978,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1793, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1820, 0) } return zRet } @@ -267807,12 +258989,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 35138 + v1 = __ccgo_ts + 35284 } else { - v1 = __ccgo_ts + 8025 + v1 = __ccgo_ts + 8112 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35149, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35295, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -267873,11 +259055,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 16459 + v2 = __ccgo_ts + 16575 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35228, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35374, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*8)))) if !(zRet != 0) { break } @@ -267905,7 +259087,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+35247, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+35393, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -267934,17 +259116,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(48) - defer tls.Free(48) + bp := tls.Alloc(80) + defer tls.Free(80) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+32 */ uintptr var _ /* azCol at bp+40 */ uintptr var _ /* bRowid at bp+28 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+24 */ int32 + var _ /* pDbExists at bp+48 */ uintptr var _ /* pTo at bp+16 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint64(16)) @@ -267957,7 +259140,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+16) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { goto diff_out } @@ -267968,18 +259153,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 24)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 28)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 28 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+35450, libc.VaList(bp+64, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 48)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+48, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 24)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 48))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 24)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 28 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+24, uintptr(0), uintptr(0), bp+40, uintptr(0), uintptr(0), bp+32, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FnCol != *(*int32)(unsafe.Pointer(bp + 24)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 24)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35481, libc.VaList(bp+64, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -268005,7 +259216,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 40))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35304, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35502, 0) } rc = int32(SQLITE_SCHEMA) } @@ -268165,15 +259376,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -268337,7 +259550,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, int32(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+6512, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, int32(libc.Uint64FromInt64(24)-libc.Uint64FromInt32(1)), bp, __ccgo_ts+6600, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -268631,18 +259844,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 24)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 56)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+24, __ccgo_ts+35331, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13078, zTab) { - _sessionAppendStr(tls, bp+24, __ccgo_ts+35335, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+35359, bp) - _sessionAppendStr(tls, bp+56, __ccgo_ts+35368, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35413, bp) + _sessionAppendStr(tls, bp+24, __ccgo_ts+35529, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13194, zTab) { + _sessionAppendStr(tls, bp+24, __ccgo_ts+35533, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+35557, bp) + _sessionAppendStr(tls, bp+56, __ccgo_ts+35566, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35611, bp) } else { i = 0 for { @@ -268650,17 +259863,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+16459, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+16575, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+40, zSep, bp) _sessionAppendStr(tls, bp+56, zSep, bp) - zSep = __ccgo_ts + 16459 + zSep = __ccgo_ts + 16575 _sessionAppendIdent(tls, bp+40, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)), bp) - _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+35427, libc.VaList(bp+80, i+int32(1))) + _sessionAppendPrintf(tls, bp+56, bp, __ccgo_ts+35625, libc.VaList(bp+80, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+35431, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) + _sessionAppendPrintf(tls, bp+24, bp, __ccgo_ts+35629, libc.VaList(bp+80, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*8)))) } goto _1 _1: @@ -268672,9 +259885,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+35458, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+35656, libc.VaList(bp+80, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 56))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -268795,7 +260008,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -268809,14 +260022,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+35500, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 16)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+35698, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 16)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -268885,8 +260098,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -268911,18 +260124,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 16)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 16)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+35520, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35718, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 16)) } @@ -268946,28 +260159,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -269106,7 +260323,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -269121,9 +260338,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint64(152)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -269152,20 +260369,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -269177,13 +260398,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), uint64(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), uint64(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -269339,7 +260561,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -269363,7 +260585,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -269378,7 +260600,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -269434,7 +260656,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -269539,7 +260761,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+72, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -269610,8 +260832,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -269645,7 +260867,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -269655,7 +260877,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = int32(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -269734,7 +260956,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*8)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*8)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -269995,7 +261217,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(64) defer tls.Free(64) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -270144,11 +261366,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -270160,8 +261382,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } goto finished_invert @@ -270189,12 +261411,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(80) defer tls.Free(80) var rc int32 @@ -270202,9 +261428,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint64(72)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -270217,14 +261443,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -270248,29 +261466,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -270347,18 +261542,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = int32(uint64(24) * uint64(nU32) * uint64(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+13078) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+13194) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 libc.Xmemset(tls, bp+8, 0, uint64(16)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*24 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, uint64(nU32)*uint64(4)) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35538, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35736, bp) _sessionAppendIdent(tls, bp+8, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35551, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35749, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -270368,9 +261563,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if int32(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35557, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35755, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 16459 + zSep = __ccgo_ts + 16575 } goto _2 _2: @@ -270378,8 +261573,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1673 - _sessionAppendStr(tls, bp+8, __ccgo_ts+35562, bp) + zSep = __ccgo_ts + 1674 + _sessionAppendStr(tls, bp+8, __ccgo_ts+35760, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -270388,13 +261583,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*8)) != 0 { _sessionAppendStr(tls, bp+8, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+8, __ccgo_ts+35570, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35768, bp) } else { _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35645, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35843, bp) _sessionAppendInteger(tls, bp+8, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 23556 + zSep = __ccgo_ts + 23719 } goto _3 _3: @@ -270477,13 +261672,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+8 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+8, __ccgo_ts+35651, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35849, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35562, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35760, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -270493,9 +261688,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35557, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35755, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 23556 + zSep = __ccgo_ts + 23719 } goto _1 _1: @@ -270503,10 +261698,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+8, __ccgo_ts+35669, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35867, bp) _sessionAppendInteger(tls, bp+8, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35133, bp) - zSep = __ccgo_ts + 1673 + _sessionAppendStr(tls, bp+8, __ccgo_ts+35279, bp) + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -270515,16 +261710,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+8, zSep, bp) _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+35645, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35843, bp) _sessionAppendInteger(tls, bp+8, i+int32(1), bp) - zSep = __ccgo_ts + 35677 + zSep = __ccgo_ts + 35875 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+6480, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+6568, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+8, uintptr(0)) @@ -270550,7 +261745,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+8020, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) + return _sessionSelectStmt(tls, db, int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+8107, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+24) } // C documentation @@ -270573,16 +261768,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 8)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+8, __ccgo_ts+35682, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35880, bp) _sessionAppendIdent(tls, bp+8, zTab, bp) - _sessionAppendStr(tls, bp+8, __ccgo_ts+23562, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+23725, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+8, __ccgo_ts+16459, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+16575, bp) } _sessionAppendIdent(tls, bp+8, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)), bp) goto _1 @@ -270590,19 +261785,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+35700, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35898, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+8, __ccgo_ts+35711, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+35909, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+8, __ccgo_ts+6480, bp) + _sessionAppendStr(tls, bp+8, __ccgo_ts+6568, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf, p+16, uintptr(0)) } @@ -270625,12 +261820,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+13078, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+13194, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+35715) + rc = _sessionPrepare(tls, db, p+16, __ccgo_ts+35913) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35828) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+36026) } return rc } @@ -270674,7 +261869,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -270692,11 +261887,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -270873,7 +262068,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aBlob uintptr @@ -270897,7 +262092,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -270912,7 +262107,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -270963,7 +262158,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var abPK, pNew, pOld, v1 uintptr @@ -271003,10 +262198,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -271044,11 +262239,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -271071,7 +262266,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -271090,7 +262285,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -271099,7 +262294,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -271109,10 +262304,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35972, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36170, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -271122,10 +262317,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35993, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36191, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -271138,7 +262333,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -271165,7 +262360,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 8)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -271193,7 +262388,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(352) defer tls.Free(352) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -271225,15 +262420,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36012, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36210, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36038, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36236, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+144, bp+136, bp+140, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 144)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -271257,9 +262452,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 144)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp + 144)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -271269,7 +262464,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+152, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+8020, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+8107, *(*uintptr)(unsafe.Pointer(bp + 144)), bp+8+32, uintptr(0), bp, bp+8+40, uintptr(0), uintptr(0), bp+8+48, bp+8+124) if rc != SQLITE_OK { break } @@ -271288,18 +262483,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36068, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36266, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol < *(*int32)(unsafe.Pointer(bp + 136)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36112, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36310, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol, *(*int32)(unsafe.Pointer(bp + 136)))) } else { if *(*int32)(unsafe.Pointer(bp + 136)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 152)), uint64(*(*int32)(unsafe.Pointer(bp + 136)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36183, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36381, libc.VaList(bp+328, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FnCol = *(*int32)(unsafe.Pointer(bp + 136)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+13078) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+13194) { v2 = _sessionStat1Sql(tls, db, bp+8) rc = v2 if v2 != 0 { @@ -271333,7 +262528,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+8, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -271342,7 +262537,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+8, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+160, bp+164, 0) @@ -271350,23 +262545,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+168, 0, uint64(152)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 168))).FnCol = *(*int32)(unsafe.Pointer(bp + 160)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+168) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36243, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36441, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36273, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36471, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+36297, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+36273, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36495, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36471, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 8))).FbRebase != 0 { @@ -271389,13 +262584,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -271404,11 +262603,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -271416,10 +262619,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -271427,37 +262636,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -272033,7 +263234,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 @@ -272068,8 +263269,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+8, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf = 0 } goto _3 @@ -272088,9 +263289,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 8))).FnBuf) } } else { if ppOut != 0 { @@ -272142,7 +263343,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -272178,11 +263379,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -272195,18 +263402,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -272214,13 +263423,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -272262,12 +263473,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -272275,27 +263492,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -272450,7 +263658,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var bDone, iHash, v2 int32 @@ -272558,8 +263766,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+24, uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+24, *(*uintptr)(unsafe.Pointer(bp + 8)), *(*int32)(unsafe.Pointer(bp + 16)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -272571,9 +263779,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+24, 0, uint64(16)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 24))).FnBuf) } } else { if ppOut != 0 { @@ -272647,21 +263855,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -272767,6 +263979,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -272812,24 +264025,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -272888,99 +264089,6 @@ type TFts5TokenizerConfig = struct { type Fts5TokenizerConfig = TFts5TokenizerConfig -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 - /* ** End of interface to code in fts5_config.c. **************************************************************************/ @@ -273002,14 +264110,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { Fa uintptr Fn int32 @@ -273021,29 +264121,12 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { FiPrev Ti64 } type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -273099,15 +264182,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -273129,14 +264203,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -273207,7 +264273,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr } type Fts5ExprNode = TFts5ExprNode @@ -273235,27 +264300,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { Fwriter TFts5PoslistWriter FbOk int32 @@ -273286,7 +264342,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -273822,14 +264878,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -273840,16 +264888,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -273901,10 +264939,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(2432)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(2432)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -274010,12 +265048,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -274090,7 +265128,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36325, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36523, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -274446,7 +265484,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36353, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36551, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -274607,18 +265645,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -274701,22 +265727,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -274735,7 +265745,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = int32(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+36384, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+36582, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -274834,7 +265844,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+104 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 36391 + zErr = __ccgo_ts + 36589 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -274845,7 +265855,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 104)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+24, bp+32) if *(*int32)(unsafe.Pointer(bp + 104)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1673, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1674, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 104)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -274894,16 +265904,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -275051,7 +266051,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } return v1 } @@ -275089,7 +266089,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 112)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 36441 + zErr = __ccgo_ts + 36639 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -275271,15 +266271,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - FnPhrase int32 - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -275360,7 +266351,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -275452,13 +266443,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -275484,13 +266475,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 36489 + z = __ccgo_ts + 36687 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 36545 + z1 = __ccgo_ts + 36743 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -275523,19 +266514,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 36603, + FzFunc: __ccgo_ts + 36801, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 36611, + FzFunc: __ccgo_ts + 36809, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 36621, + FzFunc: __ccgo_ts + 36819, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 36626, + FzFunc: __ccgo_ts + 36824, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -275923,7 +266914,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -276010,21 +267001,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -276195,7 +267171,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1659, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1660, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -276333,13 +267309,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -276399,7 +267368,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = int32(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+36642, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36840, zCmd, nCmd) == 0 { nByte = int32(libc.Uint64FromInt64(4) * libc.Uint64FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -276425,12 +267394,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36649, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36847, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36680, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+80, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -276439,7 +267408,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36713, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36911, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -276449,14 +267418,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36750, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36948, zCmd, nCmd) == 0 { p1 = zArg nArg = int64(libc.Xstrlen(tls, zArg) + uint64(1)) azArg = _sqlite3Fts5MallocZero(tls, bp, int64((libc.Uint64FromInt64(8)+libc.Uint64FromInt32(2))*uint64(nArg))) if azArg != 0 { pSpace = azArg + uintptr(nArg)*8 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36759, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36957, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -276483,7 +267452,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36792, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36990, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -276495,76 +267464,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36826, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37024, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36834, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37032, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36866, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37064, libc.VaList(bp+80, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36872, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37070, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36891, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37089, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36934, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37132, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36891, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37089, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36956, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37154, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36970, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37168, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37008, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37206, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37019, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37217, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37054, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37252, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37061, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37259, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+6889, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+6977, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 8)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 9714, + FzName: __ccgo_ts + 9801, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 19225, + FzName: __ccgo_ts + 19388, }, 2: { - FzName: __ccgo_ts + 37092, + FzName: __ccgo_ts + 37290, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -276572,20 +267541,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+8, zArg, pConfig+116) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37100, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37298, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37131, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37329, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37141, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37339, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37175, libc.VaList(bp+80, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37373, libc.VaList(bp+80, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -276646,16 +267615,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+37203) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18161) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37208, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+37401) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18324) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37406, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37238) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37436) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37248, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37446, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -276681,7 +267650,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 8)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37279, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37477, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -276689,12 +267658,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37284, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37482, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*8)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37291, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37489, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37299, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37497, 0) } } goto _1 @@ -276710,9 +267679,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37306, libc.VaList(bp+32, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37504, libc.VaList(bp+32, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37299, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+8, __ccgo_ts+37497, 0) } goto _2 _2: @@ -276775,8 +267744,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*8)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+37203) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37314, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+37401) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37512, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -276807,19 +267776,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37343, libc.VaList(bp+40, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37541, libc.VaList(bp+40, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1673 + v4 = __ccgo_ts + 1674 } if *(*uintptr)(unsafe.Pointer(bp + 16)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 16)) } else { - v5 = __ccgo_ts + 1673 + v5 = __ccgo_ts + 1674 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -276837,7 +267806,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37363, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37561, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -276845,37 +267814,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37413, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37611, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37468, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37666, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 36826 + zTail = __ccgo_ts + 37024 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 36826 + zTail = __ccgo_ts + 37024 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 37521 + zTail = __ccgo_ts + 37719 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37529, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37727, libc.VaList(bp+40, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+18161, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+18324, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -276944,25 +267913,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37540, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37738, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 16459 + v2 = __ccgo_ts + 16575 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37556, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37754, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*8)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37563, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37203)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37761, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37401)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -276995,7 +267964,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -277005,9 +267974,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -277120,7 +268089,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+8 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37589) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37787) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -277131,7 +268100,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37594) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37792) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -277142,7 +268111,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37603) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37801) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -277156,7 +268125,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37613) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37811) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -277167,7 +268136,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37623) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37821) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -277184,7 +268153,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37635) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37833) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -277199,7 +268168,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37203) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37401) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+8) if rc == SQLITE_OK { @@ -277214,7 +268183,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37647) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37845) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -277230,7 +268199,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37661) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37859) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -277273,7 +268242,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+8 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 37671 + zSelect = __ccgo_ts + 37869 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 8)) = SQLITE_OK iVersion = 0 @@ -277293,7 +268262,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+37703) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+37901) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 12)) = 0 @@ -277304,7 +268273,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 8)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 8)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+37711, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+37909, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -277369,112 +268338,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -277550,7 +268413,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37782, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37980, 0) return FTS5_EOF } goto _1 @@ -277561,7 +268424,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z2) - int64(z)) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37802, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38000, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -277576,13 +268439,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(int64(z21) - int64(z)) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37833, uint64(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38031, uint64(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37836, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38034, uint64(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+32297, uint64(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+32443, uint64(3)) == 0 { tok = int32(FTS5_AND) } break @@ -277626,7 +268489,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = int32(libc.Uint64FromInt64(8) * uint64((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+16, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -278159,16 +269022,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - Fa uintptr - Fn int32 - Fi int32 - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+12, p+24) != 0 { @@ -278193,14 +269046,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -279265,7 +270110,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = int64(uint64(32) + uint64(SZALLOC)*uint64(8)) + nByte = int64(uint64(libc.UintptrFromInt32(0)+24) + uint64(SZALLOC+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_malloc64(tls, uint64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -279275,7 +270120,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = int64(uint64(32) + uint64(nNew)*uint64(8)) + nByte1 = int64(uint64(libc.UintptrFromInt32(0)+24) + uint64(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = Xsqlite3_realloc64(tls, pNear, uint64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -279321,14 +270166,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -279381,12 +270218,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(72)+uint64(40)*uint64(nNew)) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(libc.UintptrFromInt32(0)+32)+uint64(nNew+libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint64(72)) + libc.Xmemset(tls, pNew, 0, uint64(libc.UintptrFromInt32(0)+32)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40)) } v3 = pNew pPhrase = v3 @@ -279520,7 +270357,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(uint64(libc.UintptrFromInt32(0)+32)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 32 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*40))).FbPrefix = uint8(bPrefix) @@ -279560,15 +270397,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(8)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(56)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(uint64(libc.UintptrFromInt32(0)+48)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, int64(libc.Uint64FromInt64(32)+libc.Uint64FromInt64(8))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, int64(uint64(libc.UintptrFromInt32(0)+24)+uint64(libc.Int32FromInt32(2))*libc.Uint64FromInt64(8))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = int64(uint64(8) + uint64((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = int64(libc.Uint64FromInt64(8) * uint64(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, uint64(nByte)) @@ -279609,7 +270446,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(72)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(uint64(libc.UintptrFromInt32(0)+32)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 8))).FpPhrase != 0 { @@ -279647,8 +270484,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+37840, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36353, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+38038, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint64(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36551, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -279668,10 +270505,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37845, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38043, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -279705,7 +270545,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(8)+uint64(4)*uint64(nCol)) + pNew = Xsqlite3_realloc64(tls, p, libc.Uint64FromInt64(8)*uint64((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -279755,7 +270595,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(uint64(8)+uint64(4)*uint64(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(libc.Uint64FromInt64(8)*uint64((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -279806,7 +270646,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+22559, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+22722, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -279833,7 +270673,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = int64(uint64(8) + uint64((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint64(4)) + nByte = int64(libc.Uint64FromInt64(8) * uint64(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, uint64(nByte)) @@ -279930,7 +270770,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37874, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38072, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -280015,7 +270855,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 24)))).FnTerm - nByte = int32(uint64(56) + uint64(nTerm)*uint64(8)) + nByte = int32(uint64(libc.UintptrFromInt32(0)+48) + uint64(nTerm+libc.Int32FromInt32(1))*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -280028,7 +270868,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(72)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+16, int64(uint64(libc.UintptrFromInt32(0)+32)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(40))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -280102,7 +270942,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = int64(uint64(56) + uint64(8)*uint64(nChild-libc.Int32FromInt32(1))) + nByte = int64(uint64(libc.UintptrFromInt32(0)+48) + uint64(nChild)*libc.Uint64FromInt64(8)) pRet = _sqlite3Fts5MallocZero(tls, pParse+16, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -280128,11 +270968,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 24)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 32))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 37927 + v2 = __ccgo_ts + 38125 } else { - v2 = __ccgo_ts + 37840 + v2 = __ccgo_ts + 38038 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37934, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38132, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -280145,7 +270985,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37984, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38182, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -280266,14 +271106,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -280313,14 +271145,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { FpExpr uintptr FaPopulator uintptr @@ -280622,7 +271446,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -280685,67 +271509,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -281627,9 +272391,9 @@ type TFts5Data = struct { type Fts5Data = TFts5Data type TFts5DlidxIter = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl + F__ccgo_align [0]uint64 + FnLvl int32 + FiSegid int32 } type Fts5DlidxIter = TFts5DlidxIter @@ -281666,7 +272430,6 @@ type TFts5Iter = struct { FbSkipEmpty Tu8 FiSwitchRowid Ti64 FaFirst uintptr - FaSeg [1]TFts5SegIter } type Fts5Iter = TFts5Iter @@ -281739,7 +272502,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel } type Fts5Structure = TFts5Structure @@ -281774,7 +272536,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -281789,149 +272550,13 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + F__ccgo_align [0]uint64 + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - FiStructVersion Ti64 - FpStruct uintptr -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - FaEof uintptr - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - FnRef int32 - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -281939,187 +272564,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - FiRowid Ti64 - FnPos int32 - FbDel Tu8 -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - FiSwitchRowid Ti64 - FaFirst uintptr - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = uint8(int32(iVal) >> libc.Int32FromInt32(8)) @@ -282299,7 +272744,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38037, iRowid, 0, p+72) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38235, iRowid, 0, p+72) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -282404,7 +272849,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+38043, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+80, Xsqlite3_mprintf(tls, __ccgo_ts+38241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -282433,7 +272878,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38094, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38292, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+88, zSql) != 0 { return } @@ -282467,7 +272912,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+38143, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+104, Xsqlite3_mprintf(tls, __ccgo_ts+38341, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -282545,7 +272990,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = int64(uint64(48) + uint64((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint64(16)) + nByte = int64(uint64(libc.UintptrFromInt32(0)+32) + uint64((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, uint64(nByte)) @@ -282636,7 +273081,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+38183, uint64(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+38381, uint64(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -282647,7 +273092,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+38183, uint64(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+38381, uint64(4)) *(*int32)(unsafe.Pointer(bp + 8)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 8)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -283328,7 +273773,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = int64(uint64(40) + uint64(i)*uint64(32)) + nByte = int64(uint64(libc.UintptrFromInt32(0)+8) + uint64(i+libc.Int32FromInt32(1))*libc.Uint64FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, uint64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -283573,15 +274018,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = int32(uint64(nTomb)*uint64(8) + uint64(16)) - pNew = _sqlite3Fts5MallocZero(tls, p+60, int64(nByte)) + nByte = int64(uint64(libc.UintptrFromInt32(0)+8) + uint64(nTomb+libc.Int64FromInt32(1))*libc.Uint64FromInt64(8)) + pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -284288,7 +274733,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+38211, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+112, Xsqlite3_mprintf(tls, __ccgo_ts+38409, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -284377,7 +274822,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+38295, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+120, Xsqlite3_mprintf(tls, __ccgo_ts+38493, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -285024,7 +275469,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, int64(uint64(232)+uint64(128)*uint64(nSlot-libc.Int64FromInt32(1))+uint64(4)*uint64(nSlot))) + pNew = _fts5IdxMalloc(tls, p, int64(uint64(libc.UintptrFromInt32(0)+104)+uint64(nSlot)*uint64(128)+uint64(4)*uint64(nSlot))) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 104 + uintptr(nSlot)*128 @@ -285050,14 +275495,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -285067,15 +275504,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -285189,7 +275617,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -285210,7 +275638,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -285993,7 +276421,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -286348,7 +276776,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+60, pWriter+8+8, uint32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+38377, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+96, Xsqlite3_mprintf(tls, __ccgo_ts+38575, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -286803,13 +277231,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - FpIdx uintptr - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -286854,7 +277275,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+38434, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+136, Xsqlite3_mprintf(tls, __ccgo_ts+38632, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -287023,7 +277444,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+60, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -287341,7 +277762,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+38495, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+8, Xsqlite3_mprintf(tls, __ccgo_ts+38693, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -287616,7 +278037,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = int64(uint64(libc.UintptrFromInt32(0)+32) + uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -287651,7 +278072,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte = Tsqlite3_int64(uint64(nByte) + uint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) + nByte = Tsqlite3_int64(uint64(nByte) + uint64(int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)+libc.Int64FromInt32(1))*libc.Uint64FromInt64(16)) pNew = _sqlite3Fts5MallocZero(tls, p+60, nByte) if pNew != 0 { nByte = int64(uint64(nSeg) * uint64(56)) @@ -287930,16 +278351,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -288157,7 +278568,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -288194,7 +278605,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -288205,70 +278616,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -288337,7 +278685,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -288436,14 +278784,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -288490,19 +278830,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -288581,7 +278908,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 72 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 72))).FpT = _fts5IdxMalloc(tls, p, int64(uint64(libc.UintptrFromInt32(0)+56)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -288631,7 +278958,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, int64(uint64(16)+uint64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint64(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, int64(uint64(16)+uint64(int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn))+uint64(FTS5_DATA_ZERO_PADDING))) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*16 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -288713,15 +279040,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [48]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint64(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint64(libc.UintptrFromInt32(0)+32)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(16)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1673, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1674, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -288747,11 +279077,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38546, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38744, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+27332, __ccgo_ts+38554, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+27478, __ccgo_ts+38752, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13289, __ccgo_ts+38589, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13405, __ccgo_ts+38787, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -288949,7 +279279,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = int32(uint64(nAlloc)*uint64(8) + uint64(64)) + nByte = int32(uint64(libc.UintptrFromInt32(0)+56) + uint64(nAlloc+libc.Int32FromInt32(1))*libc.Uint64FromInt64(104)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -289204,7 +279534,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+60, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+38633) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(1), __ccgo_ts+38831) } else { _sqlite3Fts5BufferSet(tls, p+60, bp, nToken, pToken) } @@ -289555,7 +279885,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(uint32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+uint32(nToken+libc.Int32FromInt32(1)) <= uint32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+60, bp, uint32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 16))).FpT = _sqlite3Fts5MallocZero(tls, p+60, int64(uint64(libc.UintptrFromInt32(0)+56)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -289677,7 +280007,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+60, int64(64)) + pT = _sqlite3Fts5MallocZero(tls, p+60, int64(uint64(libc.UintptrFromInt32(0)+56)+uint64(libc.Int32FromInt32(1))*libc.Uint64FromInt64(104))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -289797,7 +280127,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38037, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38235, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+8) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) @@ -290391,7 +280721,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+38635, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+38833, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -290622,7 +280952,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 16))+104+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 16)))).FaFirst + 1*4))).FiFirst)*128, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+38721) + _sqlite3Fts5BufferAppendBlob(tls, p+60, bp, uint32(4), __ccgo_ts+38919) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+40, bp+32) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 32)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -290761,7 +281091,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 } type Fts5Sorter = TFts5Sorter @@ -290816,87 +281145,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - Fapi Tfts5_api - Fdb uintptr - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -290904,96 +281152,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - FpStmt uintptr - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -291244,7 +281402,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38726, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38924, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -291281,7 +281439,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6512, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6600, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -291300,7 +281458,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6512, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6600, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -291750,7 +281908,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -291778,7 +281936,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -291798,7 +281956,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = int64(uint64(32) + uint64(4)*uint64(nPhrase-libc.Int32FromInt32(1))) + nByte = int64(uint64(libc.UintptrFromInt32(0)+24) + uint64((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint64FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, uint64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -291813,21 +281971,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 16459 + v1 = __ccgo_ts + 16575 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } if bDesc != 0 { - v3 = __ccgo_ts + 38765 + v3 = __ccgo_ts + 38963 } else { - v3 = __ccgo_ts + 38770 + v3 = __ccgo_ts + 38968 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+38774, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+38972, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -291885,14 +282043,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+38829, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+39027, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+6871, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+6959, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38835, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39033, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -291942,7 +282100,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38863, libc.VaList(bp+24, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39061, libc.VaList(bp+24, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+8, uintptr(0)) @@ -291975,7 +282133,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38873, libc.VaList(bp+24, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39071, libc.VaList(bp+24, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -292009,7 +282167,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 80)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38894, libc.VaList(bp+24, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39092, libc.VaList(bp+24, z)) } } } else { @@ -292017,7 +282175,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 36621 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 36819 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -292174,7 +282332,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+8, bp+16, bp+24, bp+32) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38927, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39125, libc.VaList(bp+48, *(*int32)(unsafe.Pointer(bp + 16)), *(*uintptr)(unsafe.Pointer(bp + 8)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 24)), *(*int32)(unsafe.Pointer(bp + 32))) } @@ -292245,7 +282403,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 8)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1673 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 1674 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*8))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -292374,7 +282532,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+38932, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+39130, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -292507,10 +282665,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -295046,12 +285141,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40281, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40479, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40385, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40583, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40423, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40621, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -295060,7 +285155,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40461, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40659, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -295072,14 +285167,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+27332, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13289, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39615, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+27478, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13405, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39813, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37521, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37719, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36826, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37024, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -295099,13 +285194,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 31972 + v1 = __ccgo_ts + 32118 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+40503, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+40701, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40533, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40731, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -295146,7 +285241,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+40577, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+40775, 0) iOff = int32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -295154,7 +285249,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40600, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40798, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -295169,7 +285264,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40606, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40804, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -295178,22 +285273,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36826, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37024, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 40612 + zCols = __ccgo_ts + 40810 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 40644 + zCols = __ccgo_ts + 40842 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37521, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37719, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39615, __ccgo_ts+40692, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39813, __ccgo_ts+40890, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37703, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37901, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -295238,14 +285333,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -295315,14 +285402,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(64) defer tls.Free(64) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+8 */ TFts5InsertCtx var _ /* nLoc at bp+48 */ int32 var _ /* nText at bp+32 */ int32 var _ /* pLoc at bp+40 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+24 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -295350,6 +285437,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 32)) = 0 *(*uintptr)(unsafe.Pointer(bp + 40)) = uintptr(0) @@ -295362,11 +285450,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+24, bp+32, bp+40, bp+48) } else { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 32)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 40)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 48)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -295379,6 +285480,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -295613,12 +285715,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40709, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40907, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40759, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40957, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40788, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40986, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -295626,7 +285728,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37703, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37901, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -295928,7 +286030,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+40817, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+41015, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -295961,17 +286063,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -296160,14 +286251,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 80)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+36826, bp+80) + rc = _fts5StorageCount(tls, p, __ccgo_ts+37024, bp+80) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 80)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -297199,14 +287264,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -297217,16 +287274,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -297372,64 +287419,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40919, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41117, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40922, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41120, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40927, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41125, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40932, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41130, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40935, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41133, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40938, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41136, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40943, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41141, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40948, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41146, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40952, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41150, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40958, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41156, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40963, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41161, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -297438,49 +287485,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40967, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41165, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40971, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41169, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40974, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41172, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40978, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41176, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40982, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41180, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40986, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41184, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40990, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41188, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40994, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41192, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -297497,20 +287544,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40998, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40978, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41196, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41176, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41001, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41004, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41199, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41202, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41008, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40994, uint64(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41206, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41192, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -297526,75 +287573,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41011, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41209, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40978, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41176, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41019, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41217, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41026, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41224, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41031, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41229, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40927, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41125, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41036, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41234, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40922, uint64(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41120, uint64(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41041, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41239, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40994, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41192, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41046, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41244, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+17362, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+17525, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41051, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41249, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41004, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41202, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41055, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41253, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40919, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41117, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41060, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41258, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40963, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41161, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41066, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41264, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41070, uint64(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41268, uint64(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41072, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41270, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40986, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41184, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -297603,48 +287650,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41078, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41276, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40994, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41192, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41086, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41284, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40978, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41176, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41092, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41290, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40978, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41176, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41097, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41295, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40919, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41117, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41103, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41301, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40990, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41188, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41111, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41309, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41119, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41317, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41123, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41321, aBuf+uintptr(nBuf-int32(7)), uint64(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40986, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41184, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -297652,21 +287699,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41131, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41329, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40919, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41117, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41137, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41335, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40990, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41188, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41143, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41341, aBuf+uintptr(nBuf-int32(6)), uint64(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41004, uint64(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41202, uint64(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -297684,48 +287731,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41150, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41348, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40935, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41133, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41155, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41353, aBuf+uintptr(nBuf-int32(4)), uint64(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41160, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41358, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40935, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41133, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41166, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41364, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40935, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41133, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41119, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41317, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41172, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41370, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41178, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41376, aBuf+uintptr(nBuf-int32(5)), uint64(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40919, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41117, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -297741,13 +287788,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41184, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41382, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41188, uint64(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41386, uint64(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41191, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41389, aBuf+uintptr(nBuf-int32(2)), uint64(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -297755,7 +287802,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41194, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41392, aBuf+uintptr(nBuf-int32(3)), uint64(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -297852,14 +287899,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 40 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -297877,13 +287924,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -297920,14 +287960,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*8)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+41198) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+41396) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+40891) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*8)), __ccgo_ts+41089) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -297965,7 +288005,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -298093,7 +288133,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(int64(zOut)-t__predefined_ptrdiff_t(bp)), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -298169,11 +288209,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -298195,7 +288235,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+41213)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+41411)) } // C documentation @@ -298221,7 +288261,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 40909, + FzName: __ccgo_ts + 41107, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -298229,7 +288269,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 41221, + FzName: __ccgo_ts + 41419, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -298237,7 +288277,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 41213, + FzName: __ccgo_ts + 41411, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -298267,7 +288307,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+41227, pApi, bp+96, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+41425, pApi, bp+96, uintptr(0)) } return rc } @@ -303728,39 +293768,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - FiInstPos Ti64 - FiInstOff int32 -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -303783,16 +293790,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41234) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41432) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41238) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41436) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41242) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41440) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41251, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41449, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -303855,21 +293862,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 41285, - 1: __ccgo_ts + 41325, - 2: __ccgo_ts + 41360, + 0: __ccgo_ts + 41483, + 1: __ccgo_ts + 41523, + 2: __ccgo_ts + 41558, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+25301, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*8))) == uint64(4) && libc.Xmemcmp(tls, __ccgo_ts+25464, *(*uintptr)(unsafe.Pointer(argv + 1*8)), uint64(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41403, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41601, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -303890,15 +293898,15 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*8)) } zType = v3 - nDb = int32(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = int32(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = int64(libc.Xstrlen(tls, zDb) + uint64(1)) + nTab = int64(libc.Xstrlen(tls, zTab) + uint64(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = int32(uint64(64) + uint64(nDb) + uint64(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = int64(uint64(64) + uint64(nDb) + uint64(nTab)) + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) @@ -304039,10 +294047,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41436, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41634, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+41467, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+41665, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+8, uintptr(0)) } @@ -304061,7 +294069,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41518, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41716, libc.VaList(bp+24, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -304387,7 +294395,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1673 + zCopy = __ccgo_ts + 1674 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -304511,7 +294519,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+41544, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+41742, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -304566,15 +294574,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 41554 + return __ccgo_ts + 41752 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -304947,7 +294955,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -304995,11 +295003,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12-win32\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_W32\x00OMIT_SEH\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00AreFileApisANSI\x00CharLowerW\x00CharUpperW\x00CloseHandle\x00CreateFileA\x00CreateFileW\x00CreateFileMappingA\x00CreateFileMappingW\x00CreateMutexW\x00DeleteFileA\x00DeleteFileW\x00FileTimeToLocalFileTime\x00FileTimeToSystemTime\x00FlushFileBuffers\x00FormatMessageA\x00FormatMessageW\x00FreeLibrary\x00GetCurrentProcessId\x00GetDiskFreeSpaceA\x00GetDiskFreeSpaceW\x00GetFileAttributesA\x00GetFileAttributesW\x00GetFileAttributesExW\x00GetFileSize\x00GetFullPathNameA\x00GetFullPathNameW\x00GetLastError\x00GetProcAddressA\x00GetSystemInfo\x00GetSystemTime\x00GetSystemTimeAsFileTime\x00GetTempPathA\x00GetTempPathW\x00GetTickCount\x00GetVersionExA\x00GetVersionExW\x00HeapAlloc\x00HeapCreate\x00HeapDestroy\x00HeapFree\x00HeapReAlloc\x00HeapSize\x00HeapValidate\x00HeapCompact\x00LoadLibraryA\x00LoadLibraryW\x00LocalFree\x00LockFile\x00LockFileEx\x00MapViewOfFile\x00MultiByteToWideChar\x00QueryPerformanceCounter\x00ReadFile\x00SetEndOfFile\x00SetFilePointer\x00Sleep\x00SystemTimeToFileTime\x00UnlockFile\x00UnlockFileEx\x00UnmapViewOfFile\x00WideCharToMultiByte\x00WriteFile\x00CreateEventExW\x00WaitForSingleObject\x00WaitForSingleObjectEx\x00SetFilePointerEx\x00GetFileInformationByHandleEx\x00MapViewOfFileFromApp\x00CreateFile2\x00LoadPackagedLibrary\x00GetTickCount64\x00GetNativeSystemInfo\x00OutputDebugStringA\x00OutputDebugStringW\x00GetProcessHeap\x00CreateFileMappingFromApp\x00InterlockedCompareExchange\x00UuidCreate\x00UuidCreateSequential\x00FlushViewOfFile\x00%s\x00OsError 0x%lx (%lu)\x00os_win.c:%d: (%lu) %s(%s) - %s\x00delayed %dms for lock/sharing conflict at line %d\x00winSeekFile\x00winClose\x00winRead\x00winWrite1\x00winWrite2\x00winTruncate1\x00winTruncate2\x00winSync1\x00winSync2\x00winFileSize\x00winUnlockReadLock\x00winUnlock\x00winLockSharedMemory\x00%s-shm\x00readonly_shm\x00winOpenShm\x00winShmMap1\x00winShmMap2\x00winShmMap3\x00winUnmapfile1\x00winUnmapfile2\x00winMapfile1\x00winMapfile2\x00etilqs_\x00winGetTempname1\x00winGetTempname2\x00winGetTempname3\x00winGetTempname4\x00winGetTempname5\x00exclusive\x00winOpen\x00psow\x00winDelete\x00winAccess\x00%s%c%s\x00winFullPathname1\x00winFullPathname2\x00winFullPathname3\x00winFullPathname4\x00win32\x00win32-longpath\x00win32-none\x00win32-longpath-none\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00stat\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dll\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_store_directory\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00access\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12-win32\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00OMIT_SEH\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00AreFileApisANSI\x00CharLowerW\x00CharUpperW\x00CloseHandle\x00CreateFileA\x00CreateFileW\x00CreateFileMappingA\x00CreateFileMappingW\x00CreateMutexW\x00DeleteFileA\x00DeleteFileW\x00FileTimeToLocalFileTime\x00FileTimeToSystemTime\x00FlushFileBuffers\x00FormatMessageA\x00FormatMessageW\x00FreeLibrary\x00GetCurrentProcessId\x00GetDiskFreeSpaceA\x00GetDiskFreeSpaceW\x00GetFileAttributesA\x00GetFileAttributesW\x00GetFileAttributesExW\x00GetFileSize\x00GetFullPathNameA\x00GetFullPathNameW\x00GetLastError\x00GetProcAddressA\x00GetSystemInfo\x00GetSystemTime\x00GetSystemTimeAsFileTime\x00GetTempPathA\x00GetTempPathW\x00GetTickCount\x00GetVersionExA\x00GetVersionExW\x00HeapAlloc\x00HeapCreate\x00HeapDestroy\x00HeapFree\x00HeapReAlloc\x00HeapSize\x00HeapValidate\x00HeapCompact\x00LoadLibraryA\x00LoadLibraryW\x00LocalFree\x00LockFile\x00LockFileEx\x00MapViewOfFile\x00MultiByteToWideChar\x00QueryPerformanceCounter\x00ReadFile\x00SetEndOfFile\x00SetFilePointer\x00Sleep\x00SystemTimeToFileTime\x00UnlockFile\x00UnlockFileEx\x00UnmapViewOfFile\x00WideCharToMultiByte\x00WriteFile\x00CreateEventExW\x00WaitForSingleObject\x00WaitForSingleObjectEx\x00SetFilePointerEx\x00GetFileInformationByHandleEx\x00MapViewOfFileFromApp\x00CreateFile2\x00LoadPackagedLibrary\x00GetTickCount64\x00GetNativeSystemInfo\x00OutputDebugStringA\x00OutputDebugStringW\x00GetProcessHeap\x00CreateFileMappingFromApp\x00InterlockedCompareExchange\x00UuidCreate\x00UuidCreateSequential\x00FlushViewOfFile\x00CreateEvent\x00CancelIo\x00GetModuleHandleW\x00getenv\x00getcwd\x00readlink\x00lstat\x00__errno\x00cygwin_conv_path\x00%s\x00OsError 0x%lx (%lu)\x00os_win.c:%d: (%lu) %s(%s) - %s\x00delayed %dms for lock/sharing conflict at line %d\x00winSeekFile\x00winClose\x00winRead\x00winWrite1\x00winWrite2\x00winTruncate1\x00winTruncate2\x00winSync1\x00winSync2\x00winFileSize\x00winUnlockReadLock\x00winUnlock\x00%s-shm\x00readonly_shm\x00winShmMap1\x00winShmMap2\x00winShmMap3\x00winUnmapfile1\x00winUnmapfile2\x00winMapfile1\x00winMapfile2\x00etilqs_\x00winGetTempname1\x00winGetTempname2\x00winGetTempname3\x00winGetTempname4\x00winGetTempname5\x00exclusive\x00winOpen\x00psow\x00winDelete\x00winAccess\x00%s%c%s\x00winFullPathname1\x00winFullPathname2\x00winFullPathname3\x00winFullPathname4\x00win32\x00win32-longpath\x00win32-none\x00win32-longpath-none\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00stat\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dll\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_store_directory\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00access\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/lib/sqlite_windows_386.go b/vendor/modernc.org/sqlite/lib/sqlite_windows_386.go index a6c2bef..4cdc532 100644 --- a/vendor/modernc.org/sqlite/lib/sqlite_windows_386.go +++ b/vendor/modernc.org/sqlite/lib/sqlite_windows_386.go @@ -1,4 +1,4 @@ -// Code generated for windows/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/windows/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/windows/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/windows/386 -extended-errors -o sqlite3.go sqlite3.c --cpp /usr/bin/i686-w64-mingw32-gcc --goarch 386 --goos windows -DSQLITE_HAVE_C99_MATH_FUNCS=(1) -DSQLITE_OS_WIN=1 -DSQLITE_OMIT_SEH -map gcc=i686-w64-mingw32-gcc -eval-all-macros', DO NOT EDIT. +// Code generated for windows/386 by 'generator -mlong-double-64 --package-name libsqlite3 --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -ignore-unsupported-alignment -ignore-link-errors -import=sync -DHAVE_USLEEP -DLONGDOUBLE_TYPE=double -DNDEBUG -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_ENABLE_COLUMN_METADATA -DSQLITE_ENABLE_DBSTAT_VTAB -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_GEOPOLY -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MATH_FUNCTIONS -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_HAVE_ZLIB=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_SOUNDEX -DSQLITE_THREADSAFE=1 -DSQLITE_WITHOUT_ZONEMALLOC -D_LARGEFILE64_SOURCE -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libc/include/windows/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libz/include/windows/386 -I /home/jnml/src/modernc.org/builder/.exclude/modernc.org/libtcl8.6/include/windows/386 -extended-errors -o sqlite3.go sqlite3.c -DSQLITE_MUTEX_NOOP --cpp /usr/bin/i686-w64-mingw32-gcc --goarch 386 --goos windows -DSQLITE_HAVE_C99_MATH_FUNCS=(1) -DSQLITE_OS_WIN=1 -DSQLITE_OMIT_SEH -map gcc=i686-w64-mingw32-gcc -eval-all-macros', DO NOT EDIT. //go:build windows && 386 @@ -9,6 +9,8 @@ import ( "unsafe" "modernc.org/libc" + + "sync" ) var _ reflect.Type @@ -724,7 +726,6 @@ const BITVEC_MXHASH = 0 const BITVEC_NBIT = 0 const BITVEC_NELEM = 0 const BITVEC_NINT = 0 -const BITVEC_NPTR = 0 const BITVEC_SZ = 512 const BITVEC_SZELEM = 8 const BITVEC_TELEM = 0 @@ -872,6 +873,7 @@ const BTS_PAGESIZE_FIXED = 2 const BTS_PENDING = 128 const BTS_READ_ONLY = 1 const BTS_SECURE_DELETE = 4 +const BT_MAX_LOCAL = 65501 const BUFSIZ = 512 const BackupEventLog = 0 const BeginUpdateResource = 0 @@ -12197,6 +12199,7 @@ const NONZEROLHND = 2 const NONZEROLPTR = 0 const NON_PAGED_DEBUG_SIGNATURE = 18766 const NOPARITY = 0 +const NORETRY = 16384 const NORMAL_PRINT = 0 const NORMAL_PRIORITY_CLASS = 32 const NORM_IGNORECASE = 1 @@ -16855,6 +16858,7 @@ const SQLITE_ACCESS_EXISTS = 0 const SQLITE_ACCESS_READ = 2 const SQLITE_ACCESS_READWRITE = 1 const SQLITE_AFF_BLOB = 65 +const SQLITE_AFF_DEFER = 88 const SQLITE_AFF_FLEXNUM = 70 const SQLITE_AFF_INTEGER = 68 const SQLITE_AFF_MASK = 71 @@ -17092,6 +17096,7 @@ const SQLITE_FAIL = 3 const SQLITE_FAULTINJECTOR_COUNT = 1 const SQLITE_FAULTINJECTOR_MALLOC = 0 const SQLITE_FCNTL_BEGIN_ATOMIC_WRITE = 31 +const SQLITE_FCNTL_BLOCK_ON_CONNECT = 44 const SQLITE_FCNTL_BUSYHANDLER = 15 const SQLITE_FCNTL_CHUNK_SIZE = 6 const SQLITE_FCNTL_CKPT_DONE = 37 @@ -17303,6 +17308,7 @@ const SQLITE_MAX_FILE_FORMAT = 4 const SQLITE_MAX_FUNCTION_ARG = 1000 const SQLITE_MAX_LENGTH = 1000000000 const SQLITE_MAX_LIKE_PATTERN_LENGTH = 50000 +const SQLITE_MAX_LOG_MESSAGE = 700 const SQLITE_MAX_MEMORY = 0 const SQLITE_MAX_MMAP_SIZE = 2147418112 const SQLITE_MAX_PAGE_COUNT = 4294967294 @@ -17324,6 +17330,7 @@ const SQLITE_MISMATCH = 20 const SQLITE_MISUSE = 21 const SQLITE_MISUSE_BKPT = 0 const SQLITE_MUTEX_FAST = 0 +const SQLITE_MUTEX_NOOP = 1 const SQLITE_MUTEX_RECURSIVE = 1 const SQLITE_MUTEX_STATIC_APP1 = 8 const SQLITE_MUTEX_STATIC_APP2 = 9 @@ -17467,6 +17474,7 @@ const SQLITE_SERIALIZE_NOCOPY = 1 const SQLITE_SESSION_CONFIG_STRMSIZE = 1 const SQLITE_SESSION_OBJCONFIG_ROWID = 2 const SQLITE_SESSION_OBJCONFIG_SIZE = 1 +const SQLITE_SETLK_BLOCK_ON_CONNECT = 1 const SQLITE_SET_LOCKPROXYFILE = 3 const SQLITE_SHM_EXCLUSIVE = 8 const SQLITE_SHM_LOCK = 2 @@ -17475,7 +17483,7 @@ const SQLITE_SHM_SHARED = 4 const SQLITE_SHM_UNLOCK = 1 const SQLITE_SORTER_PMASZ = 250 const SQLITE_SOUNDEX = 1 -const SQLITE_SOURCE_ID = "2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde" +const SQLITE_SOURCE_ID = "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" const SQLITE_SO_ASC = 0 const SQLITE_SO_DESC = 1 const SQLITE_SO_UNDEFINED = -1 @@ -17586,8 +17594,8 @@ const SQLITE_UTF16LE = 2 const SQLITE_UTF16NATIVE = 2 const SQLITE_UTF16_ALIGNED = 8 const SQLITE_UTF8 = 1 -const SQLITE_VERSION = "3.49.0" -const SQLITE_VERSION_NUMBER = 3049000 +const SQLITE_VERSION = "3.50.4" +const SQLITE_VERSION_NUMBER = 3050004 const SQLITE_VTABRISK_High = 2 const SQLITE_VTABRISK_Low = 0 const SQLITE_VTABRISK_Normal = 1 @@ -20043,9 +20051,6 @@ const WINPERF_LOG_NONE = 0 const WINPERF_LOG_USER = 1 const WINPERF_LOG_VERBOSE = 3 const WINSHELLAPI = "DECLSPEC_IMPORT" -const WINSHM_RDLCK = 2 -const WINSHM_UNLCK = 1 -const WINSHM_WRLCK = 3 const WINSPOOLAPI = "DECLSPEC_IMPORT" const WINSTA_ACCESSCLIPBOARD = 4 const WINSTA_ACCESSGLOBALATOMS = 32 @@ -21562,6 +21567,9 @@ const etBUFSIZE = 70 const etCHARX = 8 const etDECIMAL = 16 const etDYNSTRING = 6 +const etESCAPE_Q = 10 +const etESCAPE_q = 9 +const etESCAPE_w = 14 const etEXP = 2 const etFLOAT = 1 const etGENERIC = 3 @@ -21571,9 +21579,6 @@ const etPERCENT = 7 const etPOINTER = 13 const etRADIX = 0 const etSIZE = 4 -const etSQLESCAPE = 9 -const etSQLESCAPE2 = 10 -const etSQLESCAPE3 = 14 const etSRCITEM = 12 const etSTRING = 5 const etTOKEN = 11 @@ -22716,12 +22721,6 @@ type Tsqlite3_file = struct { type sqlite3_file = Tsqlite3_file -type Tsqlite3_file1 = struct { - FpMethods uintptr -} - -type sqlite3_file1 = Tsqlite3_file1 - // C documentation // // /* @@ -22850,400 +22849,6 @@ type Tsqlite3_io_methods = struct { type sqlite3_io_methods = Tsqlite3_io_methods -type Tsqlite3_io_methods1 = struct { - FiVersion int32 - FxClose uintptr - FxRead uintptr - FxWrite uintptr - FxTruncate uintptr - FxSync uintptr - FxFileSize uintptr - FxLock uintptr - FxUnlock uintptr - FxCheckReservedLock uintptr - FxFileControl uintptr - FxSectorSize uintptr - FxDeviceCharacteristics uintptr - FxShmMap uintptr - FxShmLock uintptr - FxShmBarrier uintptr - FxShmUnmap uintptr - FxFetch uintptr - FxUnfetch uintptr -} - -type sqlite3_io_methods1 = Tsqlite3_io_methods1 - -/* -** CAPI3REF: Standard File Control Opcodes -** KEYWORDS: {file control opcodes} {file control opcode} -** -** These integer constants are opcodes for the xFileControl method -** of the [sqlite3_io_methods] object and for the [sqlite3_file_control()] -** interface. -** -**
      -**
    • [[SQLITE_FCNTL_LOCKSTATE]] -** The [SQLITE_FCNTL_LOCKSTATE] opcode is used for debugging. This -** opcode causes the xFileControl method to write the current state of -** the lock (one of [SQLITE_LOCK_NONE], [SQLITE_LOCK_SHARED], -** [SQLITE_LOCK_RESERVED], [SQLITE_LOCK_PENDING], or [SQLITE_LOCK_EXCLUSIVE]) -** into an integer that the pArg argument points to. -** This capability is only available if SQLite is compiled with [SQLITE_DEBUG]. -** -**
    • [[SQLITE_FCNTL_SIZE_HINT]] -** The [SQLITE_FCNTL_SIZE_HINT] opcode is used by SQLite to give the VFS -** layer a hint of how large the database file will grow to be during the -** current transaction. This hint is not guaranteed to be accurate but it -** is often close. The underlying VFS might choose to preallocate database -** file space based on this hint in order to help writes to the database -** file run faster. -** -**
    • [[SQLITE_FCNTL_SIZE_LIMIT]] -** The [SQLITE_FCNTL_SIZE_LIMIT] opcode is used by in-memory VFS that -** implements [sqlite3_deserialize()] to set an upper bound on the size -** of the in-memory database. The argument is a pointer to a [sqlite3_int64]. -** If the integer pointed to is negative, then it is filled in with the -** current limit. Otherwise the limit is set to the larger of the value -** of the integer pointed to and the current database size. The integer -** pointed to is set to the new limit. -** -**
    • [[SQLITE_FCNTL_CHUNK_SIZE]] -** The [SQLITE_FCNTL_CHUNK_SIZE] opcode is used to request that the VFS -** extends and truncates the database file in chunks of a size specified -** by the user. The fourth argument to [sqlite3_file_control()] should -** point to an integer (type int) containing the new chunk-size to use -** for the nominated database. Allocating database file space in large -** chunks (say 1MB at a time), may reduce file-system fragmentation and -** improve performance on some systems. -** -**
    • [[SQLITE_FCNTL_FILE_POINTER]] -** The [SQLITE_FCNTL_FILE_POINTER] opcode is used to obtain a pointer -** to the [sqlite3_file] object associated with a particular database -** connection. See also [SQLITE_FCNTL_JOURNAL_POINTER]. -** -**
    • [[SQLITE_FCNTL_JOURNAL_POINTER]] -** The [SQLITE_FCNTL_JOURNAL_POINTER] opcode is used to obtain a pointer -** to the [sqlite3_file] object associated with the journal file (either -** the [rollback journal] or the [write-ahead log]) for a particular database -** connection. See also [SQLITE_FCNTL_FILE_POINTER]. -** -**
    • [[SQLITE_FCNTL_SYNC_OMITTED]] -** No longer in use. -** -**
    • [[SQLITE_FCNTL_SYNC]] -** The [SQLITE_FCNTL_SYNC] opcode is generated internally by SQLite and -** sent to the VFS immediately before the xSync method is invoked on a -** database file descriptor. Or, if the xSync method is not invoked -** because the user has configured SQLite with -** [PRAGMA synchronous | PRAGMA synchronous=OFF] it is invoked in place -** of the xSync method. In most cases, the pointer argument passed with -** this file-control is NULL. However, if the database file is being synced -** as part of a multi-database commit, the argument points to a nul-terminated -** string containing the transactions super-journal file name. VFSes that -** do not need this signal should silently ignore this opcode. Applications -** should not call [sqlite3_file_control()] with this opcode as doing so may -** disrupt the operation of the specialized VFSes that do require it. -** -**
    • [[SQLITE_FCNTL_COMMIT_PHASETWO]] -** The [SQLITE_FCNTL_COMMIT_PHASETWO] opcode is generated internally by SQLite -** and sent to the VFS after a transaction has been committed immediately -** but before the database is unlocked. VFSes that do not need this signal -** should silently ignore this opcode. Applications should not call -** [sqlite3_file_control()] with this opcode as doing so may disrupt the -** operation of the specialized VFSes that do require it. -** -**
    • [[SQLITE_FCNTL_WIN32_AV_RETRY]] -** ^The [SQLITE_FCNTL_WIN32_AV_RETRY] opcode is used to configure automatic -** retry counts and intervals for certain disk I/O operations for the -** windows [VFS] in order to provide robustness in the presence of -** anti-virus programs. By default, the windows VFS will retry file read, -** file write, and file delete operations up to 10 times, with a delay -** of 25 milliseconds before the first retry and with the delay increasing -** by an additional 25 milliseconds with each subsequent retry. This -** opcode allows these two values (10 retries and 25 milliseconds of delay) -** to be adjusted. The values are changed for all database connections -** within the same process. The argument is a pointer to an array of two -** integers where the first integer is the new retry count and the second -** integer is the delay. If either integer is negative, then the setting -** is not changed but instead the prior value of that setting is written -** into the array entry, allowing the current retry settings to be -** interrogated. The zDbName parameter is ignored. -** -**
    • [[SQLITE_FCNTL_PERSIST_WAL]] -** ^The [SQLITE_FCNTL_PERSIST_WAL] opcode is used to set or query the -** persistent [WAL | Write Ahead Log] setting. By default, the auxiliary -** write ahead log ([WAL file]) and shared memory -** files used for transaction control -** are automatically deleted when the latest connection to the database -** closes. Setting persistent WAL mode causes those files to persist after -** close. Persisting the files is useful when other processes that do not -** have write permission on the directory containing the database file want -** to read the database file, as the WAL and shared memory files must exist -** in order for the database to be readable. The fourth parameter to -** [sqlite3_file_control()] for this opcode should be a pointer to an integer. -** That integer is 0 to disable persistent WAL mode or 1 to enable persistent -** WAL mode. If the integer is -1, then it is overwritten with the current -** WAL persistence setting. -** -**
    • [[SQLITE_FCNTL_POWERSAFE_OVERWRITE]] -** ^The [SQLITE_FCNTL_POWERSAFE_OVERWRITE] opcode is used to set or query the -** persistent "powersafe-overwrite" or "PSOW" setting. The PSOW setting -** determines the [SQLITE_IOCAP_POWERSAFE_OVERWRITE] bit of the -** xDeviceCharacteristics methods. The fourth parameter to -** [sqlite3_file_control()] for this opcode should be a pointer to an integer. -** That integer is 0 to disable zero-damage mode or 1 to enable zero-damage -** mode. If the integer is -1, then it is overwritten with the current -** zero-damage mode setting. -** -**
    • [[SQLITE_FCNTL_OVERWRITE]] -** ^The [SQLITE_FCNTL_OVERWRITE] opcode is invoked by SQLite after opening -** a write transaction to indicate that, unless it is rolled back for some -** reason, the entire database file will be overwritten by the current -** transaction. This is used by VACUUM operations. -** -**
    • [[SQLITE_FCNTL_VFSNAME]] -** ^The [SQLITE_FCNTL_VFSNAME] opcode can be used to obtain the names of -** all [VFSes] in the VFS stack. The names are of all VFS shims and the -** final bottom-level VFS are written into memory obtained from -** [sqlite3_malloc()] and the result is stored in the char* variable -** that the fourth parameter of [sqlite3_file_control()] points to. -** The caller is responsible for freeing the memory when done. As with -** all file-control actions, there is no guarantee that this will actually -** do anything. Callers should initialize the char* variable to a NULL -** pointer in case this file-control is not implemented. This file-control -** is intended for diagnostic use only. -** -**
    • [[SQLITE_FCNTL_VFS_POINTER]] -** ^The [SQLITE_FCNTL_VFS_POINTER] opcode finds a pointer to the top-level -** [VFSes] currently in use. ^(The argument X in -** sqlite3_file_control(db,SQLITE_FCNTL_VFS_POINTER,X) must be -** of type "[sqlite3_vfs] **". This opcodes will set *X -** to a pointer to the top-level VFS.)^ -** ^When there are multiple VFS shims in the stack, this opcode finds the -** upper-most shim only. -** -**
    • [[SQLITE_FCNTL_PRAGMA]] -** ^Whenever a [PRAGMA] statement is parsed, an [SQLITE_FCNTL_PRAGMA] -** file control is sent to the open [sqlite3_file] object corresponding -** to the database file to which the pragma statement refers. ^The argument -** to the [SQLITE_FCNTL_PRAGMA] file control is an array of -** pointers to strings (char**) in which the second element of the array -** is the name of the pragma and the third element is the argument to the -** pragma or NULL if the pragma has no argument. ^The handler for an -** [SQLITE_FCNTL_PRAGMA] file control can optionally make the first element -** of the char** argument point to a string obtained from [sqlite3_mprintf()] -** or the equivalent and that string will become the result of the pragma or -** the error message if the pragma fails. ^If the -** [SQLITE_FCNTL_PRAGMA] file control returns [SQLITE_NOTFOUND], then normal -** [PRAGMA] processing continues. ^If the [SQLITE_FCNTL_PRAGMA] -** file control returns [SQLITE_OK], then the parser assumes that the -** VFS has handled the PRAGMA itself and the parser generates a no-op -** prepared statement if result string is NULL, or that returns a copy -** of the result string if the string is non-NULL. -** ^If the [SQLITE_FCNTL_PRAGMA] file control returns -** any result code other than [SQLITE_OK] or [SQLITE_NOTFOUND], that means -** that the VFS encountered an error while handling the [PRAGMA] and the -** compilation of the PRAGMA fails with an error. ^The [SQLITE_FCNTL_PRAGMA] -** file control occurs at the beginning of pragma statement analysis and so -** it is able to override built-in [PRAGMA] statements. -** -**
    • [[SQLITE_FCNTL_BUSYHANDLER]] -** ^The [SQLITE_FCNTL_BUSYHANDLER] -** file-control may be invoked by SQLite on the database file handle -** shortly after it is opened in order to provide a custom VFS with access -** to the connection's busy-handler callback. The argument is of type (void**) -** - an array of two (void *) values. The first (void *) actually points -** to a function of type (int (*)(void *)). In order to invoke the connection's -** busy-handler, this function should be invoked with the second (void *) in -** the array as the only argument. If it returns non-zero, then the operation -** should be retried. If it returns zero, the custom VFS should abandon the -** current operation. -** -**
    • [[SQLITE_FCNTL_TEMPFILENAME]] -** ^Applications can invoke the [SQLITE_FCNTL_TEMPFILENAME] file-control -** to have SQLite generate a -** temporary filename using the same algorithm that is followed to generate -** temporary filenames for TEMP tables and other internal uses. The -** argument should be a char** which will be filled with the filename -** written into memory obtained from [sqlite3_malloc()]. The caller should -** invoke [sqlite3_free()] on the result to avoid a memory leak. -** -**
    • [[SQLITE_FCNTL_MMAP_SIZE]] -** The [SQLITE_FCNTL_MMAP_SIZE] file control is used to query or set the -** maximum number of bytes that will be used for memory-mapped I/O. -** The argument is a pointer to a value of type sqlite3_int64 that -** is an advisory maximum number of bytes in the file to memory map. The -** pointer is overwritten with the old value. The limit is not changed if -** the value originally pointed to is negative, and so the current limit -** can be queried by passing in a pointer to a negative number. This -** file-control is used internally to implement [PRAGMA mmap_size]. -** -**
    • [[SQLITE_FCNTL_TRACE]] -** The [SQLITE_FCNTL_TRACE] file control provides advisory information -** to the VFS about what the higher layers of the SQLite stack are doing. -** This file control is used by some VFS activity tracing [shims]. -** The argument is a zero-terminated string. Higher layers in the -** SQLite stack may generate instances of this file control if -** the [SQLITE_USE_FCNTL_TRACE] compile-time option is enabled. -** -**
    • [[SQLITE_FCNTL_HAS_MOVED]] -** The [SQLITE_FCNTL_HAS_MOVED] file control interprets its argument as a -** pointer to an integer and it writes a boolean into that integer depending -** on whether or not the file has been renamed, moved, or deleted since it -** was first opened. -** -**
    • [[SQLITE_FCNTL_WIN32_GET_HANDLE]] -** The [SQLITE_FCNTL_WIN32_GET_HANDLE] opcode can be used to obtain the -** underlying native file handle associated with a file handle. This file -** control interprets its argument as a pointer to a native file handle and -** writes the resulting value there. -** -**
    • [[SQLITE_FCNTL_WIN32_SET_HANDLE]] -** The [SQLITE_FCNTL_WIN32_SET_HANDLE] opcode is used for debugging. This -** opcode causes the xFileControl method to swap the file handle with the one -** pointed to by the pArg argument. This capability is used during testing -** and only needs to be supported when SQLITE_TEST is defined. -** -**
    • [[SQLITE_FCNTL_NULL_IO]] -** The [SQLITE_FCNTL_NULL_IO] opcode sets the low-level file descriptor -** or file handle for the [sqlite3_file] object such that it will no longer -** read or write to the database file. -** -**
    • [[SQLITE_FCNTL_WAL_BLOCK]] -** The [SQLITE_FCNTL_WAL_BLOCK] is a signal to the VFS layer that it might -** be advantageous to block on the next WAL lock if the lock is not immediately -** available. The WAL subsystem issues this signal during rare -** circumstances in order to fix a problem with priority inversion. -** Applications should not use this file-control. -** -**
    • [[SQLITE_FCNTL_ZIPVFS]] -** The [SQLITE_FCNTL_ZIPVFS] opcode is implemented by zipvfs only. All other -** VFS should return SQLITE_NOTFOUND for this opcode. -** -**
    • [[SQLITE_FCNTL_RBU]] -** The [SQLITE_FCNTL_RBU] opcode is implemented by the special VFS used by -** the RBU extension only. All other VFS should return SQLITE_NOTFOUND for -** this opcode. -** -**
    • [[SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]] -** If the [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] opcode returns SQLITE_OK, then -** the file descriptor is placed in "batch write mode", which -** means all subsequent write operations will be deferred and done -** atomically at the next [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]. Systems -** that do not support batch atomic writes will return SQLITE_NOTFOUND. -** ^Following a successful SQLITE_FCNTL_BEGIN_ATOMIC_WRITE and prior to -** the closing [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] or -** [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE], SQLite will make -** no VFS interface calls on the same [sqlite3_file] file descriptor -** except for calls to the xWrite method and the xFileControl method -** with [SQLITE_FCNTL_SIZE_HINT]. -** -**
    • [[SQLITE_FCNTL_COMMIT_ATOMIC_WRITE]] -** The [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE] opcode causes all write -** operations since the previous successful call to -** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be performed atomically. -** This file control returns [SQLITE_OK] if and only if the writes were -** all performed successfully and have been committed to persistent storage. -** ^Regardless of whether or not it is successful, this file control takes -** the file descriptor out of batch write mode so that all subsequent -** write operations are independent. -** ^SQLite will never invoke SQLITE_FCNTL_COMMIT_ATOMIC_WRITE without -** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. -** -**
    • [[SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE]] -** The [SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE] opcode causes all write -** operations since the previous successful call to -** [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] to be rolled back. -** ^This file control takes the file descriptor out of batch write mode -** so that all subsequent write operations are independent. -** ^SQLite will never invoke SQLITE_FCNTL_ROLLBACK_ATOMIC_WRITE without -** a prior successful call to [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE]. -** -**
    • [[SQLITE_FCNTL_LOCK_TIMEOUT]] -** The [SQLITE_FCNTL_LOCK_TIMEOUT] opcode is used to configure a VFS -** to block for up to M milliseconds before failing when attempting to -** obtain a file lock using the xLock or xShmLock methods of the VFS. -** The parameter is a pointer to a 32-bit signed integer that contains -** the value that M is to be set to. Before returning, the 32-bit signed -** integer is overwritten with the previous value of M. -** -**
    • [[SQLITE_FCNTL_DATA_VERSION]] -** The [SQLITE_FCNTL_DATA_VERSION] opcode is used to detect changes to -** a database file. The argument is a pointer to a 32-bit unsigned integer. -** The "data version" for the pager is written into the pointer. The -** "data version" changes whenever any change occurs to the corresponding -** database file, either through SQL statements on the same database -** connection or through transactions committed by separate database -** connections possibly in other processes. The [sqlite3_total_changes()] -** interface can be used to find if any database on the connection has changed, -** but that interface responds to changes on TEMP as well as MAIN and does -** not provide a mechanism to detect changes to MAIN only. Also, the -** [sqlite3_total_changes()] interface responds to internal changes only and -** omits changes made by other database connections. The -** [PRAGMA data_version] command provides a mechanism to detect changes to -** a single attached database that occur due to other database connections, -** but omits changes implemented by the database connection on which it is -** called. This file control is the only mechanism to detect changes that -** happen either internally or externally and that are associated with -** a particular attached database. -** -**
    • [[SQLITE_FCNTL_CKPT_START]] -** The [SQLITE_FCNTL_CKPT_START] opcode is invoked from within a checkpoint -** in wal mode before the client starts to copy pages from the wal -** file to the database file. -** -**
    • [[SQLITE_FCNTL_CKPT_DONE]] -** The [SQLITE_FCNTL_CKPT_DONE] opcode is invoked from within a checkpoint -** in wal mode after the client has finished copying pages from the wal -** file to the database file, but before the *-shm file is updated to -** record the fact that the pages have been checkpointed. -** -**
    • [[SQLITE_FCNTL_EXTERNAL_READER]] -** The EXPERIMENTAL [SQLITE_FCNTL_EXTERNAL_READER] opcode is used to detect -** whether or not there is a database client in another process with a wal-mode -** transaction open on the database or not. It is only available on unix.The -** (void*) argument passed with this file-control should be a pointer to a -** value of type (int). The integer value is set to 1 if the database is a wal -** mode database and there exists at least one client in another process that -** currently has an SQL transaction open on the database. It is set to 0 if -** the database is not a wal-mode db, or if there is no such connection in any -** other process. This opcode cannot be used to detect transactions opened -** by clients within the current process, only within other processes. -** -**
    • [[SQLITE_FCNTL_CKSM_FILE]] -** The [SQLITE_FCNTL_CKSM_FILE] opcode is for use internally by the -** [checksum VFS shim] only. -** -**
    • [[SQLITE_FCNTL_RESET_CACHE]] -** If there is currently no transaction open on the database, and the -** database is not a temp db, then the [SQLITE_FCNTL_RESET_CACHE] file-control -** purges the contents of the in-memory page cache. If there is an open -** transaction, or if the db is a temp-db, this opcode is a no-op, not an error. -**
    - */ - -/* deprecated names */ - -// C documentation -// -// /* -// ** CAPI3REF: Mutex Handle -// ** -// ** The mutex module within SQLite defines [sqlite3_mutex] to be an -// ** abstract type for a mutex object. The SQLite core never looks -// ** at the internal representation of an [sqlite3_mutex]. It only -// ** deals with pointers to the [sqlite3_mutex] object. -// ** -// ** Mutexes are created using [sqlite3_mutex_alloc()]. -// */ -type Tsqlite3_mutex = struct { - Fmutex TCRITICAL_SECTION - Fid int32 -} - -type sqlite3_mutex = Tsqlite3_mutex - // C documentation // // /* @@ -23525,6 +23130,7 @@ type Tsqlite3_api_routines = struct { Fstmt_explain uintptr Fget_clientdata uintptr Fset_clientdata uintptr + Fsetlk_timeout uintptr } type sqlite3_api_routines = Tsqlite3_api_routines @@ -23755,33 +23361,6 @@ type Tsqlite3_syscall_ptr = uintptr type sqlite3_syscall_ptr = Tsqlite3_syscall_ptr -type Tsqlite3_vfs1 = struct { - FiVersion int32 - FszOsFile int32 - FmxPathname int32 - FpNext uintptr - FzName uintptr - FpAppData uintptr - FxOpen uintptr - FxDelete uintptr - FxAccess uintptr - FxFullPathname uintptr - FxDlOpen uintptr - FxDlError uintptr - FxDlSym uintptr - FxDlClose uintptr - FxRandomness uintptr - FxSleep uintptr - FxCurrentTime uintptr - FxGetLastError uintptr - FxCurrentTimeInt64 uintptr - FxSetSystemCall uintptr - FxGetSystemCall uintptr - FxNextSystemCall uintptr -} - -type sqlite3_vfs1 = Tsqlite3_vfs1 - // C documentation // // /* @@ -23860,19 +23439,6 @@ type Tsqlite3_mem_methods = struct { type sqlite3_mem_methods = Tsqlite3_mem_methods -type Tsqlite3_mem_methods1 = struct { - FxMalloc uintptr - FxFree uintptr - FxRealloc uintptr - FxSize uintptr - FxRoundup uintptr - FxInit uintptr - FxShutdown uintptr - FpAppData uintptr -} - -type sqlite3_mem_methods1 = Tsqlite3_mem_methods1 - // C documentation // // /* @@ -23958,7 +23524,6 @@ type Tsqlite3_context = struct { Fenc Tu8 FskipFlag Tu8 Fargc Tu16 - Fargv [1]uintptr } type sqlite3_context = Tsqlite3_context @@ -24053,226 +23618,6 @@ type Tsqlite3_module = struct { type sqlite3_module = Tsqlite3_module -/* -** CAPI3REF: Virtual Table Object -** KEYWORDS: sqlite3_module {virtual table module} -** -** This structure, sometimes called a "virtual table module", -** defines the implementation of a [virtual table]. -** This structure consists mostly of methods for the module. -** -** ^A virtual table module is created by filling in a persistent -** instance of this structure and passing a pointer to that instance -** to [sqlite3_create_module()] or [sqlite3_create_module_v2()]. -** ^The registration remains valid until it is replaced by a different -** module or until the [database connection] closes. The content -** of this structure must not change while it is registered with -** any database connection. - */ -type Tsqlite3_module1 = struct { - FiVersion int32 - FxCreate uintptr - FxConnect uintptr - FxBestIndex uintptr - FxDisconnect uintptr - FxDestroy uintptr - FxOpen uintptr - FxClose uintptr - FxFilter uintptr - FxNext uintptr - FxEof uintptr - FxColumn uintptr - FxRowid uintptr - FxUpdate uintptr - FxBegin uintptr - FxSync uintptr - FxCommit uintptr - FxRollback uintptr - FxFindFunction uintptr - FxRename uintptr - FxSavepoint uintptr - FxRelease uintptr - FxRollbackTo uintptr - FxShadowName uintptr - FxIntegrity uintptr -} - -type sqlite3_module1 = Tsqlite3_module1 - -/* -** CAPI3REF: Virtual Table Indexing Information -** KEYWORDS: sqlite3_index_info -** -** The sqlite3_index_info structure and its substructures is used as part -** of the [virtual table] interface to -** pass information into and receive the reply from the [xBestIndex] -** method of a [virtual table module]. The fields under **Inputs** are the -** inputs to xBestIndex and are read-only. xBestIndex inserts its -** results into the **Outputs** fields. -** -** ^(The aConstraint[] array records WHERE clause constraints of the form: -** -**
    column OP expr
    -** -** where OP is =, <, <=, >, or >=.)^ ^(The particular operator is -** stored in aConstraint[].op using one of the -** [SQLITE_INDEX_CONSTRAINT_EQ | SQLITE_INDEX_CONSTRAINT_ values].)^ -** ^(The index of the column is stored in -** aConstraint[].iColumn.)^ ^(aConstraint[].usable is TRUE if the -** expr on the right-hand side can be evaluated (and thus the constraint -** is usable) and false if it cannot.)^ -** -** ^The optimizer automatically inverts terms of the form "expr OP column" -** and makes other simplifications to the WHERE clause in an attempt to -** get as many WHERE clause terms into the form shown above as possible. -** ^The aConstraint[] array only reports WHERE clause terms that are -** relevant to the particular virtual table being queried. -** -** ^Information about the ORDER BY clause is stored in aOrderBy[]. -** ^Each term of aOrderBy records a column of the ORDER BY clause. -** -** The colUsed field indicates which columns of the virtual table may be -** required by the current scan. Virtual table columns are numbered from -** zero in the order in which they appear within the CREATE TABLE statement -** passed to sqlite3_declare_vtab(). For the first 63 columns (columns 0-62), -** the corresponding bit is set within the colUsed mask if the column may be -** required by SQLite. If the table has at least 64 columns and any column -** to the right of the first 63 is required, then bit 63 of colUsed is also -** set. In other words, column iCol may be required if the expression -** (colUsed & ((sqlite3_uint64)1 << (iCol>=63 ? 63 : iCol))) evaluates to -** non-zero. -** -** The [xBestIndex] method must fill aConstraintUsage[] with information -** about what parameters to pass to xFilter. ^If argvIndex>0 then -** the right-hand side of the corresponding aConstraint[] is evaluated -** and becomes the argvIndex-th entry in argv. ^(If aConstraintUsage[].omit -** is true, then the constraint is assumed to be fully handled by the -** virtual table and might not be checked again by the byte code.)^ ^(The -** aConstraintUsage[].omit flag is an optimization hint. When the omit flag -** is left in its default setting of false, the constraint will always be -** checked separately in byte code. If the omit flag is change to true, then -** the constraint may or may not be checked in byte code. In other words, -** when the omit flag is true there is no guarantee that the constraint will -** not be checked again using byte code.)^ -** -** ^The idxNum and idxStr values are recorded and passed into the -** [xFilter] method. -** ^[sqlite3_free()] is used to free idxStr if and only if -** needToFreeIdxStr is true. -** -** ^The orderByConsumed means that output from [xFilter]/[xNext] will occur in -** the correct order to satisfy the ORDER BY clause so that no separate -** sorting step is required. -** -** ^The estimatedCost value is an estimate of the cost of a particular -** strategy. A cost of N indicates that the cost of the strategy is similar -** to a linear scan of an SQLite table with N rows. A cost of log(N) -** indicates that the expense of the operation is similar to that of a -** binary search on a unique indexed field of an SQLite table with N rows. -** -** ^The estimatedRows value is an estimate of the number of rows that -** will be returned by the strategy. -** -** The xBestIndex method may optionally populate the idxFlags field with a -** mask of SQLITE_INDEX_SCAN_* flags. One such flag is -** [SQLITE_INDEX_SCAN_HEX], which if set causes the [EXPLAIN QUERY PLAN] -** output to show the idxNum has hex instead of as decimal. Another flag is -** SQLITE_INDEX_SCAN_UNIQUE, which if set indicates that the query plan will -** return at most one row. -** -** Additionally, if xBestIndex sets the SQLITE_INDEX_SCAN_UNIQUE flag, then -** SQLite also assumes that if a call to the xUpdate() method is made as -** part of the same statement to delete or update a virtual table row and the -** implementation returns SQLITE_CONSTRAINT, then there is no need to rollback -** any database changes. In other words, if the xUpdate() returns -** SQLITE_CONSTRAINT, the database contents must be exactly as they were -** before xUpdate was called. By contrast, if SQLITE_INDEX_SCAN_UNIQUE is not -** set and xUpdate returns SQLITE_CONSTRAINT, any database changes made by -** the xUpdate method are automatically rolled back by SQLite. -** -** IMPORTANT: The estimatedRows field was added to the sqlite3_index_info -** structure for SQLite [version 3.8.2] ([dateof:3.8.2]). -** If a virtual table extension is -** used with an SQLite version earlier than 3.8.2, the results of attempting -** to read or write the estimatedRows field are undefined (but are likely -** to include crashing the application). The estimatedRows field should -** therefore only be used if [sqlite3_libversion_number()] returns a -** value greater than or equal to 3008002. Similarly, the idxFlags field -** was added for [version 3.9.0] ([dateof:3.9.0]). -** It may therefore only be used if -** sqlite3_libversion_number() returns a value greater than or equal to -** 3009000. - */ -type Tsqlite3_index_info1 = struct { - F__ccgo_align [0]uint32 - FnConstraint int32 - FaConstraint uintptr - FnOrderBy int32 - FaOrderBy uintptr - FaConstraintUsage uintptr - FidxNum int32 - FidxStr uintptr - FneedToFreeIdxStr int32 - ForderByConsumed int32 - F__ccgo_align9 [4]byte - FestimatedCost float64 - FestimatedRows Tsqlite3_int64 - FidxFlags int32 - F__ccgo_align12 [4]byte - FcolUsed Tsqlite3_uint64 -} - -type sqlite3_index_info1 = Tsqlite3_index_info1 - -/* -** CAPI3REF: Virtual Table Instance Object -** KEYWORDS: sqlite3_vtab -** -** Every [virtual table module] implementation uses a subclass -** of this object to describe a particular instance -** of the [virtual table]. Each subclass will -** be tailored to the specific needs of the module implementation. -** The purpose of this superclass is to define certain fields that are -** common to all module implementations. -** -** ^Virtual tables methods can set an error message by assigning a -** string obtained from [sqlite3_mprintf()] to zErrMsg. The method should -** take care that any prior string is freed by a call to [sqlite3_free()] -** prior to assigning a new string to zErrMsg. ^After the error message -** is delivered up to the client application, the string will be automatically -** freed by sqlite3_free() and the zErrMsg field will be zeroed. - */ -type Tsqlite3_vtab1 = struct { - FpModule uintptr - FnRef int32 - FzErrMsg uintptr -} - -type sqlite3_vtab1 = Tsqlite3_vtab1 - -/* -** CAPI3REF: Virtual Table Cursor Object -** KEYWORDS: sqlite3_vtab_cursor {virtual table cursor} -** -** Every [virtual table module] implementation uses a subclass of the -** following structure to describe cursors that point into the -** [virtual table] and are used -** to loop through the virtual table. Cursors are created using the -** [sqlite3_module.xOpen | xOpen] method of the module and are destroyed -** by the [sqlite3_module.xClose | xClose] method. Cursors are used -** by the [xFilter], [xNext], [xEof], [xColumn], and [xRowid] methods -** of the module. Each module implementation will define -** the content of a cursor structure to suit its own needs. -** -** This superclass exists in order to define fields of the cursor that -** are common to all implementations. - */ -type Tsqlite3_vtab_cursor1 = struct { - FpVtab uintptr -} - -type sqlite3_vtab_cursor1 = Tsqlite3_vtab_cursor1 - // C documentation // // /* @@ -24354,20 +23699,6 @@ type Tsqlite3_mutex_methods = struct { type sqlite3_mutex_methods = Tsqlite3_mutex_methods -type Tsqlite3_mutex_methods1 = struct { - FxMutexInit uintptr - FxMutexEnd uintptr - FxMutexAlloc uintptr - FxMutexFree uintptr - FxMutexEnter uintptr - FxMutexTry uintptr - FxMutexLeave uintptr - FxMutexHeld uintptr - FxMutexNotheld uintptr -} - -type sqlite3_mutex_methods1 = Tsqlite3_mutex_methods1 - // C documentation // // /* @@ -24417,13 +23748,6 @@ type Tsqlite3_pcache_page = struct { type sqlite3_pcache_page = Tsqlite3_pcache_page -type Tsqlite3_pcache_page1 = struct { - FpBuf uintptr - FpExtra uintptr -} - -type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 - // C documentation // // /* @@ -24482,9 +23806,9 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** SQLite will typically create one cache instance for each open database file, // ** though this is not guaranteed. ^The // ** first parameter, szPage, is the size in bytes of the pages that must -// ** be allocated by the cache. ^szPage will always a power of two. ^The +// ** be allocated by the cache. ^szPage will always be a power of two. ^The // ** second parameter szExtra is a number of bytes of extra storage -// ** associated with each page cache entry. ^The szExtra parameter will +// ** associated with each page cache entry. ^The szExtra parameter will be // ** a number less than 250. SQLite will use the // ** extra szExtra bytes on each page to store metadata about the underlying // ** database page on disk. The value passed into szExtra depends @@ -24492,17 +23816,17 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** ^The third argument to xCreate(), bPurgeable, is true if the cache being // ** created will be used to cache database pages of a file stored on disk, or // ** false if it is used for an in-memory database. The cache implementation -// ** does not have to do anything special based with the value of bPurgeable; +// ** does not have to do anything special based upon the value of bPurgeable; // ** it is purely advisory. ^On a cache where bPurgeable is false, SQLite will // ** never invoke xUnpin() except to deliberately delete a page. // ** ^In other words, calls to xUnpin() on a cache with bPurgeable set to // ** false will always have the "discard" flag set to true. -// ** ^Hence, a cache created with bPurgeable false will +// ** ^Hence, a cache created with bPurgeable set to false will // ** never contain any unpinned pages. // ** // ** [[the xCachesize() page cache method]] // ** ^(The xCachesize() method may be called at any time by SQLite to set the -// ** suggested maximum cache-size (number of pages stored by) the cache +// ** suggested maximum cache-size (number of pages stored) for the cache // ** instance passed as the first argument. This is the value configured using // ** the SQLite "[PRAGMA cache_size]" command.)^ As with the bPurgeable // ** parameter, the implementation is not required to do anything with this @@ -24529,12 +23853,12 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** implementation must return a pointer to the page buffer with its content // ** intact. If the requested page is not already in the cache, then the // ** cache implementation should use the value of the createFlag -// ** parameter to help it determined what action to take: +// ** parameter to help it determine what action to take: // ** // ** // **
    createFlag Behavior when page is not already in cache // **
    0 Do not allocate a new page. Return NULL. -// **
    1 Allocate a new page if it easy and convenient to do so. +// **
    1 Allocate a new page if it is easy and convenient to do so. // ** Otherwise return NULL. // **
    2 Make every effort to allocate a new page. Only return // ** NULL if allocating a new page is effectively impossible. @@ -24551,7 +23875,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** as its second argument. If the third parameter, discard, is non-zero, // ** then the page must be evicted from the cache. // ** ^If the discard parameter is -// ** zero, then the page may be discarded or retained at the discretion of +// ** zero, then the page may be discarded or retained at the discretion of the // ** page cache implementation. ^The page cache implementation // ** may choose to evict unpinned pages at any time. // ** @@ -24569,7 +23893,7 @@ type sqlite3_pcache_page1 = Tsqlite3_pcache_page1 // ** When SQLite calls the xTruncate() method, the cache must discard all // ** existing cache entries with page numbers (keys) greater than or equal // ** to the value of the iLimit parameter passed to xTruncate(). If any -// ** of these pages are pinned, they are implicitly unpinned, meaning that +// ** of these pages are pinned, they become implicitly unpinned, meaning that // ** they can be safely discarded. // ** // ** [[the xDestroy() page cache method]] @@ -24603,24 +23927,6 @@ type Tsqlite3_pcache_methods2 = struct { type sqlite3_pcache_methods2 = Tsqlite3_pcache_methods2 -type Tsqlite3_pcache_methods21 = struct { - FiVersion int32 - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr - FxShrink uintptr -} - -type sqlite3_pcache_methods21 = Tsqlite3_pcache_methods21 - // C documentation // // /* @@ -24644,22 +23950,6 @@ type Tsqlite3_pcache_methods = struct { type sqlite3_pcache_methods = Tsqlite3_pcache_methods -type Tsqlite3_pcache_methods1 = struct { - FpArg uintptr - FxInit uintptr - FxShutdown uintptr - FxCreate uintptr - FxCachesize uintptr - FxPagecount uintptr - FxFetch uintptr - FxUnpin uintptr - FxRekey uintptr - FxTruncate uintptr - FxDestroy uintptr -} - -type sqlite3_pcache_methods1 = Tsqlite3_pcache_methods1 - // C documentation // // /* @@ -24720,7 +24010,7 @@ type sqlite3_snapshot = Tsqlite3_snapshot /* ** CAPI3REF: Flags for sqlite3_deserialize() ** -** The following are allowed values for 6th argument (the F argument) to +** The following are allowed values for the 6th argument (the F argument) to ** the [sqlite3_deserialize(D,S,P,N,M,F)] interface. ** ** The SQLITE_DESERIALIZE_FREEONCLOSE means that the database serialization @@ -24802,52 +24092,6 @@ type Tsqlite3_rtree_dbl = float64 type sqlite3_rtree_dbl = Tsqlite3_rtree_dbl -/* -** A pointer to a structure of the following type is passed as the first -** argument to callbacks registered using rtree_geometry_callback(). - */ -type Tsqlite3_rtree_geometry1 = struct { - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr -} - -type sqlite3_rtree_geometry1 = Tsqlite3_rtree_geometry1 - -/* -** A pointer to a structure of the following type is passed as the -** argument to scored geometry callback registered using -** sqlite3_rtree_query_callback(). -** -** Note that the first 5 fields of this structure are identical to -** sqlite3_rtree_geometry. This structure is a subclass of -** sqlite3_rtree_geometry. - */ -type Tsqlite3_rtree_query_info1 = struct { - F__ccgo_align [0]uint32 - FpContext uintptr - FnParam int32 - FaParam uintptr - FpUser uintptr - FxDelUser uintptr - FaCoord uintptr - FanQueue uintptr - FnCoord int32 - FiLevel int32 - FmxLevel int32 - FiRowid Tsqlite3_int64 - FrParentScore Tsqlite3_rtree_dbl - FeParentWithin int32 - FeWithin int32 - FrScore Tsqlite3_rtree_dbl - FapSqlParam uintptr - F__ccgo_pad16 [4]byte -} - -type sqlite3_rtree_query_info1 = Tsqlite3_rtree_query_info1 - /* ** Allowed values for sqlite3_rtree_query.eWithin and .eParentWithin. */ @@ -25245,340 +24489,6 @@ type Tfts5_extension_function = uintptr type fts5_extension_function = Tfts5_extension_function -type TFts5PhraseIter1 = struct { - Fa uintptr - Fb uintptr -} - -type Fts5PhraseIter1 = TFts5PhraseIter1 - -/* -** EXTENSION API FUNCTIONS -** -** xUserData(pFts): -** Return a copy of the pUserData pointer passed to the xCreateFunction() -** API when the extension function was registered. -** -** xColumnTotalSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the FTS5 table. Or, if iCol is -** non-negative but less than the number of columns in the table, return -** the total number of tokens in column iCol, considering all rows in -** the FTS5 table. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** xColumnCount(pFts): -** Return the number of columns in the table. -** -** xColumnSize(pFts, iCol, pnToken): -** If parameter iCol is less than zero, set output variable *pnToken -** to the total number of tokens in the current row. Or, if iCol is -** non-negative but less than the number of columns in the table, set -** *pnToken to the number of tokens in column iCol of the current row. -** -** If parameter iCol is greater than or equal to the number of columns -** in the table, SQLITE_RANGE is returned. Or, if an error occurs (e.g. -** an OOM condition or IO error), an appropriate SQLite error code is -** returned. -** -** This function may be quite inefficient if used with an FTS5 table -** created with the "columnsize=0" option. -** -** xColumnText: -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the text of column iCol of -** the current document. If successful, (*pz) is set to point to a buffer -** containing the text in utf-8 encoding, (*pn) is set to the size in bytes -** (not characters) of the buffer and SQLITE_OK is returned. Otherwise, -** if an error occurs, an SQLite error code is returned and the final values -** of (*pz) and (*pn) are undefined. -** -** xPhraseCount: -** Returns the number of phrases in the current query expression. -** -** xPhraseSize: -** If parameter iCol is less than zero, or greater than or equal to the -** number of phrases in the current query, as returned by xPhraseCount, -** 0 is returned. Otherwise, this function returns the number of tokens in -** phrase iPhrase of the query. Phrases are numbered starting from zero. -** -** xInstCount: -** Set *pnInst to the total number of occurrences of all phrases within -** the query within the current row. Return SQLITE_OK if successful, or -** an error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always returns 0. -** -** xInst: -** Query for the details of phrase match iIdx within the current row. -** Phrase matches are numbered starting from zero, so the iIdx argument -** should be greater than or equal to zero and smaller than the value -** output by xInstCount(). If iIdx is less than zero or greater than -** or equal to the value returned by xInstCount(), SQLITE_RANGE is returned. -** -** Otherwise, output parameter *piPhrase is set to the phrase number, *piCol -** to the column in which it occurs and *piOff the token offset of the -** first token of the phrase. SQLITE_OK is returned if successful, or an -** error code (i.e. SQLITE_NOMEM) if an error occurs. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xRowid: -** Returns the rowid of the current row. -** -** xTokenize: -** Tokenize text using the tokenizer belonging to the FTS5 table. -** -** xQueryPhrase(pFts5, iPhrase, pUserData, xCallback): -** This API function is used to query the FTS table for phrase iPhrase -** of the current query. Specifically, a query equivalent to: -** -** ... FROM ftstable WHERE ftstable MATCH $p ORDER BY rowid -** -** with $p set to a phrase equivalent to the phrase iPhrase of the -** current query is executed. Any column filter that applies to -** phrase iPhrase of the current query is included in $p. For each -** row visited, the callback function passed as the fourth argument -** is invoked. The context and API objects passed to the callback -** function may be used to access the properties of each matched row. -** Invoking Api.xUserData() returns a copy of the pointer passed as -** the third argument to pUserData. -** -** If parameter iPhrase is less than zero, or greater than or equal to -** the number of phrases in the query, as returned by xPhraseCount(), -** this function returns SQLITE_RANGE. -** -** If the callback function returns any value other than SQLITE_OK, the -** query is abandoned and the xQueryPhrase function returns immediately. -** If the returned value is SQLITE_DONE, xQueryPhrase returns SQLITE_OK. -** Otherwise, the error code is propagated upwards. -** -** If the query runs to completion without incident, SQLITE_OK is returned. -** Or, if some error occurs before the query completes or is aborted by -** the callback, an SQLite error code is returned. -** -** -** xSetAuxdata(pFts5, pAux, xDelete) -** -** Save the pointer passed as the second argument as the extension function's -** "auxiliary data". The pointer may then be retrieved by the current or any -** future invocation of the same fts5 extension function made as part of -** the same MATCH query using the xGetAuxdata() API. -** -** Each extension function is allocated a single auxiliary data slot for -** each FTS query (MATCH expression). If the extension function is invoked -** more than once for a single FTS query, then all invocations share a -** single auxiliary data context. -** -** If there is already an auxiliary data pointer when this function is -** invoked, then it is replaced by the new pointer. If an xDelete callback -** was specified along with the original pointer, it is invoked at this -** point. -** -** The xDelete callback, if one is specified, is also invoked on the -** auxiliary data pointer after the FTS5 query has finished. -** -** If an error (e.g. an OOM condition) occurs within this function, -** the auxiliary data is set to NULL and an error code returned. If the -** xDelete parameter was not NULL, it is invoked on the auxiliary data -** pointer before returning. -** -** -** xGetAuxdata(pFts5, bClear) -** -** Returns the current auxiliary data pointer for the fts5 extension -** function. See the xSetAuxdata() method for details. -** -** If the bClear argument is non-zero, then the auxiliary data is cleared -** (set to NULL) before this function returns. In this case the xDelete, -** if any, is not invoked. -** -** -** xRowCount(pFts5, pnRow) -** -** This function is used to retrieve the total number of rows in the table. -** In other words, the same value that would be returned by: -** -** SELECT count(*) FROM ftstable; -** -** xPhraseFirst() -** This function is used, along with type Fts5PhraseIter and the xPhraseNext -** method, to iterate through all instances of a single query phrase within -** the current row. This is the same information as is accessible via the -** xInstCount/xInst APIs. While the xInstCount/xInst APIs are more convenient -** to use, this API may be faster under some circumstances. To iterate -** through instances of phrase iPhrase, use the following code: -** -** Fts5PhraseIter iter; -** int iCol, iOff; -** for(pApi->xPhraseFirst(pFts, iPhrase, &iter, &iCol, &iOff); -** iCol>=0; -** pApi->xPhraseNext(pFts, &iter, &iCol, &iOff) -** ){ -** // An instance of phrase iPhrase at offset iOff of column iCol -** } -** -** The Fts5PhraseIter structure is defined above. Applications should not -** modify this structure directly - it should only be used as shown above -** with the xPhraseFirst() and xPhraseNext() API methods (and by -** xPhraseFirstColumn() and xPhraseNextColumn() as illustrated below). -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. If the FTS5 table is created -** with either "detail=none" or "detail=column" and "content=" option -** (i.e. if it is a contentless table), then this API always iterates -** through an empty set (all calls to xPhraseFirst() set iCol to -1). -** -** In all cases, matches are visited in (column ASC, offset ASC) order. -** i.e. all those in column 0, sorted by offset, followed by those in -** column 1, etc. -** -** xPhraseNext() -** See xPhraseFirst above. -** -** xPhraseFirstColumn() -** This function and xPhraseNextColumn() are similar to the xPhraseFirst() -** and xPhraseNext() APIs described above. The difference is that instead -** of iterating through all instances of a phrase in the current row, these -** APIs are used to iterate through the set of columns in the current row -** that contain one or more instances of a specified phrase. For example: -** -** Fts5PhraseIter iter; -** int iCol; -** for(pApi->xPhraseFirstColumn(pFts, iPhrase, &iter, &iCol); -** iCol>=0; -** pApi->xPhraseNextColumn(pFts, &iter, &iCol) -** ){ -** // Column iCol contains at least one instance of phrase iPhrase -** } -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" option. If the FTS5 table is created with either -** "detail=none" "content=" option (i.e. if it is a contentless table), -** then this API always iterates through an empty set (all calls to -** xPhraseFirstColumn() set iCol to -1). -** -** The information accessed using this API and its companion -** xPhraseFirstColumn() may also be obtained using xPhraseFirst/xPhraseNext -** (or xInst/xInstCount). The chief advantage of this API is that it is -** significantly more efficient than those alternatives when used with -** "detail=column" tables. -** -** xPhraseNextColumn() -** See xPhraseFirstColumn above. -** -** xQueryToken(pFts5, iPhrase, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase iPhrase of the current -** query. Before returning, output parameter *ppToken is set to point -** to a buffer containing the requested token, and *pnToken to the -** size of this buffer in bytes. -** -** If iPhrase or iToken are less than zero, or if iPhrase is greater than -** or equal to the number of phrases in the query as reported by -** xPhraseCount(), or if iToken is equal to or greater than the number of -** tokens in the phrase, SQLITE_RANGE is returned and *ppToken and *pnToken - - are both zeroed. - -** -** The output text is not a copy of the query text that specified the -** token. It is the output of the tokenizer module. For tokendata=1 -** tables, this includes any embedded 0x00 and trailing data. -** -** xInstToken(pFts5, iIdx, iToken, ppToken, pnToken) -** This is used to access token iToken of phrase hit iIdx within the -** current row. If iIdx is less than zero or greater than or equal to the -** value returned by xInstCount(), SQLITE_RANGE is returned. Otherwise, -** output variable (*ppToken) is set to point to a buffer containing the -** matching document token, and (*pnToken) to the size of that buffer in -** bytes. -** -** The output text is not a copy of the document text that was tokenized. -** It is the output of the tokenizer module. For tokendata=1 tables, this -** includes any embedded 0x00 and trailing data. -** -** This API may be slow in some cases if the token identified by parameters -** iIdx and iToken matched a prefix token in the query. In most cases, the -** first call to this API for each prefix token in the query is forced -** to scan the portion of the full-text index that matches the prefix -** token to collect the extra data required by this API. If the prefix -** token matches a large number of token instances in the document set, -** this may be a performance problem. -** -** If the user knows in advance that a query may use this API for a -** prefix token, FTS5 may be configured to collect all required data as part -** of the initial querying of the full-text index, avoiding the second scan -** entirely. This also causes prefix queries that do not use this API to -** run more slowly and use more memory. FTS5 may be configured in this way -** either on a per-table basis using the [FTS5 insttoken | 'insttoken'] -** option, or on a per-query basis using the -** [fts5_insttoken | fts5_insttoken()] user function. -** -** This API can be quite slow if used with an FTS5 table created with the -** "detail=none" or "detail=column" option. -** -** xColumnLocale(pFts5, iIdx, pzLocale, pnLocale) -** If parameter iCol is less than zero, or greater than or equal to the -** number of columns in the table, SQLITE_RANGE is returned. -** -** Otherwise, this function attempts to retrieve the locale associated -** with column iCol of the current row. Usually, there is no associated -** locale, and output parameters (*pzLocale) and (*pnLocale) are set -** to NULL and 0, respectively. However, if the fts5_locale() function -** was used to associate a locale with the value when it was inserted -** into the fts5 table, then (*pzLocale) is set to point to a nul-terminated -** buffer containing the name of the locale in utf-8 encoding. (*pnLocale) -** is set to the size in bytes of the buffer, not including the -** nul-terminator. -** -** If successful, SQLITE_OK is returned. Or, if an error occurs, an -** SQLite error code is returned. The final value of the output parameters -** is undefined in this case. -** -** xTokenize_v2: -** Tokenize text using the tokenizer belonging to the FTS5 table. This -** API is the same as the xTokenize() API, except that it allows a tokenizer -** locale to be specified. -*/ -type TFts5ExtensionApi1 = struct { - FiVersion int32 - FxUserData uintptr - FxColumnCount uintptr - FxRowCount uintptr - FxColumnTotalSize uintptr - FxTokenize uintptr - FxPhraseCount uintptr - FxPhraseSize uintptr - FxInstCount uintptr - FxInst uintptr - FxRowid uintptr - FxColumnText uintptr - FxColumnSize uintptr - FxQueryPhrase uintptr - FxSetAuxdata uintptr - FxGetAuxdata uintptr - FxPhraseFirst uintptr - FxPhraseNext uintptr - FxPhraseFirstColumn uintptr - FxPhraseNextColumn uintptr - FxQueryToken uintptr - FxInstToken uintptr - FxColumnLocale uintptr - FxTokenize_v2 uintptr -} - -type Fts5ExtensionApi1 = TFts5ExtensionApi1 - type Tfts5_tokenizer_v2 = struct { FiVersion int32 FxCreate uintptr @@ -25588,15 +24498,6 @@ type Tfts5_tokenizer_v2 = struct { type fts5_tokenizer_v2 = Tfts5_tokenizer_v2 -type Tfts5_tokenizer_v21 = struct { - FiVersion int32 - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer_v21 = Tfts5_tokenizer_v21 - // C documentation // // /* @@ -25612,14 +24513,6 @@ type Tfts5_tokenizer = struct { type fts5_tokenizer = Tfts5_tokenizer -type Tfts5_tokenizer1 = struct { - FxCreate uintptr - FxDelete uintptr - FxTokenize uintptr -} - -type fts5_tokenizer1 = Tfts5_tokenizer1 - /* Flags that may be passed as the third argument to xTokenize() */ /* Flags that may be passed by the tokenizer implementation back to FTS5 @@ -25645,17 +24538,6 @@ type Tfts5_api = struct { type fts5_api = Tfts5_api -type Tfts5_api1 = struct { - FiVersion int32 - FxCreateTokenizer uintptr - FxFindTokenizer uintptr - FxCreateFunction uintptr - FxCreateTokenizer_v2 uintptr - FxFindTokenizer_v2 uintptr -} - -type fts5_api1 = Tfts5_api1 - /* ** END OF REGISTRATION API *************************************************************************/ @@ -25710,11 +24592,17 @@ type fts5_api1 = Tfts5_api1 ** * Terms in the GROUP BY or ORDER BY clauses of a SELECT statement. ** * Terms in the VALUES clause of an INSERT statement ** -** The hard upper limit here is 32676. Most database people will +** The hard upper limit here is 32767. Most database people will ** tell you that in a well-normalized database, you usually should ** not have more than a dozen or so columns in any table. And if ** that is the case, there is no point in having more than a few ** dozen values in any of the other situations described above. +** +** An index can only have SQLITE_MAX_COLUMN columns from the user +** point of view, but the underlying b-tree that implements the index +** might have up to twice as many columns in a WITHOUT ROWID table, +** since must also store the primary key at the end. Hence the +** column count for Index is u16 instead of i16. */ /* @@ -26088,55 +24976,11 @@ type THashElem = struct { Fprev uintptr Fdata uintptr FpKey uintptr + Fh uint32 } type HashElem = THashElem -/* A complete hash table is an instance of the following structure. -** The internals of this structure are intended to be opaque -- client -** code should not attempt to access or modify the fields of this structure -** directly. Change this structure only by using the routines below. -** However, some of the "procedures" and "functions" for modifying and -** accessing this structure are really macros, so we can't really make -** this structure opaque. -** -** All elements of the hash table are on a single doubly-linked list. -** Hash.first points to the head of this list. -** -** There are Hash.htsize buckets. Each bucket points to a spot in -** the global doubly-linked list. The contents of the bucket are the -** element pointed to plus the next _ht.count-1 elements in the list. -** -** Hash.htsize and Hash.ht may be zero. In that case lookup is done -** by a linear search of the global list. For small tables, the -** Hash.ht table is never allocated because if there are few elements -** in the table, it is faster to do a linear search than to manage -** the hash table. - */ -type THash1 = struct { - Fhtsize uint32 - Fcount uint32 - Ffirst uintptr - Fht uintptr -} - -type Hash1 = THash1 - -/* Each element in the hash table is an instance of the following -** structure. All elements are stored on a single doubly-linked list. -** -** Again, this structure is intended to be opaque, but it can't really -** be opaque because it is used by macros. - */ -type THashElem1 = struct { - Fnext uintptr - Fprev uintptr - Fdata uintptr - FpKey uintptr -} - -type HashElem1 = THashElem1 - type Tsize_t = uint32 type size_t = Tsize_t @@ -26491,6 +25335,11 @@ type max_align_t = Tmax_align_t ** ourselves. */ +/* +** Work around C99 "flex-array" syntax for pre-C99 compilers, so as +** to avoid complaints from -fsanitize=strict-bounds. + */ + /* ** Macros to compute minimum and maximum of two numbers. */ @@ -26549,6 +25398,17 @@ type i8 = Ti8 /* 1-byte signed integer */ +// C documentation +// +// /* A bitfield type for use inside of structures. Always follow with :N where +// ** N is the number of bits. +// */ +type Tbft = uint32 + +type bft = Tbft + +/* Bit Field Type */ + /* ** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value ** that can be stored in a u32 without loss of data. The value @@ -26658,14 +25518,6 @@ type TBusyHandler = struct { type BusyHandler = TBusyHandler -type TBusyHandler1 = struct { - FxBusyHandler uintptr - FpBusyArg uintptr - FnBusy int32 -} - -type BusyHandler1 = TBusyHandler1 - /* ** Name of table that holds the database schema. ** @@ -26750,7 +25602,7 @@ type BusyHandler1 = TBusyHandler1 type TAggInfo = struct { FdirectMode Tu8 FuseSortingIdx Tu8 - FnSortingColumn Tu16 + FnSortingColumn Tu32 FsortingIdx int32 FsortingIdxPTab int32 FiFirstReg int32 @@ -26852,7 +25704,6 @@ type TDbClientData = struct { FpNext uintptr FpData uintptr FxDestructor uintptr - FzName [1]int8 } type DbClientData = TDbClientData @@ -26911,12 +25762,13 @@ type TExpr = struct { FpAggInfo uintptr Fy struct { FpWin [0]uintptr + FnReg [0]int32 Fsub [0]struct { FiAddr int32 FregReturn int32 } FpTab uintptr - F__ccgo_pad3 [4]byte + F__ccgo_pad4 [4]byte } } @@ -26925,7 +25777,6 @@ type Expr = TExpr type TExprList = struct { FnExpr int32 FnAlloc int32 - Fa [1]TExprList_item } type ExprList = TExprList @@ -26940,7 +25791,6 @@ type TFKey = struct { FisDeferred Tu8 FaAction [2]Tu8 FapTrigger [2]uintptr - FaCol [1]TsColMap } type FKey = TFKey @@ -26990,7 +25840,6 @@ type FuncDefHash = TFuncDefHash type TIdList = struct { FnId int32 - Fa [1]TIdList_item } type IdList = TIdList @@ -27020,7 +25869,7 @@ type TIndex = struct { FaAvgEq uintptr FaSample uintptr FaiRowEst uintptr - F__ccgo_align34 [4]byte + F__ccgo_align33 [4]byte FnRowEst0 TtRowcnt FcolNotIdxed TBitmask } @@ -27056,7 +25905,6 @@ type TKeyInfo = struct { FnAllField Tu16 Fdb uintptr FaSortFlags uintptr - FaColl [1]uintptr } type KeyInfo = TKeyInfo @@ -27128,19 +25976,22 @@ type TParse = struct { FzErrMsg uintptr FpVdbe uintptr Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 + FnQueryLoop TLogEst Fnested Tu8 FnTempReg Tu8 FisMultiWrite Tu8 FmayAbort Tu8 FhasCompound Tu8 - FokConstFactor Tu8 FdisableLookaside Tu8 FprepFlags Tu8 FwithinRJSubrtn Tu8 - FbHasWith Tu8 FmSubrtnSig Tu8 + FeTriggerOp Tu8 + FbReturning Tu8 + FeOrconf Tu8 + FdisableTriggers Tu8 + F__ccgo_align18 [1]byte + F__ccgo32 uint8 FnRangeReg int32 FiRangeReg int32 FnErr int32 @@ -27154,11 +26005,8 @@ type TParse = struct { FpConstExpr uintptr FpIdxEpr uintptr FpIdxPartExpr uintptr - FconstraintName TToken FwriteMask TyDbMask FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 FnMaxArg int32 FnSelect int32 FnProgressSteps Tu32 @@ -27169,39 +26017,41 @@ type TParse = struct { FpTriggerTab uintptr FpTriggerPrg uintptr FpCleanup uintptr + FaTempReg [8]int32 + FpOuterParse uintptr + FsNameToken TToken + Foldmask Tu32 + Fnewmask Tu32 Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr + Fd [0]struct { + FpReturning uintptr + } + Fcr struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + } + } + FsLastToken TToken + FnVar TynVar + FiPkSortOrder Tu8 + Fexplain Tu8 + FeParseMode Tu8 + FnVtabLock int32 + FnHeight int32 + FaddrExplain int32 + FpVList uintptr + FpReprepare uintptr + FzTail uintptr + FpNewTable uintptr + FpNewIndex uintptr + FpNewTrigger uintptr + FzAuthContext uintptr + FsArg TToken + FapVtabLock uintptr + FpWith uintptr + FpRename uintptr } type Parse = TParse @@ -27215,23 +26065,26 @@ type TParseCleanup = struct { type ParseCleanup = TParseCleanup type TPreUpdate = struct { - F__ccgo_align [0]uint32 - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr + F__ccgo_align [0]uint32 + Fv uintptr + FpCsr uintptr + Fop int32 + FaRecord uintptr + FpKeyinfo uintptr + FpUnpacked uintptr + FpNewUnpacked uintptr + FiNewReg int32 + FiBlobWrite int32 + F__ccgo_align9 [4]byte + FiKey1 Ti64 + FiKey2 Ti64 + Foldipk TMem + FaNew uintptr + FpTab uintptr + FpPk uintptr + FapDflt uintptr + FkeyinfoSpace [20]Tu8 + F__ccgo_pad17 [4]byte } type PreUpdate = TPreUpdate @@ -27390,7 +26243,6 @@ type TSrcList = struct { F__ccgo_align [0]uint32 FnSrc int32 FnAlloc Tu32 - Fa [1]TSrcItem } type SrcList = TSrcList @@ -27407,10 +26259,6 @@ type TStrAccum = struct { type StrAccum = TStrAccum -type Tsqlite3_str1 = TStrAccum - -type sqlite3_str1 = Tsqlite3_str1 - /* Internal alias for sqlite3_str */ type TTable = struct { FzName uintptr @@ -27445,6 +26293,7 @@ type TTable = struct { } FpTrigger uintptr FpSchema uintptr + FaHx [16]Tu8 } type Table = TTable @@ -27631,7 +26480,6 @@ type TWhereInfo = struct { FrevMask TBitmask FsWC TWhereClause FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel } type WhereInfo = TWhereInfo @@ -27673,7 +26521,6 @@ type TWith = struct { FnCte int32 FbView int32 FpOuter uintptr - Fa [1]TCte } type With = TWith @@ -27851,9 +26698,9 @@ type DbPage = TDbPage // /* // ** Handle type for pages. // */ -type TPgHdr2 = TDbPage +type TPgHdr = TDbPage -type PgHdr2 = TPgHdr2 +type PgHdr = TPgHdr /* Functions to support testing and debugging. */ @@ -27986,56 +26833,6 @@ type TBtreePayload = struct { type BtreePayload = TBtreePayload -/* Allowed flags for sqlite3BtreeDelete() and sqlite3BtreeInsert() */ - -/* An instance of the BtreePayload object describes the content of a single -** entry in either an index or table btree. -** -** Index btrees (used for indexes and also WITHOUT ROWID tables) contain -** an arbitrary key and no data. These btrees have pKey,nKey set to the -** key and the pData,nData,nZero fields are uninitialized. The aMem,nMem -** fields give an array of Mem objects that are a decomposition of the key. -** The nMem field might be zero, indicating that no decomposition is available. -** -** Table btrees (used for rowid tables) contain an integer rowid used as -** the key and passed in the nKey field. The pKey field is zero. -** pData,nData hold the content of the new entry. nZero extra zero bytes -** are appended to the end of the content when constructing the entry. -** The aMem,nMem fields are uninitialized for table btrees. -** -** Field usage summary: -** -** Table BTrees Index Btrees -** -** pKey always NULL encoded key -** nKey the ROWID length of pKey -** pData data not used -** aMem not used decomposed key value -** nMem not used entries in aMem -** nData length of pData not used -** nZero extra zeros after pData not used -** -** This object is used to pass information into sqlite3BtreeInsert(). The -** same information used to be passed as five separate parameters. But placing -** the information into this object helps to keep the interface more -** organized and understandable, and it also helps the resulting code to -** run a little faster by using fewer registers for parameter passing. - */ -type TBtreePayload1 = struct { - F__ccgo_align [0]uint32 - FpKey uintptr - F__ccgo_align1 [4]byte - FnKey Tsqlite3_int64 - FpData uintptr - FaMem uintptr - FnMem Tu16 - FnData int32 - FnZero int32 - F__ccgo_pad7 [4]byte -} - -type BtreePayload1 = TBtreePayload1 - /************** End of btree.h ***********************************************/ /************** Continuing where we left off in sqliteInt.h ******************/ /************** Include vdbe.h in the middle of sqliteInt.h ******************/ @@ -28143,16 +26940,6 @@ type TMem = struct { type Mem = TMem -// C documentation -// -// /* -// ** The names of the following types declared in vdbeInt.h are required -// ** for the VdbeOp definition. -// */ -type Tsqlite3_value1 = TMem - -type sqlite3_value1 = Tsqlite3_value1 - type TSubProgram = struct { FaOp uintptr FnOp int32 @@ -28176,38 +26963,11 @@ type TSubrtnSig = struct { type SubrtnSig = TSubrtnSig -/* -** A signature for a reusable subroutine that materializes the RHS of -** an IN operator. - */ -type TSubrtnSig1 = struct { - FselId int32 - FbComplete Tu8 - FzAff uintptr - FiTable int32 - FiAddr int32 - FregReturn int32 -} - -type SubrtnSig1 = TSubrtnSig1 - /* ** A single instruction of the virtual machine has an opcode ** and as many as three operands. The instruction is recorded ** as an instance of the following structure: */ -type TVdbeOp1 = struct { - Fopcode Tu8 - Fp4type int8 - Fp5 Tu16 - Fp1 int32 - Fp2 int32 - Fp3 int32 - Fp4 Tp4union -} - -type VdbeOp1 = TVdbeOp1 - type TVdbeOp = struct { Fopcode Tu8 Fp4type int8 @@ -28220,34 +26980,10 @@ type TVdbeOp = struct { type VdbeOp = TVdbeOp -/* -** A sub-routine used to implement a trigger program. - */ -type TSubProgram1 = struct { - FaOp uintptr - FnOp int32 - FnMem int32 - FnCsr int32 - FaOnce uintptr - Ftoken uintptr - FpNext uintptr -} - -type SubProgram1 = TSubProgram1 - /* ** A smaller version of VdbeOp used for the VdbeAddOpList() function because ** it takes up less space. */ -type TVdbeOpList1 = struct { - Fopcode Tu8 - Fp1 int8 - Fp2 int8 - Fp3 int8 -} - -type VdbeOpList1 = TVdbeOpList1 - type TVdbeOpList = struct { Fopcode Tu8 Fp1 int8 @@ -28261,92 +26997,6 @@ type TRecordCompare = uintptr type RecordCompare = TRecordCompare -/* Use SQLITE_ENABLE_COMMENTS to enable generation of extra comments on -** each VDBE opcode. -** -** Use the SQLITE_ENABLE_MODULE_COMMENTS macro to see some extra no-op -** comments in VDBE programs that show key decision points in the code -** generator. - */ - -/* -** The VdbeCoverage macros are used to set a coverage testing point -** for VDBE branch instructions. The coverage testing points are line -** numbers in the sqlite3.c source file. VDBE branch coverage testing -** only works with an amalgamation build. That's ok since a VDBE branch -** coverage build designed for testing the test suite only. No application -** should ever ship with VDBE branch coverage measuring turned on. -** -** VdbeCoverage(v) // Mark the previously coded instruction -** // as a branch -** -** VdbeCoverageIf(v, conditional) // Mark previous if conditional true -** -** VdbeCoverageAlwaysTaken(v) // Previous branch is always taken -** -** VdbeCoverageNeverTaken(v) // Previous branch is never taken -** -** VdbeCoverageNeverNull(v) // Previous three-way branch is only -** // taken on the first two ways. The -** // NULL option is not possible -** -** VdbeCoverageEqNe(v) // Previous OP_Jump is only interested -** // in distinguishing equal and not-equal. -** -** Every VDBE branch operation must be tagged with one of the macros above. -** If not, then when "make test" is run with -DSQLITE_VDBE_COVERAGE and -** -DSQLITE_DEBUG then an ALWAYS() will fail in the vdbeTakeBranch() -** routine in vdbe.c, alerting the developer to the missed tag. -** -** During testing, the test application will invoke -** sqlite3_test_control(SQLITE_TESTCTRL_VDBE_COVERAGE,...) to set a callback -** routine that is invoked as each bytecode branch is taken. The callback -** contains the sqlite3.c source line number of the VdbeCoverage macro and -** flags to indicate whether or not the branch was taken. The test application -** is responsible for keeping track of this and reporting byte-code branches -** that are never taken. -** -** See the VdbeBranchTaken() macro and vdbeTakeBranch() function in the -** vdbe.c source file for additional information. - */ - -/************** End of vdbe.h ************************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ -/************** Include pcache.h in the middle of sqliteInt.h ****************/ -/************** Begin file pcache.h ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This header file defines the interface that the sqlite page cache -** subsystem. - */ - -type TPgHdr = struct { - F__ccgo_align [0]uint32 - FpPage uintptr - FpData uintptr - FpExtra uintptr - FpCache uintptr - FpDirty uintptr - FpPager uintptr - Fpgno TPgno - Fflags Tu16 - F__ccgo_align8 [2]byte - FnRef Ti64 - FpDirtyNext uintptr - FpDirtyPrev uintptr -} - -type PgHdr = TPgHdr - type TPCache = struct { F__ccgo_align [0]uint32 FpDirty uintptr @@ -28367,187 +27017,6 @@ type TPCache = struct { type PCache = TPCache -/************** End of mutex.h ***********************************************/ -/************** Continuing where we left off in sqliteInt.h ******************/ - -/* The SQLITE_EXTRA_DURABLE compile-time option used to set the default -** synchronous setting to EXTRA. It is no longer supported. - */ - -/* -** Default synchronous levels. -** -** Note that (for historical reasons) the PAGER_SYNCHRONOUS_* macros differ -** from the SQLITE_DEFAULT_SYNCHRONOUS value by 1. -** -** PAGER_SYNCHRONOUS DEFAULT_SYNCHRONOUS -** OFF 1 0 -** NORMAL 2 1 -** FULL 3 2 -** EXTRA 4 3 -** -** The "PRAGMA synchronous" statement also uses the zero-based numbers. -** In other words, the zero-based numbers are used for all external interfaces -** and the one-based values are used internally. - */ - -/* -** Each database file to be accessed by the system is an instance -** of the following structure. There are normally two of these structures -** in the sqlite.aDb[] array. aDb[0] is the main database file and -** aDb[1] is the database file used to hold temporary tables. Additional -** databases may be attached. - */ -type TDb1 = struct { - FzDbSName uintptr - FpBt uintptr - Fsafety_level Tu8 - FbSyncSet Tu8 - FpSchema uintptr -} - -type Db1 = TDb1 - -/* -** An instance of the following structure stores a database schema. -** -** Most Schema objects are associated with a Btree. The exception is -** the Schema for the TEMP database (sqlite3.aDb[1]) which is free-standing. -** In shared cache mode, a single Schema object can be shared by multiple -** Btrees that refer to the same underlying BtShared object. -** -** Schema objects are automatically deallocated when the last Btree that -** references them is destroyed. The TEMP Schema is manually freed by -** sqlite3_close(). -* -** A thread must be holding a mutex on the corresponding Btree in order -** to access Schema content. This implies that the thread must also be -** holding a mutex on the sqlite3 connection pointer that owns the Btree. -** For a TEMP Schema, only the connection mutex is required. - */ -type TSchema1 = struct { - Fschema_cookie int32 - FiGeneration int32 - FtblHash THash - FidxHash THash - FtrigHash THash - FfkeyHash THash - FpSeqTab uintptr - Ffile_format Tu8 - Fenc Tu8 - FschemaFlags Tu16 - Fcache_size int32 -} - -type Schema1 = TSchema1 - -/* -** These macros can be used to test, set, or clear bits in the -** Db.pSchema->flags field. - */ - -/* -** Allowed values for the DB.pSchema->flags field. -** -** The DB_SchemaLoaded flag is set after the database schema has been -** read into internal hash tables. -** -** DB_UnresetViews means that one or more views have column names that -** have been filled out. If the schema changes, these column names might -** changes and so the view will need to be reset. - */ - -/* -** The number of different kinds of things that can be limited -** using the sqlite3_limit() interface. - */ - -/* -** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects -** associated with a particular database connection. The use of -** lookaside malloc provides a significant performance enhancement -** (approx 10%) by avoiding numerous malloc/free requests while parsing -** SQL statements. -** -** The Lookaside structure holds configuration information about the -** lookaside malloc subsystem. Each available memory allocation in -** the lookaside subsystem is stored on a linked list of LookasideSlot -** objects. -** -** Lookaside allocations are only allowed for objects that are associated -** with a particular database connection. Hence, schema information cannot -** be stored in lookaside because in shared cache mode the schema information -** is shared by multiple database connections. Therefore, while parsing -** schema information, the Lookaside.bEnabled flag is cleared so that -** lookaside allocations are not used to construct the schema objects. -** -** New lookaside allocations are only allowed if bDisable==0. When -** bDisable is greater than zero, sz is set to zero which effectively -** disables lookaside without adding a new test for the bDisable flag -** in a performance-critical path. sz should be set by to szTrue whenever -** bDisable changes back to zero. -** -** Lookaside buffers are initially held on the pInit list. As they are -** used and freed, they are added back to the pFree list. New allocations -** come off of pFree first, then pInit as a fallback. This dual-list -** allows use to compute a high-water mark - the maximum number of allocations -** outstanding at any point in the past - by subtracting the number of -** allocations on the pInit list from the total number of allocations. -** -** Enhancement on 2019-12-12: Two-size-lookaside -** The default lookaside configuration is 100 slots of 1200 bytes each. -** The larger slot sizes are important for performance, but they waste -** a lot of space, as most lookaside allocations are less than 128 bytes. -** The two-size-lookaside enhancement breaks up the lookaside allocation -** into two pools: One of 128-byte slots and the other of the default size -** (1200-byte) slots. Allocations are filled from the small-pool first, -** failing over to the full-size pool if that does not work. Thus more -** lookaside slots are available while also using less memory. -** This enhancement can be omitted by compiling with -** SQLITE_OMIT_TWOSIZE_LOOKASIDE. - */ -type TLookaside1 = struct { - FbDisable Tu32 - Fsz Tu16 - FszTrue Tu16 - FbMalloced Tu8 - FnSlot Tu32 - FanStat [3]Tu32 - FpInit uintptr - FpFree uintptr - FpSmallInit uintptr - FpSmallFree uintptr - FpMiddle uintptr - FpStart uintptr - FpEnd uintptr - FpTrueEnd uintptr -} - -type Lookaside1 = TLookaside1 - -type TLookasideSlot1 = struct { - FpNext uintptr -} - -type LookasideSlot1 = TLookasideSlot1 - -/* Size of the smaller allocations in two-size lookaside */ - -/* -** A hash table for built-in function definitions. (Application-defined -** functions use a regular table table from hash.h.) -** -** Hash each FuncDef structure into one of the FuncDefHash.a[] slots. -** Collisions are on the FuncDef.u.pHash chain. Use the SQLITE_FUNC_HASH() -** macro to compute a hash on the function name. - */ -type TFuncDefHash1 = struct { - Fa [23]uintptr -} - -type FuncDefHash1 = TFuncDefHash1 - // C documentation // // /* @@ -28557,927 +27026,6 @@ type Tsqlite3_xauth = uintptr type sqlite3_xauth = Tsqlite3_xauth -/* This is an extra SQLITE_TRACE macro that indicates "legacy" tracing -** in the style of sqlite3_trace() - */ - -/* -** Maximum number of sqlite3.aDb[] entries. This is the number of attached -** databases plus 2 for "main" and "temp". - */ - -/* -** Each database connection is an instance of the following structure. - */ -type Tsqlite31 = struct { - F__ccgo_align [0]uint32 - FpVfs uintptr - FpVdbe uintptr - FpDfltColl uintptr - Fmutex uintptr - FaDb uintptr - FnDb int32 - FmDbFlags Tu32 - F__ccgo_align7 [4]byte - Fflags Tu64 - FlastRowid Ti64 - FszMmap Ti64 - FnSchemaLock Tu32 - FopenFlags uint32 - FerrCode int32 - FerrByteOffset int32 - FerrMask int32 - FiSysErrno int32 - FdbOptFlags Tu32 - Fenc Tu8 - FautoCommit Tu8 - Ftemp_store Tu8 - FmallocFailed Tu8 - FbBenignMalloc Tu8 - FdfltLockMode Tu8 - FnextAutovac int8 - FsuppressErr Tu8 - FvtabOnConflict Tu8 - FisTransactionSavepoint Tu8 - FmTrace Tu8 - FnoSharedCache Tu8 - FnSqlExec Tu8 - FeOpenState Tu8 - FnextPagesize int32 - FnChange Ti64 - FnTotalChange Ti64 - FaLimit [12]int32 - FnMaxSorterMmap int32 - Finit1 Tsqlite3InitInfo - FnVdbeActive int32 - FnVdbeRead int32 - FnVdbeWrite int32 - FnVdbeExec int32 - FnVDestroy int32 - FnExtension int32 - FaExtension uintptr - Ftrace struct { - FxV2 [0]uintptr - FxLegacy uintptr - } - FpTraceArg uintptr - FxProfile uintptr - FpProfileArg uintptr - FpCommitArg uintptr - FxCommitCallback uintptr - FpRollbackArg uintptr - FxRollbackCallback uintptr - FpUpdateArg uintptr - FxUpdateCallback uintptr - FpAutovacPagesArg uintptr - FxAutovacDestr uintptr - FxAutovacPages uintptr - FpParse uintptr - FpPreUpdateArg uintptr - FxPreUpdateCallback uintptr - FpPreUpdate uintptr - FxWalCallback uintptr - FpWalArg uintptr - FxCollNeeded uintptr - FxCollNeeded16 uintptr - FpCollNeededArg uintptr - FpErr uintptr - F__ccgo_align67 [4]byte - Fu1 struct { - F__ccgo_align [0]uint32 - FnotUsed1 [0]float64 - FisInterrupted int32 - F__ccgo_pad2 [4]byte - } - Flookaside TLookaside - FxAuth Tsqlite3_xauth - FpAuthArg uintptr - FxProgress uintptr - FpProgressArg uintptr - FnProgressOps uint32 - FnVTrans int32 - FaModule THash - FpVtabCtx uintptr - FaVTrans uintptr - FpDisconnect uintptr - FaFunc THash - FaCollSeq THash - FbusyHandler TBusyHandler - FaDbStatic [2]TDb - FpSavepoint uintptr - FnAnalysisLimit int32 - FbusyTimeout int32 - FnSavepoint int32 - FnStatement int32 - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpnBytesFreed uintptr - FpDbData uintptr - FpBlockingConnection uintptr - FpUnlockConnection uintptr - FpUnlockArg uintptr - FxUnlockNotify uintptr - FpNextBlocked uintptr - F__ccgo_pad97 [4]byte -} - -type sqlite31 = Tsqlite31 - -/* -** A macro to discover the encoding of a database. - */ - -/* -** A u64 constant where the lower 32 bits are all zeros. Only the -** upper 32 bits are included in the argument. Necessary because some -** C-compilers still do not accept LL integer literals. - */ - -/* -** Possible values for the sqlite3.flags. -** -** Value constraints (enforced via assert()): -** SQLITE_FullFSync == PAGER_FULLFSYNC -** SQLITE_CkptFullFSync == PAGER_CKPT_FULLFSYNC -** SQLITE_CacheSpill == PAGER_CACHE_SPILL - */ -/* result set is empty */ -/* DELETE, or UPDATE and return */ -/* the count using a callback. */ - -/* Flags used only if debugging */ - -/* -** Allowed values for sqlite3.mDbFlags - */ - -/* -** Bits of the sqlite3.dbOptFlags field that are used by the -** sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS,...) interface to -** selectively disable various optimizations. - */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x0000800. Don't change it */ -/* TH3 expects this value ^^^^^^^^^^ to be 0x40000. Coordinate any change */ -/* TH3 expects this value ^^^^^^^^^^ See flatten04.test */ - -/* -** Macros for testing whether or not optimizations are enabled or disabled. - */ - -/* -** Return true if it OK to factor constant expressions into the initialization -** code. The argument is a Parse object for the code generator. - */ - -/* Possible values for the sqlite3.eOpenState field. -** The numbers are randomly selected such that a minimum of three bits must -** change to convert any number to another or to zero - */ - -/* -** Each SQL function is defined by an instance of the following -** structure. For global built-in functions (ex: substr(), max(), count()) -** a pointer to this structure is held in the sqlite3BuiltinFunctions object. -** For per-connection application-defined functions, a pointer to this -** structure is held in the db->aHash hash table. -** -** The u.pHash field is used by the global built-ins. The u.pDestructor -** field is used by per-connection app-def functions. - */ -type TFuncDef1 = struct { - FnArg Ti16 - FfuncFlags Tu32 - FpUserData uintptr - FpNext uintptr - FxSFunc uintptr - FxFinalize uintptr - FxValue uintptr - FxInverse uintptr - FzName uintptr - Fu struct { - FpDestructor [0]uintptr - FpHash uintptr - } -} - -type FuncDef1 = TFuncDef1 - -/* -** This structure encapsulates a user-function destructor callback (as -** configured using create_function_v2()) and a reference counter. When -** create_function_v2() is called to create a function with a destructor, -** a single object of this type is allocated. FuncDestructor.nRef is set to -** the number of FuncDef objects created (either 1 or 3, depending on whether -** or not the specified encoding is SQLITE_ANY). The FuncDef.pDestructor -** member of each of the new FuncDef objects is set to point to the allocated -** FuncDestructor. -** -** Thereafter, when one of the FuncDef objects is deleted, the reference -** count on this object is decremented. When it reaches 0, the destructor -** is invoked and the FuncDestructor structure freed. - */ -type TFuncDestructor1 = struct { - FnRef int32 - FxDestroy uintptr - FpUserData uintptr -} - -type FuncDestructor1 = TFuncDestructor1 - -/* -** Possible values for FuncDef.flags. Note that the _LENGTH and _TYPEOF -** values must correspond to OPFLAG_LENGTHARG and OPFLAG_TYPEOFARG. And -** SQLITE_FUNC_CONSTANT must be the same as SQLITE_DETERMINISTIC. There -** are assert() statements in the code to verify this. -** -** Value constraints (enforced via assert()): -** SQLITE_FUNC_MINMAX == NC_MinMaxAgg == SF_MinMaxAgg -** SQLITE_FUNC_ANYORDER == NC_OrderAgg == SF_OrderByReqd -** SQLITE_FUNC_LENGTH == OPFLAG_LENGTHARG -** SQLITE_FUNC_TYPEOF == OPFLAG_TYPEOFARG -** SQLITE_FUNC_BYTELEN == OPFLAG_BYTELENARG -** SQLITE_FUNC_CONSTANT == SQLITE_DETERMINISTIC from the API -** SQLITE_FUNC_DIRECT == SQLITE_DIRECTONLY from the API -** SQLITE_FUNC_UNSAFE == SQLITE_INNOCUOUS -- opposite meanings!!! -** SQLITE_FUNC_ENCMASK depends on SQLITE_UTF* macros in the API -** -** Note that even though SQLITE_FUNC_UNSAFE and SQLITE_INNOCUOUS have the -** same bit value, their meanings are inverted. SQLITE_FUNC_UNSAFE is -** used internally and if set means that the function has side effects. -** SQLITE_INNOCUOUS is used by application code and means "not unsafe". -** See multiple instances of tag-20230109-1. - */ -/* 0x0200 -- available for reuse */ -/* SQLITE_SUBTYPE 0x00100000 // Consumer of subtypes */ -/* SQLITE_RESULT_SUBTYPE 0x01000000 // Generator of subtypes */ - -/* Identifier numbers for each in-line function */ - -/* -** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are -** used to create the initializers for the FuncDef structures. -** -** FUNCTION(zName, nArg, iArg, bNC, xFunc) -** Used to create a scalar function definition of a function zName -** implemented by C function xFunc that accepts nArg arguments. The -** value passed as iArg is cast to a (void*) and made available -** as the user-data (sqlite3_user_data()) for the function. If -** argument bNC is true, then the SQLITE_FUNC_NEEDCOLL flag is set. -** -** VFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag. -** -** SFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_DIRECTONLY flag. -** -** INLINE_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a function that is implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** TEST_FUNC(zName, nArg, iFuncId, mFlags) -** zName is the name of a test-only function implemented by in-line -** byte code rather than by the usual callbacks. The iFuncId -** parameter determines the function id. The mFlags parameter is -** optional SQLITE_FUNC_ flags for this function. -** -** DFUNCTION(zName, nArg, iArg, bNC, xFunc) -** Like FUNCTION except it omits the SQLITE_FUNC_CONSTANT flag and -** adds the SQLITE_FUNC_SLOCHNG flag. Used for date & time functions -** and functions like sqlite_version() that can change, but not during -** a single query. The iArg is ignored. The user-data is always set -** to a NULL pointer. The bNC parameter is not used. -** -** MFUNCTION(zName, nArg, xPtr, xFunc) -** For math-library functions. xPtr is an arbitrary pointer. -** -** PURE_DATE(zName, nArg, iArg, bNC, xFunc) -** Used for "pure" date/time functions, this macro is like DFUNCTION -** except that it does set the SQLITE_FUNC_CONSTANT flags. iArg is -** ignored and the user-data for these functions is set to an -** arbitrary non-NULL pointer. The bNC parameter is not used. -** -** AGGREGATE(zName, nArg, iArg, bNC, xStep, xFinal) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** WAGGREGATE(zName, nArg, iArg, xStep, xFinal, xValue, xInverse) -** Used to create an aggregate function definition implemented by -** the C functions xStep and xFinal. The first four parameters -** are interpreted in the same way as the first 4 parameters to -** FUNCTION(). -** -** LIKEFUNC(zName, nArg, pArg, flags) -** Used to create a scalar function definition of a function zName -** that accepts nArg arguments and is implemented by a call to C -** function likeFunc. Argument pArg is cast to a (void *) and made -** available as the function user-data (sqlite3_user_data()). The -** FuncDef.flags variable is set to the value passed as the flags -** parameter. - */ - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. - */ -type TSavepoint1 = struct { - F__ccgo_align [0]uint32 - FzName uintptr - F__ccgo_align1 [4]byte - FnDeferredCons Ti64 - FnDeferredImmCons Ti64 - FpNext uintptr - F__ccgo_pad4 [4]byte -} - -type Savepoint1 = TSavepoint1 - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. - */ - -/* -** Each SQLite module (virtual table definition) is defined by an -** instance of the following structure, stored in the sqlite3.aModule -** hash table. - */ -type TModule1 = struct { - FpModule uintptr - FzName uintptr - FnRefModule int32 - FpAux uintptr - FxDestroy uintptr - FpEpoTab uintptr -} - -type Module1 = TModule1 - -/* -** Information about each column of an SQL table is held in an instance -** of the Column structure, in the Table.aCol[] array. -** -** Definitions: -** -** "table column index" This is the index of the column in the -** Table.aCol[] array, and also the index of -** the column in the original CREATE TABLE stmt. -** -** "storage column index" This is the index of the column in the -** record BLOB generated by the OP_MakeRecord -** opcode. The storage column index is less than -** or equal to the table column index. It is -** equal if and only if there are no VIRTUAL -** columns to the left. -** -** Notes on zCnName: -** The zCnName field stores the name of the column, the datatype of the -** column, and the collating sequence for the column, in that order, all in -** a single allocation. Each string is 0x00 terminated. The datatype -** is only included if the COLFLAG_HASTYPE bit of colFlags is set and the -** collating sequence name is only included if the COLFLAG_HASCOLL bit is -** set. - */ -type TColumn1 = struct { - FzCnName uintptr - F__ccgo4 uint8 - Faffinity int8 - FszEst Tu8 - FhName Tu8 - FiDflt Tu16 - FcolFlags Tu16 -} - -type Column1 = TColumn1 - -/* Allowed values for Column.eCType. -** -** Values must match entries in the global constant arrays -** sqlite3StdTypeLen[] and sqlite3StdType[]. Each value is one more -** than the offset into these arrays for the corresponding name. -** Adjust the SQLITE_N_STDTYPE value if adding or removing entries. - */ - -/* Allowed values for Column.colFlags. -** -** Constraints: -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** A "Collating Sequence" is defined by an instance of the following -** structure. Conceptually, a collating sequence consists of a name and -** a comparison routine that defines the order of that sequence. -** -** If CollSeq.xCmp is NULL, it means that the -** collating sequence is undefined. Indices built on an undefined -** collating sequence may not be read or written. - */ -type TCollSeq1 = struct { - FzName uintptr - Fenc Tu8 - FpUser uintptr - FxCmp uintptr - FxDel uintptr -} - -type CollSeq1 = TCollSeq1 - -/* -** A sort order can be either ASC or DESC. - */ - -/* -** Column affinity types. -** -** These used to have mnemonic name like 'i' for SQLITE_AFF_INTEGER and -** 't' for SQLITE_AFF_TEXT. But we can save a little space and improve -** the speed a little by numbering the values consecutively. -** -** But rather than start with 0 or 1, we begin with 'A'. That way, -** when multiple affinity types are concatenated into a string and -** used as the P4 operand, they will be more readable. -** -** Note also that the numeric types are grouped together so that testing -** for a numeric type is a single comparison. And the BLOB type is first. - */ - -/* -** The SQLITE_AFF_MASK values masks off the significant bits of an -** affinity value. - */ - -/* -** Additional bit values that can be ORed with an affinity without -** changing the affinity. -** -** The SQLITE_NOTNULL flag is a combination of NULLEQ and JUMPIFNULL. -** It causes an assert() to fire if either operand to a comparison -** operator is NULL. It is added to certain comparison operators to -** prove that the operands are always NOT NULL. - */ - -/* -** An object of this type is created for each virtual table present in -** the database schema. -** -** If the database schema is shared, then there is one instance of this -** structure for each database connection (sqlite3*) that uses the shared -** schema. This is because each database connection requires its own unique -** instance of the sqlite3_vtab* handle used to access the virtual table -** implementation. sqlite3_vtab* handles can not be shared between -** database connections, even when the rest of the in-memory database -** schema is shared, as the implementation often stores the database -** connection handle passed to it via the xConnect() or xCreate() method -** during initialization internally. This database connection handle may -** then be used by the virtual table implementation to access real tables -** within the database. So that they appear as part of the callers -** transaction, these accesses need to be made via the same database -** connection as that used to execute SQL operations on the virtual table. -** -** All VTable objects that correspond to a single table in a shared -** database schema are initially stored in a linked-list pointed to by -** the Table.pVTable member variable of the corresponding Table object. -** When an sqlite3_prepare() operation is required to access the virtual -** table, it searches the list for the VTable that corresponds to the -** database connection doing the preparing so as to use the correct -** sqlite3_vtab* handle in the compiled query. -** -** When an in-memory Table object is deleted (for example when the -** schema is being reloaded for some reason), the VTable objects are not -** deleted and the sqlite3_vtab* handles are not xDisconnect()ed -** immediately. Instead, they are moved from the Table.pVTable list to -** another linked list headed by the sqlite3.pDisconnect member of the -** corresponding sqlite3 structure. They are then deleted/xDisconnected -** next time a statement is prepared using said sqlite3*. This is done -** to avoid deadlock issues involving multiple sqlite3.mutex mutexes. -** Refer to comments above function sqlite3VtabUnlockList() for an -** explanation as to why it is safe to add an entry to an sqlite3.pDisconnect -** list without holding the corresponding sqlite3.mutex mutex. -** -** The memory for objects of this type is always allocated by -** sqlite3DbMalloc(), using the connection handle stored in VTable.db as -** the first argument. - */ -type TVTable1 = struct { - Fdb uintptr - FpMod uintptr - FpVtab uintptr - FnRef int32 - FbConstraint Tu8 - FbAllSchemas Tu8 - FeVtabRisk Tu8 - FiSavepoint int32 - FpNext uintptr -} - -type VTable1 = TVTable1 - -/* Allowed values for VTable.eVtabRisk - */ - -/* -** The schema for each SQL table, virtual table, and view is represented -** in memory by an instance of the following structure. - */ -type TTable1 = struct { - FzName uintptr - FaCol uintptr - FpIndex uintptr - FzColAff uintptr - FpCheck uintptr - Ftnum TPgno - FnTabRef Tu32 - FtabFlags Tu32 - FiPKey Ti16 - FnCol Ti16 - FnNVCol Ti16 - FnRowLogEst TLogEst - FszTabRow TLogEst - FkeyConf Tu8 - FeTabType Tu8 - Fu struct { - Fview [0]struct { - FpSelect uintptr - } - Fvtab [0]struct { - FnArg int32 - FazArg uintptr - Fp uintptr - } - Ftab struct { - FaddColOffset int32 - FpFKey uintptr - FpDfltList uintptr - } - } - FpTrigger uintptr - FpSchema uintptr -} - -type Table1 = TTable1 - -/* -** Allowed values for Table.tabFlags. -** -** TF_OOOHidden applies to tables or view that have hidden columns that are -** followed by non-hidden columns. Example: "CREATE VIRTUAL TABLE x USING -** vtab1(a HIDDEN, b);". Since "b" is a non-hidden column but "a" is hidden, -** the TF_OOOHidden attribute would apply in this case. Such tables require -** special handling during INSERT processing. The "OOO" means "Out Of Order". -** -** Constraints: -** -** TF_HasVirtual == COLFLAG_VIRTUAL -** TF_HasStored == COLFLAG_STORED -** TF_HasHidden == COLFLAG_HIDDEN - */ - -/* -** Allowed values for Table.eTabType - */ - -/* -** Test to see whether or not a table is a virtual table. This is -** done as a macro so that it will be optimized out when virtual -** table support is omitted from the build. - */ - -/* -** Macros to determine if a column is hidden. IsOrdinaryHiddenColumn() -** only works for non-virtual tables (ordinary tables and views) and is -** always false unless SQLITE_ENABLE_HIDDEN_COLUMNS is defined. The -** IsHiddenColumn() macro is general purpose. - */ - -/* Does the table have a rowid */ - -/* Macro is true if the SQLITE_ALLOW_ROWID_IN_VIEW (mis-)feature is -** available. By default, this macro is false - */ - -/* -** Each foreign key constraint is an instance of the following structure. -** -** A foreign key is associated with two tables. The "from" table is -** the table that contains the REFERENCES clause that creates the foreign -** key. The "to" table is the table that is named in the REFERENCES clause. -** Consider this example: -** -** CREATE TABLE ex1( -** a INTEGER PRIMARY KEY, -** b INTEGER CONSTRAINT fk1 REFERENCES ex2(x) -** ); -** -** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". -** Equivalent names: -** -** from-table == child-table -** to-table == parent-table -** -** Each REFERENCES clause generates an instance of the following structure -** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked. -** -** The list of all parents for child Table X is held at X.pFKey. -** -** A list of all children for a table named Z (which might not even exist) -** is held in Schema.fkeyHash with a hash key of Z. - */ -type TFKey1 = struct { - FpFrom uintptr - FpNextFrom uintptr - FzTo uintptr - FpNextTo uintptr - FpPrevTo uintptr - FnCol int32 - FisDeferred Tu8 - FaAction [2]Tu8 - FapTrigger [2]uintptr - FaCol [1]TsColMap -} - -type FKey1 = TFKey1 - -/* -** SQLite supports many different ways to resolve a constraint -** error. ROLLBACK processing means that a constraint violation -** causes the operation in process to fail and for the current transaction -** to be rolled back. ABORT processing means the operation in process -** fails and any prior changes from that one operation are backed out, -** but the transaction is not rolled back. FAIL processing means that -** the operation in progress stops and returns an error code. But prior -** changes due to the same operation are not backed out and no rollback -** occurs. IGNORE means that the particular row that caused the constraint -** error is not inserted or updated. Processing continues and no error -** is returned. REPLACE means that preexisting database rows that caused -** a UNIQUE constraint violation are removed so that the new insert or -** update can proceed. Processing continues and no error is reported. -** UPDATE applies to insert operations only and means that the insert -** is omitted and the DO UPDATE clause of an upsert is run instead. -** -** RESTRICT, SETNULL, SETDFLT, and CASCADE actions apply only to foreign keys. -** RESTRICT is the same as ABORT for IMMEDIATE foreign keys and the -** same as ROLLBACK for DEFERRED keys. SETNULL means that the foreign -** key is set to NULL. SETDFLT means that the foreign key is set -** to its default value. CASCADE means that a DELETE or UPDATE of the -** referenced table row is propagated into the row that holds the -** foreign key. -** -** The OE_Default value is a place holder that means to use whatever -** conflict resolution algorithm is required from context. -** -** The following symbolic values are used to record which type -** of conflict resolution action to take. - */ - -/* -** An instance of the following structure is passed as the first -** argument to sqlite3VdbeKeyCompare and is used to control the -** comparison of the two index keys. -** -** Note that aSortOrder[] and aColl[] have nField+1 slots. There -** are nField slots for the columns of an index then one extra slot -** for the rowid at the end. - */ -type TKeyInfo1 = struct { - FnRef Tu32 - Fenc Tu8 - FnKeyField Tu16 - FnAllField Tu16 - Fdb uintptr - FaSortFlags uintptr - FaColl [1]uintptr -} - -type KeyInfo1 = TKeyInfo1 - -/* -** Allowed bit values for entries in the KeyInfo.aSortFlags[] array. - */ - -/* -** This object holds a record which has been parsed out into individual -** fields, for the purposes of doing a comparison. -** -** A record is an object that contains one or more fields of data. -** Records are used to store the content of a table row and to store -** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the -** OP_Column opcode. -** -** An instance of this object serves as a "key" for doing a search on -** an index b+tree. The goal of the search is to find the entry that -** is closed to the key described by this object. This object might hold -** just a prefix of the key. The number of fields is given by -** pKeyInfo->nField. -** -** The r1 and r2 fields are the values to return if this key is less than -** or greater than a key in the btree, respectively. These are normally -** -1 and +1 respectively, but might be inverted to +1 and -1 if the b-tree -** is in DESC order. -** -** The key comparison functions actually return default_rc when they find -** an equals comparison. default_rc can be -1, 0, or +1. If there are -** multiple entries in the b-tree with the same key (when only looking -** at the first pKeyInfo->nFields,) then default_rc can be set to -1 to -** cause the search to find the last match, or +1 to cause the search to -** find the first match. -** -** The key comparison functions will set eqSeen to true if they ever -** get and equal results when comparing this structure to a b-tree record. -** When default_rc!=0, the search might end up on the record immediately -** before the first match or immediately after the last match. The -** eqSeen field will indicate whether or not an exact match exists in the -** b-tree. - */ -type TUnpackedRecord1 = struct { - F__ccgo_align [0]uint32 - FpKeyInfo uintptr - FaMem uintptr - Fu struct { - F__ccgo_align [0]uint32 - Fi [0]Ti64 - Fz uintptr - F__ccgo_pad2 [4]byte - } - Fn int32 - FnField Tu16 - Fdefault_rc Ti8 - FerrCode Tu8 - Fr1 Ti8 - Fr2 Ti8 - FeqSeen Tu8 - F__ccgo_pad10 [5]byte -} - -type UnpackedRecord1 = TUnpackedRecord1 - -/* -** Each SQL index is represented in memory by an -** instance of the following structure. -** -** The columns of the table that are to be indexed are described -** by the aiColumn[] field of this structure. For example, suppose -** we have the following table and index: -** -** CREATE TABLE Ex1(c1 int, c2 int, c3 text); -** CREATE INDEX Ex2 ON Ex1(c3,c1); -** -** In the Table structure describing Ex1, nCol==3 because there are -** three columns in the table. In the Index structure describing -** Ex2, nColumn==2 since 2 of the 3 columns of Ex1 are indexed. -** The value of aiColumn is {2, 0}. aiColumn[0]==2 because the -** first column to be indexed (c3) has an index of 2 in Ex1.aCol[]. -** The second column to be indexed (c1) has an index of 0 in -** Ex1.aCol[], hence Ex2.aiColumn[1]==0. -** -** The Index.onError field determines whether or not the indexed columns -** must be unique and what to do if they are not. When Index.onError=OE_None, -** it means this is not a unique index. Otherwise it is a unique index -** and the value of Index.onError indicates which conflict resolution -** algorithm to employ when an attempt is made to insert a non-unique -** element. -** -** The colNotIdxed bitmask is used in combination with SrcItem.colUsed -** for a fast test to see if an index can serve as a covering index. -** colNotIdxed has a 1 bit for every column of the original table that -** is *not* available in the index. Thus the expression -** "colUsed & colNotIdxed" will be non-zero if the index is not a -** covering index. The most significant bit of of colNotIdxed will always -** be true (note-20221022-a). If a column beyond the 63rd column of the -** table is used, the "colUsed & colNotIdxed" test will always be non-zero -** and we have to assume either that the index is not covering, or use -** an alternative (slower) algorithm to determine whether or not -** the index is covering. -** -** While parsing a CREATE TABLE or CREATE INDEX statement in order to -** generate VDBE code (as opposed to parsing one read from an sqlite_schema -** table as part of parsing an existing database schema), transient instances -** of this structure may be created. In this case the Index.tnum variable is -** used to store the address of a VDBE instruction, not a database page -** number (it cannot - the database page is not allocated until the VDBE -** program is executed). See convertToWithoutRowidTable() for details. - */ -type TIndex1 = struct { - F__ccgo_align [0]uint32 - FzName uintptr - FaiColumn uintptr - FaiRowLogEst uintptr - FpTable uintptr - FzColAff uintptr - FpNext uintptr - FpSchema uintptr - FaSortOrder uintptr - FazColl uintptr - FpPartIdxWhere uintptr - FaColExpr uintptr - Ftnum TPgno - FszIdxRow TLogEst - FnKeyCol Tu16 - FnColumn Tu16 - FonError Tu8 - F__ccgo56 uint16 - FnSample int32 - FmxSample int32 - FnSampleCol int32 - FaAvgEq uintptr - FaSample uintptr - FaiRowEst uintptr - F__ccgo_align34 [4]byte - FnRowEst0 TtRowcnt - FcolNotIdxed TBitmask -} - -type Index1 = TIndex1 - -/* -** Allowed values for Index.idxType - */ - -/* Return true if index X is a PRIMARY KEY index */ - -/* Return true if index X is a UNIQUE index */ - -/* The Index.aiColumn[] values are normally positive integer. But -** there are some negative values that have special meaning: - */ - -/* -** Each sample stored in the sqlite_stat4 table is represented in memory -** using a structure of this type. See documentation at the top of the -** analyze.c source file for additional information. - */ -type TIndexSample1 = struct { - Fp uintptr - Fn int32 - FanEq uintptr - FanLt uintptr - FanDLt uintptr -} - -type IndexSample1 = TIndexSample1 - -/* -** Possible values to use within the flags argument to sqlite3GetToken(). - */ - -/* -** Each token coming out of the lexer is an instance of -** this structure. Tokens are also used as part of an expression. -** -** The memory that "z" points to is owned by other objects. Take care -** that the owner of the "z" string does not deallocate the string before -** the Token goes out of scope! Very often, the "z" points to some place -** in the middle of the Parse.zSql text. But it might also point to a -** static string. - */ -type TToken1 = struct { - Fz uintptr - Fn uint32 -} - -type Token1 = TToken1 - -/* -** An instance of this structure contains information needed to generate -** code for a SELECT that contains aggregate functions. -** -** If Expr.op==TK_AGG_COLUMN or TK_AGG_FUNCTION then Expr.pAggInfo is a -** pointer to this structure. The Expr.iAgg field is the index in -** AggInfo.aCol[] or AggInfo.aFunc[] of information needed to generate -** code for that node. -** -** AggInfo.pGroupBy and AggInfo.aFunc.pExpr point to fields within the -** original Select structure that describes the SELECT statement. These -** fields do not need to be freed when deallocating the AggInfo structure. - */ -type TAggInfo1 = struct { - FdirectMode Tu8 - FuseSortingIdx Tu8 - FnSortingColumn Tu16 - FsortingIdx int32 - FsortingIdxPTab int32 - FiFirstReg int32 - FpGroupBy uintptr - FaCol uintptr - FnColumn int32 - FnAccumulator int32 - FaFunc uintptr - FnFunc int32 - FselId Tu32 -} - -type AggInfo1 = TAggInfo1 - /* ** Macros to compute aCol[] and aFunc[] register numbers. ** @@ -29502,614 +27050,6 @@ type TynVar = int16 type ynVar = TynVar -/* -** Each node of an expression in the parse tree is an instance -** of this structure. -** -** Expr.op is the opcode. The integer parser token codes are reused -** as opcodes here. For example, the parser defines TK_GE to be an integer -** code representing the ">=" operator. This same integer code is reused -** to represent the greater-than-or-equal-to operator in the expression -** tree. -** -** If the expression is an SQL literal (TK_INTEGER, TK_FLOAT, TK_BLOB, -** or TK_STRING), then Expr.u.zToken contains the text of the SQL literal. If -** the expression is a variable (TK_VARIABLE), then Expr.u.zToken contains the -** variable name. Finally, if the expression is an SQL function (TK_FUNCTION), -** then Expr.u.zToken contains the name of the function. -** -** Expr.pRight and Expr.pLeft are the left and right subexpressions of a -** binary operator. Either or both may be NULL. -** -** Expr.x.pList is a list of arguments if the expression is an SQL function, -** a CASE expression or an IN expression of the form " IN (, ...)". -** Expr.x.pSelect is used if the expression is a sub-select or an expression of -** the form " IN (SELECT ...)". If the EP_xIsSelect bit is set in the -** Expr.flags mask, then Expr.x.pSelect is valid. Otherwise, Expr.x.pList is -** valid. -** -** An expression of the form ID or ID.ID refers to a column in a table. -** For such expressions, Expr.op is set to TK_COLUMN and Expr.iTable is -** the integer cursor number of a VDBE cursor pointing to that table and -** Expr.iColumn is the column number for the specific column. If the -** expression is used as a result in an aggregate SELECT, then the -** value is also stored in the Expr.iAgg column in the aggregate so that -** it can be accessed after all aggregates are computed. -** -** If the expression is an unbound variable marker (a question mark -** character '?' in the original SQL) then the Expr.iTable holds the index -** number for that variable. -** -** If the expression is a subquery then Expr.iColumn holds an integer -** register number containing the result of the subquery. If the -** subquery gives a constant result, then iTable is -1. If the subquery -** gives a different answer at different times during statement processing -** then iTable is the address of a subroutine that computes the subquery. -** -** If the Expr is of type OP_Column, and the table it is selecting from -** is a disk table or the "old.*" pseudo-table, then pTab points to the -** corresponding table definition. -** -** ALLOCATION NOTES: -** -** Expr objects can use a lot of memory space in database schema. To -** help reduce memory requirements, sometimes an Expr object will be -** truncated. And to reduce the number of memory allocations, sometimes -** two or more Expr objects will be stored in a single memory allocation, -** together with Expr.u.zToken strings. -** -** If the EP_Reduced and EP_TokenOnly flags are set when -** an Expr object is truncated. When EP_Reduced is set, then all -** the child Expr objects in the Expr.pLeft and Expr.pRight subtrees -** are contained within the same memory allocation. Note, however, that -** the subtrees in Expr.x.pList or Expr.x.pSelect are always separately -** allocated, regardless of whether or not EP_Reduced is set. - */ -type TExpr1 = struct { - Fop Tu8 - FaffExpr int8 - Fop2 Tu8 - Fflags Tu32 - Fu struct { - FiValue [0]int32 - FzToken uintptr - } - FpLeft uintptr - FpRight uintptr - Fx struct { - FpSelect [0]uintptr - FpList uintptr - } - FnHeight int32 - FiTable int32 - FiColumn TynVar - FiAgg Ti16 - Fw struct { - FiOfst [0]int32 - FiJoin int32 - } - FpAggInfo uintptr - Fy struct { - FpWin [0]uintptr - Fsub [0]struct { - FiAddr int32 - FregReturn int32 - } - FpTab uintptr - F__ccgo_pad3 [4]byte - } -} - -type Expr1 = TExpr1 - -/* The following are the meanings of bits in the Expr.flags field. -** Value restrictions: -** -** EP_Agg == NC_HasAgg == SF_HasAgg -** EP_Win == NC_HasWin - */ - -/* The EP_Propagate mask is a set of properties that automatically propagate -** upwards into parent nodes. - */ - -/* Macros can be used to test, set, or clear bits in the -** Expr.flags field. - */ - -/* Macros used to ensure that the correct members of unions are accessed -** in Expr. - */ - -/* Flags for use with Expr.vvaFlags - */ - -/* The ExprSetVVAProperty() macro is used for Verification, Validation, -** and Accreditation only. It works like ExprSetProperty() during VVA -** processes but is a no-op for delivery. - */ - -/* -** Macros to determine the number of bytes required by a normal Expr -** struct, an Expr struct with the EP_Reduced flag set in Expr.flags -** and an Expr struct with the EP_TokenOnly flag set. - */ - -/* -** Flags passed to the sqlite3ExprDup() function. See the header comment -** above sqlite3ExprDup() for details. - */ - -/* -** True if the expression passed as an argument was a function with -** an OVER() clause (a window function). - */ - -/* -** A list of expressions. Each expression may optionally have a -** name. An expr/name combination can be used in several ways, such -** as the list of "expr AS ID" fields following a "SELECT" or in the -** list of "ID = expr" items in an UPDATE. A list of expressions can -** also be used as the argument to a function, in which case the a.zName -** field is not used. -** -** In order to try to keep memory usage down, the Expr.a.zEName field -** is used for multiple purposes: -** -** eEName Usage -** ---------- ------------------------- -** ENAME_NAME (1) the AS of result set column -** (2) COLUMN= of an UPDATE -** -** ENAME_TAB DB.TABLE.NAME used to resolve names -** of subqueries -** -** ENAME_SPAN Text of the original result set -** expression. - */ -type TExprList1 = struct { - FnExpr int32 - FnAlloc int32 - Fa [1]TExprList_item -} - -type ExprList1 = TExprList1 - -/* -** Allowed values for Expr.a.eEName - */ - -/* -** An instance of this structure can hold a simple list of identifiers, -** such as the list "a,b,c" in the following statements: -** -** INSERT INTO t(a,b,c) VALUES ...; -** CREATE INDEX idx ON t(a,b,c); -** CREATE TRIGGER trig BEFORE UPDATE ON t(a,b,c) ...; -** -** The IdList.a.idx field is used when the IdList represents the list of -** column names after a table name in an INSERT statement. In the statement -** -** INSERT INTO t(a,b,c) ... -** -** If "a" is the k-th column of table "t", then IdList.a[0].idx==k. - */ -type TIdList1 = struct { - FnId int32 - Fa [1]TIdList_item -} - -type IdList1 = TIdList1 - -/* -** Allowed values for IdList.eType, which determines which value of the a.u4 -** is valid. - */ - -/* -** Details of the implementation of a subquery. - */ -type TSubquery1 = struct { - FpSelect uintptr - FaddrFillSub int32 - FregReturn int32 - FregResult int32 -} - -type Subquery1 = TSubquery1 - -/* -** The SrcItem object represents a single term in the FROM clause of a query. -** The SrcList object is mostly an array of SrcItems. -** -** The jointype starts out showing the join type between the current table -** and the next table on the list. The parser builds the list this way. -** But sqlite3SrcListShiftJoinType() later shifts the jointypes so that each -** jointype expresses the join between the table and the previous table. -** -** In the colUsed field, the high-order bit (bit 63) is set if the table -** contains more than 63 columns and the 64-th or later column is used. -** -** Aggressive use of "union" helps keep the size of the object small. This -** has been shown to boost performance, in addition to saving memory. -** Access to union elements is gated by the following rules which should -** always be checked, either by an if-statement or by an assert(). -** -** Field Only access if this is true -** --------------- ----------------------------------- -** u1.zIndexedBy fg.isIndexedBy -** u1.pFuncArg fg.isTabFunc -** u1.nRow !fg.isTabFunc && !fg.isIndexedBy -** -** u2.pIBIndex fg.isIndexedBy -** u2.pCteUse fg.isCte -** -** u3.pOn !fg.isUsing -** u3.pUsing fg.isUsing -** -** u4.zDatabase !fg.fixedSchema && !fg.isSubquery -** u4.pSchema fg.fixedSchema -** u4.pSubq fg.isSubquery -** -** See also the sqlite3SrcListDelete() routine for assert() statements that -** check invariants on the fields of this object, especially the flags -** inside the fg struct. - */ -type TSrcItem1 = struct { - F__ccgo_align [0]uint32 - FzName uintptr - FzAlias uintptr - FpSTab uintptr - Ffg struct { - Fjointype Tu8 - F__ccgo4 uint32 - } - FiCursor int32 - FcolUsed TBitmask - Fu1 struct { - FpFuncArg [0]uintptr - FnRow [0]Tu32 - FzIndexedBy uintptr - } - Fu2 struct { - FpCteUse [0]uintptr - FpIBIndex uintptr - } - Fu3 struct { - FpUsing [0]uintptr - FpOn uintptr - } - Fu4 struct { - FzDatabase [0]uintptr - FpSubq [0]uintptr - FpSchema uintptr - } -} - -type SrcItem1 = TSrcItem1 - -/* -** The OnOrUsing object represents either an ON clause or a USING clause. -** It can never be both at the same time, but it can be neither. - */ -type TOnOrUsing1 = struct { - FpOn uintptr - FpUsing uintptr -} - -type OnOrUsing1 = TOnOrUsing1 - -/* -** This object represents one or more tables that are the source of -** content for an SQL statement. For example, a single SrcList object -** is used to hold the FROM clause of a SELECT statement. SrcList also -** represents the target tables for DELETE, INSERT, and UPDATE statements. -** - */ -type TSrcList1 = struct { - F__ccgo_align [0]uint32 - FnSrc int32 - FnAlloc Tu32 - Fa [1]TSrcItem -} - -type SrcList1 = TSrcList1 - -/* -** Permitted values of the SrcList.a.jointype field - */ - -/* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin() -** and the WhereInfo.wctrlFlags member. -** -** Value constraints (enforced via assert()): -** WHERE_USE_LIMIT == SF_FixedLimit - */ -/* 0x8000 not currently used */ - -/* Allowed return values from sqlite3WhereIsDistinct() - */ - -/* -** A NameContext defines a context in which to resolve table and column -** names. The context consists of a list of tables (the pSrcList) field and -** a list of named expression (pEList). The named expression list may -** be NULL. The pSrc corresponds to the FROM clause of a SELECT or -** to the table being operated on by INSERT, UPDATE, or DELETE. The -** pEList corresponds to the result set of a SELECT and is NULL for -** other statements. -** -** NameContexts can be nested. When resolving names, the inner-most -** context is searched first. If no match is found, the next outer -** context is checked. If there is still no match, the next context -** is checked. This process continues until either a match is found -** or all contexts are check. When a match is found, the nRef member of -** the context containing the match is incremented. -** -** Each subquery gets a new NameContext. The pNext field points to the -** NameContext in the parent query. Thus the process of scanning the -** NameContext list corresponds to searching through successively outer -** subqueries looking for a match. - */ -type TNameContext1 = struct { - FpParse uintptr - FpSrcList uintptr - FuNC struct { - FpAggInfo [0]uintptr - FpUpsert [0]uintptr - FiBaseReg [0]int32 - FpEList uintptr - } - FpNext uintptr - FnRef int32 - FnNcErr int32 - FncFlags int32 - FnNestedSelect Tu32 - FpWinSelect uintptr -} - -type NameContext1 = TNameContext1 - -/* -** Allowed values for the NameContext, ncFlags field. -** -** Value constraints (all checked via assert()): -** NC_HasAgg == SF_HasAgg == EP_Agg -** NC_MinMaxAgg == SF_MinMaxAgg == SQLITE_FUNC_MINMAX -** NC_OrderAgg == SF_OrderByReqd == SQLITE_FUNC_ANYORDER -** NC_HasWin == EP_Win -** - */ -/* 0x002000 // available for reuse */ - -/* -** An instance of the following object describes a single ON CONFLICT -** clause in an upsert. -** -** The pUpsertTarget field is only set if the ON CONFLICT clause includes -** conflict-target clause. (In "ON CONFLICT(a,b)" the "(a,b)" is the -** conflict-target clause.) The pUpsertTargetWhere is the optional -** WHERE clause used to identify partial unique indexes. -** -** pUpsertSet is the list of column=expr terms of the UPDATE statement. -** The pUpsertSet field is NULL for a ON CONFLICT DO NOTHING. The -** pUpsertWhere is the WHERE clause for the UPDATE and is NULL if the -** WHERE clause is omitted. - */ -type TUpsert1 = struct { - FpUpsertTarget uintptr - FpUpsertTargetWhere uintptr - FpUpsertSet uintptr - FpUpsertWhere uintptr - FpNextUpsert uintptr - FisDoUpdate Tu8 - FisDup Tu8 - FpToFree uintptr - FpUpsertIdx uintptr - FpUpsertSrc uintptr - FregData int32 - FiDataCur int32 - FiIdxCur int32 -} - -type Upsert1 = TUpsert1 - -/* -** An instance of the following structure contains all information -** needed to generate code for a single SELECT statement. -** -** See the header comment on the computeLimitRegisters() routine for a -** detailed description of the meaning of the iLimit and iOffset fields. -** -** addrOpenEphm[] entries contain the address of OP_OpenEphemeral opcodes. -** These addresses must be stored so that we can go back and fill in -** the P4_KEYINFO and P2 parameters later. Neither the KeyInfo nor -** the number of columns in P2 can be computed at the same time -** as the OP_OpenEphm instruction is coded because not -** enough information about the compound query is known at that point. -** The KeyInfo for addrOpenTran[0] and [1] contains collating sequences -** for the result set. The KeyInfo for addrOpenEphm[2] contains collating -** sequences for the ORDER BY clause. - */ -type TSelect1 = struct { - Fop Tu8 - FnSelectRow TLogEst - FselFlags Tu32 - FiLimit int32 - FiOffset int32 - FselId Tu32 - FaddrOpenEphm [2]int32 - FpEList uintptr - FpSrc uintptr - FpWhere uintptr - FpGroupBy uintptr - FpHaving uintptr - FpOrderBy uintptr - FpPrior uintptr - FpNext uintptr - FpLimit uintptr - FpWith uintptr - FpWin uintptr - FpWinDefn uintptr -} - -type Select1 = TSelect1 - -/* -** Allowed values for Select.selFlags. The "SF" prefix stands for -** "Select Flag". -** -** Value constraints (all checked via assert()) -** SF_HasAgg == NC_HasAgg -** SF_MinMaxAgg == NC_MinMaxAgg == SQLITE_FUNC_MINMAX -** SF_OrderByReqd == NC_OrderAgg == SQLITE_FUNC_ANYORDER -** SF_FixedLimit == WHERE_USE_LIMIT - */ - -/* True if SrcItem X is a subquery that has SF_NestedFrom */ - -/* -** The results of a SELECT can be distributed in several ways, as defined -** by one of the following macros. The "SRT" prefix means "SELECT Result -** Type". -** -** SRT_Union Store results as a key in a temporary index -** identified by pDest->iSDParm. -** -** SRT_Except Remove results from the temporary index pDest->iSDParm. -** -** SRT_Exists Store a 1 in memory cell pDest->iSDParm if the result -** set is not empty. -** -** SRT_Discard Throw the results away. This is used by SELECT -** statements within triggers whose only purpose is -** the side-effects of functions. -** -** SRT_Output Generate a row of output (using the OP_ResultRow -** opcode) for each row in the result set. -** -** SRT_Mem Only valid if the result is a single column. -** Store the first column of the first result row -** in register pDest->iSDParm then abandon the rest -** of the query. This destination implies "LIMIT 1". -** -** SRT_Set The result must be a single column. Store each -** row of result as the key in table pDest->iSDParm. -** Apply the affinity pDest->affSdst before storing -** results. if pDest->iSDParm2 is positive, then it is -** a register holding a Bloom filter for the IN operator -** that should be populated in addition to the -** pDest->iSDParm table. This SRT is used to -** implement "IN (SELECT ...)". -** -** SRT_EphemTab Create an temporary table pDest->iSDParm and store -** the result there. The cursor is left open after -** returning. This is like SRT_Table except that -** this destination uses OP_OpenEphemeral to create -** the table first. -** -** SRT_Coroutine Generate a co-routine that returns a new row of -** results each time it is invoked. The entry point -** of the co-routine is stored in register pDest->iSDParm -** and the result row is stored in pDest->nDest registers -** starting with pDest->iSdst. -** -** SRT_Table Store results in temporary table pDest->iSDParm. -** SRT_Fifo This is like SRT_EphemTab except that the table -** is assumed to already be open. SRT_Fifo has -** the additional property of being able to ignore -** the ORDER BY clause. -** -** SRT_DistFifo Store results in a temporary table pDest->iSDParm. -** But also use temporary table pDest->iSDParm+1 as -** a record of all prior results and ignore any duplicate -** rows. Name means: "Distinct Fifo". -** -** SRT_Queue Store results in priority queue pDest->iSDParm (really -** an index). Append a sequence number so that all entries -** are distinct. -** -** SRT_DistQueue Store results in priority queue pDest->iSDParm only if -** the same record has never been stored before. The -** index at pDest->iSDParm+1 hold all prior stores. -** -** SRT_Upfrom Store results in the temporary table already opened by -** pDest->iSDParm. If (pDest->iSDParm<0), then the temp -** table is an intkey table - in this case the first -** column returned by the SELECT is used as the integer -** key. If (pDest->iSDParm>0), then the table is an index -** table. (pDest->iSDParm) is the number of key columns in -** each index record in this case. - */ - -/* The DISTINCT clause is ignored for all of the above. Not that -** IgnorableDistinct() implies IgnorableOrderby() */ - -/* The ORDER BY clause is ignored for all of the above */ - -/* -** An instance of this object describes where to put of the results of -** a SELECT statement. - */ -type TSelectDest1 = struct { - FeDest Tu8 - FiSDParm int32 - FiSDParm2 int32 - FiSdst int32 - FnSdst int32 - FzAffSdst uintptr - FpOrderBy uintptr -} - -type SelectDest1 = TSelectDest1 - -/* -** During code generation of statements that do inserts into AUTOINCREMENT -** tables, the following information is attached to the Table.u.autoInc.p -** pointer of each autoincrement table to record some side information that -** the code generator needs. We have to keep per-table autoincrement -** information in case inserts are done within triggers. Triggers do not -** normally coordinate their activities, but we do need to coordinate the -** loading and saving of autoincrement information. - */ -type TAutoincInfo1 = struct { - FpNext uintptr - FpTab uintptr - FiDb int32 - FregCtr int32 -} - -type AutoincInfo1 = TAutoincInfo1 - -/* -** At least one instance of the following structure is created for each -** trigger that may be fired while parsing an INSERT, UPDATE or DELETE -** statement. All such objects are stored in the linked list headed at -** Parse.pTriggerPrg and deleted once statement compilation has been -** completed. -** -** A Vdbe sub-program that implements the body and WHEN clause of trigger -** TriggerPrg.pTrigger, assuming a default ON CONFLICT clause of -** TriggerPrg.orconf, is stored in the TriggerPrg.pProgram variable. -** The Parse.pTriggerPrg list never contains two entries with the same -** values for both pTrigger and orconf. -** -** The TriggerPrg.aColmask[0] variable is set to a mask of old.* columns -** accessed (or set to 0 for triggers fired as a result of INSERT -** statements). Similarly, the TriggerPrg.aColmask[1] variable is set to -** a mask of new.* columns used by the program. - */ -type TTriggerPrg1 = struct { - FpTrigger uintptr - FpNext uintptr - FpProgram uintptr - Forconf int32 - FaColmask [2]Tu32 -} - -type TriggerPrg1 = TTriggerPrg1 - // C documentation // // /* @@ -30119,317 +27059,6 @@ type TyDbMask = uint32 type yDbMask = TyDbMask -/* -** For each index X that has as one of its arguments either an expression -** or the name of a virtual generated column, and if X is in scope such that -** the value of the expression can simply be read from the index, then -** there is an instance of this object on the Parse.pIdxExpr list. -** -** During code generation, while generating code to evaluate expressions, -** this list is consulted and if a matching expression is found, the value -** is read from the index rather than being recomputed. - */ -type TIndexedExpr1 = struct { - FpExpr uintptr - FiDataCur int32 - FiIdxCur int32 - FiIdxCol int32 - FbMaybeNullRow Tu8 - Faff Tu8 - FpIENext uintptr -} - -type IndexedExpr1 = TIndexedExpr1 - -/* -** An instance of the ParseCleanup object specifies an operation that -** should be performed after parsing to deallocation resources obtained -** during the parse and which are no longer needed. - */ -type TParseCleanup1 = struct { - FpNext uintptr - FpPtr uintptr - FxCleanup uintptr -} - -type ParseCleanup1 = TParseCleanup1 - -/* -** An SQL parser context. A copy of this structure is passed through -** the parser and down into all the parser action routine in order to -** carry around information that is global to the entire parse. -** -** The structure is divided into two parts. When the parser and code -** generate call themselves recursively, the first part of the structure -** is constant but the second part is reset at the beginning and end of -** each recursion. -** -** The nTableLock and aTableLock variables are only used if the shared-cache -** feature is enabled (if sqlite3Tsd()->useSharedData is true). They are -** used to store the set of table-locks required by the statement being -** compiled. Function sqlite3TableLock() is used to add entries to the -** list. - */ -type TParse1 = struct { - Fdb uintptr - FzErrMsg uintptr - FpVdbe uintptr - Frc int32 - FcolNamesSet Tu8 - FcheckSchema Tu8 - Fnested Tu8 - FnTempReg Tu8 - FisMultiWrite Tu8 - FmayAbort Tu8 - FhasCompound Tu8 - FokConstFactor Tu8 - FdisableLookaside Tu8 - FprepFlags Tu8 - FwithinRJSubrtn Tu8 - FbHasWith Tu8 - FmSubrtnSig Tu8 - FnRangeReg int32 - FiRangeReg int32 - FnErr int32 - FnTab int32 - FnMem int32 - FszOpAlloc int32 - FiSelfTab int32 - FnLabel int32 - FnLabelAlloc int32 - FaLabel uintptr - FpConstExpr uintptr - FpIdxEpr uintptr - FpIdxPartExpr uintptr - FconstraintName TToken - FwriteMask TyDbMask - FcookieMask TyDbMask - FregRowid int32 - FregRoot int32 - FnMaxArg int32 - FnSelect int32 - FnProgressSteps Tu32 - FnTableLock int32 - FaTableLock uintptr - FpAinc uintptr - FpToplevel uintptr - FpTriggerTab uintptr - FpTriggerPrg uintptr - FpCleanup uintptr - Fu1 struct { - FpReturning [0]uintptr - FaddrCrTab int32 - } - Foldmask Tu32 - Fnewmask Tu32 - FnQueryLoop TLogEst - FeTriggerOp Tu8 - FbReturning Tu8 - FeOrconf Tu8 - FdisableTriggers Tu8 - FaTempReg [8]int32 - FpOuterParse uintptr - FsNameToken TToken - FsLastToken TToken - FnVar TynVar - FiPkSortOrder Tu8 - Fexplain Tu8 - FeParseMode Tu8 - FnVtabLock int32 - FnHeight int32 - FaddrExplain int32 - FpVList uintptr - FpReprepare uintptr - FzTail uintptr - FpNewTable uintptr - FpNewIndex uintptr - FpNewTrigger uintptr - FzAuthContext uintptr - FsArg TToken - FapVtabLock uintptr - FpWith uintptr - FpRename uintptr -} - -type Parse1 = TParse1 - -/* Allowed values for Parse.eParseMode - */ - -/* -** Sizes and pointers of various parts of the Parse object. - */ - -/* -** Return true if currently inside an sqlite3_declare_vtab() call. - */ - -/* -** An instance of the following structure can be declared on a stack and used -** to save the Parse.zAuthContext value so that it can be restored later. - */ -type TAuthContext1 = struct { - FzAuthContext uintptr - FpParse uintptr -} - -type AuthContext1 = TAuthContext1 - -/* -** Bitfield flags for P5 value in various opcodes. -** -** Value constraints (enforced via assert()): -** OPFLAG_LENGTHARG == SQLITE_FUNC_LENGTH -** OPFLAG_TYPEOFARG == SQLITE_FUNC_TYPEOF -** OPFLAG_BULKCSR == BTREE_BULKLOAD -** OPFLAG_SEEKEQ == BTREE_SEEK_EQ -** OPFLAG_FORDELETE == BTREE_FORDELETE -** OPFLAG_SAVEPOSITION == BTREE_SAVEPOSITION -** OPFLAG_AUXDELETE == BTREE_AUXDELETE - */ -/* Also used in P2 (not P5) of OP_Delete */ - -/* -** Each trigger present in the database schema is stored as an instance of -** struct Trigger. -** -** Pointers to instances of struct Trigger are stored in two ways. -** 1. In the "trigHash" hash table (part of the sqlite3* that represents the -** database). This allows Trigger structures to be retrieved by name. -** 2. All triggers associated with a single table form a linked list, using the -** pNext member of struct Trigger. A pointer to the first element of the -** linked list is stored as the "pTrigger" member of the associated -** struct Table. -** -** The "step_list" member points to the first element of a linked list -** containing the SQL statements specified as the trigger program. - */ -type TTrigger1 = struct { - FzName uintptr - Ftable uintptr - Fop Tu8 - Ftr_tm Tu8 - FbReturning Tu8 - FpWhen uintptr - FpColumns uintptr - FpSchema uintptr - FpTabSchema uintptr - Fstep_list uintptr - FpNext uintptr -} - -type Trigger1 = TTrigger1 - -/* -** A trigger is either a BEFORE or an AFTER trigger. The following constants -** determine which. -** -** If there are multiple triggers, you might of some BEFORE and some AFTER. -** In that cases, the constants below can be ORed together. - */ - -/* -** An instance of struct TriggerStep is used to store a single SQL statement -** that is a part of a trigger-program. -** -** Instances of struct TriggerStep are stored in a singly linked list (linked -** using the "pNext" member) referenced by the "step_list" member of the -** associated struct Trigger instance. The first element of the linked list is -** the first step of the trigger-program. -** -** The "op" member indicates whether this is a "DELETE", "INSERT", "UPDATE" or -** "SELECT" statement. The meanings of the other members is determined by the -** value of "op" as follows: -** -** (op == TK_INSERT) -** orconf -> stores the ON CONFLICT algorithm -** pSelect -> The content to be inserted - either a SELECT statement or -** a VALUES clause. -** zTarget -> Dequoted name of the table to insert into. -** pIdList -> If this is an INSERT INTO ... () VALUES ... -** statement, then this stores the column-names to be -** inserted into. -** pUpsert -> The ON CONFLICT clauses for an Upsert -** -** (op == TK_DELETE) -** zTarget -> Dequoted name of the table to delete from. -** pWhere -> The WHERE clause of the DELETE statement if one is specified. -** Otherwise NULL. -** -** (op == TK_UPDATE) -** zTarget -> Dequoted name of the table to update. -** pWhere -> The WHERE clause of the UPDATE statement if one is specified. -** Otherwise NULL. -** pExprList -> A list of the columns to update and the expressions to update -** them to. See sqlite3Update() documentation of "pChanges" -** argument. -** -** (op == TK_SELECT) -** pSelect -> The SELECT statement -** -** (op == TK_RETURNING) -** pExprList -> The list of expressions that follow the RETURNING keyword. -** - */ -type TTriggerStep1 = struct { - Fop Tu8 - Forconf Tu8 - FpTrig uintptr - FpSelect uintptr - FzTarget uintptr - FpFrom uintptr - FpWhere uintptr - FpExprList uintptr - FpIdList uintptr - FpUpsert uintptr - FzSpan uintptr - FpNext uintptr - FpLast uintptr -} - -type TriggerStep1 = TTriggerStep1 - -/* -** Information about a RETURNING clause - */ -type TReturning1 = struct { - FpParse uintptr - FpReturnEL uintptr - FretTrig TTrigger - FretTStep TTriggerStep - FiRetCur int32 - FnRetCol int32 - FiRetReg int32 - FzName [40]int8 -} - -type Returning1 = TReturning1 - -/* -** The following object is the header for an "RCStr" or "reference-counted -** string". An RCStr is passed around and used like any other char* -** that has been dynamically allocated. The important interface -** differences: -** -** 1. RCStr strings are reference counted. They are deallocated -** when the reference count reaches zero. -** -** 2. Use sqlite3RCStrUnref() to free an RCStr string rather than -** sqlite3_free() -** -** 3. Make a (read-only) copy of a read-only RCStr string using -** sqlite3RCStrRef(). -** -** "String" is in the name, but an RCStr object can also be used to hold -** binary data. - */ -type TRCStr1 = struct { - F__ccgo_align [0]uint32 - FnRCRef Tu64 -} - -type RCStr1 = TRCStr1 - // C documentation // // /* @@ -30517,228 +27146,6 @@ type TSqlite3Config = struct { type Sqlite3Config = TSqlite3Config -/* -** This macro is used inside of assert() statements to indicate that -** the assert is only valid on a well-formed database. Instead of: -** -** assert( X ); -** -** One writes: -** -** assert( X || CORRUPT_DB ); -** -** CORRUPT_DB is true during normal operation. CORRUPT_DB does not indicate -** that the database is definitely corrupt, only that it might be corrupt. -** For most test cases, CORRUPT_DB is set to false using a special -** sqlite3_test_control(). This enables assert() statements to prove -** things that are always true for well-formed databases. - */ - -/* -** Context pointer passed down through the tree-walk. - */ -type TWalker1 = struct { - FpParse uintptr - FxExprCallback uintptr - FxSelectCallback uintptr - FxSelectCallback2 uintptr - FwalkerDepth int32 - FeCode Tu16 - FmWFlags Tu16 - Fu struct { - Fn [0]int32 - FiCur [0]int32 - FpSrcList [0]uintptr - FpCCurHint [0]uintptr - FpRefSrcList [0]uintptr - FaiCol [0]uintptr - FpIdxCover [0]uintptr - FpGroupBy [0]uintptr - FpSelect [0]uintptr - FpRewrite [0]uintptr - FpConst [0]uintptr - FpRename [0]uintptr - FpTab [0]uintptr - FpCovIdxCk [0]uintptr - FpSrcItem [0]uintptr - FpFix [0]uintptr - FaMem [0]uintptr - FpNC uintptr - } -} - -type Walker1 = TWalker1 - -/* -** The following structure contains information used by the sqliteFix... -** routines as they walk the parse tree to make database references -** explicit. - */ -type TDbFixer1 = struct { - FpParse uintptr - Fw TWalker - FpSchema uintptr - FbTemp Tu8 - FzDb uintptr - FzType uintptr - FpName uintptr -} - -type DbFixer1 = TDbFixer1 - -/* -** Return code from the parse-tree walking primitives and their -** callbacks. - */ - -/* -** A single common table expression - */ -type TCte1 = struct { - FzName uintptr - FpCols uintptr - FpSelect uintptr - FzCteErr uintptr - FpUse uintptr - FeM10d Tu8 -} - -type Cte1 = TCte1 - -/* -** Allowed values for the materialized flag (eM10d): - */ - -/* -** An instance of the With object represents a WITH clause containing -** one or more CTEs (common table expressions). - */ -type TWith1 = struct { - FnCte int32 - FbView int32 - FpOuter uintptr - Fa [1]TCte -} - -type With1 = TWith1 - -/* -** The Cte object is not guaranteed to persist for the entire duration -** of code generation. (The query flattener or other parser tree -** edits might delete it.) The following object records information -** about each Common Table Expression that must be preserved for the -** duration of the parse. -** -** The CteUse objects are freed using sqlite3ParserAddCleanup() rather -** than sqlite3SelectDelete(), which is what enables them to persist -** until the end of code generation. - */ -type TCteUse1 = struct { - FnUse int32 - FaddrM9e int32 - FregRtn int32 - FiCur int32 - FnRowEst TLogEst - FeM10d Tu8 -} - -type CteUse1 = TCteUse1 - -/* Client data associated with sqlite3_set_clientdata() and -** sqlite3_get_clientdata(). - */ -type TDbClientData1 = struct { - FpNext uintptr - FpData uintptr - FxDestructor uintptr - FzName [1]int8 -} - -type DbClientData1 = TDbClientData1 - -/* -** This object is used in various ways, most (but not all) related to window -** functions. -** -** (1) A single instance of this structure is attached to the -** the Expr.y.pWin field for each window function in an expression tree. -** This object holds the information contained in the OVER clause, -** plus additional fields used during code generation. -** -** (2) All window functions in a single SELECT form a linked-list -** attached to Select.pWin. The Window.pFunc and Window.pExpr -** fields point back to the expression that is the window function. -** -** (3) The terms of the WINDOW clause of a SELECT are instances of this -** object on a linked list attached to Select.pWinDefn. -** -** (4) For an aggregate function with a FILTER clause, an instance -** of this object is stored in Expr.y.pWin with eFrmType set to -** TK_FILTER. In this case the only field used is Window.pFilter. -** -** The uses (1) and (2) are really the same Window object that just happens -** to be accessible in two different ways. Use case (3) are separate objects. - */ -type TWindow1 = struct { - FzName uintptr - FzBase uintptr - FpPartition uintptr - FpOrderBy uintptr - FeFrmType Tu8 - FeStart Tu8 - FeEnd Tu8 - FbImplicitFrame Tu8 - FeExclude Tu8 - FpStart uintptr - FpEnd uintptr - FppThis uintptr - FpNextWin uintptr - FpFilter uintptr - FpWFunc uintptr - FiEphCsr int32 - FregAccum int32 - FregResult int32 - FcsrApp int32 - FregApp int32 - FregPart int32 - FpOwner uintptr - FnBufferCol int32 - FiArgCol int32 - FregOne int32 - FregStartRowid int32 - FregEndRowid int32 - FbExprArgs Tu8 -} - -type Window1 = TWindow1 - -/* -** An instance of the following structure holds information about SQL -** functions arguments that are the parameters to the printf() function. - */ -type TPrintfArguments1 = struct { - FnArg int32 - FnUsed int32 - FapArg uintptr -} - -type PrintfArguments1 = TPrintfArguments1 - -/* -** An instance of this object receives the decoding of a floating point -** value into an approximate decimal representation. - */ -type TFpDecode1 = struct { - Fsign int8 - FisSpecial int8 - Fn int32 - FiDP int32 - Fz uintptr - FzBuf [24]int8 -} - -type FpDecode1 = TFpDecode1 - /************** End of sqliteInt.h *******************************************/ /************** Begin file os_common.h ***************************************/ /* @@ -30882,11 +27289,11 @@ var _sqlite3azCompileOpt = [55]uintptr{ 47: __ccgo_ts + 1024, 48: __ccgo_ts + 1046, 49: __ccgo_ts + 1067, - 50: __ccgo_ts + 1077, - 51: __ccgo_ts + 1086, - 52: __ccgo_ts + 1094, - 53: __ccgo_ts + 1108, - 54: __ccgo_ts + 1121, + 50: __ccgo_ts + 1078, + 51: __ccgo_ts + 1087, + 52: __ccgo_ts + 1095, + 53: __ccgo_ts + 1109, + 54: __ccgo_ts + 1122, } func _sqlite3CompileOptions(tls *libc.TLS, pnOpt uintptr) (r uintptr) { @@ -31717,12 +28124,12 @@ var _sqlite3StdTypeAffinity = [6]int8{ } var _sqlite3StdType = [6]uintptr{ - 0: __ccgo_ts + 1134, - 1: __ccgo_ts + 1138, - 2: __ccgo_ts + 1143, - 3: __ccgo_ts + 1147, - 4: __ccgo_ts + 1155, - 5: __ccgo_ts + 1160, + 0: __ccgo_ts + 1135, + 1: __ccgo_ts + 1139, + 2: __ccgo_ts + 1144, + 3: __ccgo_ts + 1148, + 4: __ccgo_ts + 1156, + 5: __ccgo_ts + 1161, } /************** End of global.c **********************************************/ @@ -31805,27 +28212,26 @@ type Bool = TBool // // /* Opaque type used by code in vdbesort.c */ type TVdbeSorter = struct { - F__ccgo_align [0]uint32 - FmnPmaSize int32 - FmxPmaSize int32 - FmxKeysize int32 - Fpgsz int32 - FpReader uintptr - FpMerger uintptr - Fdb uintptr - FpKeyInfo uintptr - FpUnpacked uintptr - F__ccgo_align9 [4]byte - Flist TSorterList - FiMemory int32 - FnMemory int32 - FbUsePMA Tu8 - FbUseThreads Tu8 - FiPrev Tu8 - FnTask Tu8 - FtypeMask Tu8 - F__ccgo_align17 [3]byte - FaTask [1]TSortSubtask + F__ccgo_align [0]uint32 + FmnPmaSize int32 + FmxPmaSize int32 + FmxKeysize int32 + Fpgsz int32 + FpReader uintptr + FpMerger uintptr + Fdb uintptr + FpKeyInfo uintptr + FpUnpacked uintptr + F__ccgo_align9 [4]byte + Flist TSorterList + FiMemory int32 + FnMemory int32 + FbUsePMA Tu8 + FbUseThreads Tu8 + FiPrev Tu8 + FnTask Tu8 + FtypeMask Tu8 + F__ccgo_pad18 [3]byte } type VdbeSorter = TVdbeSorter @@ -31907,76 +28313,11 @@ type TVdbeCursor = struct { FpayloadSize Tu32 FszRow Tu32 FpCache uintptr - FaType [1]Tu32 + F__ccgo_pad29 [4]byte } type VdbeCursor = TVdbeCursor -type TVdbeCursor1 = struct { - F__ccgo_align [0]uint32 - FeCurType Tu8 - FiDb Ti8 - FnullRow Tu8 - FdeferredMoveto Tu8 - FisTable Tu8 - F__ccgo_align5 [3]byte - F__ccgo8 uint8 - FseekHit Tu16 - Fub struct { - FaAltMap [0]uintptr - FpBtx uintptr - } - FseqCount Ti64 - FcacheStatus Tu32 - FseekResult int32 - FpAltCursor uintptr - Fuc struct { - FpVCur [0]uintptr - FpSorter [0]uintptr - FpCursor uintptr - } - FpKeyInfo uintptr - FiHdrOffset Tu32 - FpgnoRoot TPgno - FnField Ti16 - FnHdrParsed Tu16 - FmovetoTarget Ti64 - FaOffset uintptr - FaRow uintptr - FpayloadSize Tu32 - FszRow Tu32 - FpCache uintptr - FaType [1]Tu32 -} - -type VdbeCursor1 = TVdbeCursor1 - -/* Return true if P is a null-only cursor - */ - -/* -** A value for VdbeCursor.cacheStatus that means the cache is always invalid. - */ - -/* -** Large TEXT or BLOB values can be slow to load, so we want to avoid -** loading them more than once. For that reason, large TEXT and BLOB values -** can be stored in a cache defined by this object, and attached to the -** VdbeCursor using the pCache field. - */ -type TVdbeTxtBlbCache1 = struct { - F__ccgo_align [0]uint32 - FpCValue uintptr - F__ccgo_align1 [4]byte - FiOffset Ti64 - FiCol int32 - FcacheStatus Tu32 - FcolCacheCtr Tu32 - F__ccgo_pad5 [4]byte -} - -type VdbeTxtBlbCache1 = TVdbeTxtBlbCache1 - // C documentation // // /* @@ -32025,167 +28366,11 @@ type TVdbeFrame = struct { type VdbeFrame = TVdbeFrame -type TVdbeFrame1 = struct { - F__ccgo_align [0]uint32 - Fv uintptr - FpParent uintptr - FaOp uintptr - FaMem uintptr - FapCsr uintptr - FaOnce uintptr - Ftoken uintptr - F__ccgo_align7 [4]byte - FlastRowid Ti64 - FpAuxData uintptr - FnCursor int32 - Fpc int32 - FnOp int32 - FnMem int32 - FnChildMem int32 - FnChildCsr int32 - F__ccgo_align15 [4]byte - FnChange Ti64 - FnDbChange Ti64 -} - -type VdbeFrame1 = TVdbeFrame1 - /* -** Size of struct Mem not including the Mem.zMalloc member or anything that -** follows. - */ - -/* One or more of the following flags are set to indicate the -** representations of the value stored in the Mem struct. -** -** * MEM_Null An SQL NULL value -** -** * MEM_Null|MEM_Zero An SQL NULL with the virtual table -** UPDATE no-change flag set -** -** * MEM_Null|MEM_Term| An SQL NULL, but also contains a -** MEM_Subtype pointer accessible using -** sqlite3_value_pointer(). -** -** * MEM_Null|MEM_Cleared Special SQL NULL that compares non-equal -** to other NULLs even using the IS operator. -** -** * MEM_Str A string, stored in Mem.z with -** length Mem.n. Zero-terminated if -** MEM_Term is set. This flag is -** incompatible with MEM_Blob and -** MEM_Null, but can appear with MEM_Int, -** MEM_Real, and MEM_IntReal. -** -** * MEM_Blob A blob, stored in Mem.z length Mem.n. -** Incompatible with MEM_Str, MEM_Null, -** MEM_Int, MEM_Real, and MEM_IntReal. -** -** * MEM_Blob|MEM_Zero A blob in Mem.z of length Mem.n plus -** MEM.u.i extra 0x00 bytes at the end. -** -** * MEM_Int Integer stored in Mem.u.i. -** -** * MEM_Real Real stored in Mem.u.r. -** -** * MEM_IntReal Real stored as an integer in Mem.u.i. -** -** If the MEM_Null flag is set, then the value is an SQL NULL value. -** For a pointer type created using sqlite3_bind_pointer() or -** sqlite3_result_pointer() the MEM_Term and MEM_Subtype flags are also set. -** -** If the MEM_Str flag is set then Mem.z points at a string representation. -** Usually this is encoded in the same unicode encoding as the main -** database (see below for exceptions). If the MEM_Term flag is also -** set, then the string is nul terminated. The MEM_Int and MEM_Real -** flags may coexist with the MEM_Str flag. - */ - -/* Extra bits that modify the meanings of the core datatypes above - */ -/* 0x0080 // Available */ - -/* Bits that determine the storage for Mem.z for a string or blob or -** aggregate accumulator. - */ - -/* Return TRUE if Mem X contains dynamically allocated content - anything -** that needs to be deallocated to avoid a leak. +** The size (in bytes) of an sqlite3_context object that holds N +** argv[] arguments. */ -/* -** Clear any existing type flags from a Mem and replace them with f - */ - -/* -** True if Mem X is a NULL-nochng type. - */ - -/* -** Return true if a memory cell has been initialized and is valid. -** is for use inside assert() statements only. -** -** A Memory cell is initialized if at least one of the -** MEM_Null, MEM_Str, MEM_Int, MEM_Real, MEM_Blob, or MEM_IntReal bits -** is set. It is "undefined" if all those bits are zero. - */ - -/* -** Each auxiliary data pointer stored by a user defined function -** implementation calling sqlite3_set_auxdata() is stored in an instance -** of this structure. All such structures associated with a single VM -** are stored in a linked list headed at Vdbe.pAuxData. All are destroyed -** when the VM is halted (if not before). - */ -type TAuxData1 = struct { - FiAuxOp int32 - FiAuxArg int32 - FpAux uintptr - FxDeleteAux uintptr - FpNextAux uintptr -} - -type AuxData1 = TAuxData1 - -/* -** The "context" argument for an installable function. A pointer to an -** instance of this structure is the first argument to the routines used -** implement the SQL functions. -** -** There is a typedef for this structure in sqlite.h. So all routines, -** even the public interface to SQLite, can use a pointer to this structure. -** But this file is the only place where the internal details of this -** structure are known. -** -** This structure is defined inside of vdbeInt.h because it uses substructures -** (Mem) which are only defined there. - */ -type Tsqlite3_context1 = struct { - FpOut uintptr - FpFunc uintptr - FpMem uintptr - FpVdbe uintptr - FiOp int32 - FisError int32 - Fenc Tu8 - FskipFlag Tu8 - Fargc Tu16 - Fargv [1]uintptr -} - -type sqlite3_context1 = Tsqlite3_context1 - -// C documentation -// -// /* A bitfield type for use inside of structures. Always follow with :N where -// ** N is the number of bits. -// */ -type Tbft = uint32 - -type bft = Tbft - -/* Bit Field Type */ - // C documentation // // /* The ScanStatus object holds a single value for the @@ -32211,18 +28396,6 @@ type TScanStatus = struct { type ScanStatus = TScanStatus -type TScanStatus1 = struct { - FaddrExplain int32 - FaAddrRange [6]int32 - FaddrLoop int32 - FaddrVisit int32 - FiSelectID int32 - FnEst TLogEst - FzName uintptr -} - -type ScanStatus1 = TScanStatus1 - // C documentation // // /* The DblquoteStr object holds the text of a double-quoted @@ -32239,104 +28412,6 @@ type TDblquoteStr = struct { type DblquoteStr = TDblquoteStr -type TDblquoteStr1 = struct { - FpNextStr uintptr - Fz [8]int8 -} - -type DblquoteStr1 = TDblquoteStr1 - -/* -** An instance of the virtual machine. This structure contains the complete -** state of the virtual machine. -** -** The "sqlite3_stmt" structure pointer that is returned by sqlite3_prepare() -** is really a pointer to an instance of this structure. - */ -type TVdbe1 = struct { - F__ccgo_align [0]uint32 - Fdb uintptr - FppVPrev uintptr - FpVNext uintptr - FpParse uintptr - FnVar TynVar - FnMem int32 - FnCursor int32 - FcacheCtr Tu32 - Fpc int32 - Frc int32 - FnChange Ti64 - FiStatement int32 - F__ccgo_align12 [4]byte - FiCurrentTime Ti64 - FnFkConstraint Ti64 - FnStmtDefCons Ti64 - FnStmtDefImmCons Ti64 - FaMem uintptr - FapArg uintptr - FapCsr uintptr - FaVar uintptr - FaOp uintptr - FnOp int32 - FnOpAlloc int32 - FaColName uintptr - FpResultRow uintptr - FzErrMsg uintptr - FpVList uintptr - F__ccgo_align27 [4]byte - FstartTime Ti64 - FnResColumn Tu16 - FnResAlloc Tu16 - FerrorAction Tu8 - FminWriteFileFormat Tu8 - FprepFlags Tu8 - FeVdbeState Tu8 - F__ccgo152 uint16 - FbtreeMask TyDbMask - FlockMask TyDbMask - FaCounter [9]Tu32 - FzSql uintptr - FpFree uintptr - FpFrame uintptr - FpDelFrame uintptr - FnFrame int32 - Fexpmask Tu32 - FpProgram uintptr - FpAuxData uintptr -} - -type Vdbe1 = TVdbe1 - -/* -** The following are allowed values for Vdbe.eVdbeState - */ - -/* -** Structure used to store the context required by the -** sqlite3_preupdate_*() API functions. - */ -type TPreUpdate1 = struct { - F__ccgo_align [0]uint32 - Fv uintptr - FpCsr uintptr - Fop int32 - FaRecord uintptr - Fkeyinfo TKeyInfo - FpUnpacked uintptr - FpNewUnpacked uintptr - FiNewReg int32 - FiBlobWrite int32 - FiKey1 Ti64 - FiKey2 Ti64 - Foldipk TMem - FaNew uintptr - FpTab uintptr - FpPk uintptr - FapDflt uintptr -} - -type PreUpdate1 = TPreUpdate1 - // C documentation // // /* @@ -32358,13 +28433,6 @@ type TValueList = struct { type ValueList = TValueList -type TValueList1 = struct { - FpCsr uintptr - FpOut uintptr -} - -type ValueList1 = TValueList1 - /************** End of vdbeInt.h *********************************************/ /************** Continuing where we left off in status.c *********************/ @@ -32384,14 +28452,7 @@ type Tsqlite3StatType = struct { type sqlite3StatType = Tsqlite3StatType -type Tsqlite3StatType1 = struct { - FnowValue [10]Tsqlite3StatValueType - FmxValue [10]Tsqlite3StatValueType -} - -type sqlite3StatType1 = Tsqlite3StatType1 - -var _sqlite3Stat = Tsqlite3StatType1{} +var _sqlite3Stat = Tsqlite3StatType{} // C documentation // @@ -32470,7 +28531,7 @@ func Xsqlite3_status64(tls *libc.TLS, op int32, pCurrent uintptr, pHighwater uin var pMutex, v1 uintptr _, _ = pMutex, v1 if op < 0 || op >= int32(libc.Uint32FromInt64(40)/libc.Uint32FromInt64(4)) { - return _sqlite3MisuseError(tls, int32(24298)) + return _sqlite3MisuseError(tls, int32(24456)) } if _statMutex[op] != 0 { v1 = _sqlite3Pcache1Mutex(tls) @@ -32642,7 +28703,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p } pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i1)*16))).FpSchema if pSchema != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + uint32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(16)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) + *(*int32)(unsafe.Pointer(bp)) = int32(uint32(*(*int32)(unsafe.Pointer(bp))) + uint32((*(*func(*libc.TLS, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fm.FxRoundup})))(tls, int32(20)))*((*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fcount+(*TSchema)(unsafe.Pointer(pSchema)).FfkeyHash.Fcount)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtblHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FtrigHash.Fht)) *(*int32)(unsafe.Pointer(bp)) = int32(uint64(*(*int32)(unsafe.Pointer(bp))) + Xsqlite3_msize(tls, (*TSchema)(unsafe.Pointer(pSchema)).FidxHash.Fht)) @@ -32700,7 +28761,7 @@ func Xsqlite3_db_status(tls *libc.TLS, db uintptr, op int32, pCurrent uintptr, p goto _5 _5: ; - pVdbe = (*TVdbe1)(unsafe.Pointer(pVdbe)).FpVNext + pVdbe = (*TVdbe)(unsafe.Pointer(pVdbe)).FpVNext } (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpEnd = (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpTrueEnd (*Tsqlite3)(unsafe.Pointer(db)).FpnBytesFreed = uintptr(0) @@ -32878,26 +28939,6 @@ type TDateTime = struct { type DateTime = TDateTime -type TDateTime1 = struct { - F__ccgo_align [0]uint32 - FiJD Tsqlite3_int64 - FY int32 - FM int32 - FD int32 - Fh int32 - Fm int32 - Ftz int32 - Fs float64 - FvalidJD int8 - FvalidYMD int8 - FvalidHMS int8 - FnFloor int8 - F__ccgo44 uint8 - F__ccgo_pad17 [3]byte -} - -type DateTime1 = TDateTime1 - // C documentation // // /* @@ -33028,7 +29069,7 @@ func _parseTimezone(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } } zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1165, libc.VaList(bp+16, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1166, libc.VaList(bp+16, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) @@ -33060,13 +29101,13 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { var _ /* s at bp+8 */ int32 _, _ = ms, rScale ms = float64(0) - if _getDigits(tls, zDate, __ccgo_ts+1173, libc.VaList(bp+24, bp, bp+4)) != int32(2) { + if _getDigits(tls, zDate, __ccgo_ts+1174, libc.VaList(bp+24, bp, bp+4)) != int32(2) { return int32(1) } zDate += uintptr(5) if int32(*(*int8)(unsafe.Pointer(zDate))) == int32(':') { zDate++ - if _getDigits(tls, zDate, __ccgo_ts+1181, libc.VaList(bp+24, bp+8)) != int32(1) { + if _getDigits(tls, zDate, __ccgo_ts+1182, libc.VaList(bp+24, bp+8)) != int32(1) { return int32(1) } zDate += uintptr(2) @@ -33074,7 +29115,7 @@ func _parseHhMmSs(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { rScale = float64(1) zDate++ for int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zDate)))])&int32(0x04) != 0 { - ms = ms*float64(10) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') + ms = float64(ms*float64(10)) + float64(*(*int8)(unsafe.Pointer(zDate))) - libc.Float64FromUint8('0') rScale *= float64(10) zDate++ } @@ -33145,10 +29186,10 @@ func _computeJD(tls *libc.TLS, p uintptr) { B = int32(38) - A + A/int32(4) X1 = int32(36525) * (Y + int32(4716)) / int32(100) X2 = int32(306001) * (M + int32(1)) / int32(10000) - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64((float64(X1+X2+D+B) - libc.Float64FromFloat64(1524.5)) * libc.Float64FromInt32(86400000))) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) if (*TDateTime)(unsafe.Pointer(p)).FvalidHMS != 0 { - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000)+libc.Float64FromFloat64(0.5)) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64((*TDateTime)(unsafe.Pointer(p)).Fh*int32(3600000)+(*TDateTime)(unsafe.Pointer(p)).Fm*int32(60000)) + int64(float64((*TDateTime)(unsafe.Pointer(p)).Fs*libc.Float64FromInt32(1000))+libc.Float64FromFloat64(0.5)) if (*TDateTime)(unsafe.Pointer(p)).Ftz != 0 { *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64((*TDateTime)(unsafe.Pointer(p)).Ftz * int32(60000)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = 0 @@ -33216,7 +29257,7 @@ func _parseYyyyMmDd(tls *libc.TLS, zDate uintptr, p uintptr) (r int32) { } else { neg = 0 } - if _getDigits(tls, zDate, __ccgo_ts+1185, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { + if _getDigits(tls, zDate, __ccgo_ts+1186, libc.VaList(bp+24, bp, bp+4, bp+8)) != int32(3) { return int32(1) } zDate += uintptr(10) @@ -33284,7 +29325,7 @@ func _setRawDateNumber(tls *libc.TLS, p uintptr, r float64) { (*TDateTime)(unsafe.Pointer(p)).Fs = r libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 0, 0x1) if r >= float64(0) && r < float64(5.3734845e+06) { - (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r*libc.Float64FromFloat64(8.64e+07) + libc.Float64FromFloat64(0.5)) + (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(float64(r*libc.Float64FromFloat64(8.64e+07)) + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) } } @@ -33317,14 +29358,14 @@ func _parseDateOrTime(tls *libc.TLS, context uintptr, zDate uintptr, p uintptr) if _parseHhMmSs(tls, zDate, p) == 0 { return 0 } else { - if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1197) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { + if _sqlite3StrICmp(tls, zDate, __ccgo_ts+1198) == 0 && _sqlite3NotPureFunc(tls, context) != 0 { return _setDateTimeToCurrent(tls, context, p) } else { if _sqlite3AtoF(tls, zDate, bp, _sqlite3Strlen30(tls, zDate), uint8(SQLITE_UTF8)) > 0 { _setRawDateNumber(tls, p, *(*float64)(unsafe.Pointer(bp))) return 0 } else { - if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1201) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1208) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { + if (_sqlite3StrICmp(tls, zDate, __ccgo_ts+1202) == 0 || _sqlite3StrICmp(tls, zDate, __ccgo_ts+1209) == 0) && _sqlite3NotPureFunc(tls, context) != 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) return _setDateTimeToCurrent(tls, context, p) } @@ -33381,7 +29422,7 @@ func _computeYMD(tls *libc.TLS, p uintptr) { C = int32((float64(B) - libc.Float64FromFloat64(122.1)) / libc.Float64FromFloat64(365.25)) D = int32(36525) * (C & int32(32767)) / int32(100) E = int32(float64(B-D) / libc.Float64FromFloat64(30.6001)) - X1 = int32(libc.Float64FromFloat64(30.6001) * float64(E)) + X1 = int32(float64(libc.Float64FromFloat64(30.6001) * float64(E))) (*TDateTime)(unsafe.Pointer(p)).FD = B - D - X1 if E < int32(14) { v1 = E - int32(1) @@ -33531,7 +29572,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { *(*Ttime_t)(unsafe.Pointer(bp)) = int32((*TDateTime)(unsafe.Pointer(p)).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000)) } if _osLocaltime(tls, bp, bp+4) != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1218, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+1219, -int32(1)) return int32(SQLITE_ERROR) } (*TDateTime)(unsafe.Pointer(p)).FY = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_year + int32(1900) - iYearDiff @@ -33539,7 +29580,7 @@ func _toLocaltime(tls *libc.TLS, p uintptr, pCtx uintptr) (r int32) { (*TDateTime)(unsafe.Pointer(p)).FD = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_mday (*TDateTime)(unsafe.Pointer(p)).Fh = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_hour (*TDateTime)(unsafe.Pointer(p)).Fm = (*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_min - (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_sec) + float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001) + (*TDateTime)(unsafe.Pointer(p)).Fs = float64((*(*Ttm)(unsafe.Pointer(bp + 4))).Ftm_sec) + float64(float64((*TDateTime)(unsafe.Pointer(p)).FiJD%libc.Int64FromInt32(1000))*float64(0.001)) (*TDateTime)(unsafe.Pointer(p)).FvalidYMD = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidHMS = int8(1) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 @@ -33617,7 +29658,7 @@ func _autoAdjustDate(tls *libc.TLS, p uintptr) { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) } else { if (*TDateTime)(unsafe.Pointer(p)).Fs >= float64(int64(-libc.Int32FromInt32(21086676))*libc.Int64FromInt32(10000)) && (*TDateTime)(unsafe.Pointer(p)).Fs <= float64(libc.Int64FromInt32(25340230)*libc.Int64FromInt32(10000)+libc.Int64FromInt32(799)) { - r = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + r = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(r + libc.Float64FromFloat64(0.5)) (*TDateTime)(unsafe.Pointer(p)).FvalidJD = int8(1) @@ -33686,7 +29727,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** If rawS is available, then interpret as a julian day number, or ** a unix timestamp, depending on its magnitude. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1241) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1242) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-33611-57934 */ @@ -33701,7 +29742,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** month. As this is the default action, this modifier is really ** a no-op that is only included for symmetry. See "floor". */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1246) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1247) == 0 { _computeJD(tls, p) _clearYMD_HMS_TZ(tls, p) rc = 0 @@ -33714,7 +29755,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Resolve day-of-month overflow by rolling back to the end of the ** previous month. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1254) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1255) == 0 { _computeJD(tls, p) *(*Tsqlite3_int64)(unsafe.Pointer(p)) -= int64(int32((*TDateTime)(unsafe.Pointer(p)).FnFloor) * int32(86400000)) _clearYMD_HMS_TZ(tls, p) @@ -33729,7 +29770,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** value in the allowed range of julian day numbers understood by ** SQLite (0..5373484.5) then the result will be NULL. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1260) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1261) == 0 { if idx > int32(1) { return int32(1) } /* IMP: R-31176-64601 */ @@ -33744,7 +29785,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Assuming the current time value is UTC (a.k.a. GMT), shift it to ** show local time. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1270) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1271) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x10>>4)) != 0 { v1 = SQLITE_OK } else { @@ -33761,11 +29802,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Treat the current value of p->s as the number of ** seconds since 1970. Convert to a real julian day number. */ - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1280) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1281) == 0 && int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x1>>0)) != 0 { if idx > int32(1) { return int32(1) } /* IMP: R-49255-55373 */ - *(*float64)(unsafe.Pointer(bp)) = (*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000) + float64(2.1086676e+14) + *(*float64)(unsafe.Pointer(bp)) = float64((*TDateTime)(unsafe.Pointer(p)).Fs*float64(1000)) + float64(2.1086676e+14) if *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(4.642690608e+14) { _clearYMD_HMS_TZ(tls, p) (*TDateTime)(unsafe.Pointer(p)).FiJD = int64(*(*float64)(unsafe.Pointer(bp)) + libc.Float64FromFloat64(0.5)) @@ -33774,7 +29815,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 } } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1290) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1291) == 0 && _sqlite3NotPureFunc(tls, pCtx) != 0 { if int32(uint32(*(*uint8)(unsafe.Pointer(p + 44))&0x8>>3)) == 0 { /* Guess at the corresponding utc time */ cnt = 0 /* Guess is off by this much */ _computeJD(tls, p) @@ -33821,7 +29862,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ - if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1294, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { + if v7 = Xsqlite3_strnicmp(tls, z, __ccgo_ts+1295, int32(8)) == 0 && _sqlite3AtoF(tls, z+8, bp, _sqlite3Strlen30(tls, z+8), uint8(SQLITE_UTF8)) > 0 && *(*float64)(unsafe.Pointer(bp)) >= float64(0) && *(*float64)(unsafe.Pointer(bp)) < float64(7); v7 { v6 = int32(*(*float64)(unsafe.Pointer(bp))) n = v6 } @@ -33851,8 +29892,8 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, ** Show subsecond precision in the output of datetime() and ** unixepoch() and strftime('%s'). */ - if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1303, int32(9)) != 0 { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1201) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1208) == 0 { + if Xsqlite3_strnicmp(tls, z, __ccgo_ts+1304, int32(9)) != 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1202) == 0 || Xsqlite3_stricmp(tls, z, __ccgo_ts+1209) == 0 { libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(1), 2, 0x4) rc = 0 } @@ -33871,16 +29912,16 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, libc.SetBitFieldPtr8Uint32(p+44, libc.Uint32FromInt32(0), 0, 0x1) (*TDateTime)(unsafe.Pointer(p)).Ftz = 0 (*TDateTime)(unsafe.Pointer(p)).FvalidJD = 0 - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1313) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1314) == 0 { (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1319) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1320) == 0 { (*TDateTime)(unsafe.Pointer(p)).FM = int32(1) (*TDateTime)(unsafe.Pointer(p)).FD = int32(1) rc = 0 } else { - if Xsqlite3_stricmp(tls, z, __ccgo_ts+1324) == 0 { + if Xsqlite3_stricmp(tls, z, __ccgo_ts+1325) == 0 { rc = 0 } } @@ -33922,10 +29963,10 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } if int32(*(*int8)(unsafe.Pointer(z + uintptr(n)))) == int32('-') { - if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1328, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(5) && _getDigits(tls, z+1, __ccgo_ts+1329, libc.VaList(bp+136, bp+56)) == int32(1) { break } - if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1332, libc.VaList(bp+136, bp+56)) == int32(1) { + if n == int32(6) && _getDigits(tls, z+1, __ccgo_ts+1333, libc.VaList(bp+136, bp+56)) == int32(1) { break } } @@ -33946,11 +29987,11 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } /* Must start with +/- */ if n == int32(5) { - if _getDigits(tls, z+1, __ccgo_ts+1336, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1337, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } } else { - if _getDigits(tls, z+1, __ccgo_ts+1348, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { + if _getDigits(tls, z+1, __ccgo_ts+1349, libc.VaList(bp+136, bp+56, bp+60, bp+64)) != int32(3) { break } z++ @@ -33988,7 +30029,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, rc = 0 break } - if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1173, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { + if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 11)))])&int32(0x01) != 0 && _getDigits(tls, z+12, __ccgo_ts+1174, libc.VaList(bp+136, bp+68, bp+72)) == int32(2) { z2 = z + 12 n = int32(2) } else { @@ -34068,7 +30109,7 @@ func _parseModifier(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, p uintptr, break } _computeJD(tls, p) - *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000)*float64(_aXformType[i].FrXform) + rRounder) + *(*Tsqlite3_int64)(unsafe.Pointer(p)) += int64(float64(float64(*(*float64)(unsafe.Pointer(bp))*libc.Float64FromFloat64(1000))*float64(_aXformType[i].FrXform)) + rRounder) rc = 0 break } @@ -34225,7 +30266,7 @@ func _datetimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(16)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(17)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(18)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(19)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[32]int8)(unsafe.Pointer(bp + 48)))[int32(20)] = int8('.') @@ -34273,7 +30314,7 @@ func _timeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(4)] = int8(int32('0') + (*(*TDateTime)(unsafe.Pointer(bp))).Fm%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(5)] = int8(':') if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - s = int32(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs + libc.Float64FromFloat64(0.5)) + s = int32(float64(libc.Float64FromFloat64(1000)*(*(*TDateTime)(unsafe.Pointer(bp))).Fs) + libc.Float64FromFloat64(0.5)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(6)] = int8(int32('0') + s/int32(10000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(7)] = int8(int32('0') + s/int32(1000)%int32(10)) (*(*[16]int8)(unsafe.Pointer(bp + 48)))[int32(8)] = int8('.') @@ -34378,7 +30419,7 @@ func _daysAfterMonday(tls *libc.TLS, pDate uintptr) (r int32) { // ** In other words, return the day of the week according // ** to this code: // ** -// ** 0=Sunday, 1=Monday, 2=Tues, ..., 6=Saturday +// ** 0=Sunday, 1=Monday, 2=Tuesday, ..., 6=Saturday // */ func _daysAfterSunday(tls *libc.TLS, pDate uintptr) (r int32) { return int32(((*TDateTime)(unsafe.Pointer(pDate)).FiJD+libc.Int64FromInt32(129600000))/libc.Int64FromInt32(86400000)) % int32(7) @@ -34465,9 +30506,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { fallthrough case int32('e'): if int32(cf) == int32('d') { - v3 = __ccgo_ts + 1360 + v3 = __ccgo_ts + 1361 } else { - v3 = __ccgo_ts + 1365 + v3 = __ccgo_ts + 1366 } Xsqlite3_str_appendf(tls, bp+48, v3, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('f'): /* Fractional seconds. (Non-standard) */ @@ -34475,9 +30516,9 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if s > float64(59.999) { s = float64(59.999) } - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1369, libc.VaList(bp+176, s)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1370, libc.VaList(bp+176, s)) case int32('F'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1376, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1377, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY, (*(*TDateTime)(unsafe.Pointer(bp))).FM, (*(*TDateTime)(unsafe.Pointer(bp))).FD)) case int32('G'): /* Fall thru */ fallthrough case int32('g'): @@ -34487,17 +30528,17 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*(*TDateTime)(unsafe.Pointer(bp + 72))).FvalidYMD = 0 _computeYMD(tls, bp+72) if int32(cf) == int32('g') { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY%int32(100))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY%int32(100))) } else { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1392, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp + 72))).FY)) } case int32('H'): fallthrough case int32('k'): if int32(cf) == int32('H') { - v4 = __ccgo_ts + 1360 + v4 = __ccgo_ts + 1361 } else { - v4 = __ccgo_ts + 1365 + v4 = __ccgo_ts + 1366 } Xsqlite3_str_appendf(tls, bp+48, v4, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh)) case int32('I'): /* Fall thru */ @@ -34511,50 +30552,50 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { h = int32(12) } if int32(cf) == int32('I') { - v5 = __ccgo_ts + 1360 + v5 = __ccgo_ts + 1361 } else { - v5 = __ccgo_ts + 1365 + v5 = __ccgo_ts + 1366 } Xsqlite3_str_appendf(tls, bp+48, v5, libc.VaList(bp+176, h)) case int32('j'): /* Day of year. Jan01==1, Jan02==2, and so forth */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1396, libc.VaList(bp+176, _daysAfterJan01(tls, bp)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1397, libc.VaList(bp+176, _daysAfterJan01(tls, bp)+int32(1))) case int32('J'): /* Julian day number. (Non-standard) */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1401, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1402, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD)/float64(8.64e+07))) case int32('m'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FM)) case int32('M'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('p'): /* Fall thru */ fallthrough case int32('P'): if (*(*TDateTime)(unsafe.Pointer(bp))).Fh >= int32(12) { if int32(cf) == int32('p') { - v6 = __ccgo_ts + 1407 + v6 = __ccgo_ts + 1408 } else { - v6 = __ccgo_ts + 1410 + v6 = __ccgo_ts + 1411 } Xsqlite3_str_append(tls, bp+48, v6, int32(2)) } else { if int32(cf) == int32('p') { - v7 = __ccgo_ts + 1413 + v7 = __ccgo_ts + 1414 } else { - v7 = __ccgo_ts + 1416 + v7 = __ccgo_ts + 1417 } Xsqlite3_str_append(tls, bp+48, v7, int32(2)) } case int32('R'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1419, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1420, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm)) case int32('s'): if int32(uint32(*(*uint8)(unsafe.Pointer(bp + 44))&0x4>>2)) != 0 { - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1429, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1430, libc.VaList(bp+176, float64((*(*TDateTime)(unsafe.Pointer(bp))).FiJD-libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000000))/float64(1000))) } else { iS = (*(*TDateTime)(unsafe.Pointer(bp))).FiJD/libc.Int64FromInt32(1000) - libc.Int64FromInt32(21086676)*libc.Int64FromInt32(10000) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1434, libc.VaList(bp+176, iS)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1435, libc.VaList(bp+176, iS)) } case int32('S'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+176, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+176, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('T'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1439, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1440, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, int32((*(*TDateTime)(unsafe.Pointer(bp))).Fs))) case int32('u'): /* Day of week. 1 to 7. Monday==1, Sunday==7 */ fallthrough case int32('w'): /* Day of week. 0 to 6. Sunday==0, Monday==1 */ @@ -34564,18 +30605,18 @@ func _strftimeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } Xsqlite3_str_appendchar(tls, bp+48, int32(1), c) case int32('U'): /* Week num. 00-53. First Sun of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterSunday(tls, bp)+int32(7))/int32(7))) case int32('V'): /* Week num. 01-53. First week with a Thur is week 01 */ *(*TDateTime)(unsafe.Pointer(bp + 120)) = *(*TDateTime)(unsafe.Pointer(bp)) /* Adjust y so that is the Thursday in the same week as x */ (*(*TDateTime)(unsafe.Pointer(bp + 120))).FiJD += int64((int32(3) - _daysAfterMonday(tls, bp)) * int32(86400000)) (*(*TDateTime)(unsafe.Pointer(bp + 120))).FvalidYMD = 0 _computeYMD(tls, bp+120) - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+176, _daysAfterJan01(tls, bp+120)/int32(7)+int32(1))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+176, _daysAfterJan01(tls, bp+120)/int32(7)+int32(1))) case int32('W'): /* Week num. 00-53. First Mon of the year is week 01 */ - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1360, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1361, libc.VaList(bp+176, (_daysAfterJan01(tls, bp)-_daysAfterMonday(tls, bp)+int32(7))/int32(7))) case int32('Y'): - Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1391, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) + Xsqlite3_str_appendf(tls, bp+48, __ccgo_ts+1392, libc.VaList(bp+176, (*(*TDateTime)(unsafe.Pointer(bp))).FY)) case int32('%'): Xsqlite3_str_appendchar(tls, bp+48, int32(1), int8('%')) default: @@ -34731,7 +30772,7 @@ func _timediffFunc(tls *libc.TLS, context uintptr, NotUsed1 int32, argv uintptr) _clearYMD_HMS_TZ(tls, bp) _computeYMD_HMS(tls, bp) _sqlite3StrAccumInit(tls, bp+96, uintptr(0), uintptr(0), 0, int32(100)) - Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1454, libc.VaList(bp+128, int32(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) + Xsqlite3_str_appendf(tls, bp+96, __ccgo_ts+1455, libc.VaList(bp+128, int32(sign), Y, M, (*(*TDateTime)(unsafe.Pointer(bp))).FD-int32(1), (*(*TDateTime)(unsafe.Pointer(bp))).Fh, (*(*TDateTime)(unsafe.Pointer(bp))).Fm, (*(*TDateTime)(unsafe.Pointer(bp))).Fs)) _sqlite3ResultStrAccum(tls, context, bp+96) } @@ -34764,55 +30805,55 @@ var _aDateTimeFuncs = [10]TFuncDef{ FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1260, + FzName: __ccgo_ts + 1261, }, 1: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1280, + FzName: __ccgo_ts + 1281, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1488, + FzName: __ccgo_ts + 1489, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1493, + FzName: __ccgo_ts + 1494, }, 4: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1498, + FzName: __ccgo_ts + 1499, }, 5: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1507, + FzName: __ccgo_ts + 1508, }, 6: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), FpUserData: uintptr(unsafe.Pointer(&_sqlite3Config)), - FzName: __ccgo_ts + 1516, + FzName: __ccgo_ts + 1517, }, 7: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1525, + FzName: __ccgo_ts + 1526, }, 8: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1538, + FzName: __ccgo_ts + 1539, }, 9: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1556, + FzName: __ccgo_ts + 1557, }, } @@ -34894,28 +30935,28 @@ func init() { // */ func _sqlite3OsClose(tls *libc.TLS, pId uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) + (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods)).FxClose})))(tls, pId) (*Tsqlite3_file)(unsafe.Pointer(pId)).FpMethods = uintptr(0) } } func _sqlite3OsRead(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxRead})))(tls, id, pBuf, amt, offset) } func _sqlite3OsWrite(tls *libc.TLS, id uintptr, pBuf uintptr, amt int32, offset Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) + return (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxWrite})))(tls, id, pBuf, amt, offset) } func _sqlite3OsTruncate(tls *libc.TLS, id uintptr, size Ti64) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxTruncate})))(tls, id, size) } func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { var v1 int32 _ = v1 if flags != 0 { - v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) + v1 = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSync})))(tls, id, flags) } else { v1 = SQLITE_OK } @@ -34923,19 +30964,19 @@ func _sqlite3OsSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { } func _sqlite3OsFileSize(tls *libc.TLS, id uintptr, pSize uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileSize})))(tls, id, pSize) } func _sqlite3OsLock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxLock})))(tls, id, lockType) } func _sqlite3OsUnlock(tls *libc.TLS, id uintptr, lockType int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnlock})))(tls, id, lockType) } func _sqlite3OsCheckReservedLock(tls *libc.TLS, id uintptr, pResOut uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) + return (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxCheckReservedLock})))(tls, id, pResOut) } // C documentation @@ -34952,12 +30993,12 @@ func _sqlite3OsFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return int32(SQLITE_NOTFOUND) } - return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + return (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } func _sqlite3OsFileControlHint(tls *libc.TLS, id uintptr, op int32, pArg uintptr) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods != 0 { - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFileControl})))(tls, id, op, pArg) } } @@ -34965,7 +31006,7 @@ func _sqlite3OsSectorSize(tls *libc.TLS, id uintptr) (r int32) { var xSectorSize uintptr var v1 int32 _, _ = xSectorSize, v1 - xSectorSize = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize + xSectorSize = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxSectorSize if xSectorSize != 0 { v1 = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xSectorSize})))(tls, id) } else { @@ -34978,34 +31019,34 @@ func _sqlite3OsDeviceCharacteristics(tls *libc.TLS, id uintptr) (r int32) { if (*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods == uintptr(0) { return 0 } - return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) + return (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxDeviceCharacteristics})))(tls, id) } func _sqlite3OsShmLock(tls *libc.TLS, id uintptr, offset int32, n int32, flags int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmLock})))(tls, id, offset, n, flags) } func _sqlite3OsShmBarrier(tls *libc.TLS, id uintptr) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmBarrier})))(tls, id) } func _sqlite3OsShmUnmap(tls *libc.TLS, id uintptr, deleteFlag int32) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) + return (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmUnmap})))(tls, id, deleteFlag) } func _sqlite3OsShmMap(tls *libc.TLS, id uintptr, iPage int32, pgsz int32, bExtend int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) + return (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxShmMap})))(tls, id, iPage, pgsz, bExtend, pp) } // C documentation // // /* The real implementation of xFetch and xUnfetch */ func _sqlite3OsFetch(tls *libc.TLS, id uintptr, iOff Ti64, iAmt int32, pp uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxFetch})))(tls, id, iOff, iAmt, pp) } func _sqlite3OsUnfetch(tls *libc.TLS, id uintptr, iOff Ti64, p uintptr) (r int32) { - return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) + return (*(*func(*libc.TLS, uintptr, Tsqlite3_int64, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(id)).FpMethods)).FxUnfetch})))(tls, id, iOff, p) } // C documentation @@ -35107,7 +31148,7 @@ func _sqlite3OsCurrentTimeInt64(tls *libc.TLS, pVfs uintptr, pTimeOut uintptr) ( rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTimeInt64})))(tls, pVfs, pTimeOut) } else { rc = (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FxCurrentTime})))(tls, pVfs, bp) - *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07)) + *(*Tsqlite3_int64)(unsafe.Pointer(pTimeOut)) = int64(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(8.64e+07))) } return rc } @@ -35318,14 +31359,7 @@ type TBenignMallocHooks = struct { type BenignMallocHooks = TBenignMallocHooks -type TBenignMallocHooks1 = struct { - FxBenignBegin uintptr - FxBenignEnd uintptr -} - -type BenignMallocHooks1 = TBenignMallocHooks1 - -var _sqlite3Hooks = TBenignMallocHooks1{} +var _sqlite3Hooks = TBenignMallocHooks{} /* The "wsdHooks" macro will resolve to the appropriate BenignMallocHooks ** structure. If writable static data is unsupported on the target, @@ -35340,9 +31374,9 @@ var _sqlite3Hooks = TBenignMallocHooks1{} // ** Register hooks to call when sqlite3BeginBenignMalloc() and // ** sqlite3EndBenignMalloc() are called, respectively. // */ -func _sqlite3BenignMallocHooks(tls *libc.TLS, xBenignBegin uintptr, xBenignEnd uintptr) { - _sqlite3Hooks.FxBenignBegin = xBenignBegin - _sqlite3Hooks.FxBenignEnd = xBenignEnd +func _sqlite3BenignMallocHooks(tls *libc.TLS, __ccgo_fp_xBenignBegin uintptr, __ccgo_fp_xBenignEnd uintptr) { + _sqlite3Hooks.FxBenignBegin = __ccgo_fp_xBenignBegin + _sqlite3Hooks.FxBenignEnd = __ccgo_fp_xBenignEnd } // C documentation @@ -35483,7 +31517,7 @@ func _sqlite3MemMalloc(tls *libc.TLS, nByte int32) (r uintptr) { *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1569, libc.VaList(bp+8, nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1570, libc.VaList(bp+8, nByte)) } return p } @@ -35545,7 +31579,7 @@ func _sqlite3MemRealloc(tls *libc.TLS, pPrior uintptr, nByte int32) (r uintptr) *(*Tsqlite3_int64)(unsafe.Pointer(p)) = int64(nByte) p += 8 } else { - Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1607, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) + Xsqlite3_log(tls, int32(SQLITE_NOMEM), __ccgo_ts+1608, libc.VaList(bp+8, _sqlite3MemSize(tls, pPrior), nByte)) } return p } @@ -35756,7 +31790,11 @@ func init() { // /* // ** Initialize the mutex system. // */ +var mu sync.Mutex + func _sqlite3MutexInit(tls *libc.TLS) (r int32) { + mu.Lock() + defer mu.Unlock() var pFrom, pTo uintptr var rc int32 _, _, _ = pFrom, pTo, rc @@ -35776,11 +31814,9 @@ func _sqlite3MutexInit(tls *libc.TLS) (r int32) { (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexLeave = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexLeave (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexHeld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexHeld (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexNotheld = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexNotheld - _sqlite3MemoryBarrier(tls) (*Tsqlite3_mutex_methods)(unsafe.Pointer(pTo)).FxMutexAlloc = (*Tsqlite3_mutex_methods)(unsafe.Pointer(pFrom)).FxMutexAlloc } rc = (*(*func(*libc.TLS) int32)(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.Fmutex.FxMutexInit})))(tls) - _sqlite3MemoryBarrier(tls) return rc } @@ -35963,6 +31999,16 @@ func init() { *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_noopMutexLeave) } +// C documentation +// +// /* +// ** If compiled with SQLITE_MUTEX_NOOP, then the no-op mutex implementation +// ** is used regardless of the run-time threadsafety setting. +// */ +func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { + return _sqlite3NoopMutex(tls) +} + type T_EXCEPTION_POINTERS = struct { FExceptionRecord TPEXCEPTION_RECORD FContextRecord TPCONTEXT @@ -40120,24 +36166,6 @@ type TPMEM_EXTENDED_PARAMETER = uintptr type PMEM_EXTENDED_PARAMETER = TPMEM_EXTENDED_PARAMETER -type TMEM_EXTENDED_PARAMETER1 = struct { - F__ccgo_align [0]uint32 - F__ccgo0_0 struct { - F__ccgo_align [0]uint32 - F__ccgo0 uint64 - } - F__ccgo1_8 struct { - F__ccgo_align [0]uint32 - FPointer [0]TPVOID - FSize [0]TSIZE_T - FHandle [0]THANDLE - FULong [0]TDWORD - FULong64 TDWORD64 - } -} - -type MEM_EXTENDED_PARAMETER1 = TMEM_EXTENDED_PARAMETER1 - type TMEM_SECTION_EXTENDED_PARAMETER_TYPE = int32 type MEM_SECTION_EXTENDED_PARAMETER_TYPE = TMEM_SECTION_EXTENDED_PARAMETER_TYPE @@ -40163,12 +36191,6 @@ type TPFILE_ID_128 = uintptr type PFILE_ID_128 = TPFILE_ID_128 -type TFILE_ID_1281 = struct { - FIdentifier [16]TBYTE -} - -type FILE_ID_1281 = TFILE_ID_1281 - type TFILE_NOTIFY_INFORMATION = struct { FNextEntryOffset TDWORD FAction TDWORD @@ -41803,15 +37825,6 @@ type TPIMAGE_AUX_SYMBOL_TOKEN_DEF = uintptr type PIMAGE_AUX_SYMBOL_TOKEN_DEF = TPIMAGE_AUX_SYMBOL_TOKEN_DEF -type TIMAGE_AUX_SYMBOL_TOKEN_DEF1 = struct { - FbAuxType TBYTE - FbReserved TBYTE - FSymbolTableIndex TDWORD - FrgbReserved [12]TBYTE -} - -type IMAGE_AUX_SYMBOL_TOKEN_DEF1 = TIMAGE_AUX_SYMBOL_TOKEN_DEF1 - type TIMAGE_AUX_SYMBOL = struct { FFile [0]struct { FName [18]TBYTE @@ -42504,17 +38517,6 @@ type T_PIMAGE_RUNTIME_FUNCTION_ENTRY = uintptr type _PIMAGE_RUNTIME_FUNCTION_ENTRY = T_PIMAGE_RUNTIME_FUNCTION_ENTRY -type T_IMAGE_RUNTIME_FUNCTION_ENTRY1 = struct { - FBeginAddress TDWORD - FEndAddress TDWORD - F__ccgo2_8 struct { - FUnwindData [0]TDWORD - FUnwindInfoAddress TDWORD - } -} - -type _IMAGE_RUNTIME_FUNCTION_ENTRY1 = T_IMAGE_RUNTIME_FUNCTION_ENTRY1 - type TIMAGE_IA64_RUNTIME_FUNCTION_ENTRY = struct { FBeginAddress TDWORD FEndAddress TDWORD @@ -42829,26 +38831,6 @@ type TPIMAGE_COR20_HEADER = uintptr type PIMAGE_COR20_HEADER = TPIMAGE_COR20_HEADER -type TIMAGE_COR20_HEADER1 = struct { - Fcb TDWORD - FMajorRuntimeVersion TWORD - FMinorRuntimeVersion TWORD - FMetaData TIMAGE_DATA_DIRECTORY - FFlags TDWORD - F__ccgo5_20 struct { - FEntryPointRVA [0]TDWORD - FEntryPointToken TDWORD - } - FResources TIMAGE_DATA_DIRECTORY - FStrongNameSignature TIMAGE_DATA_DIRECTORY - FCodeManagerTable TIMAGE_DATA_DIRECTORY - FVTableFixups TIMAGE_DATA_DIRECTORY - FExportAddressTableJumps TIMAGE_DATA_DIRECTORY - FManagedNativeHeader TIMAGE_DATA_DIRECTORY -} - -type IMAGE_COR20_HEADER1 = TIMAGE_COR20_HEADER1 - type TSLIST_ENTRY = struct { FNext uintptr } @@ -47781,21 +43763,6 @@ type TLPFILE_ID_DESCRIPTOR = uintptr type LPFILE_ID_DESCRIPTOR = TLPFILE_ID_DESCRIPTOR -type TFILE_ID_DESCRIPTOR1 = struct { - F__ccgo_align [0]uint32 - FdwSize TDWORD - FType TFILE_ID_TYPE - F__ccgo2_8 struct { - F__ccgo_align [0]uint32 - FObjectId [0]TGUID - FExtendedFileId [0]TFILE_ID_128 - FFileId TLARGE_INTEGER - F__ccgo_pad3 [8]byte - } -} - -type FILE_ID_DESCRIPTOR1 = TFILE_ID_DESCRIPTOR1 - type TDRAWPATRECT = struct { FptPosition TPOINT FptSize TPOINT @@ -58898,15 +54865,6 @@ type TPDRVCONFIGINFOEX = uintptr type PDRVCONFIGINFOEX = TPDRVCONFIGINFOEX -type TDRVCONFIGINFOEX1 = struct { - FdwDCISize TDWORD - FlpszDCISectionName TLPCWSTR - FlpszDCIAliasName TLPCWSTR - FdnDevNode TDWORD -} - -type DRVCONFIGINFOEX1 = TDRVCONFIGINFOEX1 - type TNPDRVCONFIGINFOEX = uintptr type NPDRVCONFIGINFOEX = TNPDRVCONFIGINFOEX @@ -64489,10 +60447,6 @@ type TFD_SET = struct { type FD_SET = TFD_SET -type Tfd_set1 = TFD_SET - -type fd_set1 = Tfd_set1 - type TPFD_SET = uintptr type PFD_SET = TPFD_SET @@ -71749,11 +67703,11 @@ const _PROXY_MARSHAL = 2 const _PROXY_SENDRECEIVE = 3 const _PROXY_UNMARSHAL = 4 -type TIRpcStubBuffer1 = struct { +type TIRpcStubBuffer = struct { FlpVtbl uintptr } -type IRpcStubBuffer1 = TIRpcStubBuffer1 +type IRpcStubBuffer = TIRpcStubBuffer type TRPC_SS_THREAD_HANDLE = uintptr @@ -71799,12 +67753,6 @@ const _REGCLS_MULTI_SEPARATE = 2 const _REGCLS_SUSPENDED = 4 const _REGCLS_SURROGATE = 8 -type TIRpcStubBuffer = struct { - FlpVtbl uintptr -} - -type IRpcStubBuffer = TIRpcStubBuffer - type TIRpcChannelBuffer = struct { FlpVtbl uintptr } @@ -72111,12 +68059,6 @@ type TIUnknownVtbl = struct { type IUnknownVtbl = TIUnknownVtbl -type TIUnknown1 = struct { - FlpVtbl uintptr -} - -type IUnknown1 = TIUnknown1 - type TAsyncIUnknownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72131,12 +68073,6 @@ type TAsyncIUnknownVtbl = struct { type AsyncIUnknownVtbl = TAsyncIUnknownVtbl -type TAsyncIUnknown1 = struct { - FlpVtbl uintptr -} - -type AsyncIUnknown1 = TAsyncIUnknown1 - type TLPCLASSFACTORY = uintptr type LPCLASSFACTORY = TLPCLASSFACTORY @@ -72151,12 +68087,6 @@ type TIClassFactoryVtbl = struct { type IClassFactoryVtbl = TIClassFactoryVtbl -type TIClassFactory1 = struct { - FlpVtbl uintptr -} - -type IClassFactory1 = TIClassFactory1 - type TIMarshal = struct { FlpVtbl uintptr } @@ -72476,12 +68406,6 @@ type TIMarshalVtbl = struct { type IMarshalVtbl = TIMarshalVtbl -type TIMarshal1 = struct { - FlpVtbl uintptr -} - -type IMarshal1 = TIMarshal1 - type TINoMarshalVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72490,12 +68414,6 @@ type TINoMarshalVtbl = struct { type INoMarshalVtbl = TINoMarshalVtbl -type TINoMarshal1 = struct { - FlpVtbl uintptr -} - -type INoMarshal1 = TINoMarshal1 - type TIAgileObjectVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72504,12 +68422,6 @@ type TIAgileObjectVtbl = struct { type IAgileObjectVtbl = TIAgileObjectVtbl -type TIAgileObject1 = struct { - FlpVtbl uintptr -} - -type IAgileObject1 = TIAgileObject1 - type TIAgileReferenceVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72519,12 +68431,6 @@ type TIAgileReferenceVtbl = struct { type IAgileReferenceVtbl = TIAgileReferenceVtbl -type TIAgileReference1 = struct { - FlpVtbl uintptr -} - -type IAgileReference1 = TIAgileReference1 - type TLPMARSHAL2 = uintptr type LPMARSHAL2 = TLPMARSHAL2 @@ -72543,12 +68449,6 @@ type TIMarshal2Vtbl = struct { type IMarshal2Vtbl = TIMarshal2Vtbl -type TIMarshal21 = struct { - FlpVtbl uintptr -} - -type IMarshal21 = TIMarshal21 - type TLPMALLOC = uintptr type LPMALLOC = TLPMALLOC @@ -72567,12 +68467,6 @@ type TIMallocVtbl = struct { type IMallocVtbl = TIMallocVtbl -type TIMalloc1 = struct { - FlpVtbl uintptr -} - -type IMalloc1 = TIMalloc1 - type TLPSTDMARSHALINFO = uintptr type LPSTDMARSHALINFO = TLPSTDMARSHALINFO @@ -72586,12 +68480,6 @@ type TIStdMarshalInfoVtbl = struct { type IStdMarshalInfoVtbl = TIStdMarshalInfoVtbl -type TIStdMarshalInfo1 = struct { - FlpVtbl uintptr -} - -type IStdMarshalInfo1 = TIStdMarshalInfo1 - type TLPEXTERNALCONNECTION = uintptr type LPEXTERNALCONNECTION = TLPEXTERNALCONNECTION @@ -72616,12 +68504,6 @@ type TIExternalConnectionVtbl = struct { type IExternalConnectionVtbl = TIExternalConnectionVtbl -type TIExternalConnection1 = struct { - FlpVtbl uintptr -} - -type IExternalConnection1 = TIExternalConnection1 - type TLPMULTIQI = uintptr type LPMULTIQI = TLPMULTIQI @@ -72647,12 +68529,6 @@ type TIMultiQIVtbl = struct { type IMultiQIVtbl = TIMultiQIVtbl -type TIMultiQI1 = struct { - FlpVtbl uintptr -} - -type IMultiQI1 = TIMultiQI1 - type TAsyncIMultiQIVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72663,12 +68539,6 @@ type TAsyncIMultiQIVtbl = struct { type AsyncIMultiQIVtbl = TAsyncIMultiQIVtbl -type TAsyncIMultiQI1 = struct { - FlpVtbl uintptr -} - -type AsyncIMultiQI1 = TAsyncIMultiQI1 - type TIInternalUnknownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72678,12 +68548,6 @@ type TIInternalUnknownVtbl = struct { type IInternalUnknownVtbl = TIInternalUnknownVtbl -type TIInternalUnknown1 = struct { - FlpVtbl uintptr -} - -type IInternalUnknown1 = TIInternalUnknown1 - type TLPENUMUNKNOWN = uintptr type LPENUMUNKNOWN = TLPENUMUNKNOWN @@ -72700,12 +68564,6 @@ type TIEnumUnknownVtbl = struct { type IEnumUnknownVtbl = TIEnumUnknownVtbl -type TIEnumUnknown1 = struct { - FlpVtbl uintptr -} - -type IEnumUnknown1 = TIEnumUnknown1 - type TLPENUMSTRING = uintptr type LPENUMSTRING = TLPENUMSTRING @@ -72722,12 +68580,6 @@ type TIEnumStringVtbl = struct { type IEnumStringVtbl = TIEnumStringVtbl -type TIEnumString1 = struct { - FlpVtbl uintptr -} - -type IEnumString1 = TIEnumString1 - type TISequentialStreamVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72738,12 +68590,6 @@ type TISequentialStreamVtbl = struct { type ISequentialStreamVtbl = TISequentialStreamVtbl -type TISequentialStream1 = struct { - FlpVtbl uintptr -} - -type ISequentialStream1 = TISequentialStream1 - type TLPSTREAM = uintptr type LPSTREAM = TLPSTREAM @@ -72819,12 +68665,6 @@ type TIStreamVtbl = struct { type IStreamVtbl = TIStreamVtbl -type TIStream1 = struct { - FlpVtbl uintptr -} - -type IStream1 = TIStream1 - type TRPCOLEDATAREP = uint32 type RPCOLEDATAREP = TRPCOLEDATAREP @@ -72862,12 +68702,6 @@ type TIRpcChannelBufferVtbl = struct { type IRpcChannelBufferVtbl = TIRpcChannelBufferVtbl -type TIRpcChannelBuffer1 = struct { - FlpVtbl uintptr -} - -type IRpcChannelBuffer1 = TIRpcChannelBuffer1 - type TIRpcChannelBuffer2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72882,12 +68716,6 @@ type TIRpcChannelBuffer2Vtbl = struct { type IRpcChannelBuffer2Vtbl = TIRpcChannelBuffer2Vtbl -type TIRpcChannelBuffer21 = struct { - FlpVtbl uintptr -} - -type IRpcChannelBuffer21 = TIRpcChannelBuffer21 - type TIAsyncRpcChannelBufferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72905,12 +68733,6 @@ type TIAsyncRpcChannelBufferVtbl = struct { type IAsyncRpcChannelBufferVtbl = TIAsyncRpcChannelBufferVtbl -type TIAsyncRpcChannelBuffer1 = struct { - FlpVtbl uintptr -} - -type IAsyncRpcChannelBuffer1 = TIAsyncRpcChannelBuffer1 - type TIRpcChannelBuffer3Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72932,12 +68754,6 @@ type TIRpcChannelBuffer3Vtbl = struct { type IRpcChannelBuffer3Vtbl = TIRpcChannelBuffer3Vtbl -type TIRpcChannelBuffer31 = struct { - FlpVtbl uintptr -} - -type IRpcChannelBuffer31 = TIRpcChannelBuffer31 - type TIRpcSyntaxNegotiateVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72947,12 +68763,6 @@ type TIRpcSyntaxNegotiateVtbl = struct { type IRpcSyntaxNegotiateVtbl = TIRpcSyntaxNegotiateVtbl -type TIRpcSyntaxNegotiate1 = struct { - FlpVtbl uintptr -} - -type IRpcSyntaxNegotiate1 = TIRpcSyntaxNegotiate1 - type TIRpcProxyBufferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72963,12 +68773,6 @@ type TIRpcProxyBufferVtbl = struct { type IRpcProxyBufferVtbl = TIRpcProxyBufferVtbl -type TIRpcProxyBuffer1 = struct { - FlpVtbl uintptr -} - -type IRpcProxyBuffer1 = TIRpcProxyBuffer1 - type TIRpcStubBufferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -72994,12 +68798,6 @@ type TIPSFactoryBufferVtbl = struct { type IPSFactoryBufferVtbl = TIPSFactoryBufferVtbl -type TIPSFactoryBuffer1 = struct { - FlpVtbl uintptr -} - -type IPSFactoryBuffer1 = TIPSFactoryBuffer1 - type TSChannelHookCallInfo = struct { Fiid TIID FcbSize TDWORD @@ -73025,12 +68823,6 @@ type TIChannelHookVtbl = struct { type IChannelHookVtbl = TIChannelHookVtbl -type TIChannelHook1 = struct { - FlpVtbl uintptr -} - -type IChannelHook1 = TIChannelHook1 - type TSOLE_AUTHENTICATION_SERVICE = struct { FdwAuthnSvc TDWORD FdwAuthzSvc TDWORD @@ -73112,12 +68904,6 @@ type TIClientSecurityVtbl = struct { type IClientSecurityVtbl = TIClientSecurityVtbl -type TIClientSecurity1 = struct { - FlpVtbl uintptr -} - -type IClientSecurity1 = TIClientSecurity1 - type TIServerSecurityVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73130,12 +68916,6 @@ type TIServerSecurityVtbl = struct { type IServerSecurityVtbl = TIServerSecurityVtbl -type TIServerSecurity1 = struct { - FlpVtbl uintptr -} - -type IServerSecurity1 = TIServerSecurity1 - type TRPCOPT_PROPERTIES = int32 type RPCOPT_PROPERTIES = TRPCOPT_PROPERTIES @@ -73166,12 +68946,6 @@ type TIRpcOptionsVtbl = struct { type IRpcOptionsVtbl = TIRpcOptionsVtbl -type TIRpcOptions1 = struct { - FlpVtbl uintptr -} - -type IRpcOptions1 = TIRpcOptions1 - type TGLOBALOPT_PROPERTIES = int32 type GLOBALOPT_PROPERTIES = TGLOBALOPT_PROPERTIES @@ -73239,12 +69013,6 @@ type TIGlobalOptionsVtbl = struct { type IGlobalOptionsVtbl = TIGlobalOptionsVtbl -type TIGlobalOptions1 = struct { - FlpVtbl uintptr -} - -type IGlobalOptions1 = TIGlobalOptions1 - type TLPSURROGATE = uintptr type LPSURROGATE = TLPSURROGATE @@ -73259,12 +69027,6 @@ type TISurrogateVtbl = struct { type ISurrogateVtbl = TISurrogateVtbl -type TISurrogate1 = struct { - FlpVtbl uintptr -} - -type ISurrogate1 = TISurrogate1 - type TLPGLOBALINTERFACETABLE = uintptr type LPGLOBALINTERFACETABLE = TLPGLOBALINTERFACETABLE @@ -73280,12 +69042,6 @@ type TIGlobalInterfaceTableVtbl = struct { type IGlobalInterfaceTableVtbl = TIGlobalInterfaceTableVtbl -type TIGlobalInterfaceTable1 = struct { - FlpVtbl uintptr -} - -type IGlobalInterfaceTable1 = TIGlobalInterfaceTable1 - type TISynchronizeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73297,12 +69053,6 @@ type TISynchronizeVtbl = struct { type ISynchronizeVtbl = TISynchronizeVtbl -type TISynchronize1 = struct { - FlpVtbl uintptr -} - -type ISynchronize1 = TISynchronize1 - type TISynchronizeHandleVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73312,12 +69062,6 @@ type TISynchronizeHandleVtbl = struct { type ISynchronizeHandleVtbl = TISynchronizeHandleVtbl -type TISynchronizeHandle1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeHandle1 = TISynchronizeHandle1 - type TISynchronizeEventVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73328,12 +69072,6 @@ type TISynchronizeEventVtbl = struct { type ISynchronizeEventVtbl = TISynchronizeEventVtbl -type TISynchronizeEvent1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeEvent1 = TISynchronizeEvent1 - type TISynchronizeContainerVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73344,12 +69082,6 @@ type TISynchronizeContainerVtbl = struct { type ISynchronizeContainerVtbl = TISynchronizeContainerVtbl -type TISynchronizeContainer1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeContainer1 = TISynchronizeContainer1 - type TISynchronizeMutexVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73362,12 +69094,6 @@ type TISynchronizeMutexVtbl = struct { type ISynchronizeMutexVtbl = TISynchronizeMutexVtbl -type TISynchronizeMutex1 = struct { - FlpVtbl uintptr -} - -type ISynchronizeMutex1 = TISynchronizeMutex1 - type TLPCANCELMETHODCALLS = uintptr type LPCANCELMETHODCALLS = TLPCANCELMETHODCALLS @@ -73382,12 +69108,6 @@ type TICancelMethodCallsVtbl = struct { type ICancelMethodCallsVtbl = TICancelMethodCallsVtbl -type TICancelMethodCalls1 = struct { - FlpVtbl uintptr -} - -type ICancelMethodCalls1 = TICancelMethodCalls1 - type TDCOM_CALL_STATE = int32 type DCOM_CALL_STATE = TDCOM_CALL_STATE @@ -73409,12 +69129,6 @@ type TIAsyncManagerVtbl = struct { type IAsyncManagerVtbl = TIAsyncManagerVtbl -type TIAsyncManager1 = struct { - FlpVtbl uintptr -} - -type IAsyncManager1 = TIAsyncManager1 - type TICallFactoryVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73424,12 +69138,6 @@ type TICallFactoryVtbl = struct { type ICallFactoryVtbl = TICallFactoryVtbl -type TICallFactory1 = struct { - FlpVtbl uintptr -} - -type ICallFactory1 = TICallFactory1 - type TIRpcHelperVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73440,12 +69148,6 @@ type TIRpcHelperVtbl = struct { type IRpcHelperVtbl = TIRpcHelperVtbl -type TIRpcHelper1 = struct { - FlpVtbl uintptr -} - -type IRpcHelper1 = TIRpcHelper1 - type TIReleaseMarshalBuffersVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73455,12 +69157,6 @@ type TIReleaseMarshalBuffersVtbl = struct { type IReleaseMarshalBuffersVtbl = TIReleaseMarshalBuffersVtbl -type TIReleaseMarshalBuffers1 = struct { - FlpVtbl uintptr -} - -type IReleaseMarshalBuffers1 = TIReleaseMarshalBuffers1 - type TIWaitMultipleVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73471,12 +69167,6 @@ type TIWaitMultipleVtbl = struct { type IWaitMultipleVtbl = TIWaitMultipleVtbl -type TIWaitMultiple1 = struct { - FlpVtbl uintptr -} - -type IWaitMultiple1 = TIWaitMultiple1 - type TLPADDRTRACKINGCONTROL = uintptr type LPADDRTRACKINGCONTROL = TLPADDRTRACKINGCONTROL @@ -73491,12 +69181,6 @@ type TIAddrTrackingControlVtbl = struct { type IAddrTrackingControlVtbl = TIAddrTrackingControlVtbl -type TIAddrTrackingControl1 = struct { - FlpVtbl uintptr -} - -type IAddrTrackingControl1 = TIAddrTrackingControl1 - type TLPADDREXCLUSIONCONTROL = uintptr type LPADDREXCLUSIONCONTROL = TLPADDREXCLUSIONCONTROL @@ -73511,12 +69195,6 @@ type TIAddrExclusionControlVtbl = struct { type IAddrExclusionControlVtbl = TIAddrExclusionControlVtbl -type TIAddrExclusionControl1 = struct { - FlpVtbl uintptr -} - -type IAddrExclusionControl1 = TIAddrExclusionControl1 - type TIPipeByteVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73527,12 +69205,6 @@ type TIPipeByteVtbl = struct { type IPipeByteVtbl = TIPipeByteVtbl -type TIPipeByte1 = struct { - FlpVtbl uintptr -} - -type IPipeByte1 = TIPipeByte1 - type TIPipeLongVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73543,12 +69215,6 @@ type TIPipeLongVtbl = struct { type IPipeLongVtbl = TIPipeLongVtbl -type TIPipeLong1 = struct { - FlpVtbl uintptr -} - -type IPipeLong1 = TIPipeLong1 - type TIPipeDoubleVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73559,12 +69225,6 @@ type TIPipeDoubleVtbl = struct { type IPipeDoubleVtbl = TIPipeDoubleVtbl -type TIPipeDouble1 = struct { - FlpVtbl uintptr -} - -type IPipeDouble1 = TIPipeDouble1 - type TAPTTYPEQUALIFIER = int32 type APTTYPEQUALIFIER = TAPTTYPEQUALIFIER @@ -73616,12 +69276,6 @@ type TIComThreadingInfoVtbl = struct { type IComThreadingInfoVtbl = TIComThreadingInfoVtbl -type TIComThreadingInfo1 = struct { - FlpVtbl uintptr -} - -type IComThreadingInfo1 = TIComThreadingInfo1 - type TIProcessInitControlVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73631,12 +69285,6 @@ type TIProcessInitControlVtbl = struct { type IProcessInitControlVtbl = TIProcessInitControlVtbl -type TIProcessInitControl1 = struct { - FlpVtbl uintptr -} - -type IProcessInitControl1 = TIProcessInitControl1 - type TIFastRundownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -73645,12 +69293,6 @@ type TIFastRundownVtbl = struct { type IFastRundownVtbl = TIFastRundownVtbl -type TIFastRundown1 = struct { - FlpVtbl uintptr -} - -type IFastRundown1 = TIFastRundown1 - type TCO_MARSHALING_CONTEXT_ATTRIBUTES = int32 type CO_MARSHALING_CONTEXT_ATTRIBUTES = TCO_MARSHALING_CONTEXT_ATTRIBUTES @@ -73679,12 +69321,6 @@ type TIMarshalingStreamVtbl = struct { type IMarshalingStreamVtbl = TIMarshalingStreamVtbl -type TIMarshalingStream1 = struct { - FlpVtbl uintptr -} - -type IMarshalingStream1 = TIMarshalingStream1 - type TServerInformation = struct { F__ccgo_align [0]uint32 FdwServerPid TDWORD @@ -74679,12 +70315,6 @@ type TIMallocSpyVtbl = struct { type IMallocSpyVtbl = TIMallocSpyVtbl -type TIMallocSpy1 = struct { - FlpVtbl uintptr -} - -type IMallocSpy1 = TIMallocSpy1 - type TLPBC = uintptr type LPBC = TLPBC @@ -74780,12 +70410,6 @@ type TIBindCtxVtbl = struct { type IBindCtxVtbl = TIBindCtxVtbl -type TIBindCtx1 = struct { - FlpVtbl uintptr -} - -type IBindCtx1 = TIBindCtx1 - type TLPENUMMONIKER = uintptr type LPENUMMONIKER = TLPENUMMONIKER @@ -74802,12 +70426,6 @@ type TIEnumMonikerVtbl = struct { type IEnumMonikerVtbl = TIEnumMonikerVtbl -type TIEnumMoniker1 = struct { - FlpVtbl uintptr -} - -type IEnumMoniker1 = TIEnumMoniker1 - type TLPRUNNABLEOBJECT = uintptr type LPRUNNABLEOBJECT = TLPRUNNABLEOBJECT @@ -74825,12 +70443,6 @@ type TIRunnableObjectVtbl = struct { type IRunnableObjectVtbl = TIRunnableObjectVtbl -type TIRunnableObject1 = struct { - FlpVtbl uintptr -} - -type IRunnableObject1 = TIRunnableObject1 - type TLPRUNNINGOBJECTTABLE = uintptr type LPRUNNINGOBJECTTABLE = TLPRUNNINGOBJECTTABLE @@ -74850,12 +70462,6 @@ type TIRunningObjectTableVtbl = struct { type IRunningObjectTableVtbl = TIRunningObjectTableVtbl -type TIRunningObjectTable1 = struct { - FlpVtbl uintptr -} - -type IRunningObjectTable1 = TIRunningObjectTable1 - type TLPPERSIST = uintptr type LPPERSIST = TLPPERSIST @@ -74869,12 +70475,6 @@ type TIPersistVtbl = struct { type IPersistVtbl = TIPersistVtbl -type TIPersist1 = struct { - FlpVtbl uintptr -} - -type IPersist1 = TIPersist1 - type TLPPERSISTSTREAM = uintptr type LPPERSISTSTREAM = TLPPERSISTSTREAM @@ -74892,12 +70492,6 @@ type TIPersistStreamVtbl = struct { type IPersistStreamVtbl = TIPersistStreamVtbl -type TIPersistStream1 = struct { - FlpVtbl uintptr -} - -type IPersistStream1 = TIPersistStream1 - type TLPMONIKER = uintptr type LPMONIKER = TLPMONIKER @@ -74958,12 +70552,6 @@ type TIMonikerVtbl = struct { type IMonikerVtbl = TIMonikerVtbl -type TIMoniker1 = struct { - FlpVtbl uintptr -} - -type IMoniker1 = TIMoniker1 - type TIROTDataVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -74973,12 +70561,6 @@ type TIROTDataVtbl = struct { type IROTDataVtbl = TIROTDataVtbl -type TIROTData1 = struct { - FlpVtbl uintptr -} - -type IROTData1 = TIROTData1 - type TLPENUMSTATSTG = uintptr type LPENUMSTATSTG = TLPENUMSTATSTG @@ -74995,12 +70577,6 @@ type TIEnumSTATSTGVtbl = struct { type IEnumSTATSTGVtbl = TIEnumSTATSTGVtbl -type TIEnumSTATSTG1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATSTG1 = TIEnumSTATSTG1 - type TLPSTORAGE = uintptr type LPSTORAGE = TLPSTORAGE @@ -75048,12 +70624,6 @@ type TIStorageVtbl = struct { type IStorageVtbl = TIStorageVtbl -type TIStorage1 = struct { - FlpVtbl uintptr -} - -type IStorage1 = TIStorage1 - type TLPPERSISTFILE = uintptr type LPPERSISTFILE = TLPPERSISTFILE @@ -75072,12 +70642,6 @@ type TIPersistFileVtbl = struct { type IPersistFileVtbl = TIPersistFileVtbl -type TIPersistFile1 = struct { - FlpVtbl uintptr -} - -type IPersistFile1 = TIPersistFile1 - type TLPPERSISTSTORAGE = uintptr type LPPERSISTSTORAGE = TLPPERSISTSTORAGE @@ -75097,12 +70661,6 @@ type TIPersistStorageVtbl = struct { type IPersistStorageVtbl = TIPersistStorageVtbl -type TIPersistStorage1 = struct { - FlpVtbl uintptr -} - -type IPersistStorage1 = TIPersistStorage1 - type TLPLOCKBYTES = uintptr type LPLOCKBYTES = TLPLOCKBYTES @@ -75122,12 +70680,6 @@ type TILockBytesVtbl = struct { type ILockBytesVtbl = TILockBytesVtbl -type TILockBytes1 = struct { - FlpVtbl uintptr -} - -type ILockBytes1 = TILockBytes1 - type TLPENUMFORMATETC = uintptr type LPENUMFORMATETC = TLPENUMFORMATETC @@ -75181,12 +70733,6 @@ type TIEnumFORMATETCVtbl = struct { type IEnumFORMATETCVtbl = TIEnumFORMATETCVtbl -type TIEnumFORMATETC1 = struct { - FlpVtbl uintptr -} - -type IEnumFORMATETC1 = TIEnumFORMATETC1 - type TLPENUMSTATDATA = uintptr type LPENUMSTATDATA = TLPENUMSTATDATA @@ -75234,12 +70780,6 @@ type TIEnumSTATDATAVtbl = struct { type IEnumSTATDATAVtbl = TIEnumSTATDATAVtbl -type TIEnumSTATDATA1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATDATA1 = TIEnumSTATDATA1 - type TLPROOTSTORAGE = uintptr type LPROOTSTORAGE = TLPROOTSTORAGE @@ -75253,12 +70793,6 @@ type TIRootStorageVtbl = struct { type IRootStorageVtbl = TIRootStorageVtbl -type TIRootStorage1 = struct { - FlpVtbl uintptr -} - -type IRootStorage1 = TIRootStorage1 - type TLPADVISESINK = uintptr type LPADVISESINK = TLPADVISESINK @@ -75420,12 +70954,6 @@ type TIAdviseSinkVtbl = struct { type IAdviseSinkVtbl = TIAdviseSinkVtbl -type TIAdviseSink1 = struct { - FlpVtbl uintptr -} - -type IAdviseSink1 = TIAdviseSink1 - type TAsyncIAdviseSinkVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75444,12 +70972,6 @@ type TAsyncIAdviseSinkVtbl = struct { type AsyncIAdviseSinkVtbl = TAsyncIAdviseSinkVtbl -type TAsyncIAdviseSink1 = struct { - FlpVtbl uintptr -} - -type AsyncIAdviseSink1 = TAsyncIAdviseSink1 - type TLPADVISESINK2 = uintptr type LPADVISESINK2 = TLPADVISESINK2 @@ -75468,12 +70990,6 @@ type TIAdviseSink2Vtbl = struct { type IAdviseSink2Vtbl = TIAdviseSink2Vtbl -type TIAdviseSink21 = struct { - FlpVtbl uintptr -} - -type IAdviseSink21 = TIAdviseSink21 - type TAsyncIAdviseSink2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75494,12 +71010,6 @@ type TAsyncIAdviseSink2Vtbl = struct { type AsyncIAdviseSink2Vtbl = TAsyncIAdviseSink2Vtbl -type TAsyncIAdviseSink21 = struct { - FlpVtbl uintptr -} - -type AsyncIAdviseSink21 = TAsyncIAdviseSink21 - type TLPDATAOBJECT = uintptr type LPDATAOBJECT = TLPDATAOBJECT @@ -75530,12 +71040,6 @@ type TIDataObjectVtbl = struct { type IDataObjectVtbl = TIDataObjectVtbl -type TIDataObject1 = struct { - FlpVtbl uintptr -} - -type IDataObject1 = TIDataObject1 - type TLPDATAADVISEHOLDER = uintptr type LPDATAADVISEHOLDER = TLPDATAADVISEHOLDER @@ -75552,12 +71056,6 @@ type TIDataAdviseHolderVtbl = struct { type IDataAdviseHolderVtbl = TIDataAdviseHolderVtbl -type TIDataAdviseHolder1 = struct { - FlpVtbl uintptr -} - -type IDataAdviseHolder1 = TIDataAdviseHolder1 - type TLPMESSAGEFILTER = uintptr type LPMESSAGEFILTER = TLPMESSAGEFILTER @@ -75630,12 +71128,6 @@ type TIMessageFilterVtbl = struct { type IMessageFilterVtbl = TIMessageFilterVtbl -type TIMessageFilter1 = struct { - FlpVtbl uintptr -} - -type IMessageFilter1 = TIMessageFilter1 - type TIClassActivatorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75645,12 +71137,6 @@ type TIClassActivatorVtbl = struct { type IClassActivatorVtbl = TIClassActivatorVtbl -type TIClassActivator1 = struct { - FlpVtbl uintptr -} - -type IClassActivator1 = TIClassActivator1 - type TIFillLockBytesVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75663,12 +71149,6 @@ type TIFillLockBytesVtbl = struct { type IFillLockBytesVtbl = TIFillLockBytesVtbl -type TIFillLockBytes1 = struct { - FlpVtbl uintptr -} - -type IFillLockBytes1 = TIFillLockBytes1 - type TIProgressNotifyVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75678,12 +71158,6 @@ type TIProgressNotifyVtbl = struct { type IProgressNotifyVtbl = TIProgressNotifyVtbl -type TIProgressNotify1 = struct { - FlpVtbl uintptr -} - -type IProgressNotify1 = TIProgressNotify1 - type TStorageLayout = struct { F__ccgo_align [0]uint32 FLayoutType TDWORD @@ -75711,12 +71185,6 @@ type TILayoutStorageVtbl = struct { type ILayoutStorageVtbl = TILayoutStorageVtbl -type TILayoutStorage1 = struct { - FlpVtbl uintptr -} - -type ILayoutStorage1 = TILayoutStorage1 - type TIBlockingLockVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75727,12 +71195,6 @@ type TIBlockingLockVtbl = struct { type IBlockingLockVtbl = TIBlockingLockVtbl -type TIBlockingLock1 = struct { - FlpVtbl uintptr -} - -type IBlockingLock1 = TIBlockingLock1 - type TITimeAndNoticeControlVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75742,12 +71204,6 @@ type TITimeAndNoticeControlVtbl = struct { type ITimeAndNoticeControlVtbl = TITimeAndNoticeControlVtbl -type TITimeAndNoticeControl1 = struct { - FlpVtbl uintptr -} - -type ITimeAndNoticeControl1 = TITimeAndNoticeControl1 - type TIOplockStorageVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75758,12 +71214,6 @@ type TIOplockStorageVtbl = struct { type IOplockStorageVtbl = TIOplockStorageVtbl -type TIOplockStorage1 = struct { - FlpVtbl uintptr -} - -type IOplockStorage1 = TIOplockStorage1 - type TIDirectWriterLockVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75775,12 +71225,6 @@ type TIDirectWriterLockVtbl = struct { type IDirectWriterLockVtbl = TIDirectWriterLockVtbl -type TIDirectWriterLock1 = struct { - FlpVtbl uintptr -} - -type IDirectWriterLock1 = TIDirectWriterLock1 - type TIUrlMonVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75790,12 +71234,6 @@ type TIUrlMonVtbl = struct { type IUrlMonVtbl = TIUrlMonVtbl -type TIUrlMon1 = struct { - FlpVtbl uintptr -} - -type IUrlMon1 = TIUrlMon1 - type TIForegroundTransferVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75805,12 +71243,6 @@ type TIForegroundTransferVtbl = struct { type IForegroundTransferVtbl = TIForegroundTransferVtbl -type TIForegroundTransfer1 = struct { - FlpVtbl uintptr -} - -type IForegroundTransfer1 = TIForegroundTransfer1 - type TIThumbnailExtractorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75821,12 +71253,6 @@ type TIThumbnailExtractorVtbl = struct { type IThumbnailExtractorVtbl = TIThumbnailExtractorVtbl -type TIThumbnailExtractor1 = struct { - FlpVtbl uintptr -} - -type IThumbnailExtractor1 = TIThumbnailExtractor1 - type TIDummyHICONIncluderVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75836,12 +71262,6 @@ type TIDummyHICONIncluderVtbl = struct { type IDummyHICONIncluderVtbl = TIDummyHICONIncluderVtbl -type TIDummyHICONIncluder1 = struct { - FlpVtbl uintptr -} - -type IDummyHICONIncluder1 = TIDummyHICONIncluder1 - type TApplicationType = int32 type ApplicationType = TApplicationType @@ -75870,12 +71290,6 @@ type TIProcessLockVtbl = struct { type IProcessLockVtbl = TIProcessLockVtbl -type TIProcessLock1 = struct { - FlpVtbl uintptr -} - -type IProcessLock1 = TIProcessLock1 - type TISurrogateServiceVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75889,12 +71303,6 @@ type TISurrogateServiceVtbl = struct { type ISurrogateServiceVtbl = TISurrogateServiceVtbl -type TISurrogateService1 = struct { - FlpVtbl uintptr -} - -type ISurrogateService1 = TISurrogateService1 - type TLPINITIALIZESPY = uintptr type LPINITIALIZESPY = TLPINITIALIZESPY @@ -75911,12 +71319,6 @@ type TIInitializeSpyVtbl = struct { type IInitializeSpyVtbl = TIInitializeSpyVtbl -type TIInitializeSpy1 = struct { - FlpVtbl uintptr -} - -type IInitializeSpy1 = TIInitializeSpy1 - type TIApartmentShutdownVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -75926,12 +71328,6 @@ type TIApartmentShutdownVtbl = struct { type IApartmentShutdownVtbl = TIApartmentShutdownVtbl -type TIApartmentShutdown1 = struct { - FlpVtbl uintptr -} - -type IApartmentShutdown1 = TIApartmentShutdown1 - type TCOMSD = int32 type COMSD = TCOMSD @@ -76430,12 +71826,6 @@ type TIOleAdviseHolderVtbl = struct { type IOleAdviseHolderVtbl = TIOleAdviseHolderVtbl -type TIOleAdviseHolder1 = struct { - FlpVtbl uintptr -} - -type IOleAdviseHolder1 = TIOleAdviseHolder1 - type TLPOLECACHE = uintptr type LPOLECACHE = TLPOLECACHE @@ -76453,12 +71843,6 @@ type TIOleCacheVtbl = struct { type IOleCacheVtbl = TIOleCacheVtbl -type TIOleCache1 = struct { - FlpVtbl uintptr -} - -type IOleCache1 = TIOleCache1 - type TLPOLECACHE2 = uintptr type LPOLECACHE2 = TLPOLECACHE2 @@ -76487,12 +71871,6 @@ type TIOleCache2Vtbl = struct { type IOleCache2Vtbl = TIOleCache2Vtbl -type TIOleCache21 = struct { - FlpVtbl uintptr -} - -type IOleCache21 = TIOleCache21 - type TLPOLECACHECONTROL = uintptr type LPOLECACHECONTROL = TLPOLECACHECONTROL @@ -76507,12 +71885,6 @@ type TIOleCacheControlVtbl = struct { type IOleCacheControlVtbl = TIOleCacheControlVtbl -type TIOleCacheControl1 = struct { - FlpVtbl uintptr -} - -type IOleCacheControl1 = TIOleCacheControl1 - type TLPPARSEDISPLAYNAME = uintptr type LPPARSEDISPLAYNAME = TLPPARSEDISPLAYNAME @@ -76526,12 +71898,6 @@ type TIParseDisplayNameVtbl = struct { type IParseDisplayNameVtbl = TIParseDisplayNameVtbl -type TIParseDisplayName1 = struct { - FlpVtbl uintptr -} - -type IParseDisplayName1 = TIParseDisplayName1 - type TLPOLECONTAINER = uintptr type LPOLECONTAINER = TLPOLECONTAINER @@ -76547,12 +71913,6 @@ type TIOleContainerVtbl = struct { type IOleContainerVtbl = TIOleContainerVtbl -type TIOleContainer1 = struct { - FlpVtbl uintptr -} - -type IOleContainer1 = TIOleContainer1 - type TLPOLECLIENTSITE = uintptr type LPOLECLIENTSITE = TLPOLECLIENTSITE @@ -76571,12 +71931,6 @@ type TIOleClientSiteVtbl = struct { type IOleClientSiteVtbl = TIOleClientSiteVtbl -type TIOleClientSite1 = struct { - FlpVtbl uintptr -} - -type IOleClientSite1 = TIOleClientSite1 - type TLPOLEOBJECT = uintptr type LPOLEOBJECT = TLPOLEOBJECT @@ -76680,12 +72034,6 @@ type TIOleObjectVtbl = struct { type IOleObjectVtbl = TIOleObjectVtbl -type TIOleObject1 = struct { - FlpVtbl uintptr -} - -type IOleObject1 = TIOleObject1 - type TOLERENDER = int32 type OLERENDER = TOLERENDER @@ -76761,12 +72109,6 @@ type TIOleWindowVtbl = struct { type IOleWindowVtbl = TIOleWindowVtbl -type TIOleWindow1 = struct { - FlpVtbl uintptr -} - -type IOleWindow1 = TIOleWindow1 - type TLPOLELINK = uintptr type LPOLELINK = TLPOLELINK @@ -76815,12 +72157,6 @@ type TIOleLinkVtbl = struct { type IOleLinkVtbl = TIOleLinkVtbl -type TIOleLink1 = struct { - FlpVtbl uintptr -} - -type IOleLink1 = TIOleLink1 - type TLPOLEITEMCONTAINER = uintptr type LPOLEITEMCONTAINER = TLPOLEITEMCONTAINER @@ -76861,12 +72197,6 @@ type TIOleItemContainerVtbl = struct { type IOleItemContainerVtbl = TIOleItemContainerVtbl -type TIOleItemContainer1 = struct { - FlpVtbl uintptr -} - -type IOleItemContainer1 = TIOleItemContainer1 - type TLPOLEINPLACEUIWINDOW = uintptr type LPOLEINPLACEUIWINDOW = TLPOLEINPLACEUIWINDOW @@ -76902,12 +72232,6 @@ type TIOleInPlaceUIWindowVtbl = struct { type IOleInPlaceUIWindowVtbl = TIOleInPlaceUIWindowVtbl -type TIOleInPlaceUIWindow1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceUIWindow1 = TIOleInPlaceUIWindow1 - type TLPOLEINPLACEACTIVEOBJECT = uintptr type LPOLEINPLACEACTIVEOBJECT = TLPOLEINPLACEACTIVEOBJECT @@ -76927,12 +72251,6 @@ type TIOleInPlaceActiveObjectVtbl = struct { type IOleInPlaceActiveObjectVtbl = TIOleInPlaceActiveObjectVtbl -type TIOleInPlaceActiveObject1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceActiveObject1 = TIOleInPlaceActiveObject1 - type TLPOLEINPLACEFRAME = uintptr type LPOLEINPLACEFRAME = TLPOLEINPLACEFRAME @@ -76993,12 +72311,6 @@ type TIOleInPlaceFrameVtbl = struct { type IOleInPlaceFrameVtbl = TIOleInPlaceFrameVtbl -type TIOleInPlaceFrame1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceFrame1 = TIOleInPlaceFrame1 - type TLPOLEINPLACEOBJECT = uintptr type LPOLEINPLACEOBJECT = TLPOLEINPLACEOBJECT @@ -77017,12 +72329,6 @@ type TIOleInPlaceObjectVtbl = struct { type IOleInPlaceObjectVtbl = TIOleInPlaceObjectVtbl -type TIOleInPlaceObject1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceObject1 = TIOleInPlaceObject1 - type TLPOLEINPLACESITE = uintptr type LPOLEINPLACESITE = TLPOLEINPLACESITE @@ -77047,12 +72353,6 @@ type TIOleInPlaceSiteVtbl = struct { type IOleInPlaceSiteVtbl = TIOleInPlaceSiteVtbl -type TIOleInPlaceSite1 = struct { - FlpVtbl uintptr -} - -type IOleInPlaceSite1 = TIOleInPlaceSite1 - type TIContinueVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -77062,12 +72362,6 @@ type TIContinueVtbl = struct { type IContinueVtbl = TIContinueVtbl -type TIContinue1 = struct { - FlpVtbl uintptr -} - -type IContinue1 = TIContinue1 - type TLPVIEWOBJECT = uintptr type LPVIEWOBJECT = TLPVIEWOBJECT @@ -77086,12 +72380,6 @@ type TIViewObjectVtbl = struct { type IViewObjectVtbl = TIViewObjectVtbl -type TIViewObject1 = struct { - FlpVtbl uintptr -} - -type IViewObject1 = TIViewObject1 - type TLPVIEWOBJECT2 = uintptr type LPVIEWOBJECT2 = TLPVIEWOBJECT2 @@ -77111,12 +72399,6 @@ type TIViewObject2Vtbl = struct { type IViewObject2Vtbl = TIViewObject2Vtbl -type TIViewObject21 = struct { - FlpVtbl uintptr -} - -type IViewObject21 = TIViewObject21 - type TLPDROPSOURCE = uintptr type LPDROPSOURCE = TLPDROPSOURCE @@ -77131,12 +72413,6 @@ type TIDropSourceVtbl = struct { type IDropSourceVtbl = TIDropSourceVtbl -type TIDropSource1 = struct { - FlpVtbl uintptr -} - -type IDropSource1 = TIDropSource1 - type TLPDROPTARGET = uintptr type LPDROPTARGET = TLPDROPTARGET @@ -77153,12 +72429,6 @@ type TIDropTargetVtbl = struct { type IDropTargetVtbl = TIDropTargetVtbl -type TIDropTarget1 = struct { - FlpVtbl uintptr -} - -type IDropTarget1 = TIDropTarget1 - type TIDropSourceNotifyVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -77169,12 +72439,6 @@ type TIDropSourceNotifyVtbl = struct { type IDropSourceNotifyVtbl = TIDropSourceNotifyVtbl -type TIDropSourceNotify1 = struct { - FlpVtbl uintptr -} - -type IDropSourceNotify1 = TIDropSourceNotify1 - type TLPENUMOLEVERB = uintptr type LPENUMOLEVERB = TLPENUMOLEVERB @@ -77217,12 +72481,6 @@ type TIEnumOLEVERBVtbl = struct { type IEnumOLEVERBVtbl = TIEnumOLEVERBVtbl -type TIEnumOLEVERB1 = struct { - FlpVtbl uintptr -} - -type IEnumOLEVERB1 = TIEnumOLEVERB1 - type TIServiceProvider = struct { FlpVtbl uintptr } @@ -77242,12 +72500,6 @@ type TIServiceProviderVtbl = struct { type IServiceProviderVtbl = TIServiceProviderVtbl -type TIServiceProvider1 = struct { - FlpVtbl uintptr -} - -type IServiceProvider1 = TIServiceProvider1 - type TICreateTypeInfo = struct { FlpVtbl uintptr } @@ -78176,12 +73428,6 @@ type TICreateTypeInfoVtbl = struct { type ICreateTypeInfoVtbl = TICreateTypeInfoVtbl -type TICreateTypeInfo1 = struct { - FlpVtbl uintptr -} - -type ICreateTypeInfo1 = TICreateTypeInfo1 - type TLPCREATETYPEINFO2 = uintptr type LPCREATETYPEINFO2 = TLPCREATETYPEINFO2 @@ -78232,12 +73478,6 @@ type TICreateTypeInfo2Vtbl = struct { type ICreateTypeInfo2Vtbl = TICreateTypeInfo2Vtbl -type TICreateTypeInfo21 = struct { - FlpVtbl uintptr -} - -type ICreateTypeInfo21 = TICreateTypeInfo21 - type TLPCREATETYPELIB = uintptr type LPCREATETYPELIB = TLPCREATETYPELIB @@ -78260,12 +73500,6 @@ type TICreateTypeLibVtbl = struct { type ICreateTypeLibVtbl = TICreateTypeLibVtbl -type TICreateTypeLib1 = struct { - FlpVtbl uintptr -} - -type ICreateTypeLib1 = TICreateTypeLib1 - type TLPCREATETYPELIB2 = uintptr type LPCREATETYPELIB2 = TLPCREATETYPELIB2 @@ -78292,12 +73526,6 @@ type TICreateTypeLib2Vtbl = struct { type ICreateTypeLib2Vtbl = TICreateTypeLib2Vtbl -type TICreateTypeLib21 = struct { - FlpVtbl uintptr -} - -type ICreateTypeLib21 = TICreateTypeLib21 - type TLPDISPATCH = uintptr type LPDISPATCH = TLPDISPATCH @@ -78314,12 +73542,6 @@ type TIDispatchVtbl = struct { type IDispatchVtbl = TIDispatchVtbl -type TIDispatch1 = struct { - FlpVtbl uintptr -} - -type IDispatch1 = TIDispatch1 - type TLPENUMVARIANT = uintptr type LPENUMVARIANT = TLPENUMVARIANT @@ -78336,12 +73558,6 @@ type TIEnumVARIANTVtbl = struct { type IEnumVARIANTVtbl = TIEnumVARIANTVtbl -type TIEnumVARIANT1 = struct { - FlpVtbl uintptr -} - -type IEnumVARIANT1 = TIEnumVARIANT1 - type TLPTYPECOMP = uintptr type LPTYPECOMP = TLPTYPECOMP @@ -78385,12 +73601,6 @@ type TITypeCompVtbl = struct { type ITypeCompVtbl = TITypeCompVtbl -type TITypeComp1 = struct { - FlpVtbl uintptr -} - -type ITypeComp1 = TITypeComp1 - type TLPTYPEINFO = uintptr type LPTYPEINFO = TLPTYPEINFO @@ -78422,12 +73632,6 @@ type TITypeInfoVtbl = struct { type ITypeInfoVtbl = TITypeInfoVtbl -type TITypeInfo1 = struct { - FlpVtbl uintptr -} - -type ITypeInfo1 = TITypeInfo1 - type TLPTYPEINFO2 = uintptr type LPTYPEINFO2 = TLPTYPEINFO2 @@ -78474,12 +73678,6 @@ type TITypeInfo2Vtbl = struct { type ITypeInfo2Vtbl = TITypeInfo2Vtbl -type TITypeInfo21 = struct { - FlpVtbl uintptr -} - -type ITypeInfo21 = TITypeInfo21 - type TSYSKIND = int32 type SYSKIND = TSYSKIND @@ -78543,12 +73741,6 @@ type TITypeLibVtbl = struct { type ITypeLibVtbl = TITypeLibVtbl -type TITypeLib1 = struct { - FlpVtbl uintptr -} - -type ITypeLib1 = TITypeLib1 - type TLPTYPELIB2 = uintptr type LPTYPELIB2 = TLPTYPELIB2 @@ -78575,12 +73767,6 @@ type TITypeLib2Vtbl = struct { type ITypeLib2Vtbl = TITypeLib2Vtbl -type TITypeLib21 = struct { - FlpVtbl uintptr -} - -type ITypeLib21 = TITypeLib21 - type TLPTYPECHANGEEVENTS = uintptr type LPTYPECHANGEEVENTS = TLPTYPECHANGEEVENTS @@ -78610,12 +73796,6 @@ type TITypeChangeEventsVtbl = struct { type ITypeChangeEventsVtbl = TITypeChangeEventsVtbl -type TITypeChangeEvents1 = struct { - FlpVtbl uintptr -} - -type ITypeChangeEvents1 = TITypeChangeEvents1 - type TLPERRORINFO = uintptr type LPERRORINFO = TLPERRORINFO @@ -78633,12 +73813,6 @@ type TIErrorInfoVtbl = struct { type IErrorInfoVtbl = TIErrorInfoVtbl -type TIErrorInfo1 = struct { - FlpVtbl uintptr -} - -type IErrorInfo1 = TIErrorInfo1 - type TLPCREATEERRORINFO = uintptr type LPCREATEERRORINFO = TLPCREATEERRORINFO @@ -78656,12 +73830,6 @@ type TICreateErrorInfoVtbl = struct { type ICreateErrorInfoVtbl = TICreateErrorInfoVtbl -type TICreateErrorInfo1 = struct { - FlpVtbl uintptr -} - -type ICreateErrorInfo1 = TICreateErrorInfo1 - type TLPSUPPORTERRORINFO = uintptr type LPSUPPORTERRORINFO = TLPSUPPORTERRORINFO @@ -78675,12 +73843,6 @@ type TISupportErrorInfoVtbl = struct { type ISupportErrorInfoVtbl = TISupportErrorInfoVtbl -type TISupportErrorInfo1 = struct { - FlpVtbl uintptr -} - -type ISupportErrorInfo1 = TISupportErrorInfo1 - type TITypeFactoryVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -78690,12 +73852,6 @@ type TITypeFactoryVtbl = struct { type ITypeFactoryVtbl = TITypeFactoryVtbl -type TITypeFactory1 = struct { - FlpVtbl uintptr -} - -type ITypeFactory1 = TITypeFactory1 - type TITypeMarshalVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -78708,12 +73864,6 @@ type TITypeMarshalVtbl = struct { type ITypeMarshalVtbl = TITypeMarshalVtbl -type TITypeMarshal1 = struct { - FlpVtbl uintptr -} - -type ITypeMarshal1 = TITypeMarshal1 - type TLPRECORDINFO = uintptr type LPRECORDINFO = TLPRECORDINFO @@ -78742,12 +73892,6 @@ type TIRecordInfoVtbl = struct { type IRecordInfoVtbl = TIRecordInfoVtbl -type TIRecordInfo1 = struct { - FlpVtbl uintptr -} - -type IRecordInfo1 = TIRecordInfo1 - type TLPERRORLOG = uintptr type LPERRORLOG = TLPERRORLOG @@ -78761,12 +73905,6 @@ type TIErrorLogVtbl = struct { type IErrorLogVtbl = TIErrorLogVtbl -type TIErrorLog1 = struct { - FlpVtbl uintptr -} - -type IErrorLog1 = TIErrorLog1 - type TLPPROPERTYBAG = uintptr type LPPROPERTYBAG = TLPPROPERTYBAG @@ -78781,12 +73919,6 @@ type TIPropertyBagVtbl = struct { type IPropertyBagVtbl = TIPropertyBagVtbl -type TIPropertyBag1 = struct { - FlpVtbl uintptr -} - -type IPropertyBag1 = TIPropertyBag1 - type TIXMLDOMImplementation = struct { FlpVtbl uintptr } @@ -79025,12 +74157,6 @@ type TIXMLDOMImplementationVtbl = struct { type IXMLDOMImplementationVtbl = TIXMLDOMImplementationVtbl -type TIXMLDOMImplementation1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMImplementation1 = TIXMLDOMImplementation1 - type TIXMLDOMNodeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79079,12 +74205,6 @@ type TIXMLDOMNodeVtbl = struct { type IXMLDOMNodeVtbl = TIXMLDOMNodeVtbl -type TIXMLDOMNode1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNode1 = TIXMLDOMNode1 - type TIXMLDOMDocumentFragmentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79133,12 +74253,6 @@ type TIXMLDOMDocumentFragmentVtbl = struct { type IXMLDOMDocumentFragmentVtbl = TIXMLDOMDocumentFragmentVtbl -type TIXMLDOMDocumentFragment1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMDocumentFragment1 = TIXMLDOMDocumentFragment1 - type TIXMLDOMDocumentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79220,12 +74334,6 @@ type TIXMLDOMDocumentVtbl = struct { type IXMLDOMDocumentVtbl = TIXMLDOMDocumentVtbl -type TIXMLDOMDocument1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMDocument1 = TIXMLDOMDocument1 - type TIXMLDOMNodeListVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79243,12 +74351,6 @@ type TIXMLDOMNodeListVtbl = struct { type IXMLDOMNodeListVtbl = TIXMLDOMNodeListVtbl -type TIXMLDOMNodeList1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNodeList1 = TIXMLDOMNodeList1 - type TIXMLDOMNamedNodeMapVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79271,12 +74373,6 @@ type TIXMLDOMNamedNodeMapVtbl = struct { type IXMLDOMNamedNodeMapVtbl = TIXMLDOMNamedNodeMapVtbl -type TIXMLDOMNamedNodeMap1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNamedNodeMap1 = TIXMLDOMNamedNodeMap1 - type TIXMLDOMCharacterDataVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79333,12 +74429,6 @@ type TIXMLDOMCharacterDataVtbl = struct { type IXMLDOMCharacterDataVtbl = TIXMLDOMCharacterDataVtbl -type TIXMLDOMCharacterData1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMCharacterData1 = TIXMLDOMCharacterData1 - type TIXMLDOMAttributeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79390,12 +74480,6 @@ type TIXMLDOMAttributeVtbl = struct { type IXMLDOMAttributeVtbl = TIXMLDOMAttributeVtbl -type TIXMLDOMAttribute1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMAttribute1 = TIXMLDOMAttribute1 - type TIXMLDOMElementVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79453,12 +74537,6 @@ type TIXMLDOMElementVtbl = struct { type IXMLDOMElementVtbl = TIXMLDOMElementVtbl -type TIXMLDOMElement1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMElement1 = TIXMLDOMElement1 - type TIXMLDOMTextVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79516,12 +74594,6 @@ type TIXMLDOMTextVtbl = struct { type IXMLDOMTextVtbl = TIXMLDOMTextVtbl -type TIXMLDOMText1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMText1 = TIXMLDOMText1 - type TIXMLDOMCommentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79578,12 +74650,6 @@ type TIXMLDOMCommentVtbl = struct { type IXMLDOMCommentVtbl = TIXMLDOMCommentVtbl -type TIXMLDOMComment1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMComment1 = TIXMLDOMComment1 - type TIXMLDOMProcessingInstructionVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79635,12 +74701,6 @@ type TIXMLDOMProcessingInstructionVtbl = struct { type IXMLDOMProcessingInstructionVtbl = TIXMLDOMProcessingInstructionVtbl -type TIXMLDOMProcessingInstruction1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMProcessingInstruction1 = TIXMLDOMProcessingInstruction1 - type TIXMLDOMCDATASectionVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79698,12 +74758,6 @@ type TIXMLDOMCDATASectionVtbl = struct { type IXMLDOMCDATASectionVtbl = TIXMLDOMCDATASectionVtbl -type TIXMLDOMCDATASection1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMCDATASection1 = TIXMLDOMCDATASection1 - type TIXMLDOMDocumentTypeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79755,12 +74809,6 @@ type TIXMLDOMDocumentTypeVtbl = struct { type IXMLDOMDocumentTypeVtbl = TIXMLDOMDocumentTypeVtbl -type TIXMLDOMDocumentType1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMDocumentType1 = TIXMLDOMDocumentType1 - type TIXMLDOMNotationVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79811,12 +74859,6 @@ type TIXMLDOMNotationVtbl = struct { type IXMLDOMNotationVtbl = TIXMLDOMNotationVtbl -type TIXMLDOMNotation1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMNotation1 = TIXMLDOMNotation1 - type TIXMLDOMEntityVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79868,12 +74910,6 @@ type TIXMLDOMEntityVtbl = struct { type IXMLDOMEntityVtbl = TIXMLDOMEntityVtbl -type TIXMLDOMEntity1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMEntity1 = TIXMLDOMEntity1 - type TIXMLDOMEntityReferenceVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79922,12 +74958,6 @@ type TIXMLDOMEntityReferenceVtbl = struct { type IXMLDOMEntityReferenceVtbl = TIXMLDOMEntityReferenceVtbl -type TIXMLDOMEntityReference1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMEntityReference1 = TIXMLDOMEntityReference1 - type TIXMLDOMParseErrorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -79947,12 +74977,6 @@ type TIXMLDOMParseErrorVtbl = struct { type IXMLDOMParseErrorVtbl = TIXMLDOMParseErrorVtbl -type TIXMLDOMParseError1 = struct { - FlpVtbl uintptr -} - -type IXMLDOMParseError1 = TIXMLDOMParseError1 - type TIXTLRuntimeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80010,12 +75034,6 @@ type TIXTLRuntimeVtbl = struct { type IXTLRuntimeVtbl = TIXTLRuntimeVtbl -type TIXTLRuntime1 = struct { - FlpVtbl uintptr -} - -type IXTLRuntime1 = TIXTLRuntime1 - type TXMLDOMDocumentEventsVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80028,12 +75046,6 @@ type TXMLDOMDocumentEventsVtbl = struct { type XMLDOMDocumentEventsVtbl = TXMLDOMDocumentEventsVtbl -type TXMLDOMDocumentEvents1 = struct { - FlpVtbl uintptr -} - -type XMLDOMDocumentEvents1 = TXMLDOMDocumentEvents1 - type TIXMLHttpRequestVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80060,12 +75072,6 @@ type TIXMLHttpRequestVtbl = struct { type IXMLHttpRequestVtbl = TIXMLHttpRequestVtbl -type TIXMLHttpRequest1 = struct { - FlpVtbl uintptr -} - -type IXMLHttpRequest1 = TIXMLHttpRequest1 - type TIXMLDSOControlVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80083,12 +75089,6 @@ type TIXMLDSOControlVtbl = struct { type IXMLDSOControlVtbl = TIXMLDSOControlVtbl -type TIXMLDSOControl1 = struct { - FlpVtbl uintptr -} - -type IXMLDSOControl1 = TIXMLDSOControl1 - type TIXMLElementCollectionVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80105,12 +75105,6 @@ type TIXMLElementCollectionVtbl = struct { type IXMLElementCollectionVtbl = TIXMLElementCollectionVtbl -type TIXMLElementCollection1 = struct { - FlpVtbl uintptr -} - -type IXMLElementCollection1 = TIXMLElementCollection1 - type TIXMLDocumentVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80137,12 +75131,6 @@ type TIXMLDocumentVtbl = struct { type IXMLDocumentVtbl = TIXMLDocumentVtbl -type TIXMLDocument1 = struct { - FlpVtbl uintptr -} - -type IXMLDocument1 = TIXMLDocument1 - type TIXMLDocument2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80171,12 +75159,6 @@ type TIXMLDocument2Vtbl = struct { type IXMLDocument2Vtbl = TIXMLDocument2Vtbl -type TIXMLDocument21 = struct { - FlpVtbl uintptr -} - -type IXMLDocument21 = TIXMLDocument21 - type TIXMLElementVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80201,12 +75183,6 @@ type TIXMLElementVtbl = struct { type IXMLElementVtbl = TIXMLElementVtbl -type TIXMLElement1 = struct { - FlpVtbl uintptr -} - -type IXMLElement1 = TIXMLElement1 - type TIXMLElement2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80232,12 +75208,6 @@ type TIXMLElement2Vtbl = struct { type IXMLElement2Vtbl = TIXMLElement2Vtbl -type TIXMLElement21 = struct { - FlpVtbl uintptr -} - -type IXMLElement21 = TIXMLElement21 - type TIXMLAttributeVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80252,12 +75222,6 @@ type TIXMLAttributeVtbl = struct { type IXMLAttributeVtbl = TIXMLAttributeVtbl -type TIXMLAttribute1 = struct { - FlpVtbl uintptr -} - -type IXMLAttribute1 = TIXMLAttribute1 - type TIXMLErrorVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -80267,12 +75231,6 @@ type TIXMLErrorVtbl = struct { type IXMLErrorVtbl = TIXMLErrorVtbl -type TIXMLError1 = struct { - FlpVtbl uintptr -} - -type IXMLError1 = TIXMLError1 - type TLPPERSISTMONIKER = uintptr type LPPERSISTMONIKER = TLPPERSISTMONIKER @@ -80291,12 +75249,6 @@ type TIPersistMonikerVtbl = struct { type IPersistMonikerVtbl = TIPersistMonikerVtbl -type TIPersistMoniker1 = struct { - FlpVtbl uintptr -} - -type IPersistMoniker1 = TIPersistMoniker1 - type TLPMONIKERPROP = uintptr type LPMONIKERPROP = TLPMONIKERPROP @@ -80322,12 +75274,6 @@ type TIMonikerPropVtbl = struct { type IMonikerPropVtbl = TIMonikerPropVtbl -type TIMonikerProp1 = struct { - FlpVtbl uintptr -} - -type IMonikerProp1 = TIMonikerProp1 - type TLPBINDPROTOCOL = uintptr type LPBINDPROTOCOL = TLPBINDPROTOCOL @@ -80341,12 +75287,6 @@ type TIBindProtocolVtbl = struct { type IBindProtocolVtbl = TIBindProtocolVtbl -type TIBindProtocol1 = struct { - FlpVtbl uintptr -} - -type IBindProtocol1 = TIBindProtocol1 - type TLPBINDING = uintptr type LPBINDING = TLPBINDING @@ -80365,12 +75305,6 @@ type TIBindingVtbl = struct { type IBindingVtbl = TIBindingVtbl -type TIBinding1 = struct { - FlpVtbl uintptr -} - -type IBinding1 = TIBinding1 - type TLPBINDSTATUSCALLBACK = uintptr type LPBINDSTATUSCALLBACK = TLPBINDSTATUSCALLBACK @@ -80654,12 +75588,6 @@ type TIBindStatusCallbackVtbl = struct { type IBindStatusCallbackVtbl = TIBindStatusCallbackVtbl -type TIBindStatusCallback1 = struct { - FlpVtbl uintptr -} - -type IBindStatusCallback1 = TIBindStatusCallback1 - type TLPBINDSTATUSCALLBACKEX = uintptr type LPBINDSTATUSCALLBACKEX = TLPBINDSTATUSCALLBACKEX @@ -80711,12 +75639,6 @@ type TIBindStatusCallbackExVtbl = struct { type IBindStatusCallbackExVtbl = TIBindStatusCallbackExVtbl -type TIBindStatusCallbackEx1 = struct { - FlpVtbl uintptr -} - -type IBindStatusCallbackEx1 = TIBindStatusCallbackEx1 - type TLPAUTHENTICATION = uintptr type LPAUTHENTICATION = TLPAUTHENTICATION @@ -80730,12 +75652,6 @@ type TIAuthenticateVtbl = struct { type IAuthenticateVtbl = TIAuthenticateVtbl -type TIAuthenticate1 = struct { - FlpVtbl uintptr -} - -type IAuthenticate1 = TIAuthenticate1 - type TLPAUTHENTICATIONEX = uintptr type LPAUTHENTICATIONEX = TLPAUTHENTICATIONEX @@ -80771,12 +75687,6 @@ type TIAuthenticateExVtbl = struct { type IAuthenticateExVtbl = TIAuthenticateExVtbl -type TIAuthenticateEx1 = struct { - FlpVtbl uintptr -} - -type IAuthenticateEx1 = TIAuthenticateEx1 - type TLPHTTPNEGOTIATE = uintptr type LPHTTPNEGOTIATE = TLPHTTPNEGOTIATE @@ -80791,12 +75701,6 @@ type TIHttpNegotiateVtbl = struct { type IHttpNegotiateVtbl = TIHttpNegotiateVtbl -type TIHttpNegotiate1 = struct { - FlpVtbl uintptr -} - -type IHttpNegotiate1 = TIHttpNegotiate1 - type TLPHTTPNEGOTIATE2 = uintptr type LPHTTPNEGOTIATE2 = TLPHTTPNEGOTIATE2 @@ -80812,12 +75716,6 @@ type TIHttpNegotiate2Vtbl = struct { type IHttpNegotiate2Vtbl = TIHttpNegotiate2Vtbl -type TIHttpNegotiate21 = struct { - FlpVtbl uintptr -} - -type IHttpNegotiate21 = TIHttpNegotiate21 - type TLPHTTPNEGOTIATE3 = uintptr type LPHTTPNEGOTIATE3 = TLPHTTPNEGOTIATE3 @@ -80834,12 +75732,6 @@ type TIHttpNegotiate3Vtbl = struct { type IHttpNegotiate3Vtbl = TIHttpNegotiate3Vtbl -type TIHttpNegotiate31 = struct { - FlpVtbl uintptr -} - -type IHttpNegotiate31 = TIHttpNegotiate31 - type TLPWININETFILESTREAM = uintptr type LPWININETFILESTREAM = TLPWININETFILESTREAM @@ -80854,12 +75746,6 @@ type TIWinInetFileStreamVtbl = struct { type IWinInetFileStreamVtbl = TIWinInetFileStreamVtbl -type TIWinInetFileStream1 = struct { - FlpVtbl uintptr -} - -type IWinInetFileStream1 = TIWinInetFileStream1 - type TLPWINDOWFORBINDINGUI = uintptr type LPWINDOWFORBINDINGUI = TLPWINDOWFORBINDINGUI @@ -80873,12 +75759,6 @@ type TIWindowForBindingUIVtbl = struct { type IWindowForBindingUIVtbl = TIWindowForBindingUIVtbl -type TIWindowForBindingUI1 = struct { - FlpVtbl uintptr -} - -type IWindowForBindingUI1 = TIWindowForBindingUI1 - type TLPCODEINSTALL = uintptr type LPCODEINSTALL = TLPCODEINSTALL @@ -80910,12 +75790,6 @@ type TICodeInstallVtbl = struct { type ICodeInstallVtbl = TICodeInstallVtbl -type TICodeInstall1 = struct { - FlpVtbl uintptr -} - -type ICodeInstall1 = TICodeInstall1 - type TUri_PROPERTY = int32 type Uri_PROPERTY = TUri_PROPERTY @@ -80991,12 +75865,6 @@ type TIUriVtbl = struct { type IUriVtbl = TIUriVtbl -type TIUri1 = struct { - FlpVtbl uintptr -} - -type IUri1 = TIUri1 - type TIUriContainerVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81006,12 +75874,6 @@ type TIUriContainerVtbl = struct { type IUriContainerVtbl = TIUriContainerVtbl -type TIUriContainer1 = struct { - FlpVtbl uintptr -} - -type IUriContainer1 = TIUriContainer1 - type TIUriBuilderVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81043,12 +75905,6 @@ type TIUriBuilderVtbl = struct { type IUriBuilderVtbl = TIUriBuilderVtbl -type TIUriBuilder1 = struct { - FlpVtbl uintptr -} - -type IUriBuilder1 = TIUriBuilder1 - type TIUriBuilderFactoryVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81059,12 +75915,6 @@ type TIUriBuilderFactoryVtbl = struct { type IUriBuilderFactoryVtbl = TIUriBuilderFactoryVtbl -type TIUriBuilderFactory1 = struct { - FlpVtbl uintptr -} - -type IUriBuilderFactory1 = TIUriBuilderFactory1 - type TLPWININETINFO = uintptr type LPWININETINFO = TLPWININETINFO @@ -81078,12 +75928,6 @@ type TIWinInetInfoVtbl = struct { type IWinInetInfoVtbl = TIWinInetInfoVtbl -type TIWinInetInfo1 = struct { - FlpVtbl uintptr -} - -type IWinInetInfo1 = TIWinInetInfo1 - type TLPHTTPSECURITY = uintptr type LPHTTPSECURITY = TLPHTTPSECURITY @@ -81098,12 +75942,6 @@ type TIHttpSecurityVtbl = struct { type IHttpSecurityVtbl = TIHttpSecurityVtbl -type TIHttpSecurity1 = struct { - FlpVtbl uintptr -} - -type IHttpSecurity1 = TIHttpSecurity1 - type TLPWININETHTTPINFO = uintptr type LPWININETHTTPINFO = TLPWININETHTTPINFO @@ -81118,12 +75956,6 @@ type TIWinInetHttpInfoVtbl = struct { type IWinInetHttpInfoVtbl = TIWinInetHttpInfoVtbl -type TIWinInetHttpInfo1 = struct { - FlpVtbl uintptr -} - -type IWinInetHttpInfo1 = TIWinInetHttpInfo1 - type TIWinInetHttpTimeoutsVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81133,12 +75965,6 @@ type TIWinInetHttpTimeoutsVtbl = struct { type IWinInetHttpTimeoutsVtbl = TIWinInetHttpTimeoutsVtbl -type TIWinInetHttpTimeouts1 = struct { - FlpVtbl uintptr -} - -type IWinInetHttpTimeouts1 = TIWinInetHttpTimeouts1 - type TLPWININETCACHEHINTS = uintptr type LPWININETCACHEHINTS = TLPWININETCACHEHINTS @@ -81152,12 +75978,6 @@ type TIWinInetCacheHintsVtbl = struct { type IWinInetCacheHintsVtbl = TIWinInetCacheHintsVtbl -type TIWinInetCacheHints1 = struct { - FlpVtbl uintptr -} - -type IWinInetCacheHints1 = TIWinInetCacheHints1 - type TLPWININETCACHEHINTS2 = uintptr type LPWININETCACHEHINTS2 = TLPWININETCACHEHINTS2 @@ -81172,12 +75992,6 @@ type TIWinInetCacheHints2Vtbl = struct { type IWinInetCacheHints2Vtbl = TIWinInetCacheHints2Vtbl -type TIWinInetCacheHints21 = struct { - FlpVtbl uintptr -} - -type IWinInetCacheHints21 = TIWinInetCacheHints21 - type TLPBINDHOST = uintptr type LPBINDHOST = TLPBINDHOST @@ -81193,12 +76007,6 @@ type TIBindHostVtbl = struct { type IBindHostVtbl = TIBindHostVtbl -type TIBindHost1 = struct { - FlpVtbl uintptr -} - -type IBindHost1 = TIBindHost1 - type TLPIINTERNET = uintptr type LPIINTERNET = TLPIINTERNET @@ -81211,12 +76019,6 @@ type TIInternetVtbl = struct { type IInternetVtbl = TIInternetVtbl -type TIInternet1 = struct { - FlpVtbl uintptr -} - -type IInternet1 = TIInternet1 - type TLPIINTERNETBINDINFO = uintptr type LPIINTERNETBINDINFO = TLPIINTERNETBINDINFO @@ -81261,12 +76063,6 @@ type TIInternetBindInfoVtbl = struct { type IInternetBindInfoVtbl = TIInternetBindInfoVtbl -type TIInternetBindInfo1 = struct { - FlpVtbl uintptr -} - -type IInternetBindInfo1 = TIInternetBindInfo1 - type TLPIINTERNETBINDINFOEX = uintptr type LPIINTERNETBINDINFOEX = TLPIINTERNETBINDINFOEX @@ -81282,12 +76078,6 @@ type TIInternetBindInfoExVtbl = struct { type IInternetBindInfoExVtbl = TIInternetBindInfoExVtbl -type TIInternetBindInfoEx1 = struct { - FlpVtbl uintptr -} - -type IInternetBindInfoEx1 = TIInternetBindInfoEx1 - type TLPIINTERNETPROTOCOLROOT = uintptr type LPIINTERNETPROTOCOLROOT = TLPIINTERNETPROTOCOLROOT @@ -81353,12 +76143,6 @@ type TIInternetProtocolRootVtbl = struct { type IInternetProtocolRootVtbl = TIInternetProtocolRootVtbl -type TIInternetProtocolRoot1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolRoot1 = TIInternetProtocolRoot1 - type TLPIINTERNETPROTOCOL = uintptr type LPIINTERNETPROTOCOL = TLPIINTERNETPROTOCOL @@ -81381,12 +76165,6 @@ type TIInternetProtocolVtbl = struct { type IInternetProtocolVtbl = TIInternetProtocolVtbl -type TIInternetProtocol1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocol1 = TIInternetProtocol1 - type TIInternetProtocolExVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81406,12 +76184,6 @@ type TIInternetProtocolExVtbl = struct { type IInternetProtocolExVtbl = TIInternetProtocolExVtbl -type TIInternetProtocolEx1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolEx1 = TIInternetProtocolEx1 - type TLPIINTERNETPROTOCOLSINK = uintptr type LPIINTERNETPROTOCOLSINK = TLPIINTERNETPROTOCOLSINK @@ -81428,12 +76200,6 @@ type TIInternetProtocolSinkVtbl = struct { type IInternetProtocolSinkVtbl = TIInternetProtocolSinkVtbl -type TIInternetProtocolSink1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolSink1 = TIInternetProtocolSink1 - type TLPIINTERNETPROTOCOLSINKStackable = uintptr type LPIINTERNETPROTOCOLSINKStackable = TLPIINTERNETPROTOCOLSINKStackable @@ -81449,12 +76215,6 @@ type TIInternetProtocolSinkStackableVtbl = struct { type IInternetProtocolSinkStackableVtbl = TIInternetProtocolSinkStackableVtbl -type TIInternetProtocolSinkStackable1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolSinkStackable1 = TIInternetProtocolSinkStackable1 - type TLPIINTERNETSESSION = uintptr type LPIINTERNETSESSION = TLPIINTERNETSESSION @@ -81483,12 +76243,6 @@ type TIInternetSessionVtbl = struct { type IInternetSessionVtbl = TIInternetSessionVtbl -type TIInternetSession1 = struct { - FlpVtbl uintptr -} - -type IInternetSession1 = TIInternetSession1 - type TLPIINTERNETTHREADSWITCH = uintptr type LPIINTERNETTHREADSWITCH = TLPIINTERNETTHREADSWITCH @@ -81503,12 +76257,6 @@ type TIInternetThreadSwitchVtbl = struct { type IInternetThreadSwitchVtbl = TIInternetThreadSwitchVtbl -type TIInternetThreadSwitch1 = struct { - FlpVtbl uintptr -} - -type IInternetThreadSwitch1 = TIInternetThreadSwitch1 - type TLPIINTERNETPRIORITY = uintptr type LPIINTERNETPRIORITY = TLPIINTERNETPRIORITY @@ -81523,12 +76271,6 @@ type TIInternetPriorityVtbl = struct { type IInternetPriorityVtbl = TIInternetPriorityVtbl -type TIInternetPriority1 = struct { - FlpVtbl uintptr -} - -type IInternetPriority1 = TIInternetPriority1 - type TLPIINTERNETPROTOCOLINFO = uintptr type LPIINTERNETPROTOCOLINFO = TLPIINTERNETPROTOCOLINFO @@ -81603,12 +76345,6 @@ type TIInternetProtocolInfoVtbl = struct { type IInternetProtocolInfoVtbl = TIInternetProtocolInfoVtbl -type TIInternetProtocolInfo1 = struct { - FlpVtbl uintptr -} - -type IInternetProtocolInfo1 = TIInternetProtocolInfo1 - type TINTERNETFEATURELIST = int32 type INTERNETFEATURELIST = TINTERNETFEATURELIST @@ -81655,12 +76391,6 @@ type TIInternetSecurityMgrSiteVtbl = struct { type IInternetSecurityMgrSiteVtbl = TIInternetSecurityMgrSiteVtbl -type TIInternetSecurityMgrSite1 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityMgrSite1 = TIInternetSecurityMgrSite1 - type TPUAF = int32 type PUAF = TPUAF @@ -81723,12 +76453,6 @@ type TIInternetSecurityManagerVtbl = struct { type IInternetSecurityManagerVtbl = TIInternetSecurityManagerVtbl -type TIInternetSecurityManager1 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityManager1 = TIInternetSecurityManager1 - type TIInternetSecurityManagerExVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81746,12 +76470,6 @@ type TIInternetSecurityManagerExVtbl = struct { type IInternetSecurityManagerExVtbl = TIInternetSecurityManagerExVtbl -type TIInternetSecurityManagerEx1 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityManagerEx1 = TIInternetSecurityManagerEx1 - type TIInternetSecurityManagerEx2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81773,12 +76491,6 @@ type TIInternetSecurityManagerEx2Vtbl = struct { type IInternetSecurityManagerEx2Vtbl = TIInternetSecurityManagerEx2Vtbl -type TIInternetSecurityManagerEx21 = struct { - FlpVtbl uintptr -} - -type IInternetSecurityManagerEx21 = TIInternetSecurityManagerEx21 - type TIZoneIdentifierVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81790,12 +76502,6 @@ type TIZoneIdentifierVtbl = struct { type IZoneIdentifierVtbl = TIZoneIdentifierVtbl -type TIZoneIdentifier1 = struct { - FlpVtbl uintptr -} - -type IZoneIdentifier1 = TIZoneIdentifier1 - type TIInternetHostSecurityManagerVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81807,12 +76513,6 @@ type TIInternetHostSecurityManagerVtbl = struct { type IInternetHostSecurityManagerVtbl = TIInternetHostSecurityManagerVtbl -type TIInternetHostSecurityManager1 = struct { - FlpVtbl uintptr -} - -type IInternetHostSecurityManager1 = TIInternetHostSecurityManager1 - type TLPURLZONEMANAGER = uintptr type LPURLZONEMANAGER = TLPURLZONEMANAGER @@ -81921,12 +76621,6 @@ type TIInternetZoneManagerVtbl = struct { type IInternetZoneManagerVtbl = TIInternetZoneManagerVtbl -type TIInternetZoneManager1 = struct { - FlpVtbl uintptr -} - -type IInternetZoneManager1 = TIInternetZoneManager1 - type TIInternetZoneManagerExVtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81949,12 +76643,6 @@ type TIInternetZoneManagerExVtbl = struct { type IInternetZoneManagerExVtbl = TIInternetZoneManagerExVtbl -type TIInternetZoneManagerEx1 = struct { - FlpVtbl uintptr -} - -type IInternetZoneManagerEx1 = TIInternetZoneManagerEx1 - type TIInternetZoneManagerEx2Vtbl = struct { FQueryInterface uintptr FAddRef uintptr @@ -81981,12 +76669,6 @@ type TIInternetZoneManagerEx2Vtbl = struct { type IInternetZoneManagerEx2Vtbl = TIInternetZoneManagerEx2Vtbl -type TIInternetZoneManagerEx21 = struct { - FlpVtbl uintptr -} - -type IInternetZoneManagerEx21 = TIInternetZoneManagerEx21 - type TCODEBASEHOLD = struct { FcbSize TULONG FszDistUnit TLPWSTR @@ -82044,12 +76726,6 @@ type TISoftDistExtVtbl = struct { type ISoftDistExtVtbl = TISoftDistExtVtbl -type TISoftDistExt1 = struct { - FlpVtbl uintptr -} - -type ISoftDistExt1 = TISoftDistExt1 - type TLPCATALOGFILEINFO = uintptr type LPCATALOGFILEINFO = TLPCATALOGFILEINFO @@ -82064,12 +76740,6 @@ type TICatalogFileInfoVtbl = struct { type ICatalogFileInfoVtbl = TICatalogFileInfoVtbl -type TICatalogFileInfo1 = struct { - FlpVtbl uintptr -} - -type ICatalogFileInfo1 = TICatalogFileInfo1 - type TLPDATAFILTER = uintptr type LPDATAFILTER = TLPDATAFILTER @@ -82085,12 +76755,6 @@ type TIDataFilterVtbl = struct { type IDataFilterVtbl = TIDataFilterVtbl -type TIDataFilter1 = struct { - FlpVtbl uintptr -} - -type IDataFilter1 = TIDataFilter1 - type TPROTOCOLFILTERDATA = struct { FcbSize TDWORD FpProtocolSink uintptr @@ -82132,12 +76796,6 @@ type TIEncodingFilterFactoryVtbl = struct { type IEncodingFilterFactoryVtbl = TIEncodingFilterFactoryVtbl -type TIEncodingFilterFactory1 = struct { - FlpVtbl uintptr -} - -type IEncodingFilterFactory1 = TIEncodingFilterFactory1 - type THIT_LOGGING_INFO = struct { FdwStructSize TDWORD FlpszLoggedUrlName TLPSTR @@ -82177,12 +76835,6 @@ type TIWrappedProtocolVtbl = struct { type IWrappedProtocolVtbl = TIWrappedProtocolVtbl -type TIWrappedProtocol1 = struct { - FlpVtbl uintptr -} - -type IWrappedProtocol1 = TIWrappedProtocol1 - type TLPGETBINDHANDLE = uintptr type LPGETBINDHANDLE = TLPGETBINDHANDLE @@ -82206,12 +76858,6 @@ type TIGetBindHandleVtbl = struct { type IGetBindHandleVtbl = TIGetBindHandleVtbl -type TIGetBindHandle1 = struct { - FlpVtbl uintptr -} - -type IGetBindHandle1 = TIGetBindHandle1 - type TPROTOCOL_ARGUMENT = struct { FszMethod TLPCWSTR FszTargetUrl TLPCWSTR @@ -82240,12 +76886,6 @@ type TIBindCallbackRedirectVtbl = struct { type IBindCallbackRedirectVtbl = TIBindCallbackRedirectVtbl -type TIBindCallbackRedirect1 = struct { - FlpVtbl uintptr -} - -type IBindCallbackRedirect1 = TIBindCallbackRedirect1 - type TIPropertyStorage = struct { FlpVtbl uintptr } @@ -82618,12 +77258,6 @@ type TIPropertyStorageVtbl = struct { type IPropertyStorageVtbl = TIPropertyStorageVtbl -type TIPropertyStorage1 = struct { - FlpVtbl uintptr -} - -type IPropertyStorage1 = TIPropertyStorage1 - type TLPPROPERTYSETSTORAGE = uintptr type LPPROPERTYSETSTORAGE = TLPPROPERTYSETSTORAGE @@ -82640,12 +77274,6 @@ type TIPropertySetStorageVtbl = struct { type IPropertySetStorageVtbl = TIPropertySetStorageVtbl -type TIPropertySetStorage1 = struct { - FlpVtbl uintptr -} - -type IPropertySetStorage1 = TIPropertySetStorage1 - type TLPENUMSTATPROPSTG = uintptr type LPENUMSTATPROPSTG = TLPENUMSTATPROPSTG @@ -82662,12 +77290,6 @@ type TIEnumSTATPROPSTGVtbl = struct { type IEnumSTATPROPSTGVtbl = TIEnumSTATPROPSTGVtbl -type TIEnumSTATPROPSTG1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATPROPSTG1 = TIEnumSTATPROPSTG1 - type TLPENUMSTATPROPSETSTG = uintptr type LPENUMSTATPROPSETSTG = TLPENUMSTATPROPSETSTG @@ -82684,12 +77306,6 @@ type TIEnumSTATPROPSETSTGVtbl = struct { type IEnumSTATPROPSETSTGVtbl = TIEnumSTATPROPSETSTGVtbl -type TIEnumSTATPROPSETSTG1 = struct { - FlpVtbl uintptr -} - -type IEnumSTATPROPSETSTG1 = TIEnumSTATPROPSETSTG1 - type TLPPROPERTYSTORAGE = uintptr type LPPROPERTYSTORAGE = TLPPROPERTYSTORAGE @@ -83103,16 +77719,6 @@ type TPSTORAGE_BREAK_RESERVATION_REQUEST = uintptr type PSTORAGE_BREAK_RESERVATION_REQUEST = TPSTORAGE_BREAK_RESERVATION_REQUEST -type TSTORAGE_BREAK_RESERVATION_REQUEST1 = struct { - FLength TDWORD - F_unused TBYTE - FPathId TBYTE - FTargetId TBYTE - FLun TBYTE -} - -type STORAGE_BREAK_RESERVATION_REQUEST1 = TSTORAGE_BREAK_RESERVATION_REQUEST1 - type TPREVENT_MEDIA_REMOVAL = struct { FPreventMediaRemoval TBOOLEAN } @@ -84733,20 +79339,6 @@ type TPRETRIEVAL_POINTERS_BUFFER = uintptr type PRETRIEVAL_POINTERS_BUFFER = TPRETRIEVAL_POINTERS_BUFFER -type TRETRIEVAL_POINTERS_BUFFER1 = struct { - F__ccgo_align [0]uint32 - FExtentCount TDWORD - F__ccgo_align1 [4]byte - FStartingVcn TLARGE_INTEGER - FExtents [1]struct { - F__ccgo_align [0]uint32 - FNextVcn TLARGE_INTEGER - FLcn TLARGE_INTEGER - } -} - -type RETRIEVAL_POINTERS_BUFFER1 = TRETRIEVAL_POINTERS_BUFFER1 - type TNTFS_FILE_RECORD_INPUT_BUFFER = struct { F__ccgo_align [0]uint32 FFileReferenceNumber TLARGE_INTEGER @@ -91244,17 +85836,6 @@ type TIPrintDialogCallbackVtbl = struct { type IPrintDialogCallbackVtbl = TIPrintDialogCallbackVtbl -type TIPrintDialogCallbackVtbl1 = struct { - FQueryInterface uintptr - FAddRef uintptr - FRelease uintptr - FInitDone uintptr - FSelectionChange uintptr - FHandleMessage uintptr -} - -type IPrintDialogCallbackVtbl1 = TIPrintDialogCallbackVtbl1 - type TIPrintDialogServices = struct { FlpVtbl uintptr } @@ -91272,17 +85853,6 @@ type TIPrintDialogServicesVtbl = struct { type IPrintDialogServicesVtbl = TIPrintDialogServicesVtbl -type TIPrintDialogServicesVtbl1 = struct { - FQueryInterface uintptr - FAddRef uintptr - FRelease uintptr - FGetCurrentDevMode uintptr - FGetCurrentPrinterName uintptr - FGetCurrentPortName uintptr -} - -type IPrintDialogServicesVtbl1 = TIPrintDialogServicesVtbl1 - type TPRINTPAGERANGE = struct { FnFromPage TDWORD FnToPage TDWORD @@ -92641,293 +87211,6 @@ type REGISTERWORDENUMPROCW = TREGISTERWORDENUMPROCW ** on a Win32 system. */ -/* -** Each recursive mutex is an instance of the following structure. - */ -type Tsqlite3_mutex1 = struct { - Fmutex TCRITICAL_SECTION - Fid int32 -} - -type sqlite3_mutex1 = Tsqlite3_mutex1 - -/* -** These are the initializer values used when declaring a "static" mutex -** on Win32. It should be noted that all mutexes require initialization -** on the Win32 platform. - */ - -// C documentation -// -// /* -// ** Try to provide a memory barrier operation, needed for initialization -// ** and also for the xShmBarrier method of the VFS in cases when SQLite is -// ** compiled without mutexes (SQLITE_THREADSAFE=0). -// */ -func _sqlite3MemoryBarrier(tls *libc.TLS) { - libc.X__sync_synchronize(tls) -} - -// C documentation -// -// /* -// ** Initialize and deinitialize the mutex subsystem. -// */ -var _winMutex_staticMutexes = [12]Tsqlite3_mutex{ - 0: { - Fid: int32(2), - }, - 1: { - Fid: int32(3), - }, - 2: { - Fid: int32(4), - }, - 3: { - Fid: int32(5), - }, - 4: { - Fid: int32(6), - }, - 5: { - Fid: int32(7), - }, - 6: { - Fid: int32(8), - }, - 7: { - Fid: int32(9), - }, - 8: { - Fid: int32(10), - }, - 9: { - Fid: int32(11), - }, - 10: { - Fid: int32(12), - }, - 11: { - Fid: int32(13), - }, -} - -var _winMutex_isInit = int32(0) -var _winMutex_isNt = -int32(1) - -// C documentation -// -// /* As the winMutexInit() and winMutexEnd() functions are called as part -// ** of the sqlite3_initialize() and sqlite3_shutdown() processing, the -// ** "interlocked" magic used here is probably not strictly necessary. -// */ -var _winMutex_lock = int32(0) - -func _winMutexInit(tls *libc.TLS) (r int32) { - var i int32 - _ = i - /* The first to increment to 1 does actual initialization */ - if libc.X_InterlockedCompareExchange(tls, uintptr(unsafe.Pointer(&_winMutex_lock)), int32(1), 0) == 0 { - i = 0 - for { - if !(i < int32(libc.Uint32FromInt64(336)/libc.Uint32FromInt64(28))) { - break - } - libc.XInitializeCriticalSection(tls, uintptr(unsafe.Pointer(&_winMutex_staticMutexes))+uintptr(i)*28) - goto _1 - _1: - ; - i++ - } - _winMutex_isInit = int32(1) - } else { - /* Another thread is (in the process of) initializing the static - ** mutexes */ - for !(_winMutex_isInit != 0) { - Xsqlite3_win32_sleep(tls, uint32(1)) - } - } - return SQLITE_OK -} - -func _winMutexEnd(tls *libc.TLS) (r int32) { - var i int32 - _ = i - /* The first to decrement to 0 does actual shutdown - ** (which should be the last to shutdown.) */ - if libc.X_InterlockedCompareExchange(tls, uintptr(unsafe.Pointer(&_winMutex_lock)), 0, int32(1)) == int32(1) { - if _winMutex_isInit == int32(1) { - i = 0 - for { - if !(i < int32(libc.Uint32FromInt64(336)/libc.Uint32FromInt64(28))) { - break - } - libc.XDeleteCriticalSection(tls, uintptr(unsafe.Pointer(&_winMutex_staticMutexes))+uintptr(i)*28) - goto _1 - _1: - ; - i++ - } - _winMutex_isInit = 0 - } - } - return SQLITE_OK -} - -// C documentation -// -// /* -// ** The sqlite3_mutex_alloc() routine allocates a new -// ** mutex and returns a pointer to it. If it returns NULL -// ** that means that a mutex could not be allocated. SQLite -// ** will unwind its stack and return an error. The argument -// ** to sqlite3_mutex_alloc() is one of these integer constants: -// ** -// **
      -// **
    • SQLITE_MUTEX_FAST -// **
    • SQLITE_MUTEX_RECURSIVE -// **
    • SQLITE_MUTEX_STATIC_MAIN -// **
    • SQLITE_MUTEX_STATIC_MEM -// **
    • SQLITE_MUTEX_STATIC_OPEN -// **
    • SQLITE_MUTEX_STATIC_PRNG -// **
    • SQLITE_MUTEX_STATIC_LRU -// **
    • SQLITE_MUTEX_STATIC_PMEM -// **
    • SQLITE_MUTEX_STATIC_APP1 -// **
    • SQLITE_MUTEX_STATIC_APP2 -// **
    • SQLITE_MUTEX_STATIC_APP3 -// **
    • SQLITE_MUTEX_STATIC_VFS1 -// **
    • SQLITE_MUTEX_STATIC_VFS2 -// **
    • SQLITE_MUTEX_STATIC_VFS3 -// **
    -// ** -// ** The first two constants cause sqlite3_mutex_alloc() to create -// ** a new mutex. The new mutex is recursive when SQLITE_MUTEX_RECURSIVE -// ** is used but not necessarily so when SQLITE_MUTEX_FAST is used. -// ** The mutex implementation does not need to make a distinction -// ** between SQLITE_MUTEX_RECURSIVE and SQLITE_MUTEX_FAST if it does -// ** not want to. But SQLite will only request a recursive mutex in -// ** cases where it really needs one. If a faster non-recursive mutex -// ** implementation is available on the host platform, the mutex subsystem -// ** might return such a mutex in response to SQLITE_MUTEX_FAST. -// ** -// ** The other allowed parameters to sqlite3_mutex_alloc() each return -// ** a pointer to a static preexisting mutex. Six static mutexes are -// ** used by the current version of SQLite. Future versions of SQLite -// ** may add additional static mutexes. Static mutexes are for internal -// ** use by SQLite only. Applications that use SQLite mutexes should -// ** use only the dynamic mutexes returned by SQLITE_MUTEX_FAST or -// ** SQLITE_MUTEX_RECURSIVE. -// ** -// ** Note that if one of the dynamic mutex parameters (SQLITE_MUTEX_FAST -// ** or SQLITE_MUTEX_RECURSIVE) is used then sqlite3_mutex_alloc() -// ** returns a different mutex on every call. But for the static -// ** mutex types, the same mutex is returned on every call that has -// ** the same type number. -// */ -func _winMutexAlloc(tls *libc.TLS, iType int32) (r uintptr) { - var p uintptr - _ = p - switch iType { - case SQLITE_MUTEX_FAST: - fallthrough - case int32(SQLITE_MUTEX_RECURSIVE): - p = _sqlite3MallocZero(tls, uint64(28)) - if p != 0 { - (*Tsqlite3_mutex)(unsafe.Pointer(p)).Fid = iType - libc.XInitializeCriticalSection(tls, p) - } - default: - p = uintptr(unsafe.Pointer(&_winMutex_staticMutexes)) + uintptr(iType-int32(2))*28 - break - } - return p -} - -// C documentation -// -// /* -// ** This routine deallocates a previously -// ** allocated mutex. SQLite is careful to deallocate every -// ** mutex that it allocates. -// */ -func _winMutexFree(tls *libc.TLS, p uintptr) { - if (*Tsqlite3_mutex)(unsafe.Pointer(p)).Fid == SQLITE_MUTEX_FAST || (*Tsqlite3_mutex)(unsafe.Pointer(p)).Fid == int32(SQLITE_MUTEX_RECURSIVE) { - libc.XDeleteCriticalSection(tls, p) - Xsqlite3_free(tls, p) - } else { - } -} - -// C documentation -// -// /* -// ** The sqlite3_mutex_enter() and sqlite3_mutex_try() routines attempt -// ** to enter a mutex. If another thread is already within the mutex, -// ** sqlite3_mutex_enter() will block and sqlite3_mutex_try() will return -// ** SQLITE_BUSY. The sqlite3_mutex_try() interface returns SQLITE_OK -// ** upon successful entry. Mutexes created using SQLITE_MUTEX_RECURSIVE can -// ** be entered multiple times by the same thread. In such cases the, -// ** mutex must be exited an equal number of times before another thread -// ** can enter. If the same thread tries to enter any other kind of mutex -// ** more than once, the behavior is undefined. -// */ -func _winMutexEnter(tls *libc.TLS, p uintptr) { - libc.XEnterCriticalSection(tls, p) -} - -func _winMutexTry(tls *libc.TLS, p uintptr) (r int32) { - var rc int32 - _ = rc - rc = int32(SQLITE_BUSY) - /* - ** The sqlite3_mutex_try() routine is very rarely used, and when it - ** is used it is merely an optimization. So it is OK for it to always - ** fail. - ** - ** The TryEnterCriticalSection() interface is only available on WinNT. - ** And some windows compilers complain if you try to use it without - ** first doing some #defines that prevent SQLite from building on Win98. - ** For that reason, we will omit this optimization for now. See - ** ticket #2685. - */ - if _winMutex_isNt < 0 { - _winMutex_isNt = Xsqlite3_win32_is_nt(tls) - } - if _winMutex_isNt != 0 && libc.XTryEnterCriticalSection(tls, p) != 0 { - rc = SQLITE_OK - } - return rc -} - -// C documentation -// -// /* -// ** The sqlite3_mutex_leave() routine exits a mutex that was -// ** previously entered by the same thread. The behavior -// ** is undefined if the mutex is not currently entered or -// ** is not currently allocated. SQLite will never do either. -// */ -func _winMutexLeave(tls *libc.TLS, p uintptr) { - libc.XLeaveCriticalSection(tls, p) -} - -func _sqlite3DefaultMutex(tls *libc.TLS) (r uintptr) { - return uintptr(unsafe.Pointer(&_sMutex1)) -} - -var _sMutex1 = Tsqlite3_mutex_methods{} - -func init() { - p := unsafe.Pointer(&_sMutex1) - *(*uintptr)(unsafe.Add(p, 0)) = __ccgo_fp(_winMutexInit) - *(*uintptr)(unsafe.Add(p, 4)) = __ccgo_fp(_winMutexEnd) - *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_winMutexAlloc) - *(*uintptr)(unsafe.Add(p, 12)) = __ccgo_fp(_winMutexFree) - *(*uintptr)(unsafe.Add(p, 16)) = __ccgo_fp(_winMutexEnter) - *(*uintptr)(unsafe.Add(p, 20)) = __ccgo_fp(_winMutexTry) - *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_winMutexLeave) -} - /************** End of mutex_w32.c *******************************************/ /************** Begin file malloc.c ******************************************/ /* @@ -92999,6 +87282,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { return _mem0.Fmutex } +type t__ccgo_fp__Xsqlite3_memory_alarm_0 = func(*libc.TLS, uintptr, int64, int32) + // C documentation // // /* @@ -93006,8 +87291,8 @@ func _sqlite3MallocMutex(tls *libc.TLS) (r uintptr) { // ** that was invoked when memory usage grew too large. Now it is a // ** no-op. // */ -func Xsqlite3_memory_alarm(tls *libc.TLS, xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { - _ = xCallback +func Xsqlite3_memory_alarm(tls *libc.TLS, __ccgo_fp_xCallback uintptr, pArg uintptr, iThreshold Tsqlite3_int64) (r int32) { + _ = __ccgo_fp_xCallback _ = pArg _ = iThreshold return SQLITE_OK @@ -93826,7 +88111,7 @@ func _sqlite3OomFault(tls *libc.TLS, db uintptr) (r uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) if (*Tsqlite3)(unsafe.Pointer(db)).FpParse != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1644, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) pParse = (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).FpOuterParse for { @@ -93994,17 +88279,17 @@ var _fmtinfo = [23]Tet_info{ 4: { Ffmttype: int8('q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE), + Ftype1: uint8(etESCAPE_q), }, 5: { Ffmttype: int8('Q'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE2), + Ftype1: uint8(etESCAPE_Q), }, 6: { Ffmttype: int8('w'), Fflags: uint8(4), - Ftype1: uint8(etSQLESCAPE3), + Ftype1: uint8(etESCAPE_w), }, 7: { Ffmttype: int8('c'), @@ -94201,22 +88486,23 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bp := tls.Alloc(128) defer tls.Free(128) var bArgList, base Tu8 - var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v98, p92 uintptr - var c, e2, exp, i, iRound, idx, ii, isnull, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v110, v111, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96, v97 int32 + var bufpt, cset, escarg, infop, pArgList, pExpr, pItem, pSel, pToken, pre, z, zExtra, zOut, v103, v11, v14, v15, v17, v20, v21, v23, v24, v4, v45, v46, v47, v48, v49, v52, v55, v57, v59, v61, v62, v64, v67, v68, v70, v72, v75, v76, v77, v78, v79, v80, v81, v82, v83, v89, v91, v94, v97, p92 uintptr + var c, e2, exp, i, iRound, idx, ii, ix, j, length, nOut, nPad, needQuote, nn, precision, width, x, v10, v114, v122, v123, v16, v18, v19, v2, v22, v3, v51, v56, v58, v60, v65, v66, v71, v73, v74, v85, v86, v87, v88, v90, v93, v96 int32 var cThousand, done, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, xtype, v5, v6, v7, v8, v9 TetByte var ch, px, wx uint32 - var ch1, prefix, q, x1, v101, v107, v54 int8 - var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v100, v104, v106, v108, v109 Ti64 + var ch1, prefix, q, x1, v100, v107, v118, v54 int8 + var i1, j1, k, n1, nCopyBytes, nPrior, szBufNeeded, v, v104, v106, v108, v109, v110, v111, v112, v113, v115, v117, v119, v120, v121, v99 Ti64 var longvalue Tsqlite_uint64 var n Tu64 + var nBack, nCtrl Tu32 var realvalue float64 - var v102, v12 bool + var v101, v12 bool var _ /* buf at bp+0 */ [70]int8 var _ /* s at bp+72 */ TFpDecode - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, isnull, ix, j, j1, k, length, longvalue, n, n1, nCopyBytes, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v102, v103, v104, v106, v107, v108, v109, v11, v110, v111, v12, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v98, p92 /* Thousands separator for %d and %u */ - xtype = uint8(etINVALID) /* Size of the rendering buffer */ - zExtra = uintptr(0) /* True if trailing zeros should be removed */ - pArgList = uintptr(0) /* Conversion buffer */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bArgList, base, bufpt, c, cThousand, ch, ch1, cset, done, e2, escarg, exp, flag_alternateform, flag_altform2, flag_dp, flag_leftjustify, flag_long, flag_prefix, flag_rtz, flag_zeropad, i, i1, iRound, idx, ii, infop, ix, j, j1, k, length, longvalue, n, n1, nBack, nCopyBytes, nCtrl, nOut, nPad, nPrior, needQuote, nn, pArgList, pExpr, pItem, pSel, pToken, pre, precision, prefix, px, q, realvalue, szBufNeeded, v, width, wx, x, x1, xtype, z, zExtra, zOut, v10, v100, v101, v103, v104, v106, v107, v108, v109, v11, v110, v111, v112, v113, v114, v115, v117, v118, v119, v12, v120, v121, v122, v123, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v3, v4, v45, v46, v47, v48, v49, v5, v51, v52, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v64, v65, v66, v67, v68, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v83, v85, v86, v87, v88, v89, v9, v90, v91, v93, v94, v96, v97, v99, p92 /* Thousands separator for %d and %u */ + xtype = uint8(etINVALID) /* Size of the rendering buffer */ + zExtra = uintptr(0) /* True if trailing zeros should be removed */ + pArgList = uintptr(0) /* Conversion buffer */ /* pAccum never starts out with an empty buffer that was obtained from ** malloc(). This precondition is required by the mprintf("%z...") ** optimization. */ @@ -94248,7 +88534,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li v3 = int32(*(*int8)(unsafe.Pointer(v4))) c = v3 if v3 == 0 { - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1657, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1658, int32(1)) break } /* Find out what flags are present */ @@ -94465,11 +88751,11 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li goto _36 case int32(etSTRING): goto _37 - case int32(etSQLESCAPE3): + case int32(etESCAPE_w): goto _38 - case int32(etSQLESCAPE2): + case int32(etESCAPE_Q): goto _39 - case int32(etSQLESCAPE): + case int32(etESCAPE_q): goto _40 case int32(etTOKEN): goto _41 @@ -94663,9 +88949,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial != 0 { if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).FisSpecial) == int32(2) { if flag_zeropad != 0 { - v57 = __ccgo_ts + 1659 + v57 = __ccgo_ts + 1660 } else { - v57 = __ccgo_ts + 1664 + v57 = __ccgo_ts + 1665 } bufpt = v57 length = _sqlite3Strlen30(tls, bufpt) @@ -94676,7 +88962,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li (*(*TFpDecode)(unsafe.Pointer(bp + 72))).FiDP = int32(1000) (*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fn = int32(1) } else { - libc.Xmemcpy(tls, bp, __ccgo_ts+1668, uint32(5)) + libc.Xmemcpy(tls, bp, __ccgo_ts+1669, uint32(5)) bufpt = bp if int32((*(*TFpDecode)(unsafe.Pointer(bp + 72))).Fsign) == int32('-') { /* no-op */ @@ -94946,29 +89232,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } } else { ch = libc.VaUint32(&ap) - if ch < uint32(0x00080) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(ch & uint32(0xff)) - length = int32(1) - } else { - if ch < uint32(0x00800) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xc0) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(2) - } else { - if ch < uint32(0x10000) { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xe0) + int32(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(3) - } else { - (*(*[70]int8)(unsafe.Pointer(bp)))[0] = int8(int32(0xf0) + int32(uint8(ch>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(1)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(2)] = int8(int32(0x80) + int32(uint8(ch>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) - (*(*[70]int8)(unsafe.Pointer(bp)))[int32(3)] = int8(int32(0x80) + int32(uint8(ch&libc.Uint32FromInt32(0x3f)))) - length = int32(4) - } - } - } + length = _sqlite3AppendOneUtf8Character(tls, bp, ch) } if precision > int32(1) { nPrior = int64(1) @@ -95009,7 +89273,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li bufpt = libc.VaUintptr(&ap) } if bufpt == uintptr(0) { - bufpt = __ccgo_ts + 1673 + bufpt = __ccgo_ts + 1674 } else { if int32(xtype) == int32(etDYNSTRING) { if (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FnChar == uint32(0) && (*Tsqlite3_str)(unsafe.Pointer(pAccum)).FmxAlloc != 0 && width == 0 && precision < 0 && int32((*Tsqlite3_str)(unsafe.Pointer(pAccum)).FaccError) == 0 { @@ -95083,25 +89347,29 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ; /* %Q: Escape ' and enclose in '...' */ _38: ; - if int32(xtype) == int32(etSQLESCAPE3) { - v97 = int32('"') - } else { - v97 = int32('\'') - } - q = int8(v97) + needQuote = 0 if bArgList != 0 { escarg = _getTextArg(tls, pArgList) } else { escarg = libc.VaUintptr(&ap) } - isnull = libc.BoolInt32(escarg == uintptr(0)) - if isnull != 0 { - if int32(xtype) == int32(etSQLESCAPE2) { - v98 = __ccgo_ts + 1674 + if escarg == uintptr(0) { + if int32(xtype) == int32(etESCAPE_Q) { + v97 = __ccgo_ts + 1675 } else { - v98 = __ccgo_ts + 1679 + v97 = __ccgo_ts + 1680 + } + escarg = v97 + } else { + if int32(xtype) == int32(etESCAPE_Q) { + needQuote = int32(1) } - escarg = v98 + } + if int32(xtype) == int32(etESCAPE_w) { + q = int8('"') + flag_alternateform = uint8(0) + } else { + q = int8('\'') } /* For %q, %Q, and %w, the precision is the number of bytes (or ** characters if the ! flags is present) to use from the input. @@ -95109,15 +89377,15 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li ** of output characters may be larger than the precision. */ k = int64(precision) - v100 = libc.Int64FromInt32(0) - n1 = v100 - i1 = v100 + v99 = libc.Int64FromInt32(0) + n1 = v99 + i1 = v99 for { - if v102 = k != 0; v102 { - v101 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v101 + if v101 = k != 0; v101 { + v100 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v100 } - if !(v102 && int32(v101) != 0) { + if !(v101 && int32(v100) != 0) { break } if int32(ch1) == int32(q) { @@ -95128,13 +89396,46 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li i1++ } } - goto _99 - _99: + goto _98 + _98: ; i1++ k-- } - needQuote = libc.BoolInt32(!(isnull != 0) && int32(xtype) == int32(etSQLESCAPE2)) + if flag_alternateform != 0 { + /* For %#q, do unistr()-style backslash escapes for + ** all control characters, and for backslash itself. + ** For %#Q, do the same but only if there is at least + ** one control character. */ + nBack = uint32(0) + nCtrl = uint32(0) + k = 0 + for { + if !(k < i1) { + break + } + if int32(*(*int8)(unsafe.Pointer(escarg + uintptr(k)))) == int32('\\') { + nBack++ + } else { + if int32(*(*Tu8)(unsafe.Pointer(escarg + uintptr(k)))) <= int32(0x1f) { + nCtrl++ + } + } + goto _102 + _102: + ; + k++ + } + if nCtrl != 0 || int32(xtype) == int32(etESCAPE_q) { + n1 += int64(nBack + uint32(5)*nCtrl) + if int32(xtype) == int32(etESCAPE_Q) { + n1 += int64(10) + needQuote = int32(2) + } + } else { + flag_alternateform = uint8(0) + } + } n1 += i1 + int64(3) if n1 > int64(SQLITE_PRINT_BUF_SIZE) { v103 = _printfTempBuf(tls, pAccum, n1) @@ -95148,35 +89449,98 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li } j1 = 0 if needQuote != 0 { - v104 = j1 - j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = q + if needQuote == int32(2) { + libc.Xmemcpy(tls, bufpt+uintptr(j1), __ccgo_ts+1687, uint32(8)) + j1 += int64(8) + } else { + v104 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v104))) = int8('\'') + } } k = i1 - i1 = 0 - for { - if !(i1 < k) { - break + if flag_alternateform != 0 { + i1 = 0 + for { + if !(i1 < k) { + break + } + v106 = j1 + j1++ + v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v107 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 + if int32(ch1) == int32(q) { + v108 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + } else { + if int32(ch1) == int32('\\') { + v109 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = int8('\\') + } else { + if int32(uint8(ch1)) <= int32(0x1f) { + *(*int8)(unsafe.Pointer(bufpt + uintptr(j1-int64(1)))) = int8('\\') + v110 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v110))) = int8('u') + v111 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v111))) = int8('0') + v112 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v112))) = int8('0') + v113 = j1 + j1++ + if int32(ch1) >= int32(0x10) { + v114 = int32('1') + } else { + v114 = int32('0') + } + *(*int8)(unsafe.Pointer(bufpt + uintptr(v113))) = int8(v114) + v115 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v115))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1696 + uintptr(int32(ch1)&int32(0xf)))) + } + } + } + goto _105 + _105: + ; + i1++ } - v106 = j1 - j1++ - v107 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) - ch1 = v107 - *(*int8)(unsafe.Pointer(bufpt + uintptr(v106))) = v107 - if int32(ch1) == int32(q) { - v108 = j1 + } else { + i1 = 0 + for { + if !(i1 < k) { + break + } + v117 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v108))) = ch1 + v118 = *(*int8)(unsafe.Pointer(escarg + uintptr(i1))) + ch1 = v118 + *(*int8)(unsafe.Pointer(bufpt + uintptr(v117))) = v118 + if int32(ch1) == int32(q) { + v119 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v119))) = ch1 + } + goto _116 + _116: + ; + i1++ } - goto _105 - _105: - ; - i1++ } if needQuote != 0 { - v109 = j1 + v120 = j1 j1++ - *(*int8)(unsafe.Pointer(bufpt + uintptr(v109))) = q + *(*int8)(unsafe.Pointer(bufpt + uintptr(v120))) = int8('\'') + if needQuote == int32(2) { + v121 = j1 + j1++ + *(*int8)(unsafe.Pointer(bufpt + uintptr(v121))) = int8(')') + } } *(*int8)(unsafe.Pointer(bufpt + uintptr(j1))) = 0 length = int32(j1) @@ -95201,9 +89565,9 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li _sqlite3RecordErrorByteOffset(tls, (*Tsqlite3_str)(unsafe.Pointer(pAccum)).Fdb, (*TToken)(unsafe.Pointer(pToken)).Fz) } } - v110 = libc.Int32FromInt32(0) - width = v110 - length = v110 + v122 = libc.Int32FromInt32(0) + width = v122 + length = v122 goto _44 _42: ; @@ -95217,7 +89581,7 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if (*TSrcItem)(unsafe.Pointer(pItem)).FzName != 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x10000>>16) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 44)) != uintptr(0) { Xsqlite3_str_appendall(tls, pAccum, *(*uintptr)(unsafe.Pointer(pItem + 44))) - Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1686, int32(1)) + Xsqlite3_str_append(tls, pAccum, __ccgo_ts+1713, int32(1)) } Xsqlite3_str_appendall(tls, pAccum, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } else { @@ -95227,21 +89591,21 @@ func Xsqlite3_str_vappendf(tls *libc.TLS, pAccum uintptr, fmt uintptr, ap Tva_li if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) != 0 { /* Because of tag-20240424-1 */ pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pItem + 44)))).FpSelect if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_NestedFrom) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1688, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1715, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } else { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_MultiValue) != 0 { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1698, libc.VaList(bp+120, *(*Tu32)(unsafe.Pointer(pItem + 32)))) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1725, libc.VaList(bp+120, *(*Tu32)(unsafe.Pointer(pItem + 32)))) } else { - Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1719, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) + Xsqlite3_str_appendf(tls, pAccum, __ccgo_ts+1746, libc.VaList(bp+120, (*TSelect)(unsafe.Pointer(pSel)).FselId)) } } } } } } - v111 = libc.Int32FromInt32(0) - width = v111 - length = v111 + v123 = libc.Int32FromInt32(0) + width = v123 + length = v123 goto _44 _43: ; @@ -95480,7 +89844,7 @@ func Xsqlite3_str_appendall(tls *libc.TLS, p uintptr, z uintptr) { func _strAccumFinishRealloc(tls *libc.TLS, p uintptr) (r uintptr) { var zText, p1 uintptr _, _ = zText, p1 - zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1))) + zText = _sqlite3DbMallocRaw(tls, (*TStrAccum)(unsafe.Pointer(p)).Fdb, uint64(1)+uint64((*TStrAccum)(unsafe.Pointer(p)).FnChar)) if zText != 0 { libc.Xmemcpy(tls, zText, (*TStrAccum)(unsafe.Pointer(p)).FzText, (*TStrAccum)(unsafe.Pointer(p)).FnChar+uint32(1)) p1 = p + 21 @@ -95516,7 +89880,7 @@ func _sqlite3ResultStrAccum(tls *libc.TLS, pCtx uintptr, p uintptr) { if int32((*TStrAccum)(unsafe.Pointer(p)).FprintfFlags)&int32(SQLITE_PRINTF_MALLOCED) != 0 { Xsqlite3_result_text(tls, pCtx, (*TStrAccum)(unsafe.Pointer(p)).FzText, int32((*TStrAccum)(unsafe.Pointer(p)).FnChar), __ccgo_fp(_sqlite3OomClear)) } else { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1673, 0, libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1674, 0, libc.UintptrFromInt32(0)) Xsqlite3_str_reset(tls, p) } } @@ -95779,6 +90143,8 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va return zBuf } +/* Maximum size of an sqlite3_log() message. */ + // C documentation // // /* @@ -95796,11 +90162,11 @@ func Xsqlite3_snprintf(tls *libc.TLS, n int32, zBuf uintptr, zFormat uintptr, va // ** memory mutex is held do not use these mechanisms. // */ func _renderLogMsg(tls *libc.TLS, iErrCode int32, zFormat uintptr, ap Tva_list) { - bp := tls.Alloc(240) - defer tls.Free(240) + bp := tls.Alloc(736) + defer tls.Free(736) var _ /* acc at bp+0 */ TStrAccum - var _ /* zMsg at bp+24 */ [210]int8 /* Complete log message */ - _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(210), 0) + var _ /* zMsg at bp+24 */ [700]int8 /* Complete log message */ + _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(700), 0) Xsqlite3_str_vappendf(tls, bp, zFormat, ap) (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{_sqlite3Config.FxLog})))(tls, _sqlite3Config.FpLogArg, iErrCode, _sqlite3StrAccumFinish(tls, bp)) } @@ -96306,17 +90672,6 @@ type T_tls_callback_type = uintptr type _tls_callback_type = T_tls_callback_type -/* A running thread */ -type TSQLiteThread1 = struct { - Ftid uintptr - Fid uint32 - FxTask uintptr - FpIn uintptr - FpResult uintptr -} - -type SQLiteThread1 = TSQLiteThread1 - // C documentation // // /* Thread procedure Win32 compatibility shim */ @@ -96332,7 +90687,7 @@ func _sqlite3ThreadProc(tls *libc.TLS, pArg uintptr) (r uint32) { // C documentation // // /* Create a new thread */ -func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn uintptr) (r int32) { +func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { var p uintptr _ = p *(*uintptr)(unsafe.Pointer(ppThread)) = uintptr(0) @@ -96348,7 +90703,7 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui if int32(_sqlite3Config.FbCoreMutex) == 0 || _sqlite3FaultSim(tls, int32(200)) != 0 { libc.Xmemset(tls, p, 0, uint32(20)) } else { - (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = xTask + (*TSQLiteThread)(unsafe.Pointer(p)).FxTask = __ccgo_fp_xTask (*TSQLiteThread)(unsafe.Pointer(p)).FpIn = pIn (*TSQLiteThread)(unsafe.Pointer(p)).Ftid = uintptr(libc.X_beginthreadex(tls, uintptr(0), uint32(0), __ccgo_fp(_sqlite3ThreadProc), p, uint32(0), p+4)) if (*TSQLiteThread)(unsafe.Pointer(p)).Ftid == uintptr(0) { @@ -96357,7 +90712,7 @@ func _sqlite3ThreadCreate(tls *libc.TLS, ppThread uintptr, xTask uintptr, pIn ui } if (*TSQLiteThread)(unsafe.Pointer(p)).FxTask == uintptr(0) { (*TSQLiteThread)(unsafe.Pointer(p)).Fid = uint32(libc.XGetCurrentThreadId(tls)) - (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{xTask})))(tls, pIn) + (*TSQLiteThread)(unsafe.Pointer(p)).FpResult = (*(*func(*libc.TLS, uintptr) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xTask})))(tls, pIn) } *(*uintptr)(unsafe.Pointer(ppThread)) = p return SQLITE_OK @@ -96507,6 +90862,37 @@ var _sqlite3Utf8Trans1 = [64]uint8{ 61: uint8(0x01), } +// C documentation +// +// /* +// ** Write a single UTF8 character whose value is v into the +// ** buffer starting at zOut. zOut must be sized to hold at +// ** least four bytes. Return the number of bytes needed +// ** to encode the new character. +// */ +func _sqlite3AppendOneUtf8Character(tls *libc.TLS, zOut uintptr, v Tu32) (r int32) { + if v < uint32(0x00080) { + *(*int8)(unsafe.Pointer(zOut)) = int8(uint8(v & libc.Uint32FromInt32(0xff))) + return int32(1) + } + if v < uint32(0x00800) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xc0) + int32(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x1f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + int32(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(2) + } + if v < uint32(0x10000) { + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xe0) + int32(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x0f)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + int32(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + int32(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(3) + } + *(*int8)(unsafe.Pointer(zOut)) = int8(int32(0xf0) + int32(uint8(v>>libc.Int32FromInt32(18)&libc.Uint32FromInt32(0x07)))) + *(*int8)(unsafe.Pointer(zOut + 1)) = int8(int32(0x80) + int32(uint8(v>>libc.Int32FromInt32(12)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 2)) = int8(int32(0x80) + int32(uint8(v>>libc.Int32FromInt32(6)&libc.Uint32FromInt32(0x3f)))) + *(*int8)(unsafe.Pointer(zOut + 3)) = int8(int32(0x80) + int32(uint8(v&libc.Uint32FromInt32(0x3f)))) + return int32(4) +} + // C documentation // // /* @@ -97307,7 +91693,7 @@ func _sqlite3ProgressCheck(tls *libc.TLS, p uintptr) { if (*TParse)(unsafe.Pointer(p)).Frc == int32(SQLITE_INTERRUPT) { (*TParse)(unsafe.Pointer(p)).FnProgressSteps = uint32(0) } else { - v2 = p + 116 + v2 = p + 104 *(*Tu32)(unsafe.Pointer(v2))++ v1 = *(*Tu32)(unsafe.Pointer(v2)) if v1 >= (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps { @@ -97482,7 +91868,7 @@ func _sqlite3DequoteNumber(tls *libc.TLS, pParse uintptr, p uintptr) { } } else { if bHex == 0 && (!(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x04) != 0) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x04) != 0)) || bHex == int32(1) && (!(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + uintptr(-libc.Int32FromInt32(1)))))])&libc.Int32FromInt32(0x08) != 0) || !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(pIn + 1)))])&libc.Int32FromInt32(0x08) != 0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1733, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1760, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(p + 8)))) } } goto _2 @@ -97694,11 +92080,11 @@ func _dekkerMul2(tls *libc.TLS, x uintptr, _y float64, yy float64) { *(*Tu64)(unsafe.Pointer(bp + 24)) &= uint64(0xfffffffffc000000) libc.Xmemcpy(tls, bp+16, bp+24, uint32(8)) ty = *(*float64)(unsafe.Pointer(bp)) - *(*float64)(unsafe.Pointer(bp + 16)) - p = *(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16)) - q = *(*float64)(unsafe.Pointer(bp + 8))*ty + tx**(*float64)(unsafe.Pointer(bp + 16)) + p = float64(*(*float64)(unsafe.Pointer(bp + 8)) * *(*float64)(unsafe.Pointer(bp + 16))) + q = float64(*(*float64)(unsafe.Pointer(bp + 8))*ty) + float64(tx**(*float64)(unsafe.Pointer(bp + 16))) c = p + q - cc = p - c + q + tx*ty - cc = libc.AtomicLoadPFloat64(x)*yy + libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp)) + cc + cc = p - c + q + float64(tx*ty) + cc = float64(libc.AtomicLoadPFloat64(x)*yy) + float64(libc.AtomicLoadPFloat64(x+1*8)**(*float64)(unsafe.Pointer(bp))) + cc libc.AtomicStorePFloat64(x, c+cc) libc.AtomicStorePFloat64(x+1*8, c-libc.AtomicLoadPFloat64(x)) *(*float64)(unsafe.Pointer(x + 1*8)) += cc @@ -97934,7 +92320,7 @@ do_atof_calc: } *(*float64)(unsafe.Pointer(pResult)) = (*(*[2]float64)(unsafe.Pointer(bp)))[0] + (*(*[2]float64)(unsafe.Pointer(bp)))[int32(1)] if _sqlite3IsNaN(tls, *(*float64)(unsafe.Pointer(pResult))) != 0 { - *(*float64)(unsafe.Pointer(pResult)) = libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300) + *(*float64)(unsafe.Pointer(pResult)) = float64(libc.Float64FromFloat64(1e+300) * libc.Float64FromFloat64(1e+300)) } if sign < 0 { *(*float64)(unsafe.Pointer(pResult)) = -*(*float64)(unsafe.Pointer(pResult)) @@ -98024,7 +92410,7 @@ func _compare2pow63(tls *libc.TLS, zNum uintptr, incr int32) (r int32) { _, _, _ = c, i, pow63 c = 0 /* 012345678901234567 */ - pow63 = __ccgo_ts + 1758 + pow63 = __ccgo_ts + 1785 i = 0 for { if !(c == 0 && i < int32(18)) { @@ -98251,7 +92637,7 @@ func _sqlite3DecOrHexToI64(tls *libc.TLS, z uintptr, pOut uintptr) (r int32) { } return 0 } else { - n = int32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1777)) + n = int32(libc.Uint32FromInt32(0x3fffffff) & libc.Xstrspn(tls, z, __ccgo_ts+1804)) if *(*int8)(unsafe.Pointer(z + uintptr(n))) != 0 { n++ } @@ -98411,7 +92797,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') (*TFpDecode)(unsafe.Pointer(p)).Fn = int32(1) (*TFpDecode)(unsafe.Pointer(p)).FiDP = int32(1) - (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1793 + (*TFpDecode)(unsafe.Pointer(p)).Fz = __ccgo_ts + 1820 return } else { (*TFpDecode)(unsafe.Pointer(p)).Fsign = int8('+') @@ -98520,7 +92906,7 @@ func _sqlite3FpDecode(tls *libc.TLS, p uintptr, _r float64, iRound int32, mxRoun } } (*TFpDecode)(unsafe.Pointer(p)).Fz = p + 16 + uintptr(i+int32(1)) - for (*TFpDecode)(unsafe.Pointer(p)).Fn > 0 && int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { + for int32(*(*int8)(unsafe.Pointer((*TFpDecode)(unsafe.Pointer(p)).Fz + uintptr((*TFpDecode)(unsafe.Pointer(p)).Fn-int32(1))))) == int32('0') { (*TFpDecode)(unsafe.Pointer(p)).Fn-- } } @@ -98936,7 +93322,7 @@ func _sqlite3HexToBlob(tls *libc.TLS, db uintptr, z uintptr, n int32) (r uintptr func _logBadConnection(tls *libc.TLS, zType uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1795, libc.VaList(bp+8, zType)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+1822, libc.VaList(bp+8, zType)) } // C documentation @@ -98959,13 +93345,13 @@ func _sqlite3SafetyCheckOk(tls *libc.TLS, db uintptr) (r int32) { var eOpenState Tu8 _ = eOpenState if db == uintptr(0) { - _logBadConnection(tls, __ccgo_ts+1674) + _logBadConnection(tls, __ccgo_ts+1675) return 0 } eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if int32(eOpenState) != int32(SQLITE_STATE_OPEN) { if _sqlite3SafetyCheckSickOrOk(tls, db) != 0 { - _logBadConnection(tls, __ccgo_ts+1840) + _logBadConnection(tls, __ccgo_ts+1867) } return 0 } else { @@ -98979,7 +93365,7 @@ func _sqlite3SafetyCheckSickOrOk(tls *libc.TLS, db uintptr) (r int32) { _ = eOpenState eOpenState = (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState if int32(eOpenState) != int32(SQLITE_STATE_SICK) && int32(eOpenState) != int32(SQLITE_STATE_OPEN) && int32(eOpenState) != int32(SQLITE_STATE_BUSY) { - _logBadConnection(tls, __ccgo_ts+1849) + _logBadConnection(tls, __ccgo_ts+1876) return 0 } else { return int32(1) @@ -99010,7 +93396,7 @@ func _sqlite3MulInt64(tls *libc.TLS, pA uintptr, iB Ti64) (r int32) { // C documentation // // /* -// ** Compute the absolute value of a 32-bit signed integer, of possible. Or +// ** Compute the absolute value of a 32-bit signed integer, if possible. Or // ** if the integer has a value of -2147483648, return +2147483647 // */ func _sqlite3AbsInt32(tls *libc.TLS, x int32) (r int32) { @@ -99361,23 +93747,21 @@ func _sqlite3HashClear(tls *libc.TLS, pH uintptr) { // ** The hashing function. // */ func _strHash(tls *libc.TLS, z uintptr) (r uint32) { - var c, v1 uint8 var h uint32 - var v2 uintptr - _, _, _, _ = c, h, v1, v2 + var v1 uintptr + _, _ = h, v1 h = uint32(0) - for { - v2 = z - z++ - v1 = uint8(*(*int8)(unsafe.Pointer(v2))) - c = v1 - if !(int32(v1) != 0) { - break - } /*OPTIMIZATION-IF-TRUE*/ + for *(*int8)(unsafe.Pointer(z)) != 0 { /*OPTIMIZATION-IF-TRUE*/ /* Knuth multiplicative hashing. (Sorting & Searching, p. 510). ** 0x9e3779b1 is 2654435761 which is the closest prime number to - ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */ - h += uint32(_sqlite3UpperToLower[c]) + ** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. + ** + ** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are + ** hashed since the omitted bits determine the upper/lower case difference. + */ + v1 = z + z++ + h += uint32(int32(0xdf) & int32(uint8(*(*int8)(unsafe.Pointer(v1))))) h *= uint32(0x9e3779b1) } return h @@ -99432,8 +93816,8 @@ func _insertElement(tls *libc.TLS, pH uintptr, pEntry uintptr, pNew uintptr) { // */ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { var elem, new_ht, next_elem uintptr - var h, v1 uint32 - _, _, _, _, _ = elem, h, new_ht, next_elem, v1 /* For looping over existing elements */ + var v1 uint32 + _, _, _, _ = elem, new_ht, next_elem, v1 /* For looping over existing elements */ if new_size*uint32(8) > uint32(SQLITE_MALLOC_SOFT_LIMIT) { new_size = libc.Uint32FromInt32(SQLITE_MALLOC_SOFT_LIMIT) / libc.Uint32FromInt64(8) } @@ -99466,9 +93850,8 @@ func _rehash(tls *libc.TLS, pH uintptr, new_size uint32) (r int32) { if !(elem != 0) { break } - h = _strHash(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey) % new_size next_elem = (*THashElem)(unsafe.Pointer(elem)).Fnext - _insertElement(tls, pH, new_ht+uintptr(h)*8, elem) + _insertElement(tls, pH, new_ht+uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%new_size)*8, elem) goto _2 _2: ; @@ -99488,13 +93871,12 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr var count, h uint32 var elem, pEntry uintptr _, _, _, _ = count, elem, h, pEntry /* The computed hash */ + h = _strHash(tls, pKey) if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - h = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 elem = (*T_ht)(unsafe.Pointer(pEntry)).Fchain count = (*T_ht)(unsafe.Pointer(pEntry)).Fcount } else { - h = uint32(0) elem = (*THash)(unsafe.Pointer(pH)).Ffirst count = (*THash)(unsafe.Pointer(pH)).Fcount } @@ -99502,7 +93884,7 @@ func _findElementWithHash(tls *libc.TLS, pH uintptr, pKey uintptr, pHash uintptr *(*uint32)(unsafe.Pointer(pHash)) = h } for count != 0 { - if _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { + if h == (*THashElem)(unsafe.Pointer(elem)).Fh && _sqlite3StrICmp(tls, (*THashElem)(unsafe.Pointer(elem)).FpKey, pKey) == 0 { return elem } elem = (*THashElem)(unsafe.Pointer(elem)).Fnext @@ -99518,7 +93900,7 @@ var _nullElement = THashElem{} // /* Remove a single entry from the hash table given a pointer to that // ** element and a hash on the element's key. // */ -func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) { +func _removeElement(tls *libc.TLS, pH uintptr, elem uintptr) { var pEntry uintptr _ = pEntry if (*THashElem)(unsafe.Pointer(elem)).Fprev != 0 { @@ -99530,7 +93912,7 @@ func _removeElementGivenHash(tls *libc.TLS, pH uintptr, elem uintptr, h uint32) (*THashElem)(unsafe.Pointer((*THashElem)(unsafe.Pointer(elem)).Fnext)).Fprev = (*THashElem)(unsafe.Pointer(elem)).Fprev } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(h)*8 + pEntry = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 if (*T_ht)(unsafe.Pointer(pEntry)).Fchain == elem { (*T_ht)(unsafe.Pointer(pEntry)).Fchain = (*THashElem)(unsafe.Pointer(elem)).Fnext } @@ -99579,7 +93961,7 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if (*THashElem)(unsafe.Pointer(elem)).Fdata != 0 { old_data = (*THashElem)(unsafe.Pointer(elem)).Fdata if data == uintptr(0) { - _removeElementGivenHash(tls, pH, elem, *(*uint32)(unsafe.Pointer(bp))) + _removeElement(tls, pH, elem) } else { (*THashElem)(unsafe.Pointer(elem)).Fdata = data (*THashElem)(unsafe.Pointer(elem)).FpKey = pKey @@ -99589,20 +93971,19 @@ func _sqlite3HashInsert(tls *libc.TLS, pH uintptr, pKey uintptr, data uintptr) ( if data == uintptr(0) { return uintptr(0) } - new_elem = _sqlite3Malloc(tls, uint64(16)) + new_elem = _sqlite3Malloc(tls, uint64(20)) if new_elem == uintptr(0) { return data } (*THashElem)(unsafe.Pointer(new_elem)).FpKey = pKey + (*THashElem)(unsafe.Pointer(new_elem)).Fh = *(*uint32)(unsafe.Pointer(bp)) (*THashElem)(unsafe.Pointer(new_elem)).Fdata = data (*THash)(unsafe.Pointer(pH)).Fcount++ - if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(10) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { - if _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(2)) != 0 { - *(*uint32)(unsafe.Pointer(bp)) = _strHash(tls, pKey) % (*THash)(unsafe.Pointer(pH)).Fhtsize - } + if (*THash)(unsafe.Pointer(pH)).Fcount >= uint32(5) && (*THash)(unsafe.Pointer(pH)).Fcount > uint32(2)*(*THash)(unsafe.Pointer(pH)).Fhtsize { + _rehash(tls, pH, (*THash)(unsafe.Pointer(pH)).Fcount*uint32(3)) } if (*THash)(unsafe.Pointer(pH)).Fht != 0 { - v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr(*(*uint32)(unsafe.Pointer(bp)))*8 + v1 = (*THash)(unsafe.Pointer(pH)).Fht + uintptr((*THashElem)(unsafe.Pointer(new_elem)).Fh%(*THash)(unsafe.Pointer(pH)).Fhtsize)*8 } else { v1 = uintptr(0) } @@ -99621,196 +94002,196 @@ func _sqlite3OpcodeName(tls *libc.TLS, i int32) (r uintptr) { } var _azName = [190]uintptr{ - 0: __ccgo_ts + 1857, - 1: __ccgo_ts + 1867, - 2: __ccgo_ts + 1878, - 3: __ccgo_ts + 1890, - 4: __ccgo_ts + 1901, - 5: __ccgo_ts + 1913, - 6: __ccgo_ts + 1920, - 7: __ccgo_ts + 1928, - 8: __ccgo_ts + 1936, - 9: __ccgo_ts + 1941, - 10: __ccgo_ts + 1946, - 11: __ccgo_ts + 1952, - 12: __ccgo_ts + 1966, - 13: __ccgo_ts + 1972, - 14: __ccgo_ts + 1982, - 15: __ccgo_ts + 1987, - 16: __ccgo_ts + 1992, - 17: __ccgo_ts + 1995, - 18: __ccgo_ts + 2001, - 19: __ccgo_ts + 2008, - 20: __ccgo_ts + 2012, - 21: __ccgo_ts + 2022, - 22: __ccgo_ts + 2029, - 23: __ccgo_ts + 2036, - 24: __ccgo_ts + 2043, - 25: __ccgo_ts + 2050, - 26: __ccgo_ts + 2060, - 27: __ccgo_ts + 2069, - 28: __ccgo_ts + 2080, - 29: __ccgo_ts + 2089, - 30: __ccgo_ts + 2095, - 31: __ccgo_ts + 2105, - 32: __ccgo_ts + 2115, - 33: __ccgo_ts + 2120, - 34: __ccgo_ts + 2134, - 35: __ccgo_ts + 2145, - 36: __ccgo_ts + 2150, - 37: __ccgo_ts + 2157, - 38: __ccgo_ts + 2168, - 39: __ccgo_ts + 2173, - 40: __ccgo_ts + 2178, - 41: __ccgo_ts + 2184, - 42: __ccgo_ts + 2190, - 43: __ccgo_ts + 2196, - 44: __ccgo_ts + 2199, - 45: __ccgo_ts + 2203, - 46: __ccgo_ts + 2209, - 47: __ccgo_ts + 2220, - 48: __ccgo_ts + 2231, - 49: __ccgo_ts + 2239, - 50: __ccgo_ts + 2248, - 51: __ccgo_ts + 2254, - 52: __ccgo_ts + 2261, - 53: __ccgo_ts + 2269, - 54: __ccgo_ts + 2272, - 55: __ccgo_ts + 2275, - 56: __ccgo_ts + 2278, - 57: __ccgo_ts + 2281, - 58: __ccgo_ts + 2284, - 59: __ccgo_ts + 2287, - 60: __ccgo_ts + 2294, - 61: __ccgo_ts + 2304, - 62: __ccgo_ts + 2317, - 63: __ccgo_ts + 2328, - 64: __ccgo_ts + 2334, - 65: __ccgo_ts + 2341, - 66: __ccgo_ts + 2350, - 67: __ccgo_ts + 2359, - 68: __ccgo_ts + 2366, - 69: __ccgo_ts + 2379, - 70: __ccgo_ts + 2390, - 71: __ccgo_ts + 2395, - 72: __ccgo_ts + 2403, - 73: __ccgo_ts + 2409, - 74: __ccgo_ts + 2416, - 75: __ccgo_ts + 2428, - 76: __ccgo_ts + 2433, - 77: __ccgo_ts + 2442, - 78: __ccgo_ts + 2447, - 79: __ccgo_ts + 2456, - 80: __ccgo_ts + 2461, - 81: __ccgo_ts + 2466, - 82: __ccgo_ts + 2472, - 83: __ccgo_ts + 2480, - 84: __ccgo_ts + 2488, - 85: __ccgo_ts + 2498, - 86: __ccgo_ts + 2506, - 87: __ccgo_ts + 2513, - 88: __ccgo_ts + 2526, - 89: __ccgo_ts + 2531, - 90: __ccgo_ts + 2543, - 91: __ccgo_ts + 2551, - 92: __ccgo_ts + 2558, - 93: __ccgo_ts + 2569, - 94: __ccgo_ts + 2576, - 95: __ccgo_ts + 2583, - 96: __ccgo_ts + 2593, - 97: __ccgo_ts + 2602, - 98: __ccgo_ts + 2613, - 99: __ccgo_ts + 2619, - 100: __ccgo_ts + 2630, - 101: __ccgo_ts + 2640, - 102: __ccgo_ts + 2650, - 103: __ccgo_ts + 2659, - 104: __ccgo_ts + 2666, - 105: __ccgo_ts + 2672, - 106: __ccgo_ts + 2682, - 107: __ccgo_ts + 2693, - 108: __ccgo_ts + 2697, - 109: __ccgo_ts + 2706, - 110: __ccgo_ts + 2715, - 111: __ccgo_ts + 2722, - 112: __ccgo_ts + 2732, - 113: __ccgo_ts + 2739, - 114: __ccgo_ts + 2749, - 115: __ccgo_ts + 2757, - 116: __ccgo_ts + 2764, - 117: __ccgo_ts + 2778, - 118: __ccgo_ts + 2792, - 119: __ccgo_ts + 2800, - 120: __ccgo_ts + 2811, - 121: __ccgo_ts + 2824, - 122: __ccgo_ts + 2835, - 123: __ccgo_ts + 2841, - 124: __ccgo_ts + 2853, - 125: __ccgo_ts + 2862, - 126: __ccgo_ts + 2870, - 127: __ccgo_ts + 2879, - 128: __ccgo_ts + 2888, - 129: __ccgo_ts + 2895, - 130: __ccgo_ts + 2903, - 131: __ccgo_ts + 2910, - 132: __ccgo_ts + 2921, - 133: __ccgo_ts + 2935, - 134: __ccgo_ts + 2946, - 135: __ccgo_ts + 2954, - 136: __ccgo_ts + 2960, - 137: __ccgo_ts + 2968, - 138: __ccgo_ts + 2976, - 139: __ccgo_ts + 2986, - 140: __ccgo_ts + 2999, - 141: __ccgo_ts + 3009, - 142: __ccgo_ts + 3022, - 143: __ccgo_ts + 3031, - 144: __ccgo_ts + 3042, - 145: __ccgo_ts + 3050, - 146: __ccgo_ts + 3056, - 147: __ccgo_ts + 3068, - 148: __ccgo_ts + 3080, - 149: __ccgo_ts + 3088, - 150: __ccgo_ts + 3100, - 151: __ccgo_ts + 3113, - 152: __ccgo_ts + 3123, - 153: __ccgo_ts + 3133, - 154: __ccgo_ts + 3145, - 155: __ccgo_ts + 3150, - 156: __ccgo_ts + 3162, - 157: __ccgo_ts + 3172, - 158: __ccgo_ts + 3178, - 159: __ccgo_ts + 3188, - 160: __ccgo_ts + 3195, - 161: __ccgo_ts + 3207, - 162: __ccgo_ts + 3218, - 163: __ccgo_ts + 3226, - 164: __ccgo_ts + 3235, - 165: __ccgo_ts + 3244, - 166: __ccgo_ts + 3253, - 167: __ccgo_ts + 3260, - 168: __ccgo_ts + 3271, - 169: __ccgo_ts + 3284, - 170: __ccgo_ts + 3294, - 171: __ccgo_ts + 3301, - 172: __ccgo_ts + 3309, - 173: __ccgo_ts + 3318, - 174: __ccgo_ts + 3324, - 175: __ccgo_ts + 3331, - 176: __ccgo_ts + 3339, - 177: __ccgo_ts + 3347, - 178: __ccgo_ts + 3355, - 179: __ccgo_ts + 3365, - 180: __ccgo_ts + 3374, - 181: __ccgo_ts + 3385, - 182: __ccgo_ts + 3396, - 183: __ccgo_ts + 3407, - 184: __ccgo_ts + 3417, - 185: __ccgo_ts + 3423, - 186: __ccgo_ts + 3434, - 187: __ccgo_ts + 3445, - 188: __ccgo_ts + 3450, - 189: __ccgo_ts + 3458, + 0: __ccgo_ts + 1884, + 1: __ccgo_ts + 1894, + 2: __ccgo_ts + 1905, + 3: __ccgo_ts + 1917, + 4: __ccgo_ts + 1928, + 5: __ccgo_ts + 1940, + 6: __ccgo_ts + 1947, + 7: __ccgo_ts + 1955, + 8: __ccgo_ts + 1963, + 9: __ccgo_ts + 1968, + 10: __ccgo_ts + 1973, + 11: __ccgo_ts + 1979, + 12: __ccgo_ts + 1993, + 13: __ccgo_ts + 1999, + 14: __ccgo_ts + 2009, + 15: __ccgo_ts + 2014, + 16: __ccgo_ts + 2019, + 17: __ccgo_ts + 2022, + 18: __ccgo_ts + 2028, + 19: __ccgo_ts + 2035, + 20: __ccgo_ts + 2039, + 21: __ccgo_ts + 2049, + 22: __ccgo_ts + 2056, + 23: __ccgo_ts + 2063, + 24: __ccgo_ts + 2070, + 25: __ccgo_ts + 2077, + 26: __ccgo_ts + 2087, + 27: __ccgo_ts + 2096, + 28: __ccgo_ts + 2107, + 29: __ccgo_ts + 2116, + 30: __ccgo_ts + 2122, + 31: __ccgo_ts + 2132, + 32: __ccgo_ts + 2142, + 33: __ccgo_ts + 2147, + 34: __ccgo_ts + 2161, + 35: __ccgo_ts + 2172, + 36: __ccgo_ts + 2177, + 37: __ccgo_ts + 2184, + 38: __ccgo_ts + 2195, + 39: __ccgo_ts + 2200, + 40: __ccgo_ts + 2205, + 41: __ccgo_ts + 2211, + 42: __ccgo_ts + 2217, + 43: __ccgo_ts + 2223, + 44: __ccgo_ts + 2226, + 45: __ccgo_ts + 2230, + 46: __ccgo_ts + 2236, + 47: __ccgo_ts + 2247, + 48: __ccgo_ts + 2258, + 49: __ccgo_ts + 2266, + 50: __ccgo_ts + 2275, + 51: __ccgo_ts + 2281, + 52: __ccgo_ts + 2288, + 53: __ccgo_ts + 2296, + 54: __ccgo_ts + 2299, + 55: __ccgo_ts + 2302, + 56: __ccgo_ts + 2305, + 57: __ccgo_ts + 2308, + 58: __ccgo_ts + 2311, + 59: __ccgo_ts + 2314, + 60: __ccgo_ts + 2321, + 61: __ccgo_ts + 2331, + 62: __ccgo_ts + 2344, + 63: __ccgo_ts + 2355, + 64: __ccgo_ts + 2361, + 65: __ccgo_ts + 2368, + 66: __ccgo_ts + 2377, + 67: __ccgo_ts + 2386, + 68: __ccgo_ts + 2393, + 69: __ccgo_ts + 2406, + 70: __ccgo_ts + 2417, + 71: __ccgo_ts + 2422, + 72: __ccgo_ts + 2430, + 73: __ccgo_ts + 2436, + 74: __ccgo_ts + 2443, + 75: __ccgo_ts + 2455, + 76: __ccgo_ts + 2460, + 77: __ccgo_ts + 2469, + 78: __ccgo_ts + 2474, + 79: __ccgo_ts + 2483, + 80: __ccgo_ts + 2488, + 81: __ccgo_ts + 2493, + 82: __ccgo_ts + 2499, + 83: __ccgo_ts + 2507, + 84: __ccgo_ts + 2515, + 85: __ccgo_ts + 2525, + 86: __ccgo_ts + 2533, + 87: __ccgo_ts + 2540, + 88: __ccgo_ts + 2553, + 89: __ccgo_ts + 2558, + 90: __ccgo_ts + 2570, + 91: __ccgo_ts + 2578, + 92: __ccgo_ts + 2585, + 93: __ccgo_ts + 2596, + 94: __ccgo_ts + 2603, + 95: __ccgo_ts + 2610, + 96: __ccgo_ts + 2620, + 97: __ccgo_ts + 2629, + 98: __ccgo_ts + 2640, + 99: __ccgo_ts + 2646, + 100: __ccgo_ts + 2657, + 101: __ccgo_ts + 2667, + 102: __ccgo_ts + 2677, + 103: __ccgo_ts + 2686, + 104: __ccgo_ts + 2693, + 105: __ccgo_ts + 2699, + 106: __ccgo_ts + 2709, + 107: __ccgo_ts + 2720, + 108: __ccgo_ts + 2724, + 109: __ccgo_ts + 2733, + 110: __ccgo_ts + 2742, + 111: __ccgo_ts + 2749, + 112: __ccgo_ts + 2759, + 113: __ccgo_ts + 2766, + 114: __ccgo_ts + 2776, + 115: __ccgo_ts + 2784, + 116: __ccgo_ts + 2791, + 117: __ccgo_ts + 2805, + 118: __ccgo_ts + 2819, + 119: __ccgo_ts + 2827, + 120: __ccgo_ts + 2838, + 121: __ccgo_ts + 2851, + 122: __ccgo_ts + 2862, + 123: __ccgo_ts + 2868, + 124: __ccgo_ts + 2880, + 125: __ccgo_ts + 2889, + 126: __ccgo_ts + 2897, + 127: __ccgo_ts + 2906, + 128: __ccgo_ts + 2915, + 129: __ccgo_ts + 2922, + 130: __ccgo_ts + 2930, + 131: __ccgo_ts + 2937, + 132: __ccgo_ts + 2948, + 133: __ccgo_ts + 2962, + 134: __ccgo_ts + 2973, + 135: __ccgo_ts + 2981, + 136: __ccgo_ts + 2987, + 137: __ccgo_ts + 2995, + 138: __ccgo_ts + 3003, + 139: __ccgo_ts + 3013, + 140: __ccgo_ts + 3026, + 141: __ccgo_ts + 3036, + 142: __ccgo_ts + 3049, + 143: __ccgo_ts + 3058, + 144: __ccgo_ts + 3069, + 145: __ccgo_ts + 3077, + 146: __ccgo_ts + 3083, + 147: __ccgo_ts + 3095, + 148: __ccgo_ts + 3107, + 149: __ccgo_ts + 3115, + 150: __ccgo_ts + 3127, + 151: __ccgo_ts + 3140, + 152: __ccgo_ts + 3150, + 153: __ccgo_ts + 3160, + 154: __ccgo_ts + 3172, + 155: __ccgo_ts + 3177, + 156: __ccgo_ts + 3189, + 157: __ccgo_ts + 3199, + 158: __ccgo_ts + 3205, + 159: __ccgo_ts + 3215, + 160: __ccgo_ts + 3222, + 161: __ccgo_ts + 3234, + 162: __ccgo_ts + 3245, + 163: __ccgo_ts + 3253, + 164: __ccgo_ts + 3262, + 165: __ccgo_ts + 3271, + 166: __ccgo_ts + 3280, + 167: __ccgo_ts + 3287, + 168: __ccgo_ts + 3298, + 169: __ccgo_ts + 3311, + 170: __ccgo_ts + 3321, + 171: __ccgo_ts + 3328, + 172: __ccgo_ts + 3336, + 173: __ccgo_ts + 3345, + 174: __ccgo_ts + 3351, + 175: __ccgo_ts + 3358, + 176: __ccgo_ts + 3366, + 177: __ccgo_ts + 3374, + 178: __ccgo_ts + 3382, + 179: __ccgo_ts + 3392, + 180: __ccgo_ts + 3401, + 181: __ccgo_ts + 3412, + 182: __ccgo_ts + 3423, + 183: __ccgo_ts + 3434, + 184: __ccgo_ts + 3444, + 185: __ccgo_ts + 3450, + 186: __ccgo_ts + 3461, + 187: __ccgo_ts + 3472, + 188: __ccgo_ts + 3477, + 189: __ccgo_ts + 3485, } /************** End of opcodes.c *********************************************/ @@ -100007,29 +94388,27 @@ var _azName = [190]uintptr{ // /* Forward references to structures used for WAL */ type TwinShm = struct { FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 FsharedMask Tu16 FexclMask Tu16 + FhShm THANDLE + FbReadonly int32 } type winShm = TwinShm /* A connection to shared-memory */ type TwinShmNode = struct { - F__ccgo_align [0]uint32 - Fmutex uintptr - FzFilename uintptr - FhFile TwinFile - FszRegion int32 - FnRegion int32 - FisReadonly Tu8 - FisUnlocked Tu8 - FaRegion uintptr - FlastErrno TDWORD - FnRef int32 - FpFirst uintptr - FpNext uintptr + Fmutex uintptr + FzFilename uintptr + FhSharedShm THANDLE + FisUnlocked int32 + FisReadonly int32 + FszRegion int32 + FnRegion int32 + FaRegion uintptr + FlastErrno TDWORD + FnRef int32 + FpNext uintptr } type winShmNode = TwinShmNode @@ -100068,27 +94447,6 @@ type TwinFile = struct { type winFile = TwinFile -type TwinFile1 = struct { - F__ccgo_align [0]uint32 - FpMethod uintptr - FpVfs uintptr - Fh THANDLE - Flocktype Tu8 - FsharedLockByte int16 - FctrlFlags Tu8 - FlastErrno TDWORD - FpShm uintptr - FzPath uintptr - FszChunk int32 - FnFetchOut int32 - FhMap THANDLE - FpMapRegion uintptr - FmmapSize Tsqlite3_int64 - FmmapSizeMax Tsqlite3_int64 -} - -type winFile1 = TwinFile1 - // C documentation // // /* @@ -100103,14 +94461,6 @@ type TwinVfsAppData = struct { type winVfsAppData = TwinVfsAppData -type TwinVfsAppData1 = struct { - FpMethod uintptr - FpAppData uintptr - FbNoLock TBOOL -} - -type winVfsAppData1 = TwinVfsAppData1 - /* ** Allowed values for winFile.ctrlFlags */ @@ -100172,246 +94522,273 @@ type win_syscall = Twin_syscall // ** testing and sandboxing. The following array holds the names and pointers // ** to all overrideable system calls. // */ -var _aSyscall = [80]Twin_syscall{ +var _aSyscall = [89]Twin_syscall{ 0: { - FzName: __ccgo_ts + 3468, + FzName: __ccgo_ts + 3495, }, 1: { - FzName: __ccgo_ts + 3484, + FzName: __ccgo_ts + 3511, }, 2: { - FzName: __ccgo_ts + 3495, + FzName: __ccgo_ts + 3522, }, 3: { - FzName: __ccgo_ts + 3506, + FzName: __ccgo_ts + 3533, }, 4: { - FzName: __ccgo_ts + 3518, + FzName: __ccgo_ts + 3545, }, 5: { - FzName: __ccgo_ts + 3530, + FzName: __ccgo_ts + 3557, }, 6: { - FzName: __ccgo_ts + 3542, + FzName: __ccgo_ts + 3569, }, 7: { - FzName: __ccgo_ts + 3561, + FzName: __ccgo_ts + 3588, }, 8: { - FzName: __ccgo_ts + 3580, + FzName: __ccgo_ts + 3607, }, 9: { - FzName: __ccgo_ts + 3593, + FzName: __ccgo_ts + 3620, }, 10: { - FzName: __ccgo_ts + 3605, + FzName: __ccgo_ts + 3632, }, 11: { - FzName: __ccgo_ts + 3617, + FzName: __ccgo_ts + 3644, }, 12: { - FzName: __ccgo_ts + 3641, + FzName: __ccgo_ts + 3668, }, 13: { - FzName: __ccgo_ts + 3662, + FzName: __ccgo_ts + 3689, }, 14: { - FzName: __ccgo_ts + 3679, + FzName: __ccgo_ts + 3706, }, 15: { - FzName: __ccgo_ts + 3694, + FzName: __ccgo_ts + 3721, }, 16: { - FzName: __ccgo_ts + 3709, + FzName: __ccgo_ts + 3736, }, 17: { - FzName: __ccgo_ts + 3721, + FzName: __ccgo_ts + 3748, }, 18: { - FzName: __ccgo_ts + 3741, + FzName: __ccgo_ts + 3768, }, 19: { - FzName: __ccgo_ts + 3759, + FzName: __ccgo_ts + 3786, }, 20: { - FzName: __ccgo_ts + 3777, + FzName: __ccgo_ts + 3804, }, 21: { - FzName: __ccgo_ts + 3796, + FzName: __ccgo_ts + 3823, }, 22: { - FzName: __ccgo_ts + 3815, + FzName: __ccgo_ts + 3842, }, 23: { - FzName: __ccgo_ts + 3836, + FzName: __ccgo_ts + 3863, }, 24: { - FzName: __ccgo_ts + 3848, + FzName: __ccgo_ts + 3875, }, 25: { - FzName: __ccgo_ts + 3865, + FzName: __ccgo_ts + 3892, }, 26: { - FzName: __ccgo_ts + 3882, + FzName: __ccgo_ts + 3909, }, 27: { - FzName: __ccgo_ts + 3895, + FzName: __ccgo_ts + 3922, }, 28: { - FzName: __ccgo_ts + 3911, + FzName: __ccgo_ts + 3938, }, 29: { - FzName: __ccgo_ts + 3925, + FzName: __ccgo_ts + 3952, }, 30: { - FzName: __ccgo_ts + 3939, + FzName: __ccgo_ts + 3966, }, 31: { - FzName: __ccgo_ts + 3963, + FzName: __ccgo_ts + 3990, }, 32: { - FzName: __ccgo_ts + 3976, + FzName: __ccgo_ts + 4003, }, 33: { - FzName: __ccgo_ts + 3989, + FzName: __ccgo_ts + 4016, }, 34: { - FzName: __ccgo_ts + 4002, + FzName: __ccgo_ts + 4029, }, 35: { - FzName: __ccgo_ts + 4016, + FzName: __ccgo_ts + 4043, }, 36: { - FzName: __ccgo_ts + 4030, + FzName: __ccgo_ts + 4057, }, 37: { - FzName: __ccgo_ts + 4040, + FzName: __ccgo_ts + 4067, }, 38: { - FzName: __ccgo_ts + 4051, + FzName: __ccgo_ts + 4078, }, 39: { - FzName: __ccgo_ts + 4063, + FzName: __ccgo_ts + 4090, }, 40: { - FzName: __ccgo_ts + 4072, + FzName: __ccgo_ts + 4099, }, 41: { - FzName: __ccgo_ts + 4084, + FzName: __ccgo_ts + 4111, }, 42: { - FzName: __ccgo_ts + 4093, + FzName: __ccgo_ts + 4120, }, 43: { - FzName: __ccgo_ts + 4106, + FzName: __ccgo_ts + 4133, }, 44: { - FzName: __ccgo_ts + 4118, + FzName: __ccgo_ts + 4145, }, 45: { - FzName: __ccgo_ts + 4131, + FzName: __ccgo_ts + 4158, }, 46: { - FzName: __ccgo_ts + 4144, + FzName: __ccgo_ts + 4171, }, 47: { - FzName: __ccgo_ts + 4154, + FzName: __ccgo_ts + 4181, }, 48: { - FzName: __ccgo_ts + 4163, + FzName: __ccgo_ts + 4190, }, 49: { - FzName: __ccgo_ts + 4174, + FzName: __ccgo_ts + 4201, }, 50: { - FzName: __ccgo_ts + 4188, + FzName: __ccgo_ts + 4215, }, 51: { - FzName: __ccgo_ts + 4208, + FzName: __ccgo_ts + 4235, }, 52: { - FzName: __ccgo_ts + 4232, + FzName: __ccgo_ts + 4259, }, 53: { - FzName: __ccgo_ts + 4241, + FzName: __ccgo_ts + 4268, }, 54: { - FzName: __ccgo_ts + 4254, + FzName: __ccgo_ts + 4281, }, 55: { - FzName: __ccgo_ts + 4269, + FzName: __ccgo_ts + 4296, }, 56: { - FzName: __ccgo_ts + 4275, + FzName: __ccgo_ts + 4302, }, 57: { - FzName: __ccgo_ts + 4296, + FzName: __ccgo_ts + 4323, }, 58: { - FzName: __ccgo_ts + 4307, + FzName: __ccgo_ts + 4334, }, 59: { - FzName: __ccgo_ts + 4320, + FzName: __ccgo_ts + 4347, }, 60: { - FzName: __ccgo_ts + 4336, + FzName: __ccgo_ts + 4363, }, 61: { - FzName: __ccgo_ts + 4356, + FzName: __ccgo_ts + 4383, }, 62: { - FzName: __ccgo_ts + 4366, + FzName: __ccgo_ts + 4393, }, 63: { - FzName: __ccgo_ts + 4381, + FzName: __ccgo_ts + 4408, }, 64: { - FzName: __ccgo_ts + 4401, + FzName: __ccgo_ts + 4428, }, 65: { - FzName: __ccgo_ts + 4423, + FzName: __ccgo_ts + 4450, }, 66: { - FzName: __ccgo_ts + 4440, + FzName: __ccgo_ts + 4467, }, 67: { - FzName: __ccgo_ts + 4469, + FzName: __ccgo_ts + 4496, }, 68: { - FzName: __ccgo_ts + 4490, + FzName: __ccgo_ts + 4517, }, 69: { - FzName: __ccgo_ts + 4502, + FzName: __ccgo_ts + 4529, }, 70: { - FzName: __ccgo_ts + 4522, + FzName: __ccgo_ts + 4549, }, 71: { - FzName: __ccgo_ts + 4537, + FzName: __ccgo_ts + 4564, }, 72: { - FzName: __ccgo_ts + 4557, + FzName: __ccgo_ts + 4584, }, 73: { - FzName: __ccgo_ts + 4576, + FzName: __ccgo_ts + 4603, }, 74: { - FzName: __ccgo_ts + 4595, + FzName: __ccgo_ts + 4622, }, 75: { - FzName: __ccgo_ts + 4610, + FzName: __ccgo_ts + 4637, }, 76: { - FzName: __ccgo_ts + 4635, + FzName: __ccgo_ts + 4662, }, 77: { - FzName: __ccgo_ts + 4662, + FzName: __ccgo_ts + 4689, }, 78: { - FzName: __ccgo_ts + 4673, + FzName: __ccgo_ts + 4700, }, 79: { - FzName: __ccgo_ts + 4694, + FzName: __ccgo_ts + 4721, + }, + 80: { + FzName: __ccgo_ts + 4737, + }, + 81: { + FzName: __ccgo_ts + 4749, + }, + 82: { + FzName: __ccgo_ts + 4758, + }, + 83: { + FzName: __ccgo_ts + 4775, + }, + 84: { + FzName: __ccgo_ts + 4782, + }, + 85: { + FzName: __ccgo_ts + 4789, + }, + 86: { + FzName: __ccgo_ts + 4798, + }, + 87: { + FzName: __ccgo_ts + 4804, + }, + 88: { + FzName: __ccgo_ts + 4812, }, } @@ -100478,6 +94855,7 @@ func init() { *(*uintptr)(unsafe.Add(p, 880)) = __ccgo_fp(libc.XOutputDebugStringW) *(*uintptr)(unsafe.Add(p, 892)) = __ccgo_fp(libc.XGetProcessHeap) *(*uintptr)(unsafe.Add(p, 952)) = __ccgo_fp(libc.XFlushViewOfFile) + *(*uintptr)(unsafe.Add(p, 988)) = __ccgo_fp(libc.XGetModuleHandleW) } /* End of the overrideable system calls */ @@ -100490,7 +94868,7 @@ func init() { // ** system call pointer, or SQLITE_NOTFOUND if there is no configurable // ** system call named zName. // */ -func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc Tsqlite3_syscall_ptr) (r int32) { +func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, __ccgo_fp_pNewFunc Tsqlite3_syscall_ptr) (r int32) { var i uint32 var rc int32 _, _ = i, rc @@ -100503,7 +94881,7 @@ func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc rc = SQLITE_OK i = uint32(0) for { - if !(i < libc.Uint32FromInt64(960)/libc.Uint32FromInt64(12)) { + if !(i < libc.Uint32FromInt64(1068)/libc.Uint32FromInt64(12)) { break } if _aSyscall[i].FpDefault != 0 { @@ -100520,7 +94898,7 @@ func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc */ i = uint32(0) for { - if !(i < libc.Uint32FromInt64(960)/libc.Uint32FromInt64(12)) { + if !(i < libc.Uint32FromInt64(1068)/libc.Uint32FromInt64(12)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -100528,10 +94906,10 @@ func _winSetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr, pNewFunc _aSyscall[i].FpDefault = _aSyscall[i].FpCurrent } rc = SQLITE_OK - if pNewFunc == uintptr(0) { - pNewFunc = _aSyscall[i].FpDefault + if __ccgo_fp_pNewFunc == uintptr(0) { + __ccgo_fp_pNewFunc = _aSyscall[i].FpDefault } - _aSyscall[i].FpCurrent = pNewFunc + _aSyscall[i].FpCurrent = __ccgo_fp_pNewFunc break } goto _2 @@ -100556,7 +94934,7 @@ func _winGetSystemCall(tls *libc.TLS, pNotUsed uintptr, zName uintptr) (r Tsqlit _ = pNotUsed i = uint32(0) for { - if !(i < libc.Uint32FromInt64(960)/libc.Uint32FromInt64(12)) { + if !(i < libc.Uint32FromInt64(1068)/libc.Uint32FromInt64(12)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -100586,7 +94964,7 @@ func _winNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) (r uintptr) { if zName != 0 { i = 0 for { - if !(i < int32(libc.Uint32FromInt64(960)/libc.Uint32FromInt64(12))-libc.Int32FromInt32(1)) { + if !(i < int32(libc.Uint32FromInt64(1068)/libc.Uint32FromInt64(12))-libc.Int32FromInt32(1)) { break } if libc.Xstrcmp(tls, zName, _aSyscall[i].FzName) == 0 { @@ -100600,7 +94978,7 @@ func _winNextSystemCall(tls *libc.TLS, p uintptr, zName uintptr) (r uintptr) { } i++ for { - if !(i < int32(libc.Uint32FromInt64(960)/libc.Uint32FromInt64(12))) { + if !(i < int32(libc.Uint32FromInt64(1068)/libc.Uint32FromInt64(12))) { break } if _aSyscall[i].FpCurrent != uintptr(0) { @@ -100752,25 +95130,25 @@ func _winUnicodeToUtf8(tls *libc.TLS, zWideText TLPCWSTR) (r uintptr) { // ** Space to hold the returned string is obtained from sqlite3_malloc(). // */ func _winMbcsToUnicode(tls *libc.TLS, zText uintptr, useAnsi int32) (r TLPWSTR) { - var codepage, nByte, v1 int32 + var codepage, nWideChar, v1 int32 var zMbcsText TLPWSTR - _, _, _, _ = codepage, nByte, zMbcsText, v1 + _, _, _, _ = codepage, nWideChar, zMbcsText, v1 if useAnsi != 0 { v1 = CP_ACP } else { v1 = int32(CP_OEMCP) } codepage = v1 - nByte = int32(uint32((*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), libc.UintptrFromInt32(0), 0)) * uint32(2)) - if nByte == 0 { + nWideChar = (*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), libc.UintptrFromInt32(0), 0) + if nWideChar == 0 { return uintptr(0) } - zMbcsText = _sqlite3MallocZero(tls, uint64(uint32(nByte)*uint32(2))) + zMbcsText = _sqlite3MallocZero(tls, uint64(uint32(nWideChar)*uint32(2))) if zMbcsText == uintptr(0) { return uintptr(0) } - nByte = (*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), zMbcsText, nByte) - if nByte == 0 { + nWideChar = (*(*func(*libc.TLS, TUINT, TDWORD, TLPCSTR, int32, TLPWSTR, int32) int32)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(50)].FpCurrent})))(tls, uint32(codepage), uint32(0), zText, -int32(1), zMbcsText, nWideChar) + if nWideChar == 0 { Xsqlite3_free(tls, zMbcsText) zMbcsText = uintptr(0) } @@ -100951,7 +95329,7 @@ func Xsqlite3_win32_set_directory8(tls *libc.TLS, type1 uint32, zValue uintptr) if ppDirectory != 0 { zCopy = uintptr(0) if zValue != 0 && *(*int8)(unsafe.Pointer(zValue)) != 0 { - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, zValue)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, zValue)) if zCopy == uintptr(0) { rc = int32(SQLITE_NOMEM) goto set_directory8_done @@ -101052,10 +95430,10 @@ func _winGetLastErrorMsg(tls *libc.TLS, lastErrno TDWORD, nBuf int32, zBuf uintp } } if uint32(0) == dwLen { - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4713, libc.VaList(bp+16, lastErrno, lastErrno)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4832, libc.VaList(bp+16, lastErrno, lastErrno)) } else { /* copy a maximum of nBuf chars to output buffer */ - Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4710, libc.VaList(bp+16, zOut)) + Xsqlite3_snprintf(tls, nBuf, zBuf, __ccgo_ts+4829, libc.VaList(bp+16, zOut)) /* free the UTF8 buffer */ Xsqlite3_free(tls, zOut) } @@ -101088,7 +95466,7 @@ func _winLogErrorAtLine(tls *libc.TLS, errcode int32, lastErrno TDWORD, zFunc ui (*(*[500]int8)(unsafe.Pointer(bp)))[0] = 0 _winGetLastErrorMsg(tls, lastErrno, int32(500), bp) if zPath == uintptr(0) { - zPath = __ccgo_ts + 1673 + zPath = __ccgo_ts + 1674 } i = 0 for { @@ -101101,7 +95479,7 @@ func _winLogErrorAtLine(tls *libc.TLS, errcode int32, lastErrno TDWORD, zFunc ui i++ } (*(*[500]int8)(unsafe.Pointer(bp)))[i] = 0 - Xsqlite3_log(tls, errcode, __ccgo_ts+4733, libc.VaList(bp+512, iLine, lastErrno, zFunc, zPath, bp)) + Xsqlite3_log(tls, errcode, __ccgo_ts+4852, libc.VaList(bp+512, iLine, lastErrno, zFunc, zPath, bp)) return errcode } @@ -101170,7 +95548,7 @@ func _winLogIoerr(tls *libc.TLS, nRetry int32, lineno int32) { bp := tls.Alloc(32) defer tls.Free(32) if nRetry != 0 { - Xsqlite3_log(tls, int32(SQLITE_NOTICE), __ccgo_ts+4764, libc.VaList(bp+8, _winIoerrRetryDelay*nRetry*(nRetry+int32(1))/int32(2), lineno)) + Xsqlite3_log(tls, int32(SQLITE_NOTICE), __ccgo_ts+4883, libc.VaList(bp+8, _winIoerrRetryDelay*nRetry*(nRetry+int32(1))/int32(2), lineno)) } } @@ -101199,6 +95577,47 @@ func _winLockFile(tls *libc.TLS, phFile TLPHANDLE, flags TDWORD, offsetLow TDWOR return r } +// C documentation +// +// /* +// ** Lock a region of nByte bytes starting at offset offset of file hFile. +// ** Take an EXCLUSIVE lock if parameter bExclusive is true, or a SHARED lock +// ** otherwise. If nMs is greater than zero and the lock cannot be obtained +// ** immediately, block for that many ms before giving up. +// ** +// ** This function returns SQLITE_OK if the lock is obtained successfully. If +// ** some other process holds the lock, SQLITE_BUSY is returned if nMs==0, or +// ** SQLITE_BUSY_TIMEOUT otherwise. Or, if an error occurs, SQLITE_IOERR. +// */ +func _winHandleLockTimeout(tls *libc.TLS, _hFile THANDLE, offset TDWORD, nByte TDWORD, bExcl int32, nMs TDWORD) (r int32) { + bp := tls.Alloc(32) + defer tls.Free(32) + *(*THANDLE)(unsafe.Pointer(bp)) = _hFile + var flags TDWORD + var rc, v1 int32 + var ret TBOOL + var _ /* ovlp at bp+4 */ TOVERLAPPED + _, _, _, _ = flags, rc, ret, v1 + if bExcl != 0 { + v1 = int32(LOCKFILE_EXCLUSIVE_LOCK) + } else { + v1 = 0 + } + flags = uint32(int32(LOCKFILE_FAIL_IMMEDIATELY) | v1) + rc = SQLITE_OK + if !(libc.Int32FromInt32(1) != 0) { + ret = _winLockFile(tls, bp, flags, offset, uint32(0), nByte, uint32(0)) + } else { + libc.Xmemset(tls, bp+4, 0, uint32(20)) + (*(*TOVERLAPPED)(unsafe.Pointer(bp + 4))).F__ccgo2_8.F__ccgo0_0.FOffset = offset + ret = (*(*func(*libc.TLS, THANDLE, TDWORD, TDWORD, TDWORD, TDWORD, TLPOVERLAPPED) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(48)].FpCurrent})))(tls, *(*THANDLE)(unsafe.Pointer(bp)), flags, uint32(0), nByte, uint32(0), bp+4) + } + if rc == SQLITE_OK && !(ret != 0) { + rc = int32(SQLITE_BUSY) + } + return rc +} + // C documentation // // /* @@ -101219,6 +95638,27 @@ func _winUnlockFile(tls *libc.TLS, phFile TLPHANDLE, offsetLow TDWORD, offsetHig return r } +// C documentation +// +// /* +// ** Remove an nByte lock starting at offset iOff from HANDLE h. +// */ +func _winHandleUnlock(tls *libc.TLS, _h THANDLE, iOff int32, nByte int32) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + *(*THANDLE)(unsafe.Pointer(bp)) = _h + var ret TBOOL + var v1 int32 + _, _ = ret, v1 + ret = _winUnlockFile(tls, bp, uint32(iOff), uint32(0), uint32(nByte), uint32(0)) + if ret != 0 { + v1 = SQLITE_OK + } else { + v1 = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(8)<lastErrno and return non-zero. +// ** Seek the file handle h to offset nByte of the file. +// ** +// ** If successful, return SQLITE_OK. Or, if an error occurs, return an SQLite +// ** error code. // */ -func _winSeekFile(tls *libc.TLS, pFile uintptr, iOffset Tsqlite3_int64) (r int32) { +func _winHandleSeek(tls *libc.TLS, h THANDLE, iOffset Tsqlite3_int64) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var dwRet, lastErrno, v1 TDWORD + var dwRet, lastErrno TDWORD var lowerBits TLONG - var v2 bool + var rc int32 var _ /* upperBits at bp+0 */ TLONG - _, _, _, _, _ = dwRet, lastErrno, lowerBits, v1, v2 /* Value returned by GetLastError() */ + _, _, _, _ = dwRet, lastErrno, lowerBits, rc + rc = SQLITE_OK /* Value returned by SetFilePointer() */ *(*TLONG)(unsafe.Pointer(bp)) = int32(iOffset >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7fffffff)) lowerBits = int32(iOffset & libc.Int64FromUint32(0xffffffff)) + dwRet = (*(*func(*libc.TLS, THANDLE, TLONG, TPLONG, TDWORD) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(54)].FpCurrent})))(tls, h, lowerBits, bp, uint32(FILE_BEGIN)) /* API oddity: If successful, SetFilePointer() returns a dword ** containing the lower 32-bits of the new file-offset. Or, if it fails, ** it returns INVALID_SET_FILE_POINTER. However according to MSDN, ** INVALID_SET_FILE_POINTER may also be a valid new offset. So to determine ** whether an error has actually occurred, it is also necessary to call - ** GetLastError(). - */ - dwRet = (*(*func(*libc.TLS, THANDLE, TLONG, TPLONG, TDWORD) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(54)].FpCurrent})))(tls, (*TwinFile)(unsafe.Pointer(pFile)).Fh, lowerBits, bp, uint32(FILE_BEGIN)) - if v2 = dwRet == uint32(-libc.Int32FromInt32(1)); v2 { - v1 = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - lastErrno = v1 + ** GetLastError(). */ + if dwRet == uint32(-libc.Int32FromInt32(1)) { + lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) + if lastErrno != uint32(0) { + rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(22)<lastErrno and return non-zero. +// */ +func _winSeekFile(tls *libc.TLS, pFile uintptr, iOffset Tsqlite3_int64) (r int32) { + var rc int32 + _ = rc + rc = _winHandleSeek(tls, (*TwinFile)(unsafe.Pointer(pFile)).Fh, iOffset) + if rc != SQLITE_OK { + (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) + _winLogErrorAtLine(tls, rc, (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno, __ccgo_ts+4933, (*TwinFile)(unsafe.Pointer(pFile)).FzPath, int32(49992)) } - return 0 + return rc } // C documentation @@ -101308,7 +95764,7 @@ func _winClose(tls *libc.TLS, id uintptr) (r int32) { if rc != 0 { v5 = SQLITE_OK } else { - v5 = _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(16)< 0 { @@ -101520,7 +96029,7 @@ func _winSync(tls *libc.TLS, id uintptr, flags int32) (r int32) { if (*(*func(*libc.TLS, TLPCVOID, TSIZE_T) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(79)].FpCurrent})))(tls, (*TwinFile)(unsafe.Pointer(pFile)).FpMapRegion, uint32(0)) != 0 { } else { (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - return _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(24)<locktype to this value before exiting */ gotPendingLock = 0 /* True if we acquired a PENDING lock this time */ @@ -101685,48 +96200,48 @@ func _winLock(tls *libc.TLS, id uintptr, locktype int32) (r int32) { } /* Make sure the locking sequence is correct */ - /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or + /* Lock the PENDING_LOCK byte if we need to acquire an EXCLUSIVE lock or ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of ** the PENDING_LOCK byte is temporary. */ newLocktype = int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) - if int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) == NO_LOCK || locktype == int32(EXCLUSIVE_LOCK) && int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) <= int32(RESERVED_LOCK) { + if locktype == int32(SHARED_LOCK) || locktype == int32(EXCLUSIVE_LOCK) && int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) == int32(RESERVED_LOCK) { cnt = int32(3) - for { - v1 = cnt - cnt-- - if v3 = v1 > 0; v3 { - v2 = _winLockFile(tls, pFile+8, uint32(libc.Int32FromInt32(LOCKFILE_FAIL_IMMEDIATELY)|libc.Int32FromInt32(LOCKFILE_EXCLUSIVE_LOCK)), uint32(_sqlite3PendingByte), uint32(0), uint32(1), uint32(0)) - res = v2 - } - if !(v3 && v2 == 0) { - break - } + /* Flags for the LockFileEx() call. This should be an exclusive lock if + ** this call is to obtain EXCLUSIVE, or a shared lock if this call is to + ** obtain SHARED. */ + flags = int32(LOCKFILE_FAIL_IMMEDIATELY) + if locktype == int32(EXCLUSIVE_LOCK) { + flags |= int32(LOCKFILE_EXCLUSIVE_LOCK) + } + for cnt > 0 { /* Try 3 times to get the pending lock. This is needed to work ** around problems caused by indexing and/or anti-virus software on ** Windows systems. + ** ** If you are using this code as a model for alternative VFSes, do not - ** copy this retry logic. It is a hack intended for Windows only. - */ + ** copy this retry logic. It is a hack intended for Windows only. */ + res = _winLockFile(tls, pFile+8, uint32(flags), uint32(_sqlite3PendingByte), uint32(0), uint32(1), uint32(0)) + if res != 0 { + break + } lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) if lastErrno == uint32(6) { (*TwinFile)(unsafe.Pointer(pFile)).FlastErrno = lastErrno rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(15)< 0 { Xsqlite3_win32_sleep(tls, uint32(1)) } } gotPendingLock = res - if !(res != 0) { - lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - } } /* Acquire a shared lock */ if locktype == int32(SHARED_LOCK) && res != 0 { - res = _winGetReadLock(tls, pFile) + res = _winGetReadLock(tls, pFile, 0) if res != 0 { newLocktype = int32(SHARED_LOCK) } else { @@ -101758,7 +96273,7 @@ func _winLock(tls *libc.TLS, id uintptr, locktype int32) (r int32) { newLocktype = int32(EXCLUSIVE_LOCK) } else { lastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - _winGetReadLock(tls, pFile) + _winGetReadLock(tls, pFile, 0) } } /* If we are holding a PENDING lock that ought to be released, then @@ -101827,10 +96342,10 @@ func _winUnlock(tls *libc.TLS, id uintptr, locktype int32) (r int32) { type1 = int32((*TwinFile)(unsafe.Pointer(pFile)).Flocktype) if type1 >= int32(EXCLUSIVE_LOCK) { _winUnlockFile(tls, pFile+8, uint32(_sqlite3PendingByte+libc.Int32FromInt32(2)), uint32(0), uint32(SHARED_SIZE), uint32(0)) - if locktype == int32(SHARED_LOCK) && !(_winGetReadLock(tls, pFile) != 0) { + if locktype == int32(SHARED_LOCK) && !(_winGetReadLock(tls, pFile, 0) != 0) { /* This should never happen. We should always be able to ** reacquire the read lock */ - rc = _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(8)<= int32(RESERVED_LOCK) { @@ -101954,7 +96469,7 @@ func _winFileControl(tls *libc.TLS, id uintptr, op int32, pArg uintptr) (r int32 _winModeBit(tls, pFile, uint8(WINFILE_PSOW), pArg) return SQLITE_OK case int32(SQLITE_FCNTL_VFSNAME): - *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+24, (*Tsqlite3_vfs)(unsafe.Pointer((*TwinFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) + *(*uintptr)(unsafe.Pointer(pArg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+24, (*Tsqlite3_vfs)(unsafe.Pointer((*TwinFile)(unsafe.Pointer(pFile)).FpVfs)).FzName)) return SQLITE_OK case int32(SQLITE_FCNTL_WIN32_AV_RETRY): a = pArg @@ -102079,47 +96594,6 @@ func _winShmLeaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _winBigLock) } -/* -** Object used to represent a single file opened and mmapped to provide -** shared memory. When multiple threads all reference the same -** log-summary, each thread has its own winFile object, but they all -** point to a single instance of this object. In other words, each -** log-summary is opened only once per process. -** -** winShmMutexHeld() must be true when creating or destroying -** this object or while reading or writing the following fields: -** -** nRef -** pNext -** -** The following fields are read-only after the object is created: -** -** fid -** zFilename -** -** Either winShmNode.mutex must be held or winShmNode.nRef==0 and -** winShmMutexHeld() is true when reading or writing any other field -** in this structure. -** - */ -type TwinShmNode1 = struct { - F__ccgo_align [0]uint32 - Fmutex uintptr - FzFilename uintptr - FhFile TwinFile - FszRegion int32 - FnRegion int32 - FisReadonly Tu8 - FisUnlocked Tu8 - FaRegion uintptr - FlastErrno TDWORD - FnRef int32 - FpFirst uintptr - FpNext uintptr -} - -type winShmNode1 = TwinShmNode1 - // C documentation // // /* @@ -102129,64 +96603,6 @@ type winShmNode1 = TwinShmNode1 // */ var _winShmNodeList = uintptr(0) -/* -** Structure used internally by this VFS to record the state of an -** open shared memory connection. -** -** The following fields are initialized when this object is created and -** are read-only thereafter: -** -** winShm.pShmNode -** winShm.id -** -** All other fields are read/write. The winShm.pShmNode->mutex must be held -** while accessing any read/write fields. - */ -type TwinShm1 = struct { - FpShmNode uintptr - FpNext uintptr - FhasMutex Tu8 - FsharedMask Tu16 - FexclMask Tu16 -} - -type winShm1 = TwinShm1 - -/* -** Constants used for locking - */ - -// C documentation -// -// /* -// ** Apply advisory locks for all n bytes beginning at ofst. -// */ -func _winShmSystemLock(tls *libc.TLS, pFile uintptr, lockType int32, ofst int32, nByte int32) (r int32) { - var dwFlags TDWORD - var rc int32 - _, _ = dwFlags, rc - rc = 0 /* Result code form Lock/UnlockFileEx() */ - /* Access to the winShmNode object is serialized by the caller */ - /* Release/Acquire the system-level lock */ - if lockType == int32(WINSHM_UNLCK) { - rc = _winUnlockFile(tls, pFile+8+8, uint32(ofst), uint32(0), uint32(nByte), uint32(0)) - } else { - /* Initialize the locking parameters */ - dwFlags = uint32(LOCKFILE_FAIL_IMMEDIATELY) - if lockType == int32(WINSHM_WRLCK) { - dwFlags |= uint32(LOCKFILE_EXCLUSIVE_LOCK) - } - rc = _winLockFile(tls, pFile+8+8, dwFlags, uint32(ofst), uint32(0), uint32(nByte), uint32(0)) - } - if rc != 0 { - rc = SQLITE_OK - } else { - (*TwinShmNode)(unsafe.Pointer(pFile)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - rc = int32(SQLITE_BUSY) - } - return rc -} - // C documentation // // /* @@ -102225,9 +96641,7 @@ func _winShmPurge(tls *libc.TLS, pVfs uintptr, deleteFlag int32) { ; i++ } - if (*TwinShmNode)(unsafe.Pointer(p)).FhFile.Fh != libc.UintptrFromInt32(0) && (*TwinShmNode)(unsafe.Pointer(p)).FhFile.Fh != uintptr(int32(-libc.Int32FromInt32(1))) { - _winClose(tls, p+8) - } + _winHandleClose(tls, (*TwinShmNode)(unsafe.Pointer(p)).FhSharedShm) if deleteFlag != 0 { _sqlite3BeginBenignMalloc(tls) _winDelete(tls, pVfs, (*TwinShmNode)(unsafe.Pointer(p)).FzFilename, 0) @@ -102237,7 +96651,7 @@ func _winShmPurge(tls *libc.TLS, pVfs uintptr, deleteFlag int32) { Xsqlite3_free(tls, (*TwinShmNode)(unsafe.Pointer(p)).FaRegion) Xsqlite3_free(tls, p) } else { - pp = p + 100 + pp = p + 40 } } } @@ -102245,73 +96659,187 @@ func _winShmPurge(tls *libc.TLS, pVfs uintptr, deleteFlag int32) { // C documentation // // /* -// ** The DMS lock has not yet been taken on shm file pShmNode. Attempt to -// ** take it now. Return SQLITE_OK if successful, or an SQLite error -// ** code otherwise. -// ** -// ** If the DMS cannot be locked because this is a readonly_shm=1 -// ** connection and no other process already holds a lock, return -// ** SQLITE_READONLY_CANTINIT and set pShmNode->isUnlocked=1. +// ** The DMS lock has not yet been taken on the shm file associated with +// ** pShmNode. Take the lock. Truncate the *-shm file if required. +// ** Return SQLITE_OK if successful, or an SQLite error code otherwise. // */ -func _winLockSharedMemory(tls *libc.TLS, pShmNode uintptr) (r int32) { +func _winLockSharedMemory(tls *libc.TLS, pShmNode uintptr, nMs TDWORD) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) var rc int32 + var _ /* h at bp+0 */ THANDLE _ = rc - rc = _winShmSystemLock(tls, pShmNode, int32(WINSHM_WRLCK), (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) + *(*THANDLE)(unsafe.Pointer(bp)) = (*TwinShmNode)(unsafe.Pointer(pShmNode)).FhSharedShm + rc = SQLITE_OK + rc = _winHandleLockTimeout(tls, *(*THANDLE)(unsafe.Pointer(bp)), uint32((libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK)), uint32(1), int32(1), uint32(0)) if rc == SQLITE_OK { + /* We have an EXCLUSIVE lock on the DMS byte. This means that this + ** is the first process to open the file. Truncate it to zero bytes + ** in this case. */ if (*TwinShmNode)(unsafe.Pointer(pShmNode)).FisReadonly != 0 { - (*TwinShmNode)(unsafe.Pointer(pShmNode)).FisUnlocked = uint8(1) - _winShmSystemLock(tls, pShmNode, int32(WINSHM_UNLCK), (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) - return libc.Int32FromInt32(SQLITE_READONLY) | libc.Int32FromInt32(5)<:/" or ":\", +// ** it is converted to UTF-16 as-is. +// ** - If the filename contains '/', it is assumed to be a +// ** Cygwin absolute path, it is converted to a win32 +// ** absolute path in UTF-16. +// ** - Otherwise it must be a filename only, the win32 filename +// ** is returned in UTF-16. +// ** Note: If the function cygwin_conv_path() fails, only +// ** UTF-8 -> UTF-16 conversion will be done. This can only +// ** happen when the file path >32k, in which case winUtf8ToUnicode() +// ** will fail too. +// */ +func _winConvertFromUtf8Filename(tls *libc.TLS, zFilename uintptr) (r uintptr) { + var zConverted uintptr + _ = zConverted + zConverted = uintptr(0) + if int32(1) != 0 { + zConverted = _winUtf8ToUnicode(tls, zFilename) + } else { + zConverted = _winUtf8ToMbcs(tls, zFilename, (*(*func(*libc.TLS) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[0].FpCurrent})))(tls)) + } + /* caller will handle out of memory */ + return zConverted +} + +// C documentation +// +// /* +// ** This function is used to open a handle on a *-shm file. // ** -// ** When opening a new shared-memory file, if no other instances of that -// ** file are currently open, in this process or in other processes, then -// ** the file must be truncated to zero length or have its header cleared. +// ** If SQLITE_ENABLE_SETLK_TIMEOUT is defined at build time, then the file +// ** is opened with FILE_FLAG_OVERLAPPED specified. If not, it is not. +// */ +func _winHandleOpen(tls *libc.TLS, zUtf8 uintptr, pbReadonly uintptr, ph uintptr) (r int32) { + bp := tls.Alloc(16) + defer tls.Free(16) + var flag_overlapped TDWORD + var rc, v1, v2 int32 + var zConverted uintptr + var _ /* bReadonly at bp+0 */ int32 + var _ /* h at bp+4 */ THANDLE + _, _, _, _, _ = flag_overlapped, rc, zConverted, v1, v2 + rc = SQLITE_OK + zConverted = uintptr(0) + *(*int32)(unsafe.Pointer(bp)) = *(*int32)(unsafe.Pointer(pbReadonly)) + *(*THANDLE)(unsafe.Pointer(bp + 4)) = uintptr(int32(-libc.Int32FromInt32(1))) + flag_overlapped = uint32(0) + /* Convert the filename to the system encoding. */ + zConverted = _winConvertFromUtf8Filename(tls, zUtf8) + if zConverted == uintptr(0) { + rc = libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)<pFirst. This must be done while holding the pShmNode->mutex - ** mutex. - */ - Xsqlite3_mutex_enter(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - (*TwinShm1)(unsafe.Pointer(p)).FpNext = (*TwinShmNode)(unsafe.Pointer(pShmNode)).FpFirst - (*TwinShmNode)(unsafe.Pointer(pShmNode)).FpFirst = p - Xsqlite3_mutex_leave(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - return rc - /* Jump here on any error */ - goto shm_open_err -shm_open_err: - ; - _winShmSystemLock(tls, pShmNode, int32(WINSHM_UNLCK), (libc.Int32FromInt32(22)+libc.Int32FromInt32(SQLITE_SHM_NLOCK))*libc.Int32FromInt32(4)+libc.Int32FromInt32(SQLITE_SHM_NLOCK), int32(1)) - _winShmPurge(tls, (*TwinFile)(unsafe.Pointer(pDbFd)).FpVfs, 0) /* This call frees pShmNode if required */ - Xsqlite3_free(tls, p) Xsqlite3_free(tls, pNew) - _winShmLeaveMutex(tls) return rc } @@ -102400,40 +96909,28 @@ shm_open_err: // ** storage if deleteFlag is true. // */ func _winShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) (r int32) { - var p, pDbFd, pShmNode, pp uintptr - _, _, _, _ = p, pDbFd, pShmNode, pp /* For looping over sibling connections */ + var p, pDbFd, pShmNode uintptr + _, _, _ = p, pDbFd, pShmNode /* The underlying shared-memory file */ pDbFd = fd p = (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm if p == uintptr(0) { return SQLITE_OK } - pShmNode = (*TwinShm)(unsafe.Pointer(p)).FpShmNode - /* Remove connection p from the set of connections associated - ** with pShmNode */ - Xsqlite3_mutex_enter(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - pp = pShmNode + 96 - for { - if !(*(*uintptr)(unsafe.Pointer(pp)) != p) { - break - } - goto _1 - _1: - ; - pp = *(*uintptr)(unsafe.Pointer(pp)) + 4 + if (*TwinShm)(unsafe.Pointer(p)).FhShm != uintptr(int32(-libc.Int32FromInt32(1))) { + (*(*func(*libc.TLS, THANDLE) TBOOL)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(3)].FpCurrent})))(tls, (*TwinShm)(unsafe.Pointer(p)).FhShm) } - *(*uintptr)(unsafe.Pointer(pp)) = (*TwinShm)(unsafe.Pointer(p)).FpNext - /* Free the connection p */ - Xsqlite3_free(tls, p) - (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm = uintptr(0) - Xsqlite3_mutex_leave(tls, (*TwinShmNode)(unsafe.Pointer(pShmNode)).Fmutex) - /* If pShmNode->nRef has reached 0, then close the underlying - ** shared-memory file, too */ + pShmNode = (*TwinShm)(unsafe.Pointer(p)).FpShmNode _winShmEnterMutex(tls) + /* If pShmNode->nRef has reached 0, then close the underlying + ** shared-memory file, too. */ (*TwinShmNode)(unsafe.Pointer(pShmNode)).FnRef-- if (*TwinShmNode)(unsafe.Pointer(pShmNode)).FnRef == 0 { _winShmPurge(tls, (*TwinFile)(unsafe.Pointer(pDbFd)).FpVfs, deleteFlag) } _winShmLeaveMutex(tls) + /* Free the connection p */ + Xsqlite3_free(tls, p) + (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm = uintptr(0) return SQLITE_OK } @@ -102443,13 +96940,15 @@ func _winShmUnmap(tls *libc.TLS, fd uintptr, deleteFlag int32) (r int32) { // ** Change the lock state for a shared-memory segment. // */ func _winShmLock(tls *libc.TLS, fd uintptr, ofst int32, n int32, flags int32) (r int32) { - var allMask, allShared, mask Tu16 - var p, pDbFd, pShmNode, pX, p2, p3, p5, p7 uintptr - var rc int32 - _, _, _, _, _, _, _, _, _, _, _, _ = allMask, allShared, mask, p, pDbFd, pShmNode, pX, rc, p2, p3, p5, p7 + var bExcl, rc, v1 int32 + var mask Tu16 + var nMs TDWORD + var p, pDbFd, pShmNode uintptr + _, _, _, _, _, _, _, _ = bExcl, mask, nMs, p, pDbFd, pShmNode, rc, v1 pDbFd = fd /* Connection holding shared memory */ p = (*TwinFile)(unsafe.Pointer(pDbFd)).FpShm - rc = SQLITE_OK /* Mask of locks to take or release */ + rc = SQLITE_OK /* Result code */ + mask = uint16(libc.Uint32FromUint32(1)<<(ofst+n) - libc.Uint32FromUint32(1)<=3 && ofst>libc.Int32FromInt32(32)&libc.Int64FromUint32(0xffffffff)), uint32(*(*Tsqlite3_int64)(unsafe.Pointer(bp))&libc.Int64FromUint32(0xffffffff)), libc.UintptrFromInt32(0)) if (*TwinFile)(unsafe.Pointer(pFd)).FhMap == libc.UintptrFromInt32(0) { (*TwinFile)(unsafe.Pointer(pFd)).FlastErrno = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(26)].FpCurrent})))(tls) - rc = _winLogErrorAtLine(tls, libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(24)< 0 { if !(int32(*(*int8)(unsafe.Pointer(Xsqlite3_temp_directory + uintptr(nDirLen-int32(1))))) == int32('/') || int32(*(*int8)(unsafe.Pointer(Xsqlite3_temp_directory + uintptr(nDirLen-int32(1))))) == int32('\\')) { nDirLen++ } - if nDirLen > nDir { + if int64(nDirLen) > nDir { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) Xsqlite3_free(tls, zBuf) - return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5091, uintptr(0), int32(51668)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5179, uintptr(0), int32(52323)) } - Xsqlite3_snprintf(tls, nMax, zBuf, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_temp_directory)) + Xsqlite3_snprintf(tls, int32(nMax), zBuf, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_temp_directory)) } Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) } else { if int32(1) != 0 { - zWidePath = _sqlite3MallocZero(tls, uint64(uint32(nMax)*uint32(2))) + zWidePath = _sqlite3MallocZero(tls, uint64(nMax*int64(2))) if !(zWidePath != 0) { Xsqlite3_free(tls, zBuf) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)< nBuf { + nLen = int64(_sqlite3Strlen30(tls, zBuf)) + if nLen+int64(nPre)+int64(17) > nBuf { Xsqlite3_free(tls, zBuf) - return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5155, uintptr(0), int32(51837)) + return _winLogErrorAtLine(tls, int32(SQLITE_ERROR), uint32(0), __ccgo_ts+5243, uintptr(0), int32(52460)) } - Xsqlite3_snprintf(tls, nBuf-int32(16)-nLen, zBuf+uintptr(nLen), __ccgo_ts+5083, 0) + Xsqlite3_snprintf(tls, int32(nBuf-int64(16)-nLen), zBuf+uintptr(nLen), __ccgo_ts+5171, 0) j = uint32(_sqlite3Strlen30(tls, zBuf)) Xsqlite3_randomness(tls, int32(15), zBuf+uintptr(j)) pid = (*(*func(*libc.TLS) TDWORD)(unsafe.Pointer(&struct{ uintptr }{_aSyscall[int32(17)].FpCurrent})))(tls) @@ -103199,34 +97636,39 @@ func _winIsDir(tls *libc.TLS, zConverted uintptr) (r int32) { return libc.BoolInt32(attr != uint32(-libc.Int32FromInt32(1)) && attr&uint32(FILE_ATTRIBUTE_DIRECTORY) != 0) } +/* +** The Windows version of xAccess() accepts an extra bit in the flags +** parameter that prevents an anti-virus retry loop. + */ + // C documentation // // /* // ** Open a file. // */ func _winOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, id uintptr, flags int32, pOutFlags uintptr) (r int32) { - bp := tls.Alloc(32) - defer tls.Free(32) + bp := tls.Alloc(16) + defer tls.Free(16) var dwCreationDisposition, dwDesiredAccess, dwFlagsAndAttributes, dwShareMode TDWORD var h THANDLE var isCreate, isDelete, isExclusive, isReadWrite, isReadonly, rc, rc2, rc21 int32 var pAppData, pFile, zConverted, zUtf8Name, v1, p2, p3 uintptr var _ /* cnt at bp+4 */ int32 - var _ /* isRO at bp+12 */ int32 - var _ /* isRO at bp+16 */ int32 + var _ /* isRO at bp+8 */ int32 var _ /* lastErrno at bp+0 */ TDWORD - var _ /* zTmpname at bp+8 */ uintptr + var _ /* zTmpname at bp+12 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = dwCreationDisposition, dwDesiredAccess, dwFlagsAndAttributes, dwShareMode, h, isCreate, isDelete, isExclusive, isReadWrite, isReadonly, pAppData, pFile, rc, rc2, rc21, zConverted, zUtf8Name, v1, p2, p3 *(*TDWORD)(unsafe.Pointer(bp)) = uint32(0) dwFlagsAndAttributes = uint32(0) pFile = id /* Filename in OS encoding */ zUtf8Name = zName /* Filename in UTF-8 encoding */ *(*int32)(unsafe.Pointer(bp + 4)) = 0 + *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* file is known to be accessible readonly */ /* If argument zPath is a NULL pointer, this function is required to open ** a temporary file. Use this buffer to store the file name in. */ - *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) /* For temporary filename, if necessary. */ - rc = SQLITE_OK /* Function Return Code */ + *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) /* For temporary filename, if necessary. */ + rc = SQLITE_OK /* Function Return Code */ isExclusive = flags & int32(SQLITE_OPEN_EXCLUSIVE) isDelete = flags & int32(SQLITE_OPEN_DELETEONCLOSE) isCreate = flags & int32(SQLITE_OPEN_CREATE) @@ -103248,11 +97690,11 @@ func _winOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, id uintptr, flags int3 ** temporary file name to use */ if !(zUtf8Name != 0) { - rc = _winGetTempname(tls, pVfs, bp+8) + rc = _winGetTempname(tls, pVfs, bp+12) if rc != SQLITE_OK { return rc } - zUtf8Name = *(*uintptr)(unsafe.Pointer(bp + 8)) + zUtf8Name = *(*uintptr)(unsafe.Pointer(bp + 12)) } /* Database filenames are double-zero terminated if they are not ** URIs with parameters. Hence, they can always be passed into @@ -103261,12 +97703,12 @@ func _winOpen(tls *libc.TLS, pVfs uintptr, zName uintptr, id uintptr, flags int3 /* Convert the filename to the system encoding. */ zConverted = _winConvertFromUtf8Filename(tls, zUtf8Name) if zConverted == uintptr(0) { - Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 8))) + Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 12))) return libc.Int32FromInt32(SQLITE_IOERR) | libc.Int32FromInt32(12)<BITVEC_NBIT and iDivisor==0 then Bitvec.u.aHash[] is -** a hash table that will hold up to BITVEC_MXHASH distinct values. -** -** Otherwise, the value i is redirected into one of BITVEC_NPTR -** sub-bitmaps pointed to by Bitvec.u.apSub[]. Each subbitmap -** handles up to iDivisor separate values of i. apSub[0] holds -** values between 1 and iDivisor. apSub[1] holds values between -** iDivisor+1 and 2*iDivisor. apSub[N] holds values between -** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized -** to hold deal with values between 1 and iDivisor. - */ -type TBitvec1 = struct { - FiSize Tu32 - FnSet Tu32 - FiDivisor Tu32 - Fu struct { - FaHash [0][125]Tu32 - FapSub [0][125]uintptr - FaBitmap [500]Tu8 - } -} - -type Bitvec1 = TBitvec1 - // C documentation // // /* @@ -105321,7 +99594,13 @@ bitvec_set_rehash: } else { libc.Xmemcpy(tls, aiValues, p+12, uint32(500)) libc.Xmemset(tls, p+12, 0, uint32(500)) - (*TBitvec)(unsafe.Pointer(p)).FiDivisor = ((*TBitvec)(unsafe.Pointer(p)).FiSize + (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4) - uint32(1)) / ((libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(4)) + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (*TBitvec)(unsafe.Pointer(p)).FiSize / ((libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(4)) + if (*TBitvec)(unsafe.Pointer(p)).FiSize%((libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(4)) != uint32(0) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor++ + } + if (*TBitvec)(unsafe.Pointer(p)).FiDivisor < (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { + (*TBitvec)(unsafe.Pointer(p)).FiDivisor = (libc.Uint32FromInt32(BITVEC_SZ) - libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4)) / libc.Uint32FromInt64(4) * libc.Uint32FromInt64(4) / libc.Uint32FromInt64(1) * libc.Uint32FromInt32(BITVEC_SZELEM) + } rc = _sqlite3BitvecSet(tls, p, i) j = uint32(0) for { @@ -105375,7 +99654,7 @@ func _sqlite3BitvecClear(tls *libc.TLS, p uintptr, i Tu32, pBuf uintptr) { } if (*TBitvec)(unsafe.Pointer(p)).FiSize <= (libc.Uint32FromInt32(BITVEC_SZ)-libc.Uint32FromInt32(3)*libc.Uint32FromInt64(4))/libc.Uint32FromInt64(4)*libc.Uint32FromInt64(4)/libc.Uint32FromInt64(1)*libc.Uint32FromInt32(BITVEC_SZELEM) { p1 = p + 12 + uintptr(i/uint32(BITVEC_SZELEM)) - *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^(libc.Int32FromInt32(1) << (i & uint32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1))))) + *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & ^int32(uint8(libc.Int32FromInt32(1)<<(i&uint32(libc.Int32FromInt32(BITVEC_SZELEM)-libc.Int32FromInt32(1)))))) } else { aiValues = pBuf libc.Xmemcpy(tls, aiValues, p+12, uint32(500)) @@ -105494,7 +99773,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { /* Allocate the Bitvec to be tested and a linear array of ** bits to act as the reference */ pBitvec = _sqlite3BitvecCreate(tls, uint32(sz)) - pV = _sqlite3MallocZero(tls, uint64((sz+int32(7))/int32(8)+int32(1))) + pV = _sqlite3MallocZero(tls, uint64((int64(7)+int64(sz))/int64(8)+int64(1))) pTmpSpace = Xsqlite3_malloc64(tls, uint64(BITVEC_SZ)) if pBitvec == uintptr(0) || pV == uintptr(0) || pTmpSpace == uintptr(0) { goto bitvec_end @@ -105548,7 +99827,7 @@ func _sqlite3BitvecBuiltinTest(tls *libc.TLS, sz int32, aOp uintptr) (r int32) { } } else { p6 = pV + uintptr((*(*int32)(unsafe.Pointer(bp))+int32(1))>>int32(3)) - *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^(libc.Int32FromInt32(1) << ((*(*int32)(unsafe.Pointer(bp)) + libc.Int32FromInt32(1)) & libc.Int32FromInt32(7)))) + *(*uint8)(unsafe.Pointer(p6)) = uint8(int32(*(*uint8)(unsafe.Pointer(p6))) & ^int32(uint8(libc.Int32FromInt32(1)<<((*(*int32)(unsafe.Pointer(bp))+libc.Int32FromInt32(1))&libc.Int32FromInt32(7))))) _sqlite3BitvecClear(tls, pBitvec, uint32(*(*int32)(unsafe.Pointer(bp))+int32(1)), pTmpSpace) } } @@ -105582,68 +99861,6 @@ bitvec_end: return rc } -/************** End of bitvec.c **********************************************/ -/************** Begin file pcache.c ******************************************/ -/* -** 2008 August 05 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file implements that page cache. - */ -/* #include "sqliteInt.h" */ - -/* -** A complete page cache is an instance of this structure. Every -** entry in the cache holds a single page of the database file. The -** btree layer only operates on the cached copy of the database pages. -** -** A page cache entry is "clean" if it exactly matches what is currently -** on disk. A page is "dirty" if it has been modified and needs to be -** persisted to disk. -** -** pDirty, pDirtyTail, pSynced: -** All dirty pages are linked into the doubly linked list using -** PgHdr.pDirtyNext and pDirtyPrev. The list is maintained in LRU order -** such that p was added to the list more recently than p->pDirtyNext. -** PCache.pDirty points to the first (newest) element in the list and -** pDirtyTail to the last (oldest). -** -** The PCache.pSynced variable is used to optimize searching for a dirty -** page to eject from the cache mid-transaction. It is better to eject -** a page that does not require a journal sync than one that does. -** Therefore, pSynced is maintained so that it *almost* always points -** to either the oldest page in the pDirty/pDirtyTail list that has a -** clear PGHDR_NEED_SYNC flag or to a page that is older than this one -** (so that the right page to eject can be found by following pDirtyPrev -** pointers). - */ -type TPCache2 = struct { - F__ccgo_align [0]uint32 - FpDirty uintptr - FpDirtyTail uintptr - FpSynced uintptr - F__ccgo_align3 [4]byte - FnRefSum Ti64 - FszCache int32 - FszSpill int32 - FszPage int32 - FszExtra int32 - FbPurgeable Tu8 - FeCreate Tu8 - FxStress uintptr - FpStress uintptr - FpCache uintptr -} - -type PCache2 = TPCache2 - /********************************** Test and Debug Logic **********************/ /* ** Debug tracing macros. Enable by by changing the "0" to "1" and @@ -105817,14 +100034,14 @@ func _sqlite3PcacheSize(tls *libc.TLS) (r int32) { // ** to this module, the extra space really ends up being the MemPage // ** structure in the pager. // */ -func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, xStress uintptr, pStress uintptr, p uintptr) (r int32) { +func _sqlite3PcacheOpen(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32, __ccgo_fp_xStress uintptr, pStress uintptr, p uintptr) (r int32) { libc.Xmemset(tls, p, 0, uint32(56)) (*TPCache)(unsafe.Pointer(p)).FszPage = int32(1) (*TPCache)(unsafe.Pointer(p)).FszExtra = szExtra /* First 8 bytes will be zeroed */ (*TPCache)(unsafe.Pointer(p)).FbPurgeable = uint8(bPurgeable) (*TPCache)(unsafe.Pointer(p)).FeCreate = uint8(2) - (*TPCache)(unsafe.Pointer(p)).FxStress = xStress + (*TPCache)(unsafe.Pointer(p)).FxStress = __ccgo_fp_xStress (*TPCache)(unsafe.Pointer(p)).FpStress = pStress (*TPCache)(unsafe.Pointer(p)).FszCache = int32(100) (*TPCache)(unsafe.Pointer(p)).FszSpill = int32(1) @@ -106640,123 +100857,6 @@ type TPGroup = struct { type PGroup = TPGroup -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly before this structure and is used to cache the page content. -** -** When reading a corrupt database file, it is possible that SQLite might -** read a few bytes (no more than 16 bytes) past the end of the page buffer. -** It will only read past the end of the page buffer, never write. This -** object is positioned immediately after the page buffer to serve as an -** overrun area, so that overreads are harmless. -** -** Variables isBulkLocal and isAnchor were once type "u8". That works, -** but causes a 2-byte gap in the structure for most architectures (since -** pointers must be either 4 or 8-byte aligned). As this structure is located -** in memory directly after the associated page data, if the database is -** corrupt, code at the b-tree layer may overread the page buffer and -** read part of this structure before the corruption is detected. This -** can cause a valgrind error if the uninitialized gap is accessed. Using u16 -** ensures there is no such gap, and therefore no bytes of uninitialized -** memory in the structure. -** -** The pLruNext and pLruPrev pointers form a double-linked circular list -** of all pages that are unpinned. The PGroup.lru element (which should be -** the only element on the list with PgHdr1.isAnchor set to 1) forms the -** beginning and the end of the list. - */ -type TPgHdr11 = struct { - Fpage Tsqlite3_pcache_page - FiKey uint32 - FisBulkLocal Tu16 - FisAnchor Tu16 - FpNext uintptr - FpCache uintptr - FpLruNext uintptr - FpLruPrev uintptr -} - -type PgHdr11 = TPgHdr11 - -/* -** A page is pinned if it is not on the LRU list. To be "pinned" means -** that the page is in active use and must not be deallocated. - */ - -/* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set -** of one or more PCaches that are able to recycle each other's unpinned -** pages when they are under memory pressure. A PGroup is an instance of -** the following object. -** -** This page cache implementation works in one of two modes: -** -** (1) Every PCache is the sole member of its own PGroup. There is -** one PGroup per PCache. -** -** (2) There is a single global PGroup that all PCaches are a member -** of. -** -** Mode 1 uses more memory (since PCache instances are not able to rob -** unused pages from other PCaches) but it also operates without a mutex, -** and is therefore often faster. Mode 2 requires a mutex in order to be -** threadsafe, but recycles pages more efficiently. -** -** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single -** PGroup which is the pcache1.grp global variable and its mutex is -** SQLITE_MUTEX_STATIC_LRU. - */ -type TPGroup1 = struct { - Fmutex uintptr - FnMaxPage uint32 - FnMinPage uint32 - FmxPinned uint32 - FnPurgeable uint32 - Flru TPgHdr1 -} - -type PGroup1 = TPGroup1 - -/* Each page cache is an instance of the following object. Every -** open database file (including each in-memory database and each -** temporary or transient database) has a single page cache which -** is an instance of this object. -** -** Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles. - */ -type TPCache11 = struct { - FpGroup uintptr - FpnPurgeable uintptr - FszPage int32 - FszExtra int32 - FszAlloc int32 - FbPurgeable int32 - FnMin uint32 - FnMax uint32 - Fn90pct uint32 - FiMaxKey uint32 - FnPurgeableDummy uint32 - FnRecyclable uint32 - FnPage uint32 - FnHash uint32 - FapHash uintptr - FpFree uintptr - FpBulk uintptr -} - -type PCache11 = TPCache11 - -/* -** Free slots in the allocator used to divide up the global page cache -** buffer provided using the SQLITE_CONFIG_PAGECACHE mechanism. - */ -type TPgFreeslot1 = struct { - FpNext uintptr -} - -type PgFreeslot1 = TPgFreeslot1 - // C documentation // // /* @@ -106837,7 +100937,7 @@ func _sqlite3PCacheBufferSetup(tls *libc.TLS, pBuf uintptr, sz int32, n int32) { _pcache1_g.FnReserve = v3 _pcache1_g.FpStart = pBuf _pcache1_g.FpFree = uintptr(0) - _pcache1_g.FbUnderPressure = 0 + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(0), libc.Int32FromInt32(__ATOMIC_RELAXED)) for { v4 = n n-- @@ -106931,7 +101031,7 @@ func _pcache1Alloc(tls *libc.TLS, nByte int32) (r uintptr) { if p != 0 { _pcache1_g.FpFree = (*TPgFreeslot)(unsafe.Pointer(_pcache1_g.FpFree)).FpNext _pcache1_g.FnFreeSlot-- - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) _sqlite3StatusHighwater(tls, int32(SQLITE_STATUS_PAGECACHE_SIZE), nByte) _sqlite3StatusUp(tls, int32(SQLITE_STATUS_PAGECACHE_USED), int32(1)) } @@ -106972,7 +101072,7 @@ func _pcache1Free(tls *libc.TLS, p uintptr) { (*TPgFreeslot)(unsafe.Pointer(pSlot)).FpNext = _pcache1_g.FpFree _pcache1_g.FpFree = pSlot _pcache1_g.FnFreeSlot++ - _pcache1_g.FbUnderPressure = libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve) + libc.AtomicStoreNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.BoolInt32(_pcache1_g.FnFreeSlot < _pcache1_g.FnReserve), libc.Int32FromInt32(__ATOMIC_RELAXED)) Xsqlite3_mutex_leave(tls, _pcache1_g.Fmutex) } else { nFreed = 0 @@ -107100,7 +101200,7 @@ func _sqlite3PageFree(tls *libc.TLS, p uintptr) { // */ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { if _pcache1_g.FnSlot != 0 && (*TPCache1)(unsafe.Pointer(pCache)).FszPage+(*TPCache1)(unsafe.Pointer(pCache)).FszExtra <= _pcache1_g.FszSlot { - return _pcache1_g.FbUnderPressure + return libc.AtomicLoadNInt32(uintptr(unsafe.Pointer(&_pcache1_g))+96, libc.Int32FromInt32(__ATOMIC_RELAXED)) } else { return _sqlite3HeapNearlyFull(tls) } @@ -107120,17 +101220,19 @@ func _pcache1UnderMemoryPressure(tls *libc.TLS, pCache uintptr) (r int32) { // */ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { var apNew, pNext, pPage, v2 uintptr - var h, i, nNew uint32 + var h uint32 + var i Tu32 + var nNew Tu64 _, _, _, _, _, _, _ = apNew, h, i, nNew, pNext, pPage, v2 - nNew = (*TPCache1)(unsafe.Pointer(p)).FnHash * uint32(2) - if nNew < uint32(256) { - nNew = uint32(256) + nNew = uint64(2) * uint64((*TPCache1)(unsafe.Pointer(p)).FnHash) + if nNew < uint64(256) { + nNew = uint64(256) } Xsqlite3_mutex_leave(tls, (*TPGroup)(unsafe.Pointer((*TPCache1)(unsafe.Pointer(p)).FpGroup)).Fmutex) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3BeginBenignMalloc(tls) } - apNew = _sqlite3MallocZero(tls, uint64(uint32(4)*nNew)) + apNew = _sqlite3MallocZero(tls, uint64(4)*nNew) if (*TPCache1)(unsafe.Pointer(p)).FnHash != 0 { _sqlite3EndBenignMalloc(tls) } @@ -107148,7 +101250,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { if !(v2 != uintptr(0)) { break } - h = (*TPgHdr1)(unsafe.Pointer(pPage)).FiKey % nNew + h = uint32(uint64((*TPgHdr1)(unsafe.Pointer(pPage)).FiKey) % nNew) pNext = (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext (*TPgHdr1)(unsafe.Pointer(pPage)).FpNext = *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4)) *(*uintptr)(unsafe.Pointer(apNew + uintptr(h)*4)) = pPage @@ -107160,7 +101262,7 @@ func _pcache1ResizeHash(tls *libc.TLS, p uintptr) { } Xsqlite3_free(tls, (*TPCache1)(unsafe.Pointer(p)).FapHash) (*TPCache1)(unsafe.Pointer(p)).FapHash = apNew - (*TPCache1)(unsafe.Pointer(p)).FnHash = nNew + (*TPCache1)(unsafe.Pointer(p)).FnHash = uint32(nNew) } } @@ -107361,9 +101463,10 @@ func _pcache1Shutdown(tls *libc.TLS, NotUsed uintptr) { // */ func _pcache1Create(tls *libc.TLS, szPage int32, szExtra int32, bPurgeable int32) (r uintptr) { var pCache, pGroup, v1 uintptr - var sz, v2 int32 + var sz Ti64 + var v2 int32 _, _, _, _, _ = pCache, pGroup, sz, v1, v2 /* Bytes of memory required to allocate the new cache */ - sz = int32(uint32(68) + uint32(52)*uint32(_pcache1_g.FseparateCache)) + sz = int64(uint32(68) + uint32(52)*uint32(_pcache1_g.FseparateCache)) pCache = _sqlite3MallocZero(tls, uint64(sz)) if pCache != 0 { if _pcache1_g.FseparateCache != 0 { @@ -107953,25 +102056,6 @@ type TRowSetChunk = struct { type RowSetChunk = TRowSetChunk -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. - */ -type TRowSet1 = struct { - FpChunk uintptr - Fdb uintptr - FpEntry uintptr - FpLast uintptr - FpFresh uintptr - FpForest uintptr - FnFresh Tu16 - FrsFlags Tu16 - FiBatch int32 -} - -type RowSet1 = TRowSet1 - /* ** Allowed values for RowSet.rsFlags */ @@ -108936,262 +103020,6 @@ type TPagerSavepoint = struct { type PagerSavepoint = TPagerSavepoint -type TPagerSavepoint1 = struct { - F__ccgo_align [0]uint32 - FiOffset Ti64 - FiHdrOffset Ti64 - FpInSavepoint uintptr - FnOrig TPgno - FiSubRec TPgno - FbTruncateOnRelease int32 - FaWalData [4]Tu32 -} - -type PagerSavepoint1 = TPagerSavepoint1 - -/* -** Bits of the Pager.doNotSpill flag. See further description below. - */ - -/* -** An open page cache is an instance of struct Pager. A description of -** some of the more important member variables follows: -** -** eState -** -** The current 'state' of the pager object. See the comment and state -** diagram above for a description of the pager state. -** -** eLock -** -** For a real on-disk database, the current lock held on the database file - -** NO_LOCK, SHARED_LOCK, RESERVED_LOCK or EXCLUSIVE_LOCK. -** -** For a temporary or in-memory database (neither of which require any -** locks), this variable is always set to EXCLUSIVE_LOCK. Since such -** databases always have Pager.exclusiveMode==1, this tricks the pager -** logic into thinking that it already has all the locks it will ever -** need (and no reason to release them). -** -** In some (obscure) circumstances, this variable may also be set to -** UNKNOWN_LOCK. See the comment above the #define of UNKNOWN_LOCK for -** details. -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** setSuper -** -** When PagerCommitPhaseOne() is called to commit a transaction, it may -** (or may not) specify a super-journal name to be written into the -** journal file before it is synced to disk. -** -** Whether or not a journal file contains a super-journal pointer affects -** the way in which the journal file is finalized after the transaction is -** committed or rolled back when running in "journal_mode=PERSIST" mode. -** If a journal file does not contain a super-journal pointer, it is -** finalized by overwriting the first journal header with zeroes. If -** it does contain a super-journal pointer the journal file is finalized -** by truncating it to zero bytes, just as if the connection were -** running in "journal_mode=truncate" mode. -** -** Journal files that contain super-journal pointers cannot be finalized -** simply by overwriting the first journal-header with zeroes, as the -** super-journal pointer could interfere with hot-journal rollback of any -** subsequently interrupted transaction that reuses the journal file. -** -** The flag is cleared as soon as the journal file is finalized (either -** by PagerCommitPhaseTwo or PagerRollback). If an IO error prevents the -** journal file from being successfully finalized, the setSuper flag -** is cleared anyway (and the pager will move to ERROR state). -** -** doNotSpill -** -** This variables control the behavior of cache-spills (calls made by -** the pcache module to the pagerStress() routine to write cached data -** to the file-system in order to free up memory). -** -** When bits SPILLFLAG_OFF or SPILLFLAG_ROLLBACK of doNotSpill are set, -** writing to the database from pagerStress() is disabled altogether. -** The SPILLFLAG_ROLLBACK case is done in a very obscure case that -** comes up during savepoint rollback that requires the pcache module -** to allocate a new page to prevent the journal file from being written -** while it is being traversed by code in pager_playback(). The SPILLFLAG_OFF -** case is a user preference. -** -** If the SPILLFLAG_NOSYNC bit is set, writing to the database from -** pagerStress() is permitted, but syncing the journal file is not. -** This flag is set by sqlite3PagerWrite() when the file-system sector-size -** is larger than the database page-size in order to prevent a journal sync -** from happening in between the journalling of two pages on the same sector. -** -** subjInMemory -** -** This is a boolean variable. If true, then any required sub-journal -** is opened as an in-memory journal file. If false, then in-memory -** sub-journals are only used for in-memory pager files. -** -** This variable is updated by the upper layer each time a new -** write-transaction is opened. -** -** dbSize, dbOrigSize, dbFileSize -** -** Variable dbSize is set to the number of pages in the database file. -** It is valid in PAGER_READER and higher states (all states except for -** OPEN and ERROR). -** -** dbSize is set based on the size of the database file, which may be -** larger than the size of the database (the value stored at offset -** 28 of the database header by the btree). If the size of the file -** is not an integer multiple of the page-size, the value stored in -** dbSize is rounded down (i.e. a 5KB file with 2K page-size has dbSize==2). -** Except, any file that is greater than 0 bytes in size is considered -** to have at least one page. (i.e. a 1KB file with 2K page-size leads -** to dbSize==1). -** -** During a write-transaction, if pages with page-numbers greater than -** dbSize are modified in the cache, dbSize is updated accordingly. -** Similarly, if the database is truncated using PagerTruncateImage(), -** dbSize is updated. -** -** Variables dbOrigSize and dbFileSize are valid in states -** PAGER_WRITER_LOCKED and higher. dbOrigSize is a copy of the dbSize -** variable at the start of the transaction. It is used during rollback, -** and to determine whether or not pages need to be journalled before -** being modified. -** -** Throughout a write-transaction, dbFileSize contains the size of -** the file on disk in pages. It is set to a copy of dbSize when the -** write-transaction is first opened, and updated when VFS calls are made -** to write or truncate the database file on disk. -** -** The only reason the dbFileSize variable is required is to suppress -** unnecessary calls to xTruncate() after committing a transaction. If, -** when a transaction is committed, the dbFileSize variable indicates -** that the database file is larger than the database image (Pager.dbSize), -** pager_truncate() is called. The pager_truncate() call uses xFilesize() -** to measure the database file on disk, and then truncates it if required. -** dbFileSize is not used when rolling back a transaction. In this case -** pager_truncate() is called unconditionally (which means there may be -** a call to xFilesize() that is not strictly required). In either case, -** pager_truncate() may cause the file to become smaller or larger. -** -** dbHintSize -** -** The dbHintSize variable is used to limit the number of calls made to -** the VFS xFileControl(FCNTL_SIZE_HINT) method. -** -** dbHintSize is set to a copy of the dbSize variable when a -** write-transaction is opened (at the same time as dbFileSize and -** dbOrigSize). If the xFileControl(FCNTL_SIZE_HINT) method is called, -** dbHintSize is increased to the number of pages that correspond to the -** size-hint passed to the method call. See pager_write_pagelist() for -** details. -** -** errCode -** -** The Pager.errCode variable is only ever used in PAGER_ERROR state. It -** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode -** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX -** sub-codes. -** -** syncFlags, walSyncFlags -** -** syncFlags is either SQLITE_SYNC_NORMAL (0x02) or SQLITE_SYNC_FULL (0x03). -** syncFlags is used for rollback mode. walSyncFlags is used for WAL mode -** and contains the flags used to sync the checkpoint operations in the -** lower two bits, and sync flags used for transaction commits in the WAL -** file in bits 0x04 and 0x08. In other words, to get the correct sync flags -** for checkpoint operations, use (walSyncFlags&0x03) and to get the correct -** sync flags for transaction commit, use ((walSyncFlags>>2)&0x03). Note -** that with synchronous=NORMAL in WAL mode, transaction commit is not synced -** meaning that the 0x04 and 0x08 bits are both zero. - */ -type TPager1 = struct { - F__ccgo_align [0]uint32 - FpVfs uintptr - FexclusiveMode Tu8 - FjournalMode Tu8 - FuseJournal Tu8 - FnoSync Tu8 - FfullSync Tu8 - FextraSync Tu8 - FsyncFlags Tu8 - FwalSyncFlags Tu8 - FtempFile Tu8 - FnoLock Tu8 - FreadOnly Tu8 - FmemDb Tu8 - FmemVfs Tu8 - FeState Tu8 - FeLock Tu8 - FchangeCountDone Tu8 - FsetSuper Tu8 - FdoNotSpill Tu8 - FsubjInMemory Tu8 - FbUseFetch Tu8 - FhasHeldSharedLock Tu8 - FdbSize TPgno - FdbOrigSize TPgno - FdbFileSize TPgno - FdbHintSize TPgno - FerrCode int32 - FnRec int32 - FcksumInit Tu32 - FnSubRec Tu32 - FpInJournal uintptr - Ffd uintptr - Fjfd uintptr - Fsjfd uintptr - F__ccgo_align34 [4]byte - FjournalOff Ti64 - FjournalHdr Ti64 - FpBackup uintptr - FaSavepoint uintptr - FnSavepoint int32 - FiDataVersion Tu32 - FdbFileVers [16]int8 - FnMmapOut int32 - F__ccgo_align42 [4]byte - FszMmap Tsqlite3_int64 - FpMmapFreelist uintptr - FnExtra Tu16 - FnReserve Ti16 - FvfsFlags Tu32 - FsectorSize Tu32 - FmxPgno TPgno - FlckPgno TPgno - FpageSize Ti64 - FjournalSizeLimit Ti64 - FzFilename uintptr - FzJournal uintptr - FxBusyHandler uintptr - FpBusyHandlerArg uintptr - FaStat [4]Tu32 - FxReiniter uintptr - FxGet uintptr - FpTmpSpace uintptr - FpPCache uintptr - FpWal uintptr - FzWal uintptr -} - -type Pager1 = TPager1 - /* ** Indexes for use with Pager.aStat[]. The Pager.aStat[] array contains ** the values accessed by passing SQLITE_DBSTATUS_CACHE_HIT, CACHE_MISS @@ -109290,7 +103118,7 @@ func _sqlite3PagerDirectReadOk(tls *libc.TLS, pPager uintptr, pgno TPgno) (r int return 0 } /* Case (4) */ } - if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { + if (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).Ffd)).FpMethods)).FxDeviceCharacteristics})))(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd)&int32(SQLITE_IOCAP_SUBPAGE_READ) == 0 { return 0 /* Case (2) */ } return int32(1) @@ -109519,7 +103347,7 @@ func _jrnlBufferSize(tls *libc.TLS, pPager uintptr) (r int32) { // ** If an error occurs while reading from the journal file, an SQLite // ** error code is returned. // */ -func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32) (r int32) { +func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu64) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var rc, v1, v2, v4, v6, v8 int32 @@ -109537,7 +103365,7 @@ func _readSuperJournal(tls *libc.TLS, pJrnl uintptr, zSuper uintptr, nSuper Tu32 v2 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16), bp) rc = v2 } - if v5 = v3 || SQLITE_OK != v2 || *(*Tu32)(unsafe.Pointer(bp)) >= nSuper || int64(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { + if v5 = v3 || SQLITE_OK != v2 || uint64(*(*Tu32)(unsafe.Pointer(bp))) >= nSuper || int64(*(*Tu32)(unsafe.Pointer(bp))) > *(*Ti64)(unsafe.Pointer(bp + 8))-int64(16) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0); !v5 { v4 = _read32bits(tls, pJrnl, *(*Ti64)(unsafe.Pointer(bp + 8))-int64(12), bp+16) rc = v4 } @@ -110110,6 +103938,15 @@ func _pager_unlock(tls *libc.TLS, pPager uintptr) { (*TPager)(unsafe.Pointer(pPager)).FpInJournal = uintptr(0) _releaseAllSavepoints(tls, pPager) if (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { + if int32((*TPager)(unsafe.Pointer(pPager)).FeState) == int32(PAGER_ERROR) { + /* If an IO error occurs in wal.c while attempting to wrap the wal file, + ** then the Wal object may be holding a write-lock but no read-lock. + ** This call ensures that the write-lock is dropped as well. We cannot + ** have sqlite3WalEndReadTransaction() drop the write-lock, as it once + ** did, because this would break "BEGIN EXCLUSIVE" handling for + ** SQLITE_ENABLE_SETLK_TIMEOUT builds. */ + _sqlite3WalEndWriteTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) + } _sqlite3WalEndReadTransaction(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal) (*TPager)(unsafe.Pointer(pPager)).FeState = uint8(PAGER_OPEN) } else { @@ -110756,7 +104593,8 @@ func _pager_playback_one_page(tls *libc.TLS, pPager uintptr, pOffset uintptr, pD func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var c, flags, flags1, nSuperPtr, rc int32 + var c, flags, flags1, rc int32 + var nSuperPtr Ti64 var pJournal, pSuper, pVfs, zFree, zJournal, zSuperJournal, zSuperPtr uintptr var v1, v2, v3 int8 var _ /* exists at bp+8 */ int32 @@ -110768,7 +104606,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { /* Allocate space for both the pJournal and pSuper file descriptors. ** If successful, open the super-journal file for reading. */ - pSuper = _sqlite3MallocZero(tls, uint64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile*int32(2))) + pSuper = _sqlite3MallocZero(tls, uint64(int64(2)*int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile))) if !(pSuper != 0) { rc = int32(SQLITE_NOMEM) pJournal = uintptr(0) @@ -110789,11 +104627,12 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - nSuperPtr = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zFree = _sqlite3Malloc(tls, uint64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+int64(nSuperPtr)+int64(2))) + nSuperPtr = int64(1) + int64((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname) + zFree = _sqlite3Malloc(tls, uint64(int64(4)+*(*Ti64)(unsafe.Pointer(bp))+nSuperPtr+int64(2))) if !(zFree != 0) { rc = int32(SQLITE_NOMEM) goto delsuper_out + } else { } v3 = libc.Int8FromInt32(0) *(*int8)(unsafe.Pointer(zFree + 3)) = v3 @@ -110822,7 +104661,7 @@ func _pager_delsuper(tls *libc.TLS, pPager uintptr, zSuper uintptr) (r int32) { if rc != SQLITE_OK { goto delsuper_out } - rc = _readSuperJournal(tls, pJournal, zSuperPtr, uint32(nSuperPtr)) + rc = _readSuperJournal(tls, pJournal, zSuperPtr, uint64(nSuperPtr)) _sqlite3OsClose(tls, pJournal) if rc != SQLITE_OK { goto delsuper_out @@ -111055,7 +104894,7 @@ func _pager_playback(tls *libc.TLS, pPager uintptr, isHot int32) (r int32) { ** for pageSize. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) if rc == SQLITE_OK && *(*int8)(unsafe.Pointer(zSuper)) != 0 { rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+16) } @@ -111192,7 +105031,7 @@ end_playback: ** which case it requires 4 0x00 bytes in memory immediately before ** the filename. */ zSuper = (*TPager)(unsafe.Pointer(pPager)).FpTmpSpace + 4 - rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint32((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname+int32(1))) + rc = _readSuperJournal(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd, zSuper, uint64(int64(1)+int64((*Tsqlite3_vfs)(unsafe.Pointer((*TPager)(unsafe.Pointer(pPager)).FpVfs)).FmxPathname))) } if rc == SQLITE_OK && (int32((*TPager)(unsafe.Pointer(pPager)).FeState) >= int32(PAGER_WRITER_DBMOD) || int32((*TPager)(unsafe.Pointer(pPager)).FeState) == PAGER_OPEN) { rc = _sqlite3PagerSync(tls, pPager, uintptr(0)) @@ -111208,7 +105047,7 @@ end_playback: rc = _pager_delsuper(tls, pPager, zSuper) } if isHot != 0 && nPlayback != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(2)<= int32(3) { + if (*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods != uintptr(0) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(fd)).FpMethods)).FiVersion >= int32(3) { *(*Tsqlite3_int64)(unsafe.Pointer(bp)) = (*TPager)(unsafe.Pointer(pPager)).FszMmap (*TPager)(unsafe.Pointer(pPager)).FbUseFetch = libc.BoolUint8(*(*Tsqlite3_int64)(unsafe.Pointer(bp)) > libc.Int64FromInt32(0)) _setGetterMethod(tls, pPager) @@ -111955,10 +105794,10 @@ func _pagerOpentemp(tls *libc.TLS, pPager uintptr, pFile uintptr, vfsFlags int32 // ** retried. If it returns zero, then the SQLITE_BUSY error is // ** returned to the caller of the pager API function. // */ -func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, xBusyHandler uintptr, pBusyHandlerArg uintptr) { +func _sqlite3PagerSetBusyHandler(tls *libc.TLS, pPager uintptr, __ccgo_fp_xBusyHandler uintptr, pBusyHandlerArg uintptr) { var ap uintptr _ = ap - (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = xBusyHandler + (*TPager)(unsafe.Pointer(pPager)).FxBusyHandler = __ccgo_fp_xBusyHandler (*TPager)(unsafe.Pointer(pPager)).FpBusyHandlerArg = pBusyHandlerArg ap = pPager + 192 _sqlite3OsFileControlHint(tls, (*TPager)(unsafe.Pointer(pPager)).Ffd, int32(SQLITE_FCNTL_BUSYHANDLER), ap) @@ -112859,7 +106698,7 @@ func _sqlite3PagerFlush(tls *libc.TLS, pPager uintptr) (r int32) { // ** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or // ** various SQLITE_IO_XXX errors. // */ -func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, xReinit uintptr) (r int32) { +func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename uintptr, nExtra int32, flags int32, vfsFlags int32, __ccgo_fp_xReinit uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var iDc, journalFileSize, memDb, memJM, nPathname, nUriByte, pcacheSize, rc, readOnly, tempFile, useJournal, v4 int32 @@ -112903,7 +106742,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u */ if zFilename != 0 && *(*int8)(unsafe.Pointer(zFilename)) != 0 { nPathname = (*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FmxPathname + int32(1) - zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(nPathname*int32(2))) + zPathname = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(int64(2)*int64(nPathname))) if zPathname == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -112934,7 +106773,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** as it will not be possible to open the journal file or even ** check for a hot-journal before reading. */ - rc = _sqlite3CantopenError(tls, int32(62120)) + rc = _sqlite3CantopenError(tls, int32(62859)) } if rc != SQLITE_OK { _sqlite3DbFree(tls, uintptr(0), zPathname) @@ -112985,7 +106824,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u ** specific formatting and order of the various filenames, so if the format ** changes here, be sure to change it there as well. */ - pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(240)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))+uint32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint32(journalFileSize*int32(2))+uint32(__SIZEOF_POINTER__)+uint32(4)+uint32(nPathname)+uint32(1)+uint32(nUriByte)+uint32(nPathname)+uint32(8)+uint32(1)+uint32(nPathname)+uint32(4)+uint32(1)+uint32(3))) + pPtr = _sqlite3MallocZero(tls, uint64((libc.Uint32FromInt64(240)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))+uint32((pcacheSize+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7))+uint32(((*Tsqlite3_vfs)(unsafe.Pointer(pVfs)).FszOsFile+libc.Int32FromInt32(7)) & ^libc.Int32FromInt32(7)))+uint64(journalFileSize)*uint64(2)+uint64(__SIZEOF_POINTER__)+uint64(4)+uint64(nPathname)+uint64(1)+uint64(nUriByte)+uint64(nPathname)+uint64(8)+uint64(1)+uint64(nPathname)+uint64(4)+uint64(1)+uint64(3)) if !(pPtr != 0) { _sqlite3DbFree(tls, uintptr(0), zPathname) return int32(SQLITE_NOMEM) @@ -113020,7 +106859,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+5452, uint32(8)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+5540, uint32(8)) pPtr += uintptr(libc.Int32FromInt32(8) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzJournal = uintptr(0) @@ -113030,7 +106869,7 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = pPtr libc.Xmemcpy(tls, pPtr, zPathname, uint32(nPathname)) pPtr += uintptr(nPathname) - libc.Xmemcpy(tls, pPtr, __ccgo_ts+5461, uint32(4)) + libc.Xmemcpy(tls, pPtr, __ccgo_ts+5549, uint32(4)) pPtr += uintptr(libc.Int32FromInt32(4) + libc.Int32FromInt32(1)) } else { (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzWal = uintptr(0) @@ -113072,8 +106911,8 @@ func _sqlite3PagerOpen(tls *libc.TLS, pVfs uintptr, ppPager uintptr, zFilename u } } } - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = uint8(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5466, 0)) - if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5473, 0) != 0 { + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnoLock = uint8(Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5554, 0)) + if iDc&int32(SQLITE_IOCAP_IMMUTABLE) != 0 || Xsqlite3_uri_boolean(tls, (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FzFilename, __ccgo_ts+5561, 0) != 0 { vfsFlags |= int32(SQLITE_OPEN_READONLY) goto act_like_temp_file } @@ -113156,7 +106995,7 @@ _3: } /* pPager->xBusyHandler = 0; */ /* pPager->pBusyHandlerArg = 0; */ - (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = xReinit + (*TPager)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxReiniter = __ccgo_fp_xReinit _setGetterMethod(tls, *(*uintptr)(unsafe.Pointer(bp))) /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ /* pPager->szMmap = SQLITE_DEFAULT_MMAP_SIZE // will be set by btree.c */ @@ -113412,7 +107251,7 @@ func _sqlite3PagerSharedLock(tls *libc.TLS, pPager uintptr) (r int32) { f = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_MAIN_JOURNAL) rc = _sqlite3OsOpen(tls, pVfs, (*TPager)(unsafe.Pointer(pPager)).FzJournal, (*TPager)(unsafe.Pointer(pPager)).Fjfd, f, bp+8) if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 8))&int32(SQLITE_OPEN_READONLY) != 0 { - rc = _sqlite3CantopenError(tls, int32(62641)) + rc = _sqlite3CantopenError(tls, int32(63380)) _sqlite3OsClose(tls, (*TPager)(unsafe.Pointer(pPager)).Fjfd) } } @@ -113587,7 +107426,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f _, _, _, _ = noContent, pPg, rc, v1 rc = SQLITE_OK if pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62854)) + return _sqlite3CorruptError(tls, int32(63593)) } *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3PcacheFetch(tls, (*TPager)(unsafe.Pointer(pPager)).FpPCache, pgno, int32(3)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { @@ -113618,7 +107457,7 @@ func _getPageNormal(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, f ** (2) Never try to fetch the locking page */ if pgno == (*TPager)(unsafe.Pointer(pPager)).FlckPgno { - rc = _sqlite3CorruptError(tls, int32(62886)) + rc = _sqlite3CorruptError(tls, int32(63625)) goto pager_acquire_err } (*TPgHdr)(unsafe.Pointer(pPg)).FpPager = pPager @@ -113690,7 +107529,7 @@ func _getPageMMap(tls *libc.TLS, pPager uintptr, pgno TPgno, ppPage uintptr, fla ** test in the previous statement, and avoid testing pgno==0 in the ** common case where pgno is large. */ if pgno <= uint32(1) && pgno == uint32(0) { - return _sqlite3CorruptError(tls, int32(62969)) + return _sqlite3CorruptError(tls, int32(63708)) } if bMmapOk != 0 && (*TPager)(unsafe.Pointer(pPager)).FpWal != uintptr(0) { rc = _sqlite3WalFindFrame(tls, (*TPager)(unsafe.Pointer(pPager)).FpWal, pgno, bp+4) @@ -115047,7 +108886,7 @@ func _sqlite3PagerMovepage(tls *libc.TLS, pPager uintptr, pPg uintptr, pgno TPgn if pPgOld != 0 { if (*TPgHdr)(unsafe.Pointer(pPgOld)).FnRef > int64(1) { _sqlite3PagerUnrefNotNull(tls, pPgOld) - return _sqlite3CorruptError(tls, int32(64535)) + return _sqlite3CorruptError(tls, int32(65274)) } p4 = pPg + 28 *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | int32((*TPgHdr)(unsafe.Pointer(pPgOld)).Fflags)&libc.Int32FromInt32(PGHDR_NEED_SYNC)) @@ -115315,7 +109154,7 @@ func _sqlite3PagerCheckpoint(tls *libc.TLS, pPager uintptr, db uintptr, eMode in ** sqlite3_wal_checkpoint() call, but it happens very rarely. ** https://sqlite.org/forum/forumpost/fd0f19d229156939 */ - Xsqlite3_exec(tls, db, __ccgo_ts+5483, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+5571, uintptr(0), uintptr(0), uintptr(0)) } if (*TPager)(unsafe.Pointer(pPager)).FpWal != 0 { if eMode == SQLITE_CHECKPOINT_PASSIVE { @@ -115881,7 +109720,6 @@ type WalIndexHdr = TWalIndexHdr type TWalIterator = struct { FiPrior Tu32 FnSegment int32 - FaSegment [1]TWalSegment } type WalIterator = TWalIterator @@ -115896,229 +109734,6 @@ type TWalCkptInfo = struct { type WalCkptInfo = TWalCkptInfo -/* -** The following object holds a copy of the wal-index header content. -** -** The actual header in the wal-index consists of two copies of this -** object followed by one instance of the WalCkptInfo object. -** For all versions of SQLite through 3.10.0 and probably beyond, -** the locking bytes (WalCkptInfo.aLock) start at offset 120 and -** the total header size is 136 bytes. -** -** The szPage value can be any power of 2 between 512 and 32768, inclusive. -** Or it can be 1 to represent a 65536-byte page. The latter case was -** added in 3.7.1 when support for 64K pages was added. - */ -type TWalIndexHdr1 = struct { - FiVersion Tu32 - Funused Tu32 - FiChange Tu32 - FisInit Tu8 - FbigEndCksum Tu8 - FszPage Tu16 - FmxFrame Tu32 - FnPage Tu32 - FaFrameCksum [2]Tu32 - FaSalt [2]Tu32 - FaCksum [2]Tu32 -} - -type WalIndexHdr1 = TWalIndexHdr1 - -/* -** A copy of the following object occurs in the wal-index immediately -** following the second copy of the WalIndexHdr. This object stores -** information used by checkpoint. -** -** nBackfill is the number of frames in the WAL that have been written -** back into the database. (We call the act of moving content from WAL to -** database "backfilling".) The nBackfill number is never greater than -** WalIndexHdr.mxFrame. nBackfill can only be increased by threads -** holding the WAL_CKPT_LOCK lock (which includes a recovery thread). -** However, a WAL_WRITE_LOCK thread can move the value of nBackfill from -** mxFrame back to zero when the WAL is reset. -** -** nBackfillAttempted is the largest value of nBackfill that a checkpoint -** has attempted to achieve. Normally nBackfill==nBackfillAtempted, however -** the nBackfillAttempted is set before any backfilling is done and the -** nBackfill is only set after all backfilling completes. So if a checkpoint -** crashes, nBackfillAttempted might be larger than nBackfill. The -** WalIndexHdr.mxFrame must never be less than nBackfillAttempted. -** -** The aLock[] field is a set of bytes used for locking. These bytes should -** never be read or written. -** -** There is one entry in aReadMark[] for each reader lock. If a reader -** holds read-lock K, then the value in aReadMark[K] is no greater than -** the mxFrame for that reader. The value READMARK_NOT_USED (0xffffffff) -** for any aReadMark[] means that entry is unused. aReadMark[0] is -** a special case; its value is never used and it exists as a place-holder -** to avoid having to offset aReadMark[] indexes by one. Readers holding -** WAL_READ_LOCK(0) always ignore the entire WAL and read all content -** directly from the database. -** -** The value of aReadMark[K] may only be changed by a thread that -** is holding an exclusive lock on WAL_READ_LOCK(K). Thus, the value of -** aReadMark[K] cannot changed while there is a reader is using that mark -** since the reader will be holding a shared lock on WAL_READ_LOCK(K). -** -** The checkpointer may only transfer frames from WAL to database where -** the frame numbers are less than or equal to every aReadMark[] that is -** in use (that is, every aReadMark[j] for which there is a corresponding -** WAL_READ_LOCK(j)). New readers (usually) pick the aReadMark[] with the -** largest value and will increase an unused aReadMark[] to mxFrame if there -** is not already an aReadMark[] equal to mxFrame. The exception to the -** previous sentence is when nBackfill equals mxFrame (meaning that everything -** in the WAL has been backfilled into the database) then new readers -** will choose aReadMark[0] which has value 0 and hence such reader will -** get all their all content directly from the database file and ignore -** the WAL. -** -** Writers normally append new frames to the end of the WAL. However, -** if nBackfill equals mxFrame (meaning that all WAL content has been -** written back into the database) and if no readers are using the WAL -** (in other words, if there are no WAL_READ_LOCK(i) where i>0) then -** the writer will first "reset" the WAL back to the beginning and start -** writing new content beginning at frame 1. -** -** We assume that 32-bit loads are atomic and so no locks are needed in -** order to read from any aReadMark[] entries. - */ -type TWalCkptInfo1 = struct { - FnBackfill Tu32 - FaReadMark [5]Tu32 - FaLock [8]Tu8 - FnBackfillAttempted Tu32 - FnotUsed0 Tu32 -} - -type WalCkptInfo1 = TWalCkptInfo1 - -/* -** This is a schematic view of the complete 136-byte header of the -** wal-index file (also known as the -shm file): -** -** +-----------------------------+ -** 0: | iVersion | ** +-----------------------------+ | -** 4: | (unused padding) | | -** +-----------------------------+ | -** 8: | iChange | | -** +-------+-------+-------------+ | -** 12: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | -** 16: | mxFrame | | First copy of the -** +-----------------------------+ | WalIndexHdr object -** 20: | nPage | | -** +-----------------------------+ | -** 24: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 32: | aSalt | | -** | | | -** +-----------------------------+ | -** 40: | aCksum | | -** | | / -** +-----------------------------+ -** 48: | iVersion | ** +-----------------------------+ | -** 52: | (unused padding) | | -** +-----------------------------+ | -** 56: | iChange | | -** +-------+-------+-------------+ | -** 60: | bInit | bBig | szPage | | -** +-------+-------+-------------+ | Second copy of the -** 64: | mxFrame | | WalIndexHdr -** +-----------------------------+ | -** 68: | nPage | | -** +-----------------------------+ | -** 72: | aFrameCksum | | -** | | | -** +-----------------------------+ | -** 80: | aSalt | | -** | | | -** +-----------------------------+ | -** 88: | aCksum | | -** | | / -** +-----------------------------+ -** 96: | nBackfill | -** +-----------------------------+ -** 100: | 5 read marks | -** | | -** | | -** | | -** | | -** +-------+-------+------+------+ -** 120: | Write | Ckpt | Rcvr | Rd0 | ** +-------+-------+------+------+ ) 8 lock bytes -** | Read1 | Read2 | Rd3 | Rd4 | / -** +-------+-------+------+------+ -** 128: | nBackfillAttempted | -** +-----------------------------+ -** 132: | (unused padding) | -** +-----------------------------+ - */ - -/* A block of WALINDEX_LOCK_RESERVED bytes beginning at -** WALINDEX_LOCK_OFFSET is reserved for locks. Since some systems -** only support mandatory file-locks, we do not read or write data -** from the region of the file on which locks are applied. - */ - -/* Size of header before each frame in wal */ - -/* Size of write ahead log header, including checksum. */ - -/* WAL magic value. Either this value, or the same value with the least -** significant bit also set (WAL_MAGIC | 0x00000001) is stored in 32-bit -** big-endian format in the first 4 bytes of a WAL file. -** -** If the LSB is set, then the checksums for each frame within the WAL -** file are calculated by treating all data as an array of 32-bit -** big-endian words. Otherwise, they are calculated by interpreting -** all data as 32-bit little-endian words. - */ - -/* -** Return the offset of frame iFrame in the write-ahead log file, -** assuming a database page size of szPage bytes. The offset returned -** is to the start of the write-ahead log frame-header. - */ - -/* -** An open write-ahead log file is represented by an instance of the -** following object. - */ -type TWal1 = struct { - F__ccgo_align [0]uint32 - FpVfs uintptr - FpDbFd uintptr - FpWalFd uintptr - FiCallback Tu32 - FmxWalSize Ti64 - FnWiData int32 - FszFirstBlock int32 - FapWiData uintptr - FszPage Tu32 - FreadLock Ti16 - FsyncFlags Tu8 - FexclusiveMode Tu8 - FwriteLock Tu8 - FckptLock Tu8 - FreadOnly Tu8 - FtruncateOnCommit Tu8 - FsyncHeader Tu8 - FpadToSectorBoundary Tu8 - FbShmUnreliable Tu8 - Fhdr TWalIndexHdr - FminFrame Tu32 - FiReCksum Tu32 - FzWalName uintptr - FnCkpt Tu32 - FpSnapshot uintptr - FbGetSnapshot int32 - F__ccgo_pad26 [4]byte -} - -type Wal1 = TWal1 - /* ** Candidate values for Wal.exclusiveMode. */ @@ -116137,28 +109752,7 @@ type Tht_slot = uint16 type ht_slot = Tht_slot -/* -** This structure is used to implement an iterator that loops through -** all frames in the WAL in database page order. Where two or more frames -** correspond to the same database page, the iterator visits only the -** frame most recently written to the WAL (in other words, the frame with -** the largest index). -** -** The internals of this structure are only accessed by: -** -** walIteratorInit() - Create a new iterator, -** walIteratorNext() - Step an iterator, -** walIteratorFree() - Free an iterator. -** -** This functionality is used by the checkpoint code (see walCheckpoint()). - */ -type TWalIterator1 = struct { - FiPrior Tu32 - FnSegment int32 - FaSegment [1]TWalSegment -} - -type WalIterator1 = TWalIterator1 +/* Size (in bytes) of a WalIterator object suitable for N or fewer segments */ /* ** Define the parameters of the hash tables in the wal-index file. There @@ -116217,7 +109811,7 @@ func _walIndexPageRealloc(tls *libc.TLS, pWal uintptr, iPage int32, ppPage uintp rc = SQLITE_OK /* Enlarge the pWal->apWiData[] array if required */ if (*TWal)(unsafe.Pointer(pWal)).FnWiData <= iPage { - nByte = int64(uint32(4) * uint32(iPage+libc.Int32FromInt32(1))) + nByte = int64(4) * (int64(1) + int64(iPage)) apNew = _sqlite3Realloc(tls, (*TWal)(unsafe.Pointer(pWal)).FapWiData, uint64(nByte)) if !(apNew != 0) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) @@ -116318,6 +109912,7 @@ func _walChecksumBytes(tls *libc.TLS, nativeCksum int32, a uintptr, nByte int32, s2 = v1 s1 = v1 } + /* nByte is a multiple of 8 between 8 and 65536 */ if !(nativeCksum != 0) { for cond := true; cond; cond = aData < aEnd { s1 += *(*Tu32)(unsafe.Pointer(aData))&uint32(0x000000FF)<>int32(8) + *(*Tu32)(unsafe.Pointer(aData))&uint32(0xFF000000)>>int32(24) + s2 @@ -116585,14 +110180,6 @@ type TWalHashLoc = struct { type WalHashLoc = TWalHashLoc -type TWalHashLoc1 = struct { - FaHash uintptr - FaPgno uintptr - FiZero Tu32 -} - -type WalHashLoc1 = TWalHashLoc1 - // C documentation // // /* @@ -116759,7 +110346,7 @@ func _walIndexAppend(tls *libc.TLS, pWal uintptr, iFrame Tu32, iPage Tu32) (r in v2 = nCollide nCollide-- if v2 == 0 { - return _sqlite3CorruptError(tls, int32(66462)) + return _sqlite3CorruptError(tls, int32(67214)) } goto _1 _1: @@ -116847,7 +110434,7 @@ func _walIndexRecover(tls *libc.TLS, pWal uintptr) (r int32) { ** are able to understand */ version = _sqlite3Get4byte(tls, bp+8+4) if version != uint32(WAL_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(66594)) + rc = _sqlite3CantopenError(tls, int32(67346)) goto finished } /* Malloc a buffer to read frames into. */ @@ -116986,7 +110573,7 @@ finished: ** checkpointing the log file. */ if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FnPage != 0 { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_NOTICE)|libc.Int32FromInt32(1)< uint32(HASHTABLE_NPAGE) { v1 = uint32(HASHTABLE_NPAGE) } else { @@ -117427,10 +111014,10 @@ func _walIteratorInit(tls *libc.TLS, pWal uintptr, nBackfill Tu32, pp uintptr) ( // ** busy-handler function. Invoke it and retry the lock until either the // ** lock is successfully obtained or the busy-handler returns 0. // */ -func _walBusyLock(tls *libc.TLS, pWal uintptr, xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { +func _walBusyLock(tls *libc.TLS, pWal uintptr, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, lockIdx int32, n int32) (r int32) { var rc int32 _ = rc - for cond := true; cond; cond = xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xBusy})))(tls, pBusyArg) != 0 { + for cond := true; cond; cond = __ccgo_fp_xBusy != 0 && rc == int32(SQLITE_BUSY) && (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xBusy})))(tls, pBusyArg) != 0 { rc = _walLockExclusive(tls, pWal, lockIdx, n) } return rc @@ -117528,7 +111115,7 @@ func _walRestartHdr(tls *libc.TLS, pWal uintptr, _salt1 Tu32) { // ** checkpoint is running (in any other thread or process) at the same // ** time. // */ -func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { +func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, zBuf uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var i, rc, szPage, v3, v5 int32 @@ -117567,7 +111154,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } y = libc.AtomicLoadNUint32(pInfo+4+uintptr(i)*4, libc.Int32FromInt32(__ATOMIC_RELAXED)) if mxSafeFrame > y { - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, int32(3)+i, int32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, int32(3)+i, int32(1)) if rc == SQLITE_OK { if i == int32(1) { v2 = mxSafeFrame @@ -117580,7 +111167,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if rc == int32(SQLITE_BUSY) { mxSafeFrame = y - xBusy = uintptr(0) + __ccgo_fp_xBusy = uintptr(0) } else { goto walcheckpoint_out } @@ -117596,7 +111183,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy rc = _walIteratorInit(tls, pWal, (*TWalCkptInfo)(unsafe.Pointer(pInfo)).FnBackfill, bp) } if v4 = *(*uintptr)(unsafe.Pointer(bp)) != 0; v4 { - v3 = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) + v3 = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(0), int32(1)) rc = v3 } if v4 && v3 == SQLITE_OK { @@ -117617,7 +111204,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy ** database plus the amount of data in the wal file, plus the ** maximum size of the pending-byte page (65536 bytes), then ** must be corruption somewhere. */ - rc = _sqlite3CorruptError(tls, int32(67404)) + rc = _sqlite3CorruptError(tls, int32(68155)) } else { _sqlite3OsFileControlHint(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, int32(SQLITE_FCNTL_SIZE_HINT), bp+16) } @@ -117683,7 +111270,7 @@ func _walCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy } else { if eMode >= int32(SQLITE_CHECKPOINT_RESTART) { Xsqlite3_randomness(tls, int32(4), bp+32) - rc = _walBusyLock(tls, pWal, xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) + rc = _walBusyLock(tls, pWal, __ccgo_fp_xBusy, pBusyArg, libc.Int32FromInt32(3)+libc.Int32FromInt32(1), libc.Int32FromInt32(SQLITE_SHM_NLOCK)-libc.Int32FromInt32(3)-libc.Int32FromInt32(1)) if rc == SQLITE_OK { if eMode == int32(SQLITE_CHECKPOINT_TRUNCATE) { /* IMPLEMENTATION-OF: R-44699-57140 This mode works the same way as @@ -117733,7 +111320,7 @@ func _walLimitSize(tls *libc.TLS, pWal uintptr, nMax Ti64) { } _sqlite3EndBenignMalloc(tls) if rx != 0 { - Xsqlite3_log(tls, rx, __ccgo_ts+5538, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) + Xsqlite3_log(tls, rx, __ccgo_ts+5626, libc.VaList(bp+16, (*TWal)(unsafe.Pointer(pWal)).FzWalName)) } } @@ -117948,7 +111535,14 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { rc = v3 } if v4 || SQLITE_OK == v3 { - (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(1) + /* If the write-lock was just obtained, set writeLock to 2 instead of + ** the usual 1. This causes walIndexPage() to behave as if the + ** write-lock were held (so that it allocates new pages as required), + ** and walHandleException() to unlock the write-lock if a SEH exception + ** is thrown. */ + if !(bWriteLock != 0) { + (*TWal)(unsafe.Pointer(pWal)).FwriteLock = uint8(2) + } v5 = _walIndexPage(tls, pWal, 0, bp) rc = v5 if SQLITE_OK == v5 { @@ -117974,7 +111568,7 @@ func _walIndexReadHdr(tls *libc.TLS, pWal uintptr, pChanged uintptr) (r int32) { ** this version of SQLite cannot understand. */ if badHdr == 0 && (*TWal)(unsafe.Pointer(pWal)).Fhdr.FiVersion != uint32(WALINDEX_MAX_VERSION) { - rc = _sqlite3CantopenError(tls, int32(67848)) + rc = _sqlite3CantopenError(tls, int32(68606)) } if (*TWal)(unsafe.Pointer(pWal)).FbShmUnreliable != 0 { if rc != SQLITE_OK { @@ -118697,8 +112291,8 @@ func _sqlite3WalBeginReadTransaction(tls *libc.TLS, pWal uintptr, pChanged uintp // ** read-lock. // */ func _sqlite3WalEndReadTransaction(tls *libc.TLS, pWal uintptr) { - _sqlite3WalEndWriteTransaction(tls, pWal) if int32((*TWal)(unsafe.Pointer(pWal)).FreadLock) >= 0 { + _sqlite3WalEndWriteTransaction(tls, pWal) _walUnlockShared(tls, pWal, int32(3)+int32((*TWal)(unsafe.Pointer(pWal)).FreadLock)) (*TWal)(unsafe.Pointer(pWal)).FreadLock = int16(-int32(1)) } @@ -118785,7 +112379,7 @@ func _walFindFrame(tls *libc.TLS, pWal uintptr, pgno TPgno, piRead uintptr) (r i nCollide-- if v3 == 0 { *(*Tu32)(unsafe.Pointer(piRead)) = uint32(0) - return _sqlite3CorruptError(tls, int32(68694)) + return _sqlite3CorruptError(tls, int32(69456)) } iKey = _walNextHash(tls, iKey) } @@ -118931,7 +112525,7 @@ func _sqlite3WalEndWriteTransaction(tls *libc.TLS, pWal uintptr) (r int32) { // ** Otherwise, if the callback function does not return an error, this // ** function returns SQLITE_OK. // */ -func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintptr) (r int32) { +func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, __ccgo_fp_xUndo uintptr, pUndoCtx uintptr) (r int32) { var iFrame, iMax TPgno var rc int32 _, _, _ = iFrame, iMax, rc @@ -118958,7 +112552,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt ** page 1 is never written to the log until the transaction is ** committed. As a result, the call to xUndo may not fail. */ - rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) + rc = (*(*func(*libc.TLS, uintptr, TPgno) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xUndo})))(tls, pUndoCtx, _walFramePgno(tls, pWal, iFrame)) goto _1 _1: ; @@ -118967,6 +112561,7 @@ func _sqlite3WalUndo(tls *libc.TLS, pWal uintptr, xUndo uintptr, pUndoCtx uintpt if iMax != (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { _walCleanupHash(tls, pWal) } + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) } return rc } @@ -119011,6 +112606,9 @@ func _sqlite3WalSavepointUndo(tls *libc.TLS, pWal uintptr, aWalData uintptr) (r *(*Tu32)(unsafe.Pointer(pWal + 52 + 24)) = *(*Tu32)(unsafe.Pointer(aWalData + 1*4)) *(*Tu32)(unsafe.Pointer(pWal + 52 + 24 + 1*4)) = *(*Tu32)(unsafe.Pointer(aWalData + 2*4)) _walCleanupHash(tls, pWal) + if (*TWal)(unsafe.Pointer(pWal)).FiReCksum > (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame { + (*TWal)(unsafe.Pointer(pWal)).FiReCksum = uint32(0) + } } return rc } @@ -119283,7 +112881,7 @@ func _walFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, nTrunc } } if int32((*TWal)(unsafe.Pointer(pWal)).FszPage) != szPage { - return _sqlite3CorruptError(tls, int32(69217)) /* TH3 test case: cov1/corrupt155.test */ + return _sqlite3CorruptError(tls, int32(69983)) /* TH3 test case: cov1/corrupt155.test */ } /* Setup information needed to write frames into the WAL */ (*(*TWalWriter)(unsafe.Pointer(bp))).FpWal = pWal @@ -119464,7 +113062,7 @@ func _sqlite3WalFrames(tls *libc.TLS, pWal uintptr, szPage int32, pList uintptr, // ** If parameter xBusy is not NULL, it is a pointer to a busy-handler // ** callback. In this case this function runs a blocking checkpoint. // */ -func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { +func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, __ccgo_fp_xBusy uintptr, pBusyArg uintptr, sync_flags int32, nBuf int32, zBuf uintptr, pnLog uintptr, pnCkpt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var eMode2, rc, v1 int32 @@ -119473,7 +113071,7 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, _, _, _, _ = eMode2, rc, xBusy2, v1 /* Return code */ *(*int32)(unsafe.Pointer(bp)) = 0 /* True if a new wal-index header is loaded */ eMode2 = eMode /* Mode to pass to walCheckpoint() */ - xBusy2 = xBusy /* Busy handler for eMode2 */ + xBusy2 = __ccgo_fp_xBusy /* Busy handler for eMode2 */ /* EVIDENCE-OF: R-62920-47450 The busy-handler callback is never invoked ** in the SQLITE_CHECKPOINT_PASSIVE mode. */ if (*TWal)(unsafe.Pointer(pWal)).FreadOnly != 0 { @@ -119525,14 +113123,14 @@ func _sqlite3WalCheckpoint(tls *libc.TLS, pWal uintptr, db uintptr, eMode int32, rc = _walIndexReadHdr(tls, pWal, bp) if eMode2 != SQLITE_CHECKPOINT_PASSIVE { } - if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { + if *(*int32)(unsafe.Pointer(bp)) != 0 && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*TWal)(unsafe.Pointer(pWal)).FpDbFd)).FpMethods)).FiVersion >= int32(3) { _sqlite3OsUnfetch(tls, (*TWal)(unsafe.Pointer(pWal)).FpDbFd, 0, uintptr(0)) } } /* Copy data from the log to the database file. */ if rc == SQLITE_OK { if (*TWal)(unsafe.Pointer(pWal)).Fhdr.FmxFrame != 0 && _walPagesize(tls, pWal) != nBuf { - rc = _sqlite3CorruptError(tls, int32(69477)) + rc = _sqlite3CorruptError(tls, int32(70243)) } else { rc = _walCheckpoint(tls, pWal, db, eMode2, xBusy2, pBusyArg, sync_flags, zBuf) } @@ -120080,288 +113678,6 @@ type TCellInfo = struct { type CellInfo = TCellInfo -/* -** This is a magic string that appears at the beginning of every -** SQLite database in order to identify the file as a real database. -** -** You can change this value at compile-time by specifying a -** -DSQLITE_FILE_HEADER="..." on the compiler command-line. The -** header must be exactly 16 bytes including the zero-terminator so -** the string itself should be 15 characters long. If you change -** the header, then your custom library will not be able to read -** databases generated by the standard tools and the standard tools -** will not be able to read databases created by your custom library. - */ - -/* -** Page type flags. An ORed combination of these flags appear as the -** first byte of on-disk image of every BTree page. - */ - -/* -** An instance of this object stores information about each a single database -** page that has been loaded into memory. The information in this object -** is derived from the raw on-disk page content. -** -** As each database page is loaded into memory, the pager allocates an -** instance of this object and zeros the first 8 bytes. (This is the -** "extra" information associated with each page of the pager.) -** -** Access to all fields of this structure is controlled by the mutex -** stored in MemPage.pBt->mutex. - */ -type TMemPage1 = struct { - FisInit Tu8 - FintKey Tu8 - FintKeyLeaf Tu8 - Fpgno TPgno - Fleaf Tu8 - FhdrOffset Tu8 - FchildPtrSize Tu8 - Fmax1bytePayload Tu8 - FnOverflow Tu8 - FmaxLocal Tu16 - FminLocal Tu16 - FcellOffset Tu16 - FnFree int32 - FnCell Tu16 - FmaskPage Tu16 - FaiOvfl [4]Tu16 - FapOvfl [4]uintptr - FpBt uintptr - FaData uintptr - FaDataEnd uintptr - FaCellIdx uintptr - FaDataOfst uintptr - FpDbPage uintptr - FxCellSize uintptr - FxParseCell uintptr -} - -type MemPage1 = TMemPage1 - -/* -** A linked list of the following structures is stored at BtShared.pLock. -** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor -** is opened on the table with root page BtShared.iTable. Locks are removed -** from this list when a transaction is committed or rolled back, or when -** a btree handle is closed. - */ -type TBtLock1 = struct { - FpBtree uintptr - FiTable TPgno - FeLock Tu8 - FpNext uintptr -} - -type BtLock1 = TBtLock1 - -/* Candidate values for BtLock.eLock */ - -/* A Btree handle -** -** A database connection contains a pointer to an instance of -** this object for every database file that it has open. This structure -** is opaque to the database connection. The database connection cannot -** see the internals of this structure and only deals with pointers to -** this structure. -** -** For some database files, the same underlying database cache might be -** shared between multiple connections. In that case, each connection -** has it own instance of this object. But each instance of this object -** points to the same BtShared object. The database cache and the -** schema associated with the database file are all contained within -** the BtShared object. -** -** All fields in this structure are accessed under sqlite3.mutex. -** The pBt pointer itself may not be changed while there exists cursors -** in the referenced BtShared that point back to this Btree since those -** cursors have to go through this Btree to find their BtShared and -** they often do so without holding sqlite3.mutex. - */ -type TBtree1 = struct { - Fdb uintptr - FpBt uintptr - FinTrans Tu8 - Fsharable Tu8 - Flocked Tu8 - FhasIncrblobCur Tu8 - FwantToLock int32 - FnBackup int32 - FiBDataVersion Tu32 - FpNext uintptr - FpPrev uintptr - Flock TBtLock -} - -type Btree1 = TBtree1 - -/* -** Btree.inTrans may take one of the following values. -** -** If the shared-data extension is enabled, there may be multiple users -** of the Btree structure. At most one of these may open a write transaction, -** but any number may have active read transactions. -** -** These values must match SQLITE_TXN_NONE, SQLITE_TXN_READ, and -** SQLITE_TXN_WRITE - */ - -/* -** An instance of this object represents a single database file. -** -** A single database file can be in use at the same time by two -** or more database connections. When two or more connections are -** sharing the same database file, each connection has it own -** private Btree object for the file and each of those Btrees points -** to this one BtShared object. BtShared.nRef is the number of -** connections currently sharing this database file. -** -** Fields in this structure are accessed under the BtShared.mutex -** mutex, except for nRef and pNext which are accessed under the -** global SQLITE_MUTEX_STATIC_MAIN mutex. The pPager field -** may not be modified once it is initially set as long as nRef>0. -** The pSchema field may be set once under BtShared.mutex and -** thereafter is unchanged as long as nRef>0. -** -** isPending: -** -** If a BtShared client fails to obtain a write-lock on a database -** table (because there exists one or more read-locks on the table), -** the shared-cache enters 'pending-lock' state and isPending is -** set to true. -** -** The shared-cache leaves the 'pending lock' state when either of -** the following occur: -** -** 1) The current writer (BtShared.pWriter) concludes its transaction, OR -** 2) The number of locks held by other connections drops to zero. -** -** while in the 'pending-lock' state, no connection may start a new -** transaction. -** -** This feature is included to help prevent writer-starvation. - */ -type TBtShared1 = struct { - FpPager uintptr - Fdb uintptr - FpCursor uintptr - FpPage1 uintptr - FopenFlags Tu8 - FautoVacuum Tu8 - FincrVacuum Tu8 - FbDoTruncate Tu8 - FinTransaction Tu8 - Fmax1bytePayload Tu8 - FnReserveWanted Tu8 - FbtsFlags Tu16 - FmaxLocal Tu16 - FminLocal Tu16 - FmaxLeaf Tu16 - FminLeaf Tu16 - FpageSize Tu32 - FusableSize Tu32 - FnTransaction int32 - FnPage Tu32 - FpSchema uintptr - FxFreeSchema uintptr - Fmutex uintptr - FpHasContent uintptr - FnRef int32 - FpNext uintptr - FpLock uintptr - FpWriter uintptr - FpTmpSpace uintptr - FnPreformatSize int32 -} - -type BtShared1 = TBtShared1 - -/* -** Allowed values for BtShared.btsFlags - */ - -/* -** An instance of the following structure is used to hold information -** about a cell. The parseCellPtr() function fills in this structure -** based on information extract from the raw disk page. - */ -type TCellInfo1 = struct { - F__ccgo_align [0]uint32 - FnKey Ti64 - FpPayload uintptr - FnPayload Tu32 - FnLocal Tu16 - FnSize Tu16 - F__ccgo_pad5 [4]byte -} - -type CellInfo1 = TCellInfo1 - -/* -** Maximum depth of an SQLite B-Tree structure. Any B-Tree deeper than -** this will be declared corrupt. This value is calculated based on a -** maximum database size of 2^31 pages a minimum fanout of 2 for a -** root-node and 3 for all other internal nodes. -** -** If a tree that appears to be taller than this is encountered, it is -** assumed that the database is corrupt. - */ - -/* -** A cursor is a pointer to a particular entry within a particular -** b-tree within a database file. -** -** The entry is identified by its MemPage and the index in -** MemPage.aCell[] of the entry. -** -** A single database file can be shared by two more database connections, -** but cursors cannot be shared. Each cursor is associated with a -** particular database connection identified BtCursor.pBtree.db. -** -** Fields in this structure are accessed under the BtShared.mutex -** found at self->pBt->mutex. -** -** skipNext meaning: -** The meaning of skipNext depends on the value of eState: -** -** eState Meaning of skipNext -** VALID skipNext is meaningless and is ignored -** INVALID skipNext is meaningless and is ignored -** SKIPNEXT sqlite3BtreeNext() is a no-op if skipNext>0 and -** sqlite3BtreePrevious() is no-op if skipNext<0. -** REQUIRESEEK restoreCursorPosition() restores the cursor to -** eState=SKIPNEXT if skipNext!=0 -** FAULT skipNext holds the cursor fault error code. - */ -type TBtCursor1 = struct { - F__ccgo_align [0]uint32 - FeState Tu8 - FcurFlags Tu8 - FcurPagerFlags Tu8 - Fhints Tu8 - FskipNext int32 - FpBtree uintptr - FaOverflow uintptr - FpKey uintptr - FpBt uintptr - FpNext uintptr - F__ccgo_align10 [4]byte - Finfo TCellInfo - FnKey Ti64 - FpgnoRoot TPgno - FiPage Ti8 - FcurIntKey Tu8 - Fix Tu16 - FaiIdx [19]Tu16 - FpKeyInfo uintptr - FpPage uintptr - FapPage [19]uintptr - F__ccgo_pad20 [4]byte -} - -type BtCursor1 = TBtCursor1 - /* ** Legal values for BtCursor.curFlags */ @@ -120495,28 +113811,6 @@ type TIntegrityCk = struct { type IntegrityCk = TIntegrityCk -type TIntegrityCk1 = struct { - F__ccgo_align [0]uint32 - FpBt uintptr - FpPager uintptr - FaPgRef uintptr - FnCkPage TPgno - FmxErr int32 - FnErr int32 - Frc int32 - FnStep Tu32 - FzPfx uintptr - Fv0 TPgno - Fv1 TPgno - Fv2 int32 - FerrMsg TStrAccum - Fheap uintptr - Fdb uintptr - FnRow Ti64 -} - -type IntegrityCk1 = TIntegrityCk1 - /* ** Routines to read or write a two- and four-byte big-endian integer values. */ @@ -120679,10 +113973,11 @@ func _sqlite3BtreeLeave(tls *libc.TLS, p uintptr) { // ** at the same instant. // */ func _btreeEnterAll(tls *libc.TLS, db uintptr) { - var i, skipOk int32 + var i int32 var p uintptr + var skipOk Tu8 _, _, _ = i, p, skipOk - skipOk = int32(1) + skipOk = uint8(1) i = 0 for { if !(i < (*Tsqlite3)(unsafe.Pointer(db)).FnDb) { @@ -120691,14 +113986,14 @@ func _btreeEnterAll(tls *libc.TLS, db uintptr) { p = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpBt if p != 0 && (*TBtree)(unsafe.Pointer(p)).Fsharable != 0 { _sqlite3BtreeEnter(tls, p) - skipOk = 0 + skipOk = uint8(0) } goto _1 _1: ; i++ } - (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(skipOk) + (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = skipOk } func _sqlite3BtreeEnterAll(tls *libc.TLS, db uintptr) { @@ -121398,11 +114693,11 @@ func _btreeMoveto(tls *libc.TLS, pCur uintptr, pKey uintptr, nKey Ti64, bias int } _sqlite3VdbeRecordUnpack(tls, pKeyInfo, int32(nKey), pKey, pIdxKey) if int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) == 0 || int32((*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FnField) > int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnAllField) { - rc = _sqlite3CorruptError(tls, int32(71659)) + rc = _sqlite3CorruptError(tls, int32(72431)) } else { rc = _sqlite3BtreeIndexMoveto(tls, pCur, pIdxKey, pRes) } - _sqlite3DbFree(tls, (*TKeyInfo1)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) + _sqlite3DbFree(tls, (*TKeyInfo)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo)).Fdb, pIdxKey) } else { pIdxKey = uintptr(0) rc = _sqlite3BtreeTableMoveto(tls, pCur, nKey, bias, pRes) @@ -121576,7 +114871,7 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, } /* The super-journal page number must never be used as a pointer map page */ if key == uint32(0) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71857)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72629)) return } iPtrmap = _ptrmapPageno(tls, pBt, key) @@ -121589,12 +114884,12 @@ func _ptrmapPut(tls *libc.TLS, pBt uintptr, key TPgno, eType Tu8, parent TPgno, /* The first byte of the extra data is the MemPage.isInit byte. ** If that byte is set, it means this page is also being used ** as a btree page. */ - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71870)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72642)) goto ptrmap_exit } offset = int32(libc.Uint32FromInt32(5) * (key - iPtrmap - libc.Uint32FromInt32(1))) if offset < 0 { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(71875)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72647)) goto ptrmap_exit } pPtrmap = _sqlite3PagerGetData(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -121638,7 +114933,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin offset = int32(libc.Uint32FromInt32(5) * (key - uint32(iPtrmap) - libc.Uint32FromInt32(1))) if offset < 0 { _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) - return _sqlite3CorruptError(tls, int32(71920)) + return _sqlite3CorruptError(tls, int32(72692)) } *(*Tu8)(unsafe.Pointer(pEType)) = *(*Tu8)(unsafe.Pointer(pPtrmap + uintptr(offset))) if pPgno != 0 { @@ -121646,7 +114941,7 @@ func _ptrmapGet(tls *libc.TLS, pBt uintptr, key TPgno, pEType uintptr, pPgno uin } _sqlite3PagerUnref(tls, *(*uintptr)(unsafe.Pointer(bp))) if int32(*(*Tu8)(unsafe.Pointer(pEType))) < int32(1) || int32(*(*Tu8)(unsafe.Pointer(pEType))) > int32(5) { - return _sqlite3CorruptError(tls, int32(71928)) + return _sqlite3CorruptError(tls, int32(72700)) } return SQLITE_OK } @@ -121834,7 +115129,7 @@ func _btreeParseCellPtr(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(uint16(int32(pIter)-int32(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(uint16(nPayload)) + int32(uint16(int32(pIter)-int32(pCell)))) if int32((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -121867,7 +115162,7 @@ func _btreeParseCellPtrIndex(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ - (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(nPayload + uint32(uint16(int32(pIter)-int32(pCell)))) + (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(int32(uint16(nPayload)) + int32(uint16(int32(pIter)-int32(pCell)))) if int32((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) < int32(4) { (*TCellInfo)(unsafe.Pointer(pInfo)).FnSize = uint16(4) } @@ -122066,7 +115361,7 @@ func _ptrmapPutOvflPtr(tls *libc.TLS, pPage uintptr, pSrc uintptr, pCell uintptr (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if uint32(pCell) < uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) && uint32(pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal)) > uint32((*TMemPage)(unsafe.Pointer(pSrc)).FaDataEnd) { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(72368)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(73145)) return } ovfl = _sqlite3Get4byte(tls, pCell+uintptr(int32((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-int32(4))) @@ -122106,12 +115401,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { if int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) <= nMaxFrag { iFree = int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(1)))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72426)) + return _sqlite3CorruptError(tls, int32(73203)) } if iFree != 0 { iFree2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree))))< usableSize-int32(4) { - return _sqlite3CorruptError(tls, int32(72429)) + return _sqlite3CorruptError(tls, int32(73206)) } if 0 == iFree2 || int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2)))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(1))))) == 0 { pEnd = data + uintptr(cellOffset+nCell*int32(2)) @@ -122119,21 +115414,21 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { sz = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree+int32(2)))))<= iFree { - return _sqlite3CorruptError(tls, int32(72437)) + return _sqlite3CorruptError(tls, int32(73214)) } if iFree2 != 0 { if iFree+sz > iFree2 { - return _sqlite3CorruptError(tls, int32(72440)) + return _sqlite3CorruptError(tls, int32(73217)) } sz2 = int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFree2+int32(2)))))< usableSize { - return _sqlite3CorruptError(tls, int32(72442)) + return _sqlite3CorruptError(tls, int32(73219)) } libc.Xmemmove(tls, data+uintptr(iFree+sz+sz2), data+uintptr(iFree+sz), uint32(iFree2-(iFree+sz))) sz += sz2 } else { if iFree+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72446)) + return _sqlite3CorruptError(tls, int32(73223)) } } cbrk = top + sz @@ -122180,12 +115475,12 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { ** if PRAGMA cell_size_check=ON. */ if pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72479)) + return _sqlite3CorruptError(tls, int32(73256)) } size = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, src+uintptr(pc))) cbrk -= size if cbrk < iCellStart || pc+size > usableSize { - return _sqlite3CorruptError(tls, int32(72485)) + return _sqlite3CorruptError(tls, int32(73262)) } *(*Tu8)(unsafe.Pointer(pAddr1)) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*Tu8)(unsafe.Pointer(pAddr1 + 1)) = uint8(cbrk) @@ -122201,7 +115496,7 @@ func _defragmentPage(tls *libc.TLS, pPage uintptr, nMaxFrag int32) (r int32) { defragment_out: ; if int32(*(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))))+cbrk-iCellFirst != (*TMemPage)(unsafe.Pointer(pPage)).FnFree { - return _sqlite3CorruptError(tls, int32(72499)) + return _sqlite3CorruptError(tls, int32(73276)) } *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8(cbrk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8(cbrk) @@ -122261,7 +115556,7 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint } else { if x+pc > maxPC { /* This slot extends off the end of the usable part of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72556)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73333)) return uintptr(0) } else { /* The slot remains on the free-list. Reduce its size to account @@ -122278,14 +115573,14 @@ func _pageFindSlot(tls *libc.TLS, pPg uintptr, nByte int32, pRc uintptr) (r uint if pc <= iAddr { if pc != 0 { /* The next slot in the chain comes before the current slot */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72571)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73348)) } return uintptr(0) } } if pc > maxPC+nByte-int32(4) { /* The free slot chain extends off the end of the page */ - *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(72578)) + *(*int32)(unsafe.Pointer(pRc)) = _sqlite3CorruptError(tls, int32(73355)) } return uintptr(0) } @@ -122328,11 +115623,11 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r if top == 0 && (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize == uint32(65536) { top = int32(65536) } else { - return _sqlite3CorruptError(tls, int32(72626)) + return _sqlite3CorruptError(tls, int32(73403)) } } else { if top > int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(72629)) + return _sqlite3CorruptError(tls, int32(73406)) } } /* If there is enough space between gap and top for one more cell pointer, @@ -122346,7 +115641,7 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r g2 = v1 *(*int32)(unsafe.Pointer(pIdx)) = v1 if g2 <= gap { - return _sqlite3CorruptError(tls, int32(72646)) + return _sqlite3CorruptError(tls, int32(73423)) } else { return SQLITE_OK } @@ -122399,42 +115694,40 @@ func _allocateSpace(tls *libc.TLS, pPage uintptr, nByte int32, pIdx uintptr) (r // ** at the end of the page. So do additional corruption checks inside this // ** routine and return SQLITE_CORRUPT if any problems are found. // */ -func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) { +func _freeSpace(tls *libc.TLS, pPage uintptr, iStart int32, iSize int32) (r int32) { var data, pTmp, p2 uintptr - var hdr, nFrag Tu8 - var iEnd Tu32 - var iFreeBlk, iOrigSize, iPtr, x, v1 Tu16 - var iPtrEnd int32 + var hdr Tu8 + var iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, x, v1 int32 _, _, _, _, _, _, _, _, _, _, _, _ = data, hdr, iEnd, iFreeBlk, iOrigSize, iPtr, iPtrEnd, nFrag, pTmp, x, v1, p2 /* Page header size. 0 or 100 */ - nFrag = uint8(0) /* Reduction in fragmentation */ + nFrag = 0 /* Reduction in fragmentation */ iOrigSize = iSize /* Offset to cell content area */ - iEnd = uint32(int32(iStart) + int32(iSize)) /* First byte past the iStart buffer */ + iEnd = iStart + iSize /* First byte past the iStart buffer */ data = (*TMemPage)(unsafe.Pointer(pPage)).FaData /* Temporary ptr into data[] */ /* Minimum cell size is 4 */ /* The list of freeblocks must be in ascending order. Find the ** spot on the list where iStart should be inserted. */ hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset - iPtr = uint16(int32(hdr) + int32(1)) - if int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(1))))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { - iFreeBlk = uint16(0) /* Shortcut for the case when the freelist is empty */ + iPtr = int32(hdr) + int32(1) + if int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(1))))) == 0 && int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr)))) == 0 { + iFreeBlk = 0 /* Shortcut for the case when the freelist is empty */ } else { for { - v1 = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize-uint32(4) { /* TH3: corrupt081.100 */ - return _sqlite3CorruptError(tls, int32(72730)) + if iFreeBlk > int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize)-int32(4) { /* TH3: corrupt081.100 */ + return _sqlite3CorruptError(tls, int32(73507)) } /* At this point: ** iFreeBlk: First freeblock after iStart, or zero if none @@ -122442,70 +115735,70 @@ func _freeSpace(tls *libc.TLS, pPage uintptr, iStart Tu16, iSize Tu16) (r int32) ** ** Check to see if iFreeBlk should be coalesced onto the end of iStart. */ - if iFreeBlk != 0 && iEnd+uint32(3) >= uint32(iFreeBlk) { - nFrag = uint8(uint32(iFreeBlk) - iEnd) - if iEnd > uint32(iFreeBlk) { - return _sqlite3CorruptError(tls, int32(72742)) + if iFreeBlk != 0 && iEnd+int32(3) >= iFreeBlk { + nFrag = iFreeBlk - iEnd + if iEnd > iFreeBlk { + return _sqlite3CorruptError(tls, int32(73519)) } - iEnd = uint32(int32(iFreeBlk) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iFreeBlk)+int32(2)))))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - return _sqlite3CorruptError(tls, int32(72745)) + iEnd = iFreeBlk + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk+int32(2)))))< int32((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { + return _sqlite3CorruptError(tls, int32(73522)) } - iSize = uint16(iEnd - uint32(iStart)) - iFreeBlk = uint16(int32(*(*uint8)(unsafe.Pointer(data + uintptr(iFreeBlk))))< int32(hdr)+int32(1) { - iPtrEnd = int32(iPtr) + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(iPtr)+int32(2)))))<= int32(iStart) { - if iPtrEnd > int32(iStart) { - return _sqlite3CorruptError(tls, int32(72758)) - } - nFrag = Tu8(int32(nFrag) + (int32(iStart) - iPtrEnd)) - iSize = uint16(iEnd - uint32(iPtr)) + if iPtr > int32(hdr)+int32(1) { + iPtrEnd = iPtr + (int32(*(*uint8)(unsafe.Pointer(data + uintptr(iPtr+int32(2)))))<= iStart { + if iPtrEnd > iStart { + return _sqlite3CorruptError(tls, int32(73535)) + } + nFrag += iStart - iPtrEnd + iSize = iEnd - iPtr iStart = iPtr } } - if int32(nFrag) > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7))))) { - return _sqlite3CorruptError(tls, int32(72764)) + if nFrag > int32(*(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7))))) { + return _sqlite3CorruptError(tls, int32(73541)) } p2 = data + uintptr(int32(hdr)+int32(7)) - *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - int32(nFrag)) + *(*uint8)(unsafe.Pointer(p2)) = uint8(int32(*(*uint8)(unsafe.Pointer(p2))) - int32(uint8(nFrag))) } pTmp = data + uintptr(int32(hdr)+int32(5)) - x = uint16(int32(*(*Tu8)(unsafe.Pointer(pTmp)))<> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)))) = uint8(iFreeBlk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(1)) + 1)) = uint8(iFreeBlk) *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8(iEnd >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8(iEnd) } else { /* Insert the new freeblock into the freelist */ - *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = uint8(int32(iStart) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iPtr))) = uint8(iStart >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iPtr) + 1)) = uint8(iStart) - *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = uint8(int32(iFreeBlk) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart))) = uint8(iFreeBlk >> libc.Int32FromInt32(8)) *(*uint8)(unsafe.Pointer(data + uintptr(iStart) + 1)) = uint8(iFreeBlk) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)))) = uint8(int32(iSize) >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(iStart)+int32(2)) + 1)) = uint8(iSize) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)))) = uint8(int32(uint16(iSize)) >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(iStart+int32(2)) + 1)) = uint8(uint16(iSize)) } - *(*int32)(unsafe.Pointer(pPage + 20)) += int32(iOrigSize) + *(*int32)(unsafe.Pointer(pPage + 20)) += iOrigSize return SQLITE_OK } @@ -122551,7 +115844,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtrIdxLeaf) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72833)) + return _sqlite3CorruptError(tls, int32(73611)) } } } else { @@ -122577,7 +115870,7 @@ func _decodeFlags(tls *libc.TLS, pPage uintptr, flagByte int32) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FintKeyLeaf = uint8(0) (*TMemPage)(unsafe.Pointer(pPage)).FxCellSize = __ccgo_fp(_cellSizePtr) (*TMemPage)(unsafe.Pointer(pPage)).FxParseCell = __ccgo_fp(_btreeParseCellPtrIndex) - return _sqlite3CorruptError(tls, int32(72857)) + return _sqlite3CorruptError(tls, int32(73635)) } } } @@ -122616,12 +115909,12 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-55530-52930 In a well-formed b-tree page, there will ** always be at least one cell before the first freeblock. */ - return _sqlite3CorruptError(tls, int32(72908)) + return _sqlite3CorruptError(tls, int32(73686)) } for int32(1) != 0 { if pc > iCellLast { /* Freeblock off the end of the page */ - return _sqlite3CorruptError(tls, int32(72913)) + return _sqlite3CorruptError(tls, int32(73691)) } next = uint32(int32(*(*Tu8)(unsafe.Pointer(data + uintptr(pc))))< uint32(0) { /* Freeblock not in ascending order */ - return _sqlite3CorruptError(tls, int32(72923)) + return _sqlite3CorruptError(tls, int32(73701)) } if uint32(pc)+size > uint32(usableSize) { /* Last freeblock extends past page end */ - return _sqlite3CorruptError(tls, int32(72927)) + return _sqlite3CorruptError(tls, int32(73705)) } } /* At this point, nFree contains the sum of the offset to the start @@ -122648,7 +115941,7 @@ func _btreeComputeFreeSpace(tls *libc.TLS, pPage uintptr) (r int32) { ** area, according to the page header, lies within the page. */ if nFree > usableSize || nFree < iCellFirst { - return _sqlite3CorruptError(tls, int32(72939)) + return _sqlite3CorruptError(tls, int32(73717)) } (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16(nFree - iCellFirst)) return SQLITE_OK @@ -122679,11 +115972,11 @@ func _btreeCellSizeCheck(tls *libc.TLS, pPage uintptr) (r int32) { } pc = int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer(data + uintptr(cellOffset+i*int32(2)))))) if pc < iCellFirst || pc > iCellLast { - return _sqlite3CorruptError(tls, int32(72970)) + return _sqlite3CorruptError(tls, int32(73748)) } sz = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxCellSize})))(tls, pPage, data+uintptr(pc))) if pc+sz > usableSize { - return _sqlite3CorruptError(tls, int32(72975)) + return _sqlite3CorruptError(tls, int32(73753)) } goto _1 _1: @@ -122712,11 +116005,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { /* EVIDENCE-OF: R-28594-02890 The one-byte flag at offset 0 indicating ** the b-tree page type. */ if _decodeFlags(tls, pPage, int32(*(*Tu8)(unsafe.Pointer(data)))) != 0 { - return _sqlite3CorruptError(tls, int32(73007)) + return _sqlite3CorruptError(tls, int32(73785)) } (*TMemPage)(unsafe.Pointer(pPage)).FmaskPage = uint16((*TBtShared)(unsafe.Pointer(pBt)).FpageSize - libc.Uint32FromInt32(1)) (*TMemPage)(unsafe.Pointer(pPage)).FnOverflow = uint8(0) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = uint16(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + int32(8) + int32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = uint16(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) + libc.Int32FromInt32(8) + int32((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize)) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) + uintptr(8) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -122725,7 +116018,7 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FnCell = uint16(int32(*(*Tu8)(unsafe.Pointer(data + 3)))< ((*TBtShared)(unsafe.Pointer(pBt)).FpageSize-uint32(8))/uint32(6) { /* To many cells for a single page. The page must be corrupt */ - return _sqlite3CorruptError(tls, int32(73021)) + return _sqlite3CorruptError(tls, int32(73799)) } /* EVIDENCE-OF: R-24089-57979 If a page contains no cells (which is only ** possible for a root page of a table that contains no rows) then the @@ -122747,13 +116040,11 @@ func _btreeInitPage(tls *libc.TLS, pPage uintptr) (r int32) { // */ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { var data, pBt uintptr - var first Tu16 - var hdr Tu8 - var v1 int32 + var first, hdr, v1 int32 _, _, _, _, _ = data, first, hdr, pBt, v1 data = (*TMemPage)(unsafe.Pointer(pPage)).FaData pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt - hdr = (*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset + hdr = int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset) if int32((*TBtShared)(unsafe.Pointer(pBt)).FbtsFlags)&int32(BTS_FAST_SECURE) != 0 { libc.Xmemset(tls, data+uintptr(hdr), 0, (*TBtShared)(unsafe.Pointer(pBt)).FusableSize-uint32(hdr)) } @@ -122763,14 +116054,14 @@ func _zeroPage(tls *libc.TLS, pPage uintptr, flags int32) { } else { v1 = int32(8) } - first = uint16(int32(hdr) + v1) - libc.Xmemset(tls, data+uintptr(int32(hdr)+int32(1)), 0, uint32(4)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(7)))) = uint8(0) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) - *(*uint8)(unsafe.Pointer(data + uintptr(int32(hdr)+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) + first = hdr + v1 + libc.Xmemset(tls, data+uintptr(hdr+int32(1)), 0, uint32(4)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(7)))) = uint8(0) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)))) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize >> libc.Int32FromInt32(8)) + *(*uint8)(unsafe.Pointer(data + uintptr(hdr+int32(5)) + 1)) = uint8((*TBtShared)(unsafe.Pointer(pBt)).FusableSize) (*TMemPage)(unsafe.Pointer(pPage)).FnFree = int32(uint16((*TBtShared)(unsafe.Pointer(pBt)).FusableSize - uint32(first))) _decodeFlags(tls, pPage, flags) - (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = first + (*TMemPage)(unsafe.Pointer(pPage)).FcellOffset = uint16(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd = data + uintptr((*TBtShared)(unsafe.Pointer(pBt)).FpageSize) (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx = data + uintptr(first) (*TMemPage)(unsafe.Pointer(pPage)).FaDataOfst = data + uintptr((*TMemPage)(unsafe.Pointer(pPage)).FchildPtrSize) @@ -122878,7 +116169,7 @@ func _getAndInitPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, bRe _, _ = pPage, rc if pgno > _btreePagecount(tls, pBt) { *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73164)) + return _sqlite3CorruptError(tls, int32(73942)) } rc = _sqlite3PagerGet(tls, (*TBtShared)(unsafe.Pointer(pBt)).FpPager, pgno, bp, bReadOnly) if rc != 0 { @@ -122940,7 +116231,7 @@ func _btreeGetUnusedPage(tls *libc.TLS, pBt uintptr, pgno TPgno, ppPage uintptr, if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FpDbPage) > int32(1) { _releasePage(tls, *(*uintptr)(unsafe.Pointer(ppPage))) *(*uintptr)(unsafe.Pointer(ppPage)) = uintptr(0) - return _sqlite3CorruptError(tls, int32(73236)) + return _sqlite3CorruptError(tls, int32(74014)) } (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(ppPage)))).FisInit = uint8(0) } else { @@ -123028,7 +116319,7 @@ func _sqlite3BtreeOpen(tls *libc.TLS, pVfs uintptr, zFilename uintptr, db uintpt /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. */ - isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+5564) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) + isMemdb = libc.BoolInt32(zFilename != 0 && libc.Xstrcmp(tls, zFilename, __ccgo_ts+5652) == 0 || isTempDb != 0 && _sqlite3TempInMemory(tls, db) != 0 || vfsFlags&int32(SQLITE_OPEN_MEMORY) != 0) /* flags fit in 8 bits */ /* Only a BTREE_SINGLE database can be BTREE_UNORDERED */ /* A BTREE_SINGLE database is always a temporary and/or ephemeral */ @@ -123652,7 +116943,7 @@ func _sqlite3BtreeSecureDelete(tls *libc.TLS, p uintptr, newFlag int32) (r int32 p1 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) & ^libc.Int32FromInt32(BTS_FAST_SECURE)) p2 = (*TBtree)(unsafe.Pointer(p)).FpBt + 24 - *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag) + *(*Tu16)(unsafe.Pointer(p2)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p2))) | int32(uint16(libc.Int32FromInt32(BTS_SECURE_DELETE)*newFlag))) } b = int32((*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FbtsFlags) & int32(BTS_FAST_SECURE) / int32(BTS_SECURE_DELETE) _sqlite3BtreeLeave(tls, p) @@ -123814,7 +117105,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { ** The original design allowed these amounts to vary, but as of ** version 3.6.0, we require them to be fixed. */ - if libc.Xmemcmp(tls, page1+21, __ccgo_ts+5573, uint32(3)) != 0 { + if libc.Xmemcmp(tls, page1+21, __ccgo_ts+5661, uint32(3)) != 0 { goto page1_init_failed } /* EVIDENCE-OF: R-51873-39618 The page size for a database file is @@ -123852,7 +117143,7 @@ func _lockBtree(tls *libc.TLS, pBt uintptr) (r int32) { } if nPage > *(*Tu32)(unsafe.Pointer(bp + 4)) { if _sqlite3WritableSchema(tls, (*TBtShared)(unsafe.Pointer(pBt)).Fdb) == 0 { - rc = _sqlite3CorruptError(tls, int32(74174)) + rc = _sqlite3CorruptError(tls, int32(74952)) goto page1_init_failed } else { nPage = *(*Tu32)(unsafe.Pointer(bp + 4)) @@ -124293,7 +117584,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT if int32(eType) == int32(PTRMAP_OVERFLOW2) { /* The pointer is always the first 4 bytes of the page in this case. */ if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData) != iFrom { - return _sqlite3CorruptError(tls, int32(74622)) + return _sqlite3CorruptError(tls, int32(75407)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData, iTo) } else { @@ -124317,7 +117608,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pPage)).FxParseCell})))(tls, pPage, pCell, bp) if uint32((*(*TCellInfo)(unsafe.Pointer(bp))).FnLocal) < (*(*TCellInfo)(unsafe.Pointer(bp))).FnPayload { if pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74641)) + return _sqlite3CorruptError(tls, int32(75426)) } if iFrom == _sqlite3Get4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4)) { _sqlite3Put4byte(tls, pCell+uintptr((*(*TCellInfo)(unsafe.Pointer(bp))).FnSize)-uintptr(4), iTo) @@ -124326,7 +117617,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } } else { if pCell+uintptr(4) > (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize) { - return _sqlite3CorruptError(tls, int32(74650)) + return _sqlite3CorruptError(tls, int32(75435)) } if _sqlite3Get4byte(tls, pCell) == iFrom { _sqlite3Put4byte(tls, pCell, iTo) @@ -124340,7 +117631,7 @@ func _modifyPagePointer(tls *libc.TLS, pPage uintptr, iFrom TPgno, iTo TPgno, eT } if i == nCell { if int32(eType) != int32(PTRMAP_BTREE) || _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8))) != iFrom { - return _sqlite3CorruptError(tls, int32(74662)) + return _sqlite3CorruptError(tls, int32(75447)) } _sqlite3Put4byte(tls, (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+int32(8)), iTo) } @@ -124370,7 +117661,7 @@ func _relocatePage(tls *libc.TLS, pBt uintptr, pDbPage uintptr, eType Tu8, iPtrP iDbPage = (*TMemPage)(unsafe.Pointer(pDbPage)).Fpgno pPager = (*TBtShared)(unsafe.Pointer(pBt)).FpPager if iDbPage < uint32(3) { - return _sqlite3CorruptError(tls, int32(74697)) + return _sqlite3CorruptError(tls, int32(75482)) } /* Move page iDbPage from its current location to page number iFreePage */ *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3PagerMovepage(tls, pPager, (*TMemPage)(unsafe.Pointer(pDbPage)).FpDbPage, iFreePage, isCommit) @@ -124466,7 +117757,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom return rc } if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_ROOTPAGE) { - return _sqlite3CorruptError(tls, int32(74795)) + return _sqlite3CorruptError(tls, int32(75580)) } if int32(*(*Tu8)(unsafe.Pointer(bp))) == int32(PTRMAP_FREEPAGE) { if bCommit == 0 { @@ -124504,7 +117795,7 @@ func _incrVacuumStep(tls *libc.TLS, pBt uintptr, nFin TPgno, iLastPg TPgno, bCom _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 24))) if *(*TPgno)(unsafe.Pointer(bp + 16)) > dbSize { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp + 20))) - return _sqlite3CorruptError(tls, int32(74847)) + return _sqlite3CorruptError(tls, int32(75632)) } } rc = _relocatePage(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 20)), *(*Tu8)(unsafe.Pointer(bp)), *(*TPgno)(unsafe.Pointer(bp + 4)), *(*TPgno)(unsafe.Pointer(bp + 16)), bCommit) @@ -124571,7 +117862,7 @@ func _sqlite3BtreeIncrVacuum(tls *libc.TLS, p uintptr) (r int32) { nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) nFin = _finalDbSize(tls, pBt, nOrig, nFree) if nOrig < nFin || nFree >= nOrig { - rc = _sqlite3CorruptError(tls, int32(74915)) + rc = _sqlite3CorruptError(tls, int32(75700)) } else { if nFree > uint32(0) { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -124614,7 +117905,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { ** is either a pointer-map page or the pending-byte page. If one ** is encountered, this indicates corruption. */ - return _sqlite3CorruptError(tls, int32(74966)) + return _sqlite3CorruptError(tls, int32(75751)) } nFree = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36) db = (*TBtree)(unsafe.Pointer(p)).Fdb @@ -124644,7 +117935,7 @@ func _autoVacuumCommit(tls *libc.TLS, p uintptr) (r int32) { } nFin = _finalDbSize(tls, pBt, nOrig, nVac) if nFin > nOrig { - return _sqlite3CorruptError(tls, int32(74993)) + return _sqlite3CorruptError(tls, int32(75778)) } if nFin < nOrig { rc = _saveAllCursors(tls, pBt, uint32(0), uintptr(0)) @@ -125110,7 +118401,7 @@ func _btreeCursor(tls *libc.TLS, p uintptr, iTable TPgno, wrFlag int32, pKeyInfo /* Assert that the caller has opened the required transaction. */ if iTable <= uint32(1) { if iTable < uint32(1) { - return _sqlite3CorruptError(tls, int32(75457)) + return _sqlite3CorruptError(tls, int32(76242)) } else { if _btreePagecount(tls, pBt) == uint32(0) { iTable = uint32(0) @@ -125502,7 +118793,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin pBt = (*TBtCursor)(unsafe.Pointer(pCur)).FpBt /* Btree this cursor belongs to */ pBufStart = pBuf /* Start of original out buffer */ if int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(75881)) + return _sqlite3CorruptError(tls, int32(76666)) } _getCellInfo(tls, pCur) aPayload = (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload @@ -125512,7 +118803,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin ** &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] ** but is recast into its current form to avoid integer overflow problems */ - return _sqlite3CorruptError(tls, int32(75896)) + return _sqlite3CorruptError(tls, int32(76681)) } /* Check if data must be read/written to/from the btree page itself. */ if offset < uint32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) { @@ -125569,7 +118860,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin for *(*TPgno)(unsafe.Pointer(bp)) != 0 { /* If required, populate the overflow page-list cache. */ if *(*TPgno)(unsafe.Pointer(bp)) > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(75967)) + return _sqlite3CorruptError(tls, int32(76752)) } *(*TPgno)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FaOverflow + uintptr(iIdx)*4)) = *(*TPgno)(unsafe.Pointer(bp)) if offset >= ovflSize { @@ -125643,7 +118934,7 @@ func _accessPayload(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32, pBuf uin } if rc == SQLITE_OK && amt > uint32(0) { /* Overflow chain ends prematurely */ - return _sqlite3CorruptError(tls, int32(76051)) + return _sqlite3CorruptError(tls, int32(76836)) } return rc } @@ -125778,7 +119069,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { var v3, p1 uintptr _, _, _, _ = rc, v2, v3, p1 if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76189)) + return _sqlite3CorruptError(tls, int32(76974)) } (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) p1 = pCur + 1 @@ -125790,7 +119081,7 @@ func _moveToChild(tls *libc.TLS, pCur uintptr, newPgno Tu32) (r int32) { rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, newPgno, pCur+116, int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76203)) + rc = _sqlite3CorruptError(tls, int32(76988)) } if rc != 0 { v3 = pCur + 68 @@ -125906,7 +119197,7 @@ func _moveToRoot(tls *libc.TLS, pCur uintptr) (r int32) { ** in such a way that page pRoot is linked into a second b-tree table ** (or the freelist). */ if int32((*TMemPage)(unsafe.Pointer(pRoot)).FisInit) == 0 || libc.BoolInt32((*TBtCursor)(unsafe.Pointer(pCur)).FpKeyInfo == uintptr(0)) != int32((*TMemPage)(unsafe.Pointer(pRoot)).FintKey) { - return _sqlite3CorruptError(tls, int32(76338)) + return _sqlite3CorruptError(tls, int32(77123)) } goto skip_init skip_init: @@ -125920,7 +119211,7 @@ skip_init: } else { if !((*TMemPage)(unsafe.Pointer(pRoot)).Fleaf != 0) { if (*TMemPage)(unsafe.Pointer(pRoot)).Fpgno != uint32(1) { - return _sqlite3CorruptError(tls, int32(76350)) + return _sqlite3CorruptError(tls, int32(77135)) } subpage = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pRoot)).FaData+uintptr(int32((*TMemPage)(unsafe.Pointer(pRoot)).FhdrOffset)+int32(8))) (*TBtCursor)(unsafe.Pointer(pCur)).FeState = uint8(CURSOR_VALID) @@ -126154,7 +119445,7 @@ func _sqlite3BtreeTableMoveto(tls *libc.TLS, pCur uintptr, intKey Ti64, biasRigh break } if pCell >= (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(76599)) + return _sqlite3CorruptError(tls, int32(77384)) } } } @@ -126238,7 +119529,7 @@ moveto_table_finish: // ** This routine is part of an optimization. It is always safe to return // ** a positive value as that will cause the optimization to be skipped. // */ -func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, xRecordCompare TRecordCompare) (r int32) { +func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, __ccgo_fp_xRecordCompare TRecordCompare) (r int32) { var c, nCell, v1 int32 var pCell, pPage uintptr var v2 bool @@ -126250,7 +119541,7 @@ func _indexCellCompare(tls *libc.TLS, pCur uintptr, idx int32, pIdxKey uintptr, /* This branch runs if the record-size field of the cell is a ** single byte varint and the record fits entirely on the main ** b-tree page. */ - c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) + c = (*(*func(*libc.TLS, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xRecordCompare})))(tls, nCell, pCell+1, pIdxKey) } else { if v2 = !(int32(*(*Tu8)(unsafe.Pointer(pCell + 1)))&libc.Int32FromInt32(0x80) != 0); v2 { v1 = nCell&libc.Int32FromInt32(0x7f)< (*TBtShared)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpBt)).FnPage { - rc = _sqlite3CorruptError(tls, int32(76882)) + rc = _sqlite3CorruptError(tls, int32(77667)) goto moveto_index_finish } - pCellKey = _sqlite3Malloc(tls, uint64(nCell+nOverrun)) + pCellKey = _sqlite3Malloc(tls, uint64(nCell)+uint64(nOverrun)) if pCellKey == uintptr(0) { rc = int32(SQLITE_NOMEM) goto moveto_index_finish @@ -126452,7 +119743,7 @@ bypass_moveto_root: rc = SQLITE_OK (*TBtCursor)(unsafe.Pointer(pCur)).Fix = uint16(idx) if (*TUnpackedRecord)(unsafe.Pointer(pIdxKey)).FerrCode != 0 { - rc = _sqlite3CorruptError(tls, int32(76914)) + rc = _sqlite3CorruptError(tls, int32(77699)) } goto moveto_index_finish } @@ -126485,7 +119776,7 @@ bypass_moveto_root: p9 = pCur + 1 *(*Tu8)(unsafe.Pointer(p9)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p9))) & ^(libc.Int32FromInt32(BTCF_ValidNKey) | libc.Int32FromInt32(BTCF_ValidOvfl))) if int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) >= libc.Int32FromInt32(BTCURSOR_MAX_DEPTH)-libc.Int32FromInt32(1) { - return _sqlite3CorruptError(tls, int32(76945)) + return _sqlite3CorruptError(tls, int32(77730)) } *(*Tu16)(unsafe.Pointer(pCur + 72 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*2)) = uint16(lwr) *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr((*TBtCursor)(unsafe.Pointer(pCur)).FiPage)*4)) = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage @@ -126494,7 +119785,7 @@ bypass_moveto_root: rc = _getAndInitPage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpBt, chldPg, pCur+116, int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurPagerFlags)) if rc == SQLITE_OK && (int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FnCell) < int32(1) || int32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pCur)).FpPage)).FintKey) != int32((*TBtCursor)(unsafe.Pointer(pCur)).FcurIntKey)) { _releasePage(tls, (*TBtCursor)(unsafe.Pointer(pCur)).FpPage) - rc = _sqlite3CorruptError(tls, int32(76956)) + rc = _sqlite3CorruptError(tls, int32(77741)) } if rc != 0 { v11 = pCur + 68 @@ -126623,7 +119914,7 @@ func _btreeNext(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77057)) + return _sqlite3CorruptError(tls, int32(77842)) } if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { @@ -126733,7 +120024,7 @@ func _btreePrevious(tls *libc.TLS, pCur uintptr) (r int32) { (*TMemPage)(unsafe.Pointer(pPage)).FisInit = uint8(0) } if !((*TMemPage)(unsafe.Pointer(pPage)).FisInit != 0) { - return _sqlite3CorruptError(tls, int32(77150)) + return _sqlite3CorruptError(tls, int32(77935)) } if !((*TMemPage)(unsafe.Pointer(pPage)).Fleaf != 0) { idx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) @@ -126821,7 +120112,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt ** stores the total number of pages on the freelist. */ n = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+36) if n >= mxPage { - return _sqlite3CorruptError(tls, int32(77240)) + return _sqlite3CorruptError(tls, int32(78025)) } if n > uint32(0) { searchList = uint8(0) /* If the free-list must be searched for 'nearby' */ @@ -126876,7 +120167,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt nSearch++ } if v2 || v1 > n { - rc = _sqlite3CorruptError(tls, int32(77296)) + rc = _sqlite3CorruptError(tls, int32(78081)) } else { rc = _btreeGetUnusedPage(tls, pBt, iTrunk, bp, 0) } @@ -126902,7 +120193,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { if k > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/libc.Uint32FromInt32(4)-libc.Uint32FromInt32(2) { /* Value of k is out of range. Database corruption */ - rc = _sqlite3CorruptError(tls, int32(77325)) + rc = _sqlite3CorruptError(tls, int32(78110)) goto end_allocate_page } else { if searchList != 0 && (nearby == iTrunk || iTrunk < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -126929,7 +120220,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } else { iNewTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+8) if iNewTrunk > mxPage { - rc = _sqlite3CorruptError(tls, int32(77359)) + rc = _sqlite3CorruptError(tls, int32(78144)) goto end_allocate_page } rc = _btreeGetUnusedPage(tls, pBt, iNewTrunk, bp+8, 0) @@ -127000,7 +120291,7 @@ func _allocateBtreePage(tls *libc.TLS, pBt uintptr, ppPage uintptr, pPgno uintpt } iPage = _sqlite3Get4byte(tls, aData+uintptr(uint32(8)+closest*uint32(4))) if iPage > mxPage || iPage < uint32(2) { - rc = _sqlite3CorruptError(tls, int32(77424)) + rc = _sqlite3CorruptError(tls, int32(78209)) goto end_allocate_page } if !(searchList != 0) || (iPage == nearby || iPage < nearby && int32(eMode) == int32(BTALLOC_LE)) { @@ -127138,7 +120429,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in iTrunk = uint32(0) /* Page number of free-list trunk page */ pPage1 = (*TBtShared)(unsafe.Pointer(pBt)).FpPage1 /* Initial number of pages on free-list */ if iPage < uint32(2) || iPage > (*TBtShared)(unsafe.Pointer(pBt)).FnPage { - return _sqlite3CorruptError(tls, int32(77551)) + return _sqlite3CorruptError(tls, int32(78336)) } if pMemPage != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = pMemPage @@ -127189,7 +120480,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in if nFree != uint32(0) { /* Initial number of leaf cells on trunk page */ iTrunk = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(pPage1)).FaData+32) if iTrunk > _btreePagecount(tls, pBt) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(77598)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(78383)) goto freepage_out } *(*int32)(unsafe.Pointer(bp + 8)) = _btreeGetPage(tls, pBt, iTrunk, bp, 0) @@ -127198,7 +120489,7 @@ func _freePage2(tls *libc.TLS, pBt uintptr, pMemPage uintptr, iPage TPgno) (r in } nLeaf = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData+4) if nLeaf > (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(2) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(77609)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(78394)) goto freepage_out } if nLeaf < (*TBtShared)(unsafe.Pointer(pBt)).FusableSize/uint32(4)-uint32(8) { @@ -127288,7 +120579,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp _, _, _, _, _, _, _, _ = nOvfl, ovflPageSize, ovflPgno, pBt, rc, v1, v2, v3 if pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { /* Cell extends past end of page */ - return _sqlite3CorruptError(tls, int32(77698)) + return _sqlite3CorruptError(tls, int32(78483)) } ovflPgno = _sqlite3Get4byte(tls, pCell+uintptr((*TCellInfo)(unsafe.Pointer(pInfo)).FnSize)-uintptr(4)) pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt @@ -127306,7 +120597,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp /* 0 is not a legal page number and page 1 cannot be an ** overflow page. Therefore if ovflPgno<2 or past the end of the ** file the database must be corrupt. */ - return _sqlite3CorruptError(tls, int32(77715)) + return _sqlite3CorruptError(tls, int32(78500)) } if nOvfl != 0 { rc = _getOverflowPage(tls, pBt, ovflPgno, bp+4, bp) @@ -127329,7 +120620,7 @@ func _clearCellOverflow(tls *libc.TLS, pPage uintptr, pCell uintptr, pInfo uintp ** caller is iterating through or using in some other way, this ** can be problematic. */ - rc = _sqlite3CorruptError(tls, int32(77735)) + rc = _sqlite3CorruptError(tls, int32(78520)) } else { rc = _freePage2(tls, pBt, *(*uintptr)(unsafe.Pointer(bp + 4)), ovflPgno) } @@ -127550,10 +120841,10 @@ func _dropCell(tls *libc.TLS, pPage uintptr, idx int32, sz int32, pRC uintptr) { pc = uint32(int32(*(*Tu8)(unsafe.Pointer(ptr)))< (*TBtShared)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FpBt)).FusableSize { - *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(77991)) + *(*int32)(unsafe.Pointer(pRC)) = _sqlite3CorruptError(tls, int32(78776)) return } - rc = _freeSpace(tls, pPage, uint16(pc), uint16(sz)) + rc = _freeSpace(tls, pPage, int32(pc), sz) if rc != 0 { *(*int32)(unsafe.Pointer(pRC)) = rc return @@ -127844,17 +121135,6 @@ type TCellArray = struct { type CellArray = TCellArray -type TCellArray1 = struct { - FnCell int32 - FpRef uintptr - FapCell uintptr - FszCell uintptr - FapEnd [6]uintptr - FixNx [6]int32 -} - -type CellArray1 = TCellArray1 - // C documentation // // /* @@ -127944,12 +121224,12 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg sz = *(*Tu16)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FszCell + uintptr(i)*2)) if uint32(pCell) >= uint32(aData+uintptr(j)) && uint32(pCell) < uint32(pEnd) { if uint32(pCell+uintptr(sz)) > uint32(pEnd) { - return _sqlite3CorruptError(tls, int32(78381)) + return _sqlite3CorruptError(tls, int32(79166)) } pCell = pTmp + uintptr(int32(pCell)-int32(aData)) } else { if uint32(pCell+uintptr(sz)) > uint32(pSrcEnd) && uint32(pCell) < uint32(pSrcEnd) { - return _sqlite3CorruptError(tls, int32(78386)) + return _sqlite3CorruptError(tls, int32(79171)) } } pData -= uintptr(sz) @@ -127957,7 +121237,7 @@ func _rebuildPage(tls *libc.TLS, pCArray uintptr, iFirst int32, nCell int32, pPg *(*Tu8)(unsafe.Pointer(pCellptr + 1)) = uint8(int32(pData) - int32(aData)) pCellptr += uintptr(2) if pData < pCellptr { - return _sqlite3CorruptError(tls, int32(78392)) + return _sqlite3CorruptError(tls, int32(79177)) } libc.Xmemmove(tls, pData, pCell, uint32(sz)) i++ @@ -128052,7 +121332,7 @@ func _pageInsertArray(tls *libc.TLS, pPg uintptr, pBegin uintptr, ppData uintptr ** database. But they might for a corrupt database. Hence use memmove() ** since memcpy() sends SIGABORT with overlapping buffers on OpenBSD */ if uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))+uintptr(sz)) > uint32(pEnd) && uint32(*(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4))) < uint32(pEnd) { - _sqlite3CorruptError(tls, int32(78478)) + _sqlite3CorruptError(tls, int32(79264)) return int32(1) } libc.Xmemmove(tls, pSlot, *(*uintptr)(unsafe.Pointer((*TCellArray)(unsafe.Pointer(pCArray)).FapCell + uintptr(i)*4)), uint32(sz)) @@ -128133,7 +121413,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, uint16(aOfst[j]), uint16(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _3 _3: ; @@ -128160,7 +121440,7 @@ func _pageFreeArray(tls *libc.TLS, pPg uintptr, iFirst int32, nCell int32, pCArr if !(j < nFree) { break } - _freeSpace(tls, pPg, uint16(aOfst[j]), uint16(aAfter[j]-aOfst[j])) + _freeSpace(tls, pPg, aOfst[j], aAfter[j]-aOfst[j]) goto _4 _4: ; @@ -128200,7 +121480,7 @@ func _editPage(tls *libc.TLS, pPg uintptr, iOld int32, iNew int32, nNew int32, p if iOld < iNew { nShift = _pageFreeArray(tls, pPg, iOld, iNew-iOld, pCArray) if nShift > nCell { - return _sqlite3CorruptError(tls, int32(78600)) + return _sqlite3CorruptError(tls, int32(79386)) } libc.Xmemmove(tls, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx, (*TMemPage)(unsafe.Pointer(pPg)).FaCellIdx+uintptr(nShift*int32(2)), uint32(nCell*int32(2))) nCell -= nShift @@ -128271,7 +121551,7 @@ editpage_fail: ; /* Unable to edit this page. Rebuild it from scratch instead. */ if nNew < int32(1) { - return _sqlite3CorruptError(tls, int32(78674)) + return _sqlite3CorruptError(tls, int32(79464)) } _populateCellCache(tls, pCArray, iNew, nNew) return _rebuildPage(tls, pCArray, iNew, nNew, pPg) @@ -128316,7 +121596,7 @@ func _balance_quick(tls *libc.TLS, pParent uintptr, pPage uintptr, pSpace uintpt _, _, _, _, _, _, _ = pBt, pOut, pStop, v1, v2, v3, v4 pBt = (*TMemPage)(unsafe.Pointer(pPage)).FpBt /* Page number of pNew */ if int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) == 0 { - return _sqlite3CorruptError(tls, int32(78714)) + return _sqlite3CorruptError(tls, int32(79504)) } /* dbfuzz001.test */ /* Allocate a new page. This page will become the right-sibling of ** pPage. Make the parent page writable, so that the new divider cell @@ -128512,10 +121792,11 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa var aPgno [5]TPgno var apDiv [2]uintptr var cntNew, cntOld [5]int32 - var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, szScratch, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 + var cntOldNext, d, i, iB, iNew, iNew1, iOff, iOld, iOld1, iOvflSpace, iPg, iSpace1, j, k, leafData, limit, nMaxCells, nNew, nNewCell, nOld, nxDiv, pageFlags, r, sz1, sz2, szD, szLeft, szR, szRight, usableSpace, v1, v10, v12, v15, v26, v30, v31, v32, v5, v7 int32 var fgA, fgB, leafCorrection, maskPage, sz Tu16 var key Tu32 var pgnoA, pgnoB, pgnoTemp TPgno + var szScratch Tu64 var v13, v14 bool var v18 uint32 var _ /* abDone at bp+60 */ [5]Tu8 @@ -128638,8 +121919,8 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa /* ** Allocate space for memory structures */ - szScratch = int32(uint32(nMaxCells)*uint32(4) + uint32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ - (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(szScratch)) + szScratch = uint64(uint32(nMaxCells)*uint32(4) + uint32(nMaxCells)*uint32(2) + (*TBtShared)(unsafe.Pointer(pBt)).FpageSize) /* aSpace1 */ + (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell = _sqlite3DbMallocRaw(tls, uintptr(0), szScratch) if (*(*TCellArray)(unsafe.Pointer(bp + 68))).FapCell == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) goto balance_cleanup @@ -128679,7 +121960,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa ** table-interior, index-leaf, or index-interior). */ if int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pOld)).FaData))) != int32(*(*Tu8)(unsafe.Pointer((*TMemPage)(unsafe.Pointer((*(*[3]uintptr)(unsafe.Pointer(bp + 4)))[0])).FaData))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79138)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79928)) goto balance_cleanup } /* Load b.apCell[] with pointers to all cells in pOld. If pOld @@ -128702,7 +121983,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa libc.Xmemset(tls, (*(*TCellArray)(unsafe.Pointer(bp + 68))).FszCell+uintptr((*(*TCellArray)(unsafe.Pointer(bp + 68))).FnCell)*2, 0, uint32(2)*uint32(limit+int32((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow))) if int32((*TMemPage)(unsafe.Pointer(pOld)).FnOverflow) > 0 { if limit < int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79162)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79952)) goto balance_cleanup } limit = int32(*(*Tu16)(unsafe.Pointer(pOld + 28))) @@ -128833,7 +122114,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa if i+int32(1) >= k { k = i + int32(2) if k > libc.Int32FromInt32(NB)+libc.Int32FromInt32(2) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79263)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80053)) goto balance_cleanup } (*(*[5]int32)(unsafe.Pointer(bp + 36)))[k-int32(1)] = 0 @@ -128876,7 +122157,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v10 = 0 } if cntNew[i] <= v10 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79296)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80086)) goto balance_cleanup } } @@ -128935,7 +122216,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa v15 = 0 } if cntNew[i-int32(1)] <= v15 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79340)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80130)) goto balance_cleanup } goto _11 @@ -128967,7 +122248,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132)))).FpDbPage) nNew++ if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 132)))).FpDbPage) != int32(1)+libc.BoolInt32(i == iParentIdx-nxDiv) && *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79373)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80163)) } if *(*int32)(unsafe.Pointer(bp)) != 0 { goto balance_cleanup @@ -129197,7 +122478,7 @@ func _balance_nonroot(tls *libc.TLS, pParent uintptr, iParentIdx int32, aOvflSpa } pSrcEnd = *(*uintptr)(unsafe.Pointer(bp + 68 + 16 + uintptr(k)*4)) if uint32(pCell1) < uint32(pSrcEnd) && uint32(pCell1+uintptr(sz2)) > uint32(pSrcEnd) { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(79574)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80364)) goto balance_cleanup } *(*int32)(unsafe.Pointer(bp)) = _insertCell(tls, pParent, nxDiv+i, pCell1, sz2, pTemp1, (*TMemPage)(unsafe.Pointer(pNew2)).Fpgno) @@ -129443,7 +122724,7 @@ func _anotherValidCursor(tls *libc.TLS, pCur uintptr) (r int32) { break } if pOther != pCur && int32((*TBtCursor)(unsafe.Pointer(pOther)).FeState) == CURSOR_VALID && (*TBtCursor)(unsafe.Pointer(pOther)).FpPage == (*TBtCursor)(unsafe.Pointer(pCur)).FpPage { - return _sqlite3CorruptError(tls, int32(79806)) + return _sqlite3CorruptError(tls, int32(80596)) } goto _1 _1: @@ -129516,7 +122797,7 @@ func _balance(tls *libc.TLS, pCur uintptr) (r int32) { /* The page being written is not a root page, and there is currently ** more than one reference to it. This only happens if the page is one ** of its own ancestor pages. Corruption. */ - rc = _sqlite3CorruptError(tls, int32(79866)) + rc = _sqlite3CorruptError(tls, int32(80656)) } else { pParent = *(*uintptr)(unsafe.Pointer(pCur + 120 + uintptr(iPage-int32(1))*4)) iIdx = int32(*(*Tu16)(unsafe.Pointer(pCur + 72 + uintptr(iPage-int32(1))*2))) @@ -129675,7 +122956,7 @@ func _btreeOverwriteOverflowCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int return rc } if _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1) || (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FisInit != 0 { - rc = _sqlite3CorruptError(tls, int32(80030)) + rc = _sqlite3CorruptError(tls, int32(80820)) } else { if uint32(iOffset)+ovflPageSize < uint32(nTotal) { ovflPgno = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaData) @@ -129706,7 +122987,7 @@ func _btreeOverwriteCell(tls *libc.TLS, pCur uintptr, pX uintptr) (r int32) { nTotal = (*TBtreePayload)(unsafe.Pointer(pX)).FnData + (*TBtreePayload)(unsafe.Pointer(pX)).FnZero /* Total bytes of to write */ pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage /* Page being written */ if (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload+uintptr((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd || (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FpPayload < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FcellOffset) { - return _sqlite3CorruptError(tls, int32(80058)) + return _sqlite3CorruptError(tls, int32(80848)) } if int32((*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnLocal) == nTotal { /* The entire cell is local */ @@ -129791,7 +123072,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** Which can only happen if the SQLITE_NoSchemaError flag was set when ** the schema was loaded. This cannot be asserted though, as a user might ** set the flag, load the schema, and then unset the flag. */ - return _sqlite3CorruptError(tls, int32(80139)) + return _sqlite3CorruptError(tls, int32(80929)) } } /* Ensure that the cursor is not in the CURSOR_FAULT state and that it @@ -129883,7 +123164,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 { if int32((*TBtCursor)(unsafe.Pointer(pCur)).FeState) > int32(CURSOR_INVALID) { /* ^^^^^--- due to the moveToRoot() call above */ - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(80262)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(81052)) } else { *(*int32)(unsafe.Pointer(bp)) = _btreeComputeFreeSpace(tls, pPage) } @@ -129919,7 +123200,7 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s (*TBtCursor)(unsafe.Pointer(pCur)).Finfo.FnSize = uint16(0) if *(*int32)(unsafe.Pointer(bp + 4)) == 0 { if idx >= int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80304)) + return _sqlite3CorruptError(tls, int32(81094)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3PagerWrite(tls, (*TMemPage)(unsafe.Pointer(pPage)).FpDbPage) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -129949,10 +123230,10 @@ func _sqlite3BtreeInsert(tls *libc.TLS, pCur uintptr, pX uintptr, flags int32, s ** necessary to add the PTRMAP_OVERFLOW1 pointer-map entry. */ /* clearCell never fails when nLocal==nPayload */ if oldCell < (*TMemPage)(unsafe.Pointer(pPage)).FaData+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FhdrOffset)+uintptr(10) { - return _sqlite3CorruptError(tls, int32(80331)) + return _sqlite3CorruptError(tls, int32(81121)) } if oldCell+uintptr(*(*int32)(unsafe.Pointer(bp + 8))) > (*TMemPage)(unsafe.Pointer(pPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80334)) + return _sqlite3CorruptError(tls, int32(81124)) } libc.Xmemcpy(tls, oldCell, newCell, uint32(*(*int32)(unsafe.Pointer(bp + 8)))) return SQLITE_OK @@ -130070,7 +123351,7 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T nIn = uint32((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnLocal) aIn = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload if aIn+uintptr(nIn) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80436)) + return _sqlite3CorruptError(tls, int32(81226)) } nRem = (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload if nIn == nRem && nIn < uint32((*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pDest)).FpPage)).FmaxLocal) { @@ -130085,14 +123366,14 @@ func _sqlite3BtreeTransferRow(tls *libc.TLS, pDest uintptr, pSrc uintptr, iKey T *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pPageOut = uintptr(0) /* Size of output buffer aOut[] */ nOut = uint32(_btreePayloadToLocal(tls, (*TBtCursor)(unsafe.Pointer(pDest)).FpPage, int64((*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload))) - (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nOut + uint32(int32(aOut)-int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace))) + (*TBtShared)(unsafe.Pointer(pBt)).FnPreformatSize = int32(nOut) + (int32(aOut) - int32((*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace)) if nOut < (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FnPayload { pPgnoOut = aOut + uintptr(nOut) *(*int32)(unsafe.Pointer(pBt + 88)) += int32(4) } if nRem > nIn { if aIn+uintptr(nIn)+uintptr(4) > (*TMemPage)(unsafe.Pointer((*TBtCursor)(unsafe.Pointer(pSrc)).FpPage)).FaDataEnd { - return _sqlite3CorruptError(tls, int32(80461)) + return _sqlite3CorruptError(tls, int32(81251)) } ovflIn = _sqlite3Get4byte(tls, (*TBtCursor)(unsafe.Pointer(pSrc)).Finfo.FpPayload+uintptr(nIn)) } @@ -130192,21 +123473,21 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { return *(*int32)(unsafe.Pointer(bp)) } } else { - return _sqlite3CorruptError(tls, int32(80557)) + return _sqlite3CorruptError(tls, int32(81347)) } } iCellDepth = int32((*TBtCursor)(unsafe.Pointer(pCur)).FiPage) iCellIdx = int32((*TBtCursor)(unsafe.Pointer(pCur)).Fix) pPage = (*TBtCursor)(unsafe.Pointer(pCur)).FpPage if int32((*TMemPage)(unsafe.Pointer(pPage)).FnCell) <= iCellIdx { - return _sqlite3CorruptError(tls, int32(80566)) + return _sqlite3CorruptError(tls, int32(81356)) } pCell = (*TMemPage)(unsafe.Pointer(pPage)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pPage)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx + uintptr(int32(2)*iCellIdx)))))) if (*TMemPage)(unsafe.Pointer(pPage)).FnFree < 0 && _btreeComputeFreeSpace(tls, pPage) != 0 { - return _sqlite3CorruptError(tls, int32(80570)) + return _sqlite3CorruptError(tls, int32(81360)) } if pCell < (*TMemPage)(unsafe.Pointer(pPage)).FaCellIdx+uintptr((*TMemPage)(unsafe.Pointer(pPage)).FnCell) { - return _sqlite3CorruptError(tls, int32(80573)) + return _sqlite3CorruptError(tls, int32(81363)) } /* If the BTREE_SAVEPOSITION bit is on, then the cursor position must ** be preserved following this delete operation. If the current delete @@ -130300,7 +123581,7 @@ func _sqlite3BtreeDelete(tls *libc.TLS, pCur uintptr, flags Tu8) (r int32) { } pCell = (*TMemPage)(unsafe.Pointer(pLeaf)).FaData + uintptr(int32((*TMemPage)(unsafe.Pointer(pLeaf)).FmaskPage)&int32(libc.X__builtin_bswap16(tls, *(*Tu16)(unsafe.Pointer((*TMemPage)(unsafe.Pointer(pLeaf)).FaCellIdx + uintptr(int32(2)*(int32((*TMemPage)(unsafe.Pointer(pLeaf)).FnCell)-int32(1)))))))) if pCell < (*TMemPage)(unsafe.Pointer(pLeaf)).FaData+4 { - return _sqlite3CorruptError(tls, int32(80664)) + return _sqlite3CorruptError(tls, int32(81454)) } nCell = int32((*(*func(*libc.TLS, uintptr, uintptr) Tu16)(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(pLeaf)).FxCellSize})))(tls, pLeaf, pCell)) pTmp = (*TBtShared)(unsafe.Pointer(pBt)).FpTmpSpace @@ -130410,7 +123691,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags */ _sqlite3BtreeGetMeta(tls, p, int32(BTREE_LARGEST_ROOT_PAGE), bp+4) if *(*TPgno)(unsafe.Pointer(bp + 4)) > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80780)) + return _sqlite3CorruptError(tls, int32(81570)) } *(*TPgno)(unsafe.Pointer(bp + 4))++ /* The new root-page may not be allocated on a pointer-map page, or the @@ -130451,7 +123732,7 @@ func _btreeCreateTable(tls *libc.TLS, p uintptr, piTable uintptr, createTabFlags } *(*int32)(unsafe.Pointer(bp + 8)) = _ptrmapGet(tls, pBt, *(*TPgno)(unsafe.Pointer(bp + 4)), bp+20, bp+24) if int32(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_ROOTPAGE) || int32(*(*Tu8)(unsafe.Pointer(bp + 20))) == int32(PTRMAP_FREEPAGE) { - *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(80828)) + *(*int32)(unsafe.Pointer(bp + 8)) = _sqlite3CorruptError(tls, int32(81618)) } if *(*int32)(unsafe.Pointer(bp + 8)) != SQLITE_OK { _releasePage(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -130532,14 +123813,14 @@ func _clearDatabasePage(tls *libc.TLS, pBt uintptr, pgno TPgno, freePageFlag int var _ /* rc at bp+4 */ int32 _, _, _, _ = hdr, i, pCell, v2 if pgno > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(80918)) + return _sqlite3CorruptError(tls, int32(81708)) } *(*int32)(unsafe.Pointer(bp + 4)) = _getAndInitPage(tls, pBt, pgno, bp, 0) if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { return *(*int32)(unsafe.Pointer(bp + 4)) } if int32((*TBtShared)(unsafe.Pointer(pBt)).FopenFlags)&int32(BTREE_SINGLE) == 0 && _sqlite3PagerPageRefcount(tls, (*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpDbPage) != int32(1)+libc.BoolInt32(pgno == uint32(1)) { - *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3CorruptError(tls, int32(80925)) + *(*int32)(unsafe.Pointer(bp + 4)) = _sqlite3CorruptError(tls, int32(81715)) goto cleardatabasepage_out } hdr = int32((*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FhdrOffset) @@ -130676,7 +123957,7 @@ func _btreeDropTable(tls *libc.TLS, p uintptr, iTable TPgno, piMoved uintptr) (r *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) pBt = (*TBtree)(unsafe.Pointer(p)).FpBt if iTable > _btreePagecount(tls, pBt) { - return _sqlite3CorruptError(tls, int32(81029)) + return _sqlite3CorruptError(tls, int32(81819)) } *(*int32)(unsafe.Pointer(bp)) = _sqlite3BtreeClearTable(tls, p, int32(iTable), uintptr(0)) if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -130941,7 +124222,7 @@ func _checkAppendMsg(tls *libc.TLS, pCheck uintptr, zFormat uintptr, va uintptr) (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr++ ap = va if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FerrMsg.FnChar != 0 { - Xsqlite3_str_append(tls, pCheck+48, __ccgo_ts+5577, int32(1)) + Xsqlite3_str_append(tls, pCheck+48, __ccgo_ts+5665, int32(1)) } if (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx != 0 { Xsqlite3_str_appendf(tls, pCheck+48, (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx, libc.VaList(bp+8, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv0, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1, (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv2)) @@ -130989,11 +124270,11 @@ func _checkRef(tls *libc.TLS, pCheck uintptr, iPage TPgno) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if iPage > (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnCkPage || iPage == uint32(0) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5579, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5667, libc.VaList(bp+8, iPage)) return int32(1) } if _getPageReferenced(tls, pCheck, iPage) != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5602, libc.VaList(bp+8, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5690, libc.VaList(bp+8, iPage)) return int32(1) } _setPageReferenced(tls, pCheck, iPage) @@ -131019,11 +124300,11 @@ func _checkPtrmap(tls *libc.TLS, pCheck uintptr, iChild TPgno, eType Tu8, iParen if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< (*TBtShared)(unsafe.Pointer((*TIntegrityCk)(unsafe.Pointer(pCheck)).FpBt)).FusableSize/uint32(4)-uint32(2) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5732, libc.VaList(bp+16, iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5820, libc.VaList(bp+16, iPage)) N-- } else { i = 0 @@ -131095,11 +124376,11 @@ func _checkList(tls *libc.TLS, pCheck uintptr, isFreeList int32, iPage TPgno, N } if N != 0 && nErrAtStart == (*TIntegrityCk)(unsafe.Pointer(pCheck)).FnErr { if isFreeList != 0 { - v2 = __ccgo_ts + 5771 + v2 = __ccgo_ts + 5859 } else { - v2 = __ccgo_ts + 5776 + v2 = __ccgo_ts + 5864 } - _checkAppendMsg(tls, pCheck, __ccgo_ts+5797, libc.VaList(bp+16, v2, expected-N, expected)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5885, libc.VaList(bp+16, v2, expected-N, expected)) } } @@ -131235,12 +124516,12 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr if _checkRef(tls, pCheck, iPage) != 0 { return 0 } - (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 5823 + (*TIntegrityCk)(unsafe.Pointer(pCheck)).FzPfx = __ccgo_ts + 5911 (*TIntegrityCk)(unsafe.Pointer(pCheck)).Fv1 = iPage v1 = _btreeGetPage(tls, pBt, iPage, bp+8, 0) rc = v1 if v1 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5841, libc.VaList(bp+48, rc)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+5929, libc.VaList(bp+48, rc)) if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)< usableSize-uint32(4) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+5995, libc.VaList(bp+48, pc, contentOffset, usableSize-uint32(4))) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6083, libc.VaList(bp+48, pc, contentOffset, usableSize-uint32(4))) doCoverageCheck = 0 goto _4 } pCell = data + uintptr(pc) (*(*func(*libc.TLS, uintptr, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TMemPage)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 8)))).FxParseCell})))(tls, *(*uintptr)(unsafe.Pointer(bp + 8)), pCell, bp+16) if pc+uint32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnSize) > usableSize { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6025, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6113, 0) doCoverageCheck = 0 goto _4 } @@ -131325,7 +124606,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr v5 = libc.BoolInt32((*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey >= *(*Ti64)(unsafe.Pointer(bp))) } if v5 != 0 { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6049, libc.VaList(bp+48, (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6137, libc.VaList(bp+48, (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey)) } *(*Ti64)(unsafe.Pointer(bp)) = (*(*TCellInfo)(unsafe.Pointer(bp + 16))).FnKey keyCanBeEqual = 0 /* Only the first key on the page may ==maxKey */ @@ -131348,7 +124629,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr d2 = _checkTreePage(tls, pCheck, uint32(pgno), bp, *(*Ti64)(unsafe.Pointer(bp))) keyCanBeEqual = 0 if d2 != depth { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6073, 0) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6161, 0) depth = d2 } } else { @@ -131425,7 +124706,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr prev = contentOffset - uint32(1) /* Implied first min-heap entry */ for _btreeHeapPull(tls, heap, bp+12) != 0 { if prev&uint32(0xffff) >= *(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(16) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6098, libc.VaList(bp+48, *(*Tu32)(unsafe.Pointer(bp + 12))>>int32(16), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6186, libc.VaList(bp+48, *(*Tu32)(unsafe.Pointer(bp + 12))>>int32(16), iPage)) break } else { nFrag = int32(uint32(nFrag) + (*(*Tu32)(unsafe.Pointer(bp + 12))>>libc.Int32FromInt32(16) - prev&libc.Uint32FromInt32(0xffff) - libc.Uint32FromInt32(1))) @@ -131439,7 +124720,7 @@ func _checkTreePage(tls *libc.TLS, pCheck uintptr, iPage TPgno, piMinKey uintptr ** number of fragmented free bytes within the cell content area. */ if *(*Tu32)(unsafe.Pointer(heap)) == uint32(0) && nFrag != int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))) { - _checkAppendMsg(tls, pCheck, __ccgo_ts+6135, libc.VaList(bp+48, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) + _checkAppendMsg(tls, pCheck, __ccgo_ts+6223, libc.VaList(bp+48, nFrag, int32(*(*Tu8)(unsafe.Pointer(data + uintptr(hdr+int32(7))))), iPage)) } } goto end_of_check @@ -131530,7 +124811,7 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin /* Check the integrity of the freelist */ if bCkFreelist != 0 { - (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 6187 + (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = __ccgo_ts + 6275 _checkList(tls, bp, int32(1), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+32), _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+36)) (*(*TIntegrityCk)(unsafe.Pointer(bp))).FzPfx = uintptr(0) } @@ -131554,11 +124835,11 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin } mxInHdr = _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+52) if mx != mxInHdr { - _checkAppendMsg(tls, bp, __ccgo_ts+6198, libc.VaList(bp+208, mx, mxInHdr)) + _checkAppendMsg(tls, bp, __ccgo_ts+6286, libc.VaList(bp+208, mx, mxInHdr)) } } else { if _sqlite3Get4byte(tls, (*TMemPage)(unsafe.Pointer((*TBtShared)(unsafe.Pointer(pBt)).FpPage1)).FaData+64) != uint32(0) { - _checkAppendMsg(tls, bp, __ccgo_ts+6243, 0) + _checkAppendMsg(tls, bp, __ccgo_ts+6331, 0) } } } @@ -131595,10 +124876,10 @@ func _sqlite3BtreeIntegrityCheck(tls *libc.TLS, db uintptr, p uintptr, aRoot uin ** references to pointer-map pages. */ if _getPageReferenced(tls, bp, i) == 0 && (_ptrmapPageno(tls, pBt, i) != i || !((*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0)) { - _checkAppendMsg(tls, bp, __ccgo_ts+6298, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+6386, libc.VaList(bp+208, i)) } if _getPageReferenced(tls, bp, i) != 0 && (_ptrmapPageno(tls, pBt, i) == i && (*TBtShared)(unsafe.Pointer(pBt)).FautoVacuum != 0) { - _checkAppendMsg(tls, bp, __ccgo_ts+6318, libc.VaList(bp+208, i)) + _checkAppendMsg(tls, bp, __ccgo_ts+6406, libc.VaList(bp+208, i)) } goto _3 _3: @@ -131728,14 +125009,14 @@ func _sqlite3BtreeIsInBackup(tls *libc.TLS, p uintptr) (r int32) { // ** blob of allocated memory. The xFree function should not call sqlite3_free() // ** on the memory, the btree layer does that. // */ -func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, xFree uintptr) (r uintptr) { +func _sqlite3BtreeSchema(tls *libc.TLS, p uintptr, nBytes int32, __ccgo_fp_xFree uintptr) (r uintptr) { var pBt uintptr _ = pBt pBt = (*TBtree)(unsafe.Pointer(p)).FpBt _sqlite3BtreeEnter(tls, p) if !((*TBtShared)(unsafe.Pointer(pBt)).FpSchema != 0) && nBytes != 0 { (*TBtShared)(unsafe.Pointer(pBt)).FpSchema = _sqlite3DbMallocZero(tls, uintptr(0), uint64(nBytes)) - (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = xFree + (*TBtShared)(unsafe.Pointer(pBt)).FxFreeSchema = __ccgo_fp_xFree } _sqlite3BtreeLeave(tls, p) return (*TBtShared)(unsafe.Pointer(pBt)).FpSchema @@ -131946,45 +125227,6 @@ func _sqlite3BtreeConnectionCount(tls *libc.TLS, p uintptr) (r int32) { return (*TBtShared)(unsafe.Pointer((*TBtree)(unsafe.Pointer(p)).FpBt)).FnRef } -/************** End of btree.c ***********************************************/ -/************** Begin file backup.c ******************************************/ -/* -** 2009 January 28 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. - */ -/* #include "sqliteInt.h" */ -/* #include "btreeInt.h" */ - -/* -** Structure allocated for each backup operation. - */ -type Tsqlite3_backup1 = struct { - FpDestDb uintptr - FpDest uintptr - FiDestSchema Tu32 - FbDestLocked int32 - FiNext TPgno - FpSrcDb uintptr - FpSrc uintptr - Frc int32 - FnRemaining TPgno - FnPagecount TPgno - FisAttached int32 - FpNext uintptr -} - -type sqlite3_backup1 = Tsqlite3_backup1 - /* ** THREAD SAFETY NOTES: ** @@ -132037,7 +125279,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui rc = 0 _sqlite3ParseObjectInit(tls, bp, pDb) if _sqlite3OpenTempDatabase(tls, bp) != 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+4710, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).Frc, __ccgo_ts+4829, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) rc = int32(SQLITE_ERROR) } _sqlite3DbFree(tls, pErrorDb, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) @@ -132047,7 +125289,7 @@ func _findBtree(tls *libc.TLS, pErrorDb uintptr, pDb uintptr, zDb uintptr) (r ui } } if i < 0 { - _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+6350, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, pErrorDb, int32(SQLITE_ERROR), __ccgo_ts+6438, libc.VaList(bp+296, zDb)) return uintptr(0) } return (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(pDb)).FaDb + uintptr(i)*16))).FpBt @@ -132076,7 +125318,7 @@ func _setDestPgsz(tls *libc.TLS, p uintptr) (r int32) { // */ func _checkReadTransaction(tls *libc.TLS, db uintptr, p uintptr) (r int32) { if _sqlite3BtreeTxnState(tls, p) != SQLITE_TXN_NONE { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+6370, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+6458, 0) return int32(SQLITE_ERROR) } return SQLITE_OK @@ -132106,7 +125348,7 @@ func Xsqlite3_backup_init(tls *libc.TLS, pDestDb uintptr, zDestDb uintptr, pSrcD Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pSrcDb)).Fmutex) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(pDestDb)).Fmutex) if pSrcDb == pDestDb { - _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+6401, 0) + _sqlite3ErrorWithMsg(tls, pDestDb, int32(SQLITE_ERROR), __ccgo_ts+6489, 0) p = uintptr(0) } else { /* Allocate space for a new sqlite3_backup object... @@ -132784,7 +126026,7 @@ func _vdbeMemRenderNum(tls *libc.TLS, sz int32, zBuf uintptr, p uintptr) { } else { v1 = *(*float64)(unsafe.Pointer(p)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6441, libc.VaList(bp+40, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6529, libc.VaList(bp+40, v1)) *(*int8)(unsafe.Pointer(zBuf + uintptr((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar))) = 0 /* Fast version of sqlite3StrAccumFinish(&acc) */ (*TMem)(unsafe.Pointer(p)).Fn = int32((*(*TStrAccum)(unsafe.Pointer(bp))).FnChar) } @@ -132922,9 +126164,6 @@ func _sqlite3VdbeMemZeroTerminateIfAble(tls *libc.TLS, pMem uintptr) { if int32((*TMem)(unsafe.Pointer(pMem)).Fenc) != int32(SQLITE_UTF8) { return } - if (*TMem)(unsafe.Pointer(pMem)).Fz == uintptr(0) { - return - } if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Dyn) != 0 { if (*TMem)(unsafe.Pointer(pMem)).FxDel == __ccgo_fp(Xsqlite3_free) && Xsqlite3_msize(tls, (*TMem)(unsafe.Pointer(pMem)).Fz) >= uint64((*TMem)(unsafe.Pointer(pMem)).Fn+libc.Int32FromInt32(1)) { *(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((*TMem)(unsafe.Pointer(pMem)).Fn))) = 0 @@ -133100,7 +126339,7 @@ func _sqlite3VdbeMemFinalize(tls *libc.TLS, pMem uintptr, pFunc uintptr) (r int3 defer tls.Free(80) var _ /* ctx at bp+0 */ Tsqlite3_context var _ /* t at bp+32 */ TMem - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) libc.Xmemset(tls, bp+32, 0, uint32(40)) (*(*TMem)(unsafe.Pointer(bp + 32))).Fflags = uint16(MEM_Null) (*(*TMem)(unsafe.Pointer(bp + 32))).Fdb = (*TMem)(unsafe.Pointer(pMem)).Fdb @@ -133130,7 +126369,7 @@ func _sqlite3VdbeMemAggValue(tls *libc.TLS, pAccum uintptr, pOut uintptr, pFunc bp := tls.Alloc(32) defer tls.Free(32) var _ /* ctx at bp+0 */ Tsqlite3_context - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) _sqlite3VdbeMemSetNull(tls, pOut) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pOut (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpMem = pAccum @@ -133589,21 +126828,21 @@ func _sqlite3NoopDestructor(tls *libc.TLS, p uintptr) { // ** Set the value stored in *pMem should already be a NULL. // ** Also store a pointer to go with it. // */ -func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +func _sqlite3VdbeMemSetPointer(tls *libc.TLS, pMem uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var v1, v2 uintptr _, _ = v1, v2 _vdbeMemClear(tls, pMem) if zPType != 0 { v1 = zPType } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } *(*uintptr)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pMem)).Fu)) = v1 (*TMem)(unsafe.Pointer(pMem)).Fz = pPtr (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Dyn) | libc.Int32FromInt32(MEM_Subtype) | libc.Int32FromInt32(MEM_Term)) (*TMem)(unsafe.Pointer(pMem)).FeSubtype = uint8('p') - if xDestructor != 0 { - v2 = xDestructor + if __ccgo_fp_xDestructor != 0 { + v2 = __ccgo_fp_xDestructor } else { v2 = __ccgo_fp(_sqlite3NoopDestructor) } @@ -133762,7 +127001,7 @@ func _sqlite3VdbeMemMove(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** excluding the first zero character. The n parameter must be // ** non-negative for blobs. // */ -func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, xDel uintptr) (r int32) { +func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc Tu8, __ccgo_fp_xDel uintptr) (r int32) { var flags Tu16 var iLimit, v2, v4 int32 var nAlloc, nByte Ti64 @@ -133804,11 +127043,11 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } } if nByte > int64(iLimit) { - if xDel != 0 && xDel != uintptr(-libc.Int32FromInt32(1)) { - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel != 0 && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { _sqlite3DbFree(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, z) } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, z) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, z) } } _sqlite3VdbeMemSetNull(tls, pMem) @@ -133818,7 +127057,7 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { nAlloc = nByte if int32(flags)&int32(MEM_Term) != 0 { if int32(enc) == int32(SQLITE_UTF8) { @@ -133840,12 +127079,12 @@ func _sqlite3VdbeMemSetStr(tls *libc.TLS, pMem uintptr, z uintptr, n Ti64, enc T } else { _sqlite3VdbeMemRelease(tls, pMem) (*TMem)(unsafe.Pointer(pMem)).Fz = z - if xDel == __ccgo_fp(_sqlite3OomClear) { + if __ccgo_fp_xDel == __ccgo_fp(_sqlite3OomClear) { (*TMem)(unsafe.Pointer(pMem)).FzMalloc = (*TMem)(unsafe.Pointer(pMem)).Fz (*TMem)(unsafe.Pointer(pMem)).FszMalloc = _sqlite3DbMallocSize(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } else { - (*TMem)(unsafe.Pointer(pMem)).FxDel = xDel - if xDel == libc.UintptrFromInt32(0) { + (*TMem)(unsafe.Pointer(pMem)).FxDel = __ccgo_fp_xDel + if __ccgo_fp_xDel == libc.UintptrFromInt32(0) { v4 = int32(MEM_Static) } else { v4 = int32(MEM_Dyn) @@ -133884,7 +127123,7 @@ func _sqlite3VdbeMemFromBtree(tls *libc.TLS, pCur uintptr, offset Tu32, amt Tu32 _, _ = rc, v1 (*TMem)(unsafe.Pointer(pMem)).Fflags = uint16(MEM_Null) if _sqlite3BtreeMaxRecordSize(tls, pCur) < int64(offset+amt) { - return _sqlite3CorruptError(tls, int32(84326)) + return _sqlite3CorruptError(tls, int32(85117)) } v1 = _sqlite3VdbeMemClearAndResize(tls, pMem, int32(amt+uint32(1))) rc = v1 @@ -133996,8 +127235,8 @@ func _sqlite3ValueText(tls *libc.TLS, pVal uintptr, enc Tu8) (r uintptr) { // ** TODO: Maybe someday promote this interface into a published API so // ** that third-party extensions can get access to it? // */ -func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, xFree uintptr) (r int32) { - if pVal != uintptr(0) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == xFree { +func _sqlite3ValueIsOfClass(tls *libc.TLS, pVal uintptr, __ccgo_fp_xFree uintptr) (r int32) { + if pVal != uintptr(0) && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&(libc.Int32FromInt32(MEM_Str)|libc.Int32FromInt32(MEM_Blob)) != 0 && int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) != 0 && (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel == __ccgo_fp_xFree { return int32(1) } else { return 0 @@ -134048,7 +127287,8 @@ type ValueNewStat4Ctx = TValueNewStat4Ctx // ** an sqlite3_value within the UnpackedRecord.a[] array. // */ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - var i, nByte, nCol int32 + var i, nCol int32 + var nByte Ti64 var pIdx, pRec uintptr _, _, _, _, _ = i, nByte, nCol, pIdx, pRec if p != 0 { @@ -134056,7 +127296,7 @@ func _valueNew(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if pRec == uintptr(0) { pIdx = (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpIdx /* Counter variable */ nCol = int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) /* Number of index columns including rowid */ - nByte = int32(uint32(40)*uint32(nCol) + (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) + nByte = int64(uint32(40)*uint32(nCol) + (libc.Uint32FromInt64(32)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) pRec = _sqlite3DbMallocZero(tls, db, uint64(nByte)) if pRec != 0 { (*TUnpackedRecord)(unsafe.Pointer(pRec)).FpKeyInfo = _sqlite3KeyInfoOfIndex(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(p)).FpParse, pIdx) @@ -134121,7 +127361,7 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, var _ /* ctx at bp+0 */ Tsqlite3_context _, _, _, _, _, _, _ = apVal, i, nVal, pFunc, pList, pVal, rc /* Context object for function invocation */ apVal = uintptr(0) /* Function arguments */ - nVal = 0 /* Size of apVal[] array */ + nVal = 0 /* Number of function arguments */ pFunc = uintptr(0) /* Function definition */ pVal = uintptr(0) /* New value */ rc = SQLITE_OK /* Return code */ @@ -134160,14 +127400,14 @@ func _valueFromFunction(tls *libc.TLS, db uintptr, p uintptr, enc Tu8, aff Tu8, rc = int32(SQLITE_NOMEM) goto value_from_function_out } - libc.Xmemset(tls, bp, 0, uint32(32)) + libc.Xmemset(tls, bp, 0, uint32(28)) (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpOut = pVal (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FpFunc = pFunc (*(*Tsqlite3_context)(unsafe.Pointer(bp))).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*(*func(*libc.TLS, uintptr, int32, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*TFuncDef)(unsafe.Pointer(pFunc)).FxSFunc})))(tls, bp, nVal, apVal) if (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError != 0 { rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp))).FisError - _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+4710, libc.VaList(bp+40, Xsqlite3_value_text(tls, pVal))) + _sqlite3ErrorMsg(tls, (*TValueNewStat4Ctx)(unsafe.Pointer(pCtx)).FpParse, __ccgo_ts+4829, libc.VaList(bp+40, Xsqlite3_value_text(tls, pVal))) } else { _sqlite3ValueApplyAffinity(tls, pVal, aff, uint8(SQLITE_UTF8)) rc = _sqlite3VdbeChangeEncoding(tls, pVal, int32(enc)) @@ -134225,7 +127465,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity zVal = uintptr(0) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) negInt = int32(1) - zNeg = __ccgo_ts + 1673 + zNeg = __ccgo_ts + 1674 rc = SQLITE_OK for { v1 = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) @@ -134267,7 +127507,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity pExpr = pLeft op = int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) negInt = -int32(1) - zNeg = __ccgo_ts + 6448 + zNeg = __ccgo_ts + 6536 } } } @@ -134282,7 +127522,7 @@ func _valueFromExpr(tls *libc.TLS, db uintptr, pExpr uintptr, enc Tu8, affinity if op == int32(TK_INTEGER) && 0 == _sqlite3DecOrHexToI64(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), bp+8) { _sqlite3VdbeMemSetInt64(tls, *(*uintptr)(unsafe.Pointer(bp)), *(*Ti64)(unsafe.Pointer(bp + 8))*int64(negInt)) } else { - zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+6450, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + zVal = _sqlite3MPrintf(tls, db, __ccgo_ts+6538, libc.VaList(bp+24, zNeg, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) if zVal == uintptr(0) { goto no_mem } @@ -134586,7 +127826,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr = uint32(uint8(v1)) if *(*Tu32)(unsafe.Pointer(bp + 4)) > uint32(nRec) || iHdr >= *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85012)) + return _sqlite3CorruptError(tls, int32(85803)) } iField = int64(*(*Tu32)(unsafe.Pointer(bp + 4))) i = 0 @@ -134602,7 +127842,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC } iHdr += uint32(uint8(v3)) if iHdr > *(*Tu32)(unsafe.Pointer(bp + 4)) { - return _sqlite3CorruptError(tls, int32(85018)) + return _sqlite3CorruptError(tls, int32(85809)) } szField = _sqlite3VdbeSerialTypeLen(tls, *(*Tu32)(unsafe.Pointer(bp))) iField += int64(szField) @@ -134612,7 +127852,7 @@ func _sqlite3Stat4Column(tls *libc.TLS, db uintptr, pRec uintptr, nRec int32, iC i++ } if iField > int64(nRec) { - return _sqlite3CorruptError(tls, int32(85024)) + return _sqlite3CorruptError(tls, int32(85815)) } if pMem == uintptr(0) { v4 = _sqlite3ValueNew(tls, db) @@ -134663,9 +127903,9 @@ func _sqlite3Stat4ProbeFree(tls *libc.TLS, pRec uintptr) { // /* // ** Change the string value of an sqlite3_value object // */ -func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, xDel uintptr) { +func _sqlite3ValueSetStr(tls *libc.TLS, v uintptr, n int32, z uintptr, enc Tu8, __ccgo_fp_xDel uintptr) { if v != 0 { - _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, xDel) + _sqlite3VdbeMemSetStr(tls, v, z, int64(n), enc, __ccgo_fp_xDel) } } @@ -134739,7 +127979,7 @@ func _sqlite3VdbeCreate(tls *libc.TLS, pParse uintptr) (r uintptr) { libc.Xmemset(tls, p+104, 0, libc.Uint32FromInt64(232)-uint32(libc.UintptrFromInt32(0)+104)) (*TVdbe)(unsafe.Pointer(p)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe != 0 { - (*TVdbe1)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 8 + (*TVdbe)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpVdbe)).FppVPrev = p + 8 } (*TVdbe)(unsafe.Pointer(p)).FpVNext = (*Tsqlite3)(unsafe.Pointer(db)).FpVdbe (*TVdbe)(unsafe.Pointer(p)).FppVPrev = db + 4 @@ -135073,12 +128313,11 @@ func _sqlite3VdbeAddOp4(tls *libc.TLS, p uintptr, op int32, p1 int32, p2 int32, // ** while computing a generated column value. 0 is the usual case. // */ func _sqlite3VdbeAddFunctionCall(tls *libc.TLS, pParse uintptr, p1 int32, p2 int32, p3 int32, nArg int32, pFunc uintptr, eCallCtx int32) (r int32) { - var addr, nByte, v1 int32 + var addr, v1 int32 var pCtx, v uintptr - _, _, _, _, _ = addr, nByte, pCtx, v, v1 + _, _, _, _ = addr, pCtx, v, v1 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - nByte = int32(uint32(32) + uint32(nArg-libc.Int32FromInt32(1))*uint32(4)) - pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(nByte)) + pCtx = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+28)+uint32(nArg)*libc.Uint32FromInt64(4))) if pCtx == uintptr(0) { _freeEphemeralFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pFunc) return 0 @@ -135252,7 +128491,7 @@ func _sqlite3VdbeMakeLabel(tls *libc.TLS, pParse uintptr) (r int32) { var v1 int32 var v2 uintptr _, _ = v1, v2 - v2 = pParse + 60 + v2 = pParse + 64 *(*int32)(unsafe.Pointer(v2))-- v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -135337,8 +128576,8 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** (1) For each jump instruction with a negative P2 value (a label) // ** resolve the P2 value to an actual address. // ** -// ** (2) Compute the maximum number of arguments used by any SQL function -// ** and store that value in *pMaxFuncArgs. +// ** (2) Compute the maximum number of arguments used by the xUpdate/xFilter +// ** methods of any virtual table and store that value in *pMaxVtabArgs. // ** // ** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately // ** indicate what the prepared statement actually does. @@ -135351,11 +128590,11 @@ func _sqlite3VdbeReusable(tls *libc.TLS, p uintptr) { // ** script numbers the opcodes correctly. Changes to this routine must be // ** coordinated with changes to mkopcodeh.tcl. // */ -func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { +func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxVtabArgs uintptr) { var aLabel, pOp, pParse uintptr - var n, nMaxArgs int32 - _, _, _, _, _ = aLabel, n, nMaxArgs, pOp, pParse - nMaxArgs = *(*int32)(unsafe.Pointer(pMaxFuncArgs)) + var n, nMaxVtabArgs int32 + _, _, _, _, _ = aLabel, n, nMaxVtabArgs, pOp, pParse + nMaxVtabArgs = *(*int32)(unsafe.Pointer(pMaxVtabArgs)) pParse = (*TVdbe)(unsafe.Pointer(p)).FpParse aLabel = (*TParse)(unsafe.Pointer(pParse)).FaLabel /* tag-20230419-1 */ @@ -135392,13 +128631,16 @@ func _resolveP2Values(tls *libc.TLS, p uintptr, pMaxFuncArgs uintptr) { case int32(OP_Init): goto resolve_p2_values_loop_exit case int32(OP_VUpdate): - if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxArgs { - nMaxArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 + if (*TOp)(unsafe.Pointer(pOp)).Fp2 > nMaxVtabArgs { + nMaxVtabArgs = (*TOp)(unsafe.Pointer(pOp)).Fp2 } case int32(OP_VFilter): + /* The instruction immediately prior to VFilter will be an + ** OP_Integer that sets the "argc" value for the VFilter. See + ** the code where OP_VFilter is generated at tag-20250207a. */ n = (*(*TOp)(unsafe.Pointer(pOp + uintptr(-libc.Int32FromInt32(1))*20))).Fp1 - if n > nMaxArgs { - nMaxArgs = n + if n > nMaxVtabArgs { + nMaxVtabArgs = n } /* Fall through into the default case */ fallthrough @@ -135429,7 +128671,7 @@ resolve_p2_values_loop_exit: (*TParse)(unsafe.Pointer(pParse)).FaLabel = uintptr(0) } (*TParse)(unsafe.Pointer(pParse)).FnLabel = 0 - *(*int32)(unsafe.Pointer(pMaxFuncArgs)) = nMaxArgs + *(*int32)(unsafe.Pointer(pMaxVtabArgs)) = nMaxVtabArgs } // C documentation @@ -135931,7 +129173,7 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { switch int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) { case -int32(8): pKeyInfo = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6455, libc.VaList(bp+32, int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6543, libc.VaList(bp+32, int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField))) j = 0 for { if !(j < int32((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FnKeyField)) { @@ -135941,66 +129183,66 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { if pColl != 0 { v2 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } zColl = v2 - if libc.Xstrcmp(tls, zColl, __ccgo_ts+6460) == 0 { - zColl = __ccgo_ts + 6467 + if libc.Xstrcmp(tls, zColl, __ccgo_ts+6548) == 0 { + zColl = __ccgo_ts + 6555 } if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_DESC) != 0 { - v3 = __ccgo_ts + 6448 + v3 = __ccgo_ts + 6536 } else { - v3 = __ccgo_ts + 1673 + v3 = __ccgo_ts + 1674 } if int32(*(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags + uintptr(j))))&int32(KEYINFO_ORDER_BIGNULL) != 0 { - v4 = __ccgo_ts + 6469 + v4 = __ccgo_ts + 6557 } else { - v4 = __ccgo_ts + 1673 + v4 = __ccgo_ts + 1674 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6472, libc.VaList(bp+32, v3, v4, zColl)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6560, libc.VaList(bp+32, v3, v4, zColl)) goto _1 _1: ; j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6568, int32(1)) case -int32(2): pColl1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6496, libc.VaList(bp+32, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6584, libc.VaList(bp+32, (*TCollSeq)(unsafe.Pointer(pColl1)).FzName, _encnames[(*TCollSeq)(unsafe.Pointer(pColl1)).Fenc])) case -int32(7): pDef = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6505, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6593, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef)).FnArg))) case -int32(15): pDef1 = (*Tsqlite3_context)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpFunc - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6505, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6593, libc.VaList(bp+32, (*TFuncDef)(unsafe.Pointer(pDef1)).FzName, int32((*TFuncDef)(unsafe.Pointer(pDef1)).FnArg))) case -int32(13): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1434, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1435, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(3): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6512, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pOp + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6600, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(pOp + 16)))) case -int32(12): - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1401, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1402, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))))) case -int32(10): pMem = *(*uintptr)(unsafe.Pointer(pOp + 16)) if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Str) != 0 { zP4 = (*TMem)(unsafe.Pointer(pMem)).Fz } else { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1434, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1435, libc.VaList(bp+32, *(*Ti64)(unsafe.Pointer(pMem)))) } else { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1401, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(pMem)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+1402, libc.VaList(bp+32, *(*float64)(unsafe.Pointer(pMem)))) } else { if int32((*TMem)(unsafe.Pointer(pMem)).Fflags)&int32(MEM_Null) != 0 { - zP4 = __ccgo_ts + 1674 + zP4 = __ccgo_ts + 1675 } else { - zP4 = __ccgo_ts + 6515 + zP4 = __ccgo_ts + 6603 } } } } case -int32(11): pVtab = (*TVTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FpVtab - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6522, libc.VaList(bp+32, pVtab)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6610, libc.VaList(bp+32, pVtab)) case -int32(14): ai = *(*uintptr)(unsafe.Pointer(pOp + 16)) n = *(*Tu32)(unsafe.Pointer(ai)) /* The first element of an INTARRAY is always the @@ -136015,20 +129257,20 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } else { v6 = int32(',') } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6530, libc.VaList(bp+32, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6618, libc.VaList(bp+32, v6, *(*Tu32)(unsafe.Pointer(ai + uintptr(i)*4)))) goto _5 _5: ; i++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6535, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6623, int32(1)) case -int32(4): - zP4 = __ccgo_ts + 6537 + zP4 = __ccgo_ts + 6625 case -int32(5): zP4 = (*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pOp + 16)))).FzName case -int32(17): pSig = *(*uintptr)(unsafe.Pointer(pOp + 16)) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6545, libc.VaList(bp+32, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+6633, libc.VaList(bp+32, (*TSubrtnSig)(unsafe.Pointer(pSig)).FselId, (*TSubrtnSig)(unsafe.Pointer(pSig)).FzAff)) default: zP4 = *(*uintptr)(unsafe.Pointer(pOp + 16)) } @@ -136042,10 +129284,10 @@ func _sqlite3VdbeDisplayP4(tls *libc.TLS, db uintptr, pOp uintptr) (r uintptr) { } var _encnames = [4]uintptr{ - 0: __ccgo_ts + 6482, - 1: __ccgo_ts + 6484, - 2: __ccgo_ts + 6486, - 3: __ccgo_ts + 6491, + 0: __ccgo_ts + 6570, + 1: __ccgo_ts + 6572, + 2: __ccgo_ts + 6574, + 3: __ccgo_ts + 6579, } // C documentation @@ -136863,7 +130105,7 @@ func _sqlite3VdbeSetNumCols(tls *libc.TLS, p uintptr, nResColumn int32) { // ** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed // ** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. // */ -func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, xDel uintptr) (r int32) { +func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zName uintptr, __ccgo_fp_xDel uintptr) (r int32) { var pColName uintptr var rc int32 _, _ = pColName, rc @@ -136871,7 +130113,7 @@ func _sqlite3VdbeSetColName(tls *libc.TLS, p uintptr, idx int32, var1 int32, zNa return int32(SQLITE_NOMEM) } pColName = (*TVdbe)(unsafe.Pointer(p)).FaColName + uintptr(idx+var1*int32((*TVdbe)(unsafe.Pointer(p)).FnResAlloc))*40 - rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), xDel) + rc = _sqlite3VdbeMemSetStr(tls, pColName, zName, int64(-int32(1)), uint8(SQLITE_UTF8), __ccgo_fp_xDel) return rc } @@ -136998,7 +130240,7 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { retryCount = 0 /* Select a super-journal file name */ nMainFile = _sqlite3Strlen30(tls, zMainFile) - zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+6561, libc.VaList(bp+24, 0, zMainFile, 0)) + zSuper = _sqlite3MPrintf(tls, db, __ccgo_ts+6649, libc.VaList(bp+24, 0, zMainFile, 0)) if zSuper == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -137006,18 +130248,18 @@ func _vdbeCommit(tls *libc.TLS, db uintptr, p uintptr) (r int32) { for cond := true; cond; cond = rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 4)) != 0 { if retryCount != 0 { if retryCount > int32(100) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6573, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6661, libc.VaList(bp+24, zSuper)) _sqlite3OsDelete(tls, pVfs, zSuper, 0) break } else { if retryCount == int32(1) { - Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6587, libc.VaList(bp+24, zSuper)) + Xsqlite3_log(tls, int32(SQLITE_FULL), __ccgo_ts+6675, libc.VaList(bp+24, zSuper)) } } } retryCount++ Xsqlite3_randomness(tls, int32(4), bp+8) - Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+6602, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0xff))) + Xsqlite3_snprintf(tls, int32(13), zSuper+uintptr(nMainFile), __ccgo_ts+6690, libc.VaList(bp+24, *(*Tu32)(unsafe.Pointer(bp + 8))>>libc.Int32FromInt32(8)&uint32(0xffffff), *(*Tu32)(unsafe.Pointer(bp + 8))&uint32(0xff))) /* The antipenultimate character of the super-journal name must ** be "9" to avoid name collisions when using 8+3 filenames. */ rc = _sqlite3OsAccess(tls, pVfs, zSuper, SQLITE_ACCESS_EXISTS, bp+4) @@ -137248,7 +130490,7 @@ func _sqlite3VdbeCheckFk(tls *libc.TLS, p uintptr, deferred int32) (r int32) { if deferred != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons+(*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons > 0 || !(deferred != 0) && (*TVdbe)(unsafe.Pointer(p)).FnFkConstraint > 0 { (*TVdbe)(unsafe.Pointer(p)).Frc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(3)< uint32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89855))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90655))) return 0 /* Corruption */ } /* Only needed by assert() statements */ @@ -138636,7 +131878,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr pKeyInfo = v4 } if v5 || int32((*TKeyInfo)(unsafe.Pointer(v4)).FnAllField) <= i { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89936))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90736))) return 0 /* Corruption */ } else { if *(*uintptr)(unsafe.Pointer(pKeyInfo + 20 + uintptr(i)*4)) != 0 { @@ -138671,7 +131913,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } else { nStr = int32((*(*Tu32)(unsafe.Pointer(bp + 52)) - uint32(12)) / uint32(2)) if d1+uint32(nStr) > uint32(nKey1) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(89966))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90766))) return 0 /* Corruption */ } else { if int32((*TMem)(unsafe.Pointer(pRhs)).Fflags)&int32(MEM_Zero) != 0 { @@ -138725,7 +131967,7 @@ func _sqlite3VdbeRecordCompareWithSkip(tls *libc.TLS, nKey1 int32, pKey1 uintptr } idx1 += uint32(_sqlite3VarintLen(tls, uint64(*(*Tu32)(unsafe.Pointer(bp + 52))))) if idx1 >= *(*Tu32)(unsafe.Pointer(bp)) { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90017))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90817))) return 0 /* Corrupt index */ } } @@ -138857,7 +132099,7 @@ vrcs_restart: szHdr = int32(*(*Tu8)(unsafe.Pointer(aKey1))) nStr = (*(*int32)(unsafe.Pointer(bp)) - int32(12)) / int32(2) if szHdr+nStr > nKey1 { - (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90180))) + (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).FerrCode = uint8(_sqlite3CorruptError(tls, int32(90980))) return 0 /* Corruption */ } if (*TUnpackedRecord)(unsafe.Pointer(pPKey2)).Fn < nStr { @@ -139009,7 +132251,7 @@ func _sqlite3VdbeIdxRowid(tls *libc.TLS, db uintptr, pCur uintptr, rowid uintptr idx_rowid_corruption: ; _sqlite3VdbeMemReleaseMalloc(tls, bp+8) - return _sqlite3CorruptError(tls, int32(90338)) + return _sqlite3CorruptError(tls, int32(91138)) } // C documentation @@ -139040,7 +132282,7 @@ func _sqlite3VdbeIdxKeyCompare(tls *libc.TLS, db uintptr, pC uintptr, pUnpacked ** that btreeParseCellPtr() and sqlite3GetVarint32() are implemented */ if nCellKey <= 0 || nCellKey > int64(0x7fffffff) { *(*int32)(unsafe.Pointer(res)) = 0 - return _sqlite3CorruptError(tls, int32(90371)) + return _sqlite3CorruptError(tls, int32(91171)) } _sqlite3VdbeMemInit(tls, bp, db, uint16(0)) rc = _sqlite3VdbeMemFromBtreeZeroOffset(tls, pCur, uint32(nCellKey), bp) @@ -139191,15 +132433,15 @@ func _sqlite3NotPureFunc(tls *libc.TLS, pCtx uintptr) (r int32) { pOp = (*TVdbe)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe)).FaOp + uintptr((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FiOp)*20 if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_PureFunc) { if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_IsCheck) != 0 { - zContext = __ccgo_ts + 6645 + zContext = __ccgo_ts + 6733 } else { if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fp5)&int32(NC_GenCol) != 0 { - zContext = __ccgo_ts + 6664 + zContext = __ccgo_ts + 6752 } else { - zContext = __ccgo_ts + 6683 + zContext = __ccgo_ts + 6771 } } - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+6692, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+6780, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpFunc)).FzName, zContext)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) return 0 @@ -139268,8 +132510,8 @@ func _vdbeFreeUnpacked(tls *libc.TLS, db uintptr, nField int32, p uintptr) { // ** the required value will be read from the row the cursor points to. // */ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 Ti64, iReg int32, iBlobWrite int32) { - bp := tls.Alloc(128) - defer tls.Free(128) + bp := tls.Alloc(144) + defer tls.Free(144) var db, zTbl uintptr var i, i1 int32 var iKey2, v1 Ti64 @@ -139277,7 +132519,7 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, _, _, _, _, _, _ = db, i, i1, iKey2, zTbl, v1 db = (*TVdbe)(unsafe.Pointer(v)).Fdb zTbl = (*TTable)(unsafe.Pointer(pTab)).FzName - libc.Xmemset(tls, bp, 0, uint32(128)) + libc.Xmemset(tls, bp, 0, uint32(136)) if libc.BoolInt32((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0)) == 0 { v1 = libc.Int64FromInt32(0) iKey2 = v1 @@ -139294,10 +132536,11 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*TPreUpdate)(unsafe.Pointer(bp))).FpCsr = pCsr (*(*TPreUpdate)(unsafe.Pointer(bp))).Fop = op (*(*TPreUpdate)(unsafe.Pointer(bp))).FiNewReg = iReg - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fdb = db - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField = uint16((*TTable)(unsafe.Pointer(pTab)).FnCol) - (*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) + (*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo = bp + 112 + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fdb = db + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField = uint16((*TTable)(unsafe.Pointer(pTab)).FnCol) + (*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FaSortFlags = uintptr(unsafe.Pointer(&_fakeSortOrder)) (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey1 = iKey1 (*(*TPreUpdate)(unsafe.Pointer(bp))).FiKey2 = iKey2 (*(*TPreUpdate)(unsafe.Pointer(bp))).FpTab = pTab @@ -139306,9 +132549,9 @@ func _sqlite3VdbePreUpdateHook(tls *libc.TLS, v uintptr, pCsr uintptr, op int32, (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, Tsqlite3_int64, Tsqlite3_int64))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg, db, op, zDb, zTbl, iKey1, iKey2) (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate = uintptr(0) _sqlite3DbFree(tls, db, (*(*TPreUpdate)(unsafe.Pointer(bp))).FaRecord) - _vdbeFreeUnpacked(tls, db, int32((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) - _vdbeFreeUnpacked(tls, db, int32((*(*TPreUpdate)(unsafe.Pointer(bp))).Fkeyinfo.FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) - _sqlite3VdbeMemRelease(tls, bp+72) + _vdbeFreeUnpacked(tls, db, int32((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpUnpacked) + _vdbeFreeUnpacked(tls, db, int32((*TKeyInfo)(unsafe.Pointer((*(*TPreUpdate)(unsafe.Pointer(bp))).FpKeyinfo)).FnKeyField)+int32(1), (*(*TPreUpdate)(unsafe.Pointer(bp))).FpNewUnpacked) + _sqlite3VdbeMemRelease(tls, bp+56) if (*(*TPreUpdate)(unsafe.Pointer(bp))).FaNew != 0 { i = 0 for { @@ -139388,7 +132631,7 @@ func Xsqlite3_expired(tls *libc.TLS, pStmt uintptr) (r int32) { // */ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Fdb == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6728, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6816, 0) return int32(1) } else { return 0 @@ -139398,7 +132641,7 @@ func _vdbeSafety(tls *libc.TLS, p uintptr) (r int32) { func _vdbeSafetyNotNull(tls *libc.TLS, p uintptr) (r int32) { if p == uintptr(0) { - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6773, 0) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6861, 0) return int32(1) } else { return _vdbeSafety(tls, p) @@ -139456,7 +132699,7 @@ func Xsqlite3_finalize(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt db = (*TVdbe)(unsafe.Pointer(v)).Fdb if _vdbeSafety(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(90768)) + return _sqlite3MisuseError(tls, int32(91569)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*TVdbe)(unsafe.Pointer(v)).FstartTime > 0 { @@ -139783,12 +133026,12 @@ func Xsqlite3_value_free(tls *libc.TLS, pOld uintptr) { // ** The invokeValueDestructor(P,X) routine invokes destructor function X() // ** on value P if P is not going to be used and need to be destroyed. // */ -func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, xDel uintptr) { +func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc Tu8, __ccgo_fp_xDel uintptr) { var pOut uintptr var rc int32 _, _ = pOut, rc pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut - rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pOut, z, int64(n), enc, __ccgo_fp_xDel) if rc != 0 { if rc == int32(SQLITE_TOOBIG) { Xsqlite3_result_error_toobig(tls, pCtx) @@ -139805,29 +133048,33 @@ func _setResultStrOrError(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, enc T } } -func _invokeValueDestructor(tls *libc.TLS, p uintptr, xDel uintptr, pCtx uintptr) (r int32) { - if xDel == uintptr(0) { +func _invokeValueDestructor(tls *libc.TLS, p uintptr, __ccgo_fp_xDel uintptr, pCtx uintptr) (r int32) { + if __ccgo_fp_xDel == uintptr(0) { /* noop */ } else { - if xDel == uintptr(-libc.Int32FromInt32(1)) { + if __ccgo_fp_xDel == uintptr(-libc.Int32FromInt32(1)) { /* noop */ } else { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, p) } } Xsqlite3_result_error_toobig(tls, pCtx) return int32(SQLITE_TOOBIG) } -func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(0), xDel) +type t__ccgo_fp__Xsqlite3_result_blob_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(0), __ccgo_fp_xDel) } -func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr) { +type t__ccgo_fp__Xsqlite3_result_blob64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_blob64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr) { if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), xDel) + _setResultStrOrError(tls, pCtx, z, int32(n), uint8(0), __ccgo_fp_xDel) } } @@ -139857,13 +133104,15 @@ func Xsqlite3_result_null(tls *libc.TLS, pCtx uintptr) { _sqlite3VdbeMemSetNull(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } -func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, xDestructor uintptr) { +type t__ccgo_fp__Xsqlite3_result_pointer_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_pointer(tls *libc.TLS, pCtx uintptr, pPtr uintptr, zPType uintptr, __ccgo_fp_xDestructor uintptr) { var pOut uintptr _ = pOut pOut = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut _sqlite3VdbeMemRelease(tls, pOut) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, xDestructor) + _sqlite3VdbeMemSetPointer(tls, pOut, pPtr, zPType, __ccgo_fp_xDestructor) } func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { @@ -139875,11 +133124,15 @@ func Xsqlite3_result_subtype(tls *libc.TLS, pCtx uintptr, eSubtype uint32) { *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(MEM_Subtype)) } -func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), xDel) +type t__ccgo_fp__Xsqlite3_result_text_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, n, uint8(SQLITE_UTF8), __ccgo_fp_xDel) } -func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, xDel uintptr, enc uint8) { +type t__ccgo_fp__Xsqlite3_result_text64_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) { if int32(enc) != int32(SQLITE_UTF8) { if int32(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) @@ -139887,23 +133140,29 @@ func Xsqlite3_result_text64(tls *libc.TLS, pCtx uintptr, z uintptr, n Tsqlite3_u n &= ^libc.Uint64FromInt32(1) } if n > uint64(0x7fffffff) { - _invokeValueDestructor(tls, z, xDel, pCtx) + _invokeValueDestructor(tls, z, __ccgo_fp_xDel, pCtx) } else { - _setResultStrOrError(tls, pCtx, z, int32(n), enc, xDel) + _setResultStrOrError(tls, pCtx, z, int32(n), enc, __ccgo_fp_xDel) _sqlite3VdbeMemZeroTerminateIfAble(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut) } } -func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16be_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16be(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16BE), __ccgo_fp_xDel) } -func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, xDel uintptr) { - _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), xDel) +type t__ccgo_fp__Xsqlite3_result_text16le_3 = func(*libc.TLS, uintptr) + +func Xsqlite3_result_text16le(tls *libc.TLS, pCtx uintptr, z uintptr, n int32, __ccgo_fp_xDel uintptr) { + _setResultStrOrError(tls, pCtx, z, int32(uint64(n) & ^libc.Uint64FromInt32(1)), uint8(SQLITE_UTF16LE), __ccgo_fp_xDel) } func Xsqlite3_result_value(tls *libc.TLS, pCtx uintptr, pValue uintptr) { @@ -139959,7 +133218,7 @@ func Xsqlite3_result_error_code(tls *libc.TLS, pCtx uintptr, errCode int32) { // /* Force an SQLITE_TOOBIG error. */ func Xsqlite3_result_error_toobig(tls *libc.TLS, pCtx uintptr) { (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FisError = int32(SQLITE_TOOBIG) - _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+6813, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) + _sqlite3VdbeMemSetStr(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpOut, __ccgo_ts+6901, int64(-int32(1)), uint8(SQLITE_UTF8), libc.UintptrFromInt32(0)) } // C documentation @@ -140160,7 +133419,7 @@ func Xsqlite3_step(tls *libc.TLS, pStmt uintptr) (r int32) { v = pStmt /* the prepared statement */ cnt = 0 /* The database connection */ if _vdbeSafetyNotNull(tls, v) != 0 { - return _sqlite3MisuseError(tls, int32(91562)) + return _sqlite3MisuseError(tls, int32(92363)) } db = (*TVdbe)(unsafe.Pointer(v)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -140290,7 +133549,7 @@ func _valueFromValueList(tls *libc.TLS, pVal uintptr, ppOut uintptr, bNext int32 _, _, _, _, _, _, _ = iOff, pOut, pRhs, rc, sz, zBuf, v1 *(*uintptr)(unsafe.Pointer(ppOut)) = uintptr(0) if pVal == uintptr(0) { - return _sqlite3MisuseError(tls, int32(91683)) + return _sqlite3MisuseError(tls, int32(92484)) } if int32((*Tsqlite3_value)(unsafe.Pointer(pVal)).Fflags)&int32(MEM_Dyn) == 0 || (*Tsqlite3_value)(unsafe.Pointer(pVal)).FxDel != __ccgo_fp(_sqlite3VdbeValueListFree) { return int32(SQLITE_ERROR) @@ -140459,6 +133718,8 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_auxdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* @@ -140472,7 +133733,7 @@ func Xsqlite3_get_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32) (r uintptr) { // ** to all functions within the current prepared statement using iArg as an // ** access code. // */ -func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, xDelete uintptr) { +func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, __ccgo_fp_xDelete uintptr) { var pAuxData, pVdbe uintptr _, _ = pAuxData, pVdbe pVdbe = (*Tsqlite3_context)(unsafe.Pointer(pCtx)).FpVdbe @@ -140510,13 +133771,13 @@ func Xsqlite3_set_auxdata(tls *libc.TLS, pCtx uintptr, iArg int32, pAux uintptr, } } (*TAuxData)(unsafe.Pointer(pAuxData)).FpAux = pAux - (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = xDelete + (*TAuxData)(unsafe.Pointer(pAuxData)).FxDeleteAux = __ccgo_fp_xDelete return goto failed failed: ; - if xDelete != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDelete})))(tls, pAux) + if __ccgo_fp_xDelete != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDelete})))(tls, pAux) } } @@ -140750,18 +134011,18 @@ func Xsqlite3_column_type(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { // ** Column names appropriate for EXPLAIN or EXPLAIN QUERY PLAN. // */ var _azExplainColNames8 = [12]uintptr{ - 0: __ccgo_ts + 6836, - 1: __ccgo_ts + 6841, - 2: __ccgo_ts + 6848, - 3: __ccgo_ts + 6851, - 4: __ccgo_ts + 6854, - 5: __ccgo_ts + 6857, - 6: __ccgo_ts + 6860, - 7: __ccgo_ts + 6863, - 8: __ccgo_ts + 6871, - 9: __ccgo_ts + 6874, - 10: __ccgo_ts + 6881, - 11: __ccgo_ts + 6889, + 0: __ccgo_ts + 6924, + 1: __ccgo_ts + 6929, + 2: __ccgo_ts + 6936, + 3: __ccgo_ts + 6939, + 4: __ccgo_ts + 6942, + 5: __ccgo_ts + 6945, + 6: __ccgo_ts + 6948, + 7: __ccgo_ts + 6951, + 8: __ccgo_ts + 6959, + 9: __ccgo_ts + 6962, + 10: __ccgo_ts + 6969, + 11: __ccgo_ts + 6977, } var _azExplainColNames16data = [60]Tu16{ 0: uint16('a'), @@ -141016,14 +134277,14 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { var v2 bool _, _, _ = pVar, v1, v2 if _vdbeSafetyNotNull(tls, p) != 0 { - return _sqlite3MisuseError(tls, int32(92299)) + return _sqlite3MisuseError(tls, int32(93100)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) if int32((*TVdbe)(unsafe.Pointer(p)).FeVdbeState) != int32(VDBE_READY_STATE) { - _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(92303))) + _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, _sqlite3MisuseError(tls, int32(93104))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) - Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6896, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) - return _sqlite3MisuseError(tls, int32(92307)) + Xsqlite3_log(tls, int32(SQLITE_MISUSE), __ccgo_ts+6984, libc.VaList(bp+8, (*TVdbe)(unsafe.Pointer(p)).FzSql)) + return _sqlite3MisuseError(tls, int32(93108)) } if i >= uint32((*TVdbe)(unsafe.Pointer(p)).FnVar) { _sqlite3Error(tls, (*TVdbe)(unsafe.Pointer(p)).Fdb, int32(SQLITE_RANGE)) @@ -141061,7 +134322,7 @@ func _vdbeUnbind(tls *libc.TLS, p uintptr, i uint32) (r int32) { // /* // ** Bind a text or BLOB value. // */ -func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, xDel uintptr, encoding Tu8) (r int32) { +func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, __ccgo_fp_xDel uintptr, encoding Tu8) (r int32) { var p, pVar uintptr var rc int32 _, _, _ = p, pVar, rc @@ -141071,7 +134332,7 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, /* tag-20240917-01 */ if zData != uintptr(0) { pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(i-int32(1))*40 - rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, xDel) + rc = _sqlite3VdbeMemSetStr(tls, pVar, zData, nData, encoding, __ccgo_fp_xDel) if rc == SQLITE_OK && int32(encoding) != 0 { rc = _sqlite3VdbeChangeEncoding(tls, pVar, int32((*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fenc)) } @@ -141082,24 +134343,28 @@ func _bindText(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Ti64, } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDel != libc.UintptrFromInt32(0) && xDel != uintptr(-libc.Int32FromInt32(1)) { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDel})))(tls, zData) + if __ccgo_fp_xDel != libc.UintptrFromInt32(0) && __ccgo_fp_xDel != uintptr(-libc.Int32FromInt32(1)) { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDel})))(tls, zData) } } return rc } +type t__ccgo_fp__Xsqlite3_bind_blob_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Bind a blob value to an SQL statement variable. // */ -func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +func Xsqlite3_bind_blob(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } -func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(0)) +type t__ccgo_fp__Xsqlite3_bind_blob64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_blob64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(0)) } func Xsqlite3_bind_double(tls *libc.TLS, pStmt uintptr, i int32, rValue float64) (r int32) { @@ -141147,7 +134412,9 @@ func Xsqlite3_bind_null(tls *libc.TLS, pStmt uintptr, i int32) (r int32) { return rc } -func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, xDestructor uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_pointer_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, zPTtype uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var p uintptr var rc int32 _, _ = p, rc @@ -141155,32 +134422,38 @@ func Xsqlite3_bind_pointer(tls *libc.TLS, pStmt uintptr, i int32, pPtr uintptr, rc = _vdbeUnbind(tls, p, uint32(i-libc.Int32FromInt32(1))) if rc == SQLITE_OK { /* tag-20240917-01 */ - _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, pPtr, zPTtype, xDestructor) + _sqlite3VdbeMemSetPointer(tls, (*TVdbe)(unsafe.Pointer(p)).FaVar+uintptr(i-int32(1))*40, pPtr, zPTtype, __ccgo_fp_xDestructor) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).Fdb)).Fmutex) } else { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pPtr) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pPtr) } } return rc } -func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, uint8(SQLITE_UTF8)) +type t__ccgo_fp__Xsqlite3_bind_text_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, uint8(SQLITE_UTF8)) } -func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, xDel uintptr, enc uint8) (r int32) { +type t__ccgo_fp__Xsqlite3_bind_text64_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text64(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, nData Tsqlite3_uint64, __ccgo_fp_xDel uintptr, enc uint8) (r int32) { if int32(enc) != int32(SQLITE_UTF8) { if int32(enc) == int32(SQLITE_UTF16) { enc = uint8(SQLITE_UTF16LE) } - nData &= uint64(^int32(libc.Uint16FromInt32(1))) + nData &= ^libc.Uint64FromInt32(1) } - return _bindText(tls, pStmt, i, zData, int64(nData), xDel, enc) + return _bindText(tls, pStmt, i, zData, int64(nData), __ccgo_fp_xDel, enc) } -func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, xDel uintptr) (r int32) { - return _bindText(tls, pStmt, i, zData, int64(uint64(n) & ^libc.Uint64FromInt32(1)), xDel, uint8(SQLITE_UTF16LE)) +type t__ccgo_fp__Xsqlite3_bind_text16_4 = func(*libc.TLS, uintptr) + +func Xsqlite3_bind_text16(tls *libc.TLS, pStmt uintptr, i int32, zData uintptr, n int32, __ccgo_fp_xDel uintptr) (r int32) { + return _bindText(tls, pStmt, i, zData, int64(uint64(n) & ^libc.Uint64FromInt32(1)), __ccgo_fp_xDel, uint8(SQLITE_UTF16LE)) } func Xsqlite3_bind_value(tls *libc.TLS, pStmt uintptr, i int32, pValue uintptr) (r int32) { @@ -141597,11 +134870,11 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp /* Test that this call is being made from within an SQLITE_DELETE or ** SQLITE_UPDATE pre-update callback, and that iIdx is within range. */ if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_INSERT) { - rc = _sqlite3MisuseError(tls, int32(92850)) + rc = _sqlite3MisuseError(tls, int32(93651)) goto preupdate_old_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -141610,7 +134883,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp goto preupdate_old_out } if iIdx == int32((*TTable)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab)).FiPKey) { - v1 = p + 72 + v1 = p + 56 pMem = v1 *(*uintptr)(unsafe.Pointer(ppValue)) = v1 _sqlite3VdbeMemSetInt64(tls, pMem, (*TPreUpdate)(unsafe.Pointer(p)).FiKey1) @@ -141624,7 +134897,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp } rc = _sqlite3BtreePayload(tls, *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpCsr + 36)), uint32(0), nRec, aRec) if rc == SQLITE_OK { - (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, p+16, int32(nRec), aRec) + (*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, int32(nRec), aRec) if !((*TPreUpdate)(unsafe.Pointer(p)).FpUnpacked != 0) { rc = int32(SQLITE_NOMEM) } @@ -141659,7 +134932,7 @@ func Xsqlite3_preupdate_old(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp })(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpTab + 44))).FpDfltList + 8 + uintptr(int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt)-int32(1))*20))).FpExpr rc = _sqlite3ValueFromExpr(tls, db, pDflt, (*Tsqlite3)(unsafe.Pointer(db)).Fenc, uint8((*TColumn)(unsafe.Pointer(pCol)).Faffinity), bp) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - rc = _sqlite3CorruptError(tls, int32(92907)) + rc = _sqlite3CorruptError(tls, int32(93710)) } *(*uintptr)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FapDflt + uintptr(iIdx)*4)) = *(*uintptr)(unsafe.Pointer(bp)) } @@ -141694,7 +134967,7 @@ func Xsqlite3_preupdate_count(tls *libc.TLS, db uintptr) (r int32) { _, _ = p, v1 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if p != 0 { - v1 = int32((*TPreUpdate)(unsafe.Pointer(p)).Fkeyinfo.FnKeyField) + v1 = int32((*TKeyInfo)(unsafe.Pointer((*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo)).FnKeyField) } else { v1 = 0 } @@ -141760,11 +135033,11 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp iStore = 0 p = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdate if !(p != 0) || (*TPreUpdate)(unsafe.Pointer(p)).Fop == int32(SQLITE_DELETE) { - rc = _sqlite3MisuseError(tls, int32(93003)) + rc = _sqlite3MisuseError(tls, int32(93806)) goto preupdate_new_out } if (*TPreUpdate)(unsafe.Pointer(p)).FpPk != 0 && (*TPreUpdate)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) { - iStore = int32(_sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, int16(iIdx))) + iStore = _sqlite3TableColumnToIndex(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpPk, iIdx) } else { iStore = int32(_sqlite3TableColumnToStorage(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpTab, int16(iIdx))) } @@ -141787,7 +135060,7 @@ func Xsqlite3_preupdate_new(tls *libc.TLS, db uintptr, iIdx int32, ppValue uintp if rc != SQLITE_OK { goto preupdate_new_out } - pUnpack = _vdbeUnpackRecord(tls, p+16, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) + pUnpack = _vdbeUnpackRecord(tls, (*TPreUpdate)(unsafe.Pointer(p)).FpKeyinfo, (*TMem)(unsafe.Pointer(pData)).Fn, (*TMem)(unsafe.Pointer(pData)).Fz) if !(pUnpack != 0) { rc = int32(SQLITE_NOMEM) goto preupdate_new_out @@ -141936,7 +135209,7 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr break } } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6936, int32(3)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7024, int32(3)) Xsqlite3_str_append(tls, bp+8, zStart, int32(zRawSql)-int32(zStart)) } } else { @@ -141968,13 +135241,13 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr nextIndex = v2 pVar = (*TVdbe)(unsafe.Pointer(p)).FaVar + uintptr(*(*int32)(unsafe.Pointer(bp))-int32(1))*40 if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Null) != 0 { - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1674, int32(4)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+1675, int32(4)) } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&(libc.Int32FromInt32(MEM_Int)|libc.Int32FromInt32(MEM_IntReal)) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1434, libc.VaList(bp+80, *(*Ti64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+1435, libc.VaList(bp+80, *(*Ti64)(unsafe.Pointer(pVar)))) } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Real) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6441, libc.VaList(bp+80, *(*float64)(unsafe.Pointer(pVar)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6529, libc.VaList(bp+80, *(*float64)(unsafe.Pointer(pVar)))) } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Str) != 0 { /* Number of bytes of the string text to include in output */ enc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc @@ -141989,28 +135262,28 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr pVar = bp + 32 } nOut = (*TMem)(unsafe.Pointer(pVar)).Fn - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6940, libc.VaList(bp+80, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+7028, libc.VaList(bp+80, nOut, (*TMem)(unsafe.Pointer(pVar)).Fz)) if int32(enc) != int32(SQLITE_UTF8) { _sqlite3VdbeMemRelease(tls, bp+32) } } else { if int32((*TMem)(unsafe.Pointer(pVar)).Fflags)&int32(MEM_Zero) != 0 { - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6947, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+7035, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(&(*TMem)(unsafe.Pointer(pVar)).Fu)))) } else { /* Number of bytes of the blob to include in output */ - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6960, int32(2)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7048, int32(2)) nOut1 = (*TMem)(unsafe.Pointer(pVar)).Fn i = 0 for { if !(i < nOut1) { break } - Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+6963, libc.VaList(bp+80, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) + Xsqlite3_str_appendf(tls, bp+8, __ccgo_ts+7051, libc.VaList(bp+80, int32(*(*int8)(unsafe.Pointer((*TMem)(unsafe.Pointer(pVar)).Fz + uintptr(i))))&int32(0xff))) goto _3 _3: ; i++ } - Xsqlite3_str_append(tls, bp+8, __ccgo_ts+6968, int32(1)) + Xsqlite3_str_append(tls, bp+8, __ccgo_ts+7056, int32(1)) } } } @@ -142174,9 +135447,9 @@ func _sqlite3VdbeExpandSql(tls *libc.TLS, p uintptr, zRawSql uintptr) (r uintptr // ** if we run out of memory. // */ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurType Tu8) (r uintptr) { - var nByte, v2 int32 - var pCx, pMem, v1, v3, v4 uintptr - _, _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3, v4 + var nByte Ti64 + var pCx, pMem, v1, v2, v3 uintptr + _, _, _, _, _, _ = nByte, pCx, pMem, v1, v2, v3 if iCur > 0 { v1 = (*TVdbe)(unsafe.Pointer(p)).FaMem + uintptr((*TVdbe)(unsafe.Pointer(p)).FnMem-iCur)*40 } else { @@ -142202,12 +135475,10 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp */ pMem = v1 pCx = uintptr(0) + nByte = int64((uint32(libc.UintptrFromInt32(0)+84)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + uint32(nField+libc.Int32FromInt32(1))*libc.Uint32FromInt64(8)) if int32(eCurType) == CURTYPE_BTREE { - v2 = _sqlite3BtreeCursorSize(tls) - } else { - v2 = 0 + nByte += int64(_sqlite3BtreeCursorSize(tls)) } - nByte = int32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*uint32(nField) + uint32(v2)) if *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) != 0 { /*OPTIMIZATION-IF-FALSE*/ _sqlite3VdbeFreeCursorNN(tls, p, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4))) *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = uintptr(0) @@ -142216,28 +135487,28 @@ func _allocateCursor(tls *libc.TLS, p uintptr, iCur int32, nField int32, eCurTyp ** the pMem used to hold space for the cursor has enough storage available ** in pMem->zMalloc. But for the special case of the aMem[] entries used ** to hold cursors, it is faster to in-line the logic. */ - if (*TMem)(unsafe.Pointer(pMem)).FszMalloc < nByte { + if int64((*TMem)(unsafe.Pointer(pMem)).FszMalloc) < nByte { if (*TMem)(unsafe.Pointer(pMem)).FszMalloc > 0 { _sqlite3DbFreeNN(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, (*TMem)(unsafe.Pointer(pMem)).FzMalloc) } - v3 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)) - (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v3 - (*TMem)(unsafe.Pointer(pMem)).Fz = v3 + v2 = _sqlite3DbMallocRaw(tls, (*TMem)(unsafe.Pointer(pMem)).Fdb, uint64(nByte)) + (*TMem)(unsafe.Pointer(pMem)).FzMalloc = v2 + (*TMem)(unsafe.Pointer(pMem)).Fz = v2 if (*TMem)(unsafe.Pointer(pMem)).FzMalloc == uintptr(0) { (*TMem)(unsafe.Pointer(pMem)).FszMalloc = 0 return uintptr(0) } - (*TMem)(unsafe.Pointer(pMem)).FszMalloc = nByte + (*TMem)(unsafe.Pointer(pMem)).FszMalloc = int32(nByte) } - v4 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc - pCx = v4 - *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = v4 + v3 = (*TMem)(unsafe.Pointer(pMem)).FzMalloc + pCx = v3 + *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr(iCur)*4)) = v3 libc.Xmemset(tls, pCx, 0, uint32(libc.UintptrFromInt32(0)+32)) (*TVdbeCursor)(unsafe.Pointer(pCx)).FeCurType = eCurType (*TVdbeCursor)(unsafe.Pointer(pCx)).FnField = int16(nField) (*TVdbeCursor)(unsafe.Pointer(pCx)).FaOffset = pCx + 84 + uintptr(nField)*4 if int32(eCurType) == CURTYPE_BTREE { - *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))+libc.Uint32FromInt32(2)*libc.Uint32FromInt64(4)*uint32(nField)) + *(*uintptr)(unsafe.Pointer(pCx + 36)) = (*TMem)(unsafe.Pointer(pMem)).Fz + uintptr((uint32(libc.UintptrFromInt32(0)+84)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))+uint32(nField+libc.Int32FromInt32(1))*libc.Uint32FromInt64(8)) _sqlite3BtreeCursorZero(tls, *(*uintptr)(unsafe.Pointer(pCx + 36))) } return pCx @@ -142610,11 +135881,11 @@ func _vdbeMemTypeName(tls *libc.TLS, pMem uintptr) (r uintptr) { } var _azTypes = [5]uintptr{ - 0: __ccgo_ts + 1143, - 1: __ccgo_ts + 1155, - 2: __ccgo_ts + 1160, - 3: __ccgo_ts + 1138, - 4: __ccgo_ts + 1674, + 0: __ccgo_ts + 1144, + 1: __ccgo_ts + 1156, + 2: __ccgo_ts + 1161, + 3: __ccgo_ts + 1139, + 4: __ccgo_ts + 1675, } // C documentation @@ -142628,12 +135899,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { defer tls.Free(768) var aCol, aMem, aOffset, aOp, aPermute, aRoot, apArg, apArg1, db, pArgc, pBt, pBt1, pBt2, pBt3, pC, pC1, pC10, pC11, pC12, pC13, pC14, pC15, pC16, pC17, pC18, pC19, pC2, pC20, pC21, pC22, pC23, pC24, pC25, pC26, pC27, pC28, pC29, pC3, pC30, pC31, pC32, pC4, pC5, pC6, pC7, pC8, pC9, pCaller, pColl, pCrsr, pCrsr1, pCrsr2, pCrsr3, pCrsr4, pCrsr5, pCrsr6, pCrsr7, pCtx, pCtx1, pCtx2, pCur, pCur1, pCur2, pCur3, pCur4, pCur5, pCur6, pCx, pCx1, pCx2, pCx3, pData, pData0, pDb, pDb1, pDb2, pDb3, pDest, pDest1, pDest2, pEnd, pFrame, pFrame1, pFrame2, pFrame3, pFrame4, pIdxKey, pIn, pIn1, pIn2, pIn3, pKey, pKeyInfo, pKeyInfo1, pKeyInfo2, pLast, pMem, pMem1, pMem2, pMem3, pMem4, pModule, pModule1, pModule2, pModule3, pModule4, pModule5, pModule6, pName, pNew, pOp, pOrig, pOut, pPager, pProgram, pQuery, pRec, pReg, pRhs, pRt, pSavepoint, pSrc, pTab, pTab1, pTab2, pTab3, pTabCur, pTmp, pVCur1, pVTab, pVar, pVtab, pVtab1, pVtab2, pVtab3, pVtab4, pVtab5, pVtab6, pVtab7, pX, pX1, pnErr, t1, z1, z2, z3, zAffinity, zAffinity1, zData, zDb, zDb1, zEndHdr, zErr, zFilename, zHdr, zHdr1, zName, zPayload, zSchema, zSql, zTab, zTrace, v240, v241, v242, v250, v251, v252, v253, v255, v263, v278, v279, v286, v288, v297, v298, p189, p192, p193, p196, p199, p208, p209, p212, p227, p228, p229, p230, p231, p232, p233, p234, p235, p236, p237, p238, p239, p293, p294, p295, p296 uintptr var affinity int8 - var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nByte2, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 + var alreadyExists, bRev, c, c1, c2, cnt, cnt1, desiredAutoCommit, eNew, eOld, eqOnly, exists, i, i1, i2, i4, i5, i6, i7, i8, i9, iCompare, iCookie, iDb, iDb1, iDb2, iDb3, iQuery, iRollback, iSavepoint, iSet, ii, ii1, isLegacy, isSchemaChange, isTransaction, len1, n, n1, n2, n4, nArg, nArg1, nField, nField1, nField2, nHdr, nKeyCol, nMem, nName, nRoot, nStep, nVarint, oc, opflags, p1, p11, p12, p13, p2, p21, pcDest, pcx, rc, res, res10, res11, res12, res21, savedAnalysisLimit, seekResult, v11, v21, wrFlag, v188, v191, v194, v197, v198, v205, v206, v207, v223, v224, v244, v245, v248, v249, v256, v260, v265, v266, v269, v270, v272, v273, v274, v275, v284, v287, v291 int32 var colCacheCtr, iAddr, iMap, iPrior, idx, len11, n3, p22, p23, serialType, serial_type, v213, v214, v216, v221, v222 Tu32 var encoding, isWriteLock, mTrace, op, p5, resetSchemaOnFault, vtabOnConflict, v225 Tu8 var flags1, flags11, flags2, flags3, flags31, newType, nullFlag, type1, type2, typeMask, v190 Tu16 var h, h1, iKey1, nAlloc, nData, nProgressLimit, nVmStep, offset64, uu Tu64 - var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nCellKey, nZero, sz, v254, v262 Ti64 + var i3, iA, iB1, iKey, iKey2, nByte, nByte1, nByte2, nCellKey, nZero, sz, v254, v262 Ti64 var newMax, v211 uint32 var rA, rB float64 var xAuth Tsqlite3_xauth @@ -142650,7 +135921,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { var _ /* nChange at bp+512 */ Ti64 var _ /* nEntry at bp+80 */ Ti64 var _ /* nErr at bp+556 */ int32 - var _ /* nullFunc at bp+680 */ TFuncDef + var _ /* nullFunc at bp+676 */ TFuncDef var _ /* pVCur at bp+640 */ uintptr var _ /* pgno at bp+520 */ TPgno var _ /* r at bp+104 */ TUnpackedRecord @@ -143382,19 +136653,19 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TVdbe)(unsafe.Pointer(p)).Frc != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp3 > 0 && int32((*TOp)(unsafe.Pointer(pOp)).Fp4type) == P4_NOTUSED { zErr = _sqlite3ValueText(tls, aMem+uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40, uint8(SQLITE_UTF8)) - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+736, zErr)) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+736, zErr)) } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+7004, libc.VaList(bp+736, _azType[int32((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) + _sqlite3VdbeError(tls, p, __ccgo_ts+7092, libc.VaList(bp+736, _azType[int32((*TOp)(unsafe.Pointer(pOp)).Fp5)-int32(1)])) if *(*uintptr)(unsafe.Pointer(pOp + 16)) != 0 { - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+7025, libc.VaList(bp+736, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+7113, libc.VaList(bp+736, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } else { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(pOp + 16)))) } } pcx = (int32(pOp) - int32(aOp)) / 20 - Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+7032, libc.VaList(bp+736, pcx, (*TVdbe)(unsafe.Pointer(p)).FzSql, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg)) + Xsqlite3_log(tls, (*TOp)(unsafe.Pointer(pOp)).Fp1, __ccgo_ts+7120, libc.VaList(bp+736, pcx, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg, (*TVdbe)(unsafe.Pointer(p)).FzSql)) } rc = _sqlite3VdbeHalt(tls, p) if rc == int32(SQLITE_BUSY) { @@ -144608,7 +137879,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Ti64)(unsafe.Pointer(pOut)) = ^_sqlite3VdbeIntValue(tls, pIn1) } goto _187 - /* Opcode: Once P1 P2 * * * + /* Opcode: Once P1 P2 P3 * * ** ** Fall through to the next instruction the first time this opcode is ** encountered on each invocation of the byte-code program. Jump to P2 @@ -144624,6 +137895,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** whether or not the jump should be taken. The bitmask is necessary ** because the self-altering code trick does not work for recursive ** triggers. + ** + ** The P3 operand is not used directly by this opcode. However P3 is + ** used by the code generator as follows: If this opcode is the start + ** of a subroutine and that subroutine uses a Bloom filter, then P3 will + ** be the register that holds that Bloom filter. See tag-202407032019 + ** in the source code for implementation details. */ _56: ; /* Address of this instruction */ @@ -145117,7 +138394,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { pOp = aOp + uintptr((*(*TOp)(unsafe.Pointer(aOp))).Fp3-int32(1))*20 goto _187 } else { - rc = _sqlite3CorruptError(tls, int32(96760)) + rc = _sqlite3CorruptError(tls, int32(97570)) goto abort_due_to_error } /* Opcode: TypeCheck P1 P2 P3 P4 * @@ -145220,7 +138497,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_type_error vdbe_type_error: ; - _sqlite3VdbeError(tls, p, __ccgo_ts+7056, libc.VaList(bp+736, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7142, libc.VaList(bp+736, _vdbeMemTypeName(tls, pIn1), _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(aCol + uintptr(i2)*12 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i2)*12))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(12)< 0 && p12 == int32(SAVEPOINT_RELEASE) { /* It is not possible to release (commit) a savepoint if there are ** active write statements. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+7170, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7256, 0) rc = int32(SQLITE_BUSY) } else { /* Determine whether or not this is a transaction savepoint. If so, @@ -145816,7 +139093,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If this instruction implements a COMMIT and other VMs are writing ** return an error indicating that the other VMs must complete first. */ - _sqlite3VdbeError(tls, p, __ccgo_ts+7224, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7310, 0) rc = int32(SQLITE_BUSY) goto abort_due_to_error } else { @@ -145846,12 +139123,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { goto vdbe_return } else { if !(desiredAutoCommit != 0) { - v250 = __ccgo_ts + 7279 + v250 = __ccgo_ts + 7365 } else { if iRollback != 0 { - v251 = __ccgo_ts + 7327 + v251 = __ccgo_ts + 7413 } else { - v251 = __ccgo_ts + 7370 + v251 = __ccgo_ts + 7456 } v250 = v251 } @@ -145943,7 +139220,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** SQL statement was prepared. */ _sqlite3DbFree(tls, db, (*TVdbe)(unsafe.Pointer(p)).FzErrMsg) - (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+7411) + (*TVdbe)(unsafe.Pointer(p)).FzErrMsg = _sqlite3DbStrDup(tls, db, __ccgo_ts+7497) /* If the schema-cookie from the database file matches the cookie ** stored with the in-memory representation of the schema, do ** not reload the schema from the database file. @@ -146261,7 +139538,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** form sqlite3BtreeInsert() where the length of the data is zero. */ /* Only used when number of columns is zero */ (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fn = 0 - (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fz = __ccgo_ts + 1673 + (*(*TMem)(unsafe.Pointer(aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40))).Fz = __ccgo_ts + 1674 } pCx1 = *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(p)).FapCsr + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp1)*4)) if pCx1 != 0 && !(int32(TBool(*(*uint8)(unsafe.Pointer(pCx1 + 8))&0x8>>3)) != 0) && (*TOp)(unsafe.Pointer(pOp)).Fp2 <= int32((*TVdbeCursor)(unsafe.Pointer(pCx1)).FnField) { @@ -147027,7 +140304,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** into an integer without loss of information. Take care to avoid ** changing the datatype of pIn3, however, as it is used by other ** parts of the prepared statement. */ - *(*Tsqlite3_value1)(unsafe.Pointer(bp + 216)) = *(*TMem)(unsafe.Pointer(pIn3)) + *(*Tsqlite3_value)(unsafe.Pointer(bp + 216)) = *(*TMem)(unsafe.Pointer(pIn3)) _applyAffinity(tls, bp+216, int8(SQLITE_AFF_NUMERIC), encoding) if int32((*(*TMem)(unsafe.Pointer(bp + 216))).Fflags)&int32(MEM_Int) == 0 { goto jump_to_p2 @@ -147054,7 +140331,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TVdbeCursor)(unsafe.Pointer(pC10)).FseekResult = *(*int32)(unsafe.Pointer(bp + 208)) if *(*int32)(unsafe.Pointer(bp + 208)) != 0 { if (*TOp)(unsafe.Pointer(pOp)).Fp2 == 0 { - rc = _sqlite3CorruptError(tls, int32(99020)) + rc = _sqlite3CorruptError(tls, int32(99831)) } else { goto jump_to_p2 } @@ -147513,7 +140790,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_RowData opcodes always follow OP_NotExists or ** OP_SeekRowid or OP_Rewind/Op_Next with no intervening instructions ** that might invalidate the cursor. - ** If this where not the case, on of the following assert()s + ** If this were not the case, one of the following assert()s ** would fail. Should this ever change (because of changes in the code ** generator) then the fix would be to insert a call to ** sqlite3VdbeCursorMoveto(). @@ -147946,7 +141223,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } } else { if (*TOp)(unsafe.Pointer(pOp)).Fp5 != 0 && !(_sqlite3WritableSchema(tls, db) != 0) { - rc = _sqlite3ReportError(tls, libc.Int32FromInt32(SQLITE_CORRUPT)|libc.Int32FromInt32(3)< int64(0x7fffffff) { - rc = _sqlite3CorruptError(tls, int32(100317)) + rc = _sqlite3CorruptError(tls, int32(101128)) goto abort_due_to_error } _sqlite3VdbeMemInit(tls, bp+464, db, uint16(0)) @@ -148276,7 +141553,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = mTrace (*Tsqlite3)(unsafe.Pointer(db)).FnAnalysisLimit = savedAnalysisLimit if *(*uintptr)(unsafe.Pointer(bp + 524)) != 0 || rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(bp + 524)))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+736, *(*uintptr)(unsafe.Pointer(bp + 524)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 524))) if rc == int32(SQLITE_NOMEM) { goto no_mem @@ -148307,13 +141584,13 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_SchemaChange) libc.SetBitFieldPtr16Uint32(p+152, libc.Uint32FromInt32(0), 0, 0x3) } else { - zSchema = __ccgo_ts + 7456 + zSchema = __ccgo_ts + 7542 (*(*TInitData)(unsafe.Pointer(bp + 528))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 528))).FiDb = iDb3 (*(*TInitData)(unsafe.Pointer(bp + 528))).FpzErrMsg = p + 124 (*(*TInitData)(unsafe.Pointer(bp + 528))).FmInitFlags = uint32(0) (*(*TInitData)(unsafe.Pointer(bp + 528))).FmxPage = _sqlite3BtreeLastPage(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+7470, libc.VaList(bp+736, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+7556, libc.VaList(bp+736, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb3)*16))).FzDbSName, zSchema, *(*uintptr)(unsafe.Pointer(pOp + 16)))) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -148328,7 +141605,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* The OP_ParseSchema opcode with a non-NULL P4 argument should parse ** at least one SQL statement. Any less than that indicates that ** the sqlite_schema table is corrupt. */ - rc = _sqlite3CorruptError(tls, int32(100610)) + rc = _sqlite3CorruptError(tls, int32(101421)) } _sqlite3DbFreeNN(tls, db, zSql) (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy = uint8(0) @@ -148565,7 +141842,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } if (*TVdbe)(unsafe.Pointer(p)).FnFrame >= *(*int32)(unsafe.Pointer(db + 120 + 10*4)) { rc = int32(SQLITE_ERROR) - _sqlite3VdbeError(tls, p, __ccgo_ts+7513, 0) + _sqlite3VdbeError(tls, p, __ccgo_ts+7599, 0) goto abort_due_to_error } /* Register pRt is used to store the memory required to save the state @@ -148582,7 +141859,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr == 0 { nMem++ } - nByte2 = int32((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + uint32(nMem)*uint32(40) + uint32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4) + uint32(((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp+int32(7))/int32(8))) + nByte2 = int64((libc.Uint32FromInt64(88)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))+uint32(nMem)*uint32(40)+uint32((*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr)*uint32(4)) + (int64(7)+int64((*TSubProgram)(unsafe.Pointer(pProgram)).FnOp))/int64(8) pFrame2 = _sqlite3DbMallocZero(tls, db, uint64(nByte2)) if !(pFrame2 != 0) { goto no_mem @@ -148590,7 +141867,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { _sqlite3VdbeMemRelease(tls, pRt) (*TMem)(unsafe.Pointer(pRt)).Fflags = uint16(libc.Int32FromInt32(MEM_Blob) | libc.Int32FromInt32(MEM_Dyn)) (*TMem)(unsafe.Pointer(pRt)).Fz = pFrame2 - (*TMem)(unsafe.Pointer(pRt)).Fn = nByte2 + (*TMem)(unsafe.Pointer(pRt)).Fn = int32(nByte2) (*TMem)(unsafe.Pointer(pRt)).FxDel = __ccgo_fp(_sqlite3VdbeFrameMemDel) (*TVdbeFrame)(unsafe.Pointer(pFrame2)).Fv = p (*TVdbeFrame)(unsafe.Pointer(pFrame2)).FnChildMem = nMem @@ -148671,11 +141948,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { */ _144: ; - if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { - *(*Ti64)(unsafe.Pointer(db + 536)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { + *(*Ti64)(unsafe.Pointer(db + 528)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { - if (*TOp)(unsafe.Pointer(pOp)).Fp1 != 0 { - *(*Ti64)(unsafe.Pointer(db + 528)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) + if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_DeferFKs) != 0 { + *(*Ti64)(unsafe.Pointer(db + 536)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } else { *(*Ti64)(unsafe.Pointer(p + 64)) += int64((*TOp)(unsafe.Pointer(pOp)).Fp2) } @@ -148887,7 +142164,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { ** ** Note: We could avoid this by using a regular memory cell from aMem[] for ** the accumulator, instead of allocating one here. */ - nAlloc = uint64((libc.Uint32FromInt64(32) + uint32(n4-libc.Int32FromInt32(1))*libc.Uint32FromInt64(4) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) + nAlloc = uint64((uint32(libc.UintptrFromInt32(0)+28) + uint32(n4)*libc.Uint32FromInt64(4) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) pCtx = _sqlite3DbMallocRawNN(tls, db, nAlloc+uint64(40)) if pCtx == uintptr(0) { goto no_mem @@ -148937,7 +142214,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } /* IMP: R-24505-23230 */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+736, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+736, Xsqlite3_value_text(tls, (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FpOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FisError } if (*Tsqlite3_context)(unsafe.Pointer(pCtx1)).FskipFlag != 0 { @@ -148993,7 +142270,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3VdbeMemFinalize(tls, pMem3, *(*uintptr)(unsafe.Pointer(pOp + 16))) } if rc != 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+736, Xsqlite3_value_text(tls, pMem3))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+736, Xsqlite3_value_text(tls, pMem3))) goto abort_due_to_error } _sqlite3VdbeChangeEncoding(tls, pMem3, int32(encoding)) @@ -149072,11 +142349,11 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeRead > int32(1) { rc = int32(SQLITE_ERROR) if eNew == int32(PAGER_JOURNALMODE_WAL) { - v286 = __ccgo_ts + 7550 + v286 = __ccgo_ts + 7636 } else { - v286 = __ccgo_ts + 7555 + v286 = __ccgo_ts + 7641 } - _sqlite3VdbeError(tls, p, __ccgo_ts+7562, libc.VaList(bp+736, v286)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7648, libc.VaList(bp+736, v286)) goto abort_due_to_error } else { if eOld == int32(PAGER_JOURNALMODE_WAL) { @@ -149229,7 +142506,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { if rc != 0 { if rc&int32(0xFF) == int32(SQLITE_LOCKED) { z1 = *(*uintptr)(unsafe.Pointer(pOp + 16)) - _sqlite3VdbeError(tls, p, __ccgo_ts+7614, libc.VaList(bp+736, z1)) + _sqlite3VdbeError(tls, p, __ccgo_ts+7700, libc.VaList(bp+736, z1)) } goto abort_due_to_error } @@ -149391,7 +142668,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { (*TValueList)(unsafe.Pointer(pRhs)).FpOut = aMem + uintptr((*TOp)(unsafe.Pointer(pOp)).Fp3)*40 pOut = _out2Prerelease(tls, p, pOp) (*TMem)(unsafe.Pointer(pOut)).Fflags = uint16(MEM_Null) - _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+7643, __ccgo_fp(_sqlite3VdbeValueListFree)) + _sqlite3VdbeMemSetPointer(tls, pOut, pRhs, __ccgo_ts+7729, __ccgo_fp(_sqlite3VdbeValueListFree)) goto _187 /* Opcode: VFilter P1 P2 P3 P4 * ** Synopsis: iplan=r[P3] zplan='P4' @@ -149471,12 +142748,12 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { } pVtab4 = (*Tsqlite3_vtab_cursor)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pCur5 + 36)))).FpVtab pModule4 = (*Tsqlite3_vtab)(unsafe.Pointer(pVtab4)).FpModule - libc.Xmemset(tls, bp+648, 0, uint32(32)) + libc.Xmemset(tls, bp+648, 0, uint32(28)) (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FpOut = pDest2 (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).Fenc = encoding - (*(*TFuncDef)(unsafe.Pointer(bp + 680))).FpUserData = uintptr(0) - (*(*TFuncDef)(unsafe.Pointer(bp + 680))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) - (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FpFunc = bp + 680 + (*(*TFuncDef)(unsafe.Pointer(bp + 676))).FpUserData = uintptr(0) + (*(*TFuncDef)(unsafe.Pointer(bp + 676))).FfuncFlags = uint32(SQLITE_RESULT_SUBTYPE) + (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FpFunc = bp + 676 if int32((*TOp)(unsafe.Pointer(pOp)).Fp5)&int32(OPFLAG_NOCHNG) != 0 { _sqlite3VdbeMemSetNull(tls, pDest2) (*TMem)(unsafe.Pointer(pDest2)).Fflags = uint16(libc.Int32FromInt32(MEM_Null) | libc.Int32FromInt32(MEM_Zero)) @@ -149487,7 +142764,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { rc = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_module)(unsafe.Pointer(pModule4)).FxColumn})))(tls, *(*uintptr)(unsafe.Pointer(pCur5 + 36)), bp+648, (*TOp)(unsafe.Pointer(pOp)).Fp2) _sqlite3VtabImportErrmsg(tls, p, pVtab4) if (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+736, Xsqlite3_value_text(tls, pDest2))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+736, Xsqlite3_value_text(tls, pDest2))) rc = (*(*Tsqlite3_context)(unsafe.Pointer(bp + 648))).FisError } _sqlite3VdbeChangeEncoding(tls, pDest2, int32(encoding)) @@ -149741,7 +143018,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { /* If the function returned an error, throw an exception */ if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError != 0 { if (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError > 0 { - _sqlite3VdbeError(tls, p, __ccgo_ts+4710, libc.VaList(bp+736, Xsqlite3_value_text(tls, pOut))) + _sqlite3VdbeError(tls, p, __ccgo_ts+4829, libc.VaList(bp+736, Xsqlite3_value_text(tls, pOut))) rc = (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FisError } _sqlite3VdbeDeleteAuxData(tls, db, p+228, (*Tsqlite3_context)(unsafe.Pointer(pCtx2)).FiOp, (*TOp)(unsafe.Pointer(pOp)).Fp1) @@ -149892,7 +143169,7 @@ func _sqlite3VdbeExec(tls *libc.TLS, p uintptr) (r int32) { Xsqlite3_free(tls, z2) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeExec > int32(1) { - z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+7653, libc.VaList(bp+736, zTrace)) + z3 = _sqlite3MPrintf(tls, db, __ccgo_ts+7739, libc.VaList(bp+736, zTrace)) (*(*func(*libc.TLS, Tu32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{*(*uintptr)(unsafe.Pointer(&(*Tsqlite3)(unsafe.Pointer(db)).Ftrace))})))(tls, uint32(SQLITE_TRACE_STMT), (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg, p, z3) _sqlite3DbFree(tls, db, z3) } else { @@ -149979,15 +143256,15 @@ abort_due_to_error: rc = int32(SQLITE_NOMEM) } else { if rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(33)<= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { + v7 = nAttempt + if v7 >= int32(SQLITE_MAX_SCHEMA_RETRY) || rc != int32(SQLITE_SCHEMA) { break } _sqlite3ParseObjectReset(tls, bp+4) @@ -150453,11 +143709,11 @@ blob_open_out: _sqlite3DbFree(tls, db, pBlob) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v7 = __ccgo_ts + 4710 + v8 = __ccgo_ts + 4829 } else { - v7 = libc.UintptrFromInt32(0) + v8 = libc.UintptrFromInt32(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v7, libc.VaList(bp+304, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v8, libc.VaList(bp+296, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3ParseObjectReset(tls, bp+4) rc = _sqlite3ApiExit(tls, db, rc) @@ -150536,14 +143792,14 @@ func Xsqlite3_blob_close(tls *libc.TLS, pBlob uintptr) (r int32) { // /* // ** Perform a read or write operation on a blob // */ -func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, xCall uintptr) (r int32) { +func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset int32, __ccgo_fp_xCall uintptr) (r int32) { var db, p, v uintptr var iKey Tsqlite3_int64 var rc int32 _, _, _, _, _ = db, iKey, p, rc, v p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103157)) + return _sqlite3MisuseError(tls, int32(103971)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -150562,11 +143818,11 @@ func _blobReadWrite(tls *libc.TLS, pBlob uintptr, z uintptr, n int32, iOffset in ** returned, clean-up the statement handle. */ _sqlite3BtreeEnterCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) - if xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { + if __ccgo_fp_xCall == __ccgo_fp(_sqlite3BtreePutData) && (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { iKey = _sqlite3BtreeIntegerKey(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) _sqlite3VdbePreUpdateHook(tls, v, *(*uintptr)(unsafe.Pointer((*TVdbe)(unsafe.Pointer(v)).FapCsr)), int32(SQLITE_DELETE), (*TIncrblob)(unsafe.Pointer(p)).FzDb, (*TIncrblob)(unsafe.Pointer(p)).FpTab, iKey, -int32(1), int32((*TIncrblob)(unsafe.Pointer(p)).FiCol)) } - rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z) + rc = (*(*func(*libc.TLS, uintptr, Tu32, Tu32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCall})))(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr, uint32(iOffset+(*TIncrblob)(unsafe.Pointer(p)).FiOffset), uint32(n), z) _sqlite3BtreeLeaveCursor(tls, (*TIncrblob)(unsafe.Pointer(p)).FpCsr) if rc == int32(SQLITE_ABORT) { _sqlite3VdbeFinalize(tls, v) @@ -150642,7 +143898,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r _, _, _, _ = db, p, rc, v1 p = pBlob if p == uintptr(0) { - return _sqlite3MisuseError(tls, int32(103257)) + return _sqlite3MisuseError(tls, int32(104071)) } db = (*TIncrblob)(unsafe.Pointer(p)).Fdb Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -150656,7 +143912,7 @@ func Xsqlite3_blob_reopen(tls *libc.TLS, pBlob uintptr, iRow Tsqlite3_int64) (r rc = _blobSeekToRow(tls, p, iRow, bp) if rc != SQLITE_OK { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v1 = __ccgo_ts + 4710 + v1 = __ccgo_ts + 4829 } else { v1 = libc.UintptrFromInt32(0) } @@ -150936,111 +144192,6 @@ type TIncrMerger = struct { type IncrMerger = TIncrMerger -/* Read & merge multiple PMAs */ - -/* -** A container for a temp file handle and the current amount of data -** stored in the file. - */ -type TSorterFile1 = struct { - F__ccgo_align [0]uint32 - FpFd uintptr - F__ccgo_align1 [4]byte - FiEof Ti64 -} - -type SorterFile1 = TSorterFile1 - -/* -** An in-memory list of objects to be sorted. -** -** If aMemory==0 then each object is allocated separately and the objects -** are connected using SorterRecord.u.pNext. If aMemory!=0 then all objects -** are stored in the aMemory[] bulk memory, one right after the other, and -** are connected using SorterRecord.u.iNext. - */ -type TSorterList1 = struct { - F__ccgo_align [0]uint32 - FpList uintptr - FaMemory uintptr - FszPMA Ti64 -} - -type SorterList1 = TSorterList1 - -/* -** The MergeEngine object is used to combine two or more smaller PMAs into -** one big PMA using a merge operation. Separate PMAs all need to be -** combined into one big PMA in order to be able to step through the sorted -** records in order. -** -** The aReadr[] array contains a PmaReader object for each of the PMAs being -** merged. An aReadr[] object either points to a valid key or else is at EOF. -** ("EOF" means "End Of File". When aReadr[] is at EOF there is no more data.) -** For the purposes of the paragraphs below, we assume that the array is -** actually N elements in size, where N is the smallest power of 2 greater -** to or equal to the number of PMAs being merged. The extra aReadr[] elements -** are treated as if they are empty (always at EOF). -** -** The aTree[] array is also N elements in size. The value of N is stored in -** the MergeEngine.nTree variable. -** -** The final (N/2) elements of aTree[] contain the results of comparing -** pairs of PMA keys together. Element i contains the result of -** comparing aReadr[2*i-N] and aReadr[2*i-N+1]. Whichever key is smaller, the -** aTree element is set to the index of it. -** -** For the purposes of this comparison, EOF is considered greater than any -** other key value. If the keys are equal (only possible with two EOF -** values), it doesn't matter which index is stored. -** -** The (N/4) elements of aTree[] that precede the final (N/2) described -** above contains the index of the smallest of each block of 4 PmaReaders -** And so on. So that aTree[1] contains the index of the PmaReader that -** currently points to the smallest key value. aTree[0] is unused. -** -** Example: -** -** aReadr[0] -> Banana -** aReadr[1] -> Feijoa -** aReadr[2] -> Elderberry -** aReadr[3] -> Currant -** aReadr[4] -> Grapefruit -** aReadr[5] -> Apple -** aReadr[6] -> Durian -** aReadr[7] -> EOF -** -** aTree[] = { X, 5 0, 5 0, 3, 5, 6 } -** -** The current element is "Apple" (the value of the key indicated by -** PmaReader 5). When the Next() operation is invoked, PmaReader 5 will -** be advanced to the next key in its segment. Say the next key is -** "Eggplant": -** -** aReadr[5] -> Eggplant -** -** The contents of aTree[] are updated first by comparing the new PmaReader -** 5 key to the current key of PmaReader 4 (still "Grapefruit"). The PmaReader -** 5 value is still smaller, so aTree[6] is set to 5. And so on up the tree. -** The value of PmaReader 6 - "Durian" - is now smaller than that of PmaReader -** 5, so aTree[3] is set to 6. Key 0 is smaller than key 6 (Bananafile2. And instead of using a -** background thread to prepare data for the PmaReader, with a single -** threaded IncrMerger the allocate part of pTask->file2 is "refilled" with -** keys from pMerger by the calling thread whenever the PmaReader runs out -** of data. - */ -type TIncrMerger1 = struct { - F__ccgo_align [0]uint32 - FpTask uintptr - FpMerger uintptr - FiStartOff Ti64 - FmxSz int32 - FbEof int32 - FbUseThread int32 - F__ccgo_align6 [4]byte - FaFile [2]TSorterFile -} - -type IncrMerger1 = TIncrMerger1 - -/* -** An instance of this object is used for writing a PMA. -** -** The PMA is written one record at a time. Each record is of an arbitrary -** size. But I/O is more efficient if it occurs in page-sized blocks where -** each block is aligned on a page boundary. This object caches writes to -** the PMA so that aligned, page-size blocks are written. - */ -type TPmaWriter1 = struct { - F__ccgo_align [0]uint32 - FeFWErr int32 - FaBuffer uintptr - FnBuffer int32 - FiBufStart int32 - FiBufEnd int32 - F__ccgo_align5 [4]byte - FiWriteOff Ti64 - FpFd uintptr - F__ccgo_pad7 [4]byte -} - -type PmaWriter1 = TPmaWriter1 - -/* -** This object is the header on a single record while that record is being -** held in memory and prior to being written out as part of a PMA. -** -** How the linked list is connected depends on how memory is being managed -** by this module. If using a separate allocation for each in-memory record -** (VdbeSorter.list.aMemory==0), then the list is always connected using the -** SorterRecord.u.pNext pointers. -** -** Or, if using the single large allocation method (VdbeSorter.list.aMemory!=0), -** then while records are being accumulated the list is linked using the -** SorterRecord.u.iNext offset. This is because the aMemory[] array may -** be sqlite3Realloc()ed while records are being accumulated. Once the VM -** has finished passing records to the sorter, or when the in-memory buffer -** is full, the list is sorted. As part of the sorting process, it is -** converted to use the SorterRecord.u.pNext pointers. See function -** vdbeSorterSort() for details. - */ -type TSorterRecord1 = struct { - FnVal int32 - Fu struct { - FiNext [0]int32 - FpNext uintptr - } -} - -type SorterRecord1 = TSorterRecord1 - // C documentation // // /* @@ -151417,7 +144392,7 @@ func _vdbeSorterMapFile(tls *libc.TLS, pTask uintptr, pFile uintptr, pp uintptr) rc = SQLITE_OK if (*TSorterFile)(unsafe.Pointer(pFile)).FiEof <= int64((*Tsqlite3)(unsafe.Pointer((*TVdbeSorter)(unsafe.Pointer((*TSortSubtask)(unsafe.Pointer(pTask)).FpSorter)).Fdb)).FnMaxSorterMmap) { pFd = (*TSorterFile)(unsafe.Pointer(pFile)).FpFd - if (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { rc = _sqlite3OsFetch(tls, pFd, 0, int32((*TSorterFile)(unsafe.Pointer(pFile)).FiEof), pp) } } @@ -151743,8 +144718,8 @@ var _aLen = [10]Tu8{ // ** SQLITE_OK is returned if successful, or an SQLite error code otherwise. // */ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintptr) (r int32) { - var i, nWorker, pgsz, rc, sz, szKeyInfo, v2, v5 int32 - var mxCache Ti64 + var i, nWorker, pgsz, rc, szKeyInfo, v2, v5 int32 + var mxCache, sz Ti64 var pBt, pKeyInfo, pSorter, pTask, v1 uintptr var szPma Tu32 var v4 int64 @@ -151758,9 +144733,9 @@ func _sqlite3VdbeSorterInit(tls *libc.TLS, db uintptr, nField int32, pCsr uintpt } /* Do not allow the total number of threads (main thread + all workers) ** to exceed the maximum merge count */ - szKeyInfo = int32(uint32(24) + uint32(int32((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)-libc.Int32FromInt32(1))*uint32(4)) - sz = int32(uint32(152) + uint32(nWorker)*uint32(80)) - pSorter = _sqlite3DbMallocZero(tls, db, uint64(sz+szKeyInfo)) + szKeyInfo = int32(uint32(libc.UintptrFromInt32(0)+20) + uint32((*TKeyInfo)(unsafe.Pointer((*TVdbeCursor)(unsafe.Pointer(pCsr)).FpKeyInfo)).FnKeyField)*libc.Uint32FromInt64(4)) + sz = int64(uint32(libc.UintptrFromInt32(0)+72) + uint32(nWorker+libc.Int32FromInt32(1))*libc.Uint32FromInt64(80)) + pSorter = _sqlite3DbMallocZero(tls, db, uint64(sz+int64(szKeyInfo))) *(*uintptr)(unsafe.Pointer(pCsr + 36)) = pSorter if pSorter == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -151908,8 +144883,8 @@ func _vdbeSorterJoinThread(tls *libc.TLS, pTask uintptr) (r int32) { // /* // ** Launch a background thread to run xTask(pIn). // */ -func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, xTask uintptr, pIn uintptr) (r int32) { - return _sqlite3ThreadCreate(tls, pTask, xTask, pIn) +func _vdbeSorterCreateThread(tls *libc.TLS, pTask uintptr, __ccgo_fp_xTask uintptr, pIn uintptr) (r int32) { + return _sqlite3ThreadCreate(tls, pTask, __ccgo_fp_xTask, pIn) } // C documentation @@ -151958,14 +144933,15 @@ func _vdbeSorterJoinAll(tls *libc.TLS, pSorter uintptr, rcin int32) (r int32) { // ** nReader may not exceed SORTER_MAX_MERGE_COUNT even after rounding up. // */ func _vdbeMergeEngineNew(tls *libc.TLS, nReader int32) (r uintptr) { - var N, nByte int32 + var N int32 + var nByte Ti64 var pNew, v1 uintptr _, _, _, _ = N, nByte, pNew, v1 N = int32(2) /* Pointer to allocated object to return */ for N < nReader { N += N } - nByte = int32(uint32(16) + uint32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(56))) + nByte = int64(uint32(16) + uint32(N)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(56))) if _sqlite3FaultSim(tls, int32(100)) != 0 { v1 = uintptr(0) } else { @@ -152103,7 +145079,7 @@ func _vdbeSorterExtendFile(tls *libc.TLS, db uintptr, pFd uintptr, _nByte Ti64) *(*Ti64)(unsafe.Pointer(bp)) = _nByte var _ /* chunksize at bp+12 */ int32 var _ /* p at bp+8 */ uintptr - if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { + if *(*Ti64)(unsafe.Pointer(bp)) <= int64((*Tsqlite3)(unsafe.Pointer(db)).FnMaxSorterMmap) && (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pFd)).FpMethods)).FiVersion >= int32(3) { *(*uintptr)(unsafe.Pointer(bp + 8)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 12)) = libc.Int32FromInt32(4) * libc.Int32FromInt32(1024) _sqlite3OsFileControlHint(tls, pFd, int32(SQLITE_FCNTL_CHUNK_SIZE), bp+12) @@ -152257,6 +145233,9 @@ func _vdbeSorterSort(tls *libc.TLS, pTask uintptr, pList uintptr) (r int32) { break } p = _vdbeSorterMerge(tls, pTask, p, (*(*[64]uintptr)(unsafe.Pointer(bp)))[i]) + /* ,--Each aSlot[] holds twice as much as the previous. So we cannot use + ** | up all 64 aSlots[] with only a 64-bit address space. + ** v */ (*(*[64]uintptr)(unsafe.Pointer(bp)))[i] = uintptr(0) goto _1 _1: @@ -153756,61 +146735,6 @@ type TFileChunk = struct { type FileChunk = TFileChunk -/* -** The rollback journal is composed of a linked list of these structures. -** -** The zChunk array is always at least 8 bytes in size - usually much more. -** Its actual size is stored in the MemJournal.nChunkSize variable. - */ -type TFileChunk1 = struct { - FpNext uintptr - FzChunk [8]Tu8 -} - -type FileChunk1 = TFileChunk1 - -/* -** By default, allocate this many bytes of memory for each FileChunk object. - */ - -/* -** For chunk size nChunkSize, return the number of bytes that should -** be allocated for each FileChunk structure. - */ - -/* -** An instance of this object serves as a cursor into the rollback journal. -** The cursor can be either for reading or writing. - */ -type TFilePoint1 = struct { - F__ccgo_align [0]uint32 - FiOffset Tsqlite3_int64 - FpChunk uintptr - F__ccgo_pad2 [4]byte -} - -type FilePoint1 = TFilePoint1 - -/* -** This structure is a subclass of sqlite3_file. Each open memory-journal -** is an instance of this class. - */ -type TMemJournal1 = struct { - F__ccgo_align [0]uint32 - FpMethod uintptr - FnChunkSize int32 - FnSpill int32 - FpFirst uintptr - Fendpoint TFilePoint - Freadpoint TFilePoint - Fflags int32 - FpVfs uintptr - FzJournal uintptr - F__ccgo_pad9 [4]byte -} - -type MemJournal1 = TMemJournal1 - // C documentation // // /* @@ -154107,7 +147031,7 @@ func _memjrnlFileSize(tls *libc.TLS, pJfd uintptr, pSize uintptr) (r int32) { // /* // ** Table of methods for MemJournal sqlite3_file object. // */ -var _MemJournalMethods = Tsqlite3_io_methods1{ +var _MemJournalMethods = Tsqlite3_io_methods{ FiVersion: int32(1), } @@ -154810,25 +147734,25 @@ func _extendFJMatch(tls *libc.TLS, pParse uintptr, ppList uintptr, pMatch uintpt func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uintptr) (r int32) { var zLegacy uintptr _ = zLegacy - if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+7960, int32(7)) != 0 { + if Xsqlite3_strnicmp(tls, zTab, __ccgo_ts+8047, int32(7)) != 0 { return 0 } zLegacy = (*TTable)(unsafe.Pointer(pTab)).FzName - if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+7968+7) == 0 { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7987+7) == 0 { + if libc.Xstrcmp(tls, zLegacy+uintptr(7), __ccgo_ts+8055+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8074+7) == 0 { return int32(1) } if zDb == uintptr(0) { return 0 } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7456+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+7542+7) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8006+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8093+7) == 0 { return int32(1) } } else { - if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8006+7) == 0 { + if _sqlite3StrICmp(tls, zTab+uintptr(7), __ccgo_ts+8093+7) == 0 { return int32(1) } } @@ -154867,23 +147791,22 @@ func _isValidSchemaTableName(tls *libc.TLS, zTab uintptr, pTab uintptr, zDb uint func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRight uintptr, pNC uintptr, pExpr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v5 int32 - var db, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10 uintptr - var hCol, hCol1 Tu8 - var v7, v8 uint32 + var cnt, cntTab, eNewExprOp, hit, i, iCol, j, nSubquery, op, v4 int32 + var db, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v8 uintptr + var v5, v6 uint32 var _ /* bRowid at bp+4 */ int32 var _ /* pFJMatch at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hCol, hCol1, hit, i, iCol, j, nSubquery, op, pCol, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v10, v5, v7, v8 /* Loop counters */ - cnt = 0 /* Number of matching column names */ - cntTab = 0 /* Number of potential "rowid" matches */ - nSubquery = 0 /* How many levels of subquery */ - db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ - pMatch = uintptr(0) /* The matching pSrcList item */ - pTopNC = pNC /* First namecontext in the list */ - pSchema = uintptr(0) /* Schema of the expression */ - eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ - pTab = uintptr(0) /* A column of pTab */ - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = cnt, cntTab, db, eNewExprOp, hit, i, iCol, j, nSubquery, op, pEList, pItem, pMatch, pOrig, pSchema, pSel, pSrcList, pTab, pTopNC, pUpsert, zAs, zCol, zErr, v4, v5, v6, v8 /* Loop counters */ + cnt = 0 /* Number of matching column names */ + cntTab = 0 /* Number of potential "rowid" matches */ + nSubquery = 0 /* How many levels of subquery */ + db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Use for looping over pSrcList items */ + pMatch = uintptr(0) /* The matching pSrcList item */ + pTopNC = pNC /* First namecontext in the list */ + pSchema = uintptr(0) /* Schema of the expression */ + eNewExprOp = int32(TK_COLUMN) /* New value for pExpr->op on success */ + pTab = uintptr(0) /* Table holding the row */ + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Matches for FULL JOIN .. USING */ zCol = *(*uintptr)(unsafe.Pointer(pRight + 8)) /* the name context cannot be NULL. */ /* The Z in X.Y.Z cannot be NULL */ @@ -154915,7 +147838,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ; i++ } - if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+8020, zDb) == 0 { + if i == (*Tsqlite3)(unsafe.Pointer(db)).FnDb && _sqlite3StrICmp(tls, __ccgo_ts+8107, zDb) == 0 { /* This branch is taken when the main database has been renamed ** using SQLITE_DBCONFIG_MAINDBNAME. */ pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema @@ -155009,7 +147932,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if (*TTable)(unsafe.Pointer(pTab)).FpSchema != pSchema { goto _2 } - if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+8025) != 0 { + if pSchema == uintptr(0) && libc.Xstrcmp(tls, zDb, __ccgo_ts+8112) != 0 { goto _2 } } @@ -155031,57 +147954,44 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh _sqlite3RenameTokenRemap(tls, pParse, uintptr(0), pExpr+44) } } - hCol = _sqlite3StrIHash(tls, zCol) - j = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if cnt > 0 { - if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 40)), zCol) < 0 { - /* Two or more tables have the same column name which is - ** not joined by USING. This is an error. Signal as much - ** by clearing pFJMatch and letting cnt go above 1. */ - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + j = _sqlite3ColumnIndex(tls, pTab, zCol) + if j >= 0 { + if cnt > 0 { + if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pItem + 40)), zCol) < 0 { + /* Two or more tables have the same column name which is + ** not joined by USING. This is an error. Signal as much + ** by clearing pFJMatch and letting cnt go above 1. */ + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) + } else { + if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { + /* An INNER or LEFT JOIN. Use the left-most table */ + goto _2 } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { - /* An INNER or LEFT JOIN. Use the left-most table */ - goto _4 + if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { + /* A RIGHT JOIN. Use the right-most table */ + cnt = 0 + _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) + *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } else { - if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) == 0 { - /* A RIGHT JOIN. Use the right-most table */ - cnt = 0 - _sqlite3ExprListDelete(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - } else { - /* For a FULL JOIN, we must construct a coalesce() func */ - _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) - } + /* For a FULL JOIN, we must construct a coalesce() func */ + _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) } } } - cnt++ - pMatch = pItem - /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - v5 = -int32(1) - } else { - v5 = int32(int16(j)) - } - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v5) - if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4000>>14) != 0 { - _sqlite3SrcItemColumnUsed(tls, pItem, j) - } - break } - goto _4 - _4: - ; - j++ - pCol += 12 + cnt++ + pMatch = pItem + /* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */ + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + v4 = -int32(1) + } else { + v4 = int32(int16(j)) + } + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) + if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4000>>14) != 0 { + _sqlite3SrcItemColumnUsed(tls, pItem, j) + } } if 0 == cnt && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { /* pTab is a potential ROWID match. Keep track of it and match @@ -155126,11 +148036,11 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } } else { - if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8027, zTab) == 0 { + if op != int32(TK_DELETE) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8114, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(1) pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } else { - if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8031, zTab) == 0 { + if op != int32(TK_INSERT) && zTab != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8118, zTab) == 0 { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = 0 pTab = (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab } @@ -155139,36 +148049,25 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_UUpsert) != 0 && zTab != uintptr(0) { pUpsert = *(*uintptr)(unsafe.Pointer(pNC + 8)) - if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8035, zTab) == 0 { + if pUpsert != 0 && _sqlite3StrICmp(tls, __ccgo_ts+8122, zTab) == 0 { pTab = (*(*TSrcItem)(unsafe.Pointer((*TUpsert)(unsafe.Pointer(pUpsert)).FpUpsertSrc + 8))).FpSTab (*TExpr)(unsafe.Pointer(pExpr)).FiTable = int32(EXCLUDED_TABLE_NUMBER) } } if pTab != 0 { - hCol1 = _sqlite3StrIHash(tls, zCol) pSchema = (*TTable)(unsafe.Pointer(pTab)).FpSchema cntTab++ - iCol = 0 - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + iCol = _sqlite3ColumnIndex(tls, pTab, zCol) + if iCol >= 0 { + if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol { + iCol = -int32(1) } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(hCol1) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - iCol = -int32(1) - } - break + } else { + if _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { + iCol = -int32(1) + } else { + iCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } - goto _6 - _6: - ; - iCol++ - pCol += 12 - } - if iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) && _sqlite3IsRowid(tls, zCol) != 0 && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_NoVisibleRowid) == uint32(0) { - /* IMP: R-51414-32910 */ - iCol = -int32(1) } if iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { cnt++ @@ -155197,18 +148096,18 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } else { if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 { if iCol >= int32(32) { - v7 = uint32(0xffffffff) + v5 = uint32(0xffffffff) } else { - v7 = libc.Uint32FromInt32(1) << iCol + v5 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 152)) |= v7 + *(*Tu32)(unsafe.Pointer(pParse + 180)) |= v5 } else { if iCol >= int32(32) { - v8 = uint32(0xffffffff) + v6 = uint32(0xffffffff) } else { - v8 = libc.Uint32FromInt32(1) << iCol + v6 = libc.Uint32FromInt32(1) << iCol } - *(*Tu32)(unsafe.Pointer(pParse + 156)) |= v8 + *(*Tu32)(unsafe.Pointer(pParse + 184)) |= v6 } } } @@ -155255,15 +148154,15 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if int32(uint32(*(*uint16)(unsafe.Pointer(pEList + 8 + uintptr(j)*20 + 8 + 4))&0x3>>0)) == ENAME_NAME && Xsqlite3_stricmp(tls, zAs, zCol) == 0 { pOrig = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(j)*20))).FpExpr if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 && (*TExpr)(unsafe.Pointer(pOrig)).Fflags&uint32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8044, libc.VaList(bp+16, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8131, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } if (*TExpr)(unsafe.Pointer(pOrig)).Fflags&uint32(libc.Int32FromInt32(EP_Win)) != uint32(0) && ((*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 || pNC != pTopNC) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8075, libc.VaList(bp+16, zAs)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8162, libc.VaList(bp+16, zAs)) return int32(WRC_Abort) } if _sqlite3ExprVectorSize(tls, pOrig) != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return int32(WRC_Abort) } _resolveAlias(tls, pParse, pEList, j, pExpr, nSubquery) @@ -155274,8 +148173,8 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } goto lookupname_end } - goto _9 - _9: + goto _7 + _7: ; j++ } @@ -155315,7 +148214,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh ** a huge amount of legacy SQL that uses it. So for now, we just ** issue a warning. */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+8130, libc.VaList(bp+16, zCol)) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+8217, libc.VaList(bp+16, zCol)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_STRING) libc.Xmemset(tls, pExpr+44, 0, uint32(8)) return int32(WRC_Prune) @@ -155335,7 +148234,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh if *(*uintptr)(unsafe.Pointer(bp)) != 0 { if (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnExpr == cnt-int32(1) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Leaf)) != uint32(0) { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Leaf)) } else { _sqlite3ExprDelete(tls, db, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = uintptr(0) @@ -155344,7 +148243,7 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } _extendFJMatch(tls, pParse, bp, pMatch, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_FUNCTION) - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8165 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 8252 *(*uintptr)(unsafe.Pointer(pExpr + 20)) = *(*uintptr)(unsafe.Pointer(bp)) cnt = int32(1) goto lookupname_end @@ -155354,26 +148253,26 @@ func _lookupName(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, pRigh } } if cnt == 0 { - v10 = __ccgo_ts + 8174 + v8 = __ccgo_ts + 8261 } else { - v10 = __ccgo_ts + 8189 + v8 = __ccgo_ts + 8276 } - zErr = v10 + zErr = v8 if zDb != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8211, libc.VaList(bp+16, zErr, zDb, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8298, libc.VaList(bp+16, zErr, zDb, zTab, zCol)) } else { if zTab != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8224, libc.VaList(bp+16, zErr, zTab, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8311, libc.VaList(bp+16, zErr, zTab, zCol)) } else { if cnt == 0 && (*TExpr)(unsafe.Pointer(pRight)).Fflags&uint32(libc.Int32FromInt32(EP_DblQuoted)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8234, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8321, libc.VaList(bp+16, zErr, zCol)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8295, libc.VaList(bp+16, zErr, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8382, libc.VaList(bp+16, zErr, zCol)) } } } _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) (*TNameContext)(unsafe.Pointer(pTopNC)).FnNcErr++ eNewExprOp = int32(TK_NULL) } @@ -155422,8 +148321,8 @@ lookupname_end: break } pTopNC = (*TNameContext)(unsafe.Pointer(pTopNC)).FpNext - goto _11 - _11: + goto _9 + _9: } return int32(WRC_Prune) } else { @@ -155497,19 +148396,19 @@ func _notValidImpl(tls *libc.TLS, pParse uintptr, pNC uintptr, zMsg uintptr, pEx defer tls.Free(32) var zIn uintptr _ = zIn - zIn = __ccgo_ts + 8302 + zIn = __ccgo_ts + 8389 if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IdxExpr) != 0 { - zIn = __ccgo_ts + 8330 + zIn = __ccgo_ts + 8417 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_IsCheck) != 0 { - zIn = __ccgo_ts + 8348 + zIn = __ccgo_ts + 8435 } else { if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_GenCol) != 0 { - zIn = __ccgo_ts + 8366 + zIn = __ccgo_ts + 8453 } } } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8384, libc.VaList(bp+8, zMsg, zIn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8471, libc.VaList(bp+8, zMsg, zIn)) if pExpr != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } @@ -155535,7 +148434,7 @@ func _exprProbability(tls *libc.TLS, p uintptr) (r int32) { if *(*float64)(unsafe.Pointer(bp)) > float64(1) { return -int32(1) } - return int32(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08)) + return int32(float64(*(*float64)(unsafe.Pointer(bp)) * libc.Float64FromFloat64(1.34217728e+08))) } // C documentation @@ -155681,7 +148580,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } else { pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8404, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8491, uintptr(0), pExpr) } pRight = (*TExpr)(unsafe.Pointer(pExpr)).FpRight if int32((*TExpr)(unsafe.Pointer(pRight)).Fop) == int32(TK_ID) { @@ -155736,7 +148635,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if n == int32(2) { (*TExpr)(unsafe.Pointer(pExpr)).FiTable = _exprProbability(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + 1*20))).FpExpr) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8421, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8508, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } } else { @@ -155760,7 +148659,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { auth = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_FUNCTION), uintptr(0), (*TFuncDef)(unsafe.Pointer(pDef)).FzName, uintptr(0)) if auth != SQLITE_OK { if auth == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8485, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8572, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) @@ -155774,13 +148673,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** an EP_SubtArg expression. In this case subtypes are required as ** the function may return a value with a subtype back to its ** caller using sqlite3_result_value(). */ - if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_SubtArg) != uint32(0) { + if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_SUBTYPE) != 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&libc.Uint32FromUint32(EP_SubtArg) != uint32(0) { ii = 0 for { if !(ii < n) { break } - *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*20))).FpExpr + 4)) |= uint32(EP_SubtArg) + *(*Tu32)(unsafe.Pointer((*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(ii)*20))).FpExpr + 4)) |= libc.Uint32FromUint32(EP_SubtArg) goto _7 _7: ; @@ -155800,16 +148699,13 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { ** sqlite_version() that might change over time cannot be used ** in an index or generated column. Curiously, they can be used ** in a CHECK constraint. SQLServer, MySQL, and PostgreSQL all - ** all this. */ + ** allow this. */ if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8521, uintptr(0), pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8608, uintptr(0), pExpr) } } else { /* Must fit in 8 bits */ (*TExpr)(unsafe.Pointer(pExpr)).Fop2 = uint8((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & int32(NC_SelfRef)) - if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { - *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FromDDL)) - } } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INTERNAL) != uint32(0) && int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmDbFlags&uint32(DBFLAG_InternalFunc) == uint32(0) { /* Internal-use-only functions are disallowed unless the @@ -155820,35 +148716,38 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { pDef = uintptr(0) } else { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(libc.Int32FromInt32(SQLITE_FUNC_DIRECT)|libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) != uint32(0) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_FromDDL) != 0 { + *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FromDDL)) + } _sqlite3ExprFunctionUsable(tls, pParse, pExpr, pDef) } } } if 0 == libc.BoolInt32(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME)) { if pDef != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FxValue == uintptr(0) && pWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8549, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8636, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowAgg) == 0 || is_agg != 0 && (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 && !(pWin != 0) || is_agg != 0 && pWin != 0 && (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_AllowWin) == 0 { if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 || pWin != 0 { - zType = __ccgo_ts + 8592 + zType = __ccgo_ts + 8679 } else { - zType = __ccgo_ts + 8599 + zType = __ccgo_ts + 8686 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8609, libc.VaList(bp+8, zType, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8696, libc.VaList(bp+8, zType, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ is_agg = 0 } else { if no_such_func != 0 && int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8637, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8724, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if wrong_num_args != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8659, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8746, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8703, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8790, libc.VaList(bp+8, pExpr)) (*TNameContext)(unsafe.Pointer(pNC)).FnNcErr++ } else { if is_agg == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 { @@ -155933,7 +148832,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { nRef = (*TNameContext)(unsafe.Pointer(pNC)).FnRef if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&int32(NC_SelfRef) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8751, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8838, pExpr, pExpr) } else { _sqlite3WalkSelect(tls, pWalker, *(*uintptr)(unsafe.Pointer(pExpr + 20))) } @@ -155945,7 +148844,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { } case int32(TK_VARIABLE): if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_IsCheck)|libc.Int32FromInt32(NC_PartIdx)|libc.Int32FromInt32(NC_IdxExpr)|libc.Int32FromInt32(NC_GenCol)) != 0 { - _notValidImpl(tls, pParse, pNC, __ccgo_ts+8762, pExpr, pExpr) + _notValidImpl(tls, pParse, pNC, __ccgo_ts+8849, pExpr, pExpr) } case int32(TK_IS): fallthrough @@ -155991,7 +148890,7 @@ func _resolveExprStep(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { nRight = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) } if nLeft != nRight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } break @@ -156116,7 +149015,7 @@ func _resolveOrderByTermToExprList(tls *libc.TLS, pParse uintptr, pSelect uintpt func _resolveOutOfRangeError(tls *libc.TLS, pParse uintptr, zType uintptr, i int32, mx int32, pError uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8773, libc.VaList(bp+8, i, zType, mx)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8860, libc.VaList(bp+8, i, zType, mx)) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pError) } @@ -156151,7 +149050,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8829, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8916, 0) return int32(1) } i = 0 @@ -156189,7 +149088,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r } if _sqlite3ExprIsInteger(tls, pE, bp, uintptr(0)) != 0 { if *(*int32)(unsafe.Pointer(bp)) <= 0 || *(*int32)(unsafe.Pointer(bp)) > (*TExprList)(unsafe.Pointer(pEList)).FnExpr { - _resolveOutOfRangeError(tls, pParse, __ccgo_ts+8863, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) + _resolveOutOfRangeError(tls, pParse, __ccgo_ts+8950, i+int32(1), (*TExprList)(unsafe.Pointer(pEList)).FnExpr, pE) return int32(1) } } else { @@ -156259,7 +149158,7 @@ func _resolveCompoundOrderBy(tls *libc.TLS, pParse uintptr, pSelect uintptr) (r break } if int32(uint32(*(*uint16)(unsafe.Pointer(pOrderBy + 8 + uintptr(i)*20 + 8 + 4))&0x4>>2)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8869, libc.VaList(bp+16, i+int32(1))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8956, libc.VaList(bp+16, i+int32(1))) return int32(1) } goto _3 @@ -156293,7 +149192,7 @@ func _sqlite3ResolveOrderGroupBy(tls *libc.TLS, pParse uintptr, pSelect uintptr, return 0 } if (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8930, libc.VaList(bp+8, zType)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9017, libc.VaList(bp+8, zType)) return int32(1) } pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList @@ -156606,7 +149505,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags |= int32(NC_UEList) if (*TSelect)(unsafe.Pointer(p)).FpHaving != 0 { if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Aggregate) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8961, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9048, 0) return int32(WRC_Abort) } if _sqlite3ResolveExprNames(tls, bp, (*TSelect)(unsafe.Pointer(p)).FpHaving) != 0 { @@ -156673,7 +149572,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** is not detected until much later, and so we need to go ahead and ** resolve those symbols on the incorrect ORDER BY for consistency. */ - if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8863) != 0 { + if (*TSelect)(unsafe.Pointer(p)).FpOrderBy != uintptr(0) && isCompound <= nCompound && _resolveOrderGroupBy(tls, bp, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8950) != 0 { return int32(WRC_Abort) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -156684,7 +149583,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { ** the GROUP BY clause does not contain aggregate functions. */ if pGroupBy != 0 { - if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+9000) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { + if _resolveOrderGroupBy(tls, bp, p, pGroupBy, __ccgo_ts+9087) != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(WRC_Abort) } i = 0 @@ -156694,7 +149593,7 @@ func _resolveSelectStep(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { break } if (*TExpr)(unsafe.Pointer((*TExprList_item)(unsafe.Pointer(pItem2)).FpExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Agg)) != uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9006, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9093, 0) return int32(WRC_Abort) } goto _6 @@ -156796,12 +149695,12 @@ func _sqlite3ResolveExprNames(tls *libc.TLS, pNC uintptr, pExpr uintptr) (r int3 (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback = v1 (*(*TWalker)(unsafe.Pointer(bp))).FxSelectCallback2 = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 24)) = pNC - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { return int32(SQLITE_ERROR) } _sqlite3WalkExprNN(tls, bp, pExpr) - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) *(*int32)(unsafe.Pointer(pNC + 24)) |= savedHasAgg return libc.BoolInt32((*TNameContext)(unsafe.Pointer(pNC)).FnNcErr > 0 || (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnErr > 0) @@ -156844,12 +149743,12 @@ func _sqlite3ResolveExprListNames(tls *libc.TLS, pNC uintptr, pList uintptr) (r if pExpr == uintptr(0) { goto _1 } - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) += (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if _sqlite3ExprCheckHeight(tls, (*(*TWalker)(unsafe.Pointer(bp))).FpParse, (*TParse)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse)).FnHeight) != 0 { return int32(SQLITE_ERROR) } _sqlite3WalkExprNN(tls, bp, pExpr) - *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 232)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight + *(*int32)(unsafe.Pointer((*(*TWalker)(unsafe.Pointer(bp))).FpParse + 228)) -= (*TExpr)(unsafe.Pointer(pExpr)).FnHeight if (*TNameContext)(unsafe.Pointer(pNC)).FncFlags&(libc.Int32FromInt32(NC_HasAgg)|libc.Int32FromInt32(NC_MinMaxAgg)|libc.Int32FromInt32(NC_HasWin)|libc.Int32FromInt32(NC_OrderAgg)) != 0 { *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32((*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_HasWin))) savedHasAgg |= (*TNameContext)(unsafe.Pointer(pNC)).FncFlags & (libc.Int32FromInt32(NC_HasAgg) | libc.Int32FromInt32(NC_MinMaxAgg) | libc.Int32FromInt32(NC_HasWin) | libc.Int32FromInt32(NC_OrderAgg)) @@ -156916,33 +149815,35 @@ func _sqlite3ResolveSelectNames(tls *libc.TLS, pParse uintptr, p uintptr, pOuter func _sqlite3ResolveSelfReference(tls *libc.TLS, pParse uintptr, pTab uintptr, type1 int32, pExpr uintptr, pList uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) + var pSrc uintptr var rc, v1 int32 - var _ /* sNC at bp+56 */ TNameContext - var _ /* sSrc at bp+0 */ TSrcList - _, _ = rc, v1 - libc.Xmemset(tls, bp+56, 0, uint32(36)) - libc.Xmemset(tls, bp, 0, uint32(56)) + var _ /* sNC at bp+0 */ TNameContext + var _ /* srcSpace at bp+36 */ [56]Tu8 + _, _, _ = pSrc, rc, v1 /* Memory space for the fake SrcList */ + libc.Xmemset(tls, bp, 0, uint32(36)) + pSrc = bp + 36 + libc.Xmemset(tls, pSrc, 0, uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48)) if pTab != 0 { - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).FiCursor = -int32(1) + (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).FiCursor = -int32(1) if (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + 1*16))).FpSchema { /* Cause EP_FromDDL to be set on TK_FUNCTION nodes of non-TEMP ** schema elements */ type1 |= int32(NC_FromDDL) } } - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FpParse = pParse - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FpSrcList = bp - (*(*TNameContext)(unsafe.Pointer(bp + 56))).FncFlags = type1 | int32(NC_IsDDL) - v1 = _sqlite3ResolveExprNames(tls, bp+56, pExpr) + (*(*TNameContext)(unsafe.Pointer(bp))).FpParse = pParse + (*(*TNameContext)(unsafe.Pointer(bp))).FpSrcList = pSrc + (*(*TNameContext)(unsafe.Pointer(bp))).FncFlags = type1 | int32(NC_IsDDL) + v1 = _sqlite3ResolveExprNames(tls, bp, pExpr) rc = v1 if v1 != SQLITE_OK { return rc } if pList != 0 { - rc = _sqlite3ResolveExprListNames(tls, bp+56, pList) + rc = _sqlite3ResolveExprListNames(tls, bp, pList) } return rc } @@ -156994,7 +149895,7 @@ func _sqlite3ExprAffinity(tls *libc.TLS, pExpr uintptr) (r int8) { if op == int32(TK_SELECT_COLUMN) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)))).FpEList + 8 + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*20))).FpExpr) } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(SQLITE_AFF_DEFER) { return _sqlite3ExprAffinity(tls, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr) } if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Skip)|libc.Int32FromInt32(EP_IfNullRow)) != uint32(0) { @@ -157202,7 +150103,7 @@ func _sqlite3ExprCollSeq(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r uintpt p = (*TExpr)(unsafe.Pointer(p)).FpLeft continue } - if op == int32(TK_VECTOR) { + if op == int32(TK_VECTOR) || op == int32(TK_FUNCTION) && int32((*TExpr)(unsafe.Pointer(p)).FaffExpr) == int32(SQLITE_AFF_DEFER) { p = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(p + 20)) + 8))).FpExpr continue } @@ -157677,7 +150578,7 @@ func _codeVectorCompare(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32 return } if nLeft != _sqlite3ExprVectorSize(tls, pRight) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) return } if int32(op) == int32(TK_LE) { @@ -157756,7 +150657,7 @@ func _sqlite3ExprCheckHeight(tls *libc.TLS, pParse uintptr, nHeight int32) (r in rc = SQLITE_OK mxHeight = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 3*4)) if nHeight > mxHeight { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9065, libc.VaList(bp+8, mxHeight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9152, libc.VaList(bp+8, mxHeight)) rc = int32(SQLITE_ERROR) } return rc @@ -158101,11 +151002,11 @@ func _sqlite3ExprListToValues(tls *libc.TLS, pParse uintptr, nElem int32, pEList } if nExprElem != nElem { if nExprElem > int32(1) { - v2 = __ccgo_ts + 9113 + v2 = __ccgo_ts + 9200 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9115, libc.VaList(bp+8, nExprElem, v2, nElem)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9202, libc.VaList(bp+8, nExprElem, v2, nElem)) break } pSel = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(pExpr + 20)), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(SF_Values), uintptr(0)) @@ -158151,10 +151052,10 @@ func _sqlite3ExprAnd(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRight uintpt return pLeft } else { f = (*TExpr)(unsafe.Pointer(pLeft)).Fflags | (*TExpr)(unsafe.Pointer(pRight)).Fflags - if f&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { + if f&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)|libc.Int32FromInt32(EP_IsFalse)|libc.Int32FromInt32(EP_HasFunc)) == uint32(EP_IsFalse) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { _sqlite3ExprDeferredDelete(tls, pParse, pLeft) _sqlite3ExprDeferredDelete(tls, pParse, pRight) - return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1793) + return _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820) } else { return _sqlite3PExpr(tls, pParse, int32(TK_AND), pLeft, pRight) } @@ -158182,7 +151083,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u } *(*int32)(unsafe.Pointer(pNew + 36)) = int32((*TToken)(unsafe.Pointer(pToken)).Fz) - int32((*TParse)(unsafe.Pointer(pParse)).FzTail) if pList != 0 && (*TExprList)(unsafe.Pointer(pList)).FnExpr > *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 6*4)) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9159, libc.VaList(bp+8, pToken)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9246, libc.VaList(bp+8, pToken)) } *(*uintptr)(unsafe.Pointer(pNew + 20)) = pList *(*Tu32)(unsafe.Pointer(pNew + 4)) |= uint32(libc.Int32FromInt32(EP_HasFunc)) @@ -158202,7 +151103,7 @@ func _sqlite3ExprFunction(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u func _sqlite3ExprOrderByAggregateError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9193, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9280, libc.VaList(bp+8, p)) } // C documentation @@ -158273,7 +151174,7 @@ func _sqlite3ExprFunctionUsable(tls *libc.TLS, pParse uintptr, pExpr uintptr, pD ** SQLITE_DBCONFIG_TRUSTED_SCHEMA is off (meaning ** that the schema is possibly tainted). */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9243, libc.VaList(bp+8, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9330, libc.VaList(bp+8, pExpr)) } } } @@ -158311,7 +151212,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) if int32(*(*int8)(unsafe.Pointer(z + 1))) == 0 { /* Wildcard of the form "?". Assign the next variable number */ - v2 = pParse + 220 + v2 = pParse + 216 *(*TynVar)(unsafe.Pointer(v2))++ v1 = *(*TynVar)(unsafe.Pointer(v2)) x = v1 @@ -158325,7 +151226,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n bOk = libc.BoolInt32(0 == _sqlite3Atoi64(tls, z+1, bp, int32(n-uint32(1)), uint8(SQLITE_UTF8))) } if bOk == 0 || *(*Ti64)(unsafe.Pointer(bp)) < int64(1) || *(*Ti64)(unsafe.Pointer(bp)) > int64(*(*int32)(unsafe.Pointer(db + 120 + 9*4))) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9263, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 120 + 9*4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9350, libc.VaList(bp+16, *(*int32)(unsafe.Pointer(db + 120 + 9*4)))) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) return } @@ -158345,7 +151246,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n */ x = int16(_sqlite3VListNameToNum(tls, (*TParse)(unsafe.Pointer(pParse)).FpVList, z, int32(n))) if int32(x) == 0 { - v4 = pParse + 220 + v4 = pParse + 216 *(*TynVar)(unsafe.Pointer(v4))++ v3 = *(*TynVar)(unsafe.Pointer(v4)) x = v3 @@ -158358,7 +151259,7 @@ func _sqlite3ExprAssignVarNumber(tls *libc.TLS, pParse uintptr, pExpr uintptr, n } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = x if int32(x) > *(*int32)(unsafe.Pointer(db + 120 + 9*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9306, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9393, 0) _sqlite3RecordErrorOffsetOfExpr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) } } @@ -158594,12 +151495,6 @@ type TEdupBuf = struct { type EdupBuf = TEdupBuf -type TEdupBuf1 = struct { - FzAlloc uintptr -} - -type EdupBuf1 = TEdupBuf1 - // C documentation // // /* @@ -158741,7 +151636,7 @@ func _sqlite3WithDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { _, _, _ = i, nByte, pRet pRet = uintptr(0) if p != 0 { - nByte = int64(uint32(36) + uint32(24)*uint32((*TWith)(unsafe.Pointer(p)).FnCte-libc.Int32FromInt32(1))) + nByte = int64(uint32(libc.UintptrFromInt32(0)+12) + uint32((*TWith)(unsafe.Pointer(p)).FnCte)*libc.Uint32FromInt64(24)) pRet = _sqlite3DbMallocZero(tls, db, uint64(nByte)) if pRet != 0 { (*TWith)(unsafe.Pointer(pRet)).FnCte = (*TWith)(unsafe.Pointer(p)).FnCte @@ -158881,7 +151776,6 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u } (*TExprList_item)(unsafe.Pointer(pItem)).FzEName = _sqlite3DbStrDup(tls, db, (*TExprList_item)(unsafe.Pointer(pOldItem)).FzEName) (*TExprList_item)(unsafe.Pointer(pItem)).Ffg = (*TExprList_item)(unsafe.Pointer(pOldItem)).Ffg - libc.SetBitFieldPtr16Uint32(pItem+8+4, libc.Uint32FromInt32(0), 2, 0x4) (*TExprList_item)(unsafe.Pointer(pItem)).Fu = (*TExprList_item)(unsafe.Pointer(pOldItem)).Fu goto _1 _1: @@ -158902,27 +151796,20 @@ func _sqlite3ExprListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r u // ** called with a NULL argument. // */ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r uintptr) { - var i, nByte int32 - var pNew, pNewItem, pNewSubq, pOldItem, pTab, v4 uintptr - var v1 uint32 - var v2 Tu32 - _, _, _, _, _, _, _, _, _, _ = i, nByte, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v2, v4 + var i int32 + var pNew, pNewItem, pNewSubq, pOldItem, pTab, v3 uintptr + var v1 Tu32 + _, _, _, _, _, _, _, _ = i, pNew, pNewItem, pNewSubq, pOldItem, pTab, v1, v3 if p == uintptr(0) { return uintptr(0) } - if (*TSrcList)(unsafe.Pointer(p)).FnSrc > 0 { - v1 = uint32(48) * uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc-libc.Int32FromInt32(1)) - } else { - v1 = uint32(0) - } - nByte = int32(uint32(56) + v1) - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(nByte)) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc)*libc.Uint32FromInt64(48))) if pNew == uintptr(0) { return uintptr(0) } - v2 = uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc) - (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v2 - (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = int32(v2) + v1 = uint32((*TSrcList)(unsafe.Pointer(p)).FnSrc) + (*TSrcList)(unsafe.Pointer(pNew)).FnAlloc = v1 + (*TSrcList)(unsafe.Pointer(pNew)).FnSrc = int32(v1) i = 0 for { if !(i < (*TSrcList)(unsafe.Pointer(p)).FnSrc) { @@ -158968,9 +151855,9 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui if int32(*(*uint32)(unsafe.Pointer(pNewItem + 12 + 4))&0x200>>9) != 0 { (*TCteUse)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNewItem + 36)))).FnUse++ } - v4 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab - (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v4 - pTab = v4 + v3 = (*TSrcItem)(unsafe.Pointer(pOldItem)).FpSTab + (*TSrcItem)(unsafe.Pointer(pNewItem)).FpSTab = v3 + pTab = v3 if pTab != 0 { (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ } @@ -158980,8 +151867,8 @@ func _sqlite3SrcListDup(tls *libc.TLS, db uintptr, p uintptr, flags int32) (r ui *(*uintptr)(unsafe.Pointer(pNewItem + 40)) = _sqlite3ExprDup(tls, db, *(*uintptr)(unsafe.Pointer(pOldItem + 40)), flags) } (*TSrcItem)(unsafe.Pointer(pNewItem)).FcolUsed = (*TSrcItem)(unsafe.Pointer(pOldItem)).FcolUsed - goto _3 - _3: + goto _2 + _2: ; i++ } @@ -158995,7 +151882,7 @@ func _sqlite3IdListDup(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if p == uintptr(0) { return uintptr(0) } - pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(8)+uint32((*TIdList)(unsafe.Pointer(p)).FnId-libc.Int32FromInt32(1))*uint32(4))) + pNew = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+4)+uint32((*TIdList)(unsafe.Pointer(p)).FnId)*libc.Uint32FromInt64(4))) if pNew == uintptr(0) { return uintptr(0) } @@ -159046,7 +151933,7 @@ func _sqlite3SelectDup(tls *libc.TLS, db uintptr, pDup uintptr, flags int32) (r (*TSelect)(unsafe.Pointer(pNew)).FpLimit = _sqlite3ExprDup(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit, flags) (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & uint32(^libc.Int32FromInt32(SF_UsesEphemeral)) + (*TSelect)(unsafe.Pointer(pNew)).FselFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags & ^libc.Uint32FromInt32(SF_UsesEphemeral) *(*int32)(unsafe.Pointer(pNew + 20)) = -int32(1) *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = (*TSelect)(unsafe.Pointer(p)).FnSelectRow @@ -159127,7 +152014,7 @@ var _zeroItem = TExprList_item{} func _sqlite3ExprListAppendNew(tls *libc.TLS, db uintptr, pExpr uintptr) (r uintptr) { var pItem, pList uintptr _, _ = pItem, pList - pList = _sqlite3DbMallocRawNN(tls, db, uint64(libc.Uint32FromInt64(28)+libc.Uint32FromInt64(20)*libc.Uint32FromInt32(4))) + pList = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+uint32(libc.Int32FromInt32(4))*libc.Uint32FromInt64(20))) if pList == uintptr(0) { _sqlite3ExprDelete(tls, db, pExpr) return uintptr(0) @@ -159145,7 +152032,7 @@ func _sqlite3ExprListAppendGrow(tls *libc.TLS, db uintptr, pList uintptr, pExpr var v1 int32 _, _, _, _ = pItem, pNew, v1, v2 *(*int32)(unsafe.Pointer(pList + 4)) *= int32(2) - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(28)+uint32((*TExprList)(unsafe.Pointer(pList)).FnAlloc-libc.Int32FromInt32(1))*uint32(20))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(libc.UintptrFromInt32(0)+8)+uint32((*TExprList)(unsafe.Pointer(pList)).FnAlloc)*libc.Uint32FromInt64(20))) if pNew == uintptr(0) { _sqlite3ExprListDelete(tls, db, pList) _sqlite3ExprDelete(tls, db, pExpr) @@ -159226,7 +152113,7 @@ func _sqlite3ExprListAppendVector(tls *libc.TLS, pParse uintptr, pList uintptr, n = v2 } if v3 && (*TIdList)(unsafe.Pointer(pColumns)).FnId != v2 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9329, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9416, libc.VaList(bp+8, (*TIdList)(unsafe.Pointer(pColumns)).FnId, n)) goto vector_append_error } i = 0 @@ -159355,7 +152242,7 @@ func _sqlite3ExprListCheckLength(tls *libc.TLS, pParse uintptr, pEList uintptr, _ = mx mx = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 2*4)) if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr > mx { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9359, libc.VaList(bp+8, zObject)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9446, libc.VaList(bp+8, zObject)) } } @@ -159453,10 +152340,10 @@ func _sqlite3SelectWalkFail(tls *libc.TLS, pWalker uintptr, NotUsed uintptr) (r // ** anything else 0 // */ func _sqlite3IsTrueOrFalse(tls *libc.TLS, zIn uintptr) (r Tu32) { - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9382) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9469) == 0 { return uint32(EP_IsTrue) } - if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9387) == 0 { + if _sqlite3StrICmp(tls, zIn, __ccgo_ts+9474) == 0 { return uint32(EP_IsFalse) } return uint32(0) @@ -160134,13 +153021,13 @@ func _sqlite3ExprNeedsNoAffinityChange(tls *libc.TLS, p uintptr, aff int8) (r in // ** Return TRUE if the given string is a row-id column name. // */ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { - if _sqlite3StrICmp(tls, z, __ccgo_ts+9393) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9480) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9401) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9488) == 0 { return int32(1) } - if _sqlite3StrICmp(tls, z, __ccgo_ts+9407) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+9494) == 0 { return int32(1) } return 0 @@ -160155,32 +153042,19 @@ func _sqlite3IsRowid(tls *libc.TLS, z uintptr) (r int32) { // */ func _sqlite3RowidAlias(tls *libc.TLS, pTab uintptr) (r uintptr) { var azOpt [3]uintptr - var iCol, ii int32 - _, _, _ = azOpt, iCol, ii + var ii int32 + _, _ = azOpt, ii azOpt = [3]uintptr{ - 0: __ccgo_ts + 9393, - 1: __ccgo_ts + 9401, - 2: __ccgo_ts + 9407, + 0: __ccgo_ts + 9480, + 1: __ccgo_ts + 9488, + 2: __ccgo_ts + 9494, } ii = 0 for { if !(ii < int32(libc.Uint32FromInt64(12)/libc.Uint32FromInt64(4))) { break } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if Xsqlite3_stricmp(tls, azOpt[ii], (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) == 0 { - break - } - goto _2 - _2: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if _sqlite3ColumnIndex(tls, pTab, azOpt[ii]) < 0 { return azOpt[ii] } goto _1 @@ -160389,7 +153263,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 eType = 0 /* True if RHS must be unique */ v = _sqlite3GetVdbe(tls, pParse) /* Virtual machine being coded */ mustBeUnique = libc.BoolInt32(inFlags&uint32(IN_INDEX_LOOP) != uint32(0)) - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ iTab = v1 @@ -160442,7 +153316,7 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 iAddr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) _sqlite3OpenTable(tls, pParse, iTab, iDb, pTab, int32(OP_OpenRead)) eType = int32(IN_INDEX_ROWID) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+9411, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+9498, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) _sqlite3VdbeJumpHere(tls, v, iAddr) } else { /* Iterator variable */ affinity_ok = int32(1) @@ -160542,12 +153416,12 @@ func _sqlite3FindInIndex(tls *libc.TLS, pParse uintptr, pX uintptr, inFlags Tu32 if colUsed == libc.Uint64FromInt32(1)<0 so that the new limit is either 1 or 0 */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1793) + pLimit = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820) if pLimit != 0 { (*TExpr)(unsafe.Pointer(pLimit)).FaffExpr = int8(SQLITE_AFF_NUMERIC) pLimit = _sqlite3PExpr(tls, pParse, int32(TK_NE), _sqlite3ExprDup(tls, db, (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft, 0), pLimit) @@ -161139,7 +154014,7 @@ func _sqlite3CodeSubselect(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int3 (*TExpr)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSel)).FpLimit)).FpLeft = pLimit } else { /* If there is no pre-existing limit add a limit of 1 */ - pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+9626) + pLimit = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_INTEGER), __ccgo_ts+9713) (*TSelect)(unsafe.Pointer(pSel)).FpLimit = _sqlite3PExpr(tls, pParse, int32(TK_LIMIT), pLimit, uintptr(0)) } (*TSelect)(unsafe.Pointer(pSel)).FiLimit = 0 @@ -161235,7 +154110,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals zAff = uintptr(0) /* Where to jump when NULLs seen in step 2 */ destStep6 = 0 /* Top of the step-6 loop */ *(*int32)(unsafe.Pointer(bp + 8)) = 0 /* Index to use */ - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = uint8(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) pLeft = (*TExpr)(unsafe.Pointer(pExpr)).FpLeft if _sqlite3ExprCheckIN(tls, pParse, pExpr) != 0 { return @@ -161270,9 +154145,9 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals ** Avoid factoring the LHS of the IN(...) expression out of the loop, ** even if it is constant, as OP_Affinity may be used on the register ** by code generated below. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) rLhsOrig = _exprCodeVector(tls, pParse, pLeft, bp+4) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) i = 0 for { if !(i < nVector && *(*int32)(unsafe.Pointer(aiMap + uintptr(i)*4)) == i) { @@ -161405,7 +154280,7 @@ func _sqlite3ExprCodeIN(tls *libc.TLS, pParse uintptr, pExpr uintptr, destIfFals FiAddr int32 FregReturn int32 })(unsafe.Pointer(pExpr + 44))).FiAddr) - if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { + if int32((*TVdbeOp)(unsafe.Pointer(pOp)).Fopcode) == int32(OP_Once) && (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3 > 0 { /* tag-202407032019 */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Filter), (*TVdbeOp)(unsafe.Pointer(pOp)).Fp3, destIfFalse, rLhs, nVector) } } @@ -161535,13 +154410,13 @@ func _codeInteger(tls *libc.TLS, pParse uintptr, pExpr uintptr, negFlag int32, i z = *(*uintptr)(unsafe.Pointer(pExpr + 8)) c = _sqlite3DecOrHexToI64(tls, z, bp) if c == int32(3) && !(negFlag != 0) || c == int32(2) || negFlag != 0 && *(*Ti64)(unsafe.Pointer(bp)) == int64(-libc.Int32FromInt32(1))-(libc.Int64FromUint32(0xffffffff)|libc.Int64FromInt32(0x7fffffff)<y.nReg registers starting + ** with target */ + _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, target, target+*(*int32)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy))-int32(1)) + return target default: /* Make NULL the default case so that if a bug causes an illegal ** Expr node to be passed into this function, it will be handled @@ -162321,7 +155201,7 @@ expr_code_doover: case int32(TK_AGG_FUNCTION): pInfo = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pInfo == uintptr(0) || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) < 0 || int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pInfo)).FnFunc { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9719, libc.VaList(bp+120, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9806, libc.VaList(bp+120, pExpr)) } else { return (*TAggInfo)(unsafe.Pointer(pInfo)).FiFirstReg + (*TAggInfo)(unsafe.Pointer(pInfo)).FnColumn + int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) } @@ -162333,7 +155213,7 @@ expr_code_doover: if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { return (*TWindow)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(&(*TExpr)(unsafe.Pointer(pExpr)).Fy)))).FregResult } - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { /* SQL functions can be expensive. So try to avoid running them ** multiple times if we know they always give the same result */ return _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) @@ -162348,7 +155228,7 @@ expr_code_doover: zId = *(*uintptr)(unsafe.Pointer(pExpr + 8)) pDef = _sqlite3FindFunction(tls, db, zId, nFarg, enc, uint8(0)) if pDef == uintptr(0) || (*TFuncDef)(unsafe.Pointer(pDef)).FxFinalize != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9746, libc.VaList(bp+120, pExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9833, libc.VaList(bp+120, pExpr)) break } if (*TFuncDef)(unsafe.Pointer(pDef)).FfuncFlags&uint32(SQLITE_FUNC_INLINE) != uint32(0) && pFarg != uintptr(0) { @@ -162377,7 +155257,7 @@ expr_code_doover: if pFarg != 0 { if constMask != 0 { r1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nFarg + *(*int32)(unsafe.Pointer(pParse + 52)) += nFarg } else { r1 = _sqlite3GetTempRange(tls, pParse, nFarg) } @@ -162453,7 +155333,7 @@ expr_code_doover: } n1 = _sqlite3ExprVectorSize(tls, pLeft2) if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != n1 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9329, libc.VaList(bp+120, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9416, libc.VaList(bp+120, (*TExpr)(unsafe.Pointer(pExpr)).FiTable, n1)) } return (*TExpr)(unsafe.Pointer(pLeft2)).FiTable + int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) case int32(TK_IN): @@ -162516,7 +155396,7 @@ expr_code_doover: _sqlite3VdbeAddOp1(tls, v, int32(OP_RealAffinity), target) } case int32(TK_VECTOR): - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8112, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8199, 0) break /* TK_IF_NULL_ROW Expr nodes are inserted ahead of expressions ** that derive from the right-hand table of a LEFT JOIN. The @@ -162526,7 +155406,7 @@ expr_code_doover: */ fallthrough case int32(TK_IF_NULL_ROW): - okConstFactor = (*TParse)(unsafe.Pointer(pParse)).FokConstFactor + okConstFactor = uint8(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) pAggInfo1 = (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo if pAggInfo1 != 0 { if !((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FdirectMode != 0) { @@ -162534,7 +155414,7 @@ expr_code_doover: break } if (*TAggInfo)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo)).FuseSortingIdx != 0 { - _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16))).FiSorterColumn), target) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), (*TAggInfo)(unsafe.Pointer(pAggInfo1)).FsortingIdxPTab, (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo1)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*20))).FiSorterColumn, target) inReg = target break } @@ -162547,9 +155427,9 @@ expr_code_doover: ** (2) Make sure the computed value really is stored in register ** "target" and not someplace else. */ - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* note (1) above */ + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) /* note (1) above */ _sqlite3ExprCode(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, target) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = okConstFactor + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) _sqlite3VdbeJumpHere(tls, v, addrINR) break /* @@ -162631,7 +155511,7 @@ expr_code_doover: _sqlite3VdbeResolveLabel(tls, v, endLabel) case int32(TK_RAISE): if !((*TParse)(unsafe.Pointer(pParse)).FpTriggerTab != 0) && !((*TParse)(unsafe.Pointer(pParse)).Fnested != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9770, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9857, 0) return 0 } if int32((*TExpr)(unsafe.Pointer(pExpr)).FaffExpr) == int32(OE_Abort) { @@ -162702,17 +155582,17 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r if pExpr != uintptr(0) && (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_HasFunc)) != uint32(0) { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeAddOp0(tls, v, int32(OP_Once)) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0) { if regDest < 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regDest = v2 } _sqlite3ExprCode(tls, pParse, pExpr, regDest) } - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) _sqlite3VdbeJumpHere(tls, v, addr) } else { @@ -162721,7 +155601,7 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r pItem1 = p + 8 + uintptr((*TExprList)(unsafe.Pointer(p)).FnExpr-int32(1))*20 libc.SetBitFieldPtr16Uint32(pItem1+8+4, libc.BoolUint32(regDest < libc.Int32FromInt32(0)), 3, 0x8) if regDest < 0 { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regDest = v4 @@ -162733,6 +155613,27 @@ func _sqlite3ExprCodeRunJustOnce(tls *libc.TLS, pParse uintptr, pExpr uintptr, r return regDest } +// C documentation +// +// /* +// ** Make arrangements to invoke OP_Null on a range of registers +// ** during initialization. +// */ +func _sqlite3ExprNullRegisterRange(tls *libc.TLS, pParse uintptr, iReg int32, nReg int32) { + bp := tls.Alloc(64) + defer tls.Free(64) + var okConstFactor Tu8 + var _ /* t at bp+0 */ TExpr + _ = okConstFactor + okConstFactor = uint8(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32)) & 0x4 >> 2))) + libc.Xmemset(tls, bp, 0, uint32(52)) + (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_NULLS) + *(*int32)(unsafe.Pointer(bp + 44)) = nReg + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) + _sqlite3ExprCodeRunJustOnce(tls, pParse, bp, iReg) + libc.SetBitFieldPtr8Uint32(pParse+32, uint32(okConstFactor), 2, 0x4) +} + // C documentation // // /* @@ -162752,7 +155653,7 @@ func _sqlite3ExprCodeTemp(tls *libc.TLS, pParse uintptr, pExpr uintptr, pReg uin var r1, r2 int32 _, _ = r1, r2 pExpr = _sqlite3ExprSkipCollateAndLikely(tls, pExpr) - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && pExpr != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && pExpr != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_REGISTER) && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { *(*int32)(unsafe.Pointer(pReg)) = 0 r2 = _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, -int32(1)) } else { @@ -162822,7 +155723,7 @@ func _sqlite3ExprCodeCopy(tls *libc.TLS, pParse uintptr, pExpr uintptr, target i // ** might choose to code the expression at initialization time. // */ func _sqlite3ExprCodeFactorable(tls *libc.TLS, pParse uintptr, pExpr uintptr, target int32) { - if (*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0 && _sqlite3ExprIsConstantNotJoin(tls, pParse, pExpr) != 0 { _sqlite3ExprCodeRunJustOnce(tls, pParse, pExpr, target) } else { _sqlite3ExprCodeCopy(tls, pParse, pExpr, target) @@ -162866,7 +155767,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe /* Never gets this far otherwise */ n = (*TExprList)(unsafe.Pointer(pList)).FnExpr - if !((*TParse)(unsafe.Pointer(pParse)).FokConstFactor != 0) { + if !(int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x4>>2)) != 0) { flags = Tu8(int32(flags) & ^libc.Int32FromInt32(SQLITE_ECEL_FACTOR)) } pItem = pList + 8 @@ -162939,7 +155840,7 @@ func _sqlite3ExprCodeExprList(tls *libc.TLS, pParse uintptr, pList uintptr, targ // ** // ** The jumpIfNull parameter is ignored if xJumpIf is NULL. // */ -func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, xJump uintptr, jumpIfNull int32) { +func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, __ccgo_fp_xJump uintptr, jumpIfNull int32) { bp := tls.Alloc(160) defer tls.Free(160) var db, pDel uintptr @@ -162966,8 +155867,8 @@ func _exprCodeBetween(tls *libc.TLS, pParse uintptr, pExpr uintptr, dest int32, (*(*TExpr)(unsafe.Pointer(bp + 104))).FpLeft = pDel (*(*TExpr)(unsafe.Pointer(bp + 104))).FpRight = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8 + 1*20))).FpExpr _sqlite3ExprToRegister(tls, pDel, _exprCodeVector(tls, pParse, pDel, bp+156)) - if xJump != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{xJump})))(tls, pParse, bp, dest, jumpIfNull) + if __ccgo_fp_xJump != 0 { + (*(*func(*libc.TLS, uintptr, uintptr, int32, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xJump})))(tls, pParse, bp, dest, jumpIfNull) } else { /* Mark the expression is being from the ON or USING clause of a join ** so that the sqlite3ExprCodeTarget() routine will not attempt to move @@ -163133,7 +156034,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -163342,7 +156245,9 @@ _14: _13: ; r1 = _sqlite3ExprCodeTemp(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, bp) - _sqlite3VdbeTypeofColumn(tls, v, r1) + if *(*int32)(unsafe.Pointer(bp)) != 0 { + _sqlite3VdbeTypeofColumn(tls, v, r1) + } _sqlite3VdbeAddOp2(tls, v, op, r1, dest) goto _18 _15: @@ -164049,7 +156954,7 @@ type IdxCover = TIdxCover // ** pWalker->u.pIdxCover->pIdx. // */ func _exprIdxCover(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && int32(_sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, (*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { + if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FiCur && _sqlite3TableColumnToIndex(tls, (*TIdxCover)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FpIdx, int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)) < 0 { (*TWalker)(unsafe.Pointer(pWalker)).FeCode = uint16(1) return int32(WRC_Abort) } @@ -164280,10 +157185,10 @@ func _agginfoPersistExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int pParse = (*TWalker)(unsafe.Pointer(pWalker)).FpParse db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { - if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*16))).FpCExpr == pExpr { + if iAgg < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn && (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*20))).FpCExpr == pExpr { pExpr = _sqlite3ExprDup(tls, db, pExpr, 0) if pExpr != 0 && !(_sqlite3ExprDeferredDelete(tls, pParse, pExpr) != 0) { - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*16))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(iAgg)*20))).FpCExpr = pExpr } } } else { @@ -164321,7 +157226,7 @@ func _addAggInfoColumn(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(16), pInfo+24, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaCol, int32(20), pInfo+28, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -164335,7 +157240,7 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var _ /* i at bp+0 */ int32 - (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(24), pInfo+36, bp) + (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc = _sqlite3ArrayAllocate(tls, db, (*TAggInfo)(unsafe.Pointer(pInfo)).FaFunc, int32(24), pInfo+40, bp) return *(*int32)(unsafe.Pointer(bp)) } @@ -164349,10 +157254,13 @@ func _addAggInfoFunc(tls *libc.TLS, db uintptr, pInfo uintptr) (r int32) { // ** new column will have an index of pAggInfo->nColumn-1. // */ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pExpr uintptr) { - var j, k, n int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var j, k, mxTerm, n int32 var pCol, pE, pGB, pTerm, v4 uintptr - var v3 Tu16 - _, _, _, _, _, _, _, _, _ = j, k, n, pCol, pE, pGB, pTerm, v3, v4 + var v3 Tu32 + _, _, _, _, _, _, _, _, _, _ = j, k, mxTerm, n, pCol, pE, pGB, pTerm, v3, v4 + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 2*4)) pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol k = 0 for { @@ -164362,25 +157270,29 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, if (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr == pExpr { return } - if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { goto fix_up_expr } goto _1 _1: ; k++ - pCol += 16 + pCol += 20 } k = _addAggInfoColumn(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) if k < 0 { /* OOM on resize */ return } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*16 + if k > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9907, libc.VaList(bp+8, mxTerm)) + k = mxTerm + } + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(k)*20 (*TAggInfo_col)(unsafe.Pointer(pCol)).FpTab = (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable = (*TExpr)(unsafe.Pointer(pExpr)).FiTable - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = (*TExpr)(unsafe.Pointer(pExpr)).FiColumn - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(-int32(1)) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn = int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = -int32(1) (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr = pExpr if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy != 0 && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IF_NULL_ROW) { pGB = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy @@ -164393,7 +157305,7 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, } pE = (*TExprList_item)(unsafe.Pointer(pTerm)).FpExpr if int32((*TExpr)(unsafe.Pointer(pE)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(pE)).FiTable == (*TExpr)(unsafe.Pointer(pExpr)).FiTable && int32((*TExpr)(unsafe.Pointer(pE)).FiColumn) == int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(j) + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = j break } goto _2 @@ -164403,11 +157315,11 @@ func _findOrCreateAggInfoColumn(tls *libc.TLS, pParse uintptr, pAggInfo uintptr, pTerm += 20 } } - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) < 0 { - v4 = pAggInfo + 2 - v3 = *(*Tu16)(unsafe.Pointer(v4)) - *(*Tu16)(unsafe.Pointer(v4))++ - (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int16(v3) + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn < 0 { + v4 = pAggInfo + 4 + v3 = *(*Tu32)(unsafe.Pointer(v4)) + *(*Tu32)(unsafe.Pointer(v4))++ + (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn = int32(v3) } goto fix_up_expr fix_up_expr: @@ -164427,13 +157339,13 @@ fix_up_expr: // ** for additional information. // */ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) + bp := tls.Alloc(80) + defer tls.Free(80) var enc Tu8 - var i, iDataCur, nArg, v5, v6, v8 int32 + var i, iDataCur, mxTerm, nArg, v5, v6, v8 int32 var pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v7, v9 uintptr var _ /* tmp at bp+0 */ TExpr - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = enc, i, iDataCur, mxTerm, nArg, pAggInfo, pIEpr, pItem, pItem1, pNC, pOBList, pParse, pSrcList, v5, v6, v7, v8, v9 pNC = *(*uintptr)(unsafe.Pointer(pWalker + 24)) pParse = (*TNameContext)(unsafe.Pointer(pNC)).FpParse pSrcList = (*TNameContext)(unsafe.Pointer(pNC)).FpSrcList @@ -164503,7 +157415,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { return int32(WRC_Abort) } - (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*16))).FpCExpr = pExpr + (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*(*TExpr)(unsafe.Pointer(bp))).FiAgg)*20))).FpCExpr = pExpr (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo = pAggInfo (*TExpr)(unsafe.Pointer(pExpr)).FiAgg = (*(*TExpr)(unsafe.Pointer(bp))).FiAgg return int32(WRC_Prune) @@ -164539,6 +157451,7 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) ** function that is already in the pAggInfo structure */ pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + mxTerm = *(*int32)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb + 120 + 2*4)) i = 0 for { if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc) { @@ -164556,44 +157469,49 @@ func _analyzeAggregate(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int32) i++ pItem1 += 24 } - if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - /* pExpr is original. Make a new entry in pAggInfo->aFunc[] - */ - enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc - i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) - if i >= 0 { - pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr - if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { - v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr - } else { - v5 = 0 - } - nArg = v5 - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) - if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { - v7 = pParse + 44 - v6 = *(*int32)(unsafe.Pointer(v7)) - *(*int32)(unsafe.Pointer(v7))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 - pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)) - if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, 0) == 0 { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + if i > mxTerm { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9907, libc.VaList(bp+64, mxTerm)) + i = mxTerm + } else { + if i >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { + /* pExpr is original. Make a new entry in pAggInfo->aFunc[] + */ + enc = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fenc + i = _addAggInfoFunc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pAggInfo) + if i >= 0 { + pItem1 = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFExpr = pExpr + if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 { + v5 = (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + v5 = 0 + } + nArg = v5 + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc = _sqlite3FindFunction(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(pExpr + 8)), nArg, enc, uint8(0)) + if (*TExpr)(unsafe.Pointer(pExpr)).FpLeft != 0 && (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) == uint32(0) { + v7 = pParse + 48 + v6 = *(*int32)(unsafe.Pointer(v7)) + *(*int32)(unsafe.Pointer(v7))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = v6 + pOBList = *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pExpr)).FpLeft + 20)) + if (*TExprList)(unsafe.Pointer(pOBList)).FnExpr == int32(1) && nArg == int32(1) && _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer(pOBList + 8))).FpExpr, (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)) + 8))).FpExpr, 0) == 0 { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(0) + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique = libc.BoolUint8((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != libc.Uint32FromInt32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBPayload = uint8(1) + } + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) + } + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { + v9 = pParse + 48 + v8 = *(*int32)(unsafe.Pointer(v9)) + *(*int32)(unsafe.Pointer(v9))++ + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 + } else { + (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FbUseSubtype = libc.BoolUint8((*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pItem1)).FpFunc)).FfuncFlags&uint32(SQLITE_SUBTYPE) != uint32(0)) - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiOBTab = -int32(1) - } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Distinct)) != uint32(0) && !((*TAggInfo_func)(unsafe.Pointer(pItem1)).FbOBUnique != 0) { - v9 = pParse + 44 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = v8 - } else { - (*TAggInfo_func)(unsafe.Pointer(pItem1)).FiDistinct = -int32(1) } } } @@ -164673,7 +157591,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { var v3 Tu8 _, _, _, _ = v1, v2, v3, v4 if int32((*TParse)(unsafe.Pointer(pParse)).FnTempReg) == 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) return v1 @@ -164681,7 +157599,7 @@ func _sqlite3GetTempReg(tls *libc.TLS, pParse uintptr) (r int32) { v4 = pParse + 19 *(*Tu8)(unsafe.Pointer(v4))-- v3 = *(*Tu8)(unsafe.Pointer(v4)) - return *(*int32)(unsafe.Pointer(pParse + 168 + uintptr(v3)*4)) + return *(*int32)(unsafe.Pointer(pParse + 136 + uintptr(v3)*4)) } // C documentation @@ -164699,7 +157617,7 @@ func _sqlite3ReleaseTempReg(tls *libc.TLS, pParse uintptr, iReg int32) { v2 = pParse + 19 v1 = *(*Tu8)(unsafe.Pointer(v2)) *(*Tu8)(unsafe.Pointer(v2))++ - *(*int32)(unsafe.Pointer(pParse + 168 + uintptr(v1)*4)) = iReg + *(*int32)(unsafe.Pointer(pParse + 136 + uintptr(v1)*4)) = iReg } } } @@ -164718,11 +157636,11 @@ func _sqlite3GetTempRange(tls *libc.TLS, pParse uintptr, nReg int32) (r int32) { i = (*TParse)(unsafe.Pointer(pParse)).FiRangeReg n = (*TParse)(unsafe.Pointer(pParse)).FnRangeReg if nReg <= n { - *(*int32)(unsafe.Pointer(pParse + 36)) += nReg - *(*int32)(unsafe.Pointer(pParse + 32)) -= nReg + *(*int32)(unsafe.Pointer(pParse + 40)) += nReg + *(*int32)(unsafe.Pointer(pParse + 36)) -= nReg } else { i = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg } return i } @@ -164840,8 +157758,8 @@ func _sqlite3FirstAvailableRegister(tls *libc.TLS, pParse uintptr, iMin int32) ( func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9820, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Eponymous) != uint32(0) || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9936, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -164859,10 +157777,10 @@ func _isAlterableTable(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int32) { func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, zWhen uintptr, bNoDQS int32) { bp := tls.Alloc(48) defer tls.Free(48) - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+9848, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 0, 0x1) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+9964, libc.VaList(bp+8, zDb, zDb, bTemp, zWhen, bNoDQS)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10023, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10139, libc.VaList(bp+8, zDb, zWhen, bNoDQS)) } } @@ -164878,9 +157796,9 @@ func _renameTestSchema(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32, func _renameFixQuotes(tls *libc.TLS, pParse uintptr, zDb uintptr, bTemp int32) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10197, libc.VaList(bp+8, zDb, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10313, libc.VaList(bp+8, zDb, zDb)) if bTemp == 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10344, 0) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10460, 0) } } @@ -164936,7 +157854,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** in database iDb. If so, this is an error. */ if _sqlite3FindTable(tls, db, zName, zDb) != 0 || _sqlite3FindIndex(tls, db, zName, zDb) != 0 || _sqlite3IsShadowTableOf(tls, db, pTab, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10495, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10611, libc.VaList(bp+8, zName)) goto exit_rename_table } /* Make sure it is not a system table being altered, or a reserved name @@ -164945,11 +157863,11 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { goto exit_rename_table } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+10554, zName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+10670, zName) { goto exit_rename_table } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10560, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+10676, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_rename_table } /* Invoke the authorization callback. */ @@ -164979,21 +157897,21 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName nTabName = _sqlite3Utf8CharLen(tls, zTabName, -int32(1)) /* Rewrite all CREATE TABLE, INDEX, TRIGGER or VIEW statements in ** the schema to use the new table name. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10587, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10703, libc.VaList(bp+8, zDb, zDb, zTabName, zName, libc.BoolInt32(iDb == int32(1)), zTabName)) /* Update the tbl_name and name columns of the sqlite_schema table ** as required. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+10771, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+10887, libc.VaList(bp+8, zDb, zName, zName, zName, nTabName, zTabName)) /* If the sqlite_sequence table exists in this database, then update ** it with the new table name. */ - if _sqlite3FindTable(tls, db, __ccgo_ts+11076, zDb) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11092, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if _sqlite3FindTable(tls, db, __ccgo_ts+11192, zDb) != 0 { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11208, libc.VaList(bp+8, zDb, zName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* If the table being renamed is not itself part of the temp database, ** edit view and trigger definitions within the temp database ** as required. */ if iDb != int32(1) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11150, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11266, libc.VaList(bp+8, zDb, zTabName, zName, zTabName, zDb, zName)) } /* If this is a virtual table, invoke the xRename() function if ** one is defined. The xRename() callback will modify the names @@ -165001,7 +157919,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName ** SQLite tables) that are identified by the name of the virtual table. */ if pVTab != 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) i = v1 @@ -165009,7 +157927,7 @@ func _sqlite3AlterRenameTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName _sqlite3VdbeAddOp4(tls, v, int32(OP_VRename), i, 0, 0, pVTab, -int32(11)) } _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11415, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+11531, 0) goto exit_rename_table exit_rename_table: ; @@ -165026,7 +157944,7 @@ exit_rename_table: func _sqlite3ErrorIfNotEmpty(tls *libc.TLS, pParse uintptr, zDb uintptr, zTab uintptr, zErr uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11428, libc.VaList(bp+8, zErr, zDb, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11544, libc.VaList(bp+8, zErr, zDb, zTab)) } // C documentation @@ -165066,11 +157984,11 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr ** column must not be NULL. */ if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11466, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11582, 0) return } if (*TTable)(unsafe.Pointer(pNew)).FpIndex != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11498, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+11614, 0) return } if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { @@ -165086,10 +158004,10 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr FpFKey uintptr FpDfltList uintptr })(unsafe.Pointer(pNew + 44))).FpFKey != 0 && pDflt != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11525) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11641) } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && !(pDflt != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11584) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11700) } /* Ensure the default expression is something that sqlite3ValueFromExpr() ** can handle (i.e. not CURRENT_TIME etc.) @@ -165101,13 +158019,13 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr return } if !(*(*uintptr)(unsafe.Pointer(bp)) != 0) { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11637) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11753) } _sqlite3ValueFree(tls, *(*uintptr)(unsafe.Pointer(bp))) } } else { if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_STORED) != 0 { - _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11683) + _sqlite3ErrorIfNotEmpty(tls, pParse, zDb, zTab, __ccgo_ts+11799) } } /* Modify the CREATE TABLE statement. */ @@ -165121,7 +158039,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr } /* substr() operations on characters, but addColOffset is in bytes. So we ** have to use printf() to translate between these units: */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11710, libc.VaList(bp+16, zDb, (*(*struct { + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11826, libc.VaList(bp+16, zDb, (*(*struct { FaddColOffset int32 FpFKey uintptr FpDfltList uintptr @@ -165149,7 +158067,7 @@ func _sqlite3AlterFinishAddColumn(tls *libc.TLS, pParse uintptr, pColDef uintptr _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterAdd)) /* Verify that constraints are still satisfied */ if (*TTable)(unsafe.Pointer(pNew)).FpCheck != uintptr(0) || int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 && int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 || (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Strict) != uint32(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+11856, libc.VaList(bp+16, zTab, zDb)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+11972, libc.VaList(bp+16, zTab, zDb)) } } } @@ -165187,12 +158105,12 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { goto exit_begin_add_column } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12209, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12325, 0) goto exit_begin_add_column } /* Make sure this is not an attempt to ALTER a view. */ if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12243, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12359, 0) goto exit_begin_add_column } if SQLITE_OK != _isAlterableTable(tls, pParse, pTab) { @@ -165207,7 +158125,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { ** table because user table are not allowed to have the "sqlite_" ** prefix on their name. */ - pNew = _sqlite3DbMallocZero(tls, db, uint64(64)) + pNew = _sqlite3DbMallocZero(tls, db, uint64(80)) if !(pNew != 0) { goto exit_begin_add_column } @@ -165216,7 +158134,7 @@ func _sqlite3AlterBeginAddColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr) { (*TTable)(unsafe.Pointer(pNew)).FnCol = (*TTable)(unsafe.Pointer(pTab)).FnCol nAlloc = (int32((*TTable)(unsafe.Pointer(pNew)).FnCol)-int32(1))/int32(8)*int32(8) + int32(8) (*TTable)(unsafe.Pointer(pNew)).FaCol = _sqlite3DbMallocZero(tls, db, uint64(uint32(12)*uint32(nAlloc))) - (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+12273, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + (*TTable)(unsafe.Pointer(pNew)).FzName = _sqlite3MPrintf(tls, db, __ccgo_ts+12389, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !((*TTable)(unsafe.Pointer(pNew)).FaCol != 0) || !((*TTable)(unsafe.Pointer(pNew)).FzName != 0) { goto exit_begin_add_column } @@ -165277,18 +158195,18 @@ func _isRealTable(tls *libc.TLS, pParse uintptr, pTab uintptr, bDrop int32) (r i _, _ = zType, v1 zType = uintptr(0) if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 12292 + zType = __ccgo_ts + 12408 } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 12297 + zType = __ccgo_ts + 12413 } if zType != 0 { if bDrop != 0 { - v1 = __ccgo_ts + 12311 + v1 = __ccgo_ts + 12427 } else { - v1 = __ccgo_ts + 12328 + v1 = __ccgo_ts + 12444 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12346, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12462, libc.VaList(bp+8, v1, zType, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -165335,25 +158253,13 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld if !(zOld != 0) { goto exit_rename_column } - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if 0 == _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName, zOld) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12364, libc.VaList(bp+8, pOld)) + iCol = _sqlite3ColumnIndex(tls, pTab, zOld) + if iCol < 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12480, libc.VaList(bp+8, pOld)) goto exit_rename_column } /* Ensure the schema contains no double-quoted strings */ - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1673, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+1674, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1))) /* Do the rename operation using a recursive UPDATE statement that ** uses the sqlite_rename_column() SQL function to compute the new @@ -165365,11 +158271,11 @@ func _sqlite3AlterRenameColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pOld goto exit_rename_column } bQuote = int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pNew)).Fz)))]) & int32(0x80) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12385, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12567, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12501, libc.VaList(bp+8, zDb, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote, libc.BoolInt32(iSchema == int32(1)), (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12683, libc.VaList(bp+8, zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, iCol, zNew, bQuote)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iSchema, uint16(INITFLAG_AlterRename)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+11415, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iSchema == int32(1)), __ccgo_ts+11531, int32(1)) goto exit_rename_column exit_rename_column: ; @@ -165379,31 +158285,6 @@ exit_rename_column: return } -/* -** Each RenameToken object maps an element of the parse tree into -** the token that generated that element. The parse tree element -** might be one of: -** -** * A pointer to an Expr that represents an ID -** * The name of a table column in Column.zName -** -** A list of RenameToken objects can be constructed during parsing. -** Each new object is created by sqlite3RenameTokenMap(). -** As the parse tree is transformed, the sqlite3RenameTokenRemap() -** routine is used to keep the mapping current. -** -** After the parse finishes, renameTokenFind() routine can be used -** to look up the actual token value that created some element in -** the parse tree. - */ -type TRenameToken1 = struct { - Fp uintptr - Ft TToken - FpNext uintptr -} - -type RenameToken1 = TRenameToken1 - // C documentation // // /* @@ -165420,16 +158301,6 @@ type TRenameCtx = struct { type RenameCtx = TRenameCtx -type TRenameCtx1 = struct { - FpList uintptr - FnList int32 - FiCol int32 - FpTab uintptr - FzOld uintptr -} - -type RenameCtx1 = TRenameCtx1 - // C documentation // // /* @@ -165723,7 +158594,7 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) if pPtr == uintptr(0) { return uintptr(0) } - pp = pParse + 284 + pp = pParse + 280 for { if !(*(*uintptr)(unsafe.Pointer(pp)) != 0) { break @@ -165732,9 +158603,9 @@ func _renameTokenFind(tls *libc.TLS, pParse uintptr, pCtx uintptr, pPtr uintptr) pToken = *(*uintptr)(unsafe.Pointer(pp)) if pCtx != 0 { *(*uintptr)(unsafe.Pointer(pp)) = (*TRenameToken)(unsafe.Pointer(pToken)).FpNext - (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FpList = pToken - (*TRenameCtx1)(unsafe.Pointer(pCtx)).FnList++ + (*TRenameToken)(unsafe.Pointer(pToken)).FpNext = (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList + (*TRenameCtx)(unsafe.Pointer(pCtx)).FpList = pToken + (*TRenameCtx)(unsafe.Pointer(pCtx)).FnList++ } return pToken } @@ -165845,11 +158716,11 @@ func _renameColumnParseError(tls *libc.TLS, pCtx uintptr, zWhen uintptr, pType u zT = Xsqlite3_value_text(tls, pType) zN = Xsqlite3_value_text(tls, pObject) if *(*int8)(unsafe.Pointer(zWhen)) != 0 { - v1 = __ccgo_ts + 12698 + v1 = __ccgo_ts + 12814 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12700, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) + zErr = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+12816, libc.VaList(bp+8, zT, zN, v1, zWhen, (*TParse)(unsafe.Pointer(pParse)).FzErrMsg)) Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, zErr) } @@ -165920,30 +158791,34 @@ func _renameColumnIdlistNames(tls *libc.TLS, pParse uintptr, pCtx uintptr, pIdLi // ** is initialized by this function before it is used. // */ func _renameParseSql(tls *libc.TLS, p uintptr, zDb uintptr, db uintptr, zSql uintptr, bTemp int32) (r int32) { - var rc, v1 int32 - _, _ = rc, v1 + var flags Tu64 + var iDb, rc int32 + _, _, _ = flags, iDb, rc _sqlite3ParseObjectInit(tls, p, db) if zSql == uintptr(0) { return int32(SQLITE_NOMEM) } - if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+12723, int32(7)) != 0 { - return _sqlite3CorruptError(tls, int32(118069)) + if Xsqlite3_strnicmp(tls, zSql, __ccgo_ts+12839, int32(7)) != 0 { + return _sqlite3CorruptError(tls, int32(118915)) } if bTemp != 0 { - v1 = int32(1) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(1) } else { - v1 = _sqlite3FindDbName(tls, db, zDb) + iDb = _sqlite3FindDbName(tls, db, zDb) + (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) } - (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(v1) (*TParse)(unsafe.Pointer(p)).FeParseMode = uint8(PARSE_MODE_RENAME) (*TParse)(unsafe.Pointer(p)).Fdb = db (*TParse)(unsafe.Pointer(p)).FnQueryLoop = int16(1) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags + *(*Tu64)(unsafe.Pointer(db + 32)) |= uint64(libc.Int32FromInt32(0x00040)) << libc.Int32FromInt32(32) rc = _sqlite3RunParser(tls, p, zSql) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { rc = int32(SQLITE_NOMEM) } if rc == SQLITE_OK && ((*TParse)(unsafe.Pointer(p)).FpNewTable == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewIndex == uintptr(0) && (*TParse)(unsafe.Pointer(p)).FpNewTrigger == uintptr(0)) { - rc = _sqlite3CorruptError(tls, int32(118080)) + rc = _sqlite3CorruptError(tls, int32(118936)) } (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(0) return rc @@ -165964,9 +158839,8 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, bp := tls.Alloc(32) defer tls.Free(32) var db, pBest, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 uintptr - var iOff, nOut, rc int32 - var nNew, nQuot, nSql Ti64 - var nReplace Tu32 + var iOff, rc int32 + var nNew, nOut, nQuot, nReplace, nSql Ti64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, iOff, nNew, nOut, nQuot, nReplace, nSql, pBest, rc, zBuf1, zBuf2, zOut, zQuot, zReplace, v1 nNew = int64(_sqlite3Strlen30(tls, zNew)) nSql = int64(_sqlite3Strlen30(tls, zSql)) @@ -165982,15 +158856,15 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** ALTER TABLE statement was quoted (bQuote==1), then set zNew to ** point to zQuot so that all substitutions are made using the ** quoted version of the new column name. */ - zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+12731, libc.VaList(bp+8, zNew)) + zQuot = _sqlite3MPrintf(tls, db, __ccgo_ts+12847, libc.VaList(bp+8, zNew)) if zQuot == uintptr(0) { return int32(SQLITE_NOMEM) } else { nQuot = int64(_sqlite3Strlen30(tls, zQuot) - int32(1)) } - zOut = _sqlite3DbMallocZero(tls, db, uint64(nSql+int64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*nQuot+int64(1))) + zOut = _sqlite3DbMallocZero(tls, db, uint64(nSql)+uint64((*TRenameCtx)(unsafe.Pointer(pRename)).FnList)*uint64(nQuot)+uint64(1)) } else { - zOut = _sqlite3DbMallocZero(tls, db, uint64((nSql*int64(2)+int64(1))*int64(3))) + zOut = _sqlite3DbMallocZero(tls, db, (uint64(2)*uint64(nSql)+uint64(1))*uint64(3)) if zOut != 0 { zBuf1 = zOut + uintptr(nSql*int64(2)+int64(1)) zBuf2 = zOut + uintptr(nSql*int64(4)+int64(2)) @@ -166001,16 +158875,16 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, ** with the new column name, or with single-quoted versions of themselves. ** All that remains is to construct and return the edited SQL string. */ if zOut != 0 { - nOut = int32(nSql) + nOut = nSql libc.Xmemcpy(tls, zOut, zSql, uint32(nSql)) for (*TRenameCtx)(unsafe.Pointer(pRename)).FpList != 0 { pBest = _renameColumnTokenNext(tls, pRename) if zNew != 0 { - if bQuote == 0 && _sqlite3IsIdChar(tls, uint8(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz)))) != 0 { - nReplace = uint32(nNew) + if bQuote == 0 && _sqlite3IsIdChar(tls, *(*Tu8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz))) != 0 { + nReplace = nNew zReplace = zNew } else { - nReplace = uint32(nQuot) + nReplace = nQuot zReplace = zQuot if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('"') { nReplace++ @@ -166027,21 +158901,21 @@ func _renameEditSql(tls *libc.TLS, pCtx uintptr, pRename uintptr, zSql uintptr, *(*int8)(unsafe.Pointer(zBuf1 + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) = 0 _sqlite3Dequote(tls, zBuf1) if int32(*(*int8)(unsafe.Pointer((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz + uintptr((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)))) == int32('\'') { - v1 = __ccgo_ts + 12698 + v1 = __ccgo_ts + 12814 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - Xsqlite3_snprintf(tls, int32(nSql*int64(2)), zBuf2, __ccgo_ts+12737, libc.VaList(bp+8, zBuf1, v1)) + Xsqlite3_snprintf(tls, int32(nSql*libc.Int64FromInt32(2)), zBuf2, __ccgo_ts+12853, libc.VaList(bp+8, zBuf1, v1)) zReplace = zBuf2 - nReplace = uint32(_sqlite3Strlen30(tls, zReplace)) + nReplace = int64(_sqlite3Strlen30(tls, zReplace)) } iOff = int32((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fz) - int32(zSql) - if (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn != nReplace { - libc.Xmemmove(tls, zOut+uintptr(uint32(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint32(nOut)-(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) - nOut = int32(uint32(nOut) + (nReplace - (*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn)) + if int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) != nReplace { + libc.Xmemmove(tls, zOut+uintptr(int64(iOff)+nReplace), zOut+uintptr(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn), uint32(nOut-int64(uint32(iOff)+(*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn))) + nOut += nReplace - int64((*TRenameToken)(unsafe.Pointer(pBest)).Ft.Fn) *(*int8)(unsafe.Pointer(zOut + uintptr(nOut))) = int8('\000') } - libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, nReplace) + libc.Xmemcpy(tls, zOut+uintptr(iOff), zReplace, uint32(nReplace)) _sqlite3DbFree(tls, db, pBest) } Xsqlite3_result_text(tls, pCtx, zOut, -int32(1), uintptr(-libc.Int32FromInt32(1))) @@ -166067,7 +158941,7 @@ func _renameSetENames(tls *libc.TLS, pEList uintptr, val int32) { if !(i < (*TExprList)(unsafe.Pointer(pEList)).FnExpr) { break } - libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, uint32(val), 0, 0x3) + libc.SetBitFieldPtr16Uint32(pEList+8+uintptr(i)*20+8+4, uint32(val&libc.Int32FromInt32(0x3)), 0, 0x3) goto _1 _1: ; @@ -166322,7 +159196,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp var xAuth Tsqlite3_xauth var _ /* sCtx at bp+0 */ TRenameCtx var _ /* sParse at bp+20 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bFKOnly, bQuote, bTemp, db, i, iCol, pExpr, pFKey, pIdx, pSelect, pStep, pTab, pTarget, pUpsertSet, rc, xAuth, zDb, zNew, zOld, zSql, zTable, v1, v2 db = Xsqlite3_context_db_handle(tls, context) zSql = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -166363,11 +159237,11 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = _renameParseSql(tls, bp+20, zDb, db, zSql, bTemp) /* Find tokens that need to be replaced. */ - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp + 20 - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameColumnExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + 20 + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameColumnExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp (*(*TRenameCtx)(unsafe.Pointer(bp))).FpTab = pTab if rc != SQLITE_OK { goto renameColumnFunc_done @@ -166377,7 +159251,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp + 20))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp+20, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166387,7 +159261,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } rc = v2 if rc == SQLITE_OK { - _sqlite3WalkSelect(tls, bp+308, pSelect) + _sqlite3WalkSelect(tls, bp+304, pSelect) } if rc != SQLITE_OK { goto renameColumnFunc_done @@ -166404,13 +159278,13 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp if (*(*TRenameCtx)(unsafe.Pointer(bp))).FiCol < 0 { _renameTokenFind(tls, bp+20, bp, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable+32) } - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpCheck) pIdx = (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FpIndex for { if !(pIdx != 0) { break } - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) goto _3 _3: ; @@ -166421,7 +159295,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp if !(pIdx != 0) { break } - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer(pIdx)).FaColExpr) goto _4 _4: ; @@ -166433,7 +159307,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp break } pExpr = _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTable)).FaCol+uintptr(i)*12) - _sqlite3WalkExpr(tls, bp+308, pExpr) + _sqlite3WalkExpr(tls, bp+304, pExpr) goto _5 _5: ; @@ -166474,8 +159348,8 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp } } else { if (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex != 0 { - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FaColExpr) - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FaColExpr) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewIndex)).FpPartIdxWhere) } else { rc = _renameResolveTrigger(tls, bp+20) if rc != SQLITE_OK { @@ -166507,7 +159381,7 @@ func _renameColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintp _renameColumnIdlistNames(tls, bp+20, bp, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger)).FpColumns, zOld) } /* Find tokens to edit in various expressions and selects */ - _renameWalkTrigger(tls, bp+308, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger) + _renameWalkTrigger(tls, bp+304, (*(*TParse)(unsafe.Pointer(bp + 20))).FpNewTrigger) } } rc = _renameEditSql(tls, context, bp, zSql, zNew, bQuote) @@ -166519,7 +159393,7 @@ renameColumnFunc_done: Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv))) } else { if (*(*TParse)(unsafe.Pointer(bp + 20))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1673, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20) + _renameColumnParseError(tls, context, __ccgo_ts+1674, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp+20) } else { Xsqlite3_result_error_code(tls, context, rc) } @@ -166603,15 +159477,15 @@ func _renameTableSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintptr) (r in // ** -> 'CREATE TABLE t1(a REFERENCES t3)' // */ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { - bp := tls.Alloc(384) - defer tls.Free(384) + bp := tls.Alloc(368) + defer tls.Free(368) var bQuote, bTemp, i, isLegacy, rc int32 var db, pFKey, pItem, pSelect, pStep, pTab, pTrigger, zDb, zInput, zNew, zOld uintptr var xAuth Tsqlite3_xauth - var _ /* sCtx at bp+288 */ TRenameCtx - var _ /* sNC at bp+336 */ TNameContext + var _ /* sCtx at bp+284 */ TRenameCtx + var _ /* sNC at bp+332 */ TNameContext var _ /* sParse at bp+0 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bQuote, bTemp, db, i, isLegacy, pFKey, pItem, pSelect, pStep, pTab, pTrigger, rc, xAuth, zDb, zInput, zNew, zOld db = Xsqlite3_context_db_handle(tls, context) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -166625,13 +159499,13 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _sqlite3BtreeEnterAll(tls, db) - libc.Xmemset(tls, bp+288, 0, uint32(20)) - (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab = _sqlite3FindTable(tls, db, zOld, zDb) - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameTableExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameTableSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + 288 + libc.Xmemset(tls, bp+284, 0, uint32(20)) + (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab = _sqlite3FindTable(tls, db, zOld, zDb) + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameTableExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameTableSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) if rc == SQLITE_OK { isLegacy = int32((*Tsqlite3)(unsafe.Pointer(db)).Fflags & libc.Uint64FromInt32(SQLITE_LegacyAlter)) @@ -166642,16 +159516,16 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect - libc.Xmemset(tls, bp+336, 0, uint32(36)) - (*(*TNameContext)(unsafe.Pointer(bp + 336))).FpParse = bp - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + libc.Xmemset(tls, bp+332, 0, uint32(36)) + (*(*TNameContext)(unsafe.Pointer(bp + 332))).FpParse = bp + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr - })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+336) + })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect, bp+332) if (*(*TParse)(unsafe.Pointer(bp))).FnErr != 0 { rc = (*(*TParse)(unsafe.Pointer(bp))).Frc } else { - _sqlite3WalkSelect(tls, bp+308, (*(*struct { + _sqlite3WalkSelect(tls, bp+304, (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer(pTab)).Fu))).FpSelect) } @@ -166669,7 +159543,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt break } if Xsqlite3_stricmp(tls, (*TFKey)(unsafe.Pointer(pFKey)).FzTo, zOld) == 0 { - _renameTokenFind(tls, bp, bp+288, (*TFKey)(unsafe.Pointer(pFKey)).FzTo) + _renameTokenFind(tls, bp, bp+284, (*TFKey)(unsafe.Pointer(pFKey)).FzTo) } goto _1 _1: @@ -166681,35 +159555,35 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt ** expressions. Also update the name that appears right after the ** "CREATE [VIRTUAL] TABLE" bit. */ if Xsqlite3_stricmp(tls, zOld, (*TTable)(unsafe.Pointer(pTab)).FzName) == 0 { - (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab = pTab + (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab = pTab if isLegacy == 0 { - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer(pTab)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer(pTab)).FpCheck) } - _renameTokenFind(tls, bp, bp+288, (*TTable)(unsafe.Pointer(pTab)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TTable)(unsafe.Pointer(pTab)).FzName) } } } else { if (*(*TParse)(unsafe.Pointer(bp))).FpNewIndex != 0 { - _renameTokenFind(tls, bp, bp+288, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FzName) if isLegacy == 0 { - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) } } else { pTrigger = (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger - if 0 == Xsqlite3_stricmp(tls, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable, zOld) && (*TTable)(unsafe.Pointer((*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpTab)).FpSchema == (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema { - _renameTokenFind(tls, bp, bp+288, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable) + if 0 == Xsqlite3_stricmp(tls, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable, zOld) && (*TTable)(unsafe.Pointer((*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpTab)).FpSchema == (*TTrigger)(unsafe.Pointer(pTrigger)).FpTabSchema { + _renameTokenFind(tls, bp, bp+284, (*TTrigger)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger)).Ftable) } if isLegacy == 0 { rc = _renameResolveTrigger(tls, bp) if rc == SQLITE_OK { - _renameWalkTrigger(tls, bp+308, pTrigger) + _renameWalkTrigger(tls, bp+304, pTrigger) pStep = (*TTrigger)(unsafe.Pointer(pTrigger)).Fstep_list for { if !(pStep != 0) { break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != 0 && 0 == Xsqlite3_stricmp(tls, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget, zOld) { - _renameTokenFind(tls, bp, bp+288, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) + _renameTokenFind(tls, bp, bp+284, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) } if (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom != 0 { i = 0 @@ -166719,7 +159593,7 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } pItem = (*TTriggerStep)(unsafe.Pointer(pStep)).FpFrom + 8 + uintptr(i)*48 if 0 == Xsqlite3_stricmp(tls, (*TSrcItem)(unsafe.Pointer(pItem)).FzName, zOld) { - _renameTokenFind(tls, bp, bp+288, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) + _renameTokenFind(tls, bp, bp+284, (*TSrcItem)(unsafe.Pointer(pItem)).FzName) } goto _3 _3: @@ -166738,21 +159612,21 @@ func _renameTableFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt } } if rc == SQLITE_OK { - rc = _renameEditSql(tls, context, bp+288, zInput, zNew, bQuote) + rc = _renameEditSql(tls, context, bp+284, zInput, zNew, bQuote) } if rc != SQLITE_OK { if rc == int32(SQLITE_ERROR) && _sqlite3WritableSchema(tls, db) != 0 { Xsqlite3_result_value(tls, context, *(*uintptr)(unsafe.Pointer(argv + 3*4))) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _renameColumnParseError(tls, context, __ccgo_ts+1673, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp) + _renameColumnParseError(tls, context, __ccgo_ts+1674, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), bp) } else { Xsqlite3_result_error_code(tls, context, rc) } } } _renameParseCleanup(tls, bp) - _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpList) + _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpList) _sqlite3BtreeLeaveAll(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth } @@ -166801,9 +159675,9 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin var db, pSelect, zDb, zInput uintptr var i, rc, v1 int32 var xAuth Tsqlite3_xauth - var _ /* sCtx at bp+288 */ TRenameCtx + var _ /* sCtx at bp+284 */ TRenameCtx var _ /* sParse at bp+0 */ TParse - var _ /* sWalker at bp+308 */ TWalker + var _ /* sWalker at bp+304 */ TWalker _, _, _, _, _, _, _, _ = db, i, pSelect, rc, xAuth, zDb, zInput, v1 db = Xsqlite3_context_db_handle(tls, context) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -166816,18 +159690,18 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin rc = _renameParseSql(tls, bp, zDb, db, zInput, 0) if rc == SQLITE_OK { /* Walker to find tokens that need to be replaced. */ - libc.Xmemset(tls, bp+288, 0, uint32(20)) - libc.Xmemset(tls, bp+308, 0, uint32(28)) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FpParse = bp - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxExprCallback = __ccgo_fp(_renameQuotefixExprCb) - (*(*TWalker)(unsafe.Pointer(bp + 308))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) - *(*uintptr)(unsafe.Pointer(bp + 308 + 24)) = bp + 288 + libc.Xmemset(tls, bp+284, 0, uint32(20)) + libc.Xmemset(tls, bp+304, 0, uint32(28)) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FpParse = bp + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxExprCallback = __ccgo_fp(_renameQuotefixExprCb) + (*(*TWalker)(unsafe.Pointer(bp + 304))).FxSelectCallback = __ccgo_fp(_renameColumnSelectCb) + *(*uintptr)(unsafe.Pointer(bp + 304 + 24)) = bp + 284 if (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 { if int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { pSelect = (*(*struct { FpSelect uintptr })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect - *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= uint32(^libc.Int32FromInt32(SF_View)) + *(*Tu32)(unsafe.Pointer(pSelect + 4)) &= ^libc.Uint32FromInt32(SF_View) (*(*TParse)(unsafe.Pointer(bp))).Frc = SQLITE_OK _sqlite3SelectPrep(tls, bp, pSelect, uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -166837,16 +159711,16 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin } rc = v1 if rc == SQLITE_OK { - _sqlite3WalkSelect(tls, bp+308, pSelect) + _sqlite3WalkSelect(tls, bp+304, pSelect) } } else { - _sqlite3WalkExprList(tls, bp+308, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FpCheck) + _sqlite3WalkExprList(tls, bp+304, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FpCheck) i = 0 for { if !(i < int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FnCol)) { break } - _sqlite3WalkExpr(tls, bp+308, _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FaCol+uintptr(i)*12)) + _sqlite3WalkExpr(tls, bp+304, _sqlite3ColumnExpr(tls, (*(*TParse)(unsafe.Pointer(bp))).FpNewTable, (*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FaCol+uintptr(i)*12)) goto _2 _2: ; @@ -166855,19 +159729,19 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin } } else { if (*(*TParse)(unsafe.Pointer(bp))).FpNewIndex != 0 { - _sqlite3WalkExprList(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FaColExpr) - _sqlite3WalkExpr(tls, bp+308, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) + _sqlite3WalkExprList(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FaColExpr) + _sqlite3WalkExpr(tls, bp+304, (*TIndex)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewIndex)).FpPartIdxWhere) } else { rc = _renameResolveTrigger(tls, bp) if rc == SQLITE_OK { - _renameWalkTrigger(tls, bp+308, (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger) + _renameWalkTrigger(tls, bp+304, (*(*TParse)(unsafe.Pointer(bp))).FpNewTrigger) } } } if rc == SQLITE_OK { - rc = _renameEditSql(tls, context, bp+288, zInput, uintptr(0), 0) + rc = _renameEditSql(tls, context, bp+284, zInput, uintptr(0), 0) } - _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 288))).FpList) + _renameTokenFree(tls, db, (*(*TRenameCtx)(unsafe.Pointer(bp + 284))).FpList) } if rc != SQLITE_OK { if _sqlite3WritableSchema(tls, db) != 0 && rc == int32(SQLITE_ERROR) { @@ -166909,12 +159783,13 @@ func _renameQuotefixFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uin // ** C. Otherwise return NULL. // */ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { - bp := tls.Alloc(336) - defer tls.Free(336) - var bNoDQS, bTemp, flags, i1, i2, isLegacy, rc int32 + bp := tls.Alloc(320) + defer tls.Free(320) + var bNoDQS, bTemp, i1, i2, isLegacy, rc int32 var db, zDb, zInput, zWhen uintptr + var flags Tu64 var xAuth Tsqlite3_xauth - var _ /* sNC at bp+288 */ TNameContext + var _ /* sNC at bp+284 */ TNameContext var _ /* sParse at bp+0 */ TParse _, _, _, _, _, _, _, _, _, _, _, _ = bNoDQS, bTemp, db, flags, i1, i2, isLegacy, rc, xAuth, zDb, zInput, zWhen db = Xsqlite3_context_db_handle(tls, context) @@ -166928,19 +159803,19 @@ func _renameTableTest(tls *libc.TLS, context uintptr, NotUsed int32, argv uintpt (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) _ = NotUsed if zDb != 0 && zInput != 0 { - flags = int32((*Tsqlite3)(unsafe.Pointer(db)).Fflags) + flags = (*Tsqlite3)(unsafe.Pointer(db)).Fflags if bNoDQS != 0 { *(*Tu64)(unsafe.Pointer(db + 32)) &= uint64(^(libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) } rc = _renameParseSql(tls, bp, zDb, db, zInput, bTemp) - *(*Tu64)(unsafe.Pointer(db + 32)) |= uint64(flags & (libc.Int32FromInt32(SQLITE_DqsDML) | libc.Int32FromInt32(SQLITE_DqsDDL))) + (*Tsqlite3)(unsafe.Pointer(db)).Fflags = flags if rc == SQLITE_OK { if isLegacy == 0 && (*(*TParse)(unsafe.Pointer(bp))).FpNewTable != 0 && int32((*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).FeTabType) == int32(TABTYP_VIEW) { - libc.Xmemset(tls, bp+288, 0, uint32(36)) - (*(*TNameContext)(unsafe.Pointer(bp + 288))).FpParse = bp + libc.Xmemset(tls, bp+284, 0, uint32(36)) + (*(*TNameContext)(unsafe.Pointer(bp + 284))).FpParse = bp _sqlite3SelectPrep(tls, bp, (*(*struct { FpSelect uintptr - })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect, bp+288) + })(unsafe.Pointer(&(*TTable)(unsafe.Pointer((*(*TParse)(unsafe.Pointer(bp))).FpNewTable)).Fu))).FpSelect, bp+284) if (*(*TParse)(unsafe.Pointer(bp))).FnErr != 0 { rc = (*(*TParse)(unsafe.Pointer(bp))).Frc } @@ -167007,7 +159882,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr pTab = (*(*TParse)(unsafe.Pointer(bp))).FpNewTable if pTab == uintptr(0) || int32((*TTable)(unsafe.Pointer(pTab)).FnCol) == int32(1) || iCol >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { /* This can happen if the sqlite_schema table is corrupt */ - rc = _sqlite3CorruptError(tls, int32(119044)) + rc = _sqlite3CorruptError(tls, int32(119904)) goto drop_column_done } pCol = _renameTokenFind(tls, bp, uintptr(0), (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) @@ -167024,7 +159899,7 @@ func _dropColumnFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr (*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz-- } } - zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12742, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) + zNew = _sqlite3MPrintf(tls, db, __ccgo_ts+12858, libc.VaList(bp+296, int32((*TRenameToken)(unsafe.Pointer(pCol)).Ft.Fz)-int32(zSql), zSql, zEnd)) Xsqlite3_result_text(tls, context, zNew, -int32(1), uintptr(-libc.Int32FromInt32(1))) Xsqlite3_free(tls, zNew) goto drop_column_done @@ -167079,23 +159954,23 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } iCol = _sqlite3ColumnIndex(tls, pTab, zCol) if iCol < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12364, libc.VaList(bp+8, pName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12480, libc.VaList(bp+8, pName)) goto exit_drop_column } /* Do not allow the user to drop a PRIMARY KEY column or a column ** constrained by a UNIQUE constraint. */ if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_PRIMKEY)|libc.Int32FromInt32(COLFLAG_UNIQUE)) != 0 { if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - v1 = __ccgo_ts + 12749 + v1 = __ccgo_ts + 12865 } else { - v1 = __ccgo_ts + 6979 + v1 = __ccgo_ts + 7067 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12761, libc.VaList(bp+8, v1, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12877, libc.VaList(bp+8, v1, zCol)) goto exit_drop_column } /* Do not allow the number of columns to go to zero */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) <= int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12789, libc.VaList(bp+8, zCol)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+12905, libc.VaList(bp+8, zCol)) goto exit_drop_column } /* Edit the sqlite_schema table */ @@ -167105,33 +159980,33 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_ALTER_TABLE), zDb, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol) != 0 { goto exit_drop_column } - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1673, 0) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+1674, 0) _renameFixQuotes(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1))) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+12837, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+12953, libc.VaList(bp+8, zDb, iDb, iCol, (*TTable)(unsafe.Pointer(pTab)).FzName)) /* Drop and reload the database schema. */ _renameReloadSchema(tls, pParse, iDb, uint16(INITFLAG_AlterDrop)) - _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+12958, int32(1)) + _renameTestSchema(tls, pParse, zDb, libc.BoolInt32(iDb == int32(1)), __ccgo_ts+13074, int32(1)) /* Edit rows of table on disk */ if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { pPk = uintptr(0) nField = 0 v = _sqlite3GetVdbe(tls, pParse) - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ iCur = v2 _sqlite3OpenTable(tls, pParse, iCur, iDb, pTab, int32(OP_OpenWrite)) addr = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), iCur) - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) reg = v4 if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), iCur, reg) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TIndex)(unsafe.Pointer(pPk)).FnColumn) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TIndex)(unsafe.Pointer(pPk)).FnColumn) i = 0 for { if !(i < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { @@ -167145,7 +160020,7 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } nField = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) } - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regRec = v7 @@ -167156,8 +160031,8 @@ func _sqlite3AlterDropColumn(tls *libc.TLS, pParse uintptr, pSrc uintptr, pName } if i != iCol && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) == 0 { if pPk != 0 { - iPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(i))) - iColPos = int32(_sqlite3TableColumnToIndex(tls, pPk, int16(iCol))) + iPos = _sqlite3TableColumnToIndex(tls, pPk, i) + iColPos = _sqlite3TableColumnToIndex(tls, pPk, iCol) if iPos < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) { goto _9 } @@ -167218,27 +160093,27 @@ var _aAlterTableFuncs = [5]TFuncDef{ 0: { FnArg: int16(9), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12976, + FzName: __ccgo_ts + 13092, }, 1: { FnArg: int16(7), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 12997, + FzName: __ccgo_ts + 13113, }, 2: { FnArg: int16(7), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 13017, + FzName: __ccgo_ts + 13133, }, 3: { FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 13036, + FzName: __ccgo_ts + 13152, }, 4: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT)), - FzName: __ccgo_ts + 13055, + FzName: __ccgo_ts + 13171, }, } @@ -167449,8 +160324,13 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW ** side-effect of the CREATE TABLE statement is to leave the rootpage ** of the new table in register pParse->regRoot. This is important ** because the OpenWrite opcode below will be needing it. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13158, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) - aRoot[i] = uint32((*TParse)(unsafe.Pointer(pParse)).FregRoot) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13274, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, _aTable[i].FzCols)) + aRoot[i] = uint32((*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot) aCreateTbl[i] = uint8(OPFLAG_P2ISREG) } } else { @@ -167460,10 +160340,10 @@ func _openStatTable(tls *libc.TLS, pParse uintptr, iDb int32, iStatCur int32, zW aRoot[i] = (*TTable)(unsafe.Pointer(pStat)).Ftnum _sqlite3TableLock(tls, pParse, iDb, aRoot[i], uint8(1), zTab) if zWhere != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13181, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13297, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab, zWhereType, zWhere)) } else { if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13211, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13327, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, zTab)) } else { /* The sqlite_stat[134] table already exists. Delete all rows. */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Clear), int32(aRoot[i]), iDb) @@ -167495,15 +160375,15 @@ var _aTable = [3]struct { FzCols uintptr }{ 0: { - FzName: __ccgo_ts + 13078, - FzCols: __ccgo_ts + 13091, + FzName: __ccgo_ts + 13194, + FzCols: __ccgo_ts + 13207, }, 1: { - FzName: __ccgo_ts + 13104, - FzCols: __ccgo_ts + 13117, + FzName: __ccgo_ts + 13220, + FzCols: __ccgo_ts + 13233, }, 2: { - FzName: __ccgo_ts + 13145, + FzName: __ccgo_ts + 13261, }, } @@ -167562,50 +160442,6 @@ type TStatSample = struct { type StatSample = TStatSample -type TStatSample1 = struct { - F__ccgo_align [0]uint32 - FanDLt uintptr - FanEq uintptr - FanLt uintptr - F__ccgo_align3 [4]byte - Fu struct { - F__ccgo_align [0]uint32 - FaRowid [0]uintptr - FiRowid Ti64 - } - FnRowid Tu32 - FisPSample Tu8 - FiCol int32 - FiHash Tu32 -} - -type StatSample1 = TStatSample1 - -type TStatAccum1 = struct { - F__ccgo_align [0]uint32 - Fdb uintptr - F__ccgo_align1 [4]byte - FnEst TtRowcnt - FnRow TtRowcnt - FnLimit int32 - FnCol int32 - FnKeyCol int32 - FnSkipAhead Tu8 - F__ccgo_align7 [3]byte - Fcurrent TStatSample - FnPSample TtRowcnt - FmxSample int32 - FiPrn Tu32 - FaBest uintptr - FiMin int32 - FnSample int32 - FnMaxEqZero int32 - FiGet int32 - Fa uintptr -} - -type StatAccum1 = TStatAccum1 - // C documentation // // /* Reclaim memory used by a StatSample @@ -167729,7 +160565,8 @@ func _statAccumDestructor(tls *libc.TLS, pOld uintptr) { // */ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var db, p, pSpace uintptr - var i, mxSample, n, nCol, nColUp, nKeyCol, v1, v2 int32 + var i, mxSample, nCol, nColUp, nKeyCol, v1, v2 int32 + var n Ti64 _, _, _, _, _, _, _, _, _, _, _ = db, i, mxSample, n, nCol, nColUp, nKeyCol, p, pSpace, v1, v2 /* Bytes of space to allocate */ db = Xsqlite3_context_db_handle(tls, context) if (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0) { @@ -167745,10 +160582,10 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { nColUp = nCol nKeyCol = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) /* Allocate the space required for the StatAccum object */ - n = int32(uint32(120) + uint32(8)*uint32(nColUp)) /* StatAccum.anDLt */ - n = int32(uint32(n) + libc.Uint32FromInt64(8)*uint32(nColUp)) /* StatAccum.anEq */ + n = int64(uint32(120) + uint32(8)*uint32(nColUp)) /* StatAccum.anDLt */ + n += int64(uint32(8) * uint32(nColUp)) /* StatAccum.anEq */ if mxSample != 0 { - n = int32(uint32(n) + (libc.Uint32FromInt64(8)*uint32(nColUp) + libc.Uint32FromInt64(40)*uint32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*uint32(nColUp)*uint32(nCol+mxSample))) + n += int64(uint32(8)*uint32(nColUp) + uint32(40)*uint32(nCol+mxSample) + libc.Uint32FromInt64(8)*libc.Uint32FromInt32(3)*uint32(nColUp)*uint32(nCol+mxSample)) } p = _sqlite3DbMallocZero(tls, db, uint64(n)) if p == uintptr(0) { @@ -167758,7 +160595,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { (*TStatAccum)(unsafe.Pointer(p)).Fdb = db (*TStatAccum)(unsafe.Pointer(p)).FnEst = uint64(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 2*4)))) (*TStatAccum)(unsafe.Pointer(p)).FnRow = uint64(0) - (*TStatAccum)(unsafe.Pointer(p)).FnLimit = int32(Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + (*TStatAccum)(unsafe.Pointer(p)).FnLimit = Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))) (*TStatAccum)(unsafe.Pointer(p)).FnCol = nCol (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol = nKeyCol (*TStatAccum)(unsafe.Pointer(p)).FnSkipAhead = uint8(0) @@ -167817,7 +160654,7 @@ func _statInit(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statInitFuncdef = TFuncDef{ FnArg: int16(4), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13229, + FzName: __ccgo_ts + 13345, } func init() { @@ -168191,7 +161028,7 @@ func _statPush(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statPushFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(2) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13239, + FzName: __ccgo_ts + 13355, } func init() { @@ -168241,7 +161078,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { v1 = (*TStatAccum)(unsafe.Pointer(p)).FnRow } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13249, libc.VaList(bp+56, v1)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13365, libc.VaList(bp+56, v1)) i = 0 for { if !(i < (*TStatAccum)(unsafe.Pointer(p)).FnKeyCol) { @@ -168252,7 +161089,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if iVal == uint64(2) && (*TStatAccum)(unsafe.Pointer(p)).FnRow*uint64(10) <= nDistinct*uint64(11) { iVal = uint64(1) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13254, libc.VaList(bp+56, iVal)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+13370, libc.VaList(bp+56, iVal)) goto _2 _2: ; @@ -168291,7 +161128,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { if !(i1 < (*TStatAccum)(unsafe.Pointer(p)).FnCol) { break } - Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+13260, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) + Xsqlite3_str_appendf(tls, bp+24, __ccgo_ts+13376, libc.VaList(bp+56, *(*TtRowcnt)(unsafe.Pointer(aCnt + uintptr(i1)*8)))) goto _3 _3: ; @@ -168309,7 +161146,7 @@ func _statGet(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { var _statGetFuncdef = TFuncDef{ FnArg: int16(libc.Int32FromInt32(1) + libc.Int32FromInt32(IsStat4)), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13266, + FzName: __ccgo_ts + 13382, } func init() { @@ -168375,7 +161212,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint /* Do not gather statistics on views or virtual tables */ return } - if Xsqlite3_strlike(tls, __ccgo_ts+13275, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { + if Xsqlite3_strlike(tls, __ccgo_ts+13391, (*TTable)(unsafe.Pointer(pTab)).FzName, uint32('\\')) == 0 { /* Do not gather statistics on system tables */ return } @@ -168384,12 +161221,12 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint return } if (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback != 0 { - pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(64)+libc.Uint32FromInt32(13))) + pStat1 = _sqlite3DbMallocZero(tls, db, uint64(libc.Uint32FromInt64(80)+libc.Uint32FromInt32(13))) if pStat1 == uintptr(0) { return } - (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*64 - libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+13078, uint32(13)) + (*TTable)(unsafe.Pointer(pStat1)).FzName = pStat1 + 1*80 + libc.Xmemcpy(tls, (*TTable)(unsafe.Pointer(pStat1)).FzName, __ccgo_ts+13194, uint32(13)) (*TTable)(unsafe.Pointer(pStat1)).FnCol = int16(3) (*TTable)(unsafe.Pointer(pStat1)).FiPKey = int16(-int32(1)) _sqlite3VdbeAddOp4(tls, (*TParse)(unsafe.Pointer(pParse)).FpVdbe, int32(OP_Noop), 0, 0, 0, pStat1, -int32(6)) @@ -168591,7 +161428,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint if !(j < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, regKey+j) goto _17 _17: @@ -168622,7 +161459,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint addrGotoEnd = 0 } _callStatGet(tls, pParse, regStat, STAT_GET_STAT1, regStat1) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13285, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13401, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP4(tls, v, -int32(1), pStat1, -int32(5)) @@ -168713,7 +161550,7 @@ func _analyzeOneTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uint _sqlite3VdbeAddOp2(tls, v, int32(OP_Count), iTabCur, regStat1) jZeroRows = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regStat1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regIdxname) - _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13285, 0) + _sqlite3VdbeAddOp4(tls, v, int32(OP_MakeRecord), regTabname, int32(3), regTemp, __ccgo_ts+13401, 0) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), iStatCur, regNewRowid) _sqlite3VdbeAddOp3(tls, v, int32(OP_Insert), iStatCur, regTemp, regNewRowid) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_APPEND)) @@ -168750,7 +161587,7 @@ func _analyzeDatabase(tls *libc.TLS, pParse uintptr, iDb int32) { pSchema = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) _openStatTable(tls, pParse, iDb, iStatCur, uintptr(0), uintptr(0)) iMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) iTab = (*TParse)(unsafe.Pointer(pParse)).FnTab @@ -168783,11 +161620,11 @@ func _analyzeTable(tls *libc.TLS, pParse uintptr, pTab uintptr, pOnlyIdx uintptr iDb = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab)).FpSchema) _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) iStatCur = (*TParse)(unsafe.Pointer(pParse)).FnTab - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) if pOnlyIdx != 0 { - _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+13289) + _openStatTable(tls, pParse, iDb, iStatCur, (*TIndex)(unsafe.Pointer(pOnlyIdx)).FzName, __ccgo_ts+13405) } else { - _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13293) + _openStatTable(tls, pParse, iDb, iStatCur, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+13409) } _analyzeOneTable(tls, pParse, pTab, pOnlyIdx, iStatCur, (*TParse)(unsafe.Pointer(pParse)).FnMem+int32(1), (*TParse)(unsafe.Pointer(pParse)).FnTab) _loadAnalysis(tls, pParse, iDb) @@ -168895,13 +161732,6 @@ type TanalysisInfo = struct { type analysisInfo = TanalysisInfo -type TanalysisInfo1 = struct { - Fdb uintptr - FzDatabase uintptr -} - -type analysisInfo1 = TanalysisInfo1 - // C documentation // // /* @@ -168916,7 +161746,7 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, _, _, _, _, _, _ = c, i, sz, v, z, v2 z = zIntArray if z == uintptr(0) { - z = __ccgo_ts + 1673 + z = __ccgo_ts + 1674 } i = 0 for { @@ -168951,17 +161781,17 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 2, 0x4) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 6, 0x40) for *(*int8)(unsafe.Pointer(z)) != 0 { - if Xsqlite3_strglob(tls, __ccgo_ts+13297, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13413, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 2, 0x4) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+13308, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13424, z) == 0 { sz = _sqlite3Atoi(tls, z+uintptr(3)) if sz < int32(2) { sz = int32(2) } (*TIndex)(unsafe.Pointer(pIndex)).FszIdxRow = _sqlite3LogEst(tls, uint64(sz)) } else { - if Xsqlite3_strglob(tls, __ccgo_ts+13318, z) == 0 { + if Xsqlite3_strglob(tls, __ccgo_ts+13434, z) == 0 { libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 6, 0x40) } } @@ -168973,13 +161803,6 @@ func _decodeIntArray(tls *libc.TLS, zIntArray uintptr, nOut int32, aOut uintptr, z++ } } - /* Set the bLowQual flag if the peak number of rows obtained - ** from a full equality match is so large that a full table scan - ** seems likely to be faster than using the index. - */ - if int32(*(*TLogEst)(unsafe.Pointer(aLog))) > int32(66) && int32(*(*TLogEst)(unsafe.Pointer(aLog))) <= int32(*(*TLogEst)(unsafe.Pointer(aLog + uintptr(nOut-int32(1))*2))) { - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 8, 0x100) - } } } @@ -169340,11 +162163,11 @@ func _loadStat4(tls *libc.TLS, db uintptr, zDb uintptr) (r int32) { _, _, _, _ = pStat4, rc, v1, v2 rc = SQLITE_OK if v2 = (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Stat4)) == uint32(0); v2 { - v1 = _sqlite3FindTable(tls, db, __ccgo_ts+13104, zDb) + v1 = _sqlite3FindTable(tls, db, __ccgo_ts+13220, zDb) pStat4 = v1 } if v2 && v1 != uintptr(0) && int32((*TTable)(unsafe.Pointer(pStat4)).FeTabType) == TABTYP_NORM { - rc = _loadStatTbl(tls, db, __ccgo_ts+13330, __ccgo_ts+13399, zDb) + rc = _loadStatTbl(tls, db, __ccgo_ts+13446, __ccgo_ts+13515, zDb) } return rc } @@ -169410,10 +162233,10 @@ func _sqlite3AnalysisLoad(tls *libc.TLS, db uintptr, iDb int32) (r int32) { /* Load new statistics out of the sqlite_stat1 table */ (*(*TanalysisInfo)(unsafe.Pointer(bp))).Fdb = db (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName - v3 = _sqlite3FindTable(tls, db, __ccgo_ts+13078, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) + v3 = _sqlite3FindTable(tls, db, __ccgo_ts+13194, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase) pStat1 = v3 if v3 != 0 && int32((*TTable)(unsafe.Pointer(pStat1)).FeTabType) == TABTYP_NORM { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13451, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+13567, libc.VaList(bp+16, (*(*TanalysisInfo)(unsafe.Pointer(bp))).FzDatabase)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -169526,7 +162349,7 @@ func _resolveAttachExpr(tls *libc.TLS, pName uintptr, pExpr uintptr) (r int32) { // ** database iDb attached to handle db. // */ func _sqlite3DbIsNamed(tls *libc.TLS, db uintptr, iDb int32, zName uintptr) (r int32) { - return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+8020, zName) == 0) + return libc.BoolInt32(_sqlite3StrICmp(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName) == 0 || iDb == 0 && _sqlite3StrICmp(tls, __ccgo_ts+8107, zName) == 0) } // C documentation @@ -169568,21 +162391,21 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { zFile = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) zName = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if zFile == uintptr(0) { - zFile = __ccgo_ts + 1673 + zFile = __ccgo_ts + 1674 } if zName == uintptr(0) { - zName = __ccgo_ts + 1673 + zName = __ccgo_ts + 1674 } if int32(uint32(*(*uint8)(unsafe.Pointer(db + 172 + 8))&0x4>>2)) != 0 { /* This is not a real ATTACH. Instead, this routine is being called ** from sqlite3_deserialize() to close database db->init.iDb and ** reopen it as a MemDB */ *(*uintptr)(unsafe.Pointer(bp + 20)) = uintptr(0) - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+5341) + *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_vfs_find(tls, __ccgo_ts+5429) if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { return } - rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+13492, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) + rc = _sqlite3BtreeOpen(tls, *(*uintptr)(unsafe.Pointer(bp + 16)), __ccgo_ts+13608, db, bp+20, 0, int32(SQLITE_OPEN_MAIN_DB)) if rc == SQLITE_OK { pNewSchema = _sqlite3SchemaGet(tls, db, *(*uintptr)(unsafe.Pointer(bp + 20))) if pNewSchema != 0 { @@ -169613,7 +162436,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { ** * Specified database name already being used. */ if (*Tsqlite3)(unsafe.Pointer(db)).FnDb >= *(*int32)(unsafe.Pointer(db + 120 + 7*4))+int32(2) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13495, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13611, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(db + 120 + 7*4)))) goto attach_error } i = 0 @@ -169622,7 +162445,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { break } if _sqlite3DbIsNamed(tls, db, i, zName) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13532, libc.VaList(bp+32, zName)) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13648, libc.VaList(bp+32, zName)) goto attach_error } goto _1 @@ -169640,7 +162463,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { } libc.Xmemcpy(tls, aNew, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, libc.Uint32FromInt64(16)*libc.Uint32FromInt32(2)) } else { - aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(uint32(16)*uint32((*Tsqlite3)(unsafe.Pointer(db)).FnDb+libc.Int32FromInt32(1)))) + aNew = _sqlite3DbRealloc(tls, db, (*Tsqlite3)(unsafe.Pointer(db)).FaDb, uint64(int64(16)*(int64(1)+int64((*Tsqlite3)(unsafe.Pointer(db)).FnDb)))) if aNew == uintptr(0) { return } @@ -169678,7 +162501,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { (*Tsqlite3)(unsafe.Pointer(db)).FnoSharedCache = uint8(0) if rc == int32(SQLITE_CONSTRAINT) { rc = int32(SQLITE_ERROR) - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13562, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13678, 0) } else { if rc == SQLITE_OK { (*TDb)(unsafe.Pointer(pNew)).FpSchema = _sqlite3SchemaGet(tls, db, (*TDb)(unsafe.Pointer(pNew)).FpBt) @@ -169686,7 +162509,7 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { rc = int32(SQLITE_NOMEM) } else { if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Ffile_format != 0 && int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pNew)).FpSchema)).Fenc) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13591, 0) + *(*uintptr)(unsafe.Pointer(bp + 12)) = _sqlite3MPrintf(tls, db, __ccgo_ts+13707, 0) rc = int32(SQLITE_ERROR) } } @@ -169730,10 +162553,10 @@ func _attachFunc(tls *libc.TLS, context uintptr, NotUsed int32, argv uintptr) { if rc == int32(SQLITE_NOMEM) || rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(12)<= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13687, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13803, libc.VaList(bp+136, zName)) goto detach_error } if i < int32(2) { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13708, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13824, libc.VaList(bp+136, zName)) goto detach_error } if _sqlite3BtreeTxnState(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != SQLITE_TXN_NONE || _sqlite3BtreeIsInBackup(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) != 0 { - Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13734, libc.VaList(bp+136, zName)) + Xsqlite3_snprintf(tls, int32(128), bp, __ccgo_ts+13850, libc.VaList(bp+136, zName)) goto detach_error } /* If any TEMP triggers reference the schema being detached, move those @@ -169898,7 +162721,7 @@ func _sqlite3Detach(tls *libc.TLS, pParse uintptr, pDbname uintptr) { var _detach_func = TFuncDef{ FnArg: int16(1), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13756, + FzName: __ccgo_ts + 13872, } func init() { @@ -169920,7 +162743,7 @@ func _sqlite3Attach(tls *libc.TLS, pParse uintptr, p uintptr, pDbname uintptr, p var _attach_func = TFuncDef{ FnArg: int16(3), FfuncFlags: uint32(SQLITE_UTF8), - FzName: __ccgo_ts + 13770, + FzName: __ccgo_ts + 13886, } func init() { @@ -169946,7 +162769,7 @@ func _fixExprCb(tls *libc.TLS, p uintptr, pExpr uintptr) (r int32) { if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TDbFixer)(unsafe.Pointer(pFix)).FpParse)).Fdb)).Finit1.Fbusy != 0 { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_NULL) } else { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13784, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13900, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType)) return int32(WRC_Abort) } } @@ -169980,7 +162803,7 @@ func _fixSelectCb(tls *libc.TLS, p uintptr, pSelect uintptr) (r int32) { if int32((*TDbFixer)(unsafe.Pointer(pFix)).FbTemp) == 0 && int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x4>>2) == 0 { if int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x10000>>16) == 0 && *(*uintptr)(unsafe.Pointer(pItem + 44)) != uintptr(0) { if iDb != _sqlite3FindDbName(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 44))) { - _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13808, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 44)))) + _sqlite3ErrorMsg(tls, (*TDbFixer)(unsafe.Pointer(pFix)).FpParse, __ccgo_ts+13924, libc.VaList(bp+8, (*TDbFixer)(unsafe.Pointer(pFix)).FzType, (*TDbFixer)(unsafe.Pointer(pFix)).FpName, *(*uintptr)(unsafe.Pointer(pItem + 44)))) return int32(WRC_Abort) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pItem + 44))) @@ -170107,6 +162930,8 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 return 0 } +type t__ccgo_fp__Xsqlite3_set_authorizer_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32 + /************** End of attach.c **********************************************/ /************** Begin file auth.c ********************************************/ /* @@ -170179,9 +163004,9 @@ func _sqlite3FixTriggerStep(tls *libc.TLS, pFix uintptr, pStep uintptr) (r int32 // ** Setting the auth function to NULL disables this hook. The default // ** setting of the auth function is NULL. // */ -func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uintptr) (r int32) { +func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, __ccgo_fp_xAuth uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = xAuth + (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = __ccgo_fp_xAuth (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg = pArg if (*Tsqlite3)(unsafe.Pointer(db)).FxAuth != 0 { _sqlite3ExpirePreparedStatements(tls, db, int32(1)) @@ -170197,7 +163022,7 @@ func Xsqlite3_set_authorizer(tls *libc.TLS, db uintptr, xAuth uintptr, pArg uint // ** user-supplied authorization function returned an illegal value. // */ func _sqliteAuthBadReturnCode(tls *libc.TLS, pParse uintptr) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13854, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13970, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_ERROR) } @@ -170225,11 +163050,11 @@ func _sqlite3AuthReadCol(tls *libc.TLS, pParse uintptr, zTab uintptr, zCol uintp } rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, int32(SQLITE_READ), zTab, zCol, zDb, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - z = Xsqlite3_mprintf(tls, __ccgo_ts+13877, libc.VaList(bp+8, zTab, zCol)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13993, libc.VaList(bp+8, zTab, zCol)) if (*Tsqlite3)(unsafe.Pointer(db)).FnDb > int32(2) || iDb != 0 { - z = Xsqlite3_mprintf(tls, __ccgo_ts+13883, libc.VaList(bp+8, zDb, z)) + z = Xsqlite3_mprintf(tls, __ccgo_ts+13999, libc.VaList(bp+8, zDb, z)) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13889, libc.VaList(bp+8, z)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14005, libc.VaList(bp+8, z)) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != int32(SQLITE_IGNORE) && rc != SQLITE_OK { @@ -170289,7 +163114,7 @@ func _sqlite3AuthRead(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSchema uint if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName } else { - zCol = __ccgo_ts + 9401 + zCol = __ccgo_ts + 9488 } } if int32(SQLITE_IGNORE) == _sqlite3AuthReadCol(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol, iDb) { @@ -170324,7 +163149,7 @@ func _sqlite3AuthCheck(tls *libc.TLS, pParse uintptr, code int32, zArg1 uintptr, ** parameters can be either NULL or a string. */ rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAuth})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAuthArg, code, zArg1, zArg2, zArg3, (*TParse)(unsafe.Pointer(pParse)).FzAuthContext) if rc == int32(SQLITE_DENY) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13916, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14032, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_AUTH) } else { if rc != SQLITE_OK && rc != int32(SQLITE_IGNORE) { @@ -170361,47 +163186,6 @@ func _sqlite3AuthContextPop(tls *libc.TLS, pContext uintptr) { } } -/************** End of auth.c ************************************************/ -/************** Begin file build.c *******************************************/ -/* -** 2001 September 15 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains C code routines that are called by the SQLite parser -** when syntax rules are reduced. The routines in this file handle the -** following kinds of SQL syntax: -** -** CREATE TABLE -** DROP TABLE -** CREATE INDEX -** DROP INDEX -** creating ID lists -** BEGIN TRANSACTION -** COMMIT -** ROLLBACK - */ -/* #include "sqliteInt.h" */ - -/* -** The TableLock structure is only used by the sqlite3TableLock() and -** codeTableLocks() functions. - */ -type TTableLock1 = struct { - FiDb int32 - FiTab TPgno - FisWriteLock Tu8 - FzLockName uintptr -} - -type TableLock1 = TTableLock1 - // C documentation // // /* @@ -170442,7 +163226,7 @@ func _lockTable(tls *libc.TLS, pParse uintptr, iDb int32, iTab TPgno, isWriteLoc nBytes = int32(uint32(16) * uint32((*TParse)(unsafe.Pointer(pToplevel)).FnTableLock+libc.Int32FromInt32(1))) (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock = _sqlite3DbReallocOrFree(tls, (*TParse)(unsafe.Pointer(pToplevel)).Fdb, (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock, uint64(nBytes)) if (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock != 0 { - v4 = pToplevel + 120 + v4 = pToplevel + 108 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ p = (*TParse)(unsafe.Pointer(pToplevel)).FaTableLock + uintptr(v3)*16 @@ -170540,7 +163324,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } if v != 0 { if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol != 0 { _sqlite3VdbeAddOp0(tls, v, int32(OP_FkCheck)) addrRewind = _sqlite3VdbeAddOp1(tls, v, int32(OP_Rewind), (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur) @@ -170618,7 +163404,7 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { */ if (*TParse)(unsafe.Pointer(pParse)).FpConstExpr != 0 { pEL = (*TParse)(unsafe.Pointer(pParse)).FpConstExpr - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) i = 0 for { if !(i < (*TExprList)(unsafe.Pointer(pEL)).FnExpr) { @@ -170632,7 +163418,9 @@ func _sqlite3FinishCoding(tls *libc.TLS, pParse uintptr) { } } if (*TParse)(unsafe.Pointer(pParse)).FbReturning != 0 { - pRet = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pRet = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if (*TReturning)(unsafe.Pointer(pRet)).FnRetCol != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), (*TReturning)(unsafe.Pointer(pRet)).FiRetCur, (*TReturning)(unsafe.Pointer(pRet)).FnRetCol) } @@ -170698,13 +163486,13 @@ func _sqlite3NestedParse(tls *libc.TLS, pParse uintptr, zFormat uintptr, va uint return } (*TParse)(unsafe.Pointer(pParse)).Fnested++ - libc.Xmemcpy(tls, bp, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemcpy(tls, bp, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_PreferBuiltin) _sqlite3RunParser(tls, pParse, zSql) (*Tsqlite3)(unsafe.Pointer(db)).FmDbFlags = savedDbFlags _sqlite3DbFree(tls, db, zSql) - libc.Xmemcpy(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), bp, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemcpy(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), bp, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*TParse)(unsafe.Pointer(pParse)).Fnested-- } @@ -170745,21 +163533,21 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp if i >= (*Tsqlite3)(unsafe.Pointer(db)).FnDb { /* No match against the official names. But always match "main" ** to schema 0 as a legacy fallback. */ - if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+8020) == 0 { + if _sqlite3StrICmp(tls, zDatabase, __ccgo_ts+8107) == 0 { i = 0 } else { return uintptr(0) } } p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, zName) - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) == 0 { + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) == 0 { if i == int32(1) { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7987+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8006+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7456+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+7968) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8074+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8093+7) == 0 || _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7542+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+8055) } } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8006+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, __ccgo_ts+7456) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8093+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FpSchema+8, __ccgo_ts+7542) } } } @@ -170789,12 +163577,12 @@ func _sqlite3FindTable(tls *libc.TLS, db uintptr, zName uintptr, zDatabase uintp ; i++ } - if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8006+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+7456) + if p == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8093+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FpSchema+8, __ccgo_ts+7542) } else { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7987+7) == 0 { - p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+7968) + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8074+7) == 0 { + p = _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema+8, __ccgo_ts+8055) } } } @@ -170832,7 +163620,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt ** can be an eponymous virtual table. */ if int32((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { pMod = _sqlite3HashFind(tls, db+404, zName) - if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+13931, int32(7)) == 0 { + if pMod == uintptr(0) && Xsqlite3_strnicmp(tls, zName, __ccgo_ts+14047, int32(7)) == 0 { pMod = _sqlite3PragmaVtabRegister(tls, db, zName) } if pMod != 0 && _sqlite3VtabEponymousTableInit(tls, pParse, pMod) != 0 { @@ -170842,7 +163630,7 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt if flags&uint32(LOCATE_NOERR) != 0 { return uintptr(0) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) } else { if int32((*TTable)(unsafe.Pointer(p)).FeTabType) == int32(TABTYP_VTAB) && int32((*TParse)(unsafe.Pointer(pParse)).FprepFlags)&int32(SQLITE_PREPARE_NO_VTAB) != 0 { p = uintptr(0) @@ -170850,15 +163638,15 @@ func _sqlite3LocateTable(tls *libc.TLS, pParse uintptr, flags Tu32, zName uintpt } if p == uintptr(0) { if flags&uint32(LOCATE_VIEW) != 0 { - v1 = __ccgo_ts + 13939 + v1 = __ccgo_ts + 14055 } else { - v1 = __ccgo_ts + 13952 + v1 = __ccgo_ts + 14068 } zMsg = v1 if zDbase != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8224, libc.VaList(bp+8, zMsg, zDbase, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8311, libc.VaList(bp+8, zMsg, zDbase, zName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8295, libc.VaList(bp+8, zMsg, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+8382, libc.VaList(bp+8, zMsg, zName)) } } else { } @@ -170896,12 +163684,12 @@ func _sqlite3LocateTableItem(tls *libc.TLS, pParse uintptr, flags Tu32, p uintpt // ** names into the new preferred names, as appropriate. // */ func _sqlite3PreferredTableName(tls *libc.TLS, zName uintptr) (r uintptr) { - if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) == 0 { - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7456+7) == 0 { - return __ccgo_ts + 8006 + if Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) == 0 { + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7542+7) == 0 { + return __ccgo_ts + 8093 } - if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+7968+7) == 0 { - return __ccgo_ts + 7987 + if _sqlite3StrICmp(tls, zName+uintptr(7), __ccgo_ts+8055+7) == 0 { + return __ccgo_ts + 8074 } } return zName @@ -171025,9 +163813,9 @@ func _sqlite3CollapseDatabaseArray(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { - _sqlite3DbFree(tls, db, (*TDb1)(unsafe.Pointer(pDb)).FzDbSName) - (*TDb1)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt == uintptr(0) { + _sqlite3DbFree(tls, db, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) + (*TDb)(unsafe.Pointer(pDb)).FzDbSName = uintptr(0) goto _1 } if j < i { @@ -171426,7 +164214,7 @@ func _sqlite3OpenSchemaTable(tls *libc.TLS, p uintptr, iDb int32) { var v uintptr _ = v v = _sqlite3GetVdbe(tls, p) - _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+7456) + _sqlite3TableLock(tls, p, iDb, uint32(SCHEMA_ROOT), uint8(1), __ccgo_ts+7542) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_OpenWrite), 0, int32(SCHEMA_ROOT), iDb, int32(5)) if (*TParse)(unsafe.Pointer(p)).FnTab == 0 { (*TParse)(unsafe.Pointer(p)).FnTab = int32(1) @@ -171458,7 +164246,7 @@ func _sqlite3FindDbName(tls *libc.TLS, db uintptr, zName uintptr) (r int32) { } /* "main" is always an acceptable alias for the primary database ** even if it has been renamed using SQLITE_DBCONFIG_MAINDBNAME. */ - if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+8020, zName) { + if i == 0 && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+8107, zName) { break } goto _1 @@ -171516,13 +164304,13 @@ func _sqlite3TwoPartName(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13966, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14082, 0) return -int32(1) } *(*uintptr)(unsafe.Pointer(pUnqual)) = pName2 iDb = _sqlite3FindDb(tls, db, pName1) if iDb < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+13983, libc.VaList(bp+8, pName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14099, libc.VaList(bp+8, pName1)) return -int32(1) } } else { @@ -171566,12 +164354,12 @@ func _sqlite3CheckObjectName(tls *libc.TLS, pParse uintptr, zName uintptr, zType } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if Xsqlite3_stricmp(tls, zType, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit))) != 0 || Xsqlite3_stricmp(tls, zName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 1*4))) != 0 || Xsqlite3_stricmp(tls, zTblName, *(*uintptr)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FazInit + 2*4))) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1673, 0) /* corruptSchema() will supply the error */ + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1674, 0) /* corruptSchema() will supply the error */ return int32(SQLITE_ERROR) } } else { - if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+7960, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14003, libc.VaList(bp+8, zName)) + if int32((*TParse)(unsafe.Pointer(pParse)).Fnested) == 0 && 0 == Xsqlite3_strnicmp(tls, zName, __ccgo_ts+8047, int32(7)) || _sqlite3ReadOnlyShadowTables(tls, db) != 0 && _sqlite3ShadowTableName(tls, db, zName) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14119, libc.VaList(bp+8, zName)) return int32(SQLITE_ERROR) } } @@ -171607,23 +164395,25 @@ func _sqlite3PrimaryKeyIndex(tls *libc.TLS, pTab uintptr) (r uintptr) { // ** find the (first) offset of that column in index pIdx. Or return -1 // ** if column iCol is not used in index pIdx. // */ -func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol Ti16) (r Ti16) { +func _sqlite3TableColumnToIndex(tls *libc.TLS, pIdx uintptr, iCol int32) (r int32) { var i int32 - _ = i + var iCol16 Ti16 + _, _ = i, iCol16 + iCol16 = int16(iCol) i = 0 for { if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { break } - if int32(iCol) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { - return int16(i) + if int32(iCol16) == int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) { + return i } goto _1 _1: ; i++ } - return int16(-int32(1)) + return -int32(1) } // C documentation @@ -171743,7 +164533,7 @@ func _sqlite3ForceNotReadOnly(tls *libc.TLS, pParse uintptr) { var iReg, v1 int32 var v, v2 uintptr _, _, _, _ = iReg, v, v1, v2 - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -171786,9 +164576,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* Special case: Parsing the sqlite_schema or sqlite_temp_schema schema */ iDb = int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zName = _sqlite3DbStrDup(tls, db, v1) *(*uintptr)(unsafe.Pointer(bp)) = pName1 @@ -171801,7 +164591,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 && (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) && iDb != int32(1) { /* If creating a temp table, the name may not be qualified. Unless ** the database name is "temp" anyway. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14045, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14161, 0) return } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp != 0 { @@ -171817,9 +164607,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui return } if isView != 0 { - v2 = __ccgo_ts + 12292 + v2 = __ccgo_ts + 12408 } else { - v2 = __ccgo_ts + 10554 + v2 = __ccgo_ts + 10670 } if _sqlite3CheckObjectName(tls, pParse, zName, v2, zName) != 0 { goto begin_table_error @@ -171829,9 +164619,9 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui } zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && isTemp == int32(1) { - v3 = __ccgo_ts + 7968 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7456 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto begin_table_error @@ -171855,11 +164645,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui if pTable != 0 { if !(noErr != 0) { if int32((*TTable)(unsafe.Pointer(pTable)).FeTabType) == int32(TABTYP_VIEW) { - v4 = __ccgo_ts + 12292 + v4 = __ccgo_ts + 12408 } else { - v4 = __ccgo_ts + 10554 + v4 = __ccgo_ts + 10670 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14086, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14202, libc.VaList(bp+16, v4, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -171867,11 +164657,11 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error } if _sqlite3FindIndex(tls, db, zName, zDb1) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14107, libc.VaList(bp+16, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14223, libc.VaList(bp+16, zName)) goto begin_table_error } } - pTable = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTable = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTable == uintptr(0) { (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -171903,19 +164693,29 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui /* If the file format and encoding in the database have not been set, ** set them now. */ - v9 = pParse + 48 + v9 = pParse + 52 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) v7 = v8 - (*TParse)(unsafe.Pointer(pParse)).FregRowid = v7 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid = v7 reg1 = v7 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) v10 = v11 - (*TParse)(unsafe.Pointer(pParse)).FregRoot = v10 + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot = v10 reg2 = v10 - v14 = pParse + 48 + v14 = pParse + 52 *(*int32)(unsafe.Pointer(v14))++ v13 = *(*int32)(unsafe.Pointer(v14)) reg3 = v13 @@ -171935,15 +164735,20 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui ** The record created does not contain anything yet. It will be replaced ** by the real entry in code generated at sqlite3EndTable(). ** - ** The rowid for the new entry is left in register pParse->regRowid. - ** The root page number of the new table is left in reg pParse->regRoot. + ** The rowid for the new entry is left in register pParse->u1.cr.regRowid. + ** The root page of the new table is left in reg pParse->u1.cr.regRoot. ** The rowid and root page number values are needed by the code that ** sqlite3EndTable will generate. */ if isView != 0 || isVirtual != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, reg2) } else { - *(*int32)(unsafe.Pointer(pParse + 148)) = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab = _sqlite3VdbeAddOp3(tls, v, int32(OP_CreateBtree), iDb, reg2, int32(BTREE_INTKEY)) } _sqlite3OpenSchemaTable(tls, pParse, iDb) _sqlite3VdbeAddOp2(tls, v, int32(OP_NewRowid), 0, reg1) @@ -171958,7 +164763,7 @@ func _sqlite3StartTable(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 ui goto begin_table_error begin_table_error: ; - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) _sqlite3DbFree(tls, db, zName) return } @@ -172019,7 +164824,7 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _, _, _ = db, pHash, pRet db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TParse)(unsafe.Pointer(pParse)).FpNewTrigger != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14142, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14258, 0) } else { } (*TParse)(unsafe.Pointer(pParse)).FbReturning = uint8(1) @@ -172028,14 +164833,16 @@ func _sqlite3AddReturning(tls *libc.TLS, pParse uintptr, pList uintptr) { _sqlite3ExprListDelete(tls, db, pList) return } - *(*uintptr)(unsafe.Pointer(pParse + 148)) = pRet + (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning = pRet (*TReturning)(unsafe.Pointer(pRet)).FpParse = pParse (*TReturning)(unsafe.Pointer(pRet)).FpReturnEL = pList _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3DeleteReturning), pRet) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return } - Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+14176, libc.VaList(bp+8, pParse)) + Xsqlite3_snprintf(tls, int32(40), pRet+104, __ccgo_ts+14292, libc.VaList(bp+8, pParse)) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.FzName = pRet + 104 (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Fop = uint8(TK_RETURNING) (*TReturning)(unsafe.Pointer(pRet)).FretTrig.Ftr_tm = uint8(TRIGGER_AFTER) @@ -172067,11 +164874,11 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok defer tls.Free(32) *(*TToken)(unsafe.Pointer(bp)) = _sName *(*TToken)(unsafe.Pointer(bp + 8)) = _sType - var aNew, db, p, pCol, z, zType, v1, p4 uintptr + var aNew, db, p, pCol, z, zType, v1, p3 uintptr var affinity int8 - var eType, hName, szEst Tu8 + var eType, h, szEst Tu8 var i int32 - _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, hName, i, p, pCol, szEst, z, zType, v1, p4 + _, _, _, _, _, _, _, _, _, _, _, _, _ = aNew, affinity, db, eType, h, i, p, pCol, szEst, z, zType, v1, p3 db = (*TParse)(unsafe.Pointer(pParse)).Fdb eType = uint8(COLTYPE_CUSTOM) szEst = uint8(1) @@ -172082,7 +164889,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok return } if int32((*TTable)(unsafe.Pointer(p)).FnCol)+int32(1) > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14196, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14312, libc.VaList(bp+24, (*TTable)(unsafe.Pointer(p)).FzName)) return } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -172092,12 +164899,12 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok ** by the parser, we can sometimes end up with a typename that ends ** with "generated always". Check for this case and omit the surplus ** text. */ - if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+14219, int32(6)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(16) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(6)), __ccgo_ts+14335, int32(6)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(6) for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- } - if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+14226, int32(9)) == 0 { + if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn >= uint32(9) && Xsqlite3_strnicmp(tls, (*(*TToken)(unsafe.Pointer(bp + 8))).Fz+uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-libc.Uint32FromInt32(9)), __ccgo_ts+14342, int32(9)) == 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn -= uint32(9) for (*(*TToken)(unsafe.Pointer(bp + 8))).Fn > uint32(0) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp + 8))).Fz + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn-uint32(1)))))])&int32(0x01) != 0 { (*(*TToken)(unsafe.Pointer(bp + 8))).Fn-- @@ -172139,21 +164946,10 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok libc.Xmemcpy(tls, z, (*(*TToken)(unsafe.Pointer(bp))).Fz, (*(*TToken)(unsafe.Pointer(bp))).Fn) *(*int8)(unsafe.Pointer(z + uintptr((*(*TToken)(unsafe.Pointer(bp))).Fn))) = 0 _sqlite3Dequote(tls, z) - hName = _sqlite3StrIHash(tls, z) - i = 0 - for { - if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { - break - } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FhName) == int32(hName) && _sqlite3StrICmp(tls, z, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(i)*12))).FzCnName) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14236, libc.VaList(bp+24, z)) - _sqlite3DbFree(tls, db, z) - return - } - goto _3 - _3: - ; - i++ + if (*TTable)(unsafe.Pointer(p)).FnCol != 0 && _sqlite3ColumnIndex(tls, p, z) >= 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14352, libc.VaList(bp+24, z)) + _sqlite3DbFree(tls, db, z) + return } aNew = _sqlite3DbRealloc(tls, db, (*TTable)(unsafe.Pointer(p)).FaCol, uint64((int64((*TTable)(unsafe.Pointer(p)).FnCol)+int64(1))*int64(12))) if aNew == uintptr(0) { @@ -172164,7 +164960,7 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr((*TTable)(unsafe.Pointer(p)).FnCol)*12 libc.Xmemset(tls, pCol, 0, uint32(12)) (*TColumn)(unsafe.Pointer(pCol)).FzCnName = z - (*TColumn)(unsafe.Pointer(pCol)).FhName = hName + (*TColumn)(unsafe.Pointer(pCol)).FhName = _sqlite3StrIHash(tls, z) if (*(*TToken)(unsafe.Pointer(bp + 8))).Fn == uint32(0) { /* If there is no type specified, columns have the default affinity ** 'BLOB' with a default size of 4 bytes. */ @@ -172177,12 +164973,21 @@ func _sqlite3AddColumn(tls *libc.TLS, pParse uintptr, _sName TToken, _sType TTok *(*int8)(unsafe.Pointer(zType + uintptr((*(*TToken)(unsafe.Pointer(bp + 8))).Fn))) = 0 _sqlite3Dequote(tls, zType) (*TColumn)(unsafe.Pointer(pCol)).Faffinity = _sqlite3AffinityType(tls, zType, pCol) - p4 = pCol + 10 - *(*Tu16)(unsafe.Pointer(p4)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p4))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + p3 = pCol + 10 + *(*Tu16)(unsafe.Pointer(p3)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p3))) | libc.Int32FromInt32(COLFLAG_HASTYPE)) + } + if int32((*TTable)(unsafe.Pointer(p)).FnCol) <= int32(0xff) { + h = uint8(uint32((*TColumn)(unsafe.Pointer(pCol)).FhName) % uint32(16)) + *(*Tu8)(unsafe.Pointer(p + 64 + uintptr(h))) = uint8((*TTable)(unsafe.Pointer(p)).FnCol) } (*TTable)(unsafe.Pointer(p)).FnCol++ (*TTable)(unsafe.Pointer(p)).FnNVCol++ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn = uint32(0) } // C documentation @@ -172354,10 +165159,10 @@ func _sqlite3AddDefaultValue(tls *libc.TLS, pParse uintptr, pExpr uintptr, zStar isInit = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb) != int32(1)) pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(p)).FnCol)-int32(1))*12 if !(_sqlite3ExprIsConstantOrFunction(tls, pExpr, uint8(isInit)) != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14262, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14378, libc.VaList(bp+64, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } else { if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14307, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14423, 0) } else { libc.Xmemset(tls, bp, 0, uint32(52)) (*(*TExpr)(unsafe.Pointer(bp))).Fop = uint8(TK_SPAN) @@ -172415,7 +165220,7 @@ func _makeColumnPartOfPrimaryKey(tls *libc.TLS, pParse uintptr, pCol uintptr) { p1 = pCol + 10 *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | libc.Int32FromInt32(COLFLAG_PRIMKEY)) if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14348, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14464, 0) } } @@ -172443,8 +165248,8 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError bp := tls.Alloc(16) defer tls.Free(16) var i, iCol, nTerm int32 - var pCExpr, pCExpr1, pCol, pTab, zCName uintptr - _, _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab, zCName + var pCExpr, pCExpr1, pCol, pTab uintptr + _, _, _, _, _, _, _ = i, iCol, nTerm, pCExpr, pCExpr1, pCol, pTab pTab = (*TParse)(unsafe.Pointer(pParse)).FpNewTable pCol = uintptr(0) iCol = -int32(1) @@ -172452,7 +165257,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError goto primary_key_exit } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_HasPrimaryKey) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14400, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14516, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto primary_key_exit } *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_HasPrimaryKey) @@ -172471,21 +165276,10 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError pCExpr = _sqlite3ExprSkipCollate(tls, (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).FpExpr) _sqlite3StringToId(tls, pCExpr) if int32((*TExpr)(unsafe.Pointer(pCExpr)).Fop) == int32(TK_ID) { - zCName = *(*uintptr)(unsafe.Pointer(pCExpr + 8)) - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName) == 0 { - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 - _makeColumnPartOfPrimaryKey(tls, pParse, pCol) - break - } - goto _2 - _2: - ; - iCol++ + iCol = _sqlite3ColumnIndex(tls, pTab, *(*uintptr)(unsafe.Pointer(pCExpr + 8))) + if iCol >= 0 { + pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 + _makeColumnPartOfPrimaryKey(tls, pParse, pCol) } } goto _1 @@ -172508,7 +165302,7 @@ func _sqlite3AddPrimaryKey(tls *libc.TLS, pParse uintptr, pList uintptr, onError _sqlite3HasExplicitNulls(tls, pParse, pList) } else { if autoInc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14441, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14557, 0) } else { _sqlite3CreateIndex(tls, pParse, uintptr(0), uintptr(0), uintptr(0), pList, onError, uintptr(0), uintptr(0), sortOrder, 0, uint8(SQLITE_IDXTYPE_PRIMARYKEY)) pList = uintptr(0) @@ -172536,8 +165330,13 @@ func _sqlite3AddCheckConstraint(tls *libc.TLS, pParse uintptr, pCheckExpr uintpt db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pTab != 0 && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == libc.Int32FromInt32(PARSE_MODE_DECLARE_VTAB)) && !(_sqlite3BtreeIsReadonly(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr((*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb)*16))).FpBt) != 0) { (*TTable)(unsafe.Pointer(pTab)).FpCheck = _sqlite3ExprListAppend(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pCheckExpr) - if (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn != 0 { - _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+84, int32(1)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn != 0 { + _sqlite3ExprListSetName(tls, pParse, (*TTable)(unsafe.Pointer(pTab)).FpCheck, pParse+188+12, int32(1)) } else { zStart++ for { @@ -172624,17 +165423,17 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui } pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-int32(1))*12 if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) == int32(PARSE_MODE_DECLARE_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14497, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14613, 0) goto generated_done } if int32((*TColumn)(unsafe.Pointer(pCol)).FiDflt) > 0 { goto generated_error } if pType != 0 { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+14540, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(7) && Xsqlite3_strnicmp(tls, __ccgo_ts+14656, (*TToken)(unsafe.Pointer(pType)).Fz, int32(7)) == 0 { /* no-op */ } else { - if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14548, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { + if (*TToken)(unsafe.Pointer(pType)).Fn == uint32(6) && Xsqlite3_strnicmp(tls, __ccgo_ts+14664, (*TToken)(unsafe.Pointer(pType)).Fz, int32(6)) == 0 { eType = uint8(COLFLAG_STORED) } else { goto generated_error @@ -172666,7 +165465,7 @@ func _sqlite3AddGenerated(tls *libc.TLS, pParse uintptr, pExpr uintptr, pType ui goto generated_error generated_error: ; - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14555, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14671, libc.VaList(bp+8, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) goto generated_done generated_done: ; @@ -172807,9 +165606,10 @@ func _identPut(tls *libc.TLS, z uintptr, pIdx uintptr, zSignedIdent uintptr) { // ** from sqliteMalloc() and must be freed by the calling function. // */ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { - bp := tls.Alloc(32) - defer tls.Free(32) - var i, len1, n, v2 int32 + bp := tls.Alloc(16) + defer tls.Free(16) + var i, len1, v2 int32 + var n Ti64 var pCol, zEnd, zSep, zSep2, zStmt, zType uintptr var _ /* k at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _ = i, len1, n, pCol, zEnd, zSep, zSep2, zStmt, zType, v2 @@ -172820,31 +165620,31 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - n += _identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5) + n += int64(_identLength(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) + int32(5)) goto _1 _1: ; i++ pCol += 12 } - n += _identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName) - if n < int32(50) { - zSep = __ccgo_ts + 1673 - zSep2 = __ccgo_ts + 14586 - zEnd = __ccgo_ts + 6480 + n += int64(_identLength(tls, (*TTable)(unsafe.Pointer(p)).FzName)) + if n < int64(50) { + zSep = __ccgo_ts + 1674 + zSep2 = __ccgo_ts + 14702 + zEnd = __ccgo_ts + 6568 } else { - zSep = __ccgo_ts + 14588 - zSep2 = __ccgo_ts + 14592 - zEnd = __ccgo_ts + 14597 + zSep = __ccgo_ts + 14704 + zSep2 = __ccgo_ts + 14708 + zEnd = __ccgo_ts + 14713 } - n += int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol) + n += int64(int32(35) + int32(6)*int32((*TTable)(unsafe.Pointer(p)).FnCol)) zStmt = _sqlite3DbMallocRaw(tls, uintptr(0), uint64(n)) if zStmt == uintptr(0) { _sqlite3OomFault(tls, db) return uintptr(0) } - Xsqlite3_snprintf(tls, n, zStmt, __ccgo_ts+14600, 0) - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Strlen30(tls, zStmt) + libc.Xmemcpy(tls, zStmt, __ccgo_ts+14716, uint32(13)) + *(*int32)(unsafe.Pointer(bp)) = int32(13) _identPut(tls, zStmt, bp, (*TTable)(unsafe.Pointer(p)).FzName) v2 = *(*int32)(unsafe.Pointer(bp)) *(*int32)(unsafe.Pointer(bp))++ @@ -172855,8 +165655,9 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { if !(i < int32((*TTable)(unsafe.Pointer(p)).FnCol)) { break } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, 0) - *(*int32)(unsafe.Pointer(bp)) += _sqlite3Strlen30(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp)))) + len1 = _sqlite3Strlen30(tls, zSep) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zSep, uint32(len1)) + *(*int32)(unsafe.Pointer(bp)) += len1 zSep = zSep2 _identPut(tls, zStmt, bp, (*TColumn)(unsafe.Pointer(pCol)).FzCnName) zType = _azType1[int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity)-int32(SQLITE_AFF_BLOB)] @@ -172869,17 +165670,18 @@ func _createTableStmt(tls *libc.TLS, db uintptr, p uintptr) (r uintptr) { i++ pCol += 12 } - Xsqlite3_snprintf(tls, n-*(*int32)(unsafe.Pointer(bp)), zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), __ccgo_ts+4710, libc.VaList(bp+16, zEnd)) + len1 = _sqlite3Strlen30(tls, zEnd) + libc.Xmemcpy(tls, zStmt+uintptr(*(*int32)(unsafe.Pointer(bp))), zEnd, uint32(len1+int32(1))) return zStmt } var _azType1 = [6]uintptr{ - 0: __ccgo_ts + 1673, - 1: __ccgo_ts + 14614, - 2: __ccgo_ts + 14620, - 3: __ccgo_ts + 14625, - 4: __ccgo_ts + 14630, - 5: __ccgo_ts + 14620, + 0: __ccgo_ts + 1674, + 1: __ccgo_ts + 14730, + 2: __ccgo_ts + 14736, + 3: __ccgo_ts + 14741, + 4: __ccgo_ts + 14746, + 5: __ccgo_ts + 14736, } // C documentation @@ -172888,15 +165690,16 @@ var _azType1 = [6]uintptr{ // ** Resize an Index object to hold N columns total. Return SQLITE_OK // ** on success and SQLITE_NOMEM on an OOM error. // */ -func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int32) { - var nByte int32 - var zExtra uintptr - _, _ = nByte, zExtra +func _resizeIndexObject(tls *libc.TLS, pParse uintptr, pIdx uintptr, N int32) (r int32) { + var db, zExtra uintptr + var nByte Tu64 + _, _, _ = db, nByte, zExtra if int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) >= N { return SQLITE_OK } - nByte = int32((libc.Uint32FromInt64(4) + libc.Uint32FromInt64(2) + libc.Uint32FromInt64(2) + libc.Uint32FromInt32(1)) * uint32(N)) - zExtra = _sqlite3DbMallocZero(tls, db, uint64(nByte)) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + nByte = uint64(libc.Uint32FromInt64(4)+libc.Uint32FromInt64(2)+libc.Uint32FromInt64(2)+libc.Uint32FromInt32(1)) * uint64(N) + zExtra = _sqlite3DbMallocZero(tls, db, nByte) if zExtra == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -172911,7 +165714,7 @@ func _resizeIndexObject(tls *libc.TLS, db uintptr, pIdx uintptr, N int32) (r int zExtra += uintptr(uint32(2) * uint32(N)) libc.Xmemcpy(tls, zExtra, (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder, uint32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) (*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder = zExtra - (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = uint16(N) + (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = uint16(N) /* See tag-20250221-1 above for proof of safety */ libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 4, 0x10) return SQLITE_OK } @@ -173144,8 +165947,18 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { /* Convert the P3 operand of the OP_CreateBtree opcode from BTREE_INTKEY ** into BTREE_BLOBKEY. */ - if *(*int32)(unsafe.Pointer(pParse + 148)) != 0 { - _sqlite3VdbeChangeP3(tls, v, *(*int32)(unsafe.Pointer(pParse + 148)), int32(BTREE_BLOBKEY)) + if (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab != 0 { + _sqlite3VdbeChangeP3(tls, v, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FaddrCrTab, int32(BTREE_BLOBKEY)) } /* Locate the PRIMARY KEY index. Or, if this table was originally ** an INTEGER PRIMARY KEY table, create a new PRIMARY KEY index. @@ -173245,7 +166058,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { (*TIndex)(unsafe.Pointer(pIdx)).FnColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol goto _6 } - if _resizeIndexObject(tls, db, pIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { + if _resizeIndexObject(tls, pParse, pIdx, int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)+n) != 0 { return } i = 0 @@ -173258,8 +166071,8 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(j)*2)) = *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)) *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(j)*4)) = *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FazColl + uintptr(i)*4)) if *(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaSortOrder + uintptr(i))) != 0 { - /* See ticket https://www.sqlite.org/src/info/bba7b69f9849b5bf */ - libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 10, 0x400) + /* See ticket https://sqlite.org/src/info/bba7b69f9849b5bf */ + libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 9, 0x200) } j++ } @@ -173289,7 +166102,7 @@ func _convertToWithoutRowidTable(tls *libc.TLS, pParse uintptr, pTab uintptr) { ; i++ } - if _resizeIndexObject(tls, db, pPk, nPk+nExtra) != 0 { + if _resizeIndexObject(tls, pParse, pPk, nPk+nExtra) != 0 { return } i = 0 @@ -173481,7 +166294,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { if pSelect != 0 || !(int32((*TTable)(unsafe.Pointer(p)).FeTabType) == libc.Int32FromInt32(TABTYP_NORM)) && (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1673, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1674, 0) return } (*TTable)(unsafe.Pointer(p)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum @@ -173508,9 +166321,9 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr pCol = (*TTable)(unsafe.Pointer(p)).FaCol + uintptr(ii)*12 if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf0>>4)) == COLTYPE_CUSTOM { if int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_HASTYPE) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14636, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1673))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14752, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1674))) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14669, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14785, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) } return } else { @@ -173531,11 +166344,11 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* Special processing for WITHOUT ROWID Tables */ if tabOpts&uint32(TF_WithoutRowid) != 0 { if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14696, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14812, 0) return } if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasPrimaryKey) == uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14746, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14862, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)) return } *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) @@ -173582,7 +166395,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr ii1++ } if nNG == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14778, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14894, 0) return } } @@ -173616,16 +166429,16 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr */ if int32((*TTable)(unsafe.Pointer(p)).FeTabType) == TABTYP_NORM { /* A regular table */ - zType = __ccgo_ts + 10554 - zType2 = __ccgo_ts + 14822 + zType = __ccgo_ts + 10670 + zType2 = __ccgo_ts + 14938 } else { /* A view */ - zType = __ccgo_ts + 12292 - zType2 = __ccgo_ts + 14828 + zType = __ccgo_ts + 12408 + zType2 = __ccgo_ts + 14944 } /* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT ** statement to populate the new table. The root-page number for the - ** new table is in register pParse->regRoot. + ** new table is in register pParse->u1.cr.regRoot. ** ** Once the SELECT has been coded by sqlite3Select(), it is in a ** suitable state to query for the column names and types to be used @@ -173642,24 +166455,29 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr (*TParse)(unsafe.Pointer(pParse)).FnErr++ return } - v5 = pParse + 44 + v5 = pParse + 48 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iCsr = v4 - v7 = pParse + 48 + v7 = pParse + 52 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regYield = v6 - v9 = pParse + 48 + v9 = pParse + 52 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) regRec = v8 - v11 = pParse + 48 + v11 = pParse + 52 *(*int32)(unsafe.Pointer(v11))++ v10 = *(*int32)(unsafe.Pointer(v11)) regRowid = v10 _sqlite3MayAbort(tls, pParse) - _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*TParse)(unsafe.Pointer(pParse)).FregRoot, iDb) + _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenWrite), iCsr, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot, iDb) _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_P2ISREG)) addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) @@ -173698,7 +166516,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr zStmt = _createTableStmt(tls, db, p) } else { if tabOpts != 0 { - v13 = pParse + 212 + v13 = pParse + 208 } else { v13 = pEnd } @@ -173707,13 +166525,23 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if int32(*(*int8)(unsafe.Pointer((*TToken)(unsafe.Pointer(pEnd2)).Fz))) != int32(';') { n = int32(uint32(n) + (*TToken)(unsafe.Pointer(pEnd2)).Fn) } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14833, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+14949, libc.VaList(bp+40, zType2, n, (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) } /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14848, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*TParse)(unsafe.Pointer(pParse)).FregRoot, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+14964, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zType, (*TTable)(unsafe.Pointer(p)).FzName, (*TTable)(unsafe.Pointer(p)).FzName, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRoot, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid)) _sqlite3DbFree(tls, db, zStmt) _sqlite3ChangeCookie(tls, pParse, iDb) /* Check to see if we need to create an sqlite_sequence table for @@ -173722,15 +166550,15 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_Autoincrement) != uint32(0) && !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != libc.Int32FromInt32(PARSE_MODE_NORMAL)) { pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 if (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).FpSeqTab == uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+14946, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15062, libc.VaList(bp+40, (*TDb)(unsafe.Pointer(pDb)).FzDbSName)) } } /* Reparse everything to update our internal data structures */ - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+14988, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+15104, libc.VaList(bp+40, (*TTable)(unsafe.Pointer(p)).FzName)), uint16(0)) /* Test for cycles in generated columns and illegal expressions ** in CHECK constraints and in DEFAULT clauses. */ if (*TTable)(unsafe.Pointer(p)).FtabFlags&uint32(TF_HasGenerated) != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+15022, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_SqlExec), int32(0x0001), 0, 0, _sqlite3MPrintf(tls, db, __ccgo_ts+15138, libc.VaList(bp+40, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(p)).FzName)), -int32(6)) } } /* Add the table to the in-memory representation of the database. @@ -173748,7 +166576,7 @@ func _sqlite3EndTable(tls *libc.TLS, pParse uintptr, pCons uintptr, pEnd uintptr /* If this is the magic sqlite_sequence table used by autoincrement, ** then record a pointer to this table in the main database structure ** so that INSERT can find the table easily. */ - if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+11076) == 0 { + if libc.Xstrcmp(tls, (*TTable)(unsafe.Pointer(p)).FzName, __ccgo_ts+11192) == 0 { (*TSchema)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FpSchema)).FpSeqTab = p } } @@ -173781,7 +166609,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*uintptr)(unsafe.Pointer(bp + 60)) = uintptr(0) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if int32((*TParse)(unsafe.Pointer(pParse)).FnVar) > 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15043, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15159, 0) goto create_view_fail } _sqlite3StartTable(tls, pParse, pName1, pName2, isTemp, int32(1), 0, noErr) @@ -173798,7 +166626,7 @@ func _sqlite3CreateView(tls *libc.TLS, pParse uintptr, pBegin uintptr, pName1 ui *(*Tu32)(unsafe.Pointer(p + 28)) |= uint32(TF_NoVisibleRowid) /* Never allow rowid in view */ _sqlite3TwoPartName(tls, pParse, pName1, pName2, bp+60) iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(p)).FpSchema) - _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+12292, *(*uintptr)(unsafe.Pointer(bp + 60))) + _sqlite3FixInit(tls, bp+8, pParse, iDb, __ccgo_ts+12408, *(*uintptr)(unsafe.Pointer(bp + 60))) if _sqlite3FixSelect(tls, bp+8, pSelect) != 0 { goto create_view_fail } @@ -173895,7 +166723,7 @@ func _viewGetColumnNames(tls *libc.TLS, pParse uintptr, pTable uintptr) (r int32 ** SELECT * FROM temp.ex1; */ if int32((*TTable)(unsafe.Pointer(pTable)).FnCol) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15079, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15195, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) return int32(1) } /* If we get this far, it means we need to compute the table names. @@ -174079,7 +166907,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { v = _sqlite3GetVdbe(tls, pParse) r1 = _sqlite3GetTempReg(tls, pParse) if iTable < int32(2) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15109, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15225, 0) } _sqlite3VdbeAddOp3(tls, v, int32(OP_Destroy), iTable, r1, iDb) _sqlite3MayAbort(tls, pParse) @@ -174092,7 +166920,7 @@ func _destroyRootPage(tls *libc.TLS, pParse uintptr, iTable int32, iDb int32) { ** is in register NNN. See grammar rules associated with the TK_REGISTER ** token for additional information. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15124, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*16))).FzDbSName, iTable, r1, r1)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15240, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FaDb + uintptr(iDb)*16))).FzDbSName, iTable, r1, r1)) _sqlite3ReleaseTempReg(tls, pParse, r1) } @@ -174175,9 +167003,9 @@ func _sqlite3ClearStatTables(tls *libc.TLS, pParse uintptr, iDb int32, zType uin if !(i <= int32(4)) { break } - Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+15191, libc.VaList(bp+32, i)) + Xsqlite3_snprintf(tls, int32(24), bp, __ccgo_ts+15307, libc.VaList(bp+32, i)) if _sqlite3FindTable(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, bp, zDbName) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+13181, libc.VaList(bp+32, zDbName, bp, zType, zName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+13297, libc.VaList(bp+32, zDbName, bp, zType, zName)) } goto _1 _1: @@ -174218,7 +167046,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** move as a result of the drop (can happen in auto-vacuum mode). */ if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != 0 { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15205, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15321, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) } /* Drop all entries in the schema table that refer to the ** table. The program name loops through the schema table and deletes @@ -174227,7 +167055,7 @@ func _sqlite3CodeDropTable(tls *libc.TLS, pParse uintptr, pTab uintptr, iDb int3 ** created in the temp database that refers to a table in another ** database. */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+15250, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+15366, libc.VaList(bp+8, (*TDb)(unsafe.Pointer(pDb)).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName)) if !(isView != 0) && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) { _destroyTable(tls, pParse, pTab) } @@ -174262,11 +167090,11 @@ func _sqlite3ReadOnlyShadowTables(tls *libc.TLS, db uintptr) (r int32) { // ** Return true if it is not allowed to drop the given table // */ func _tableMayNotBeDropped(tls *libc.TLS, db uintptr, pTab uintptr) (r int32) { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) == 0 { - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+15317, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+15433, int32(4)) == 0 { return 0 } - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+8762, int32(10)) == 0 { + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName+uintptr(7), __ccgo_ts+8849, int32(10)) == 0 { return 0 } return int32(1) @@ -174321,9 +167149,9 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zTab = v1 zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName @@ -174356,18 +167184,18 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 goto exit_drop_table } if _tableMayNotBeDropped(tls, db, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15322, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15438, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Ensure DROP TABLE is not used on a view, and DROP VIEW is not used ** on a table. */ if isView != 0 && !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15350, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15466, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } if !(isView != 0) && int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15384, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15500, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_drop_table } /* Generate code to remove the table from the schema table @@ -174377,7 +167205,7 @@ func _sqlite3DropTable(tls *libc.TLS, pParse uintptr, pName uintptr, isView int3 if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) if !(isView != 0) { - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13293, (*TTable)(unsafe.Pointer(pTab)).FzName) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13409, (*TTable)(unsafe.Pointer(pTab)).FzName) _sqlite3FkDropTable(tls, pParse, pName, pTab) } _sqlite3CodeDropTable(tls, pParse, pTab, iDb, isView) @@ -174425,19 +167253,19 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p goto fk_end } if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15416, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*12))).FzCnName, pTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15532, libc.VaList(bp+8, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(p)).FaCol + uintptr(iCol)*12))).FzCnName, pTo)) goto fk_end } nCol = int32(1) } else { if pToCol != 0 && (*TExprList)(unsafe.Pointer(pToCol)).FnExpr != (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15479, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15595, 0) goto fk_end } else { nCol = (*TExprList)(unsafe.Pointer(pFromCol)).FnExpr } } - nByte = int64(uint32(44) + uint32(nCol-libc.Int32FromInt32(1))*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) + nByte = int64(uint32(libc.UintptrFromInt32(0)+36) + uint32(nCol)*uint32(8) + (*TToken)(unsafe.Pointer(pTo)).Fn + uint32(1)) if pToCol != 0 { i = 0 for { @@ -174494,7 +167322,7 @@ func _sqlite3CreateForeignKey(tls *libc.TLS, pParse uintptr, pFromCol uintptr, p j++ } if j >= int32((*TTable)(unsafe.Pointer(p)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15573, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15689, libc.VaList(bp+8, (*(*TExprList_item)(unsafe.Pointer(pFromCol + 8 + uintptr(i)*20))).FzEName)) goto fk_end } if int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= int32(PARSE_MODE_RENAME) { @@ -174609,11 +167437,11 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP var _ /* iPartIdxLabel at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addr2, db, iDb, iIdx, iSorter, iTab, j2, pKey, pTab, regRecord, tnum, v, v1, v2, v3, v4, v5, v6, v7 pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ /* The table that is indexed */ iTab = v1 - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ /* Btree cursor used for pTab */ iIdx = v3 /* Register holding assembled index record */ @@ -174635,7 +167463,7 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP } pKey = _sqlite3KeyInfoOfIndex(tls, pParse, pIndex) /* Open the sorter cursor if we are to use one. */ - v6 = pParse + 44 + v6 = pParse + 48 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ iSorter = v5 @@ -174680,13 +167508,13 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP addr2 = _sqlite3VdbeCurrentAddr(tls, v) } _sqlite3VdbeAddOp3(tls, v, int32(OP_SorterData), iSorter, regRecord, iIdx) - if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x400>>10)) != 0) { + if !(int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x200>>9)) != 0) { /* This OP_SeekEnd opcode makes index insert for a REINDEX go much ** faster by avoiding unnecessary seeks. But the optimization does ** not work for UNIQUE constraint indexes on WITHOUT ROWID tables ** with DESC primary keys, since those indexes have there keys in ** a different order from the main table. - ** See ticket: https://www.sqlite.org/src/info/bba7b69f9849b5bf + ** See ticket: https://sqlite.org/src/info/bba7b69f9849b5bf */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SeekEnd), iIdx) } @@ -174709,23 +167537,23 @@ func _sqlite3RefillIndex(tls *libc.TLS, pParse uintptr, pIndex uintptr, memRootP // ** of 8-byte aligned space after the Index object and return a // ** pointer to this extra space in *ppExtra. // */ -func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol Ti16, nExtra int32, ppExtra uintptr) (r uintptr) { - var nByte int32 +func _sqlite3AllocateIndexObject(tls *libc.TLS, db uintptr, nCol int32, nExtra int32, ppExtra uintptr) (r uintptr) { + var nByte Ti64 var p, pExtra uintptr - _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ - nByte = int32((libc.Uint32FromInt64(104)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + (uint32(4)*uint32(nCol)+uint32(7))&uint32(^libc.Int32FromInt32(7)) + (uint32(2)*uint32(int32(nCol)+libc.Int32FromInt32(1))+uint32(2)*uint32(nCol)+uint32(1)*uint32(nCol)+uint32(7))&uint32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ - p = _sqlite3DbMallocZero(tls, db, uint64(nByte+nExtra)) + _, _, _ = nByte, p, pExtra /* Bytes of space for Index object + arrays */ + nByte = int64((libc.Uint32FromInt64(104)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7)) + (uint32(4)*uint32(nCol)+uint32(7))&uint32(^libc.Int32FromInt32(7)) + (uint32(2)*uint32(nCol+libc.Int32FromInt32(1))+uint32(2)*uint32(nCol)+uint32(1)*uint32(nCol)+uint32(7))&uint32(^libc.Int32FromInt32(7))) /* Index.aSortOrder */ + p = _sqlite3DbMallocZero(tls, db, uint64(nByte+int64(nExtra))) if p != 0 { pExtra = p + uintptr((libc.Uint32FromInt64(104)+libc.Uint32FromInt32(7))&uint32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FazColl = pExtra pExtra += uintptr((libc.Uint32FromInt64(4)*uint32(nCol) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) (*TIndex)(unsafe.Pointer(p)).FaiRowLogEst = pExtra - pExtra += uintptr(uint32(2) * uint32(int32(nCol)+libc.Int32FromInt32(1))) + pExtra += uintptr(uint32(2) * uint32(nCol+libc.Int32FromInt32(1))) (*TIndex)(unsafe.Pointer(p)).FaiColumn = pExtra pExtra += uintptr(uint32(2) * uint32(nCol)) (*TIndex)(unsafe.Pointer(p)).FaSortOrder = pExtra (*TIndex)(unsafe.Pointer(p)).FnColumn = uint16(nCol) - (*TIndex)(unsafe.Pointer(p)).FnKeyCol = uint16(int32(nCol) - int32(1)) + (*TIndex)(unsafe.Pointer(p)).FnKeyCol = uint16(nCol - libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(ppExtra)) = p + uintptr(nByte) } return p @@ -174754,11 +167582,11 @@ func _sqlite3HasExplicitNulls(tls *libc.TLS, pParse uintptr, pList uintptr) (r i if int32(uint32(*(*uint16)(unsafe.Pointer(pList + 8 + uintptr(i)*20 + 8 + 4))&0x20>>5)) != 0 { sf = (*(*TExprList_item)(unsafe.Pointer(pList + 8 + uintptr(i)*20))).Ffg.FsortFlags if int32(sf) == 0 || int32(sf) == int32(3) { - v2 = __ccgo_ts + 15619 + v2 = __ccgo_ts + 15735 } else { - v2 = __ccgo_ts + 15625 + v2 = __ccgo_ts + 15741 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15630, libc.VaList(bp+8, v2)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15746, libc.VaList(bp+8, v2)) return int32(1) } goto _1 @@ -174836,7 +167664,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = int32(1) } } - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15658, *(*uintptr)(unsafe.Pointer(bp + 52))) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+15774, *(*uintptr)(unsafe.Pointer(bp + 52))) if _sqlite3FixSrcList(tls, bp, pTblName) != 0 { /* Because the parser constructs pTblName from a single identifier, ** sqlite3FixSrcList can never fail. */ @@ -174846,7 +167674,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u goto exit_create_index } if iDb == int32(1) && (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema != (*TTable)(unsafe.Pointer(pTab)).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15664, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15780, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if !((*TTable)(unsafe.Pointer(pTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { @@ -174860,16 +167688,16 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16 - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15714, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 && pTblName != uintptr(0) { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15830, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName)) goto exit_create_index } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15742, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15858, 0) goto exit_create_index } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15767, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15883, 0) goto exit_create_index } /* @@ -174890,19 +167718,19 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if zName == uintptr(0) { goto exit_create_index } - if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+15658, (*TTable)(unsafe.Pointer(pTab)).FzName) { + if SQLITE_OK != _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+15774, (*TTable)(unsafe.Pointer(pTab)).FzName) { goto exit_create_index } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if !((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0) { if _sqlite3FindTable(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15801, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15917, libc.VaList(bp+80, zName)) goto exit_create_index } } if _sqlite3FindIndex(tls, db, zName, (*TDb)(unsafe.Pointer(pDb)).FzDbSName) != uintptr(0) { if !(ifNotExist != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15835, libc.VaList(bp+80, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15951, libc.VaList(bp+80, zName)) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) _sqlite3ForceNotReadOnly(tls, pParse) @@ -174923,7 +167751,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pLoop = (*TIndex)(unsafe.Pointer(pLoop)).FpNext n++ } - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+15859, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+15975, libc.VaList(bp+80, (*TTable)(unsafe.Pointer(pTab)).FzName, n)) if zName == uintptr(0) { goto exit_create_index } @@ -174941,9 +167769,9 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { zDb = (*TDb)(unsafe.Pointer(pDb)).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7968 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7456 + v2 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v2, uintptr(0), zDb) != 0 { goto exit_create_index @@ -174971,7 +167799,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } _sqlite3ExprListSetSortOrder(tls, pList, sortOrder, -int32(1)) } else { - _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+15658) + _sqlite3ExprListCheckLength(tls, pParse, pList, __ccgo_ts+15774) if (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { goto exit_create_index } @@ -175003,7 +167831,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u v5 = int32(1) } nExtraCol = v5 - pIndex = _sqlite3AllocateIndexObject(tls, db, int16((*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol), nName+nExtra+int32(1), bp+56) + pIndex = _sqlite3AllocateIndexObject(tls, db, (*TExprList)(unsafe.Pointer(pList)).FnExpr+nExtraCol, nName+nExtra+int32(1), bp+56) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto exit_create_index } @@ -175055,7 +167883,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u pCExpr = _sqlite3ExprSkipCollate(tls, (*TExprList_item)(unsafe.Pointer(pListItem)).FpExpr) if int32((*TExpr)(unsafe.Pointer(pCExpr)).Fop) != int32(TK_COLUMN) { if pTab == (*TParse)(unsafe.Pointer(pParse)).FpNewTable { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15882, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15998, 0) goto exit_create_index } if (*TIndex)(unsafe.Pointer(pIndex)).FaColExpr == uintptr(0) { @@ -175065,7 +167893,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u j = -int32(2) *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(-libc.Int32FromInt32(2)) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 11, 0x800) } else { j = int32((*TExpr)(unsafe.Pointer(pCExpr)).FiColumn) if j < 0 { @@ -175075,8 +167903,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 3, 0x8) } if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_VIRTUAL) != 0 { + libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 10, 0x400) libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 11, 0x800) - libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(1), 12, 0x1000) } } *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIndex)).FaiColumn + uintptr(i)*2)) = int16(j) @@ -175154,7 +167982,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { goto _8 } - if int32(_sqlite3TableColumnToIndex(tls, pIndex, int16(j))) >= 0 { + if _sqlite3TableColumnToIndex(tls, pIndex, j) >= 0 { goto _8 } libc.SetBitFieldPtr16Uint32(pIndex+56, libc.Uint32FromInt32(0), 5, 0x20) @@ -175202,7 +168030,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u ** explicitly specified behavior for the index. */ if !(int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) || int32((*TIndex)(unsafe.Pointer(pIndex)).FonError) == int32(OE_Default)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15943, libc.VaList(bp+80, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16059, libc.VaList(bp+80, 0)) } if int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Default) { (*TIndex)(unsafe.Pointer(pIdx)).FonError = (*TIndex)(unsafe.Pointer(pIndex)).FonError @@ -175232,8 +168060,8 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != uintptr(0) { (*TIndex)(unsafe.Pointer(pIndex)).Ftnum = (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum if _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+15985, 0) - (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(126496)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16101, 0) + (*TParse)(unsafe.Pointer(pParse)).Frc = _sqlite3CorruptError(tls, int32(127382)) goto exit_create_index } } @@ -175246,7 +168074,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_SchemaChange) } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || pTblName != uintptr(0) { - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iMem = v11 @@ -175273,11 +168101,11 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* A named index with an explicit CREATE INDEX statement */ if onError == OE_None { - v13 = __ccgo_ts + 1673 + v13 = __ccgo_ts + 1674 } else { - v13 = __ccgo_ts + 16002 + v13 = __ccgo_ts + 16118 } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16010, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+16126, libc.VaList(bp+80, v13, n1, (*TToken)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 52)))).Fz)) } else { /* An automatic index created by a PRIMARY KEY or UNIQUE constraint */ /* zStmt = sqlite3MPrintf(""); */ @@ -175285,7 +168113,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u } /* Add an entry in sqlite_schema for this index */ - _sqlite3NestedParse(tls, pParse, __ccgo_ts+16030, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+16146, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, iMem, zStmt)) _sqlite3DbFree(tls, db, zStmt) /* Fill the index with data and reparse the schema. Code an OP_Expire ** to invalidate all pre-compiled statements. @@ -175293,7 +168121,7 @@ func _sqlite3CreateIndex(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 u if pTblName != 0 { _sqlite3RefillIndex(tls, pParse, pIndex, iMem) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+16089, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+16205, libc.VaList(bp+80, (*TIndex)(unsafe.Pointer(pIndex)).FzName)), uint16(0)) _sqlite3VdbeAddOp2(tls, v, int32(OP_Expire), 0, int32(1)) } _sqlite3VdbeJumpHere(tls, v, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum)) @@ -175456,16 +168284,16 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pIndex = _sqlite3FindIndex(tls, db, (*(*TSrcItem)(unsafe.Pointer(pName + 8))).FzName, *(*uintptr)(unsafe.Pointer(pName + 8 + 44))) if pIndex == uintptr(0) { if !(ifExists != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16116, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16232, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, *(*uintptr)(unsafe.Pointer(pName + 8 + 44))) _sqlite3ForceNotReadOnly(tls, pParse) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto exit_drop_index } if int32(uint32(*(*uint16)(unsafe.Pointer(pIndex + 56))&0x3>>0)) != SQLITE_IDXTYPE_APPDEF { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16134, libc.VaList(bp+8, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16250, libc.VaList(bp+8, 0)) goto exit_drop_index } iDb = _sqlite3SchemaToIndex(tls, db, (*TIndex)(unsafe.Pointer(pIndex)).FpSchema) @@ -175473,9 +168301,9 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in pTab = (*TIndex)(unsafe.Pointer(pIndex)).FpTable zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zTab = v1 if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_DELETE), zTab, uintptr(0), zDb) != 0 { @@ -175491,8 +168319,8 @@ func _sqlite3DropIndex(tls *libc.TLS, pParse uintptr, pName uintptr, ifExists in v = _sqlite3GetVdbe(tls, pParse) if v != 0 { _sqlite3BeginWriteOperation(tls, pParse, int32(1), iDb) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+16207, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) - _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13289, (*TIndex)(unsafe.Pointer(pIndex)).FzName) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+16323, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TIndex)(unsafe.Pointer(pIndex)).FzName)) + _sqlite3ClearStatTables(tls, pParse, iDb, __ccgo_ts+13405, (*TIndex)(unsafe.Pointer(pIndex)).FzName) _sqlite3ChangeCookie(tls, pParse, iDb) _destroyRootPage(tls, pParse, int32((*TIndex)(unsafe.Pointer(pIndex)).Ftnum), iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropIndex), iDb, 0, 0, (*TIndex)(unsafe.Pointer(pIndex)).FzName, 0) @@ -175565,12 +168393,12 @@ func _sqlite3IdListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pToken u _, _, _, _, _ = db, i, pNew, v1, v2 db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocZero(tls, db, uint64(8)) + pList = _sqlite3DbMallocZero(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+4)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) if pList == uintptr(0) { return uintptr(0) } } else { - pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(8)+uint32((*TIdList)(unsafe.Pointer(pList)).FnId)*uint32(4))) + pNew = _sqlite3DbRealloc(tls, db, pList, uint64(uint32(libc.UintptrFromInt32(0)+4)+uint32((*TIdList)(unsafe.Pointer(pList)).FnId+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) if pNew == uintptr(0) { _sqlite3IdListDelete(tls, db, pList) return uintptr(0) @@ -175682,13 +168510,13 @@ func _sqlite3SrcListEnlarge(tls *libc.TLS, pParse uintptr, pSrc uintptr, nExtra nAlloc = int64(2)*int64((*TSrcList)(unsafe.Pointer(pSrc)).FnSrc) + int64(nExtra) db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc+nExtra >= int32(SQLITE_MAX_SRCLIST) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16267, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16383, libc.VaList(bp+8, int32(SQLITE_MAX_SRCLIST))) return uintptr(0) } if nAlloc > int64(SQLITE_MAX_SRCLIST) { nAlloc = int64(SQLITE_MAX_SRCLIST) } - pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(int64(56)+(nAlloc-int64(1))*int64(48))) + pNew = _sqlite3DbRealloc(tls, db, pSrc, uint64(int64(uint32(libc.UintptrFromInt32(0)+8))+nAlloc*libc.Int64FromInt64(48))) if pNew == uintptr(0) { return uintptr(0) } @@ -175769,7 +168597,7 @@ func _sqlite3SrcListAppend(tls *libc.TLS, pParse uintptr, pList uintptr, pTable /* Cannot have C without B */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb if pList == uintptr(0) { - pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + pList = _sqlite3DbMallocRawNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(48))) if pList == uintptr(0) { return uintptr(0) } @@ -175819,7 +168647,7 @@ func _sqlite3SrcListAssignCursors(tls *libc.TLS, pParse uintptr, pList uintptr) if (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor >= 0 { goto _1 } - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v2 @@ -175990,11 +168818,11 @@ func _sqlite3SrcListAppendFromTerm(tls *libc.TLS, pParse uintptr, p uintptr, pTa db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !(p != 0) && pOnUsing != uintptr(0) && ((*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 || (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpUsing != 0) { if (*TOnOrUsing)(unsafe.Pointer(pOnUsing)).FpOn != 0 { - v1 = __ccgo_ts + 16303 + v1 = __ccgo_ts + 16419 } else { - v1 = __ccgo_ts + 16306 + v1 = __ccgo_ts + 16422 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16312, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16428, libc.VaList(bp+8, v1)) goto append_from_error } p = _sqlite3SrcListAppend(tls, pParse, p, pTable, pDatabase) @@ -176193,7 +169021,7 @@ func _sqlite3BeginTransaction(tls *libc.TLS, pParse uintptr, type1 int32) { var eTxnType, i int32 _, _, _, _, _ = db, eTxnType, i, pBt, v db = (*TParse)(unsafe.Pointer(pParse)).Fdb - if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+16348, uintptr(0), uintptr(0)) != 0 { + if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), __ccgo_ts+16464, uintptr(0), uintptr(0)) != 0 { return } v = _sqlite3GetVdbe(tls, pParse) @@ -176240,9 +169068,9 @@ func _sqlite3EndTransaction(tls *libc.TLS, pParse uintptr, eType int32) { _, _, _ = isRollback, v, v1 isRollback = libc.BoolInt32(eType == int32(TK_ROLLBACK)) if isRollback != 0 { - v1 = __ccgo_ts + 16354 + v1 = __ccgo_ts + 16470 } else { - v1 = __ccgo_ts + 16363 + v1 = __ccgo_ts + 16479 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_TRANSACTION), v1, uintptr(0), uintptr(0)) != 0 { return @@ -176274,9 +169102,9 @@ func _sqlite3Savepoint(tls *libc.TLS, pParse uintptr, op int32, pName uintptr) { } var _az = [3]uintptr{ - 0: __ccgo_ts + 16348, - 1: __ccgo_ts + 16370, - 2: __ccgo_ts + 16354, + 0: __ccgo_ts + 16464, + 1: __ccgo_ts + 16486, + 2: __ccgo_ts + 16470, } // C documentation @@ -176296,7 +169124,7 @@ func _sqlite3OpenTempDatabase(tls *libc.TLS, pParse uintptr) (r int32) { if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt == uintptr(0) && !((*TParse)(unsafe.Pointer(pParse)).Fexplain != 0) { rc = _sqlite3BtreeOpen(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, uintptr(0), db, bp, 0, _flags) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16378, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16494, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = rc return int32(1) } @@ -176321,7 +169149,7 @@ var _flags = libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQ // */ func _sqlite3CodeVerifySchemaAtToplevel(tls *libc.TLS, pToplevel uintptr, iDb int32) { if libc.BoolInt32((*TParse)(unsafe.Pointer(pToplevel)).FcookieMask&(libc.Uint32FromInt32(1)<= 0 { - zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+13877, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) + zMsg = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+13993, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) rc = libc.Int32FromInt32(SQLITE_CONSTRAINT) | libc.Int32FromInt32(6)<>9)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x100>>8)) == 0 { /* Deactivate the index because it contains an unknown collating ** sequence. The only way to reactive the index is to reload the ** schema. Adding the missing collating sequence later does not @@ -176752,7 +169580,7 @@ func _sqlite3KeyInfoOfIndex(tls *libc.TLS, pParse uintptr, pIdx uintptr) (r uint ** the missing index using the collation-needed callback. For ** simplicity, SQLite will not give the application a second chance. */ - libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 9, 0x200) + libc.SetBitFieldPtr16Uint32(pIdx+56, libc.Uint32FromInt32(1), 8, 0x100) (*TParse)(unsafe.Pointer(pParse)).Frc = libc.Int32FromInt32(SQLITE_ERROR) | libc.Int32FromInt32(2)< libc.BoolInt32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16578, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16694, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } return 0 } @@ -177634,11 +170460,11 @@ func _sqlite3IsReadOnly(tls *libc.TLS, pParse uintptr, pTab uintptr, pTrigger ui bp := tls.Alloc(16) defer tls.Free(16) if _tabIsReadOnly(tls, pParse, pTab) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16611, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16727, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && (pTrigger == uintptr(0) || (*TTrigger)(unsafe.Pointer(pTrigger)).FbReturning != 0 && (*TTrigger)(unsafe.Pointer(pTrigger)).FpNext == uintptr(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16640, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16756, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(1) } return 0 @@ -177742,7 +170568,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } /* Assign cursor numbers to the table and all its indices. */ - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ v1 = v2 @@ -177799,7 +170625,7 @@ func _sqlite3DeleteFrom(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** we are counting rows. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))< *(*int32)(unsafe.Pointer(db + 120 + 8*4)) { - Xsqlite3_result_error(tls, context, __ccgo_ts+16714, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16830, -int32(1)) return } if argc == int32(3) { @@ -179518,7 +172349,7 @@ func _likeFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { return } if _sqlite3Utf8CharLen(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), -int32(1)) != int32(1) { - Xsqlite3_result_error(tls, context, __ccgo_ts+16747, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16863, -int32(1)) return } escape = _sqlite3Utf8Read(tls, bp+4) @@ -179600,7 +172431,7 @@ func _errlogFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { defer tls.Free(16) _ = argc _ = context - Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))) + Xsqlite3_log(tls, Xsqlite3_value_int(tls, *(*uintptr)(unsafe.Pointer(argv))), __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))))) } // C documentation @@ -179672,32 +172503,32 @@ var _hexdigits = [16]int8{ // ** Append to pStr text that is the SQL literal representation of the // ** value contained in pValue. // */ -func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { +func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr, bEscape int32) { bp := tls.Alloc(32) defer tls.Free(32) var i int32 var nBlob Ti64 var r1 float64 - var zArg, zBlob, zText, zVal uintptr + var zArg, zBlob, zText, zVal, v2 uintptr var _ /* r2 at bp+0 */ float64 - _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal + _, _, _, _, _, _, _, _ = i, nBlob, r1, zArg, zBlob, zText, zVal, v2 /* As currently implemented, the string must be initially empty. ** we might relax this requirement in the future, but that will ** require enhancements to the implementation. */ switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_FLOAT): r1 = Xsqlite3_value_double(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16792, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16908, libc.VaList(bp+16, r1)) zVal = Xsqlite3_str_value(tls, pStr) if zVal != 0 { _sqlite3AtoF(tls, zVal, bp, int32((*TStrAccum)(unsafe.Pointer(pStr)).FnChar), uint8(SQLITE_UTF8)) if r1 != *(*float64)(unsafe.Pointer(bp)) { Xsqlite3_str_reset(tls, pStr) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16800, libc.VaList(bp+16, r1)) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16916, libc.VaList(bp+16, r1)) } } case int32(SQLITE_INTEGER): - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1434, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) + Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+1435, libc.VaList(bp+16, Xsqlite3_value_int64(tls, pValue))) case int32(SQLITE_BLOB): zBlob = Xsqlite3_value_blob(tls, pValue) nBlob = int64(Xsqlite3_value_bytes(tls, pValue)) @@ -179725,13 +172556,149 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { } case int32(SQLITE_TEXT): zArg = Xsqlite3_value_text(tls, pValue) - Xsqlite3_str_appendf(tls, pStr, __ccgo_ts+16808, libc.VaList(bp+16, zArg)) + if bEscape != 0 { + v2 = __ccgo_ts + 16924 + } else { + v2 = __ccgo_ts + 16928 + } + Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+16, zArg)) default: - Xsqlite3_str_append(tls, pStr, __ccgo_ts+1674, int32(4)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+1675, int32(4)) break } } +// C documentation +// +// /* +// ** Return true if z[] begins with N hexadecimal digits, and write +// ** a decoding of those digits into *pVal. Or return false if any +// ** one of the first N characters in z[] is not a hexadecimal digit. +// */ +func _isNHex(tls *libc.TLS, z uintptr, N int32, pVal uintptr) (r int32) { + var i, v int32 + _, _ = i, v + v = 0 + i = 0 + for { + if !(i < N) { + break + } + if !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i))))])&libc.Int32FromInt32(0x08) != 0) { + return 0 + } + v = v< 0 { + libc.Xmemmove(tls, zOut+uintptr(j), zIn+uintptr(i), uint32(n)) + j += n + i += n + } + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('\\') { + i += int32(2) + v2 = j + j++ + *(*int8)(unsafe.Pointer(zOut + uintptr(v2))) = int8('\\') + } else { + if int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1)))))])&int32(0x08) != 0 { + if !(_isNHex(tls, zIn+uintptr(i+int32(1)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(5) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('+') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(6), bp) != 0) { + goto unistr_error + } + i += int32(8) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('u') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(4), bp) != 0) { + goto unistr_error + } + i += int32(6) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + if int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i+int32(1))))) == int32('U') { + if !(_isNHex(tls, zIn+uintptr(i+int32(2)), int32(8), bp) != 0) { + goto unistr_error + } + i += int32(10) + j += _sqlite3AppendOneUtf8Character(tls, zOut+uintptr(j), *(*Tu32)(unsafe.Pointer(bp))) + } else { + goto unistr_error + } + } + } + } + } + } + *(*int8)(unsafe.Pointer(zOut + uintptr(j))) = 0 + Xsqlite3_result_text64(tls, context, zOut, uint64(j), __ccgo_fp(Xsqlite3_free), uint8(SQLITE_UTF8)) + return + goto unistr_error +unistr_error: + ; + Xsqlite3_free(tls, zOut) + Xsqlite3_result_error(tls, context, __ccgo_ts+16931, -int32(1)) + return +} + // C documentation // // /* @@ -179743,6 +172710,10 @@ func _sqlite3QuoteValue(tls *libc.TLS, pStr uintptr, pValue uintptr) { // ** as needed. BLOBs are encoded as hexadecimal literals. Strings with // ** embedded NUL characters cannot be represented as string literals in SQL // ** and hence the returned string literal is truncated prior to the first NUL. +// ** +// ** If sqlite3_user_data() is non-zero, then the UNISTR_QUOTE() function is +// ** implemented instead. The difference is that UNISTR_QUOTE() uses the +// ** UNISTR() function to escape control characters. // */ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { bp := tls.Alloc(32) @@ -179753,7 +172724,7 @@ func _quoteFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) _ = argc _sqlite3StrAccumInit(tls, bp, db, uintptr(0), 0, *(*int32)(unsafe.Pointer(db + 120))) - _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv))) + _sqlite3QuoteValue(tls, bp, *(*uintptr)(unsafe.Pointer(argv)), int32(Xsqlite3_user_data(tls, context))) Xsqlite3_result_text(tls, context, _sqlite3StrAccumFinish(tls, bp), int32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FnChar), __ccgo_fp(_sqlite3OomClear)) if int32((*(*Tsqlite3_str)(unsafe.Pointer(bp))).FaccError) != SQLITE_OK { Xsqlite3_result_null(tls, context) @@ -179964,7 +172935,7 @@ func _unhexFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { var v3 uint32 var _ /* zHex at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _ = c, ch, d, nHex, nPass, p, pBlob, zPass, v1, v2, v3, v4, v5, v6 - zPass = __ccgo_ts + 1673 + zPass = __ccgo_ts + 1674 nPass = 0 *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) nHex = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -180277,7 +173248,7 @@ var _lenOne = [1]uint32{ } var _azOne = [1]uintptr{ - 0: __ccgo_ts + 12698, + 0: __ccgo_ts + 12814, } // C documentation @@ -180289,8 +173260,8 @@ var _azOne = [1]uintptr{ // ** entries in argv[]. Use zSep as the separator. // */ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, nSep int32, zSep uintptr) { - var i int32 - var j, k, n Ti64 + var i, k int32 + var j, n Ti64 var v, z uintptr _, _, _, _, _, _ = i, j, k, n, v, z n = 0 @@ -180305,7 +173276,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n ; i++ } - n += int64((argc - int32(1)) * nSep) + n += int64(argc-libc.Int32FromInt32(1)) * int64(nSep) z = Xsqlite3_malloc64(tls, uint64(n+int64(1))) if z == uintptr(0) { Xsqlite3_result_error_nomem(tls, context) @@ -180317,8 +173288,8 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n if !(i < argc) { break } - k = int64(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4)))) - if k > 0 { + if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != int32(SQLITE_NULL) { + k = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) v = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if v != uintptr(0) { if j > 0 && nSep > 0 { @@ -180326,7 +173297,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n j += int64(nSep) } libc.Xmemcpy(tls, z+uintptr(j), v, uint32(k)) - j += k + j += int64(k) } } goto _2 @@ -180345,7 +173316,7 @@ func _concatFuncCore(tls *libc.TLS, context uintptr, argc int32, argv uintptr, n // ** concatentation of all non-null arguments. // */ func _concatFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { - _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1673) + _concatFuncCore(tls, context, argc, argv, 0, __ccgo_ts+1674) } // C documentation @@ -180391,7 +173362,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { _, _, _, _, _, _, _ = code, i, j, prevcode, zIn, v3, v4 zIn = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) if zIn == uintptr(0) { - zIn = __ccgo_ts + 1673 + zIn = __ccgo_ts + 1674 } i = 0 for { @@ -180437,7 +173408,7 @@ func _soundexFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } else { /* IMP: R-64894-50321 The string "?000" is returned if the argument ** is NULL or contains no ASCII alphabetic characters. */ - Xsqlite3_result_text(tls, context, __ccgo_ts+16811, int32(4), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+16954, int32(4), libc.UintptrFromInt32(0)) } } @@ -180498,7 +173469,7 @@ func _loadExt(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { ** flag is set. See the sqlite3_enable_load_extension() API. */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_LoadExtFunc) == uint64(0) { - Xsqlite3_result_error(tls, context, __ccgo_ts+13916, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+14032, -int32(1)) return } if argc == int32(2) { @@ -180531,19 +173502,6 @@ type TSumCtx = struct { type SumCtx = TSumCtx -type TSumCtx1 = struct { - F__ccgo_align [0]uint32 - FrSum float64 - FrErr float64 - FiSum Ti64 - Fcnt Ti64 - Fapprox Tu8 - Fovrfl Tu8 - F__ccgo_pad6 [6]byte -} - -type SumCtx1 = TSumCtx1 - // C documentation // // /* @@ -180612,7 +173570,7 @@ func _kahanBabuskaNeumaierInit(tls *libc.TLS, p uintptr, iVal Ti64) { // ** that it returns NULL if it sums over no inputs. TOTAL returns // ** 0.0 in that case. In addition, TOTAL always returns a float where // ** SUM might return an integer if it never encounters a floating point -// ** value. TOTAL never fails, but SUM might through an exception if +// ** value. TOTAL never fails, but SUM might throw an exception if // ** it overflows an integer. // */ func _sumStep(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { @@ -180694,7 +173652,7 @@ func _sumFinalize(tls *libc.TLS, context uintptr) { if p != 0 && (*TSumCtx)(unsafe.Pointer(p)).Fcnt > 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fapprox != 0 { if (*TSumCtx)(unsafe.Pointer(p)).Fovrfl != 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+16691, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+16807, -int32(1)) } else { if !(_sqlite3IsOverflow(tls, (*TSumCtx)(unsafe.Pointer(p)).FrErr) != 0) { Xsqlite3_result_double(tls, context, (*TSumCtx)(unsafe.Pointer(p)).FrSum+(*TSumCtx)(unsafe.Pointer(p)).FrErr) @@ -180758,13 +173716,6 @@ type TCountCtx = struct { type CountCtx = TCountCtx -type TCountCtx1 = struct { - F__ccgo_align [0]uint32 - Fn Ti64 -} - -type CountCtx1 = TCountCtx1 - // C documentation // // /* @@ -181026,7 +173977,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { Xsqlite3_result_error_nomem(tls, context) } else { if (*TGroupConcatCtx)(unsafe.Pointer(pGCC)).FnAccum > 0 && (*TStrAccum)(unsafe.Pointer(pAccum)).FnChar == uint32(0) { - Xsqlite3_result_text(tls, context, __ccgo_ts+1673, int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, context, __ccgo_ts+1674, int32(1), libc.UintptrFromInt32(0)) } else { zText = Xsqlite3_str_value(tls, pAccum) Xsqlite3_result_text(tls, context, zText, int32((*TStrAccum)(unsafe.Pointer(pAccum)).FnChar), uintptr(-libc.Int32FromInt32(1))) @@ -181046,7 +173997,7 @@ func _groupConcatValue(tls *libc.TLS, context uintptr) { func _sqlite3RegisterPerConnectionBuiltinFunctions(tls *libc.TLS, db uintptr) { var rc int32 _ = rc - rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+16816, int32(2)) + rc = Xsqlite3_overload_function(tls, db, __ccgo_ts+16959, int32(2)) if rc == int32(SQLITE_NOMEM) { _sqlite3OomFault(tls, db) } @@ -181075,8 +174026,8 @@ func _sqlite3RegisterLikeFunctions(tls *libc.TLS, db uintptr, caseSensitive int3 if !(nArg <= int32(3)) { break } - _sqlite3CreateFunc(tls, db, __ccgo_ts+16822, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) - pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16822, nArg, uint8(SQLITE_UTF8), uint8(0)) + _sqlite3CreateFunc(tls, db, __ccgo_ts+16965, nArg, int32(SQLITE_UTF8), pInfo, __ccgo_fp(_likeFunc), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + pDef = _sqlite3FindFunction(tls, db, __ccgo_ts+16965, nArg, uint8(SQLITE_UTF8), uint8(0)) *(*Tu32)(unsafe.Pointer(pDef + 4)) |= uint32(flags) *(*Tu32)(unsafe.Pointer(pDef + 4)) &= uint32(^libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)) goto _1 @@ -181256,11 +174207,11 @@ func _logFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { // ** Functions to converts degrees to radians and radians to degrees. // */ func _degToRad(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180)) + return float64(x * (libc.Float64FromFloat64(3.141592653589793) / libc.Float64FromFloat64(180))) } func _radToDeg(tls *libc.TLS, x float64) (r float64) { - return x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793)) + return float64(x * (libc.Float64FromFloat64(180) / libc.Float64FromFloat64(3.141592653589793))) } // C documentation @@ -181364,7 +174315,7 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { _sqlite3WindowFunctions(tls) _sqlite3RegisterDateTimeFunctions(tls) _sqlite3RegisterJsonFunctions(tls) - _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), int32(libc.Uint32FromInt64(4160)/libc.Uint32FromInt64(40))) + _sqlite3InsertBuiltinFuncs(tls, uintptr(unsafe.Pointer(&_aBuiltinFunc)), int32(libc.Uint32FromInt64(4240)/libc.Uint32FromInt64(40))) } /* @@ -181377,542 +174328,553 @@ func _sqlite3RegisterBuiltinFunctions(tls *libc.TLS) { ** ** For peak efficiency, put the most frequently used function last. */ -var _aBuiltinFunc = [104]TFuncDef{ +var _aBuiltinFunc = [106]TFuncDef{ 0: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_implies_nonnull_row)), - FzName: __ccgo_ts + 16827, + FzName: __ccgo_ts + 16970, }, 1: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_compare)), - FzName: __ccgo_ts + 16847, + FzName: __ccgo_ts + 16990, }, 2: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_expr_implies_expr)), - FzName: __ccgo_ts + 16860, + FzName: __ccgo_ts + 17003, }, 3: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INTERNAL) | libc.Int32FromInt32(SQLITE_FUNC_TEST) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_affinity)), - FzName: __ccgo_ts + 16878, + FzName: __ccgo_ts + 17021, }, 4: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 16887, + FzName: __ccgo_ts + 17030, }, 5: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 16895, + FzName: __ccgo_ts + 17038, }, 6: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_FUNC_UNSAFE)), - FzName: __ccgo_ts + 16895, + FzName: __ccgo_ts + 17038, }, 7: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16910, + FzName: __ccgo_ts + 17053, }, 8: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 16936, + FzName: __ccgo_ts + 17079, }, 9: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 16961, + FzName: __ccgo_ts + 17104, }, 10: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 16970, + FzName: __ccgo_ts + 17113, }, 11: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_FUNC_UNLIKELY)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_unlikely)), - FzName: __ccgo_ts + 16981, + FzName: __ccgo_ts + 17124, }, 12: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_sqlite_offset)), - FzName: __ccgo_ts + 16988, + FzName: __ccgo_ts + 17131, }, 13: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 17002, + FzName: __ccgo_ts + 17145, }, 14: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 17002, + FzName: __ccgo_ts + 17145, }, 15: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 17008, + FzName: __ccgo_ts + 17151, }, 16: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 17008, + FzName: __ccgo_ts + 17151, }, 17: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), - FzName: __ccgo_ts + 17014, + FzName: __ccgo_ts + 17157, }, 18: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(3)), - FzName: __ccgo_ts + 17014, + FzName: __ccgo_ts + 17157, }, 19: { FnArg: int16(-int32(3)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17019, + FzName: __ccgo_ts + 17162, }, 20: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17019, + FzName: __ccgo_ts + 17162, }, 21: { FnArg: int16(-int32(3)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 17023, + FzName: __ccgo_ts + 17166, }, 22: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_MINMAX) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 17023, + FzName: __ccgo_ts + 17166, }, 23: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF)), - FzName: __ccgo_ts + 17027, + FzName: __ccgo_ts + 17170, }, 24: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_TYPEOF) | libc.Int32FromInt32(SQLITE_SUBTYPE)), - FzName: __ccgo_ts + 17034, + FzName: __ccgo_ts + 17177, }, 25: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_LENGTH)), - FzName: __ccgo_ts + 17042, + FzName: __ccgo_ts + 17185, }, 26: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_BYTELEN)), - FzName: __ccgo_ts + 17049, + FzName: __ccgo_ts + 17192, }, 27: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17062, + FzName: __ccgo_ts + 17205, }, 28: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17068, + FzName: __ccgo_ts + 17211, }, 29: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17075, + FzName: __ccgo_ts + 17218, }, 30: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17082, + FzName: __ccgo_ts + 17225, }, 31: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17090, + FzName: __ccgo_ts + 17233, }, 32: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17095, + FzName: __ccgo_ts + 17238, }, 33: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17099, + FzName: __ccgo_ts + 17242, }, 34: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17099, + FzName: __ccgo_ts + 17242, }, 35: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17105, + FzName: __ccgo_ts + 17248, }, 36: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17111, + FzName: __ccgo_ts + 17254, }, 37: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17117, + FzName: __ccgo_ts + 17260, }, 38: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17121, + FzName: __ccgo_ts + 17264, }, 39: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17121, + FzName: __ccgo_ts + 17264, }, 40: { FnArg: int16(-int32(3)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17127, + FzName: __ccgo_ts + 17270, }, 41: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17134, + FzName: __ccgo_ts + 17277, }, 42: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17144, + FzName: __ccgo_ts + 17287, }, 43: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17151, + FzName: __ccgo_ts + 17294, }, 44: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17158, + FzName: __ccgo_ts + 17301, }, 45: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17169, + FzName: __ccgo_ts + 17312, }, 46: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17176, + FzName: __ccgo_ts + 17319, }, 47: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_SLOCHNG) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17191, + FzName: __ccgo_ts + 17334, }, 48: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17208, + FzName: __ccgo_ts + 17351, }, 49: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17219, + FzName: __ccgo_ts + 17362, }, 50: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17225, + FnArg: int16(1), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17369, }, 51: { - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17243, + FnArg: int16(1), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 17375, }, 52: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17251, + FzName: __ccgo_ts + 17388, }, 53: { - FnArg: int16(3), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17265, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17406, }, 54: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17273, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17414, }, 55: { - FnArg: int16(2), + FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17282, + FzName: __ccgo_ts + 17428, }, 56: { - FnArg: int16(3), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17282, + FzName: __ccgo_ts + 17436, }, 57: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17289, + FzName: __ccgo_ts + 17445, }, 58: { FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17289, + FzName: __ccgo_ts + 17445, }, 59: { + FnArg: int16(2), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17452, + }, + 60: { + FnArg: int16(3), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17452, + }, + 61: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17299, + FzName: __ccgo_ts + 17462, }, - 60: { + 62: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17303, + FzName: __ccgo_ts + 17466, }, - 61: { + 63: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17309, + FzName: __ccgo_ts + 17472, }, - 62: { + 64: { FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_COUNT) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17313, + FzName: __ccgo_ts + 17476, }, - 63: { + 65: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_FUNC_ANYORDER)), - FzName: __ccgo_ts + 17313, + FzName: __ccgo_ts + 17476, }, - 64: { + 66: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17319, + FzName: __ccgo_ts + 17482, }, - 65: { + 67: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17319, + FzName: __ccgo_ts + 17482, }, - 66: { + 68: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 17332, + FzName: __ccgo_ts + 17495, }, - 67: { + 69: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE) | libc.Int32FromInt32(SQLITE_FUNC_CASE)), FpUserData: uintptr(unsafe.Pointer(&_globInfo)), - FzName: __ccgo_ts + 17343, + FzName: __ccgo_ts + 17506, }, - 68: { + 70: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 16822, + FzName: __ccgo_ts + 16965, }, - 69: { + 71: { FnArg: int16(3), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_LIKE)), FpUserData: uintptr(unsafe.Pointer(&_likeInfoNorm)), - FzName: __ccgo_ts + 16822, - }, - 70: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17348, - }, - 71: { - FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1246, + FzName: __ccgo_ts + 16965, }, 72: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 1254, + FzName: __ccgo_ts + 17511, }, 73: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17353, + FzName: __ccgo_ts + 1247, }, 74: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17359, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 1255, }, 75: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 17362, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17516, }, 76: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(1)), - FzName: __ccgo_ts + 17366, + FzName: __ccgo_ts + 17522, }, 77: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FpUserData: uintptr(libc.Int32FromInt32(2)), - FzName: __ccgo_ts + 17372, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 17525, }, 78: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17362, + FpUserData: uintptr(libc.Int32FromInt32(1)), + FzName: __ccgo_ts + 17529, }, 79: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17377, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FpUserData: uintptr(libc.Int32FromInt32(2)), + FzName: __ccgo_ts + 17535, }, 80: { FnArg: int16(2), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17381, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17525, }, 81: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17385, + FzName: __ccgo_ts + 17540, }, 82: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17391, + FzName: __ccgo_ts + 17544, }, 83: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17395, + FzName: __ccgo_ts + 17548, }, 84: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17400, + FzName: __ccgo_ts + 17554, }, 85: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17405, + FzName: __ccgo_ts + 17558, }, 86: { - FnArg: int16(2), + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17410, + FzName: __ccgo_ts + 17563, }, 87: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17416, + FzName: __ccgo_ts + 17568, }, 88: { - FnArg: int16(1), + FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17420, + FzName: __ccgo_ts + 17573, }, 89: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17424, + FzName: __ccgo_ts + 17579, }, 90: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17428, + FzName: __ccgo_ts + 17583, }, 91: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17433, + FzName: __ccgo_ts + 17587, }, 92: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17438, + FzName: __ccgo_ts + 17591, }, 93: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17443, + FzName: __ccgo_ts + 17596, }, 94: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17449, + FzName: __ccgo_ts + 17601, }, 95: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17455, + FzName: __ccgo_ts + 17606, }, 96: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17461, + FzName: __ccgo_ts + 17612, }, 97: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17466, + FzName: __ccgo_ts + 17618, }, 98: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17474, + FzName: __ccgo_ts + 17624, }, 99: { + FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), - FzName: __ccgo_ts + 17482, + FzName: __ccgo_ts + 17629, }, 100: { FnArg: int16(1), - FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), - FzName: __ccgo_ts + 17485, + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17637, }, 101: { + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8)), + FzName: __ccgo_ts + 17645, + }, + 102: { + FnArg: int16(1), + FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL)), + FzName: __ccgo_ts + 17648, + }, + 103: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), - FzName: __ccgo_ts + 8165, + FzName: __ccgo_ts + 8252, }, - 102: { + 104: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_iif)), - FzName: __ccgo_ts + 17490, + FzName: __ccgo_ts + 17653, }, - 103: { + 105: { FnArg: int16(-int32(4)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_FUNC_INLINE) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(0)), FpUserData: uintptr(libc.Int32FromInt32(INLINEFUNC_iif)), - FzName: __ccgo_ts + 17494, + FzName: __ccgo_ts + 17657, }, } @@ -181971,109 +174933,111 @@ func init() { *(*uintptr)(unsafe.Add(p, 1856)) = __ccgo_fp(_versionFunc) *(*uintptr)(unsafe.Add(p, 1896)) = __ccgo_fp(_sourceidFunc) *(*uintptr)(unsafe.Add(p, 1936)) = __ccgo_fp(_errlogFunc) - *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(_quoteFunc) - *(*uintptr)(unsafe.Add(p, 2016)) = __ccgo_fp(_last_insert_rowid) - *(*uintptr)(unsafe.Add(p, 2056)) = __ccgo_fp(_changes) - *(*uintptr)(unsafe.Add(p, 2096)) = __ccgo_fp(_total_changes) - *(*uintptr)(unsafe.Add(p, 2136)) = __ccgo_fp(_replaceFunc) - *(*uintptr)(unsafe.Add(p, 2176)) = __ccgo_fp(_zeroblobFunc) - *(*uintptr)(unsafe.Add(p, 2216)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 1976)) = __ccgo_fp(_unistrFunc) + *(*uintptr)(unsafe.Add(p, 2016)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 2056)) = __ccgo_fp(_quoteFunc) + *(*uintptr)(unsafe.Add(p, 2096)) = __ccgo_fp(_last_insert_rowid) + *(*uintptr)(unsafe.Add(p, 2136)) = __ccgo_fp(_changes) + *(*uintptr)(unsafe.Add(p, 2176)) = __ccgo_fp(_total_changes) + *(*uintptr)(unsafe.Add(p, 2216)) = __ccgo_fp(_replaceFunc) + *(*uintptr)(unsafe.Add(p, 2256)) = __ccgo_fp(_zeroblobFunc) *(*uintptr)(unsafe.Add(p, 2296)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 2336)) = __ccgo_fp(_substrFunc) - *(*uintptr)(unsafe.Add(p, 2376)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2380)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 2384)) = __ccgo_fp(_sumFinalize) - *(*uintptr)(unsafe.Add(p, 2388)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 2416)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2420)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 2424)) = __ccgo_fp(_totalFinalize) - *(*uintptr)(unsafe.Add(p, 2428)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2376)) = __ccgo_fp(_substrFunc) + *(*uintptr)(unsafe.Add(p, 2416)) = __ccgo_fp(_substrFunc) *(*uintptr)(unsafe.Add(p, 2456)) = __ccgo_fp(_sumStep) - *(*uintptr)(unsafe.Add(p, 2460)) = __ccgo_fp(_avgFinalize) - *(*uintptr)(unsafe.Add(p, 2464)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2460)) = __ccgo_fp(_sumFinalize) + *(*uintptr)(unsafe.Add(p, 2464)) = __ccgo_fp(_sumFinalize) *(*uintptr)(unsafe.Add(p, 2468)) = __ccgo_fp(_sumInverse) - *(*uintptr)(unsafe.Add(p, 2496)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 2500)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2504)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2508)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 2536)) = __ccgo_fp(_countStep) - *(*uintptr)(unsafe.Add(p, 2540)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_countFinalize) - *(*uintptr)(unsafe.Add(p, 2548)) = __ccgo_fp(_countInverse) - *(*uintptr)(unsafe.Add(p, 2576)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 2580)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 2584)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 2588)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_groupConcatStep) - *(*uintptr)(unsafe.Add(p, 2620)) = __ccgo_fp(_groupConcatFinalize) - *(*uintptr)(unsafe.Add(p, 2624)) = __ccgo_fp(_groupConcatValue) - *(*uintptr)(unsafe.Add(p, 2628)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 2496)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 2500)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 2504)) = __ccgo_fp(_totalFinalize) + *(*uintptr)(unsafe.Add(p, 2508)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2536)) = __ccgo_fp(_sumStep) + *(*uintptr)(unsafe.Add(p, 2540)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2544)) = __ccgo_fp(_avgFinalize) + *(*uintptr)(unsafe.Add(p, 2548)) = __ccgo_fp(_sumInverse) + *(*uintptr)(unsafe.Add(p, 2576)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 2580)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2584)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2588)) = __ccgo_fp(_countInverse) + *(*uintptr)(unsafe.Add(p, 2616)) = __ccgo_fp(_countStep) + *(*uintptr)(unsafe.Add(p, 2620)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2624)) = __ccgo_fp(_countFinalize) + *(*uintptr)(unsafe.Add(p, 2628)) = __ccgo_fp(_countInverse) *(*uintptr)(unsafe.Add(p, 2656)) = __ccgo_fp(_groupConcatStep) *(*uintptr)(unsafe.Add(p, 2660)) = __ccgo_fp(_groupConcatFinalize) *(*uintptr)(unsafe.Add(p, 2664)) = __ccgo_fp(_groupConcatValue) *(*uintptr)(unsafe.Add(p, 2668)) = __ccgo_fp(_groupConcatInverse) - *(*uintptr)(unsafe.Add(p, 2696)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 2736)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2696)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 2700)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 2704)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 2708)) = __ccgo_fp(_groupConcatInverse) + *(*uintptr)(unsafe.Add(p, 2736)) = __ccgo_fp(_groupConcatStep) + *(*uintptr)(unsafe.Add(p, 2740)) = __ccgo_fp(_groupConcatFinalize) + *(*uintptr)(unsafe.Add(p, 2744)) = __ccgo_fp(_groupConcatValue) + *(*uintptr)(unsafe.Add(p, 2748)) = __ccgo_fp(_groupConcatInverse) *(*uintptr)(unsafe.Add(p, 2776)) = __ccgo_fp(_likeFunc) - *(*uintptr)(unsafe.Add(p, 2808)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 2816)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2848)) = __ccgo_fp(_xCeil) - *(*uintptr)(unsafe.Add(p, 2856)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2888)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 2816)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2856)) = __ccgo_fp(_likeFunc) + *(*uintptr)(unsafe.Add(p, 2888)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 2896)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2928)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 2928)) = __ccgo_fp(_xCeil) *(*uintptr)(unsafe.Add(p, 2936)) = __ccgo_fp(_ceilingFunc) - *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 3016)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 2968)) = __ccgo_fp(_xFloor) + *(*uintptr)(unsafe.Add(p, 2976)) = __ccgo_fp(_ceilingFunc) + *(*uintptr)(unsafe.Add(p, 3008)) = __ccgo_fp(libc.Xtrunc) + *(*uintptr)(unsafe.Add(p, 3016)) = __ccgo_fp(_ceilingFunc) *(*uintptr)(unsafe.Add(p, 3056)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 3096)) = __ccgo_fp(_logFunc) *(*uintptr)(unsafe.Add(p, 3136)) = __ccgo_fp(_logFunc) - *(*uintptr)(unsafe.Add(p, 3168)) = __ccgo_fp(libc.Xexp) - *(*uintptr)(unsafe.Add(p, 3176)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3208)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 3216)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3248)) = __ccgo_fp(libc.Xpow) - *(*uintptr)(unsafe.Add(p, 3256)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3288)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 3176)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 3216)) = __ccgo_fp(_logFunc) + *(*uintptr)(unsafe.Add(p, 3248)) = __ccgo_fp(libc.Xexp) + *(*uintptr)(unsafe.Add(p, 3256)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 3288)) = __ccgo_fp(libc.Xpow) *(*uintptr)(unsafe.Add(p, 3296)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3328)) = __ccgo_fp(libc.Xacos) - *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3368)) = __ccgo_fp(libc.Xasin) - *(*uintptr)(unsafe.Add(p, 3376)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(libc.Xatan) + *(*uintptr)(unsafe.Add(p, 3328)) = __ccgo_fp(libc.Xpow) + *(*uintptr)(unsafe.Add(p, 3336)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3368)) = __ccgo_fp(libc.Xfmod) + *(*uintptr)(unsafe.Add(p, 3376)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3408)) = __ccgo_fp(libc.Xacos) *(*uintptr)(unsafe.Add(p, 3416)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3448)) = __ccgo_fp(libc.Xatan2) - *(*uintptr)(unsafe.Add(p, 3456)) = __ccgo_fp(_math2Func) - *(*uintptr)(unsafe.Add(p, 3488)) = __ccgo_fp(libc.Xcos) + *(*uintptr)(unsafe.Add(p, 3448)) = __ccgo_fp(libc.Xasin) + *(*uintptr)(unsafe.Add(p, 3456)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 3488)) = __ccgo_fp(libc.Xatan) *(*uintptr)(unsafe.Add(p, 3496)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3528)) = __ccgo_fp(libc.Xsin) - *(*uintptr)(unsafe.Add(p, 3536)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3568)) = __ccgo_fp(libc.Xtan) + *(*uintptr)(unsafe.Add(p, 3528)) = __ccgo_fp(libc.Xatan2) + *(*uintptr)(unsafe.Add(p, 3536)) = __ccgo_fp(_math2Func) + *(*uintptr)(unsafe.Add(p, 3568)) = __ccgo_fp(libc.Xcos) *(*uintptr)(unsafe.Add(p, 3576)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3608)) = __ccgo_fp(libc.Xcosh) + *(*uintptr)(unsafe.Add(p, 3608)) = __ccgo_fp(libc.Xsin) *(*uintptr)(unsafe.Add(p, 3616)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3648)) = __ccgo_fp(libc.Xsinh) + *(*uintptr)(unsafe.Add(p, 3648)) = __ccgo_fp(libc.Xtan) *(*uintptr)(unsafe.Add(p, 3656)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3688)) = __ccgo_fp(libc.Xtanh) + *(*uintptr)(unsafe.Add(p, 3688)) = __ccgo_fp(libc.Xcosh) *(*uintptr)(unsafe.Add(p, 3696)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3728)) = __ccgo_fp(libc.Xacosh) + *(*uintptr)(unsafe.Add(p, 3728)) = __ccgo_fp(libc.Xsinh) *(*uintptr)(unsafe.Add(p, 3736)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(libc.Xasinh) + *(*uintptr)(unsafe.Add(p, 3768)) = __ccgo_fp(libc.Xtanh) *(*uintptr)(unsafe.Add(p, 3776)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3808)) = __ccgo_fp(libc.Xatanh) + *(*uintptr)(unsafe.Add(p, 3808)) = __ccgo_fp(libc.Xacosh) *(*uintptr)(unsafe.Add(p, 3816)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3848)) = __ccgo_fp(libc.Xsqrt) + *(*uintptr)(unsafe.Add(p, 3848)) = __ccgo_fp(libc.Xasinh) *(*uintptr)(unsafe.Add(p, 3856)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3888)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 3888)) = __ccgo_fp(libc.Xatanh) *(*uintptr)(unsafe.Add(p, 3896)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3928)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 3928)) = __ccgo_fp(libc.Xsqrt) *(*uintptr)(unsafe.Add(p, 3936)) = __ccgo_fp(_math1Func) - *(*uintptr)(unsafe.Add(p, 3976)) = __ccgo_fp(_piFunc) - *(*uintptr)(unsafe.Add(p, 4016)) = __ccgo_fp(_signFunc) - *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_versionFunc) - *(*uintptr)(unsafe.Add(p, 4096)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 3968)) = __ccgo_fp(_degToRad) + *(*uintptr)(unsafe.Add(p, 3976)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 4008)) = __ccgo_fp(_radToDeg) + *(*uintptr)(unsafe.Add(p, 4016)) = __ccgo_fp(_math1Func) + *(*uintptr)(unsafe.Add(p, 4056)) = __ccgo_fp(_piFunc) + *(*uintptr)(unsafe.Add(p, 4096)) = __ccgo_fp(_signFunc) *(*uintptr)(unsafe.Add(p, 4136)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 4176)) = __ccgo_fp(_versionFunc) + *(*uintptr)(unsafe.Add(p, 4216)) = __ccgo_fp(_versionFunc) } /************** End of func.c ************************************************/ @@ -182390,7 +175354,7 @@ func _sqlite3FkLocateIndex(tls *libc.TLS, pParse uintptr, pParent uintptr, pFKey } if !(pIdx != 0) { if !((*TParse)(unsafe.Pointer(pParse)).FdisableTriggers != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17497, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17660, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName, (*TFKey)(unsafe.Pointer(pFKey)).FzTo)) } _sqlite3DbFree(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, aiCol) return int32(1) @@ -183214,7 +176178,7 @@ func _sqlite3FkCheck(tls *libc.TLS, pParse uintptr, pTab uintptr, regOld int32, (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab = (*TFKey)(unsafe.Pointer(pFKey)).FpFrom (*TSrcItem)(unsafe.Pointer(pItem)).FzName = (*TTable)(unsafe.Pointer((*TFKey)(unsafe.Pointer(pFKey)).FpFrom)).FzName (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FnTabRef++ - v7 = pParse + 44 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ (*TSrcItem)(unsafe.Pointer(pItem)).FiCursor = v6 @@ -183501,11 +176465,11 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr break } *(*TToken)(unsafe.Pointer(bp + 8)) = TToken{ - Fz: __ccgo_ts + 8031, + Fz: __ccgo_ts + 8118, Fn: uint32(3), } /* Literal "old" token */ *(*TToken)(unsafe.Pointer(bp + 16)) = TToken{ - Fz: __ccgo_ts + 8027, + Fz: __ccgo_ts + 8114, Fn: uint32(3), } /* tFromCol = OLD.tToCol */ if *(*uintptr)(unsafe.Pointer(bp + 4)) != 0 { @@ -183569,7 +176533,7 @@ func _fkActionTrigger(tls *libc.TLS, pParse uintptr, pTab uintptr, pFKey uintptr nFrom = _sqlite3Strlen30(tls, zFrom) if action == int32(OE_Restrict) { iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+6615) + pRaise = _sqlite3Expr(tls, db, int32(TK_STRING), __ccgo_ts+6703) pRaise = _sqlite3PExpr(tls, pParse, int32(TK_RAISE), pRaise, uintptr(0)) if pRaise != 0 { (*TExpr)(unsafe.Pointer(pRaise)).FaffExpr = int8(OE_Abort) @@ -184033,7 +176997,7 @@ func _exprColumnFlagUnion(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 _ = p1 if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_COLUMN) && int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) >= 0 { p1 = pWalker + 20 - *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | int32((*(*TColumn)(unsafe.Pointer((*TTable1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) + *(*Tu16)(unsafe.Pointer(p1)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p1))) | int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalker + 24)))).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiColumn)*12))).FcolFlags)) } return WRC_Continue } @@ -184151,7 +177115,7 @@ func _sqlite3ComputeGeneratedColumns(tls *libc.TLS, pParse uintptr, iRegStore in } } if pRedo != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9658, libc.VaList(bp+40, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+9745, libc.VaList(bp+40, (*TColumn)(unsafe.Pointer(pRedo)).FzCnName)) } (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 } @@ -184217,11 +177181,11 @@ func _autoIncBegin(tls *libc.TLS, pParse uintptr, iDb int32, pTab uintptr) (r in (*TAutoincInfo)(unsafe.Pointer(pInfo)).FpTab = pTab (*TAutoincInfo)(unsafe.Pointer(pInfo)).FiDb = iDb (*TParse)(unsafe.Pointer(pToplevel)).FnMem++ /* Register to hold name of table */ - v3 = pToplevel + 48 + v3 = pToplevel + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr = v2 /* Max rowid register */ - *(*int32)(unsafe.Pointer(pToplevel + 48)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ + *(*int32)(unsafe.Pointer(pToplevel + 52)) += int32(2) /* Rowid in sqlite_sequence + orig max val */ } memId = (*TAutoincInfo)(unsafe.Pointer(pInfo)).FregCtr } @@ -184546,7 +177510,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint var p, pRet, pSelect, pSubq, pSubq1, v, v2 uintptr var _ /* dest at bp+0 */ TSelectDest _, _, _, _, _, _, _, _, _ = f, p, pRet, pSelect, pSubq, pSubq1, v, v1, v2 - if (*TParse)(unsafe.Pointer(pParse)).FbHasWith != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x2>>1)) != 0 || (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy != 0 || _exprListIsConstant(tls, pParse, pRow) == 0 || (*TSrcList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpSrc)).FnSrc == 0 && _exprListIsNoAffinity(tls, pParse, (*TSelect)(unsafe.Pointer(pLeft)).FpEList) == 0 || int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) != PARSE_MODE_NORMAL { /* The co-routine method cannot be used. Fall back to UNION ALL. */ pSelect = uintptr(0) f = libc.Int32FromInt32(SF_Values) | libc.Int32FromInt32(SF_MultiValue) @@ -184560,7 +177524,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint } } pSelect = _sqlite3SelectNew(tls, pParse, pRow, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(f), uintptr(0)) - *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLeft + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if pSelect != 0 { (*TSelect)(unsafe.Pointer(pSelect)).Fop = uint8(TK_ALL) (*TSelect)(unsafe.Pointer(pSelect)).FpPrior = pLeft @@ -184595,7 +177559,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint if _sqlite3SrcItemAttachSubquery(tls, pParse, p, pLeft, 0) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(p + 44)) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v1 @@ -184608,7 +177572,7 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint ** of the co-routine to a separate array for processing. */ (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(3) (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pLeft)).FpEList)).FnExpr - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) + (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst *(*Tu32)(unsafe.Pointer(pLeft + 4)) |= uint32(SF_MultiValue) _sqlite3Select(tls, pParse, pLeft, bp) (*TSubquery)(unsafe.Pointer(pSubq)).FregResult = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst @@ -184735,27 +177699,27 @@ func _sqlite3MultiValues(tls *libc.TLS, pParse uintptr, pLeft uintptr, pRow uint func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uintptr, pColumn uintptr, onError int32, pUpsert uintptr) { bp := tls.Alloc(112) defer tls.Free(112) - var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, zCName, v13, v16, v18, v6, v9 uintptr - var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v12, v15, v17, v19, v22, v23, v4, v5, v7, v8 int32 - var appendFlag, bIdListInOrder, hName, useTempTable, withoutRowid Tu8 - var colFlags, v21 Tu32 + var aRegIdx, aTabColMap, db, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, v, v12, v15, v17, v5, v8 uintptr + var addr1, addr11, addrCont, addrInsTop, addrL, addrTop, bUseSeek, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, y, v1, v11, v14, v16, v18, v21, v22, v3, v4, v6, v7 int32 + var appendFlag, bIdListInOrder, useTempTable, withoutRowid Tu8 + var colFlags, v20 Tu32 var _ /* dest at bp+8 */ TSelectDest var _ /* iDataCur at bp+0 */ int32 var _ /* iIdxCur at bp+4 */ int32 var _ /* isReplace at bp+76 */ int32 var _ /* sNC at bp+40 */ TNameContext var _ /* tmask at bp+36 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, hName, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, zCName, v1, v12, v13, v15, v16, v17, v18, v19, v21, v22, v23, v4, v5, v6, v7, v8, v9 /* Number of columns in the data */ - nHidden = 0 /* Number of hidden columns if TABLE is virtual */ - *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ - *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ - ipkColumn = -int32(1) /* Label for the end of the insertion loop */ - srcTab = 0 /* Data comes from this temporary cursor if >=0 */ - addrInsTop = 0 /* Jump to label "D" */ - addrCont = 0 /* Index of database holding TABLE */ - useTempTable = uint8(0) /* Store SELECT results in intermediate table */ - appendFlag = uint8(0) /* True if IDLIST is in table order */ - pList = uintptr(0) /* Register in which to store next column */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aTabColMap, addr1, addr11, addrCont, addrInsTop, addrL, addrTop, appendFlag, bIdListInOrder, bUseSeek, colFlags, db, endOfLoop, i, iDb, iRegStore, ipkColumn, isView, j, k, nColumn, nHidden, nIdx, pIdx, pIpk, pItem, pList, pNx, pSubq, pTab, pTrigger, pVTab, pX, rc, regAutoinc, regCols, regData, regFromSelect, regIns, regRec, regRowCount, regRowid, regTempRowid, regYield, srcTab, useTempTable, v, withoutRowid, y, v1, v11, v12, v14, v15, v16, v17, v18, v20, v21, v22, v3, v4, v5, v6, v7, v8 /* Number of columns in the data */ + nHidden = 0 /* Number of hidden columns if TABLE is virtual */ + *(*int32)(unsafe.Pointer(bp)) = 0 /* VDBE cursor that is the main data repository */ + *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* First index cursor */ + ipkColumn = -int32(1) /* Label for the end of the insertion loop */ + srcTab = 0 /* Data comes from this temporary cursor if >=0 */ + addrInsTop = 0 /* Jump to label "D" */ + addrCont = 0 /* Index of database holding TABLE */ + useTempTable = uint8(0) /* Store SELECT results in intermediate table */ + appendFlag = uint8(0) /* True if IDLIST is in table order */ + pList = uintptr(0) /* Register in which to store next column */ /* Register allocations */ regFromSelect = 0 /* Base register for data coming from SELECT */ regAutoinc = 0 /* Register holding the AUTOINCREMENT counter */ @@ -184836,7 +177800,7 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regIns = v1 regRowid = v1 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + int32(1) if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { regRowid++ (*TParse)(unsafe.Pointer(pParse)).FnMem++ @@ -184872,44 +177836,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if !(i < (*TIdList)(unsafe.Pointer(pColumn)).FnId) { break } - zCName = (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName - hName = _sqlite3StrIHash(tls, zCName) - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break + j = _sqlite3ColumnIndex(tls, pTab, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName) + if j >= 0 { + if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { + *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) != int32(hName) { - goto _3 + if i != j { + bIdListInOrder = uint8(0) } - if _sqlite3StrICmp(tls, zCName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName) == 0 { - if *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) == 0 { - *(*int32)(unsafe.Pointer(aTabColMap + uintptr(j)*4)) = i + int32(1) - } - if i != j { - bIdListInOrder = uint8(0) - } - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - ipkColumn = i - } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17542, libc.VaList(bp+88, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) - goto insert_cleanup - } - break + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + ipkColumn = i } - goto _3 - _3: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&(libc.Int32FromInt32(COLFLAG_STORED)|libc.Int32FromInt32(COLFLAG_VIRTUAL)) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17705, libc.VaList(bp+88, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) + goto insert_cleanup + } + } else { if _sqlite3IsRowid(tls, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName) != 0 && !(withoutRowid != 0) { ipkColumn = i bIdListInOrder = uint8(0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17583, libc.VaList(bp+88, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17746, libc.VaList(bp+88, pTabList+8, (*(*TIdList_item)(unsafe.Pointer(pColumn + 4 + uintptr(i)*4))).FzName)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto insert_cleanup } } @@ -184931,31 +177879,31 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSDParm = (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn regFromSelect = (*TSubquery)(unsafe.Pointer(pSubq)).FregResult nColumn = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+17615, libc.VaList(bp+88, pItem)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+17778, libc.VaList(bp+88, pItem)) if bIdListInOrder != 0 && nColumn == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { regData = regFromSelect regRowid = regData - int32(1) if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v4 = int32(1) + v3 = int32(1) } else { - v4 = 0 + v3 = 0 } - regIns = regRowid - v4 + regIns = regRowid - v3 } } else { - v6 = pParse + 48 - *(*int32)(unsafe.Pointer(v6))++ - v5 = *(*int32)(unsafe.Pointer(v6)) /* Top of the co-routine */ - regYield = v5 + v5 = pParse + 52 + *(*int32)(unsafe.Pointer(v5))++ + v4 = *(*int32)(unsafe.Pointer(v5)) /* Top of the co-routine */ + regYield = v4 addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regYield, 0, addrTop) _sqlite3SelectDestInit(tls, bp+8, int32(SRT_Coroutine), regYield) if bIdListInOrder != 0 { - v7 = regData + v6 = regData } else { - v7 = 0 + v6 = 0 } - (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v7 + (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst = v6 (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FnSdst = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) rc = _sqlite3Select(tls, pParse, pSelect, bp+8) regFromSelect = (*(*TSelectDest)(unsafe.Pointer(bp + 8))).FiSdst @@ -184979,10 +177927,10 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin useTempTable = uint8(1) } if useTempTable != 0 { /* Label "L" */ - v9 = pParse + 44 - v8 = *(*int32)(unsafe.Pointer(v9)) - *(*int32)(unsafe.Pointer(v9))++ - srcTab = v8 + v8 = pParse + 48 + v7 = *(*int32)(unsafe.Pointer(v8)) + *(*int32)(unsafe.Pointer(v8))++ + srcTab = v7 regRec = _sqlite3GetTempReg(tls, pParse) regTempRowid = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), srcTab, nColumn) @@ -185023,8 +177971,8 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { ipkColumn-- } - goto _10 - _10: + goto _9 + _9: ; i-- } @@ -185041,28 +177989,28 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_NOINSERT) != 0 { nHidden++ } - goto _11 - _11: + goto _10 + _10: ; i++ } } if nColumn != int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17623, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17786, libc.VaList(bp+88, pTabList+8, int32((*TTable)(unsafe.Pointer(pTab)).FnCol)-nHidden, nColumn)) goto insert_cleanup } } if pColumn != uintptr(0) && nColumn != (*TIdList)(unsafe.Pointer(pColumn)).FnId { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17675, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+17838, libc.VaList(bp+88, nColumn, (*TIdList)(unsafe.Pointer(pColumn)).FnId)) goto insert_cleanup } /* Initialize the count of rows to be inserted */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<= 0 { /* tag-20191021-001: If the INTEGER PRIMARY KEY is being generated by the ** SELECT, go ahead and copy the value into the rowid slot now, so that @@ -185175,18 +178123,18 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin ** using excess space. The file format definition requires this extra ** NULL - we cannot optimize further by skipping the column completely */ _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) - goto _20 + goto _19 } - v21 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags) - colFlags = v21 - if v21&uint32(COLFLAG_NOINSERT) != uint32(0) { + v20 = uint32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags) + colFlags = v20 + if v20&uint32(COLFLAG_NOINSERT) != uint32(0) { nHidden++ if colFlags&uint32(COLFLAG_VIRTUAL) != uint32(0) { /* Virtual columns do not participate in OP_MakeRecord. So back up ** iRegStore by one slot to compensate for the iRegStore++ in the ** outer for() loop */ iRegStore-- - goto _20 + goto _19 } else { if colFlags&uint32(COLFLAG_STORED) != uint32(0) { /* Stored columns are computed later. But if there are BEFORE @@ -185196,13 +178144,13 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin if *(*int32)(unsafe.Pointer(bp + 36))&int32(TRIGGER_BEFORE) != 0 { _sqlite3VdbeAddOp1(tls, v, int32(OP_SoftNull), iRegStore) } - goto _20 + goto _19 } else { if pColumn == uintptr(0) { /* Hidden columns that are not explicitly named in the INSERT - ** get there default value */ + ** get their default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } } } @@ -185213,14 +178161,14 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin /* A column not named in the insert column list gets its ** default value */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } k = j - int32(1) } else { if nColumn == 0 { /* This is INSERT INTO ... DEFAULT VALUES. Load the default value. */ _sqlite3ExprCodeFactorable(tls, pParse, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), iRegStore) - goto _20 + goto _19 } else { k = i - nHidden } @@ -185237,16 +178185,16 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin y = _sqlite3ExprCodeTarget(tls, pParse, pX, iRegStore) if y != iRegStore { if (*TExpr)(unsafe.Pointer(pX)).Fflags&uint32(libc.Int32FromInt32(EP_Subquery)) != uint32(0) { - v22 = int32(OP_Copy) + v21 = int32(OP_Copy) } else { - v22 = int32(OP_SCopy) + v21 = int32(OP_SCopy) } - _sqlite3VdbeAddOp2(tls, v, v22, y, iRegStore) + _sqlite3VdbeAddOp2(tls, v, v21, y, iRegStore) } } } - goto _20 - _20: + goto _19 + _19: ; i++ iRegStore++ @@ -185357,11 +178305,11 @@ func _sqlite3Insert(tls *libc.TLS, pParse uintptr, pTabList uintptr, pSelect uin _sqlite3VtabMakeWritable(tls, pParse, pTab) _sqlite3VdbeAddOp4(tls, v, int32(OP_VUpdate), int32(1), int32((*TTable)(unsafe.Pointer(pTab)).FnCol)+int32(2), regIns, pVTab, -int32(11)) if onError == int32(OE_Default) { - v23 = int32(OE_Abort) + v22 = int32(OE_Abort) } else { - v23 = onError + v22 = onError } - _sqlite3VdbeChangeP5(tls, v, uint16(v23)) + _sqlite3VdbeChangeP5(tls, v, uint16(v22)) _sqlite3MayAbort(tls, pParse) } else { *(*int32)(unsafe.Pointer(bp + 76)) = 0 /* True to use OPFLAG_SEEKRESULT */ @@ -185420,7 +178368,7 @@ insert_end: ** invoke the callback function. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17767) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+17930) } goto insert_cleanup insert_cleanup: @@ -185543,33 +178491,6 @@ type TIndexIterator = struct { type IndexIterator = TIndexIterator -type TIndexIterator1 = struct { - FeType int32 - Fi int32 - Fu struct { - Fax [0]struct { - FnIdx int32 - FaIdx uintptr - } - Flx struct { - FpIdx uintptr - } - F__ccgo_pad2 [4]byte - } -} - -type IndexIterator1 = TIndexIterator1 - -/* When IndexIterator.eType==1, then each index is an array of instances -** of the following object - */ -type TIndexListTerm1 = struct { - Fp uintptr - Fix int32 -} - -type IndexListTerm1 = TIndexListTerm1 - // C documentation // // /* Return the first index on the list */ @@ -185816,7 +178737,7 @@ func _sqlite3GenerateConstraintChecks(tls *libc.TLS, pParse uintptr, pTab uintpt case int32(OE_Rollback): fallthrough case int32(OE_Fail): - zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+13877, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) + zMsg = _sqlite3MPrintf(tls, db, __ccgo_ts+13993, libc.VaList(bp+48, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TColumn)(unsafe.Pointer(pCol)).FzCnName)) _sqlite3VdbeAddOp3(tls, v, int32(OP_HaltIfNull), libc.Int32FromInt32(SQLITE_CONSTRAINT)|libc.Int32FromInt32(5)<= 0 && !(int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == int32('/') || int32(*(*int8)(unsafe.Pointer(zFile + uintptr(iFile)))) == int32('\\'))) { @@ -188050,7 +180651,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp iFile-- } iFile++ - if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17817, int32(3)) == 0 { + if Xsqlite3_strnicmp(tls, zFile+uintptr(iFile), __ccgo_ts+17980, int32(3)) == 0 { iFile += int32(3) } iEntry = int32(8) @@ -188070,7 +180671,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp ; iFile++ } - libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17821, uint32(6)) + libc.Xmemcpy(tls, zAltEntry+uintptr(iEntry), __ccgo_ts+17984, uint32(6)) zEntry = zAltEntry xInit = _sqlite3OsDlSym(tls, pVfs, handle, zEntry) } @@ -188082,7 +180683,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v7 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17827, libc.VaList(bp+16, zEntry, zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17990, libc.VaList(bp+16, zEntry, zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -188097,7 +180698,7 @@ func _sqlite3LoadExtension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintp return SQLITE_OK } if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+17870, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+18033, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3OsDlClose(tls, pVfs, handle) @@ -188128,7 +180729,7 @@ extension_not_found: *(*uintptr)(unsafe.Pointer(pzErrMsg)) = v10 if *(*uintptr)(unsafe.Pointer(bp)) != 0 { /* zErrmsg would be NULL if not so */ - Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+17902, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) + Xsqlite3_snprintf(tls, int32(nMsg), *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+18065, libc.VaList(bp+16, int32(FILENAME_MAX), zFile)) _sqlite3OsDlError(tls, pVfs, int32(nMsg-uint64(1)), *(*uintptr)(unsafe.Pointer(bp))) } } @@ -188137,7 +180738,7 @@ extension_not_found: /* Shared library endings to try if zFile cannot be loaded as written */ var _azEndings = [1]uintptr{ - 0: __ccgo_ts + 17781, + 0: __ccgo_ts + 17944, } func Xsqlite3_load_extension(tls *libc.TLS, db uintptr, zFile uintptr, zProc uintptr, pzErrMsg uintptr) (r int32) { @@ -188206,14 +180807,9 @@ type Tsqlite3AutoExtList = struct { type sqlite3AutoExtList = Tsqlite3AutoExtList -type Tsqlite3AutoExtList1 = struct { - FnExt Tu32 - FaExt uintptr -} - -type sqlite3AutoExtList1 = Tsqlite3AutoExtList1 +var _sqlite3Autoext = Tsqlite3AutoExtList{} -var _sqlite3Autoext = Tsqlite3AutoExtList1{} +type t__ccgo_fp__Xsqlite3_auto_extension_0 = func(*libc.TLS) /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, @@ -188228,7 +180824,7 @@ var _sqlite3Autoext = Tsqlite3AutoExtList1{} // ** Register a statically linked extension that is automatically // ** loaded by every new database connection. // */ -func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var aNew, mutex uintptr var i Tu32 var nByte Tu64 @@ -188246,7 +180842,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i < _sqlite3Autoext.FnExt) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == __ccgo_fp_xInit { break } goto _1 @@ -188261,7 +180857,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { rc = int32(SQLITE_NOMEM) } else { _sqlite3Autoext.FaExt = aNew - *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) = xInit + *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) = __ccgo_fp_xInit _sqlite3Autoext.FnExt++ } } @@ -188271,6 +180867,8 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { return r } +type t__ccgo_fp__Xsqlite3_cancel_auto_extension_0 = func(*libc.TLS) + // C documentation // // /* @@ -188282,7 +180880,7 @@ func Xsqlite3_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { // ** Return 1 if xInit was found on the list and removed. Return 0 if xInit // ** was not on the list. // */ -func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { +func Xsqlite3_cancel_auto_extension(tls *libc.TLS, __ccgo_fp_xInit uintptr) (r int32) { var i, n int32 var mutex uintptr _, _, _ = i, mutex, n @@ -188294,7 +180892,7 @@ func Xsqlite3_cancel_auto_extension(tls *libc.TLS, xInit uintptr) (r int32) { if !(i >= 0) { break } - if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == xInit { + if *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) == __ccgo_fp_xInit { _sqlite3Autoext.FnExt-- *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer(_sqlite3Autoext.FaExt + uintptr(_sqlite3Autoext.FnExt)*4)) n++ @@ -188370,7 +180968,7 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { rc = v2 } if v3 && v2 != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+17939, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+18102, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) go1 = 0 } Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -188424,63 +181022,63 @@ func _sqlite3AutoLoadExtensions(tls *libc.TLS, db uintptr) { // ** result column is different from the name of the pragma // */ var _pragCName = [57]uintptr{ - 0: __ccgo_ts + 6871, - 1: __ccgo_ts + 17978, - 2: __ccgo_ts + 10554, - 3: __ccgo_ts + 17982, - 4: __ccgo_ts + 17987, - 5: __ccgo_ts + 17990, - 6: __ccgo_ts + 18000, - 7: __ccgo_ts + 18010, - 8: __ccgo_ts + 18016, - 9: __ccgo_ts + 18020, - 10: __ccgo_ts + 18025, - 11: __ccgo_ts + 18030, - 12: __ccgo_ts + 18038, - 13: __ccgo_ts + 18049, - 14: __ccgo_ts + 18052, - 15: __ccgo_ts + 18059, - 16: __ccgo_ts + 18020, - 17: __ccgo_ts + 18025, - 18: __ccgo_ts + 18066, - 19: __ccgo_ts + 18071, - 20: __ccgo_ts + 18074, - 21: __ccgo_ts + 18081, - 22: __ccgo_ts + 18016, - 23: __ccgo_ts + 18020, - 24: __ccgo_ts + 18087, - 25: __ccgo_ts + 18092, - 26: __ccgo_ts + 18097, - 27: __ccgo_ts + 18020, - 28: __ccgo_ts + 18101, - 29: __ccgo_ts + 18025, - 30: __ccgo_ts + 18109, - 31: __ccgo_ts + 18113, - 32: __ccgo_ts + 18118, - 33: __ccgo_ts + 13293, - 34: __ccgo_ts + 13289, - 35: __ccgo_ts + 18124, - 36: __ccgo_ts + 18129, - 37: __ccgo_ts + 18134, - 38: __ccgo_ts + 17978, - 39: __ccgo_ts + 18020, - 40: __ccgo_ts + 18139, - 41: __ccgo_ts + 18146, - 42: __ccgo_ts + 18153, - 43: __ccgo_ts + 10554, - 44: __ccgo_ts + 18161, - 45: __ccgo_ts + 6874, - 46: __ccgo_ts + 18167, - 47: __ccgo_ts + 17978, - 48: __ccgo_ts + 18020, - 49: __ccgo_ts + 18172, - 50: __ccgo_ts + 18177, - 51: __ccgo_ts + 17362, - 52: __ccgo_ts + 18182, - 53: __ccgo_ts + 18195, - 54: __ccgo_ts + 18204, - 55: __ccgo_ts + 18211, - 56: __ccgo_ts + 18222, + 0: __ccgo_ts + 6959, + 1: __ccgo_ts + 18141, + 2: __ccgo_ts + 10670, + 3: __ccgo_ts + 18145, + 4: __ccgo_ts + 18150, + 5: __ccgo_ts + 18153, + 6: __ccgo_ts + 18163, + 7: __ccgo_ts + 18173, + 8: __ccgo_ts + 18179, + 9: __ccgo_ts + 18183, + 10: __ccgo_ts + 18188, + 11: __ccgo_ts + 18193, + 12: __ccgo_ts + 18201, + 13: __ccgo_ts + 18212, + 14: __ccgo_ts + 18215, + 15: __ccgo_ts + 18183, + 16: __ccgo_ts + 18222, + 17: __ccgo_ts + 18188, + 18: __ccgo_ts + 18230, + 19: __ccgo_ts + 18234, + 20: __ccgo_ts + 18239, + 21: __ccgo_ts + 18245, + 22: __ccgo_ts + 18183, + 23: __ccgo_ts + 18188, + 24: __ccgo_ts + 18252, + 25: __ccgo_ts + 18257, + 26: __ccgo_ts + 18260, + 27: __ccgo_ts + 18267, + 28: __ccgo_ts + 18179, + 29: __ccgo_ts + 18183, + 30: __ccgo_ts + 18273, + 31: __ccgo_ts + 18278, + 32: __ccgo_ts + 18283, + 33: __ccgo_ts + 18141, + 34: __ccgo_ts + 18183, + 35: __ccgo_ts + 18287, + 36: __ccgo_ts + 18294, + 37: __ccgo_ts + 18301, + 38: __ccgo_ts + 13409, + 39: __ccgo_ts + 13405, + 40: __ccgo_ts + 18309, + 41: __ccgo_ts + 18314, + 42: __ccgo_ts + 18319, + 43: __ccgo_ts + 10670, + 44: __ccgo_ts + 18324, + 45: __ccgo_ts + 6962, + 46: __ccgo_ts + 18330, + 47: __ccgo_ts + 18335, + 48: __ccgo_ts + 17525, + 49: __ccgo_ts + 18340, + 50: __ccgo_ts + 18141, + 51: __ccgo_ts + 18183, + 52: __ccgo_ts + 18353, + 53: __ccgo_ts + 18358, + 54: __ccgo_ts + 18367, + 55: __ccgo_ts + 18374, + 56: __ccgo_ts + 18385, } // C documentation @@ -188500,343 +181098,343 @@ type PragmaName = TPragmaName var _aPragmaName = [67]TPragmaName{ 0: { - FzName: __ccgo_ts + 18230, + FzName: __ccgo_ts + 18393, FePragTyp: uint8(PragTyp_ANALYSIS_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 1: { - FzName: __ccgo_ts + 18245, + FzName: __ccgo_ts + 18408, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_APPLICATION_ID), }, 2: { - FzName: __ccgo_ts + 18260, + FzName: __ccgo_ts + 18423, FePragTyp: uint8(PragTyp_AUTO_VACUUM), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 3: { - FzName: __ccgo_ts + 18272, + FzName: __ccgo_ts + 18435, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_AutoIndex), }, 4: { - FzName: __ccgo_ts + 18288, + FzName: __ccgo_ts + 18451, FePragTyp: uint8(PragTyp_BUSY_TIMEOUT), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(56), FnPragCName: uint8(1), }, 5: { - FzName: __ccgo_ts + 18211, + FzName: __ccgo_ts + 18374, FePragTyp: uint8(PragTyp_CACHE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 6: { - FzName: __ccgo_ts + 18301, + FzName: __ccgo_ts + 18464, FePragTyp: uint8(PragTyp_CACHE_SPILL), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 7: { - FzName: __ccgo_ts + 18313, + FzName: __ccgo_ts + 18476, FePragTyp: uint8(PragTyp_CASE_SENSITIVE_LIKE), FmPragFlg: uint8(PragFlg_NoColumns), }, 8: { - FzName: __ccgo_ts + 18333, + FzName: __ccgo_ts + 18496, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CellSizeCk), }, 9: { - FzName: __ccgo_ts + 18349, + FzName: __ccgo_ts + 18512, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_CkptFullFSync), }, 10: { - FzName: __ccgo_ts + 18370, + FzName: __ccgo_ts + 18533, FePragTyp: uint8(PragTyp_COLLATION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(2), }, 11: { - FzName: __ccgo_ts + 18385, + FzName: __ccgo_ts + 18548, FePragTyp: uint8(PragTyp_COMPILE_OPTIONS), FmPragFlg: uint8(PragFlg_Result0), }, 12: { - FzName: __ccgo_ts + 18401, + FzName: __ccgo_ts + 18564, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(0x00001)) << libc.Int32FromInt32(32), }, 13: { - FzName: __ccgo_ts + 18415, + FzName: __ccgo_ts + 18578, FePragTyp: uint8(PragTyp_DATA_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 14: { - FzName: __ccgo_ts + 18436, + FzName: __ccgo_ts + 18599, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_DATA_VERSION), }, 15: { - FzName: __ccgo_ts + 18449, + FzName: __ccgo_ts + 18612, FePragTyp: uint8(PragTyp_DATABASE_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(47), + FiPragCName: uint8(50), FnPragCName: uint8(3), }, 16: { - FzName: __ccgo_ts + 18463, + FzName: __ccgo_ts + 18626, FePragTyp: uint8(PragTyp_DEFAULT_CACHE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiPragCName: uint8(55), FnPragCName: uint8(1), }, 17: { - FzName: __ccgo_ts + 18482, + FzName: __ccgo_ts + 18645, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_DeferFKs), }, 18: { - FzName: __ccgo_ts + 18501, + FzName: __ccgo_ts + 18664, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_NullCallback), }, 19: { - FzName: __ccgo_ts + 18524, + FzName: __ccgo_ts + 18687, FePragTyp: uint8(PragTyp_ENCODING), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 20: { - FzName: __ccgo_ts + 18533, + FzName: __ccgo_ts + 18696, FePragTyp: uint8(PragTyp_FOREIGN_KEY_CHECK), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(43), FnPragCName: uint8(4), }, 21: { - FzName: __ccgo_ts + 18551, + FzName: __ccgo_ts + 18714, FePragTyp: uint8(PragTyp_FOREIGN_KEY_LIST), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FnPragCName: uint8(8), }, 22: { - FzName: __ccgo_ts + 18568, + FzName: __ccgo_ts + 18731, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ForeignKeys), }, 23: { - FzName: __ccgo_ts + 18581, + FzName: __ccgo_ts + 18744, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_ReadOnly) | libc.Int32FromInt32(PragFlg_Result0)), }, 24: { - FzName: __ccgo_ts + 18596, + FzName: __ccgo_ts + 18759, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullColNames), }, 25: { - FzName: __ccgo_ts + 18614, + FzName: __ccgo_ts + 18777, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_FullFSync), }, 26: { - FzName: __ccgo_ts + 18624, + FzName: __ccgo_ts + 18787, FePragTyp: uint8(PragTyp_FUNCTION_LIST), FmPragFlg: uint8(PragFlg_Result0), - FiPragCName: uint8(27), + FiPragCName: uint8(15), FnPragCName: uint8(6), }, 27: { - FzName: __ccgo_ts + 18638, + FzName: __ccgo_ts + 18801, FePragTyp: uint8(PragTyp_HARD_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 28: { - FzName: __ccgo_ts + 18654, + FzName: __ccgo_ts + 18817, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_IgnoreChecks), }, 29: { - FzName: __ccgo_ts + 18679, + FzName: __ccgo_ts + 18842, FePragTyp: uint8(PragTyp_INCREMENTAL_VACUUM), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_NoColumns)), }, 30: { - FzName: __ccgo_ts + 18698, + FzName: __ccgo_ts + 18861, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(3), }, 31: { - FzName: __ccgo_ts + 18709, + FzName: __ccgo_ts + 18872, FePragTyp: uint8(PragTyp_INDEX_LIST), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(38), + FiPragCName: uint8(33), FnPragCName: uint8(5), }, 32: { - FzName: __ccgo_ts + 18720, + FzName: __ccgo_ts + 18883, FePragTyp: uint8(PragTyp_INDEX_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), - FiPragCName: uint8(21), + FiPragCName: uint8(27), FnPragCName: uint8(6), FiArg: uint64(1), }, 33: { - FzName: __ccgo_ts + 18732, + FzName: __ccgo_ts + 18895, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 34: { - FzName: __ccgo_ts + 18748, + FzName: __ccgo_ts + 18911, FePragTyp: uint8(PragTyp_JOURNAL_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 35: { - FzName: __ccgo_ts + 18761, + FzName: __ccgo_ts + 18924, FePragTyp: uint8(PragTyp_JOURNAL_SIZE_LIMIT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 36: { - FzName: __ccgo_ts + 18780, + FzName: __ccgo_ts + 18943, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_LegacyAlter), }, 37: { - FzName: __ccgo_ts + 18799, + FzName: __ccgo_ts + 18962, FePragTyp: uint8(PragTyp_LOCKING_MODE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 38: { - FzName: __ccgo_ts + 18812, + FzName: __ccgo_ts + 18975, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 39: { - FzName: __ccgo_ts + 18827, + FzName: __ccgo_ts + 18990, FePragTyp: uint8(PragTyp_MMAP_SIZE), }, 40: { - FzName: __ccgo_ts + 18837, + FzName: __ccgo_ts + 19000, FePragTyp: uint8(PragTyp_MODULE_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 41: { - FzName: __ccgo_ts + 18849, + FzName: __ccgo_ts + 19012, FePragTyp: uint8(PragTyp_OPTIMIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_NeedSchema)), }, 42: { - FzName: __ccgo_ts + 18858, + FzName: __ccgo_ts + 19021, FePragTyp: uint8(PragTyp_PAGE_COUNT), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq)), }, 43: { - FzName: __ccgo_ts + 18869, + FzName: __ccgo_ts + 19032, FePragTyp: uint8(PragTyp_PAGE_SIZE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 44: { - FzName: __ccgo_ts + 18879, + FzName: __ccgo_ts + 19042, FePragTyp: uint8(PragTyp_PRAGMA_LIST), FmPragFlg: uint8(PragFlg_Result0), FiPragCName: uint8(9), FnPragCName: uint8(1), }, 45: { - FzName: __ccgo_ts + 18891, + FzName: __ccgo_ts + 19054, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_QueryOnly), }, 46: { - FzName: __ccgo_ts + 18902, + FzName: __ccgo_ts + 19065, FePragTyp: uint8(PragTyp_INTEGRITY_CHECK), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), }, 47: { - FzName: __ccgo_ts + 18914, + FzName: __ccgo_ts + 19077, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(0x00004)) << libc.Int32FromInt32(32), }, 48: { - FzName: __ccgo_ts + 18931, + FzName: __ccgo_ts + 19094, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_RecTriggers), }, 49: { - FzName: __ccgo_ts + 18950, + FzName: __ccgo_ts + 19113, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ReverseOrder), }, 50: { - FzName: __ccgo_ts + 18976, + FzName: __ccgo_ts + 19139, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_SCHEMA_VERSION), }, 51: { - FzName: __ccgo_ts + 18991, + FzName: __ccgo_ts + 19154, FePragTyp: uint8(PragTyp_SECURE_DELETE), FmPragFlg: uint8(PragFlg_Result0), }, 52: { - FzName: __ccgo_ts + 19005, + FzName: __ccgo_ts + 19168, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_ShortColNames), }, 53: { - FzName: __ccgo_ts + 19024, + FzName: __ccgo_ts + 19187, FePragTyp: uint8(PragTyp_SHRINK_MEMORY), FmPragFlg: uint8(PragFlg_NoColumns), }, 54: { - FzName: __ccgo_ts + 19038, + FzName: __ccgo_ts + 19201, FePragTyp: uint8(PragTyp_SOFT_HEAP_LIMIT), FmPragFlg: uint8(PragFlg_Result0), }, 55: { - FzName: __ccgo_ts + 19054, + FzName: __ccgo_ts + 19217, FePragTyp: uint8(PragTyp_SYNCHRONOUS), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_SchemaReq) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 56: { - FzName: __ccgo_ts + 19066, + FzName: __ccgo_ts + 19229, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), FnPragCName: uint8(6), }, 57: { - FzName: __ccgo_ts + 19077, + FzName: __ccgo_ts + 19240, FePragTyp: uint8(PragTyp_TABLE_LIST), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1)), - FiPragCName: uint8(15), + FiPragCName: uint8(21), FnPragCName: uint8(6), }, 58: { - FzName: __ccgo_ts + 19088, + FzName: __ccgo_ts + 19251, FePragTyp: uint8(PragTyp_TABLE_INFO), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NeedSchema) | libc.Int32FromInt32(PragFlg_Result1) | libc.Int32FromInt32(PragFlg_SchemaOpt)), FiPragCName: uint8(8), @@ -188844,45 +181442,45 @@ var _aPragmaName = [67]TPragmaName{ FiArg: uint64(1), }, 59: { - FzName: __ccgo_ts + 19100, + FzName: __ccgo_ts + 19263, FePragTyp: uint8(PragTyp_TEMP_STORE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), }, 60: { - FzName: __ccgo_ts + 19111, + FzName: __ccgo_ts + 19274, FePragTyp: uint8(PragTyp_TEMP_STORE_DIRECTORY), FmPragFlg: uint8(PragFlg_NoColumns1), }, 61: { - FzName: __ccgo_ts + 19132, + FzName: __ccgo_ts + 19295, FePragTyp: uint8(PragTyp_THREADS), FmPragFlg: uint8(PragFlg_Result0), }, 62: { - FzName: __ccgo_ts + 19140, + FzName: __ccgo_ts + 19303, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(SQLITE_TrustedSchema), }, 63: { - FzName: __ccgo_ts + 19155, + FzName: __ccgo_ts + 19318, FePragTyp: uint8(PragTyp_HEADER_VALUE), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_NoColumns1) | libc.Int32FromInt32(PragFlg_Result0)), FiArg: uint64(BTREE_USER_VERSION), }, 64: { - FzName: __ccgo_ts + 19168, + FzName: __ccgo_ts + 19331, FePragTyp: uint8(PragTyp_WAL_AUTOCHECKPOINT), }, 65: { - FzName: __ccgo_ts + 19187, + FzName: __ccgo_ts + 19350, FePragTyp: uint8(PragTyp_WAL_CHECKPOINT), FmPragFlg: uint8(PragFlg_NeedSchema), - FiPragCName: uint8(50), + FiPragCName: uint8(47), FnPragCName: uint8(3), }, 66: { - FzName: __ccgo_ts + 19202, + FzName: __ccgo_ts + 19365, FePragTyp: uint8(PragTyp_FLAG), FmPragFlg: uint8(libc.Int32FromInt32(PragFlg_Result0) | libc.Int32FromInt32(PragFlg_NoColumns1)), FiArg: uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_NoSchemaError)), @@ -188900,7 +181498,7 @@ var _aPragmaName = [67]TPragmaName{ ** the following macro or to the actual analysis_limit if it is non-zero, ** in order to prevent PRAGMA optimize from running for too long. ** -** The value of 2000 is chosen emperically so that the worst-case run-time +** The value of 2000 is chosen empirically so that the worst-case run-time ** for PRAGMA optimize does not exceed 100 milliseconds against a variety ** of test databases on a RaspberryPI-4 compiled using -Os and without ** -DSQLITE_DEBUG. Of course, your mileage may vary. For the purpose of @@ -189008,10 +181606,10 @@ func _sqlite3GetBoolean(tls *libc.TLS, z uintptr, dflt Tu8) (r Tu8) { // */ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { if z != 0 { - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+5171) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+5259) { return int32(PAGER_LOCKINGMODE_EXCLUSIVE) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19218) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19381) { return PAGER_LOCKINGMODE_NORMAL } } @@ -189029,13 +181627,13 @@ func _getLockingMode(tls *libc.TLS, z uintptr) (r int32) { func _getAutoVacuum(tls *libc.TLS, z uintptr) (r int32) { var i, v1 int32 _, _ = i, v1 - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+9714) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+9801) { return BTREE_AUTOVACUUM_NONE } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19225) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19388) { return int32(BTREE_AUTOVACUUM_FULL) } - if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19230) { + if 0 == _sqlite3StrICmp(tls, z, __ccgo_ts+19393) { return int32(BTREE_AUTOVACUUM_INCR) } i = _sqlite3Atoi(tls, z) @@ -189058,10 +181656,10 @@ func _getTempStore(tls *libc.TLS, z uintptr) (r int32) { if int32(*(*int8)(unsafe.Pointer(z))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(z))) <= int32('2') { return int32(*(*int8)(unsafe.Pointer(z))) - int32('0') } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+18172) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+18353) == 0 { return int32(1) } else { - if _sqlite3StrICmp(tls, z, __ccgo_ts+19242) == 0 { + if _sqlite3StrICmp(tls, z, __ccgo_ts+19405) == 0 { return int32(2) } else { return 0 @@ -189083,7 +181681,7 @@ func _invalidateTempStorage(tls *libc.TLS, pParse uintptr) (r int32) { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt != uintptr(0) { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) || _sqlite3BtreeTxnState(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) != SQLITE_TXN_NONE { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19249, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19412, 0) return int32(SQLITE_ERROR) } _sqlite3BtreeClose(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpBt) @@ -189213,15 +181811,15 @@ func _actionName(tls *libc.TLS, action Tu8) (r uintptr) { _ = zName switch int32(action) { case int32(OE_SetNull): - zName = __ccgo_ts + 19311 + zName = __ccgo_ts + 19474 case int32(OE_SetDflt): - zName = __ccgo_ts + 19320 + zName = __ccgo_ts + 19483 case int32(OE_Cascade): - zName = __ccgo_ts + 19332 + zName = __ccgo_ts + 19495 case int32(OE_Restrict): - zName = __ccgo_ts + 19340 + zName = __ccgo_ts + 19503 default: - zName = __ccgo_ts + 19349 + zName = __ccgo_ts + 19512 break } return zName @@ -189242,12 +181840,12 @@ func _sqlite3JournalModename(tls *libc.TLS, eMode int32) (r uintptr) { } var _azModeName = [6]uintptr{ - 0: __ccgo_ts + 19359, - 1: __ccgo_ts + 19366, - 2: __ccgo_ts + 19374, - 3: __ccgo_ts + 19378, - 4: __ccgo_ts + 19242, - 5: __ccgo_ts + 19387, + 0: __ccgo_ts + 19522, + 1: __ccgo_ts + 19529, + 2: __ccgo_ts + 19537, + 3: __ccgo_ts + 19541, + 4: __ccgo_ts + 19405, + 5: __ccgo_ts + 19550, } // C documentation @@ -189309,15 +181907,15 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s goto _1 } if (*TFuncDef)(unsafe.Pointer(p)).FxValue != uintptr(0) { - zType = __ccgo_ts + 19412 + zType = __ccgo_ts + 19575 } else { if (*TFuncDef)(unsafe.Pointer(p)).FxFinalize != uintptr(0) { - zType = __ccgo_ts + 19414 + zType = __ccgo_ts + 19577 } else { - zType = __ccgo_ts + 9113 + zType = __ccgo_ts + 9200 } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19416, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19579, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer(p)).FzName, isBuiltin, zType, _azEnc[(*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK)], int32((*TFuncDef)(unsafe.Pointer(p)).FnArg), (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&mask^uint32(SQLITE_INNOCUOUS))) goto _1 _1: ; @@ -189326,9 +181924,9 @@ func _pragmaFunclistLine(tls *libc.TLS, v uintptr, p uintptr, isBuiltin int32, s } var _azEnc = [4]uintptr{ - 1: __ccgo_ts + 19391, - 2: __ccgo_ts + 19396, - 3: __ccgo_ts + 19404, + 1: __ccgo_ts + 19554, + 2: __ccgo_ts + 19559, + 3: __ccgo_ts + 19567, } // C documentation @@ -189428,7 +182026,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p return } if minusFlag != 0 { - zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19423, libc.VaList(bp+136, pValue)) + zRight = _sqlite3MPrintf(tls, db, __ccgo_ts+19586, libc.VaList(bp+136, pValue)) } else { zRight = _sqlite3NameFromToken(tls, db, pValue) } @@ -189471,7 +182069,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } if rc != int32(SQLITE_NOTFOUND) { if (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0] != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4710, libc.VaList(bp+136, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0])) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4829, libc.VaList(bp+136, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0])) Xsqlite3_free(tls, (*(*[4]uintptr)(unsafe.Pointer(bp + 4)))[0]) } (*TParse)(unsafe.Pointer(pParse)).FnErr++ @@ -189516,7 +182114,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_DEFAULT_CACHE_SIZE): _sqlite3VdbeUsesBtree(tls, v, iDb) if !(zRight != 0) { - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) aOp = _sqlite3VdbeAddOpList(tls, v, int32(libc.Uint32FromInt64(36)/libc.Uint32FromInt64(4)), uintptr(unsafe.Pointer(&_getCacheSize)), _iLn3) if 0 != 0 { break @@ -189575,7 +182173,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pBt1 = (*TDb)(unsafe.Pointer(pDb)).FpBt b = -int32(1) if zRight != 0 { - if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19427) == 0 { + if Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19590) == 0 { b = int32(2) } else { b = int32(_sqlite3GetBoolean(tls, zRight, uint8(0))) @@ -189618,7 +182216,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p case int32(PragTyp_PAGE_COUNT): *(*Ti64)(unsafe.Pointer(bp + 24)) = 0 _sqlite3CodeVerifySchema(tls, pParse, iDb) - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) iReg = v4 @@ -189646,7 +182244,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p */ fallthrough case int32(PragTyp_LOCKING_MODE): - zRet = __ccgo_ts + 19218 + zRet = __ccgo_ts + 19381 eMode = _getLockingMode(tls, zRight) if (*TToken)(unsafe.Pointer(pId2)).Fn == uint32(0) && eMode == -int32(1) { /* Simple "PRAGMA locking_mode;" statement. This is a query for @@ -189674,7 +182272,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p eMode = _sqlite3PagerLockingMode(tls, pPager, eMode) } if eMode == int32(PAGER_LOCKINGMODE_EXCLUSIVE) { - zRet = __ccgo_ts + 5171 + zRet = __ccgo_ts + 5259 } _returnSingleText(tls, v, zRet) break @@ -189964,7 +182562,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+56) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 56)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19432, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19595, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } @@ -189974,7 +182572,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } Xsqlite3_free(tls, Xsqlite3_temp_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+136, zRight)) + Xsqlite3_temp_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+136, zRight)) } else { Xsqlite3_temp_directory = uintptr(0) } @@ -190003,14 +182601,14 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if *(*int8)(unsafe.Pointer(zRight)) != 0 { rc = _sqlite3OsAccess(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpVfs, zRight, int32(SQLITE_ACCESS_READWRITE), bp+60) if rc != SQLITE_OK || *(*int32)(unsafe.Pointer(bp + 60)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19432, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19595, 0) Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_VFS1))) goto pragma_out } } Xsqlite3_free(tls, Xsqlite3_data_directory) if *(*int8)(unsafe.Pointer(zRight)) != 0 { - Xsqlite3_data_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+136, zRight)) + Xsqlite3_data_directory = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+136, zRight)) } else { Xsqlite3_data_directory = uintptr(0) } @@ -190032,7 +182630,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _returnSingleInt(tls, v, int64(int32((*TDb)(unsafe.Pointer(pDb)).Fsafety_level)-int32(1))) } else { if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19457, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+19620, 0) } else { if iDb != int32(1) { iLevel = (int32(_getSafetyLevel(tls, zRight, 0, uint8(1))) + int32(1)) & int32(PAGER_SYNCHRONOUS_MASK) @@ -190064,8 +182662,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p *(*Tu64)(unsafe.Pointer(db + 32)) &= ^mask if mask == uint64(SQLITE_DeferFKs) { (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredImmCons = 0 + (*Tsqlite3)(unsafe.Pointer(db)).FnDeferredCons = 0 } - if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19510) == 0 { + if mask&uint64(SQLITE_WriteSchema) != uint64(0) && Xsqlite3_stricmp(tls, zRight, __ccgo_ts+19673) == 0 { /* IMP: R-60817-01178 If the argument is "RESET" then schema ** writing is disabled (as with "PRAGMA writable_schema=OFF") and, ** in addition, the schema is reloaded. */ @@ -190145,9 +182744,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pColExpr = _sqlite3ColumnExpr(tls, pTab, pCol) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - v14 = __ccgo_ts + 19516 + v14 = __ccgo_ts + 19679 } else { - v14 = __ccgo_ts + 19524 + v14 = __ccgo_ts + 19687 } if int32(uint32(*(*uint8)(unsafe.Pointer(pCol + 4))&0xf>>0)) != 0 { v15 = int32(1) @@ -190159,7 +182758,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v16 = *(*uintptr)(unsafe.Pointer(pColExpr + 8)) } - _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+136, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1673), v15, v16, k, isHidden)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), v14, libc.VaList(bp+136, i-nHidden, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, _sqlite3ColumnType(tls, pCol, __ccgo_ts+1674), v15, v16, k, isHidden)) goto _12 _12: ; @@ -190218,7 +182817,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } pTab1 = (*THashElem)(unsafe.Pointer(k1)).Fdata if int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) == 0 { - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19531, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+19694, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab1)).FzName)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 64)) = uintptr(0) Xsqlite3_prepare_v3(tls, db, zSql, -int32(1), uint32(SQLITE_PREPARE_DONT_LOG), bp+64, uintptr(0)) @@ -190226,7 +182825,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3DbFree(tls, db, zSql) } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpParse, __ccgo_ts+1644, 0) (*TParse)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FpParse)).Frc = int32(SQLITE_NOMEM) } pHash = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FpSchema + 8 @@ -190248,19 +182847,19 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _20 } if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VIEW) { - zType = __ccgo_ts + 12292 + zType = __ccgo_ts + 12408 } else { if int32((*TTable)(unsafe.Pointer(pTab2)).FeTabType) == int32(TABTYP_VTAB) { - zType = __ccgo_ts + 14540 + zType = __ccgo_ts + 14656 } else { if (*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Shadow) != 0 { - zType = __ccgo_ts + 19547 + zType = __ccgo_ts + 19710 } else { - zType = __ccgo_ts + 10554 + zType = __ccgo_ts + 10670 } } } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19554, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19717, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(ii4)*16))).FzDbSName, _sqlite3PreferredTableName(tls, (*TTable)(unsafe.Pointer(pTab2)).FzName), zType, int32((*TTable)(unsafe.Pointer(pTab2)).FnCol), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_WithoutRowid) != uint32(0)), libc.BoolInt32((*TTable)(unsafe.Pointer(pTab2)).FtabFlags&uint32(TF_Strict) != uint32(0)))) goto _20 _20: ; @@ -190307,9 +182906,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { v22 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab3)).FaCol + uintptr(cnum)*12))).FzCnName } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19561, libc.VaList(bp+136, i1, int32(cnum), v22)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19724, libc.VaList(bp+136, i1, int32(cnum), v22)) if (*TPragmaName)(unsafe.Pointer(pPragma)).FiArg != 0 { - _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+19566, libc.VaList(bp+136, int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) + _sqlite3VdbeMultiLoad(tls, v, int32(4), __ccgo_ts+19729, libc.VaList(bp+136, int32(*(*Tu8)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaSortOrder + uintptr(i1)))), *(*uintptr)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FazColl + uintptr(i1)*4)), libc.BoolInt32(i1 < int32((*TIndex)(unsafe.Pointer(pIdx)).FnKeyCol)))) } _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), int32(1), (*TParse)(unsafe.Pointer(pParse)).FnMem) goto _21 @@ -190333,11 +182932,11 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } azOrigin = [3]uintptr{ - 0: __ccgo_ts + 19571, - 1: __ccgo_ts + 19573, - 2: __ccgo_ts + 18049, + 0: __ccgo_ts + 19734, + 1: __ccgo_ts + 19736, + 2: __ccgo_ts + 18212, } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19575, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(int32((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19738, libc.VaList(bp+136, i2, (*TIndex)(unsafe.Pointer(pIdx1)).FzName, libc.BoolInt32(int32((*TIndex)(unsafe.Pointer(pIdx1)).FonError) != OE_None), azOrigin[int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x3>>0))], libc.BoolInt32((*TIndex)(unsafe.Pointer(pIdx1)).FpPartIdxWhere != uintptr(0)))) goto _23 _23: ; @@ -190356,7 +182955,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt == uintptr(0) { goto _24 } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19581, libc.VaList(bp+136, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt))) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19744, libc.VaList(bp+136, i3, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FzDbSName, _sqlite3BtreeGetFilename(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i3)*16))).FpBt))) goto _24 _24: ; @@ -190373,7 +182972,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p pColl = (*THashElem)(unsafe.Pointer(p)).Fdata v26 = i4 i4++ - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19585, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19748, libc.VaList(bp+136, v26, (*TCollSeq)(unsafe.Pointer(pColl)).FzName)) goto _25 _25: ; @@ -190423,7 +183022,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p break } pMod = (*THashElem)(unsafe.Pointer(j1)).Fdata - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9113, libc.VaList(bp+136, (*TModule)(unsafe.Pointer(pMod)).FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9200, libc.VaList(bp+136, (*TModule)(unsafe.Pointer(pMod)).FzName)) goto _30 _30: ; @@ -190435,7 +183034,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(i6 < int32(libc.Uint32FromInt64(1072)/libc.Uint32FromInt64(16))) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9113, libc.VaList(bp+136, _aPragmaName[i6].FzName)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+9200, libc.VaList(bp+136, _aPragmaName[i6].FzName)) goto _31 _31: ; @@ -190461,7 +183060,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if !(j2 < (*TFKey)(unsafe.Pointer(pFK)).FnCol) { break } - _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19588, libc.VaList(bp+136, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FiFrom)*12))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25))), __ccgo_ts+19597)) + _sqlite3VdbeMultiLoad(tls, v, int32(1), __ccgo_ts+19751, libc.VaList(bp+136, i7, j2, (*TFKey)(unsafe.Pointer(pFK)).FzTo, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab5)).FaCol + uintptr((*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FiFrom)*12))).FzCnName, (*(*TsColMap)(unsafe.Pointer(pFK + 36 + uintptr(j2)*8))).FzCol, _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25 + 1))), _actionName(tls, *(*Tu8)(unsafe.Pointer(pFK + 25))), __ccgo_ts+19760)) goto _32 _32: ; @@ -190475,8 +183074,8 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } case int32(PragTyp_FOREIGN_KEY_CHECK): /* child to parent column mapping */ regResult = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(4) - v34 = pParse + 48 + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(4) + v34 = pParse + 52 *(*int32)(unsafe.Pointer(v34))++ v33 = *(*int32)(unsafe.Pointer(v34)) regRow = v33 @@ -190602,7 +183201,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regResult+int32(1)) } - _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+19602, libc.VaList(bp+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) + _sqlite3VdbeMultiLoad(tls, v, regResult+int32(2), __ccgo_ts+19765, libc.VaList(bp+136, (*TFKey)(unsafe.Pointer(pFK1)).FzTo, i8-int32(1))) _sqlite3VdbeAddOp2(tls, v, int32(OP_ResultRow), regResult, int32(4)) _sqlite3VdbeResolveLabel(tls, v, addrOk) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp + 72))) @@ -190698,7 +183297,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _40 } _sqlite3CodeVerifySchema(tls, pParse, i9) - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(0) /* tag-20230327-1 */ + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(0), 2, 0x4) /* tag-20230327-1 */ /* Do an integrity check of the B-Tree ** ** Begin by finding the root pages numbers @@ -190793,7 +183392,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp4(tls, v, int32(OP_IntegrityCk), int32(1), cnt, int32(8), aRoot, -int32(14)) _sqlite3VdbeChangeP5(tls, v, uint16(i9)) addr1 = _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), int32(2)) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+19606, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FzDbSName)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+19769, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i9)*16))).FzDbSName)), -int32(6)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(2), int32(3), int32(3)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -190804,7 +183403,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p v48 = 0 } cnt = v48 - _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19630) + _sqlite3VdbeLoadString(tls, v, int32(2), __ccgo_ts+19793) x2 = (*THash)(unsafe.Pointer(pTbls)).Ffirst for { if !(x2 != 0) { @@ -190940,7 +183539,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if pPk1 != 0 { a1 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 80)), 0, r2, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), r2) - zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+19659, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr = _sqlite3MPrintf(tls, db, __ccgo_ts+19822, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeJumpHere(tls, v, a1) @@ -191002,7 +183601,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } p11 = *(*int32)(unsafe.Pointer(bp + 80)) if !((*TTable)(unsafe.Pointer(pTab10)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) { - p3 = int32(_sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), int16(j4))) + p3 = _sqlite3TableColumnToIndex(tls, _sqlite3PrimaryKeyIndex(tls, pTab10), j4) } else { p3 = int32(_sqlite3TableColumnToStorage(tls, pTab10, int16(j4))) } @@ -191024,7 +183623,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ColumnDefault(tls, v, pTab10, j4, int32(3)) jmp3 = _sqlite3VdbeAddOp2(tls, v, int32(OP_NotNull), int32(3), labelOk) } - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19695, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19858, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*TColumn)(unsafe.Pointer(pCol1)).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) if doTypeCheck != 0 { _sqlite3VdbeGoto(tls, v, labelError) @@ -191037,7 +183636,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if bStrict != 0 && doTypeCheck != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(_aStdTypeMask[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)])) - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19715, libc.VaList(bp+136, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19878, libc.VaList(bp+136, _sqlite3StdType[int32(uint32(*(*uint8)(unsafe.Pointer(pCol1 + 4))&0xf0>>4))-int32(1)], (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) == int32(SQLITE_AFF_TEXT) { @@ -191045,7 +183644,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p ** NULL, TEXT, or BLOB. */ _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), p11, labelOk, p3, p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19737, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19900, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } else { if !(bStrict != 0) && int32((*TColumn)(unsafe.Pointer(pCol1)).Faffinity) >= int32(SQLITE_AFF_NUMERIC) { @@ -191056,10 +183655,10 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if p11 >= 0 { _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab10, *(*int32)(unsafe.Pointer(bp + 80)), j4, int32(3)) } - _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+19760, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Affinity), int32(3), int32(1), 0, __ccgo_ts+19923, -int32(1)) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IsType), -int32(1), labelOk, int32(3), p4) _sqlite3VdbeChangeP5(tls, v, uint16(0x1c)) /* NULL, TEXT, or BLOB */ - zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19762, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) + zErr1 = _sqlite3MPrintf(tls, db, __ccgo_ts+19925, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab10)).FaCol + uintptr(j4)*12))).FzCnName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr1, -int32(6)) } } @@ -191093,7 +183692,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3ExprIfTrue(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pCheck + 8))).FpExpr, addrCkOk, int32(SQLITE_JUMPIFNULL)) _sqlite3VdbeResolveLabel(tls, v, addrCkFault) (*TParse)(unsafe.Pointer(pParse)).FiSelfTab = 0 - zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19782, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) + zErr2 = _sqlite3MPrintf(tls, db, __ccgo_ts+19945, libc.VaList(bp+136, (*TTable)(unsafe.Pointer(pTab10)).FzName)) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, int32(3), 0, zErr2, -int32(6)) _integrityCheckResultRow(tls, v) _sqlite3VdbeResolveLabel(tls, v, addrCkOk) @@ -191117,9 +183716,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeAddOp2(tls, v, int32(OP_AddImm), int32(8)+j4, int32(1)) /* increment entry count */ /* Verify that an index entry exists for the current table row */ jmp21 = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), *(*int32)(unsafe.Pointer(bp + 84))+j4, ckUniq, r1, int32((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19812) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19975) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19817) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19980) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) jmp5 = _sqlite3VdbeLoadString(tls, v, int32(4), (*TIndex)(unsafe.Pointer(pIdx6)).FzName) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(4), int32(3), int32(3)) @@ -191132,9 +183731,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if (*TTable)(unsafe.Pointer(pTab10)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { _sqlite3VdbeAddOp2(tls, v, int32(OP_IdxRowid), *(*int32)(unsafe.Pointer(bp + 84))+j4, int32(3)) jmp7 = _sqlite3VdbeAddOp3(tls, v, int32(OP_Eq), int32(3), 0, r1+int32((*TIndex)(unsafe.Pointer(pIdx6)).FnColumn)-int32(1)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19838) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+20001) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19874) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20037) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp7) } @@ -191162,9 +183761,9 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if label6 != 0 { jmp6 = _sqlite3VdbeAddOp0(tls, v, int32(OP_Goto)) _sqlite3VdbeResolveLabel(tls, v, label6) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19812) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19975) _sqlite3VdbeAddOp3(tls, v, int32(OP_Concat), int32(7), int32(3), int32(3)) - _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+19885) + _sqlite3VdbeLoadString(tls, v, int32(4), __ccgo_ts+20048) _sqlite3VdbeGoto(tls, v, jmp5-int32(1)) _sqlite3VdbeJumpHere(tls, v, jmp6) } @@ -191192,7 +183791,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p _sqlite3VdbeGoto(tls, v, uniqOk) _sqlite3VdbeJumpHere(tls, v, jmp61) _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxGT), *(*int32)(unsafe.Pointer(bp + 84))+j4, uniqOk, r1, int32((*TIndex)(unsafe.Pointer(pIdx6)).FnKeyCol)) - _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+19912) + _sqlite3VdbeLoadString(tls, v, int32(3), __ccgo_ts+20075) _sqlite3VdbeGoto(tls, v, jmp5) _sqlite3VdbeResolveLabel(tls, v, uniqOk) } @@ -191289,7 +183888,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p if aOp2 != 0 { (*(*TVdbeOp)(unsafe.Pointer(aOp2))).Fp2 = int32(1) - *(*int32)(unsafe.Pointer(bp + 76)) (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 2*20))).Fp4type = int8(-libc.Int32FromInt32(1)) - *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 19939 + *(*uintptr)(unsafe.Pointer(aOp2 + 2*20 + 16)) = __ccgo_ts + 20102 (*(*TVdbeOp)(unsafe.Pointer(aOp2 + 5*20))).Fp4type = int8(-libc.Int32FromInt32(1)) *(*uintptr)(unsafe.Pointer(aOp2 + 5*20 + 16)) = _sqlite3ErrStr(tls, int32(SQLITE_CORRUPT)) } @@ -191368,7 +183967,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p FzName uintptr Fenc Tu8 })(unsafe.Pointer(pEnc)).FzName != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20000, libc.VaList(bp+136, zRight)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20163, libc.VaList(bp+136, zRight)) } } } @@ -191473,13 +184072,13 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p iBt = v67 eMode2 = SQLITE_CHECKPOINT_PASSIVE if zRight != 0 { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19225) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19388) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_FULL) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20025) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+20188) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_RESTART) } else { - if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19378) == 0 { + if _sqlite3StrICmp(tls, zRight, __ccgo_ts+19541) == 0 { eMode2 = int32(SQLITE_CHECKPOINT_TRUNCATE) } } @@ -191614,7 +184213,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p nLimit = int32(SQLITE_DEFAULT_OPTIMIZE_LIMIT) } } - v70 = pParse + 44 + v70 = pParse + 48 v69 = *(*int32)(unsafe.Pointer(v70)) *(*int32)(unsafe.Pointer(v70))++ iTabCur = v69 @@ -191644,7 +184243,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p goto _73 } /* Do not scan system tables */ - if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+7960, int32(7)) { + if 0 == Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab12)).FzName, __ccgo_ts+8047, int32(7)) { goto _73 } /* Find the size of the table as last recorded in sqlite_stat1. @@ -191706,7 +184305,7 @@ func _sqlite3Pragma(tls *libc.TLS, pParse uintptr, pId1 uintptr, pId2 uintptr, p } else { _sqlite3VdbeAddOp2(tls, v, int32(OP_Rewind), iTabCur, int32(uint32(_sqlite3VdbeCurrentAddr(tls, v)+int32(2))+opMask&uint32(1))) } - zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20033, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) + zSubSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20196, libc.VaList(bp+136, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab12)).FzName)) if opMask&uint32(0x01) != 0 { r11 = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, r11, 0, zSubSql, -int32(6)) @@ -191979,34 +184578,34 @@ var _encnames1 = [9]struct { Fenc Tu8 }{ 0: { - FzName: __ccgo_ts + 19942, + FzName: __ccgo_ts + 20105, Fenc: uint8(SQLITE_UTF8), }, 1: { - FzName: __ccgo_ts + 19947, + FzName: __ccgo_ts + 20110, Fenc: uint8(SQLITE_UTF8), }, 2: { - FzName: __ccgo_ts + 19953, + FzName: __ccgo_ts + 20116, Fenc: uint8(SQLITE_UTF16LE), }, 3: { - FzName: __ccgo_ts + 19962, + FzName: __ccgo_ts + 20125, Fenc: uint8(SQLITE_UTF16BE), }, 4: { - FzName: __ccgo_ts + 19971, + FzName: __ccgo_ts + 20134, Fenc: uint8(SQLITE_UTF16LE), }, 5: { - FzName: __ccgo_ts + 19979, + FzName: __ccgo_ts + 20142, Fenc: uint8(SQLITE_UTF16BE), }, 6: { - FzName: __ccgo_ts + 19987, + FzName: __ccgo_ts + 20150, }, 7: { - FzName: __ccgo_ts + 19994, + FzName: __ccgo_ts + 20157, }, 8: {}, } @@ -192064,26 +184663,6 @@ type TPragmaVtabCursor = struct { type PragmaVtabCursor = TPragmaVtabCursor -type TPragmaVtab1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr - FpName uintptr - FnHidden Tu8 - FiHidden Tu8 -} - -type PragmaVtab1 = TPragmaVtab1 - -type TPragmaVtabCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FpPragma uintptr - FiRowid Tsqlite_int64 - FazArg [2]uintptr -} - -type PragmaVtabCursor1 = TPragmaVtabCursor1 - // C documentation // // /* @@ -192104,14 +184683,14 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg _ = argc _ = argv _sqlite3StrAccumInit(tls, bp, uintptr(0), bp+24, int32(200), 0) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20051) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20214) i = 0 j = int32((*TPragmaName)(unsafe.Pointer(pPragma)).FiPragCName) for { if !(i < int32((*TPragmaName)(unsafe.Pointer(pPragma)).FnPragCName)) { break } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20066, libc.VaList(bp+232, int32(cSep), _pragCName[j])) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20229, libc.VaList(bp+232, int32(cSep), _pragCName[j])) cSep = int8(',') goto _1 _1: @@ -192120,19 +184699,19 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg j++ } if i == 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20073, libc.VaList(bp+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20236, libc.VaList(bp+232, (*TPragmaName)(unsafe.Pointer(pPragma)).FzName)) i++ } j = 0 if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&int32(PragFlg_Result1) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20079) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20242) j++ } if int32((*TPragmaName)(unsafe.Pointer(pPragma)).FmPragFlg)&(libc.Int32FromInt32(PragFlg_SchemaOpt)|libc.Int32FromInt32(PragFlg_SchemaReq)) != 0 { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20091) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20254) j++ } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6568, int32(1)) _sqlite3StrAccumFinish(tls, bp) rc = Xsqlite3_declare_vtab(tls, db, bp+24) if rc == SQLITE_OK { @@ -192147,7 +184726,7 @@ func _pragmaVtabConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg (*TPragmaVtab)(unsafe.Pointer(pTab)).FnHidden = uint8(j) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+232, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+232, Xsqlite3_errmsg(tls, db))) } *(*uintptr)(unsafe.Pointer(ppVtab)) = pTab return rc @@ -192328,7 +184907,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr } zText = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if zText != 0 { - *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+32, zText)) + *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+32, zText)) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + uintptr(j)*4)) == uintptr(0) { return int32(SQLITE_NOMEM) } @@ -192340,13 +184919,13 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr j++ } _sqlite3StrAccumInit(tls, bp, uintptr(0), uintptr(0), 0, *(*int32)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb + 120 + 1*4))) - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20106) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+20269) if *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20114, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20277, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16 + 1*4)))) } Xsqlite3_str_appendall(tls, bp, (*TPragmaName)(unsafe.Pointer((*TPragmaVtab)(unsafe.Pointer(pTab)).FpName)).FzName) if *(*uintptr)(unsafe.Pointer(pCsr + 16)) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20118, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+20281, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(pCsr + 16)))) } zSql = _sqlite3StrAccumFinish(tls, bp) if zSql == uintptr(0) { @@ -192355,7 +184934,7 @@ func _pragmaVtabFilter(tls *libc.TLS, pVtabCursor uintptr, idxNum int32, idxStr rc = Xsqlite3_prepare_v2(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), pCsr+4, uintptr(0)) Xsqlite3_free(tls, zSql) if rc != SQLITE_OK { - (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+32, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) + (*TPragmaVtab)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+32, Xsqlite3_errmsg(tls, (*TPragmaVtab)(unsafe.Pointer(pTab)).Fdb))) return rc } return _pragmaVtabNext(tls, pVtabCursor) @@ -192481,24 +185060,24 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) /* A error message has already been generated. Do not overwrite it */ } else { if (*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(libc.Int32FromInt32(INITFLAG_AlterMask)) != 0 { - *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+20152, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) + *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = _sqlite3MPrintf(tls, db, __ccgo_ts+20315, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(azObj)), *(*uintptr)(unsafe.Pointer(azObj + 1*4)), _azAlterType[(*TInitData)(unsafe.Pointer(pData)).FmInitFlags&uint32(INITFLAG_AlterMask)-uint32(1)], zExtra)) (*TInitData)(unsafe.Pointer(pData)).Frc = int32(SQLITE_ERROR) } else { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_WriteSchema) != 0 { - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142802)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143792)) } else { if *(*uintptr)(unsafe.Pointer(azObj + 1*4)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(azObj + 1*4)) } else { - v1 = __ccgo_ts + 6482 + v1 = __ccgo_ts + 6570 } zObj = v1 - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20180, libc.VaList(bp+8, zObj)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20343, libc.VaList(bp+8, zObj)) if zExtra != 0 && *(*int8)(unsafe.Pointer(zExtra)) != 0 { - z = _sqlite3MPrintf(tls, db, __ccgo_ts+20211, libc.VaList(bp+8, z, zExtra)) + z = _sqlite3MPrintf(tls, db, __ccgo_ts+20374, libc.VaList(bp+8, z, zExtra)) } *(*uintptr)(unsafe.Pointer((*TInitData)(unsafe.Pointer(pData)).FpzErrMsg)) = z - (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(142809)) + (*TInitData)(unsafe.Pointer(pData)).Frc = _sqlite3CorruptError(tls, int32(143799)) } } } @@ -192506,9 +185085,9 @@ func _corruptSchema(tls *libc.TLS, pData uintptr, azObj uintptr, zExtra uintptr) } var _azAlterType = [3]uintptr{ - 0: __ccgo_ts + 20122, - 1: __ccgo_ts + 20129, - 2: __ccgo_ts + 20141, + 0: __ccgo_ts + 20285, + 1: __ccgo_ts + 20292, + 2: __ccgo_ts + 20304, } // C documentation @@ -192584,7 +185163,7 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(iDb) if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), db+172) == 0 || (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FnewTnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage && (*TInitData)(unsafe.Pointer(pData)).FmxPage > uint32(0) { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15985) + _corruptSchema(tls, pData, argv, __ccgo_ts+16101) } } libc.SetBitFieldPtr8Uint32(db+172+8, libc.Uint32FromInt32(0), 0, 0x1) @@ -192617,11 +185196,11 @@ func _sqlite3InitCallback(tls *libc.TLS, pInit uintptr, argc int32, argv uintptr } else { pIndex = _sqlite3FindIndex(tls, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) if pIndex == uintptr(0) { - _corruptSchema(tls, pData, argv, __ccgo_ts+20219) + _corruptSchema(tls, pData, argv, __ccgo_ts+20382) } else { if _sqlite3GetUInt32(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4)), pIndex+44) == 0 || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum < uint32(2) || (*TIndex)(unsafe.Pointer(pIndex)).Ftnum > (*TInitData)(unsafe.Pointer(pData)).FmxPage || _sqlite3IndexHasDuplicateRootPage(tls, pIndex) != 0 { if _sqlite3Config.FbExtraSchemaChecks != 0 { - _corruptSchema(tls, pData, argv, __ccgo_ts+15985) + _corruptSchema(tls, pData, argv, __ccgo_ts+16101) } } } @@ -192660,18 +185239,18 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl ** table name will be inserted automatically by the parser so we can just ** use the abbreviation "x" here. The parser will also automatically tag ** the schema table as read-only. */ - (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 10554 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[0] = __ccgo_ts + 10670 if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v2 = __ccgo_ts + 7968 + v2 = __ccgo_ts + 8055 } else { - v2 = __ccgo_ts + 7456 + v2 = __ccgo_ts + 7542 } v1 = v2 zSchemaTabName = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] = v1 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(2)] = (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(1)] - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 9626 - (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20232 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(3)] = __ccgo_ts + 9713 + (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(4)] = __ccgo_ts + 20395 (*(*[6]uintptr)(unsafe.Pointer(bp)))[int32(5)] = uintptr(0) (*(*TInitData)(unsafe.Pointer(bp + 44))).Fdb = db (*(*TInitData)(unsafe.Pointer(bp + 44))).FiDb = iDb @@ -192755,7 +185334,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl } else { /* If opening an attached database, the encoding much match ENC(db) */ if (*(*[5]int32)(unsafe.Pointer(bp + 24)))[libc.Int32FromInt32(BTREE_TEXT_ENCODING)-libc.Int32FromInt32(1)]&int32(3) != int32((*Tsqlite3)(unsafe.Pointer(db)).Fenc) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+13591) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+13707) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192781,7 +185360,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl (*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format = uint8(1) } if int32((*TSchema)(unsafe.Pointer((*TDb)(unsafe.Pointer(pDb)).FpSchema)).Ffile_format) > int32(SQLITE_MAX_FILE_FORMAT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+20304) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+20467) rc = int32(SQLITE_ERROR) goto initone_error_out } @@ -192796,7 +185375,7 @@ func _sqlite3InitOne(tls *libc.TLS, db uintptr, iDb int32, pzErrMsg uintptr, mFl /* Read the schema information out of the schema tables */ (*(*TInitData)(unsafe.Pointer(bp + 44))).FmxPage = _sqlite3BtreeLastPage(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) - zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20328, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) + zSql = _sqlite3MPrintf(tls, db, __ccgo_ts+20491, libc.VaList(bp+80, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zSchemaTabName)) xAuth = (*Tsqlite3)(unsafe.Pointer(db)).FxAuth (*Tsqlite3)(unsafe.Pointer(db)).FxAuth = uintptr(0) rc = Xsqlite3_exec(tls, db, zSql, __ccgo_fp(_sqlite3InitCallback), bp+44, uintptr(0)) @@ -193092,7 +185671,7 @@ func _sqlite3ParseObjectReset(tls *libc.TLS, pParse uintptr) { // ** // ** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj); // */ -func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, pPtr uintptr) (r uintptr) { +func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, __ccgo_fp_xCleanup uintptr, pPtr uintptr) (r uintptr) { var pCleanup uintptr _ = pCleanup if _sqlite3FaultSim(tls, int32(300)) != 0 { @@ -193105,9 +185684,9 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpNext = (*TParse)(unsafe.Pointer(pParse)).FpCleanup (*TParse)(unsafe.Pointer(pParse)).FpCleanup = pCleanup (*TParseCleanup)(unsafe.Pointer(pCleanup)).FpPtr = pPtr - (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = xCleanup + (*TParseCleanup)(unsafe.Pointer(pCleanup)).FxCleanup = __ccgo_fp_xCleanup } else { - (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) + (*(*func(*libc.TLS, uintptr, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xCleanup})))(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pPtr) pPtr = uintptr(0) } return pPtr @@ -193125,13 +185704,13 @@ func _sqlite3ParserAddCleanup(tls *libc.TLS, pParse uintptr, xCleanup uintptr, p // ** is generated by Lemon. // */ func _sqlite3ParseObjectInit(tls *libc.TLS, pParse uintptr, db uintptr) { - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+168)-uint32(libc.UintptrFromInt32(0)+4)) - libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+136)-uint32(libc.UintptrFromInt32(0)+4)) + libc.Xmemset(tls, pParse+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*TParse)(unsafe.Pointer(pParse)).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = pParse (*TParse)(unsafe.Pointer(pParse)).Fdb = db if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+1644, 0) } } @@ -193154,8 +185733,8 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep _, _, _, _, _, _, _, _ = i, mxLen, pBt, pT, rc, zDb, zSqlCopy, v1 rc = SQLITE_OK /* Parsing context */ /* sqlite3ParseObjectInit(&sParse, db); // inlined for performance */ - libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+168)-uint32(libc.UintptrFromInt32(0)+4)) - libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+212)), 0, libc.Uint32FromInt64(288)-uint32(libc.UintptrFromInt32(0)+212)) + libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+4)), 0, uint32(libc.UintptrFromInt32(0)+136)-uint32(libc.UintptrFromInt32(0)+4)) + libc.Xmemset(tls, bp+uintptr(uint32(libc.UintptrFromInt32(0)+208)), 0, libc.Uint32FromInt64(284)-uint32(libc.UintptrFromInt32(0)+208)) (*(*TParse)(unsafe.Pointer(bp))).FpOuterParse = (*Tsqlite3)(unsafe.Pointer(db)).FpParse (*Tsqlite3)(unsafe.Pointer(db)).FpParse = bp (*(*TParse)(unsafe.Pointer(bp))).Fdb = db @@ -193165,7 +185744,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } else { } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { - _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1643, 0) + _sqlite3ErrorMsg(tls, bp, __ccgo_ts+1644, 0) v1 = libc.Int32FromInt32(SQLITE_NOMEM) rc = v1 (*Tsqlite3)(unsafe.Pointer(db)).FerrCode = v1 @@ -193214,7 +185793,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep rc = _sqlite3BtreeSchemaLocked(tls, pBt) if rc != 0 { zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(i)*16))).FzDbSName - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+20362, libc.VaList(bp+296, zDb)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+20525, libc.VaList(bp+296, zDb)) goto end_prepare } } @@ -193230,7 +185809,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep if nBytes >= 0 && (nBytes == 0 || int32(*(*int8)(unsafe.Pointer(zSql + uintptr(nBytes-int32(1))))) != 0) { mxLen = *(*int32)(unsafe.Pointer(db + 120 + 1*4)) if nBytes > mxLen { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+20392, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_TOOBIG), __ccgo_ts+20555, 0) rc = _sqlite3ApiExit(tls, db, int32(SQLITE_TOOBIG)) goto end_prepare } @@ -193253,10 +185832,10 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { (*(*TParse)(unsafe.Pointer(bp))).Frc = int32(SQLITE_NOMEM) - (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema = uint8(0) + libc.SetBitFieldPtr8Uint32(bp+32, libc.Uint32FromInt32(0), 3, 0x8) } if (*(*TParse)(unsafe.Pointer(bp))).Frc != SQLITE_OK && (*(*TParse)(unsafe.Pointer(bp))).Frc != int32(SQLITE_DONE) { - if (*(*TParse)(unsafe.Pointer(bp))).FcheckSchema != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(bp + 32))&0x8>>3)) != 0 && int32((*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy) == 0 { _schemaIsValid(tls, bp) } if (*(*TParse)(unsafe.Pointer(bp))).FpVdbe != 0 { @@ -193264,7 +185843,7 @@ func _sqlite3Prepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, prep } rc = (*(*TParse)(unsafe.Pointer(bp))).Frc if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+4710, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, rc, __ccgo_ts+4829, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) } else { _sqlite3Error(tls, db, rc) @@ -193294,7 +185873,7 @@ func _sqlite3LockAndPrepare(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int3 cnt = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143609)) + return _sqlite3MisuseError(tls, int32(144599)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _sqlite3BtreeEnterAll(tls, db) @@ -193428,7 +186007,7 @@ func _sqlite3Prepare16(tls *libc.TLS, db uintptr, zSql uintptr, nBytes int32, pr rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) if !(_sqlite3SafetyCheckOk(tls, db) != 0) || zSql == uintptr(0) { - return _sqlite3MisuseError(tls, int32(143758)) + return _sqlite3MisuseError(tls, int32(144748)) } /* Make sure nBytes is non-negative and correct. It should be the ** number of bytes until the end of the input buffer or until the first @@ -193550,15 +186129,6 @@ type TDistinctCtx = struct { type DistinctCtx = TDistinctCtx -type TDistinctCtx1 = struct { - FisTnct Tu8 - FeTnctType Tu8 - FtabTnct int32 - FaddrTnct int32 -} - -type DistinctCtx1 = TDistinctCtx1 - // C documentation // // /* @@ -193594,21 +186164,6 @@ type TSortCtx = struct { type SortCtx = TSortCtx -type TSortCtx1 = struct { - FpOrderBy uintptr - FnOBSat int32 - FiECursor int32 - FregReturn int32 - FlabelBkOut int32 - FaddrSortIndex int32 - FlabelDone int32 - FlabelOBLopt int32 - FsortFlags Tu8 - FpDeferredRowLoad uintptr -} - -type SortCtx1 = TSortCtx1 - // C documentation // // /* @@ -193688,7 +186243,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp (*TSelect)(unsafe.Pointer(pNew)).FselFlags = selFlags (*TSelect)(unsafe.Pointer(pNew)).FiLimit = 0 (*TSelect)(unsafe.Pointer(pNew)).FiOffset = 0 - v3 = pParse + 112 + v3 = pParse + 100 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) (*TSelect)(unsafe.Pointer(pNew)).FselId = uint32(v2) @@ -193696,7 +186251,7 @@ func _sqlite3SelectNew(tls *libc.TLS, pParse uintptr, pEList uintptr, pSrc uintp *(*int32)(unsafe.Pointer(pNew + 20 + 1*4)) = -int32(1) (*TSelect)(unsafe.Pointer(pNew)).FnSelectRow = 0 if pSrc == uintptr(0) { - pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + pSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48))) } (*TSelect)(unsafe.Pointer(pNew)).FpSrc = pSrc (*TSelect)(unsafe.Pointer(pNew)).FpWhere = pWhere @@ -193852,15 +186407,15 @@ func _sqlite3JoinType(tls *libc.TLS, pParse uintptr, pA uintptr, pB uintptr, pC i++ } if jointype&(libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER)) == libc.Int32FromInt32(JT_INNER)|libc.Int32FromInt32(JT_OUTER) || jointype&int32(JT_ERROR) != 0 || jointype&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LEFT)|libc.Int32FromInt32(JT_RIGHT)) == int32(JT_OUTER) { - zSp1 = __ccgo_ts + 12698 - zSp2 = __ccgo_ts + 12698 + zSp1 = __ccgo_ts + 12814 + zSp2 = __ccgo_ts + 12814 if pB == uintptr(0) { zSp1++ } if pC == uintptr(0) { zSp2++ } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20411, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20574, libc.VaList(bp+8, pA, zSp1, pB, zSp2, pC)) jointype = int32(JT_INNER) } return jointype @@ -193917,25 +186472,28 @@ var _aKeyword = [7]struct { // ** is not contained in the table. // */ func _sqlite3ColumnIndex(tls *libc.TLS, pTab uintptr, zCol uintptr) (r int32) { + var aCol uintptr var h Tu8 - var i int32 - var pCol uintptr - _, _, _ = h, i, pCol + var i, nCol int32 + _, _, _, _ = aCol, h, i, nCol h = _sqlite3StrIHash(tls, zCol) - pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol - i = libc.Int32FromInt32(0) - for { - if !(i < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if int32((*TColumn)(unsafe.Pointer(pCol)).FhName) == int32(h) && _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zCol) == 0 { + aCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + nCol = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + /* See if the aHx gives us a lucky match */ + i = int32(*(*Tu8)(unsafe.Pointer(pTab + 64 + uintptr(uint32(h)%uint32(16))))) + if int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FhName) == int32(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FzCnName, zCol) == 0 { + return i + } + /* No lucky match from the hash table. Do a full search. */ + i = 0 + for int32(1) != 0 { + if int32((*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FhName) == int32(h) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer(aCol + uintptr(i)*12))).FzCnName, zCol) == 0 { return i } - goto _1 - _1: - ; - pCol += 12 i++ + if i >= nCol { + break + } } return -int32(1) } @@ -194067,13 +186625,13 @@ func _unsetJoinExpr(tls *libc.TLS, p uintptr, iTable int32, nullable int32) { _ = i for p != 0 { if iTable < 0 || (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) && *(*int32)(unsafe.Pointer(p + 36)) == iTable { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON))) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^uint32(libc.Int32FromInt32(EP_OuterON) | libc.Int32FromInt32(EP_InnerON)) if iTable >= 0 { *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(libc.Int32FromInt32(EP_InnerON)) } } if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_COLUMN) && (*TExpr)(unsafe.Pointer(p)).FiTable == iTable && !(nullable != 0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(EP_CanBeNull)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^uint32(libc.Int32FromInt32(EP_CanBeNull)) } if int32((*TExpr)(unsafe.Pointer(p)).Fop) == int32(TK_FUNCTION) { if *(*uintptr)(unsafe.Pointer(p + 20)) != 0 { @@ -194151,7 +186709,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if int32((*TSrcItem)(unsafe.Pointer(pRight)).Ffg.Fjointype)&int32(JT_NATURAL) != 0 { pUsing = uintptr(0) if int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x800>>11) != 0 || *(*uintptr)(unsafe.Pointer(pRight + 40)) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20441, libc.VaList(bp+16, 0)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20604, libc.VaList(bp+16, 0)) return int32(1) } j = 0 @@ -194201,12 +186759,12 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { zName1 = (*(*TIdList_item)(unsafe.Pointer(pList + 4 + uintptr(j)*4))).FzName iRightCol = _sqlite3ColumnIndex(tls, pRightTab, zName1) if iRightCol < 0 || _tableAndColumnIndex(tls, pSrc, 0, i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x2000>>13)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20491, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20654, libc.VaList(bp+16, zName1)) return int32(1) } pE1 = _sqlite3CreateColumnExpr(tls, db, pSrc, *(*int32)(unsafe.Pointer(bp)), *(*int32)(unsafe.Pointer(bp + 4))) _sqlite3SrcItemColumnUsed(tls, pSrc+8+uintptr(*(*int32)(unsafe.Pointer(bp)))*48, *(*int32)(unsafe.Pointer(bp + 4))) - if int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + if int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { /* This branch runs if the query contains one or more RIGHT or FULL ** JOINs. If only a single table on the left side of this join ** contains the zName column, then this branch is a no-op. @@ -194221,9 +186779,10 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** adding a new error so as to not break legacy applications. */ pFuncArgs = uintptr(0) /* Arguments to the coalesce() */ + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= uint32(libc.Int32FromInt32(EP_CanBeNull)) for _tableAndColumnIndex(tls, pSrc, *(*int32)(unsafe.Pointer(bp))+int32(1), i, zName1, bp, bp+4, int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x2000>>13)) != 0 { if int32(*(*uint32)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*48 + 12 + 4))&0x800>>11) == 0 || _sqlite3IdListIndex(tls, *(*uintptr)(unsafe.Pointer(pSrc + 8 + uintptr(*(*int32)(unsafe.Pointer(bp)))*48 + 40)), zName1) < 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20555, libc.VaList(bp+16, zName1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20718, libc.VaList(bp+16, zName1)) break } pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) @@ -194233,6 +186792,13 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { if pFuncArgs != 0 { pFuncArgs = _sqlite3ExprListAppend(tls, pParse, pFuncArgs, pE1) pE1 = _sqlite3ExprFunction(tls, pParse, pFuncArgs, uintptr(unsafe.Pointer(&_tkCoalesce)), 0) + if pE1 != 0 { + (*TExpr)(unsafe.Pointer(pE1)).FaffExpr = int8(SQLITE_AFF_DEFER) + } + } + } else { + if int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8 + uintptr(i+int32(1))*48))).Ffg.Fjointype)&int32(JT_LEFT) != 0 && (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { + *(*Tu32)(unsafe.Pointer(pE1 + 4)) |= uint32(libc.Int32FromInt32(EP_CanBeNull)) } } pE2 = _sqlite3CreateColumnExpr(tls, db, pSrc, i+int32(1), iRightCol) @@ -194267,7 +186833,7 @@ func _sqlite3ProcessJoin(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { } var _tkCoalesce = TToken{ - Fz: __ccgo_ts + 8165, + Fz: __ccgo_ts + 8252, Fn: uint32(8), } @@ -194284,13 +186850,6 @@ type TRowLoadInfo = struct { type RowLoadInfo = TRowLoadInfo -type TRowLoadInfo1 = struct { - FregResult int32 - FecelFlags Tu8 -} - -type RowLoadInfo1 = TRowLoadInfo1 - // C documentation // // /* @@ -194315,7 +186874,7 @@ func _makeSorterRecord(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uin _, _, _, _, _ = nOBSat, regOut, v, v1, v2 nOBSat = (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regOut = v1 @@ -194360,7 +186919,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp regBase = regData - nPrefixReg } else { regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nBase + *(*int32)(unsafe.Pointer(pParse + 52)) += nBase } if (*TSelect)(unsafe.Pointer(pSelect)).FiOffset != 0 { v1 = (*TSelect)(unsafe.Pointer(pSelect)).FiOffset + int32(1) @@ -194384,7 +186943,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp if nOBSat > 0 { /* Original KeyInfo on the sorter table */ regRecord = _makeSorterRecord(tls, pParse, pSort, pSelect, regBase, nBase) regPrevKey = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat nKey = nExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat + bSeq if bSeq != 0 { addrFirst = _sqlite3VdbeAddOp1(tls, v, int32(OP_IfNot), regBase+nExpr) @@ -194405,7 +186964,7 @@ func _pushOntoSorter(tls *libc.TLS, pParse uintptr, pSort uintptr, pSelect uintp addrJmp = _sqlite3VdbeCurrentAddr(tls, v) _sqlite3VdbeAddOp3(tls, v, int32(OP_Jump), addrJmp+int32(1), 0, addrJmp+int32(1)) (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut = _sqlite3VdbeMakeLabel(tls, pParse) - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn = v3 @@ -194528,7 +187087,7 @@ func _codeDistinct(tls *libc.TLS, pParse uintptr, eTnctType int32, iTab int32, a v1 = (*TParse)(unsafe.Pointer(pParse)).FnMem + libc.Int32FromInt32(1) regPrev = v1 iRet = v1 - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol iJump = _sqlite3VdbeCurrentAddr(tls, v) + nResultCol i = 0 for { @@ -194655,10 +187214,10 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS if !(int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&libc.Int32FromInt32(SORTFLAG_UseSorter) != 0) { nPrefixReg++ } - *(*int32)(unsafe.Pointer(pParse + 48)) += nPrefixReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nPrefixReg } (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol } else { if (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst+nResultCol > (*TParse)(unsafe.Pointer(pParse)).FnMem { /* This is an error condition that can result, for example, when a SELECT @@ -194666,7 +187225,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS ** there are columns in the table on the left. The error will be caught ** and reported later. But we need to make sure enough memory is allocated ** to avoid other spurious errors in the meantime. */ - *(*int32)(unsafe.Pointer(pParse + 48)) += nResultCol + *(*int32)(unsafe.Pointer(pParse + 52)) += nResultCol } } (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = nResultCol @@ -194843,7 +187402,7 @@ func _selectInnerLoop(tls *libc.TLS, pParse uintptr, p uintptr, srcTab int32, pS _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), iParm, r13, regResult, nResultCol) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 != 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, regResult, nResultCol) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20592, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20755, 0) } _sqlite3ReleaseTempReg(tls, pParse, r13) } @@ -194954,8 +187513,8 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt var nExtra int32 var p uintptr _, _ = nExtra, p - nExtra = int32(uint32(N+X)*(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(1)) - uint32(4)) - p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(24)+uint32(nExtra))) + nExtra = int32(uint32(N+X) * (libc.Uint32FromInt64(4) + libc.Uint32FromInt32(1))) + p = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+20)+uint32(libc.Int32FromInt32(0))*libc.Uint32FromInt64(4)+uint32(nExtra))) if p != 0 { (*TKeyInfo)(unsafe.Pointer(p)).FaSortFlags = p + 20 + uintptr(N+X)*4 (*TKeyInfo)(unsafe.Pointer(p)).FnKeyField = uint16(N) @@ -194963,7 +187522,7 @@ func _sqlite3KeyInfoAlloc(tls *libc.TLS, db uintptr, N int32, X int32) (r uintpt (*TKeyInfo)(unsafe.Pointer(p)).Fenc = (*Tsqlite3)(unsafe.Pointer(db)).Fenc (*TKeyInfo)(unsafe.Pointer(p)).Fdb = db (*TKeyInfo)(unsafe.Pointer(p)).FnRef = uint32(1) - libc.Xmemset(tls, p+1*24, 0, uint32(nExtra)) + libc.Xmemset(tls, p+20, 0, uint32(nExtra)) } else { return _sqlite3OomFault(tls, db) } @@ -195048,13 +187607,13 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { _ = z switch id { case int32(TK_ALL): - z = __ccgo_ts + 20612 + z = __ccgo_ts + 20775 case int32(TK_INTERSECT): - z = __ccgo_ts + 20622 + z = __ccgo_ts + 20785 case int32(TK_EXCEPT): - z = __ccgo_ts + 20632 + z = __ccgo_ts + 20795 default: - z = __ccgo_ts + 20639 + z = __ccgo_ts + 20802 break } return z @@ -195075,7 +187634,7 @@ func _sqlite3SelectOpName(tls *libc.TLS, id int32) (r uintptr) { func _explainTempTable(tls *libc.TLS, pParse uintptr, zUsage uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20645, libc.VaList(bp+8, zUsage)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20808, libc.VaList(bp+8, zUsage)) } /* @@ -195112,13 +187671,13 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, nKey = (*TExprList)(unsafe.Pointer(pOrderBy)).FnExpr - (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat == 0 || nKey == int32(1) { if (*TSortCtx)(unsafe.Pointer(pSort)).FnOBSat != 0 { - v1 = __ccgo_ts + 20668 + v1 = __ccgo_ts + 20831 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20682, libc.VaList(bp+8, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20845, libc.VaList(bp+8, v1)) } else { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20713, libc.VaList(bp+8, nKey)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20876, libc.VaList(bp+8, nKey)) } if (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut != 0 { _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), (*TSortCtx)(unsafe.Pointer(pSort)).FregReturn, (*TSortCtx)(unsafe.Pointer(pSort)).FlabelBkOut) @@ -195142,11 +187701,11 @@ func _generateSortTail(tls *libc.TLS, pParse uintptr, p uintptr, pSort uintptr, } } if int32((*TSortCtx)(unsafe.Pointer(pSort)).FsortFlags)&int32(SORTFLAG_UseSorter) != 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regSortOut = v2 - v5 = pParse + 44 + v5 = pParse + 48 v4 = *(*int32)(unsafe.Pointer(v5)) *(*int32)(unsafe.Pointer(v5))++ iSortTab = v4 @@ -195361,8 +187920,8 @@ func _columnTypeImpl(tls *libc.TLS, pNC uintptr, pExpr uintptr, pzOrigDb uintptr iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zType = __ccgo_ts + 1147 - *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 18161 + zType = __ccgo_ts + 1148 + *(*uintptr)(unsafe.Pointer(bp + 8)) = __ccgo_ts + 18324 } else { *(*uintptr)(unsafe.Pointer(bp + 8)) = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, uintptr(0)) @@ -195475,7 +188034,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = db, fullName, i, iCol, p, pEList, pTab, pTabList, srcName, v, z, zCol, zName, zName1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* COLUMN or TABLE.COLUMN if no AS clause and is direct */ - if (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet != 0 { + if int32(Tbft(*(*uint8)(unsafe.Pointer(pParse + 32))&0x1>>0)) != 0 { return } /* Column names are determined by the left-most term of a compound select */ @@ -195484,7 +188043,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } pTabList = (*TSelect)(unsafe.Pointer(pSelect)).FpSrc pEList = (*TSelect)(unsafe.Pointer(pSelect)).FpEList - (*TParse)(unsafe.Pointer(pParse)).FcolNamesSet = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 0, 0x1) fullName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_FullColNames) != uint64(0)) srcName = libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_ShortColNames) != uint64(0) || fullName != 0) _sqlite3VdbeSetNumCols(tls, v, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) @@ -195508,13 +188067,13 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) } if iCol < 0 { - zCol = __ccgo_ts + 18161 + zCol = __ccgo_ts + 18324 } else { zCol = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName } if fullName != 0 { zName1 = uintptr(0) - zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+13877, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) + zName1 = _sqlite3MPrintf(tls, db, __ccgo_ts+13993, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zCol)) _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zName1, __ccgo_fp(_sqlite3OomClear)) } else { _sqlite3VdbeSetColName(tls, v, i, COLNAME_NAME, zCol, uintptr(-libc.Int32FromInt32(1))) @@ -195522,7 +188081,7 @@ func _sqlite3GenerateColumnNames(tls *libc.TLS, pParse uintptr, pSelect uintptr) } else { z = (*(*TExprList_item)(unsafe.Pointer(pEList + 8 + uintptr(i)*20))).FzEName if z == uintptr(0) { - v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+20759, libc.VaList(bp+8, i+int32(1))) + v2 = _sqlite3MPrintf(tls, db, __ccgo_ts+20922, libc.VaList(bp+8, i+int32(1))) } else { v2 = _sqlite3DbStrDup(tls, db, z) } @@ -195614,7 +188173,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if iCol >= 0 { v3 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12))).FzCnName } else { - v3 = __ccgo_ts + 18161 + v3 = __ccgo_ts + 18324 } zName = v3 } else { @@ -195629,7 +188188,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, if zName != 0 && !(_sqlite3IsTrueOrFalse(tls, zName) != 0) { zName = _sqlite3DbStrDup(tls, db, zName) } else { - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20759, libc.VaList(bp+32, i+int32(1))) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20922, libc.VaList(bp+32, i+int32(1))) } /* Make sure the column name is unique. If the name is not unique, ** append an integer to the name so that it becomes unique. @@ -195665,7 +188224,7 @@ func _sqlite3ColumnsFromExprList(tls *libc.TLS, pParse uintptr, pEList uintptr, } *(*Tu32)(unsafe.Pointer(bp))++ v8 = *(*Tu32)(unsafe.Pointer(bp)) - zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20768, libc.VaList(bp+32, nName, zName, v8)) + zName = _sqlite3MPrintf(tls, db, __ccgo_ts+20931, libc.VaList(bp+32, nName, zName, v8)) _sqlite3ProgressCheck(tls, pParse) if *(*Tu32)(unsafe.Pointer(bp)) > uint32(3) { Xsqlite3_randomness(tls, int32(4), bp) @@ -195784,7 +188343,7 @@ func _sqlite3SubqueryColumnTypes(tls *libc.TLS, pParse uintptr, pTab uintptr, pS zType = _columnTypeImpl(tls, bp, p, uintptr(0), uintptr(0), uintptr(0)) if zType == uintptr(0) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) != int32(_sqlite3AffinityType(tls, zType, uintptr(0))) { if int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_NUMERIC) || int32((*TColumn)(unsafe.Pointer(pCol)).Faffinity) == int32(SQLITE_AFF_FLEXNUM) { - zType = __ccgo_ts + 20776 + zType = __ccgo_ts + 20939 } else { zType = uintptr(0) j = int32(1) @@ -195850,7 +188409,7 @@ func _sqlite3ResultSetOfSelect(tls *libc.TLS, pParse uintptr, pSelect uintptr, a for (*TSelect)(unsafe.Pointer(pSelect)).FpPrior != 0 { pSelect = (*TSelect)(unsafe.Pointer(pSelect)).FpPrior } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return uintptr(0) } @@ -195878,7 +188437,7 @@ func _sqlite3GetVdbe(tls *libc.TLS, pParse uintptr) (r uintptr) { return (*TParse)(unsafe.Pointer(pParse)).FpVdbe } if (*TParse)(unsafe.Pointer(pParse)).FpToplevel == uintptr(0) && (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_FactorOutConst)) == uint32(0) { - (*TParse)(unsafe.Pointer(pParse)).FokConstFactor = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 2, 0x4) } return _sqlite3VdbeCreate(tls, pParse) } @@ -195928,7 +188487,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int ** no rows. */ if pLimit != 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v1 = v2 @@ -195951,7 +188510,7 @@ func _computeLimitRegisters(tls *libc.TLS, pParse uintptr, p uintptr, iBreak int _sqlite3VdbeAddOp2(tls, v, int32(OP_IfNot), iLimit, iBreak) } if (*TExpr)(unsafe.Pointer(pLimit)).FpRight != 0 { - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) v4 = v5 @@ -196099,7 +188658,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest iDistinct = 0 /* To ensure unique results if UNION */ eDest = int32(SRT_Fifo) /* Registers used by LIMIT and OFFSET */ if (*TSelect)(unsafe.Pointer(p)).FpWin != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20780, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20943, 0) return } /* Obtain authorization to do a recursive query */ @@ -196136,7 +188695,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Allocate cursors numbers for Queue and Distinct. The cursor number for ** the Distinct table must be exactly one greater than Queue in order ** for the SRT_DistFifo and SRT_DistQueue destinations to work. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iQueue = v3 @@ -196147,7 +188706,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest v5 = int32(SRT_DistFifo) } eDest = v5 - v7 = pParse + 44 + v7 = pParse + 48 v6 = *(*int32)(unsafe.Pointer(v7)) *(*int32)(unsafe.Pointer(v7))++ iDistinct = v6 @@ -196161,7 +188720,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest } _sqlite3SelectDestInit(tls, bp, eDest, iQueue) /* Allocate cursors for Current, Queue, and Distinct. */ - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regCurrent = v9 @@ -196192,7 +188751,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest break } if (*TSelect)(unsafe.Pointer(pFirstRec)).FselFlags&uint32(SF_Aggregate) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20829, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20992, 0) goto end_of_recursive_query } (*TSelect)(unsafe.Pointer(pFirstRec)).Fop = uint8(TK_ALL) @@ -196207,7 +188766,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest /* Store the results of the setup-query in Queue. */ pSetup = (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior (*TSelect)(unsafe.Pointer(pSetup)).FpNext = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20871, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21034, 0) rc = _sqlite3Select(tls, pParse, pSetup, bp) (*TSelect)(unsafe.Pointer(pSetup)).FpNext = p if rc != 0 { @@ -196235,7 +188794,7 @@ func _generateWithRecursiveQuery(tls *libc.TLS, pParse uintptr, p uintptr, pDest ** the value for the recursive-table. Store the results in the Queue. */ (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = uintptr(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20877, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21040, 0) _sqlite3Select(tls, pParse, p, bp) (*TSelect)(unsafe.Pointer(pFirstRec)).FpPrior = pSetup /* Keep running the loop until the Queue is empty */ @@ -196288,11 +188847,11 @@ func _multiSelectValues(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) nRow += bShowAll } if nRow == int32(1) { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } else { - v1 = __ccgo_ts + 20892 + v1 = __ccgo_ts + 21055 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20894, libc.VaList(bp+8, nRow, v1)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21057, libc.VaList(bp+8, nRow, v1)) for p != 0 { _selectInnerLoop(tls, pParse, p, -int32(1), uintptr(0), uintptr(0), pDest, int32(1), int32(1)) if !(bShowAll != 0) { @@ -196400,8 +188959,8 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in return _multiSelectOrderBy(tls, pParse, p, pDest) } else { if (*TSelect)(unsafe.Pointer(pPrior)).FpPrior == uintptr(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20917, 0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20932, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21080, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21095, 0) } /* Generate code for the left and right SELECT statements. */ @@ -196426,7 +188985,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in _sqlite3VdbeAddOp3(tls, v, int32(OP_OffsetLimit), (*TSelect)(unsafe.Pointer(p)).FiLimit, (*TSelect)(unsafe.Pointer(p)).FiOffset+int32(1), (*TSelect)(unsafe.Pointer(p)).FiOffset) } } - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20612, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20775, 0) rc = _sqlite3Select(tls, pParse, p, bp) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -196452,7 +189011,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in /* We will need to create our own temporary table to hold the ** intermediate results. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ unionTab = v1 @@ -196478,7 +189037,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 32))).FeDest = op - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20951, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21114, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+32) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -196510,11 +189069,11 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in ** two temporary tables. Hence it has its own case. Begin ** by allocating the tables we will need. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ tab1 = v3 - v6 = pParse + 44 + v6 = pParse + 48 v5 = *(*int32)(unsafe.Pointer(v6)) *(*int32)(unsafe.Pointer(v6))++ tab2 = v5 @@ -196536,7 +189095,7 @@ func _multiSelect(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r in pLimit1 = (*TSelect)(unsafe.Pointer(p)).FpLimit (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) (*(*TSelectDest)(unsafe.Pointer(bp + 60))).FiSDParm = tab2 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+20951, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21114, libc.VaList(bp+96, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) rc = _sqlite3Select(tls, pParse, p, bp+60) pDelete = (*TSelect)(unsafe.Pointer(p)).FpPrior (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior @@ -196643,6 +189202,7 @@ multi_select_end: ; (*TSelectDest)(unsafe.Pointer(pDest)).FiSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSdst (*TSelectDest)(unsafe.Pointer(pDest)).FnSdst = (*(*TSelectDest)(unsafe.Pointer(bp))).FnSdst + (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 = (*(*TSelectDest)(unsafe.Pointer(bp))).FiSDParm2 if pDelete != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3SelectDeleteGeneric), pDelete) } @@ -196659,9 +189219,9 @@ func _sqlite3SelectWrongNumTermsError(tls *libc.TLS, pParse uintptr, p uintptr) bp := tls.Alloc(16) defer tls.Free(16) if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Values) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+20972, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21135, 0) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21018, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21181, libc.VaList(bp+8, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) } } @@ -196732,7 +189292,7 @@ func _generateOutputSubroutine(tls *libc.TLS, pParse uintptr, p uintptr, pIn uin _sqlite3VdbeAddOp4Int(tls, v, int32(OP_IdxInsert), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm, r11, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) if (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2 > 0 { _sqlite3VdbeAddOp4Int(tls, v, int32(OP_FilterAdd), (*TSelectDest)(unsafe.Pointer(pDest)).FiSDParm2, 0, (*TSelectDest)(unsafe.Pointer(pIn)).FiSdst, (*TSelectDest)(unsafe.Pointer(pIn)).FnSdst) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20592, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20755, 0) } _sqlite3ReleaseTempReg(tls, pParse, r11) break @@ -196980,7 +189540,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } else { nExpr = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr regPrev = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nExpr + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += nExpr + int32(1) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regPrev) pKeyDup = _sqlite3KeyInfoAlloc(tls, db, nExpr, int32(1)) if pKeyDup != 0 { @@ -197034,16 +189594,16 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr (*TSelect)(unsafe.Pointer(pSplit)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy = _sqlite3ExprListDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pOrderBy, 0) - _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8863) - _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+8863) + _sqlite3ResolveOrderGroupBy(tls, pParse, p, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, __ccgo_ts+8950) + _sqlite3ResolveOrderGroupBy(tls, pParse, pPrior, (*TSelect)(unsafe.Pointer(pPrior)).FpOrderBy, __ccgo_ts+8950) /* Compute the limit registers */ _computeLimitRegisters(tls, pParse, p, labelEnd) if (*TSelect)(unsafe.Pointer(p)).FiLimit != 0 && op == int32(TK_ALL) { - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) regLimitA = v9 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regLimitB = v11 @@ -197061,32 +189621,32 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr } _sqlite3ExprDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpLimit) (*TSelect)(unsafe.Pointer(p)).FpLimit = uintptr(0) - v16 = pParse + 48 + v16 = pParse + 52 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) regAddrA = v15 - v18 = pParse + 48 + v18 = pParse + 52 *(*int32)(unsafe.Pointer(v18))++ v17 = *(*int32)(unsafe.Pointer(v18)) regAddrB = v17 - v20 = pParse + 48 + v20 = pParse + 52 *(*int32)(unsafe.Pointer(v20))++ v19 = *(*int32)(unsafe.Pointer(v20)) regOutA = v19 - v22 = pParse + 48 + v22 = pParse + 52 *(*int32)(unsafe.Pointer(v22))++ v21 = *(*int32)(unsafe.Pointer(v22)) regOutB = v21 _sqlite3SelectDestInit(tls, bp, int32(SRT_Coroutine), regAddrA) _sqlite3SelectDestInit(tls, bp+28, int32(SRT_Coroutine), regAddrB) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21100, libc.VaList(bp+64, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21263, libc.VaList(bp+64, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(p)).Fop)))) /* Generate a coroutine to evaluate the SELECT statement to the ** left of the compound operator - the "A" select. */ addrSelectA = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) addr1 = _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), regAddrA, 0, addrSelectA) (*TSelect)(unsafe.Pointer(pPrior)).FiLimit = regLimitA - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21111, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21274, 0) _sqlite3Select(tls, pParse, pPrior, bp) _sqlite3VdbeEndCoroutine(tls, v, regAddrA) _sqlite3VdbeJumpHere(tls, v, addr1) @@ -197099,7 +189659,7 @@ func _multiSelectOrderBy(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr savedOffset = (*TSelect)(unsafe.Pointer(p)).FiOffset (*TSelect)(unsafe.Pointer(p)).FiLimit = regLimitB (*TSelect)(unsafe.Pointer(p)).FiOffset = 0 - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21116, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21279, 0) _sqlite3Select(tls, pParse, p, bp+28) (*TSelect)(unsafe.Pointer(p)).FiLimit = savedLimit (*TSelect)(unsafe.Pointer(p)).FiOffset = savedOffset @@ -197309,11 +189869,11 @@ func _substExpr(tls *libc.TLS, pSubst uintptr, pExpr uintptr) (r uintptr) { if pColl != 0 { v1 = (*TCollSeq)(unsafe.Pointer(pColl)).FzName } else { - v1 = __ccgo_ts + 6460 + v1 = __ccgo_ts + 6548 } pNew = _sqlite3ExprAddCollateString(tls, (*TSubstContext)(unsafe.Pointer(pSubst)).FpParse, pNew, v1) } - *(*Tu32)(unsafe.Pointer(pNew + 4)) &= uint32(^libc.Int32FromInt32(EP_Collate)) + *(*Tu32)(unsafe.Pointer(pNew + 4)) &= ^uint32(libc.Int32FromInt32(EP_Collate)) if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON)) != uint32(0) { _sqlite3SetJoinExpr(tls, pNew, *(*int32)(unsafe.Pointer(pExpr + 36)), (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_InnerON))) } @@ -197474,7 +190034,7 @@ func _srclistRenumberCursors(tls *libc.TLS, pParse uintptr, aCsrMap uintptr, pSr } if i != iExcept { if !(int32(*(*uint32)(unsafe.Pointer(pItem + 12 + 4))&0x80>>7) != 0) || *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) == 0 { - v3 = pParse + 44 + v3 = pParse + 48 v2 = *(*int32)(unsafe.Pointer(v3)) *(*int32)(unsafe.Pointer(v3))++ *(*int32)(unsafe.Pointer(aCsrMap + uintptr((*TSrcItem)(unsafe.Pointer(pItem)).FiCursor+int32(1))*4)) = v2 @@ -197664,9 +190224,9 @@ func _compoundHasDifferentAffinities(tls *libc.TLS, p uintptr) (r int32) { // ** from 2015-02-09.) // ** // ** (3) If the subquery is the right operand of a LEFT JOIN then -// ** (3a) the subquery may not be a join and -// ** (3b) the FROM clause of the subquery may not contain a virtual -// ** table and +// ** (3a) the subquery may not be a join +// ** (**) Was (3b): "the FROM clause of the subquery may not contain +// ** a virtual table" // ** (**) Was: "The outer query may not have a GROUP BY." This case // ** is now managed correctly // ** (3d) the outer query may not be DISTINCT. @@ -197878,7 +190438,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA ** See also tickets #306, #350, and #3300. */ if int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&(libc.Int32FromInt32(JT_OUTER)|libc.Int32FromInt32(JT_LTORJ)) != 0 { - if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pSubSrc + 8))).FpSTab)).FeTabType) == int32(TABTYP_VTAB) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { + if (*TSrcList)(unsafe.Pointer(pSubSrc)).FnSrc > int32(1) || (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != uint32(0) || int32((*TSrcItem)(unsafe.Pointer(pSubitem)).Ffg.Fjointype)&int32(JT_RIGHT) != 0 { return 0 } isOuterJoin = int32(1) @@ -198025,7 +190585,7 @@ func _flattenSubquery(tls *libc.TLS, pParse uintptr, p uintptr, iFrom int32, isA if pNew == uintptr(0) { (*TSelect)(unsafe.Pointer(p)).FpPrior = pPrior } else { - v5 = pParse + 112 + v5 = pParse + 100 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TSelect)(unsafe.Pointer(pNew)).FselId = uint32(v4) @@ -198264,18 +190824,6 @@ type TWhereConst = struct { type WhereConst = TWhereConst -type TWhereConst1 = struct { - FpParse uintptr - FpOomFault uintptr - FnConst int32 - FnChng int32 - FbHasAffBlob int32 - FmExcludeOn Tu32 - FapExpr uintptr -} - -type WhereConst1 = TWhereConst1 - // C documentation // // /* @@ -198315,7 +190863,7 @@ func _constInsert(tls *libc.TLS, pConst uintptr, pColumn uintptr, pValue uintptr ; i++ } - if int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { (*TWhereConst)(unsafe.Pointer(pConst)).FbHasAffBlob = int32(1) } (*TWhereConst)(unsafe.Pointer(pConst)).FnConst++ @@ -198384,7 +190932,7 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } - if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(uint32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { + if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&(libc.Uint32FromInt32(EP_FixedCol)|(*TWhereConst)(unsafe.Pointer(pConst)).FmExcludeOn) != uint32(0) { return WRC_Continue } i = 0 @@ -198402,12 +190950,12 @@ func _propagateConstantExprRewriteOne(tls *libc.TLS, pConst uintptr, pExpr uintp if int32((*TExpr)(unsafe.Pointer(pColumn)).FiColumn) != int32((*TExpr)(unsafe.Pointer(pExpr)).FiColumn) { goto _1 } - if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) == int32(SQLITE_AFF_BLOB) { + if bIgnoreAffBlob != 0 && int32(_sqlite3ExprAffinity(tls, pColumn)) <= int32(SQLITE_AFF_BLOB) { break } /* A match is found. Add the EP_FixedCol property */ (*TWhereConst)(unsafe.Pointer(pConst)).FnChng++ - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Leaf)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Leaf)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_FixedCol)) (*TExpr)(unsafe.Pointer(pExpr)).FpLeft = _sqlite3ExprDup(tls, (*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb, *(*uintptr)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FapExpr + uintptr(i*int32(2)+int32(1))*4)), 0) if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer((*TWhereConst)(unsafe.Pointer(pConst)).FpParse)).Fdb)).FmallocFailed != 0 { @@ -198889,7 +191437,7 @@ func _disableUnusedSubqueryResultColumns(tls *libc.TLS, pItem uintptr) (r int32) goto _6 } (*TExpr)(unsafe.Pointer(pY)).Fop = uint8(TK_NULL) - *(*Tu32)(unsafe.Pointer(pY + 4)) &= uint32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely))) + *(*Tu32)(unsafe.Pointer(pY + 4)) &= ^uint32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Unlikely)) *(*Tu32)(unsafe.Pointer(pX + 4)) |= uint32(SF_PushDown) nChng++ goto _6 @@ -198935,13 +191483,13 @@ func _minMaxQuery(tls *libc.TLS, db uintptr, pFunc uintptr, ppMinMax uintptr) (r return uint8(eRet) } zFunc = *(*uintptr)(unsafe.Pointer(pFunc + 8)) - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17019) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17162) == 0 { eRet = int32(WHERE_ORDERBY_MIN) if _sqlite3ExprCanBeNull(tls, (*(*TExprList_item)(unsafe.Pointer(pEList + 8))).FpExpr) != 0 { sortFlags = uint8(KEYINFO_ORDER_BIGNULL) } } else { - if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17023) == 0 { + if _sqlite3StrICmp(tls, zFunc, __ccgo_ts+17166) == 0 { eRet = int32(WHERE_ORDERBY_MAX) sortFlags = uint8(KEYINFO_ORDER_DESC) } else { @@ -199029,8 +191577,8 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } if !(pIdx != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21122, libc.VaList(bp+8, zIndexedBy, 0)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21285, libc.VaList(bp+8, zIndexedBy, 0)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) return int32(SQLITE_ERROR) } *(*uintptr)(unsafe.Pointer(pFrom + 36)) = pIdx @@ -199054,7 +191602,7 @@ func _sqlite3IndexedByLookup(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r in // ** above that generates the code for a compound SELECT with an ORDER BY clause // ** uses a merge algorithm that requires the same collating sequence on the // ** result columns as on the ORDER BY clause. See ticket -// ** http://www.sqlite.org/src/info/6709574d2a +// ** http://sqlite.org/src/info/6709574d2a // ** // ** This transformation is only needed for EXCEPT, INTERSECT, and UNION. // ** The UNION ALL operator works fine with multiSelectOrderBy() even when @@ -199136,7 +191684,7 @@ func _convertCompoundSelectToSubquery(tls *libc.TLS, pWalker uintptr, p uintptr) (*TSelect)(unsafe.Pointer(p)).FpNext = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWith = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpWinDefn = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Compound) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_Converted) (*TSelect)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pNew)).FpPrior)).FpNext = pNew (*TSelect)(unsafe.Pointer(pNew)).FpLimit = uintptr(0) @@ -199154,7 +191702,7 @@ func _cannotBeFunction(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) if int32(*(*uint32)(unsafe.Pointer(pFrom + 12 + 4))&0x8>>3) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21140, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21303, libc.VaList(bp+8, (*TSrcItem)(unsafe.Pointer(pFrom)).FzName)) return int32(1) } return 0 @@ -199302,7 +191850,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom if _cannotBeFunction(tls, pParse, pFrom) != 0 { return int32(2) } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return int32(2) } @@ -199330,7 +191878,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 44)))).FpSelect *(*Tu32)(unsafe.Pointer(pSel + 4)) |= uint32(SF_CopyCte) if int32(*(*uint32)(unsafe.Pointer(pFrom + 12 + 4))&0x2>>1) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21163, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21326, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(pFrom + 32)))) return int32(2) } libc.SetBitFieldPtr32Uint32(pFrom+12+4, libc.Uint32FromInt32(1), 9, 0x200) @@ -199352,12 +191900,12 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ libc.SetBitFieldPtr32Uint32(pItem+12+4, libc.Uint32FromInt32(1), 7, 0x80) if (*TSelect)(unsafe.Pointer(pRecTerm)).FselFlags&uint32(SF_Recursive) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21183, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21346, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName)) return int32(2) } *(*Tu32)(unsafe.Pointer(pRecTerm + 4)) |= uint32(SF_Recursive) if iRecTab < 0 { - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ iRecTab = v3 @@ -199374,7 +191922,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom } pRecTerm = (*TSelect)(unsafe.Pointer(pRecTerm)).FpPrior } - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21226 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21389 pSavedWith = (*TParse)(unsafe.Pointer(pParse)).FpWith (*TParse)(unsafe.Pointer(pParse)).FpWith = *(*uintptr)(unsafe.Pointer(bp)) if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { @@ -199405,7 +191953,7 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom pEList = (*TSelect)(unsafe.Pointer(pLeft)).FpEList if (*TCte)(unsafe.Pointer(pCte)).FpCols != 0 { if pEList != 0 && (*TExprList)(unsafe.Pointer(pEList)).FnExpr != (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21249, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21412, libc.VaList(bp+16, (*TCte)(unsafe.Pointer(pCte)).FzName, (*TExprList)(unsafe.Pointer(pEList)).FnExpr, (*TExprList)(unsafe.Pointer((*TCte)(unsafe.Pointer(pCte)).FpCols)).FnExpr)) (*TParse)(unsafe.Pointer(pParse)).FpWith = pSavedWith return int32(2) } @@ -199414,9 +191962,9 @@ func _resolveFromTermToCte(tls *libc.TLS, pParse uintptr, pWalker uintptr, pFrom _sqlite3ColumnsFromExprList(tls, pParse, pEList, pTab+34, pTab+4) if bMayRecursive != 0 { if (*TSelect)(unsafe.Pointer(pSel)).FselFlags&uint32(SF_Recursive) != 0 { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21287 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21450 } else { - (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21321 + (*TCte)(unsafe.Pointer(pCte)).FzCteErr = __ccgo_ts + 21484 } _sqlite3WalkSelect(tls, pWalker, pSel) } @@ -199465,7 +192013,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int var v2 int32 _, _, _, _ = pSel, pTab, v1, v2 pSel = (*TSubquery)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pFrom + 44)))).FpSelect - v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(64)) + v1 = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(80)) pTab = v1 (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = v1 if pTab == uintptr(0) { @@ -199475,7 +192023,7 @@ func _sqlite3ExpandSubquery(tls *libc.TLS, pParse uintptr, pFrom uintptr) (r int if (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias != 0 { (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TSrcItem)(unsafe.Pointer(pFrom)).FzAlias) } else { - (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+21359, libc.VaList(bp+8, pFrom)) + (*TTable)(unsafe.Pointer(pTab)).FzName = _sqlite3MPrintf(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, __ccgo_ts+21522, libc.VaList(bp+8, pFrom)) } for (*TSelect)(unsafe.Pointer(pSel)).FpPrior != 0 { pSel = (*TSelect)(unsafe.Pointer(pSel)).FpPrior @@ -199571,7 +192119,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TWalker)(unsafe.Pointer(pWalker)).FeCode != 0 { /* Renumber selId because it has been copied from a view */ - v2 = pParse + 112 + v2 = pParse + 100 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TSelect)(unsafe.Pointer(p)).FselId = uint32(v1) @@ -199580,7 +192128,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pEList = (*TSelect)(unsafe.Pointer(p)).FpEList if (*TParse)(unsafe.Pointer(pParse)).FpWith != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_View) != 0 { if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { - (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(36)) + (*TSelect)(unsafe.Pointer(p)).FpWith = _sqlite3DbMallocZero(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+12)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if (*TSelect)(unsafe.Pointer(p)).FpWith == uintptr(0) { return int32(WRC_Abort) } @@ -199631,7 +192179,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { return int32(WRC_Abort) } if (*TTable)(unsafe.Pointer(pTab)).FnTabRef >= uint32(0xffff) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21363, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21526, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) (*TSrcItem)(unsafe.Pointer(pFrom)).FpSTab = uintptr(0) return int32(WRC_Abort) } @@ -199646,7 +192194,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) { if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_EnableView) == uint64(0) && (*TTable)(unsafe.Pointer(pTab)).FpSchema != (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FpSchema { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21402, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21565, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } _sqlite3SrcItemAttachSubquery(tls, pParse, pFrom, (*(*struct { FpSelect uintptr @@ -199661,7 +192209,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 44))).Fp)).FeVtabRisk) > libc.BoolInt32((*Tsqlite3)(unsafe.Pointer(db)).Fflags&uint64(SQLITE_TrustedSchema) != uint64(0)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16578, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+16694, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName)) } } nCol = (*TTable)(unsafe.Pointer(pTab)).FnCol @@ -199785,7 +192333,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if iDb >= 0 { v10 = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName } else { - v10 = __ccgo_ts + 8025 + v10 = __ccgo_ts + 8112 } zSchemaName = v10 } @@ -199802,7 +192350,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { pNew = _sqlite3ExprListAppend(tls, pParse, pNew, pRight) if pNew != 0 { pX = pNew + 8 + uintptr((*TExprList)(unsafe.Pointer(pNew)).FnExpr-int32(1))*20 - (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21433, libc.VaList(bp+8, zUName)) + (*TExprList_item)(unsafe.Pointer(pX)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21596, libc.VaList(bp+8, zUName)) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(ENAME_TAB), 0, 0x3) libc.SetBitFieldPtr16Uint32(pX+8+4, libc.Uint32FromInt32(1), 7, 0x80) } @@ -199881,7 +192429,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { if pNestedFrom != 0 && libc.Bool(libc.Bool(!(libc.Int32FromInt32(ViewCanHaveRowid) != 0)) || j < (*TExprList)(unsafe.Pointer(pNestedFrom)).FnExpr) { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, (*(*TExprList_item)(unsafe.Pointer(pNestedFrom + 8 + uintptr(j)*20))).FzEName) } else { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21438, libc.VaList(bp+8, zSchemaName, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+21601, libc.VaList(bp+8, zSchemaName, zTabName, zName)) } if j == int32((*TTable)(unsafe.Pointer(pTab1)).FnCol) { v13 = int32(ENAME_ROWID) @@ -199894,7 +192442,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } } else { if longNames != 0 { - (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+13877, libc.VaList(bp+8, zTabName, zName)) + (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3MPrintf(tls, db, __ccgo_ts+13993, libc.VaList(bp+8, zTabName, zName)) libc.SetBitFieldPtr16Uint32(pX1+8+4, libc.Uint32FromInt32(ENAME_NAME), 0, 0x3) } else { (*TExprList_item)(unsafe.Pointer(pX1)).FzEName = _sqlite3DbStrDup(tls, db, zName) @@ -199914,9 +192462,9 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if !(tableSeen != 0) { if zTName != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21447, libc.VaList(bp+8, zTName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21610, libc.VaList(bp+8, zTName)) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21465, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21628, 0) } } } @@ -199930,7 +192478,7 @@ func _selectExpander(tls *libc.TLS, pWalker uintptr, p uintptr) (r int32) { } if (*TSelect)(unsafe.Pointer(p)).FpEList != 0 { if (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList)).FnExpr > *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21485, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21648, 0) return int32(WRC_Abort) } if elistFlags&uint32(libc.Int32FromInt32(EP_HasFunc)|libc.Int32FromInt32(EP_Subquery)) != uint32(0) { @@ -200127,14 +192675,14 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u var j, k, mx int32 _, _, _ = j, k, mx (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator - if int32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn) > 0 { + if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn > uint32(0) { mx = (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSelect)).FpGroupBy)).FnExpr - int32(1) j = 0 for { if !(j < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - k = int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*16))).FiSorterColumn) + k = (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(j)*20))).FiSorterColumn if k > mx { mx = k } @@ -200143,7 +192691,7 @@ func _optimizeAggregateUseOfIndexedExpr(tls *libc.TLS, pParse uintptr, pSelect u ; j++ } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint16(mx + int32(1)) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint32(mx + int32(1)) } _analyzeAggFuncArgs(tls, pAggInfo, pNC) _ = pSelect @@ -200175,11 +192723,11 @@ func _aggregateIdxEprRefToColCallback(tls *libc.TLS, pWalker uintptr, pExpr uint if int32((*TExpr)(unsafe.Pointer(pExpr)).FiAgg) >= (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn { return WRC_Continue } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*16 + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr((*TExpr)(unsafe.Pointer(pExpr)).FiAgg)*20 (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_AGG_COLUMN) (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiTable - (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = (*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely))) + (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16((*TAggInfo_col)(unsafe.Pointer(pCol)).FiColumn) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Skip) | libc.Int32FromInt32(EP_Collate) | libc.Int32FromInt32(EP_Unlikely)) return int32(WRC_Prune) } @@ -200232,7 +192780,7 @@ func _aggregateConvertIndexedExprRefToColumn(tls *libc.TLS, pAggInfo uintptr) { // */ func _assignAggregateRegisters(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TAggInfo)(unsafe.Pointer(pAggInfo)).FiFirstReg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc } // C documentation @@ -200269,12 +192817,12 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct >= 0 { pE = (*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFExpr if *(*uintptr)(unsafe.Pointer(pE + 20)) == uintptr(0) || (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pE + 20)))).FnExpr != int32(1) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21516, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21679, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct = -int32(1) } else { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, *(*uintptr)(unsafe.Pointer(pE + 20)), 0, 0) (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistAddr = _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiDistinct, 0, 0, pKeyInfo, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21567, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21730, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } } if (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab >= 0 { @@ -200295,7 +192843,7 @@ func _resetAccumulator(tls *libc.TLS, pParse uintptr, pAggInfo uintptr) { (*TKeyInfo)(unsafe.Pointer(pKeyInfo1)).FnKeyField++ } _sqlite3VdbeAddOp4(tls, v, int32(OP_OpenEphemeral), (*TAggInfo_func)(unsafe.Pointer(pFunc)).FiOBTab, (*TExprList)(unsafe.Pointer(pOBList)).FnExpr+nExtra, 0, pKeyInfo1, -int32(8)) - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21600, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21763, libc.VaList(bp+8, (*TFuncDef)(unsafe.Pointer((*TAggInfo_func)(unsafe.Pointer(pFunc)).FpFunc)).FzName)) } goto _1 _1: @@ -200434,7 +192982,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui ** without a FILTER clause that will ensure the magnet registers ** are populated. */ if regHit == 0 { - v3 = pParse + 48 + v3 = pParse + 52 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) regHit = v2 @@ -200542,7 +193090,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui pColl = (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FpDfltColl } if regHit == 0 && (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnAccumulator != 0 { - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regHit = v7 @@ -200586,7 +193134,7 @@ func _updateAccumulator(tls *libc.TLS, pParse uintptr, regAcc int32, pAggInfo ui _9: ; i++ - pC += 16 + pC += 20 } (*TAggInfo)(unsafe.Pointer(pAggInfo)).FdirectMode = uint8(0) if addrHitTest != 0 { @@ -200609,16 +193157,16 @@ func _explainSimpleCount(tls *libc.TLS, pParse uintptr, pTab uintptr, pIdx uintp if int32((*TParse)(unsafe.Pointer(pParse)).Fexplain) == int32(2) { bCover = libc.BoolInt32(pIdx != uintptr(0) && ((*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) || !(int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == libc.Int32FromInt32(SQLITE_IDXTYPE_PRIMARYKEY)))) if bCover != 0 { - v1 = __ccgo_ts + 21633 + v1 = __ccgo_ts + 21796 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } if bCover != 0 { v2 = (*TIndex)(unsafe.Pointer(pIdx)).FzName } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21656, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+21819, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, v1, v2)) } } @@ -200650,7 +193198,7 @@ func _havingToWhereExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) (r int3 ** statements AggInfo structure. */ if _sqlite3ExprIsConstantOrGroupBy(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, pExpr, (*TSelect)(unsafe.Pointer(pS)).FpGroupBy) != 0 && libc.BoolInt32((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)|libc.Int32FromInt32(EP_IsFalse)) == uint32(EP_IsFalse)) == 0 && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { db = (*TParse)(unsafe.Pointer((*TWalker)(unsafe.Pointer(pWalker)).FpParse)).Fdb - pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9626) + pNew = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) if pNew != 0 { pWhere = (*TSelect)(unsafe.Pointer(pS)).FpWhere t = *(*TExpr)(unsafe.Pointer(pNew)) @@ -200779,6 +193327,7 @@ func _agginfoFree(tls *libc.TLS, db uintptr, pArg uintptr) { // ** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries // ** * The outer query is a simple count(*) with no WHERE clause or other // ** extraneous syntax. +// ** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10) // ** // ** Return TRUE if the optimization is undertaken. // */ @@ -200807,7 +193356,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_AGG_FUNCTION) { return 0 } /* Result is an aggregate */ - if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+17313) != 0 { + if Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(pExpr + 8)), __ccgo_ts+17476) != 0 { return 0 } /* Is count() */ if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != uintptr(0) { @@ -200840,9 +193389,9 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 if (*TSelect)(unsafe.Pointer(pSub)).FpLimit != 0 { return 0 } /* No LIMIT clause */ - if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(SF_Aggregate) != 0 { - return 0 - } /* Not an aggregate */ + if (*TSelect)(unsafe.Pointer(pSub)).FselFlags&uint32(libc.Int32FromInt32(SF_Aggregate)|libc.Int32FromInt32(SF_Distinct)) != 0 { + return 0 /* Not an aggregate nor DISTINCT */ + } /* Due to the previous */ pSub = (*TSelect)(unsafe.Pointer(pSub)).FpPrior /* Repeat over compound */ } @@ -200852,13 +193401,13 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pExpr = uintptr(0) pSub = _sqlite3SubqueryDetach(tls, db, pFrom) _sqlite3SrcListDelete(tls, db, (*TSelect)(unsafe.Pointer(p)).FpSrc) - (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(56)) + (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48))) for pSub != 0 { pPrior = (*TSelect)(unsafe.Pointer(pSub)).FpPrior (*TSelect)(unsafe.Pointer(pSub)).FpPrior = uintptr(0) (*TSelect)(unsafe.Pointer(pSub)).FpNext = uintptr(0) *(*Tu32)(unsafe.Pointer(pSub + 4)) |= uint32(SF_Aggregate) - *(*Tu32)(unsafe.Pointer(pSub + 4)) &= uint32(^libc.Int32FromInt32(SF_Compound)) + *(*Tu32)(unsafe.Pointer(pSub + 4)) &= ^libc.Uint32FromInt32(SF_Compound) (*TSelect)(unsafe.Pointer(pSub)).FnSelectRow = 0 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(pSub)).FpEList) if pPrior != 0 { @@ -200878,7 +193427,7 @@ func _countOfViewOptimization(tls *libc.TLS, pParse uintptr, p uintptr) (r int32 pSub = pPrior } (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8))).FpExpr = pExpr - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) return int32(1) } @@ -201051,8 +193600,8 @@ func _fromClauseTermCanBeCoroutine(tls *libc.TLS, pParse uintptr, pTabList uintp func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r int32) { bp := tls.Alloc(160) defer tls.Free(160) - var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v27, v32, v33, v34, v36, v38, v40, v42, v44, v45, v49, v50, v54, v58, v60 int32 - var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v28, v3, v35, v37, v39, v41, v43, v46, v51, v53, v55, v59, p10, p23, p4, p5, p7, p8 uintptr + var addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iUseFlag, ii, ii1, isAgg, j, k, nCol, nGroupBy, onceAddr, orderByGrp, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortOut, sortPTab, topAddr, v12, v15, v19, v24, v26, v28, v33, v34, v35, v37, v39, v41, v43, v45, v46, v50, v51, v55, v59, v61 int32 + var db, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, v, zDb, zSavedAuthContext, v1, v13, v14, v16, v17, v20, v25, v29, v3, v36, v38, v40, v42, v44, v47, v52, v54, v56, v60, p10, p23, p27, p4, p5, p7, p8 uintptr var distFlag, distFlag1, wctrlFlags Tu16 var iRoot TPgno var minMaxFlag, sortFlags Tu8 @@ -201061,11 +193610,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r var _ /* sDistinct at bp+0 */ TDistinctCtx var _ /* sNC at bp+84 */ TNameContext var _ /* sSort at bp+12 */ TSortCtx - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v27, v28, v3, v32, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v49, v50, v51, v53, v54, v55, v58, v59, v60, p10, p23, p4, p5, p7, p8 /* True for select lists like "count(*)" */ - pEList = uintptr(0) /* The HAVING clause. May be NULL */ - pAggInfo = uintptr(0) /* Aggregate information */ - rc = int32(1) /* The database connection */ - *(*uintptr)(unsafe.Pointer(bp + 52)) = uintptr(0) /* Flag for min/max queries */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addr1, addrEnd, addrGosub, addrOutputRow, addrReset, addrSetAbort, addrSortingIdx, addrTop, addrTopOfLoop, db, distFlag, distFlag1, eDist, eDist1, groupBySort, i, iAMem, iAbortFlag, iBMem, iBreak, iCont, iCsr, iDb, iDb1, iEnd, iOrderByCol, iRoot, iUseFlag, ii, ii1, isAgg, j, k, minMaxFlag, nCol, nGroupBy, onceAddr, orderByGrp, p0, pAggInfo, pBase, pBest, pCol, pCteUse, pCteUse1, pDistinct, pDistinct1, pEList, pExpr, pF, pF1, pGroupBy, pHaving, pI2, pIdx, pItem, pItem1, pItem2, pKeyInfo, pKeyInfo1, pKeyInfo2, pPrior, pPriorSubq, pSub, pSub1, pSubq, pTab, pTab1, pTabList, pWInfo, pWhere, pWin, pX, rc, regAcc, regBase, regGosub, regOutputRow, regRecord, regReset, sortFlags, sortOut, sortPTab, topAddr, v, wctrlFlags, zDb, zSavedAuthContext, v1, v12, v13, v14, v15, v16, v17, v19, v20, v24, v25, v26, v28, v29, v3, v33, v34, v35, v36, v37, v38, v39, v40, v41, v42, v43, v44, v45, v46, v47, v50, v51, v52, v54, v55, v56, v59, v60, v61, p10, p23, p27, p4, p5, p7, p8 /* True for select lists like "count(*)" */ + pEList = uintptr(0) /* The HAVING clause. May be NULL */ + pAggInfo = uintptr(0) /* Aggregate information */ + rc = int32(1) /* The database connection */ + *(*uintptr)(unsafe.Pointer(bp + 52)) = uintptr(0) /* Flag for min/max queries */ db = (*TParse)(unsafe.Pointer(pParse)).Fdb v = _sqlite3GetVdbe(tls, pParse) if p == uintptr(0) || (*TParse)(unsafe.Pointer(pParse)).FnErr != 0 { @@ -201081,7 +193630,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_sqlite3ExprListDeleteGeneric), (*TSelect)(unsafe.Pointer(p)).FpOrderBy) (*TSelect)(unsafe.Pointer(p)).FpOrderBy = uintptr(0) } - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_NoopOrderBy) } _sqlite3SelectPrep(tls, pParse, p, uintptr(0)) @@ -201105,14 +193654,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { v1 = (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(p0)).FpSTab)).FzName } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21668, libc.VaList(bp+128, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21831, libc.VaList(bp+128, v1)) goto select_end } /* Clear the SF_UFSrcCheck flag. The check has already been performed, ** and leaving this flag set can cause errors if a compound sub-query ** in p->pSrc is flattened into this query and this function called ** again as part of compound SELECT processing. */ - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_UFSrcCheck)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_UFSrcCheck) } if int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) == int32(SRT_Output) { _sqlite3GenerateColumnNames(tls, pParse, p) @@ -201213,7 +193762,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Catch mismatch in the declared columns of a view and the number of ** columns in the SELECT on the RHS */ if int32((*TTable)(unsafe.Pointer(pTab)).FnCol) != (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21722, libc.VaList(bp+128, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21885, libc.VaList(bp+128, int32((*TTable)(unsafe.Pointer(pTab)).FnCol), (*TTable)(unsafe.Pointer(pTab)).FzName, (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(pSub)).FpEList)).FnExpr)) goto select_end } /* Do not attempt the usual optimizations (flattening and ORDER BY @@ -201371,7 +193920,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r zDb = *(*uintptr)(unsafe.Pointer(pItem1 + 44)) } } - _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1673, zDb) + _sqlite3AuthCheck(tls, pParse, int32(SQLITE_READ), (*TSrcItem)(unsafe.Pointer(pItem1)).FzName, __ccgo_ts+1674, zDb) } /* Generate code for all sub-queries in the FROM clause */ @@ -201391,7 +193940,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** more conservative than necessary, but much easier than enforcing ** an exact limit. */ - *(*int32)(unsafe.Pointer(pParse + 232)) += _sqlite3SelectExprHeight(tls, p) + *(*int32)(unsafe.Pointer(pParse + 228)) += _sqlite3SelectExprHeight(tls, p) /* Make copies of constant WHERE-clause terms in the outer query down ** inside the subquery. This can help the subquery to run more efficiently. ** This is the "predicate push-down optimization". tag-select-0420 @@ -201414,14 +193963,14 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** set on each invocation. tag-select-0482 */ addrTop = _sqlite3VdbeCurrentAddr(tls, v) + int32(1) - v13 = pParse + 48 + v13 = pParse + 52 *(*int32)(unsafe.Pointer(v13))++ v12 = *(*int32)(unsafe.Pointer(v13)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v12 _sqlite3VdbeAddOp3(tls, v, int32(OP_InitCoroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn, 0, addrTop) (*TSubquery)(unsafe.Pointer(pSubq)).FaddrFillSub = addrTop _sqlite3SelectDestInit(tls, bp+56, int32(SRT_Coroutine), (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21762, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21925, libc.VaList(bp+128, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+56) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow libc.SetBitFieldPtr32Uint32(pItem1+12+4, libc.Uint32FromInt32(1), 6, 0x40) @@ -201453,7 +194002,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow = (*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pPriorSubq)).FpSelect)).FnSelectRow } else { onceAddr = 0 - v16 = pParse + 48 + v16 = pParse + 52 *(*int32)(unsafe.Pointer(v16))++ v15 = *(*int32)(unsafe.Pointer(v16)) (*TSubquery)(unsafe.Pointer(pSubq)).FregReturn = v15 @@ -201468,7 +194017,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } else { } _sqlite3SelectDestInit(tls, bp+56, int32(SRT_EphemTab), (*TSrcItem)(unsafe.Pointer(pItem1)).FiCursor) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21777, libc.VaList(bp+128, pItem1)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+21940, libc.VaList(bp+128, pItem1)) _sqlite3Select(tls, pParse, pSub1, bp+56) (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem1)).FpSTab)).FnRowLogEst = (*TSelect)(unsafe.Pointer(pSub1)).FnSelectRow if onceAddr != 0 { @@ -201490,7 +194039,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto select_end } - *(*int32)(unsafe.Pointer(pParse + 232)) -= _sqlite3SelectExprHeight(tls, p) + *(*int32)(unsafe.Pointer(pParse + 228)) -= _sqlite3SelectExprHeight(tls, p) (*TParse)(unsafe.Pointer(pParse)).FzAuthContext = zSavedAuthContext goto _11 _11: @@ -201522,7 +194071,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** BY and DISTINCT, and an index or separate temp-table for the other. */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(libc.Int32FromInt32(SF_Distinct)|libc.Int32FromInt32(SF_Aggregate)) == uint32(SF_Distinct) && _sqlite3ExprListCompare(tls, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, pEList, -int32(1)) == 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_GroupByOrder)) == uint32(0) && (*TSelect)(unsafe.Pointer(p)).FpWin == uintptr(0) { - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Distinct)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Distinct) v17 = _sqlite3ExprListDup(tls, db, pEList, 0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = v17 pGroupBy = v17 @@ -201555,7 +194104,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ if (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy != 0 { pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy, 0, (*TExprList)(unsafe.Pointer(pEList)).FnExpr) - v20 = pParse + 44 + v20 = pParse + 48 v19 = *(*int32)(unsafe.Pointer(v20)) *(*int32)(unsafe.Pointer(v20))++ (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FiECursor = v19 @@ -201614,7 +194163,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r /* Open an ephemeral index to use for the distinct set. tag-select-0680 */ if (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) != 0 { - v25 = pParse + 44 + v25 = pParse + 48 v24 = *(*int32)(unsafe.Pointer(v25)) *(*int32)(unsafe.Pointer(v25))++ (*(*TDistinctCtx)(unsafe.Pointer(bp))).FtabTnct = v24 @@ -201643,6 +194192,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } if int32(_sqlite3WhereOutputRowCount(tls, pWInfo)) < int32((*TSelect)(unsafe.Pointer(p)).FnSelectRow) { (*TSelect)(unsafe.Pointer(p)).FnSelectRow = _sqlite3WhereOutputRowCount(tls, pWInfo) + if int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) <= int32(SRT_DistQueue) && int32((*TSelectDest)(unsafe.Pointer(pDest)).FeDest) >= int32(SRT_DistFifo) { + /* TUNING: For a UNION CTE, because UNION is implies DISTINCT, + ** reduce the estimated output row count by 8 (LogEst 30). + ** Search for tag-20250414a to see other cases */ + p27 = p + 2 + *(*TLogEst)(unsafe.Pointer(p27)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p27))) - libc.Int32FromInt32(30)) + } } if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && _sqlite3WhereIsDistinct(tls, pWInfo) != 0 { (*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType = uint8(_sqlite3WhereIsDistinct(tls, pWInfo)) @@ -201665,10 +194221,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r addrGosub = _sqlite3VdbeMakeLabel(tls, pParse) iCont = _sqlite3VdbeMakeLabel(tls, pParse) iBreak = _sqlite3VdbeMakeLabel(tls, pParse) - v28 = pParse + 48 - *(*int32)(unsafe.Pointer(v28))++ - v27 = *(*int32)(unsafe.Pointer(v28)) - regGosub = v27 + v29 = pParse + 52 + *(*int32)(unsafe.Pointer(v29))++ + v28 = *(*int32)(unsafe.Pointer(v29)) + regGosub = v28 _sqlite3WindowCodeStep(tls, pParse, p, pWInfo, regGosub, addrGosub) _sqlite3VdbeAddOp2(tls, v, int32(OP_Goto), 0, iBreak) _sqlite3VdbeResolveLabel(tls, v, addrGosub) @@ -201702,8 +194258,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 16))).FiAlias = uint16(0) - goto _29 - _29: + goto _30 + _30: ; k-- pItem2 += 20 @@ -201718,8 +194274,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r FiOrderByCol Tu16 FiAlias Tu16 })(unsafe.Pointer(pItem2 + 16))).FiAlias = uint16(0) - goto _30 - _30: + goto _31 + _31: ; k-- pItem2 += 20 @@ -201748,8 +194304,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r } sortFlags = uint8(int32((*(*TExprList_item)(unsafe.Pointer((*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags) & int32(KEYINFO_ORDER_DESC)) (*(*TExprList_item)(unsafe.Pointer(pGroupBy + 8 + uintptr(ii1)*20))).Ffg.FsortFlags = sortFlags - goto _31 - _31: + goto _32 + _32: ; ii1++ } @@ -201766,7 +194322,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** sAggInfo for all TK_AGG_FUNCTION nodes in expressions of the ** SELECT statement. */ - pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(44)) + pAggInfo = _sqlite3DbMallocZero(tls, db, uint64(48)) if pAggInfo != 0 { _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_agginfoFree), pAggInfo) } @@ -201779,11 +194335,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r (*(*TNameContext)(unsafe.Pointer(bp + 84))).FpSrcList = pTabList *(*uintptr)(unsafe.Pointer(bp + 84 + 8)) = pAggInfo if pGroupBy != 0 { - v32 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + v33 = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr } else { - v32 = 0 + v33 = 0 } - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint16(v32) + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn = uint32(v33) (*TAggInfo)(unsafe.Pointer(pAggInfo)).FpGroupBy = pGroupBy _sqlite3ExprAnalyzeAggList(tls, bp+84, pEList) _sqlite3ExprAnalyzeAggList(tls, bp+84, (*(*TSortCtx)(unsafe.Pointer(bp + 12))).FpOrderBy) @@ -201817,49 +194373,50 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r pDistinct = _sqlite3ExprListDup(tls, db, pGroupBy, 0) pDistinct = _sqlite3ExprListAppend(tls, pParse, pDistinct, pExpr) if pDistinct != 0 { - v33 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v34 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v33 = 0 + v34 = 0 } - distFlag = uint16(v33) + distFlag = uint16(v34) } /* If there is a GROUP BY clause we might need a sorting index to ** implement it. Allocate that sorting index now. If it turns out ** that we do not need it after all, the OP_SorterOpen instruction ** will be converted into a Noop. */ - v35 = pParse + 44 - v34 = *(*int32)(unsafe.Pointer(v35)) - *(*int32)(unsafe.Pointer(v35))++ - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v34 + v36 = pParse + 48 + v35 = *(*int32)(unsafe.Pointer(v36)) + *(*int32)(unsafe.Pointer(v36))++ + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx = v35 pKeyInfo1 = _sqlite3KeyInfoFromExprList(tls, pParse, pGroupBy, 0, (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) addrSortingIdx = _sqlite3VdbeAddOp4(tls, v, int32(OP_SorterOpen), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, int32((*TAggInfo)(unsafe.Pointer(pAggInfo)).FnSortingColumn), 0, pKeyInfo1, -int32(8)) /* Initialize memory locations used by GROUP BY aggregate processing */ - v37 = pParse + 48 - *(*int32)(unsafe.Pointer(v37))++ - v36 = *(*int32)(unsafe.Pointer(v37)) - iUseFlag = v36 - v39 = pParse + 48 - *(*int32)(unsafe.Pointer(v39))++ - v38 = *(*int32)(unsafe.Pointer(v39)) - iAbortFlag = v38 - v41 = pParse + 48 - *(*int32)(unsafe.Pointer(v41))++ - v40 = *(*int32)(unsafe.Pointer(v41)) - regOutputRow = v40 + v38 = pParse + 52 + *(*int32)(unsafe.Pointer(v38))++ + v37 = *(*int32)(unsafe.Pointer(v38)) + iUseFlag = v37 + v40 = pParse + 52 + *(*int32)(unsafe.Pointer(v40))++ + v39 = *(*int32)(unsafe.Pointer(v40)) + iAbortFlag = v39 + v42 = pParse + 52 + *(*int32)(unsafe.Pointer(v42))++ + v41 = *(*int32)(unsafe.Pointer(v42)) + regOutputRow = v41 addrOutputRow = _sqlite3VdbeMakeLabel(tls, pParse) - v43 = pParse + 48 - *(*int32)(unsafe.Pointer(v43))++ - v42 = *(*int32)(unsafe.Pointer(v43)) - regReset = v42 + v44 = pParse + 52 + *(*int32)(unsafe.Pointer(v44))++ + v43 = *(*int32)(unsafe.Pointer(v44)) + regReset = v43 addrReset = _sqlite3VdbeMakeLabel(tls, pParse) iAMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr iBMem = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, iAbortFlag) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, iAMem, iAMem+(*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr-int32(1)) + _sqlite3ExprNullRegisterRange(tls, pParse, iAMem, (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr) /* Begin a loop that will extract all source rows in GROUP BY order. ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information @@ -201867,16 +194424,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r */ _sqlite3VdbeAddOp2(tls, v, int32(OP_Gosub), regReset, addrReset) if int32((*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct) == int32(2) { - v44 = int32(WHERE_DISTINCTBY) + v45 = int32(WHERE_DISTINCTBY) } else { - v44 = int32(WHERE_GROUPBY) + v45 = int32(WHERE_GROUPBY) } if orderByGrp != 0 { - v45 = int32(WHERE_SORTBYGROUP) + v46 = int32(WHERE_SORTBYGROUP) } else { - v45 = 0 + v46 = 0 } - pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, uint16(v44|v45|int32(distFlag)), 0) + pWInfo = _sqlite3WhereBegin(tls, pParse, pTabList, pWhere, pGroupBy, pDistinct, p, uint16(v45|v46|int32(distFlag)), 0) if pWInfo == uintptr(0) { _sqlite3ExprListDelete(tls, db, pDistinct) goto select_end @@ -201894,11 +194451,11 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r groupBySort = 0 } else { if (*(*TDistinctCtx)(unsafe.Pointer(bp))).FisTnct != 0 && (*TSelect)(unsafe.Pointer(p)).FselFlags&uint32(SF_Distinct) == uint32(0) { - v46 = __ccgo_ts + 21793 + v47 = __ccgo_ts + 21956 } else { - v46 = __ccgo_ts + 21802 + v47 = __ccgo_ts + 21965 } - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20645, libc.VaList(bp+128, v46)) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+20808, libc.VaList(bp+128, v47)) groupBySort = int32(1) nGroupBy = (*TExprList)(unsafe.Pointer(pGroupBy)).FnExpr nCol = nGroupBy @@ -201908,12 +194465,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - if int32((*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*16))).FiSorterColumn) >= j { + if (*(*TAggInfo_col)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20))).FiSorterColumn >= j { nCol++ j++ } - goto _47 - _47: + goto _48 + _48: ; i++ } @@ -201926,13 +194483,13 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if !(i < (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnColumn) { break } - pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*16 - if int32((*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn) >= j { + pCol = (*TAggInfo)(unsafe.Pointer(pAggInfo)).FaCol + uintptr(i)*20 + if (*TAggInfo_col)(unsafe.Pointer(pCol)).FiSorterColumn >= j { _sqlite3ExprCode(tls, pParse, (*TAggInfo_col)(unsafe.Pointer(pCol)).FpCExpr, j+regBase) j++ } - goto _48 - _48: + goto _49 + _49: ; i++ } @@ -201943,12 +194500,12 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3ReleaseTempReg(tls, pParse, regRecord) _sqlite3ReleaseTempRange(tls, pParse, regBase, nCol) _sqlite3WhereEnd(tls, pWInfo) - v51 = pParse + 44 - v50 = *(*int32)(unsafe.Pointer(v51)) - *(*int32)(unsafe.Pointer(v51))++ - v49 = v50 - sortPTab = v49 - (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v49 + v52 = pParse + 48 + v51 = *(*int32)(unsafe.Pointer(v52)) + *(*int32)(unsafe.Pointer(v52))++ + v50 = v51 + sortPTab = v50 + (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdxPTab = v50 sortOut = _sqlite3GetTempReg(tls, pParse) _sqlite3VdbeAddOp3(tls, v, int32(OP_OpenPseudo), sortPTab, sortOut, nCol) _sqlite3VdbeAddOp2(tls, v, int32(OP_SorterSort), (*TAggInfo)(unsafe.Pointer(pAggInfo)).FsortingIdx, addrEnd) @@ -201997,12 +194554,16 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if iOrderByCol != 0 { pX = (*(*TExprList_item)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpEList + 8 + uintptr(iOrderByCol-int32(1))*20))).FpExpr pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + for pBase != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pBase)).Fop) == int32(TK_IF_NULL_ROW) { + pX = (*TExpr)(unsafe.Pointer(pBase)).FpLeft + pBase = _sqlite3ExprSkipCollateAndLikely(tls, pX) + } if pBase != uintptr(0) && int32((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_AGG_COLUMN) && int32((*TExpr)(unsafe.Pointer(pBase)).Fop) != int32(TK_REGISTER) { _sqlite3ExprToRegister(tls, pX, iAMem+j) } } - goto _52 - _52: + goto _53 + _53: ; j++ } @@ -202072,9 +194633,9 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _fixDistinctOpenEph(tls, pParse, eDist, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistinct, (*TAggInfo_func)(unsafe.Pointer(pF)).FiDistAddr) } } else { - v53 = _isSimpleCount(tls, p, pAggInfo) - pTab1 = v53 - if v53 != uintptr(0) { + v54 = _isSimpleCount(tls, p, pAggInfo) + pTab1 = v54 + if v54 != uintptr(0) { /* tag-select-0821 ** ** If isSimpleCount() returns a pointer to a Table structure, then @@ -202091,10 +194652,10 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r ** always spread across less pages than their corresponding tables. */ iDb1 = _sqlite3SchemaToIndex(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, (*TTable)(unsafe.Pointer(pTab1)).FpSchema) - v55 = pParse + 44 - v54 = *(*int32)(unsafe.Pointer(v55)) - *(*int32)(unsafe.Pointer(v55))++ - iCsr = v54 /* Iterator variable */ + v56 = pParse + 48 + v55 = *(*int32)(unsafe.Pointer(v56)) + *(*int32)(unsafe.Pointer(v56))++ + iCsr = v55 /* Iterator variable */ pKeyInfo2 = uintptr(0) /* Keyinfo for scanned index */ pBest = uintptr(0) /* Best index found so far */ iRoot = (*TTable)(unsafe.Pointer(pTab1)).Ftnum /* Root page of scanned b-tree */ @@ -202121,8 +194682,8 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x4>>2)) == 0 && int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TTable)(unsafe.Pointer(pTab1)).FszTabRow) && (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere == uintptr(0) && (!(pBest != 0) || int32((*TIndex)(unsafe.Pointer(pIdx)).FszIdxRow) < int32((*TIndex)(unsafe.Pointer(pBest)).FszIdxRow)) { pBest = pIdx } - goto _56 - _56: + goto _57 + _57: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext } @@ -202162,32 +194723,32 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r break } if (*TExpr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != uint32(0) { - goto _57 + goto _58 } if (*TFuncDef)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc + uintptr(i)*24))).FpFunc)).FfuncFlags&uint32(SQLITE_FUNC_NEEDCOLL) != 0 { break } - goto _57 - _57: + goto _58 + _58: ; i++ } if i == (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc { - v59 = pParse + 48 - *(*int32)(unsafe.Pointer(v59))++ - v58 = *(*int32)(unsafe.Pointer(v59)) - regAcc = v58 + v60 = pParse + 52 + *(*int32)(unsafe.Pointer(v60))++ + v59 = *(*int32)(unsafe.Pointer(v60)) + regAcc = v59 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regAcc) } } else { if (*TAggInfo)(unsafe.Pointer(pAggInfo)).FnFunc == int32(1) && (*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FiDistinct >= 0 { pDistinct1 = *(*uintptr)(unsafe.Pointer((*(*TAggInfo_func)(unsafe.Pointer((*TAggInfo)(unsafe.Pointer(pAggInfo)).FaFunc))).FpFExpr + 20)) if pDistinct1 != 0 { - v60 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) + v61 = libc.Int32FromInt32(WHERE_WANT_DISTINCT) | libc.Int32FromInt32(WHERE_AGG_DISTINCT) } else { - v60 = 0 + v61 = 0 } - distFlag1 = uint16(v60) + distFlag1 = uint16(v61) } } _assignAggregateRegisters(tls, pParse, pAggInfo) @@ -202229,7 +194790,7 @@ func _sqlite3Select(tls *libc.TLS, pParse uintptr, p uintptr, pDest uintptr) (r _sqlite3VdbeResolveLabel(tls, v, addrEnd) } /* endif aggregate query */ if int32((*(*TDistinctCtx)(unsafe.Pointer(bp))).FeTnctType) == int32(WHERE_DISTINCT_UNORDERED) { - _explainTempTable(tls, pParse, __ccgo_ts+21793) + _explainTempTable(tls, pParse, __ccgo_ts+21956) } /* If there is an ORDER BY clause, then we need to sort the results ** and send them to the callback one by one. tag-select-0900 @@ -202335,7 +194896,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr if !(i < nCol) { break } - z = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4)))) + z = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(colv + uintptr(i)*4)))) if z == uintptr(0) { goto malloc_failed } @@ -202351,7 +194912,7 @@ func _sqlite3_get_table_cb(tls *libc.TLS, pArg uintptr, nCol int32, argv uintptr } else { if int32((*TTabResult)(unsafe.Pointer(p)).FnColumn) != nCol { Xsqlite3_free(tls, (*TTabResult)(unsafe.Pointer(p)).FzErrMsg) - (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+21811, 0) + (*TTabResult)(unsafe.Pointer(p)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+21974, 0) (*TTabResult)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) return int32(1) } @@ -202441,7 +195002,7 @@ func Xsqlite3_get_table(tls *libc.TLS, db uintptr, zSql uintptr, pazResult uintp if (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg != 0 { if pzErrMsg != 0 { Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(pzErrMsg))) - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+40, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+40, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg)) } Xsqlite3_free(tls, (*(*TTabResult)(unsafe.Pointer(bp))).FzErrMsg) } @@ -202603,7 +195164,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if isTemp != 0 { /* If TEMP was specified, then the trigger name may not be qualified. */ if (*TToken)(unsafe.Pointer(pName2)).Fn > uint32(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21876, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22039, 0) goto trigger_cleanup } iDb = int32(1) @@ -202643,7 +195204,7 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto trigger_cleanup } - _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+21922, *(*uintptr)(unsafe.Pointer(bp))) + _sqlite3FixInit(tls, bp+4, pParse, iDb, __ccgo_ts+22085, *(*uintptr)(unsafe.Pointer(bp))) if _sqlite3FixSrcList(tls, bp+4, pTableName) != 0 { goto trigger_cleanup } @@ -202653,11 +195214,11 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_orphan_error } if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21930, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22093, 0) goto trigger_orphan_error } if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Shadow) != uint32(0) && _sqlite3ReadOnlyShadowTables(tls, db) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+21971, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22134, 0) goto trigger_orphan_error } /* Check that the trigger name is not reserved and that no trigger of the @@ -202666,13 +195227,13 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 if zName == uintptr(0) { goto trigger_cleanup } - if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+21922, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { + if _sqlite3CheckObjectName(tls, pParse, zName, __ccgo_ts+22085, (*TTable)(unsafe.Pointer(pTab)).FzName) != 0 { goto trigger_cleanup } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { if _sqlite3HashFind(tls, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FpSchema+40, zName) != 0 { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22011, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22174, libc.VaList(bp+64, *(*uintptr)(unsafe.Pointer(bp)))) } else { _sqlite3CodeVerifySchema(tls, pParse, iDb) } @@ -202680,8 +195241,8 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 } } /* Do not create a trigger on a system table */ - if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+7960, int32(7)) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22037, 0) + if Xsqlite3_strnicmp(tls, (*TTable)(unsafe.Pointer(pTab)).FzName, __ccgo_ts+8047, int32(7)) == 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22200, 0) goto trigger_cleanup } /* INSTEAD of triggers are only for views and views only support INSTEAD @@ -202689,15 +195250,15 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 */ if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VIEW) && tr_tm != int32(TK_INSTEAD) { if tr_tm == int32(TK_BEFORE) { - v1 = __ccgo_ts + 22075 + v1 = __ccgo_ts + 22238 } else { - v1 = __ccgo_ts + 22082 + v1 = __ccgo_ts + 22245 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22088, libc.VaList(bp+64, v1, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22251, libc.VaList(bp+64, v1, pTableName+8)) goto trigger_orphan_error } if !(int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VIEW)) && tr_tm == int32(TK_INSTEAD) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22125, libc.VaList(bp+64, pTableName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22288, libc.VaList(bp+64, pTableName+8)) goto trigger_orphan_error } if !(int32((*TParse)(unsafe.Pointer(pParse)).FeParseMode) >= libc.Int32FromInt32(PARSE_MODE_RENAME)) { @@ -202717,9 +195278,9 @@ func _sqlite3BeginTrigger(tls *libc.TLS, pParse uintptr, pName1 uintptr, pName2 goto trigger_cleanup } if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iTabDb == int32(1) { - v3 = __ccgo_ts + 7968 + v3 = __ccgo_ts + 8055 } else { - v3 = __ccgo_ts + 7456 + v3 = __ccgo_ts + 7542 } if _sqlite3AuthCheck(tls, pParse, int32(SQLITE_INSERT), v3, uintptr(0), zDb) != 0 { goto trigger_cleanup @@ -202819,7 +195380,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl pStepList = (*TTriggerStep)(unsafe.Pointer(pStepList)).FpNext } _sqlite3TokenInit(tls, bp+56, (*TTrigger)(unsafe.Pointer(pTrig)).FzName) - _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+21922, bp+56) + _sqlite3FixInit(tls, bp, pParse, iDb, __ccgo_ts+22085, bp+56) if _sqlite3FixTriggerStep(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).Fstep_list) != 0 || _sqlite3FixExpr(tls, bp, (*TTrigger)(unsafe.Pointer(pTrig)).FpWhen) != 0 { goto triggerfinish_cleanup } @@ -202841,7 +195402,7 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl break } if (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget != uintptr(0) && _sqlite3ShadowTableName(tls, db, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22171, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22334, libc.VaList(bp+72, (*TTrigger)(unsafe.Pointer(pTrig)).FzName, (*TTriggerStep)(unsafe.Pointer(pStep)).FzTarget)) goto triggerfinish_cleanup } goto _1 @@ -202857,10 +195418,10 @@ func _sqlite3FinishTrigger(tls *libc.TLS, pParse uintptr, pStepList uintptr, pAl } _sqlite3BeginWriteOperation(tls, pParse, 0, iDb) z = _sqlite3DbStrNDup(tls, db, (*TToken)(unsafe.Pointer(pAll)).Fz, uint64((*TToken)(unsafe.Pointer(pAll)).Fn)) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+22219, libc.VaList(bp+72, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22382, libc.VaList(bp+72, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, zName, (*TTrigger)(unsafe.Pointer(pTrig)).Ftable, z)) _sqlite3DbFree(tls, db, z) _sqlite3ChangeCookie(tls, pParse, iDb) - _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+22294, libc.VaList(bp+72, zName)), uint16(0)) + _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, _sqlite3MPrintf(tls, db, __ccgo_ts+22457, libc.VaList(bp+72, zName)), uint16(0)) } } if (*Tsqlite3)(unsafe.Pointer(db)).Finit1.Fbusy != 0 { @@ -203128,11 +195689,11 @@ func _sqlite3DropTrigger(tls *libc.TLS, pParse uintptr, pName uintptr, noErr int } if !(pTrigger != 0) { if !(noErr != 0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22323, libc.VaList(bp+8, pName+8)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22486, libc.VaList(bp+8, pName+8)) } else { _sqlite3CodeVerifyNamedSchema(tls, pParse, zDb) } - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto drop_trigger_cleanup } _sqlite3DropTriggerPtr(tls, pParse, pTrigger) @@ -203170,9 +195731,9 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { code = int32(SQLITE_DROP_TRIGGER) zDb = (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName if libc.Bool(!(libc.Int32FromInt32(OMIT_TEMPDB) != 0)) && iDb == int32(1) { - v1 = __ccgo_ts + 7968 + v1 = __ccgo_ts + 8055 } else { - v1 = __ccgo_ts + 7456 + v1 = __ccgo_ts + 7542 } zTab = v1 if iDb == int32(1) { @@ -203187,7 +195748,7 @@ func _sqlite3DropTriggerPtr(tls *libc.TLS, pParse uintptr, pTrigger uintptr) { v2 = _sqlite3GetVdbe(tls, pParse) v = v2 if v2 != uintptr(0) { - _sqlite3NestedParse(tls, pParse, __ccgo_ts+22343, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+22506, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp4(tls, v, int32(OP_DropTrigger), iDb, 0, 0, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName, 0) } @@ -203320,11 +195881,11 @@ func _triggersReallyExist(tls *libc.TLS, pParse uintptr, pTab uintptr, op int32, if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { if op != int32(TK_INSERT) { if op == int32(TK_DELETE) { - v1 = __ccgo_ts + 22405 + v1 = __ccgo_ts + 22568 } else { - v1 = __ccgo_ts + 22412 + v1 = __ccgo_ts + 22575 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22419, libc.VaList(bp+8, v1)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22582, libc.VaList(bp+8, v1)) } (*TTrigger)(unsafe.Pointer(p)).Ftr_tm = uint8(TRIGGER_BEFORE) } else { @@ -203426,7 +195987,7 @@ func _isAsteriskTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr) (r int32) { if int32((*TExpr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pTerm)).FpRight)).Fop) != int32(TK_ASTERISK) { return 0 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22467, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22630, 0) return int32(1) } @@ -203574,12 +196135,12 @@ func _sqlite3ProcessReturningSubqueries(tls *libc.TLS, pEList uintptr, pTab uint func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, regIn int32) { bp := tls.Alloc(176) defer tls.Free(176) - var db, pCol, pNew, pReturning, v, v2 uintptr + var db, pCol, pFrom, pNew, pReturning, v, v2 uintptr var i, nCol, reg, v1 int32 - var _ /* sFrom at bp+80 */ TSrcList - var _ /* sNC at bp+136 */ TNameContext + var _ /* fromSpace at bp+76 */ [56]Tu8 + var _ /* sNC at bp+132 */ TNameContext var _ /* sSelect at bp+0 */ TSelect - _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pNew, pReturning, reg, v, v1, v2 + _, _, _, _, _, _, _, _, _, _, _ = db, i, nCol, pCol, pFrom, pNew, pReturning, reg, v, v1, v2 v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe db = (*TParse)(unsafe.Pointer(pParse)).Fdb if !((*TParse)(unsafe.Pointer(pParse)).FbReturning != 0) { @@ -203587,19 +196148,22 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab ** this statement lacks a RETURNING clause. */ return } - pReturning = *(*uintptr)(unsafe.Pointer(pParse + 148)) + pReturning = (*(*struct { + FpReturning uintptr + })(unsafe.Pointer(&(*TParse)(unsafe.Pointer(pParse)).Fu1))).FpReturning if pTrigger != pReturning+8 { /* This RETURNING trigger is for a different statement */ return } libc.Xmemset(tls, bp, 0, uint32(76)) - libc.Xmemset(tls, bp+80, 0, uint32(56)) + pFrom = bp + 76 + libc.Xmemset(tls, pFrom, 0, uint32(libc.UintptrFromInt32(0)+8)+libc.Uint32FromInt64(48)) (*(*TSelect)(unsafe.Pointer(bp))).FpEList = _sqlite3ExprListDup(tls, db, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, 0) - (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = bp + 80 - (*(*TSrcList)(unsafe.Pointer(bp + 80))).FnSrc = int32(1) - (*(*TSrcItem)(unsafe.Pointer(bp + 80 + 8))).FpSTab = pTab - (*(*TSrcItem)(unsafe.Pointer(bp + 80 + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ - (*(*TSrcItem)(unsafe.Pointer(bp + 80 + 8))).FiCursor = -int32(1) + (*(*TSelect)(unsafe.Pointer(bp))).FpSrc = pFrom + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FpSTab = pTab + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FzName = (*TTable)(unsafe.Pointer(pTab)).FzName /* tag-20240424-1 */ + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).FiCursor = -int32(1) _sqlite3SelectPrep(tls, pParse, bp, uintptr(0)) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { _sqlite3GenerateColumnNames(tls, pParse, bp) @@ -203607,24 +196171,24 @@ func _codeReturningTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab _sqlite3ExprListDelete(tls, db, (*(*TSelect)(unsafe.Pointer(bp))).FpEList) pNew = _sqlite3ExpandReturning(tls, pParse, (*TReturning)(unsafe.Pointer(pReturning)).FpReturnEL, pTab) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - libc.Xmemset(tls, bp+136, 0, uint32(36)) + libc.Xmemset(tls, bp+132, 0, uint32(36)) if (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol == 0 { (*TReturning)(unsafe.Pointer(pReturning)).FnRetCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TReturning)(unsafe.Pointer(pReturning)).FiRetCur = v1 } - (*(*TNameContext)(unsafe.Pointer(bp + 136))).FpParse = pParse - *(*int32)(unsafe.Pointer(bp + 136 + 8)) = regIn - (*(*TNameContext)(unsafe.Pointer(bp + 136))).FncFlags = int32(NC_UBaseReg) + (*(*TNameContext)(unsafe.Pointer(bp + 132))).FpParse = pParse + *(*int32)(unsafe.Pointer(bp + 132 + 8)) = regIn + (*(*TNameContext)(unsafe.Pointer(bp + 132))).FncFlags = int32(NC_UBaseReg) (*TParse)(unsafe.Pointer(pParse)).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*TParse)(unsafe.Pointer(pParse)).FpTriggerTab = pTab - if _sqlite3ResolveExprListNames(tls, bp+136, pNew) == SQLITE_OK && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + if _sqlite3ResolveExprListNames(tls, bp+132, pNew) == SQLITE_OK && !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { nCol = (*TExprList)(unsafe.Pointer(pNew)).FnExpr reg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) _sqlite3ProcessReturningSubqueries(tls, pNew, pTab) - *(*int32)(unsafe.Pointer(pParse + 48)) += nCol + int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += nCol + int32(2) (*TReturning)(unsafe.Pointer(pReturning)).FiRetReg = reg i = 0 for { @@ -203692,7 +196256,7 @@ func _codeTriggerProgram(tls *libc.TLS, pParse uintptr, pStepList uintptr, orcon } (*TParse)(unsafe.Pointer(pParse)).FeOrconf = uint8(v2) if (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan != 0 { - _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+7653, libc.VaList(bp+40, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Trace), int32(0x7fffffff), int32(1), 0, _sqlite3MPrintf(tls, db, __ccgo_ts+7739, libc.VaList(bp+40, (*TTriggerStep)(unsafe.Pointer(pStep)).FzSpan)), -int32(6)) } switch int32((*TTriggerStep)(unsafe.Pointer(pStep)).Fop) { case int32(TK_UPDATE): @@ -203743,8 +196307,8 @@ func _transferParseError(tls *libc.TLS, pTo uintptr, pFrom uintptr) { // ** implementing trigger pTrigger with ON CONFLICT policy orconf. // */ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintptr, orconf int32) (r uintptr) { - bp := tls.Alloc(352) - defer tls.Free(352) + bp := tls.Alloc(336) + defer tls.Free(336) var db, pPrg, pProgram, pTop, pWhen, v, v1, v2 uintptr var iEndTrigger int32 var _ /* sNC at bp+0 */ TNameContext @@ -203791,10 +196355,12 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp (*(*TParse)(unsafe.Pointer(bp + 36))).FeTriggerOp = (*TTrigger)(unsafe.Pointer(pTrigger)).Fop (*(*TParse)(unsafe.Pointer(bp + 36))).FnQueryLoop = (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop (*(*TParse)(unsafe.Pointer(bp + 36))).FprepFlags = (*TParse)(unsafe.Pointer(pParse)).FprepFlags + (*(*TParse)(unsafe.Pointer(bp + 36))).Foldmask = uint32(0) + (*(*TParse)(unsafe.Pointer(bp + 36))).Fnewmask = uint32(0) v = _sqlite3GetVdbe(tls, bp+36) if v != 0 { if (*TTrigger)(unsafe.Pointer(pTrigger)).FzName != 0 { - _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+22509, libc.VaList(bp+336, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) + _sqlite3VdbeChangeP4(tls, v, -int32(1), _sqlite3MPrintf(tls, db, __ccgo_ts+22672, libc.VaList(bp+328, (*TTrigger)(unsafe.Pointer(pTrigger)).FzName)), -int32(6)) } /* If one was specified, code the WHEN clause. If it evaluates to false ** (or NULL) the sub-vdbe is immediately halted by jumping to the @@ -203816,7 +196382,7 @@ func _codeRowTrigger(tls *libc.TLS, pParse uintptr, pTrigger uintptr, pTab uintp _sqlite3VdbeAddOp0(tls, v, int32(OP_Halt)) _transferParseError(tls, pParse, bp+36) if (*TParse)(unsafe.Pointer(pParse)).FnErr == 0 { - (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+108) + (*TSubProgram)(unsafe.Pointer(pProgram)).FaOp = _sqlite3VdbeTakeOpArray(tls, v, pProgram+4, pTop+96) } (*TSubProgram)(unsafe.Pointer(pProgram)).FnMem = (*(*TParse)(unsafe.Pointer(bp + 36))).FnMem (*TSubProgram)(unsafe.Pointer(pProgram)).FnCsr = (*(*TParse)(unsafe.Pointer(bp + 36))).FnTab @@ -203888,7 +196454,7 @@ func _sqlite3CodeRowTriggerDirect(tls *libc.TLS, pParse uintptr, p uintptr, pTab ** is a pointer to the sub-vdbe containing the trigger program. */ if pPrg != 0 { bRecursive = libc.BoolInt32((*TTrigger)(unsafe.Pointer(p)).FzName != 0 && uint64(0) == (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Fflags&uint64(SQLITE_RecTriggers)) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) _sqlite3VdbeAddOp4(tls, v, int32(OP_Program), reg, ignoreJump, v1, (*TTriggerPrg)(unsafe.Pointer(pPrg)).FpProgram, -int32(4)) @@ -204304,13 +196870,13 @@ func _updateFromSelect(tls *libc.TLS, pParse uintptr, iEph int32, pPk uintptr, p func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges uintptr, pWhere uintptr, onError int32, pOrderBy uintptr, pLimit uintptr, pUpsert uintptr) { bp := tls.Alloc(96) defer tls.Free(96) - var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v11, v16, v19, v21, v24, v26, v29, v31, v34, v37, v39, v4, v5 uintptr - var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v15, v18, v2, v20, v22, v23, v25, v27, v28, v3, v30, v32, v33, v35, v36, v38, v41, v46, v48, v49 int32 - var chngKey, chngPk, chngRowid, hCol, v8 Tu8 + var aRegIdx, aToOpen, aXRef, db, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, v, v10, v15, v18, v20, v23, v25, v28, v30, v33, v36, v38, v4, v5 uintptr + var addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, newmask, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v1, v14, v17, v19, v2, v21, v22, v24, v26, v27, v29, v3, v31, v32, v34, v35, v37, v40, v45, v47, v48 int32 + var chngKey, chngPk, chngRowid, v8 Tu8 var colFlags, oldmask Tu32 var nPk Ti16 - var v13 uint64 - var v43 uint32 + var v12 uint64 + var v42 uint32 var _ /* aiCurOnePass at bp+48 */ [2]int32 var _ /* bReplace at bp+56 */ int32 var _ /* iNotUsed1 at bp+60 */ int32 @@ -204318,21 +196884,21 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui var _ /* sContext at bp+0 */ TAuthContext var _ /* sNC at bp+8 */ TNameContext var _ /* tmask at bp+44 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hCol, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v11, v13, v15, v16, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v41, v43, v46, v48, v49, v5, v8 /* The table to be updated */ - addrTop = 0 /* VDBE instruction address of the start of the loop */ - pWInfo = uintptr(0) /* The database structure */ - aRegIdx = uintptr(0) /* Registers for to each index and the main table */ - aXRef = uintptr(0) /* Either chngPk or chngRowid */ - pRowidExpr = uintptr(0) /* Expression defining the new record number */ - iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ - iEph = 0 /* Ephemeral table holding all primary key values */ - nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ - addrOpen = 0 /* Address of OP_OpenEphemeral */ - iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ - nPk = 0 /* Number of components of the PRIMARY KEY */ - *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* True if REPLACE conflict resolution might happen */ - bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ - nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aRegIdx, aToOpen, aXRef, addrOnce, addrOpen, addrTop, bFinishSeek, bProgress, chngKey, chngPk, chngRowid, colFlags, db, eOnePass, flags, hasFK, i, iBaseCur, iCur, iDataCur, iDb, iEph, iIdxCur, iPk, iRowidExpr, isView, j, k, labelBreak, labelContinue, nAllIdx, nChangeFrom, nEphCol, nIdx, nKey, nOff, nPk, newmask, oldmask, pIdx, pKeyInfo, pPk, pRowidExpr, pTab, pTrigger, pWInfo, rc, reg, regKey, regNew, regNewRowid, regOld, regOldRowid, regRowCount, regRowSet, v, v1, v10, v12, v14, v15, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v40, v42, v45, v47, v48, v5, v8 /* The table to be updated */ + addrTop = 0 /* VDBE instruction address of the start of the loop */ + pWInfo = uintptr(0) /* The database structure */ + aRegIdx = uintptr(0) /* Registers for to each index and the main table */ + aXRef = uintptr(0) /* Either chngPk or chngRowid */ + pRowidExpr = uintptr(0) /* Expression defining the new record number */ + iRowidExpr = -int32(1) /* Mask of NEW.* columns accessed by BEFORE triggers */ + iEph = 0 /* Ephemeral table holding all primary key values */ + nKey = 0 /* The write cursors opened by WHERE_ONEPASS */ + addrOpen = 0 /* Address of OP_OpenEphemeral */ + iPk = 0 /* First of nPk cells holding PRIMARY KEY value */ + nPk = 0 /* Number of components of the PRIMARY KEY */ + *(*int32)(unsafe.Pointer(bp + 56)) = 0 /* True if REPLACE conflict resolution might happen */ + bFinishSeek = int32(1) /* The OP_FinishSeek opcode is needed */ + nChangeFrom = 0 /* If there is a FROM, pChanges->nExpr, else 0 */ /* Register Allocations */ regRowCount = 0 /* A count of rows changed */ regOldRowid = 0 /* The old rowid */ @@ -204379,7 +196945,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** need to occur right after the database cursor. So go ahead and ** allocate enough space, just in case. */ - v4 = pParse + 44 + v4 = pParse + 48 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ v2 = v3 @@ -204462,58 +197028,46 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui if !(i < (*TExprList)(unsafe.Pointer(pChanges)).FnExpr) { break } - hCol = _sqlite3StrIHash(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) /* If this is an UPDATE with a FROM clause, do not resolve expressions ** here. The call to sqlite3Select() below will do that. */ if nChangeFrom == 0 && _sqlite3ResolveExprNames(tls, bp+8, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr) != 0 { goto update_cleanup } - j = 0 - for { - if !(j < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FhName) == int32(hCol) && _sqlite3StrICmp(tls, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) == 0 { - if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { - chngRowid = uint8(1) - pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr - iRowidExpr = i + j = _sqlite3ColumnIndex(tls, pTab, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) + if j >= 0 { + if j == int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) { + chngRowid = uint8(1) + pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr + iRowidExpr = i + } else { + if pPk != 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { + chngPk = uint8(1) } else { - if pPk != 0 && int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0 { - chngPk = uint8(1) - } else { - if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22523, libc.VaList(bp+80, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) - goto update_cleanup - } + if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FcolFlags)&int32(COLFLAG_GENERATED) != 0 { + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22686, libc.VaList(bp+80, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName)) + goto update_cleanup } } - *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i - break } - goto _10 - _10: - ; - j++ - } - if j >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + *(*int32)(unsafe.Pointer(aXRef + uintptr(j)*4)) = i + } else { if pPk == uintptr(0) && _sqlite3IsRowid(tls, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName) != 0 { j = -int32(1) chngRowid = uint8(1) pRowidExpr = (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FpExpr iRowidExpr = i } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22559, libc.VaList(bp+80, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName)) - (*TParse)(unsafe.Pointer(pParse)).FcheckSchema = uint8(1) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22722, libc.VaList(bp+80, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(i)*20))).FzEName)) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 3, 0x8) goto update_cleanup } } if j < 0 { - v11 = __ccgo_ts + 9401 + v10 = __ccgo_ts + 9488 } else { - v11 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName + v10 = (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(j)*12))).FzCnName } - rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v11, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) + rc = _sqlite3AuthCheck(tls, pParse, int32(SQLITE_UPDATE), (*TTable)(unsafe.Pointer(pTab)).FzName, v10, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName) if rc == int32(SQLITE_DENY) { goto update_cleanup } else { @@ -204543,17 +197097,17 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) >= 0 { - goto _12 + goto _11 } if int32((*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(i)*12))).FcolFlags)&int32(COLFLAG_GENERATED) == 0 { - goto _12 + goto _11 } if _sqlite3ExprReferencesUpdatedColumn(tls, _sqlite3ColumnExpr(tls, pTab, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(i)*12), aXRef, int32(chngRowid)) != 0 { *(*int32)(unsafe.Pointer(aXRef + uintptr(i)*4)) = int32(99999) bProgress = int32(1) } - goto _12 - _12: + goto _11 + _11: ; i++ } @@ -204565,11 +197119,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table implementation makes all columns available). */ if int32((*TTable)(unsafe.Pointer(pTab)).FeTabType) == int32(TABTYP_VTAB) { - v13 = uint64(-libc.Int32FromInt32(1)) + v12 = uint64(-libc.Int32FromInt32(1)) } else { - v13 = uint64(0) + v12 = uint64(0) } - (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v13 + (*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FcolUsed = v12 hasFK = _sqlite3FkRequired(tls, pParse, pTab, aXRef, int32(chngKey)) /* There is one entry in the aRegIdx[] array for each index on the table ** being updated. Fill in aRegIdx[] with a register number that will hold @@ -204585,11 +197139,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if chngKey != 0 || hasFK > int32(1) || pIdx == pPk || _indexWhereClauseMightChange(tls, pIdx, aXRef, int32(chngRowid)) != 0 { - v16 = pParse + 48 - *(*int32)(unsafe.Pointer(v16))++ - v15 = *(*int32)(unsafe.Pointer(v16)) - reg = v15 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v15 = pParse + 52 + *(*int32)(unsafe.Pointer(v15))++ + v14 = *(*int32)(unsafe.Pointer(v15)) + reg = v14 + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) } else { reg = 0 i = 0 @@ -204598,18 +197152,18 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui break } if _indexColumnIsBeingUpdated(tls, pIdx, i, aXRef, int32(chngRowid)) != 0 { - v19 = pParse + 48 - *(*int32)(unsafe.Pointer(v19))++ - v18 = *(*int32)(unsafe.Pointer(v19)) - reg = v18 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) + v18 = pParse + 52 + *(*int32)(unsafe.Pointer(v18))++ + v17 = *(*int32)(unsafe.Pointer(v18)) + reg = v17 + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn) if onError == int32(OE_Default) && int32((*TIndex)(unsafe.Pointer(pIdx)).FonError) == int32(OE_Replace) { *(*int32)(unsafe.Pointer(bp + 56)) = int32(1) } break } - goto _17 - _17: + goto _16 + _16: ; i++ } @@ -204618,16 +197172,16 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui *(*Tu8)(unsafe.Pointer(aToOpen + uintptr(nAllIdx+int32(1)))) = uint8(0) } *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = reg - goto _14 - _14: + goto _13 + _13: ; pIdx = (*TIndex)(unsafe.Pointer(pIdx)).FpNext nAllIdx++ } - v21 = pParse + 48 - *(*int32)(unsafe.Pointer(v21))++ - v20 = *(*int32)(unsafe.Pointer(v21)) - *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v20 /* Register storing the table record */ + v20 = pParse + 52 + *(*int32)(unsafe.Pointer(v20))++ + v19 = *(*int32)(unsafe.Pointer(v20)) + *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) = v19 /* Register storing the table record */ if *(*int32)(unsafe.Pointer(bp + 56)) != 0 { /* If REPLACE conflict resolution might be invoked, open cursors on all ** indexes in case they are needed to delete records. */ @@ -204645,24 +197199,24 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** table record is written. regRowSet holds the RowSet for the ** two-pass update algorithm. */ regRowSet = *(*int32)(unsafe.Pointer(aRegIdx + uintptr(nAllIdx)*4)) - v24 = pParse + 48 - *(*int32)(unsafe.Pointer(v24))++ - v23 = *(*int32)(unsafe.Pointer(v24)) - v22 = v23 - regNewRowid = v22 - regOldRowid = v22 + v23 = pParse + 52 + *(*int32)(unsafe.Pointer(v23))++ + v22 = *(*int32)(unsafe.Pointer(v23)) + v21 = v22 + regNewRowid = v21 + regOldRowid = v21 if chngPk != 0 || pTrigger != 0 || hasFK != 0 { regOld = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } if chngKey != 0 || pTrigger != 0 || hasFK != 0 { - v26 = pParse + 48 - *(*int32)(unsafe.Pointer(v26))++ - v25 = *(*int32)(unsafe.Pointer(v26)) - regNewRowid = v25 + v25 = pParse + 52 + *(*int32)(unsafe.Pointer(v25))++ + v24 = *(*int32)(unsafe.Pointer(v25)) + regNewRowid = v24 } regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } /* Start the view context. */ if isView != 0 { @@ -204688,50 +197242,50 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui goto update_cleanup } /* Jump to labelBreak to abandon further processing of this UPDATE */ - v27 = _sqlite3VdbeMakeLabel(tls, pParse) - labelBreak = v27 - labelContinue = v27 + v26 = _sqlite3VdbeMakeLabel(tls, pParse) + labelBreak = v26 + labelContinue = v26 /* Not an UPSERT. Normal processing. Begin by ** initialize the count of updated rows */ if (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00001))<= 0 { if nChangeFrom != 0 { if isView != 0 { - v46 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) + v45 = int32((*TTable)(unsafe.Pointer(pTab)).FnCol) } else { - v46 = int32(nPk) + v45 = int32(nPk) } - nOff = v46 + nOff = v45 _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iEph, nOff+j, k) } else { _sqlite3ExprCode(tls, pParse, (*(*TExprList_item)(unsafe.Pointer(pChanges + 8 + uintptr(j)*20))).FpExpr, k) @@ -205029,8 +197583,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } } } - goto _45 - _45: + goto _44 + _44: ; i++ k++ @@ -205080,8 +197634,8 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui _sqlite3ExprCodeGetColumnOfTable(tls, v, pTab, iDataCur, i, k) } } - goto _47 - _47: + goto _46 + _46: ; i++ k++ @@ -205128,11 +197682,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** is the column index supplied by the user. */ if hasFK > int32(1) || chngKey != 0 { - v48 = 0 + v47 = 0 } else { - v48 = int32(OPFLAG_ISNOOP) + v47 = int32(OPFLAG_ISNOOP) } - _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v48, regNewRowid) + _sqlite3VdbeAddOp3(tls, v, int32(OP_Delete), iDataCur, int32(OPFLAG_ISUPDATE)|v47, regNewRowid) if eOnePass == int32(ONEPASS_MULTI) { _sqlite3VdbeChangeP5(tls, v, uint16(OPFLAG_SAVEPOSITION)) } @@ -205144,11 +197698,11 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui } /* Insert the new index entries and the new record. */ if eOnePass == int32(ONEPASS_MULTI) { - v49 = int32(OPFLAG_SAVEPOSITION) + v48 = int32(OPFLAG_SAVEPOSITION) } else { - v49 = 0 + v48 = 0 } - _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v49, 0, 0) + _sqlite3CompleteInsertion(tls, pParse, pTab, iDataCur, iIdxCur, regNewRowid, aRegIdx, int32(OPFLAG_ISUPDATE)|v48, 0, 0) /* Do any ON CASCADE, SET NULL or SET DEFAULT operations required to ** handle rows (possibly in other tables) that refer via a foreign key ** to the row just updated. */ @@ -205191,7 +197745,7 @@ func _sqlite3Update(tls *libc.TLS, pParse uintptr, pTabList uintptr, pChanges ui ** that information. */ if regRowCount != 0 { - _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22578) + _sqlite3CodeChangeCount(tls, v, regRowCount, __ccgo_ts+22741) } goto update_cleanup update_cleanup: @@ -205248,13 +197802,13 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp /* Allocate nArg registers in which to gather the arguments for VUpdate. Then ** create and open the ephemeral table in which the records created from ** these arguments will be temporarily stored. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ ephemTab = v1 addr = _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), ephemTab, nArg) regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nArg + *(*int32)(unsafe.Pointer(pParse + 52)) += nArg if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > int32(1) { pPk = uintptr(0) if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { @@ -205296,11 +197850,11 @@ func _updateVirtualTable(tls *libc.TLS, pParse uintptr, pSrc uintptr, pTab uintp _sqlite3ExprListDelete(tls, db, pList) eOnePass = ONEPASS_OFF } else { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) regRec = v4 - v7 = pParse + 48 + v7 = pParse + 52 *(*int32)(unsafe.Pointer(v7))++ v6 = *(*int32)(unsafe.Pointer(v7)) regRowid = v6 @@ -205625,9 +198179,9 @@ func _sqlite3UpsertAnalyzeTarget(tls *libc.TLS, pParse uintptr, pTabList uintptr if nClause == 0 && (*TUpsert)(unsafe.Pointer(pUpsert)).FpNextUpsert == uintptr(0) { (*(*[16]int8)(unsafe.Pointer(bp + 140)))[0] = 0 } else { - Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+22591, libc.VaList(bp+168, nClause+int32(1))) + Xsqlite3_snprintf(tls, int32(16), bp+140, __ccgo_ts+22754, libc.VaList(bp+168, nClause+int32(1))) } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22595, libc.VaList(bp+168, bp+140)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+22758, libc.VaList(bp+168, bp+140)) return int32(SQLITE_ERROR) } goto _1 @@ -205716,13 +198270,13 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) iPk = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPk + *(*int32)(unsafe.Pointer(pParse + 52)) += nPk i = 0 for { if !(i < nPk) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(i)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iCur, k, iPk+i) goto _1 _1: @@ -205730,7 +198284,7 @@ func _sqlite3UpsertDoUpdate(tls *libc.TLS, pParse uintptr, pUpsert uintptr, pTab i++ } i = _sqlite3VdbeAddOp4Int(tls, v, int32(OP_Found), iDataCur, 0, iPk, nPk) - _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+13966, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_Halt), int32(SQLITE_CORRUPT), int32(OE_Abort), 0, __ccgo_ts+14082, -int32(1)) _sqlite3MayAbort(tls, pParse) _sqlite3VdbeJumpHere(tls, v, i) } @@ -205812,7 +198366,7 @@ func _execSql(tls *libc.TLS, db uintptr, pzErrMsg uintptr, zSql uintptr) (r int3 ** corrupt the sqlite_schema.sql field with other kinds of statements ** then run VACUUM to get those statements to execute at inappropriate ** times. */ - if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22668, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22672, uint32(3)) == 0) { + if zSubSql != 0 && (libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22831, uint32(3)) == 0 || libc.Xstrncmp(tls, zSubSql, __ccgo_ts+22835, uint32(3)) == 0) { rc = _execSql(tls, db, pzErrMsg, zSubSql) if rc != SQLITE_OK { break @@ -205903,7 +198457,7 @@ func _sqlite3Vacuum(tls *libc.TLS, pParse uintptr, _pNm uintptr, pInto uintptr) if iDb != int32(1) { iIntoReg = 0 if pInto != 0 && _sqlite3ResolveSelfReference(tls, pParse, uintptr(0), 0, pInto, uintptr(0)) == 0 { - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iIntoReg = v1 @@ -205942,24 +198496,24 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p pDb = uintptr(0) /* Name of output file */ pgflags = uint32(PAGER_SYNCHRONOUS_OFF) /* Name of the ATTACH-ed database used for vacuum */ if !((*Tsqlite3)(unsafe.Pointer(db)).FautoCommit != 0) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22676) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22839) return int32(SQLITE_ERROR) /* IMP: R-12218-18073 */ } if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive > int32(1) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22716) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22879) return int32(SQLITE_ERROR) /* IMP: R-15610-35227 */ } saved_openFlags = (*Tsqlite3)(unsafe.Pointer(db)).FopenFlags if pOut != 0 { if Xsqlite3_value_type(tls, pOut) != int32(SQLITE_TEXT) { - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22759) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22922) return int32(SQLITE_ERROR) } zOut = Xsqlite3_value_text(tls, pOut) *(*uint32)(unsafe.Pointer(db + 60)) &= uint32(^libc.Int32FromInt32(SQLITE_OPEN_READONLY)) *(*uint32)(unsafe.Pointer(db + 60)) |= uint32(libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE)) } else { - zOut = __ccgo_ts + 1673 + zOut = __ccgo_ts + 1674 } /* Save the current value of the database flags so that it can be ** restored before returning. Then set the writable-schema flag, and @@ -205969,7 +198523,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p saved_nChange = (*Tsqlite3)(unsafe.Pointer(db)).FnChange saved_nTotalChange = (*Tsqlite3)(unsafe.Pointer(db)).FnTotalChange saved_mTrace = (*Tsqlite3)(unsafe.Pointer(db)).FmTrace - *(*Tu64)(unsafe.Pointer(db + 32)) |= uint64(libc.Int32FromInt32(SQLITE_WriteSchema) | libc.Int32FromInt32(SQLITE_IgnoreChecks)) + *(*Tu64)(unsafe.Pointer(db + 32)) |= uint64(libc.Int32FromInt32(SQLITE_WriteSchema)|libc.Int32FromInt32(SQLITE_IgnoreChecks)) | uint64(libc.Int32FromInt32(0x00040))< 0) { rc = int32(SQLITE_ERROR) - _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22808) + _sqlite3SetString(tls, pzErrMsg, db, __ccgo_ts+22971) goto end_of_vacuum } *(*Tu32)(unsafe.Pointer(db + 24)) |= uint32(DBFLAG_VacuumInto) @@ -206022,7 +198576,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** file. This is done before the sqlite3BtreeGetPageSize(pMain) call below, ** to ensure that we do not try to change the page-size on a WAL database. */ - rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+16348) + rc = _execSql(tls, db, pzErrMsg, __ccgo_ts+16464) if rc != SQLITE_OK { goto end_of_vacuum } @@ -206053,11 +198607,11 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** in the temporary database. */ (*Tsqlite3)(unsafe.Pointer(db)).Finit1.FiDb = uint8(nDb) /* force new CREATE statements into vacuum_db */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22835, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22998, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22943, libc.VaList(bp+80, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23106, libc.VaList(bp+80, zDbMain)) if rc != SQLITE_OK { goto end_of_vacuum } @@ -206066,7 +198620,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** an "INSERT INTO vacuum_db.xxx SELECT * FROM main.xxx;" to copy ** the contents to the temporary database. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+22997, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23160, libc.VaList(bp+80, bp+8, zDbMain, bp+8)) *(*Tu32)(unsafe.Pointer(db + 24)) &= uint32(^libc.Int32FromInt32(DBFLAG_Vacuum)) if rc != SQLITE_OK { goto end_of_vacuum @@ -206076,7 +198630,7 @@ func _sqlite3RunVacuum(tls *libc.TLS, pzErrMsg uintptr, db uintptr, iDb int32, p ** associated storage, so all we have to do is copy their entries ** from the schema table. */ - rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23134, libc.VaList(bp+80, bp+8, zDbMain)) + rc = _execSqlF(tls, db, pzErrMsg, __ccgo_ts+23297, libc.VaList(bp+80, bp+8, zDbMain)) if rc != 0 { goto end_of_vacuum } @@ -206167,39 +198721,6 @@ var _aCopy = [10]uint8{ 8: uint8(BTREE_APPLICATION_ID), } -/************** End of vacuum.c **********************************************/ -/************** Begin file vtab.c ********************************************/ -/* -** 2006 June 10 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -************************************************************************* -** This file contains code used to help implement virtual tables. - */ -/* #include "sqliteInt.h" */ - -/* -** Before a virtual table xCreate() or xConnect() method is invoked, the -** sqlite3.pVtabCtx member variable is set to point to an instance of -** this struct allocated on the stack. It is used by the implementation of -** the sqlite3_declare_vtab() and sqlite3_vtab_config() APIs, both of which -** are invoked only from within xCreate and xConnect methods. - */ -type TVtabCtx1 = struct { - FpVTable uintptr - FpTab uintptr - FpPrior uintptr - FbDeclared int32 -} - -type VtabCtx1 = TVtabCtx1 - // C documentation // // /* @@ -206210,7 +198731,7 @@ type VtabCtx1 = TVtabCtx1 // ** If there already exists a module with zName, replace it with the new one. // ** If pModule==0, then delete the module zName if it exists. // */ -func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r uintptr) { +func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r uintptr) { var nName int32 var pDel, pMod, zCopy uintptr _, _, _, _ = nName, pDel, pMod, zCopy @@ -206229,7 +198750,7 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule (*TModule)(unsafe.Pointer(pMod)).FzName = zCopy (*TModule)(unsafe.Pointer(pMod)).FpModule = pModule (*TModule)(unsafe.Pointer(pMod)).FpAux = pAux - (*TModule)(unsafe.Pointer(pMod)).FxDestroy = xDestroy + (*TModule)(unsafe.Pointer(pMod)).FxDestroy = __ccgo_fp_xDestroy (*TModule)(unsafe.Pointer(pMod)).FpEpoTab = uintptr(0) (*TModule)(unsafe.Pointer(pMod)).FnRefModule = int32(1) } @@ -206254,15 +198775,15 @@ func _sqlite3VtabCreateModule(tls *libc.TLS, db uintptr, zName uintptr, pModule // ** This function implements the sqlite3_create_module() and // ** sqlite3_create_module_v2() interfaces. // */ -func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { +func _createModule(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, xDestroy) + _sqlite3VtabCreateModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) rc = _sqlite3ApiExit(tls, db, rc) - if rc != SQLITE_OK && xDestroy != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, pAux) + if rc != SQLITE_OK && __ccgo_fp_xDestroy != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, pAux) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc @@ -206277,13 +198798,15 @@ func Xsqlite3_create_module(tls *libc.TLS, db uintptr, zName uintptr, pModule ui return _createModule(tls, db, zName, pModule, pAux, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_module_v2_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** External API function used to create a new virtual-table module. // */ -func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, xDestroy uintptr) (r int32) { - return _createModule(tls, db, zName, pModule, pAux, xDestroy) +func Xsqlite3_create_module_v2(tls *libc.TLS, db uintptr, zName uintptr, pModule uintptr, pAux uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createModule(tls, db, zName, pModule, pAux, __ccgo_fp_xDestroy) } // C documentation @@ -206603,7 +199126,7 @@ func _addModuleArgument(tls *libc.TLS, pParse uintptr, pTable uintptr, zArg uint FazArg uintptr Fp uintptr })(unsafe.Pointer(pTable + 44))).FnArg+int32(3) >= *(*int32)(unsafe.Pointer(db + 120 + 2*4)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14196, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+14312, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTable)).FzName)) } azModuleArg = _sqlite3DbRealloc(tls, db, (*(*struct { FnArg int32 @@ -206726,24 +199249,29 @@ func _sqlite3VtabFinishParse(tls *libc.TLS, pParse uintptr, pEnd uintptr) { if pEnd != 0 { (*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fn = uint32(int32((*TToken)(unsafe.Pointer(pEnd)).Fz)-int32((*TParse)(unsafe.Pointer(pParse)).FsNameToken.Fz)) + (*TToken)(unsafe.Pointer(pEnd)).Fn } - zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+23257, libc.VaList(bp+8, pParse+204)) + zStmt = _sqlite3MPrintf(tls, db, __ccgo_ts+23420, libc.VaList(bp+8, pParse+172)) /* A slot for the record has already been allocated in the ** schema table. We just need to update that slot with all ** the information we've collected. ** - ** The VM register number pParse->regRowid holds the rowid of an + ** The VM register number pParse->u1.cr.regRowid holds the rowid of an ** entry in the sqlite_schema table that was created for this vtab ** by sqlite3StartTable(). */ iDb = _sqlite3SchemaToIndex(tls, db, (*TTable)(unsafe.Pointer(pTab)).FpSchema) - _sqlite3NestedParse(tls, pParse, __ccgo_ts+23281, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*TParse)(unsafe.Pointer(pParse)).FregRowid)) + _sqlite3NestedParse(tls, pParse, __ccgo_ts+23444, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(iDb)*16))).FzDbSName, (*TTable)(unsafe.Pointer(pTab)).FzName, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt, (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FregRowid)) v = _sqlite3GetVdbe(tls, pParse) _sqlite3ChangeCookie(tls, pParse, iDb) _sqlite3VdbeAddOp0(tls, v, int32(OP_Expire)) - zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+23380, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) + zWhere = _sqlite3MPrintf(tls, db, __ccgo_ts+23543, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, zStmt)) _sqlite3VdbeAddParseSchemaOp(tls, v, iDb, zWhere, uint16(0)) _sqlite3DbFree(tls, db, zStmt) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) iReg = v1 @@ -206784,7 +199312,7 @@ func _sqlite3VtabArgInit(tls *libc.TLS, pParse uintptr) { func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { var pArg uintptr _ = pArg - pArg = pParse + 268 + pArg = pParse + 264 if (*TToken)(unsafe.Pointer(pArg)).Fz == uintptr(0) { (*TToken)(unsafe.Pointer(pArg)).Fz = (*TToken)(unsafe.Pointer(p)).Fz (*TToken)(unsafe.Pointer(pArg)).Fn = (*TToken)(unsafe.Pointer(p)).Fn @@ -206800,7 +199328,7 @@ func _sqlite3VtabArgExtend(tls *libc.TLS, pParse uintptr, p uintptr) { // ** pointer to the function to invoke is passed as the fourth parameter // ** to this procedure. // */ -func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, xConstruct uintptr, pzErr uintptr) (r int32) { +func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, __ccgo_fp_xConstruct uintptr, pzErr uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var azArg, pCtx, pVTable, zFormat, zModuleName, zType, p6 uintptr @@ -206827,7 +199355,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, break } if (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab == pTab { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23399, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23562, libc.VaList(bp+32, (*TTable)(unsafe.Pointer(pTab)).FzName)) return int32(SQLITE_LOCKED) } goto _1 @@ -206861,7 +199389,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared = 0 (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = bp (*TTable)(unsafe.Pointer(pTab)).FnTabRef++ - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8, bp+16) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConstruct})))(tls, db, (*TModule)(unsafe.Pointer(pMod)).FpAux, nArg, azArg, pVTable+8, bp+16) _sqlite3DeleteTable(tls, db, pTab) (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx = (*(*TVtabCtx)(unsafe.Pointer(bp))).FpPrior if rc == int32(SQLITE_NOMEM) { @@ -206869,9 +199397,9 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, } if SQLITE_OK != rc { if *(*uintptr)(unsafe.Pointer(bp + 16)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23441, libc.VaList(bp+32, zModuleName)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23604, libc.VaList(bp+32, zModuleName)) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+4710, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 16)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+4829, libc.VaList(bp+32, *(*uintptr)(unsafe.Pointer(bp + 16)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 16))) } _sqlite3DbFree(tls, db, pVTable) @@ -206884,7 +199412,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, (*TModule)(unsafe.Pointer(pMod)).FnRefModule++ (*TVTable)(unsafe.Pointer(pVTable)).FnRef = int32(1) if (*(*TVtabCtx)(unsafe.Pointer(bp))).FbDeclared == 0 { - zFormat = __ccgo_ts + 23471 + zFormat = __ccgo_ts + 23634 *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, zFormat, libc.VaList(bp+32, zModuleName)) _sqlite3VtabUnlock(tls, pVTable) rc = int32(SQLITE_ERROR) @@ -206910,7 +199438,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { break } - zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, __ccgo_ts+1673) + zType = _sqlite3ColumnType(tls, (*TTable)(unsafe.Pointer(pTab)).FaCol+uintptr(iCol)*12, __ccgo_ts+1674) i = 0 nType = _sqlite3Strlen30(tls, zType) i = 0 @@ -206918,7 +199446,7 @@ func _vtabCallConstructor(tls *libc.TLS, db uintptr, pTab uintptr, pMod uintptr, if !(i < nType) { break } - if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+18052, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { + if 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+18215, zType+uintptr(i), int32(6)) && (i == 0 || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i-int32(1))))) == int32(' ')) && (int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32('\000') || int32(*(*int8)(unsafe.Pointer(zType + uintptr(i+int32(6))))) == int32(' ')) { break } goto _3 @@ -206999,13 +199527,13 @@ func _sqlite3VtabCallConnect(tls *libc.TLS, pParse uintptr, pTab uintptr) (r int FazArg uintptr Fp uintptr })(unsafe.Pointer(pTab + 44))).FazArg)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23517, libc.VaList(bp+16, zModule)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23680, libc.VaList(bp+16, zModule)) rc = int32(SQLITE_ERROR) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxConnect, bp) if rc != SQLITE_OK { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4710, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4829, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) (*TParse)(unsafe.Pointer(pParse)).Frc = rc } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) @@ -207086,7 +199614,7 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, ** error. Otherwise, do nothing. */ if pMod == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate == uintptr(0) || (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxDestroy == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23517, libc.VaList(bp+8, zMod)) + *(*uintptr)(unsafe.Pointer(pzErr)) = _sqlite3MPrintf(tls, db, __ccgo_ts+23680, libc.VaList(bp+8, zMod)) rc = int32(SQLITE_ERROR) } else { rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer((*TModule)(unsafe.Pointer(pMod)).FpModule)).FxCreate, pzErr) @@ -207110,13 +199638,13 @@ func _sqlite3VtabCallCreate(tls *libc.TLS, db uintptr, iDb int32, zTab uintptr, // ** virtual table module. // */ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r int32) { - bp := tls.Alloc(320) - defer tls.Free(320) + bp := tls.Alloc(304) + defer tls.Free(304) var i, initBusy, rc int32 var pCtx, pIdx, pNew, pTab, z, v3 uintptr var v2 Ti16 var _ /* sParse at bp+0 */ TParse - var _ /* tokenType at bp+288 */ int32 + var _ /* tokenType at bp+284 */ int32 _, _, _, _, _, _, _, _, _, _ = i, initBusy, pCtx, pIdx, pNew, pTab, rc, z, v2, v3 rc = SQLITE_OK /* Verify that the first two keywords in the CREATE TABLE statement @@ -207129,12 +199657,12 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i if !(_aKeyword1[i] != 0) { break } - *(*int32)(unsafe.Pointer(bp + 288)) = 0 - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 288)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp + 288)) == int32(TK_COMMENT) { - z += uintptr(_sqlite3GetToken(tls, z, bp+288)) + *(*int32)(unsafe.Pointer(bp + 284)) = 0 + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp + 284)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp + 284)) == int32(TK_COMMENT) { + z += uintptr(_sqlite3GetToken(tls, z, bp+284)) } - if *(*int32)(unsafe.Pointer(bp + 288)) != int32(_aKeyword1[i]) { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+23536, 0) + if *(*int32)(unsafe.Pointer(bp + 284)) != int32(_aKeyword1[i]) { + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+23699, 0) return int32(SQLITE_ERROR) } goto _1 @@ -207145,9 +199673,9 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pCtx = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(pCtx != 0) || (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared != 0 { - _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(157359))) + _sqlite3Error(tls, db, _sqlite3MisuseError(tls, int32(158400))) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - return _sqlite3MisuseError(tls, int32(157361)) + return _sqlite3MisuseError(tls, int32(158402)) } pTab = (*TVtabCtx)(unsafe.Pointer(pCtx)).FpTab _sqlite3ParseObjectInit(tls, bp, db) @@ -207189,11 +199717,11 @@ func Xsqlite3_declare_vtab(tls *libc.TLS, db uintptr, zCreateTable uintptr) (r i (*TVtabCtx)(unsafe.Pointer(pCtx)).FbDeclared = int32(1) } else { if (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg != 0 { - v3 = __ccgo_ts + 4710 + v3 = __ccgo_ts + 4829 } else { v3 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), v3, libc.VaList(bp+304, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), v3, libc.VaList(bp+296, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg)) _sqlite3DbFree(tls, db, (*(*TParse)(unsafe.Pointer(bp))).FzErrMsg) rc = int32(SQLITE_ERROR) } @@ -207603,7 +200131,7 @@ func _sqlite3VtabMakeWritable(tls *libc.TLS, pParse uintptr, pTab uintptr) { apVtabLock = _sqlite3Realloc(tls, (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock, uint64(n)) if apVtabLock != 0 { (*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock = apVtabLock - v4 = pToplevel + 228 + v4 = pToplevel + 224 v3 = *(*int32)(unsafe.Pointer(v4)) *(*int32)(unsafe.Pointer(v4))++ *(*uintptr)(unsafe.Pointer((*TParse)(unsafe.Pointer(pToplevel)).FapVtabLock + uintptr(v3)*4)) = pTab @@ -207645,7 +200173,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) if (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != uintptr(0) && (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxCreate != (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect { return 0 } - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return 0 } @@ -207665,7 +200193,7 @@ func _sqlite3VtabEponymousTableInit(tls *libc.TLS, pParse uintptr, pMod uintptr) _addModuleArgument(tls, pParse, pTab, _sqlite3DbStrDup(tls, db, (*TTable)(unsafe.Pointer(pTab)).FzName)) rc = _vtabCallConstructor(tls, db, pTab, pMod, (*Tsqlite3_module)(unsafe.Pointer(pModule)).FxConnect, bp) if rc != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4710, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+4829, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) _sqlite3VtabEponymousTableClear(tls, db, pMod) } @@ -207729,7 +200257,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) p = (*Tsqlite3)(unsafe.Pointer(db)).FpVtabCtx if !(p != 0) { - rc = _sqlite3MisuseError(tls, int32(157856)) + rc = _sqlite3MisuseError(tls, int32(158897)) } else { ap = va switch op { @@ -207742,7 +200270,7 @@ func Xsqlite3_vtab_config(tls *libc.TLS, db uintptr, op int32, va uintptr) (r in case int32(SQLITE_VTAB_USES_ALL_SCHEMAS): (*TVTable)(unsafe.Pointer((*TVtabCtx)(unsafe.Pointer(p)).FpVTable)).FbAllSchemas = uint8(1) default: - rc = _sqlite3MisuseError(tls, int32(157878)) + rc = _sqlite3MisuseError(tls, int32(158919)) break } _ = ap @@ -208018,454 +200546,6 @@ type TWhereRightJoin = struct { type WhereRightJoin = TWhereRightJoin -/* -** This object is a header on a block of allocated memory that will be -** automatically freed when its WInfo object is destructed. - */ -type TWhereMemBlock1 = struct { - F__ccgo_align [0]uint32 - FpNext uintptr - F__ccgo_align1 [4]byte - Fsz Tu64 -} - -type WhereMemBlock1 = TWhereMemBlock1 - -/* -** Extra information attached to a WhereLevel that is a RIGHT JOIN. - */ -type TWhereRightJoin1 = struct { - FiMatch int32 - FregBloom int32 - FregReturn int32 - FaddrSubrtn int32 - FendSubrtn int32 -} - -type WhereRightJoin1 = TWhereRightJoin1 - -/* -** This object contains information needed to implement a single nested -** loop in WHERE clause. -** -** Contrast this object with WhereLoop. This object describes the -** implementation of the loop. WhereLoop describes the algorithm. -** This object contains a pointer to the WhereLoop algorithm as one of -** its elements. -** -** The WhereInfo object contains a single instance of this object for -** each term in the FROM clause (which is to say, for each of the -** nested loops as implemented). The order of WhereLevel objects determines -** the loop nested order, with WhereInfo.a[0] being the outer loop and -** WhereInfo.a[WhereInfo.nLevel-1] being the inner loop. - */ -type TWhereLevel1 = struct { - F__ccgo_align [0]uint32 - FiLeftJoin int32 - FiTabCur int32 - FiIdxCur int32 - FaddrBrk int32 - FaddrNxt int32 - FaddrSkip int32 - FaddrCont int32 - FaddrFirst int32 - FaddrBody int32 - FregBignull int32 - FaddrBignull int32 - FregFilter int32 - FpRJ uintptr - FiFrom Tu8 - Fop Tu8 - Fp3 Tu8 - Fp5 Tu8 - Fp1 int32 - Fp2 int32 - Fu struct { - FpCoveringIdx [0]uintptr - Fin struct { - FnIn int32 - FaInLoop uintptr - } - } - FpWLoop uintptr - F__ccgo_align21 [4]byte - FnotReady TBitmask -} - -type WhereLevel1 = TWhereLevel1 - -/* -** Each instance of this object represents an algorithm for evaluating one -** term of a join. Every term of the FROM clause will have at least -** one corresponding WhereLoop object (unless INDEXED BY constraints -** prevent a query solution - which is an error) and many terms of the -** FROM clause will have multiple WhereLoop objects, each describing a -** potential way of implementing that FROM-clause term, together with -** dependencies and cost estimates for using the chosen algorithm. -** -** Query planning consists of building up a collection of these WhereLoop -** objects, then computing a particular sequence of WhereLoop objects, with -** one WhereLoop object per FROM clause term, that satisfy all dependencies -** and that minimize the overall cost. - */ -type TWhereLoop1 = struct { - F__ccgo_align [0]uint32 - Fprereq TBitmask - FmaskSelf TBitmask - FiTab Tu8 - FiSortIdx Tu8 - FrSetup TLogEst - FrRun TLogEst - FnOut TLogEst - Fu struct { - Fvtab [0]struct { - FidxNum int32 - F__ccgo4 uint8 - FisOrdered Ti8 - FomitMask Tu16 - FidxStr uintptr - FmHandleIn Tu32 - } - Fbtree struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - } - } - FwsFlags Tu32 - FnLTerm Tu16 - FnSkip Tu16 - FnLSlot Tu16 - FaLTerm uintptr - FpNextLoop uintptr - FaLTermSpace [3]uintptr -} - -type WhereLoop1 = TWhereLoop1 - -/* This object holds the prerequisites and the cost of running a -** subquery on one operand of an OR operator in the WHERE clause. -** See WhereOrSet for additional information - */ -type TWhereOrCost1 = struct { - F__ccgo_align [0]uint32 - Fprereq TBitmask - FrRun TLogEst - FnOut TLogEst - F__ccgo_pad3 [4]byte -} - -type WhereOrCost1 = TWhereOrCost1 - -/* The WhereOrSet object holds a set of possible WhereOrCosts that -** correspond to the subquery(s) of OR-clause processing. Only the -** best N_OR_COST elements are retained. - */ -type TWhereOrSet1 = struct { - F__ccgo_align [0]uint32 - Fn Tu16 - F__ccgo_align1 [6]byte - Fa [3]TWhereOrCost -} - -type WhereOrSet1 = TWhereOrSet1 - -/* -** Each instance of this object holds a sequence of WhereLoop objects -** that implement some or all of a query plan. -** -** Think of each WhereLoop object as a node in a graph with arcs -** showing dependencies and costs for travelling between nodes. (That is -** not a completely accurate description because WhereLoop costs are a -** vector, not a scalar, and because dependencies are many-to-one, not -** one-to-one as are graph nodes. But it is a useful visualization aid.) -** Then a WherePath object is a path through the graph that visits some -** or all of the WhereLoop objects once. -** -** The "solver" works by creating the N best WherePath objects of length -** 1. Then using those as a basis to compute the N best WherePath objects -** of length 2. And so forth until the length of WherePaths equals the -** number of nodes in the FROM clause. The best (lowest cost) WherePath -** at the end is the chosen query plan. - */ -type TWherePath1 = struct { - F__ccgo_align [0]uint32 - FmaskLoop TBitmask - FrevLoop TBitmask - FnRow TLogEst - FrCost TLogEst - FrUnsort TLogEst - FisOrdered Ti8 - FaLoop uintptr - F__ccgo_pad7 [4]byte -} - -type WherePath1 = TWherePath1 - -/* -** The query generator uses an array of instances of this structure to -** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators, -** usually, or sometimes subexpressions separated by OR. -** -** All WhereTerms are collected into a single WhereClause structure. -** The following identity holds: -** -** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm -** -** When a term is of the form: -** -** X -** -** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records -** the using a bitmask encoding defined by WO_xxx below. The -** use of a bitmask encoding for the operator allows us to search -** quickly for terms that match any of several different operators. -** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag has the TERM_ORINFO bit set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the OR clause. -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates -** cursor number into bits and the translated bit is stored in the prereq -** fields. The translation is used in order to maximize the number of -** bits that will fit in a Bitmask. The VDBE cursor numbers might be -** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet -** translates these sparse cursor numbers into consecutive integers -** beginning with 0 in order to make the best possible use of the available -** bits in the Bitmask. So, in the example above, the cursor numbers -** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. - */ -type TWhereTerm1 = struct { - F__ccgo_align [0]uint32 - FpExpr uintptr - FpWC uintptr - FtruthProb TLogEst - FwtFlags Tu16 - FeOperator Tu16 - FnChild Tu8 - FeMatchOp Tu8 - FiParent int32 - FleftCursor int32 - Fu struct { - FpOrInfo [0]uintptr - FpAndInfo [0]uintptr - Fx struct { - FleftColumn int32 - FiField int32 - } - } - FprereqRight TBitmask - FprereqAll TBitmask -} - -type WhereTerm1 = TWhereTerm1 - -/* -** Allowed values of WhereTerm.wtFlags - */ - -/* -** An instance of the WhereScan object is used as an iterator for locating -** terms in the WHERE clause that are useful to the query planner. - */ -type TWhereScan1 = struct { - FpOrigWC uintptr - FpWC uintptr - FzCollName uintptr - FpIdxExpr uintptr - Fk int32 - FopMask Tu32 - Fidxaff int8 - FiEquiv uint8 - FnEquiv uint8 - FaiCur [11]int32 - FaiColumn [11]Ti16 -} - -type WhereScan1 = TWhereScan1 - -/* -** An instance of the following structure holds all information about a -** WHERE clause. Mostly this is a container for one or more WhereTerms. -** -** Explanation of pOuter: For a WHERE clause of the form -** -** a AND ((b AND c) OR (d AND e)) AND f -** -** There are separate WhereClause objects for the whole clause and for -** the subclauses "(b AND c)" and "(d AND e)". The pOuter field of the -** subclauses points to the WhereClause object for the whole clause. - */ -type TWhereClause1 = struct { - F__ccgo_align [0]uint32 - FpWInfo uintptr - FpOuter uintptr - Fop Tu8 - FhasOr Tu8 - FnTerm int32 - FnSlot int32 - FnBase int32 - Fa uintptr - F__ccgo_align8 [4]byte - FaStatic [8]TWhereTerm -} - -type WhereClause1 = TWhereClause1 - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereOrInfo1 = struct { - F__ccgo_align [0]uint32 - Fwc TWhereClause - Findexable TBitmask -} - -type WhereOrInfo1 = TWhereOrInfo1 - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. - */ -type TWhereAndInfo1 = struct { - F__ccgo_align [0]uint32 - Fwc TWhereClause -} - -type WhereAndInfo1 = TWhereAndInfo1 - -/* -** An instance of the following structure keeps track of a mapping -** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. -** -** The VDBE cursor numbers are small integers contained in -** SrcItem.iCursor and Expr.iTable fields. For any given WHERE -** clause, the cursor numbers might not begin with 0 and they might -** contain gaps in the numbering sequence. But we want to make maximum -** use of the bits in our bitmasks. This structure provides a mapping -** from the sparse cursor numbers into consecutive integers beginning -** with 0. -** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask -** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, -** 57->5, 73->4. Or one of 719 other combinations might be used. It -** does not really matter. What is important is that sparse cursor -** numbers all get mapped into bit numbers that begin with 0 and contain -** no gaps. - */ -type TWhereMaskSet1 = struct { - FbVarSelect int32 - Fn int32 - Fix [64]int32 -} - -type WhereMaskSet1 = TWhereMaskSet1 - -/* -** This object is a convenience wrapper holding all information needed -** to construct WhereLoop objects for a particular query. - */ -type TWhereLoopBuilder1 = struct { - FpWInfo uintptr - FpWC uintptr - FpNew uintptr - FpOrSet uintptr - FpRec uintptr - FnRecValid int32 - FbldFlags1 uint8 - FbldFlags2 uint8 - FiPlanLimit uint32 -} - -type WhereLoopBuilder1 = TWhereLoopBuilder1 - -/* Allowed values for WhereLoopBuider.bldFlags */ - -/* The WhereLoopBuilder.iPlanLimit is used to limit the number of -** index+constraint combinations the query planner will consider for a -** particular query. If this parameter is unlimited, then certain -** pathological queries can spend excess time in the sqlite3WhereBegin() -** routine. The limit is high enough that is should not impact real-world -** queries. -** -** SQLITE_QUERY_PLANNER_LIMIT is the baseline limit. The limit is -** increased by SQLITE_QUERY_PLANNER_LIMIT_INCR before each term of the FROM -** clause is processed, so that every table in a join is guaranteed to be -** able to propose a some index+constraint combinations even if the initial -** baseline limit was exhausted by prior tables of the join. - */ - -/* -** The WHERE clause processing routine has two halves. The -** first part does the start of the WHERE loop and the second -** half does the tail of the WHERE loop. An instance of -** this structure is returned by the first half and passed -** into the second half to give some continuity. -** -** An instance of this object holds the complete state of the query -** planner. - */ -type TWhereInfo1 = struct { - F__ccgo_align [0]uint32 - FpParse uintptr - FpTabList uintptr - FpOrderBy uintptr - FpResultSet uintptr - FpSelect uintptr - FaiCurOnePass [2]int32 - FiContinue int32 - FiBreak int32 - FsavedNQueryLoop int32 - FwctrlFlags Tu16 - FiLimit TLogEst - FnLevel Tu8 - FnOBSat Ti8 - FeOnePass Tu8 - FeDistinct Tu8 - F__ccgo48 uint8 - FnRowOut TLogEst - FiTop int32 - FiEndWhere int32 - FpLoops uintptr - FpMemToFree uintptr - F__ccgo_align26 [4]byte - FrevMask TBitmask - FsWC TWhereClause - FsMaskSet TWhereMaskSet - Fa [1]TWhereLevel -} - -type WhereInfo1 = TWhereInfo1 - /* ** Bitmasks for the operators on WhereTerm objects. These are all ** operators that are of interest to the query planner. An @@ -208497,10 +200577,10 @@ type WhereInfo1 = TWhereInfo1 func _explainIndexColumnName(tls *libc.TLS, pIdx uintptr, i int32) (r uintptr) { i = int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FaiColumn + uintptr(i)*2))) if i == -int32(2) { - return __ccgo_ts + 23549 + return __ccgo_ts + 23712 } if i == -int32(1) { - return __ccgo_ts + 18161 + return __ccgo_ts + 18324 } return (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pIdx)).FpTable)).FaCol + uintptr(i)*12))).FzCnName } @@ -208519,10 +200599,10 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, var i int32 _ = i if bAnd != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23556, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23719, int32(5)) } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23562, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23725, int32(1)) } i = 0 for { @@ -208530,7 +200610,7 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14586, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14702, int32(1)) } Xsqlite3_str_appendall(tls, pStr, _explainIndexColumnName(tls, pIdx, iTerm+i)) goto _1 @@ -208539,11 +200619,11 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } Xsqlite3_str_append(tls, pStr, zOp, int32(1)) if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23562, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23725, int32(1)) } i = 0 for { @@ -208551,16 +200631,16 @@ func _explainAppendTerm(tls *libc.TLS, pStr uintptr, pIdx uintptr, nTerm int32, break } if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+14586, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+14702, int32(1)) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6482, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6570, int32(1)) goto _2 _2: ; i++ } if nTerm > int32(1) { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } } @@ -208607,7 +200687,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { if int32(nEq) == 0 && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_BTM_LIMIT)|libc.Int32FromInt32(WHERE_TOP_LIMIT)) == uint32(0) { return } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23564, int32(2)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23727, int32(2)) i = 0 for { if !(i < int32(nEq)) { @@ -208615,12 +200695,12 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { } z = _explainIndexColumnName(tls, pIndex, i) if i != 0 { - Xsqlite3_str_append(tls, pStr, __ccgo_ts+23556, int32(5)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+23719, int32(5)) } if i >= int32(nSkip) { - v2 = __ccgo_ts + 23567 + v2 = __ccgo_ts + 23730 } else { - v2 = __ccgo_ts + 23572 + v2 = __ccgo_ts + 23735 } Xsqlite3_str_appendf(tls, pStr, v2, libc.VaList(bp+8, z)) goto _1 @@ -208637,7 +200717,7 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+23580) + })(unsafe.Pointer(pLoop + 24))).FnBtm), j, i, __ccgo_ts+23743) i = int32(1) } if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_TOP_LIMIT) != 0 { @@ -208648,9 +200728,9 @@ func _explainIndexRange(tls *libc.TLS, pStr uintptr, pLoop uintptr) { FnDistinctCol Tu16 FpIndex uintptr FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+23582) + })(unsafe.Pointer(pLoop + 24))).FnTop), j, i, __ccgo_ts+23745) } - Xsqlite3_str_append(tls, pStr, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, pStr, __ccgo_ts+6568, int32(1)) } // C documentation @@ -208695,11 +200775,11 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab _sqlite3StrAccumInit(tls, bp, db, bp+24, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) if isSearch != 0 { - v2 = __ccgo_ts + 23584 + v2 = __ccgo_ts + 23747 } else { - v2 = __ccgo_ts + 23591 + v2 = __ccgo_ts + 23754 } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23596, libc.VaList(bp+136, v2, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23759, libc.VaList(bp+136, v2, pItem)) if flags&uint32(libc.Int32FromInt32(WHERE_IPK)|libc.Int32FromInt32(WHERE_VIRTUALTABLE)) == uint32(0) { zFmt = uintptr(0) pIdx = (*(*struct { @@ -208712,37 +200792,37 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab })(unsafe.Pointer(pLoop + 24))).FpIndex if !((*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pItem)).FpSTab)).FtabFlags&libc.Uint32FromInt32(TF_WithoutRowid) == libc.Uint32FromInt32(0)) && int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x3>>0)) == int32(SQLITE_IDXTYPE_PRIMARYKEY) { if isSearch != 0 { - zFmt = __ccgo_ts + 12749 + zFmt = __ccgo_ts + 12865 } } else { if flags&uint32(WHERE_PARTIALIDX) != 0 { - zFmt = __ccgo_ts + 23602 + zFmt = __ccgo_ts + 23765 } else { if flags&uint32(WHERE_AUTO_INDEX) != 0 { - zFmt = __ccgo_ts + 23635 + zFmt = __ccgo_ts + 23798 } else { if flags&uint32(libc.Int32FromInt32(WHERE_IDX_ONLY)|libc.Int32FromInt32(WHERE_EXPRIDX)) != 0 { - zFmt = __ccgo_ts + 23660 + zFmt = __ccgo_ts + 23823 } else { - zFmt = __ccgo_ts + 23678 + zFmt = __ccgo_ts + 23841 } } } } if zFmt != 0 { - Xsqlite3_str_append(tls, bp, __ccgo_ts+23687, int32(7)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23850, int32(7)) Xsqlite3_str_appendf(tls, bp, zFmt, libc.VaList(bp+136, (*TIndex)(unsafe.Pointer(pIdx)).FzName)) _explainIndexRange(tls, bp, pLoop) } } else { if flags&uint32(WHERE_IPK) != uint32(0) && flags&uint32(WHERE_CONSTRAINT) != uint32(0) { - zRowid = __ccgo_ts + 18161 - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23695, libc.VaList(bp+136, zRowid)) + zRowid = __ccgo_ts + 18324 + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23858, libc.VaList(bp+136, zRowid)) if flags&uint32(libc.Int32FromInt32(WHERE_COLUMN_EQ)|libc.Int32FromInt32(WHERE_COLUMN_IN)) != 0 { cRangeOp = int8('=') } else { if flags&uint32(WHERE_BOTH_LIMIT) == uint32(WHERE_BOTH_LIMIT) { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23726, libc.VaList(bp+136, zRowid)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23889, libc.VaList(bp+136, zRowid)) cRangeOp = int8('<') } else { if flags&uint32(WHERE_BTM_LIMIT) != 0 { @@ -208752,14 +200832,14 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23736, libc.VaList(bp+136, int32(cRangeOp))) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23899, libc.VaList(bp+136, int32(cRangeOp))) } else { if flags&uint32(WHERE_VIRTUALTABLE) != uint32(0) { - Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23741) + Xsqlite3_str_appendall(tls, bp, __ccgo_ts+23904) if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x4>>2)) != 0 { - v3 = __ccgo_ts + 23763 + v3 = __ccgo_ts + 23926 } else { - v3 = __ccgo_ts + 23771 + v3 = __ccgo_ts + 23934 } Xsqlite3_str_appendf(tls, bp, v3, libc.VaList(bp+136, (*(*struct { FidxNum int32 @@ -208780,7 +200860,7 @@ func _sqlite3WhereAddExplainText(tls *libc.TLS, pParse uintptr, addr int32, pTab } } if int32((*TSrcItem)(unsafe.Pointer(pItem)).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23777, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23940, 0) } _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(pOp + 16))) (*TVdbeOp)(unsafe.Pointer(pOp)).Fp4type = int8(-libc.Int32FromInt32(6)) @@ -208810,10 +200890,10 @@ func _sqlite3WhereExplainOneScan(tls *libc.TLS, pParse uintptr, pTabList uintptr v1 = pParse } if int32((*TParse)(unsafe.Pointer(v1)).Fexplain) == int32(2) || libc.Bool(0 != 0) { - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_MULTI_OR) == uint32(0) && int32(wctrlFlags)&int32(WHERE_OR_SUBCLAUSE) == 0 { v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe addr = _sqlite3VdbeCurrentAddr(tls, v) - ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) + ret = _sqlite3VdbeAddOp3(tls, v, int32(OP_Explain), addr, (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FrRun)) _sqlite3WhereAddExplainText(tls, pParse, addr, pTabList, pLevel, wctrlFlags) } } @@ -208846,14 +200926,14 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp db = (*TParse)(unsafe.Pointer(pParse)).Fdb /* Initial space for EQP output string */ _sqlite3StrAccumInit(tls, bp, db, bp+24, int32(100), int32(SQLITE_MAX_LENGTH)) (*(*TStrAccum)(unsafe.Pointer(bp))).FprintfFlags = uint8(SQLITE_PRINTF_INTERNAL) - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23788, libc.VaList(bp+136, pItem)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23951, libc.VaList(bp+136, pItem)) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_IPK) != 0 { pTab = (*TSrcItem)(unsafe.Pointer(pItem)).FpSTab if int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) >= 0 { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23567, libc.VaList(bp+136, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23730, libc.VaList(bp+136, (*(*TColumn)(unsafe.Pointer((*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr((*TTable)(unsafe.Pointer(pTab)).FiPKey)*12))).FzCnName)) } else { - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23809, 0) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23972, 0) } } else { i = int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) @@ -208877,16 +200957,16 @@ func _sqlite3WhereExplainBloomFilter(tls *libc.TLS, pParse uintptr, pWInfo uintp FpOrderBy uintptr })(unsafe.Pointer(pLoop + 24))).FpIndex, i) if i > int32((*TWhereLoop)(unsafe.Pointer(pLoop)).FnSkip) { - Xsqlite3_str_append(tls, bp, __ccgo_ts+23556, int32(5)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+23719, int32(5)) } - Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23567, libc.VaList(bp+136, z)) + Xsqlite3_str_appendf(tls, bp, __ccgo_ts+23730, libc.VaList(bp+136, z)) goto _1 _1: ; i++ } } - Xsqlite3_str_append(tls, bp, __ccgo_ts+6480, int32(1)) + Xsqlite3_str_append(tls, bp, __ccgo_ts+6568, int32(1)) zMsg = _sqlite3StrAccumFinish(tls, bp) ret = _sqlite3VdbeAddOp4(tls, v, int32(OP_Explain), _sqlite3VdbeCurrentAddr(tls, v), (*TParse)(unsafe.Pointer(pParse)).FaddrExplain, 0, zMsg, -int32(6)) return ret @@ -209091,7 +201171,7 @@ func _adjustOrderByCol(tls *libc.TLS, pOrderBy uintptr, pEList uintptr) { // /* // ** pX is an expression of the form: (vector) IN (SELECT ...) // ** In other words, it is a vector IN operator with a SELECT clause on the -// ** LHS. But not all terms in the vector are indexable and the terms might +// ** RHS. But not all terms in the vector are indexable and the terms might // ** not be in the correct order for indexing. // ** // ** This routine makes a copy of the input pX expression and then adjusts @@ -209147,8 +201227,8 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p FiField int32 })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm + uintptr(i)*4)) + 24))).FiField - int32(1) if (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr == uintptr(0) { - goto _2 - } /* Duplicate PK column */ + goto _2 /* Duplicate PK column */ + } pRhs = _sqlite3ExprListAppend(tls, pParse, pRhs, (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr) (*(*TExprList_item)(unsafe.Pointer(pOrigRhs + 8 + uintptr(iField)*20))).FpExpr = uintptr(0) if pRhs != 0 { @@ -209170,7 +201250,7 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p *(*uintptr)(unsafe.Pointer((*TExpr)(unsafe.Pointer(pNew)).FpLeft + 20)) = pLhs } (*TSelect)(unsafe.Pointer(pSelect)).FpEList = pRhs - v4 = pParse + 112 + v4 = pParse + 100 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TSelect)(unsafe.Pointer(pSelect)).FselId = uint32(v3) /* Req'd for SubrtnSig validity */ @@ -209227,10 +201307,10 @@ func _removeUnindexableInClauseTerms(tls *libc.TLS, pParse uintptr, iEq int32, p func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, iEq int32, bRev int32, iTarget int32) { bp := tls.Alloc(16) defer tls.Free(16) - var aiMap, db, pExpr, pIn, pLoop, pX, v uintptr - var eType, i, iCol, iMap, iOut, n, nEq, v3, v4, v6, v7, v8 int32 + var aiMap, db, pIn, pLoop, pX, pXMod, v uintptr + var eType, i, iCol, iMap, iOut, nEq, v3, v5, v6, v7 int32 var _ /* iTab at bp+0 */ int32 - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, n, nEq, pExpr, pIn, pLoop, pX, v, v3, v4, v6, v7, v8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = aiMap, db, eType, i, iCol, iMap, iOut, nEq, pIn, pLoop, pX, pXMod, v, v3, v5, v6, v7 pX = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr eType = int32(IN_INDEX_NOOP) pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop @@ -209285,37 +201365,23 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i if !((*TExpr)(unsafe.Pointer(pX)).Fflags&libc.Uint32FromInt32(EP_xIsSelect) != libc.Uint32FromInt32(0)) || (*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pX + 20)))).FpEList)).FnExpr == int32(1) { eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), uintptr(0), bp) } else { - pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == 0 || !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_Subrtn)) != libc.Uint32FromInt32(0)) { - db = (*TParse)(unsafe.Pointer(pParse)).Fdb - pX = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) - if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*uint32(nEq))) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = *(*int32)(unsafe.Pointer(bp)) - } - _sqlite3ExprDelete(tls, db, pX) - } else { - n = _sqlite3ExprVectorSize(tls, (*TExpr)(unsafe.Pointer(pX)).FpLeft) - if nEq > n { - v3 = nEq - } else { - v3 = n - } - aiMap = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(uint32(4)*uint32(v3))) - eType = _sqlite3FindInIndex(tls, pParse, pX, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) + db = (*TParse)(unsafe.Pointer(pParse)).Fdb + pXMod = _removeUnindexableInClauseTerms(tls, pParse, iEq, pLoop, pX) + if !((*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0) { + aiMap = _sqlite3DbMallocZero(tls, db, uint64(uint32(4)*uint32(nEq))) + eType = _sqlite3FindInIndex(tls, pParse, pXMod, uint32(IN_INDEX_LOOP), uintptr(0), aiMap, bp) } - pX = pExpr + _sqlite3ExprDelete(tls, db, pXMod) } if eType == int32(IN_INDEX_INDEX_DESC) { bRev = libc.BoolInt32(!(bRev != 0)) } if bRev != 0 { - v4 = int32(OP_Last) + v3 = int32(OP_Last) } else { - v4 = int32(OP_Rewind) + v3 = int32(OP_Rewind) } - _sqlite3VdbeAddOp2(tls, v, v4, *(*int32)(unsafe.Pointer(bp)), 0) + _sqlite3VdbeAddOp2(tls, v, v3, *(*int32)(unsafe.Pointer(bp)), 0) *(*Tu32)(unsafe.Pointer(pLoop + 40)) |= uint32(WHERE_IN_ABLE) if (*(*struct { FnIn int32 @@ -209362,24 +201428,24 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp2(tls, v, int32(OP_Rowid), *(*int32)(unsafe.Pointer(bp)), iOut) } else { if aiMap != 0 { - v7 = iMap + v6 = iMap iMap++ - v6 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v7)*4)) + v5 = *(*int32)(unsafe.Pointer(aiMap + uintptr(v6)*4)) } else { - v6 = 0 + v5 = 0 } - iCol = v6 + iCol = v5 (*TInLoop)(unsafe.Pointer(pIn)).FaddrInTop = _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), *(*int32)(unsafe.Pointer(bp)), iCol, iOut) } _sqlite3VdbeAddOp1(tls, v, int32(OP_IsNull), iOut) if i == iEq { (*TInLoop)(unsafe.Pointer(pIn)).FiCur = *(*int32)(unsafe.Pointer(bp)) if bRev != 0 { - v8 = int32(OP_Prev) + v7 = int32(OP_Prev) } else { - v8 = int32(OP_Next) + v7 = int32(OP_Next) } - (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = uint8(v8) + (*TInLoop)(unsafe.Pointer(pIn)).FeEndLoopOp = uint8(v7) if iEq > 0 { (*TInLoop)(unsafe.Pointer(pIn)).FiBase = iTarget - i (*TInLoop)(unsafe.Pointer(pIn)).FnPrefix = i @@ -209391,8 +201457,8 @@ func _codeINTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uintptr, i } pIn += 20 } - goto _5 - _5: + goto _4 + _4: ; i++ } @@ -209450,7 +201516,7 @@ func _codeEqualityTerm(tls *libc.TLS, pParse uintptr, pTerm uintptr, pLevel uint ** not a transitive constraint. For an example of where that does not ** work, see https://sqlite.org/forum/forumpost/eb8613976a (2021-05-04) */ - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags&uint32(WHERE_TRANSCONS) == uint32(0) || int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator)&int32(WO_EQUIV) == 0 { _disableTerm(tls, pLevel, pTerm) } return iReg @@ -209532,7 +201598,7 @@ func _codeAllEqualityTerms(tls *libc.TLS, pParse uintptr, pLevel uintptr, bRev i */ regBase = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) nReg = int32(nEq) + nExtraReg - *(*int32)(unsafe.Pointer(pParse + 48)) += nReg + *(*int32)(unsafe.Pointer(pParse + 52)) += nReg zAff = _sqlite3DbStrDup(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, _sqlite3IndexAffinityStr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pIdx)) if nSkip != 0 { iIdxCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -209800,7 +201866,7 @@ func _filterPullDown(tls *libc.TLS, pParse uintptr, pWInfo uintptr, iLevel int32 if (*TWhereLevel)(unsafe.Pointer(pLevel)).FregFilter == 0 { continue } - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FnSkip != 0 { continue } /* ,--- Because sqlite3ConstructBloomFilter() has will not have set @@ -209945,7 +202011,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** row of the left table of the join. */ if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom) > 0 && int32((*(*TSrcItem)(unsafe.Pointer(pTabItem))).Ffg.Fjointype)&int32(JT_LEFT) != 0 { - v5 = pParse + 48 + v5 = pParse + 52 *(*int32)(unsafe.Pointer(v5))++ v4 = *(*int32)(unsafe.Pointer(v5)) (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin = v4 @@ -210006,11 +202072,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FidxStr uintptr FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FmHandleIn != 0 { - v10 = pParse + 44 + v10 = pParse + 48 v9 = *(*int32)(unsafe.Pointer(v10)) *(*int32)(unsafe.Pointer(v10))++ iTab = v9 - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) iCache = v11 @@ -210041,6 +202107,9 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI FmHandleIn Tu32 })(unsafe.Pointer(pLoop + 24))).FidxNum, iReg) _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), nConstraint, iReg+int32(1)) + /* The instruction immediately prior to OP_VFilter must be an OP_Integer + ** that sets the "argc" value for xVFilter. This is necessary for + ** resolveP2() to work correctly. See tag-20250207a. */ if int32(Tu32(*(*uint8)(unsafe.Pointer(pLoop + 24 + 4))&0x1>>0)) != 0 { v13 = -int32(6) } else { @@ -210179,7 +202248,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** construct. */ pTerm = *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pLoop)).FaLTerm)) - v21 = pParse + 48 + v21 = pParse + 52 *(*int32)(unsafe.Pointer(v21))++ v20 = *(*int32)(unsafe.Pointer(v21)) iReleaseReg = v20 @@ -210259,7 +202328,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if pEnd != 0 { pX1 = (*TWhereTerm)(unsafe.Pointer(pEnd)).FpExpr /* Transitive constraints */ - v28 = pParse + 48 + v28 = pParse + 52 *(*int32)(unsafe.Pointer(v28))++ v27 = *(*int32)(unsafe.Pointer(v28)) memEndValue = v27 @@ -210293,7 +202362,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp1 = iCur (*TWhereLevel)(unsafe.Pointer(pLevel)).Fp2 = start if testOp != int32(OP_Noop) { - v33 = pParse + 48 + v33 = pParse + 52 *(*int32)(unsafe.Pointer(v33))++ v32 = *(*int32)(unsafe.Pointer(v33)) iRowidReg = v32 @@ -210415,7 +202484,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(libc.Int32FromInt32(WHERE_TOP_LIMIT)|libc.Int32FromInt32(WHERE_BTM_LIMIT)) == uint32(0) && (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_BIGNULL_SORT) != uint32(0) { nExtraReg = int32(1) bSeekPastNull = uint8(1) - v40 = pParse + 48 + v40 = pParse + 52 *(*int32)(unsafe.Pointer(v40))++ v39 = *(*int32)(unsafe.Pointer(v40)) v38 = v39 @@ -210608,7 +202677,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if !(j < int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol)) { break } - k = int32(_sqlite3TableColumnToIndex(tls, pIdx, *(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) + k = _sqlite3TableColumnToIndex(tls, pIdx, int32(*(*Ti16)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pPk)).FaiColumn + uintptr(j)*2)))) _sqlite3VdbeAddOp3(tls, v, int32(OP_Column), iIdxCur, k, iRowidReg+j) goto _42 _42: @@ -210622,12 +202691,13 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI if (*TWhereLevel)(unsafe.Pointer(pLevel)).FiLeftJoin == 0 { /* If a partial index is driving the loop, try to eliminate WHERE clause ** terms from the query that must be true due to the WHERE clause of - ** the partial index. + ** the partial index. This optimization does not work on an outer join, + ** as shown by: ** - ** 2019-11-02 ticket 623eff57e76d45f6: This optimization does not work - ** for a LEFT JOIN. + ** 2019-11-02 ticket 623eff57e76d45f6 (LEFT JOIN) + ** 2025-05-29 forum post 7dee41d32506c4ae (RIGHT JOIN) */ - if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 { + if (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere != 0 && (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ == uintptr(0) { _whereApplyPartialIndexConstraints(tls, (*TIndex)(unsafe.Pointer(pIdx)).FpPartIdxWhere, iCur, pWC) } } else { @@ -210665,11 +202735,11 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI } else { if (*TWhereLoop)(unsafe.Pointer(pLoop)).FwsFlags&uint32(WHERE_MULTI_OR) != 0 { /* Shortened table list or OR-clause generation */ pCov = uintptr(0) - v45 = pParse + 44 + v45 = pParse + 48 v44 = *(*int32)(unsafe.Pointer(v45)) *(*int32)(unsafe.Pointer(v45))++ /* Potential covering index (or NULL) */ iCovCur = v44 - v47 = pParse + 48 + v47 = pParse + 52 *(*int32)(unsafe.Pointer(v47))++ v46 = *(*int32)(unsafe.Pointer(v47)) /* Cursor used for index scans (if any) */ regReturn = v46 /* Register used with OP_Gosub */ @@ -210689,7 +202759,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) > int32(1) { /* Original list of tables */ nNotReady = int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) - iLevel - int32(1) - pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(56)+uint32(nNotReady)*uint32(48))) + pOrTab = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(libc.UintptrFromInt32(0)+8)+uint32(nNotReady+libc.Int32FromInt32(1))*libc.Uint32FromInt64(48))) if pOrTab == uintptr(0) { return notReady } @@ -210725,21 +202795,21 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI */ if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_DUPLICATES_OK) == 0 { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) { - v50 = pParse + 48 + v50 = pParse + 52 *(*int32)(unsafe.Pointer(v50))++ v49 = *(*int32)(unsafe.Pointer(v50)) regRowset = v49 _sqlite3VdbeAddOp2(tls, v, int32(OP_Null), 0, regRowset) } else { pPk1 = _sqlite3PrimaryKeyIndex(tls, pTab) - v52 = pParse + 44 + v52 = pParse + 48 v51 = *(*int32)(unsafe.Pointer(v52)) *(*int32)(unsafe.Pointer(v52))++ regRowset = v51 _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenEphemeral), regRowset, int32((*TIndex)(unsafe.Pointer(pPk1)).FnKeyCol)) _sqlite3VdbeSetP4KeyInfo(tls, pParse, pPk1) } - v54 = pParse + 48 + v54 = pParse + 52 *(*int32)(unsafe.Pointer(v54))++ v53 = *(*int32)(unsafe.Pointer(v54)) regRowid = v53 @@ -210757,7 +202827,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** ** This optimization also only applies if the (x1 OR x2 OR ...) term ** is not contained in the ON clause of a LEFT JOIN. - ** See ticket http://www.sqlite.org/src/info/f2369304e4 + ** See ticket http://sqlite.org/src/info/f2369304e4 ** ** 2022-02-04: Do not push down slices of a row-value comparison. ** In other words, "w" or "y" may not be a slice of a vector. Otherwise, @@ -210812,7 +202882,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI ** eliminating duplicates from other WHERE clauses, the action for each ** sub-WHERE clause is to to invoke the main loop body as a subroutine. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23817, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23980, 0) ii = 0 for { if !(ii < (*TWhereClause)(unsafe.Pointer(pOrWc)).FnTerm) { @@ -210835,7 +202905,7 @@ func _sqlite3WhereCodeOneLoopStart(tls *libc.TLS, pParse uintptr, v uintptr, pWI pOrExpr = pAndExpr } /* Loop through table entries that match term pOrTerm. */ - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23832, libc.VaList(bp+72, ii+int32(1))) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23995, libc.VaList(bp+72, ii+int32(1))) pSubWInfo = _sqlite3WhereBegin(tls, pParse, pOrTab, pOrExpr, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_OR_SUBCLAUSE), iCovCur) if pSubWInfo != 0 { addrExplain = _sqlite3WhereExplainOneScan(tls, pParse, pOrTab, pSubWInfo+760, uint16(0)) @@ -211324,9 +203394,9 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe defer tls.Free(80) var addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, nPk, r, v3 int32 var mAll TBitmask - var pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr - var _ /* sFrom at bp+0 */ TSrcList - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 + var pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, v, v4 uintptr + var _ /* fromSpace at bp+0 */ [56]Tu8 + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = addrCont, iCol, iCur, iIdxCur, iPk, jmp, k, mAll, nPk, pFrom, pLoop, pParse, pPk, pRJ, pRight, pSubWInfo, pSubWhere, pSubq, pTab, pTabItem, pTerm, pWC, r, v, v3, v4 pParse = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse v = (*TParse)(unsafe.Pointer(pParse)).FpVdbe pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ @@ -211335,14 +203405,14 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe pLoop = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop pTabItem = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*48 mAll = uint64(0) - _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+23841, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) + _sqlite3VdbeExplain(tls, pParse, uint8(1), __ccgo_ts+24004, libc.VaList(bp+64, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pTabItem)).FpSTab)).FzName)) k = 0 for { if !(k < iLevel) { break } pRight = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760 + uintptr(k)*88))).FiFrom)*48 - mAll |= (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760 + uintptr(k)*88))).FpWLoop)).FmaskSelf + mAll |= (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760 + uintptr(k)*88))).FpWLoop)).FmaskSelf if int32(*(*uint32)(unsafe.Pointer(pRight + 12 + 4))&0x40>>6) != 0 { pSubq = *(*uintptr)(unsafe.Pointer(pRight + 44)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult, (*TSubquery)(unsafe.Pointer(pSubq)).FregResult+(*TExprList)(unsafe.Pointer((*TSelect)(unsafe.Pointer((*TSubquery)(unsafe.Pointer(pSubq)).FpSelect)).FpEList)).FnExpr-int32(1)) @@ -211381,15 +203451,16 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe k++ } } - (*(*TSrcList)(unsafe.Pointer(bp))).FnSrc = int32(1) - (*(*TSrcList)(unsafe.Pointer(bp))).FnAlloc = uint32(1) - libc.Xmemcpy(tls, bp+8, pTabItem, uint32(48)) - (*(*TSrcItem)(unsafe.Pointer(bp + 8))).Ffg.Fjointype = uint8(0) + pFrom = bp + (*TSrcList)(unsafe.Pointer(pFrom)).FnSrc = int32(1) + (*TSrcList)(unsafe.Pointer(pFrom)).FnAlloc = uint32(1) + libc.Xmemcpy(tls, pFrom+8, pTabItem, uint32(48)) + (*(*TSrcItem)(unsafe.Pointer(pFrom + 8))).Ffg.Fjointype = uint8(0) (*TParse)(unsafe.Pointer(pParse)).FwithinRJSubrtn++ - pSubWInfo = _sqlite3WhereBegin(tls, pParse, bp, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) + pSubWInfo = _sqlite3WhereBegin(tls, pParse, pFrom, pSubWhere, uintptr(0), uintptr(0), uintptr(0), uint16(WHERE_RIGHT_JOIN), 0) if pSubWInfo != 0 { iCur = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiTabCur - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) r = v3 @@ -211401,7 +203472,7 @@ func _sqlite3WhereRightJoinLoop(tls *libc.TLS, pWInfo uintptr, iLevel int32, pLe } else { pPk = _sqlite3PrimaryKeyIndex(tls, pTab) nPk = int32((*TIndex)(unsafe.Pointer(pPk)).FnKeyCol) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPk - int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += nPk - int32(1) iPk = 0 for { if !(iPk < nPk) { @@ -211872,19 +203943,19 @@ var _aOp = [4]struct { FeOp2 uint8 }{ 0: { - FzOp: __ccgo_ts + 18010, + FzOp: __ccgo_ts + 18173, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_MATCH), }, 1: { - FzOp: __ccgo_ts + 17343, + FzOp: __ccgo_ts + 17506, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_GLOB), }, 2: { - FzOp: __ccgo_ts + 16822, + FzOp: __ccgo_ts + 16965, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_LIKE), }, 3: { - FzOp: __ccgo_ts + 23855, + FzOp: __ccgo_ts + 24018, FeOp2: uint8(SQLITE_INDEX_CONSTRAINT_REGEXP), }, } @@ -212404,37 +204475,41 @@ func _exprAnalyzeOrTerm(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) // ** 1. The SQLITE_Transitive optimization must be enabled // ** 2. Must be either an == or an IS operator // ** 3. Not originating in the ON clause of an OUTER JOIN -// ** 4. The affinities of A and B must be compatible -// ** 5a. Both operands use the same collating sequence OR -// ** 5b. The overall collating sequence is BINARY +// ** 4. The operator is not IS or else the query does not contain RIGHT JOIN +// ** 5. The affinities of A and B must be compatible +// ** 6a. Both operands use the same collating sequence OR +// ** 6b. The overall collating sequence is BINARY // ** If this routine returns TRUE, that means that the RHS can be substituted // ** for the LHS anyplace else in the WHERE clause where the LHS column occurs. // ** This is an optimization. No harm comes from returning 0. But if 1 is // ** returned when it should not be, then incorrect answers might result. // */ -func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr) (r int32) { +func _termIsEquivalence(tls *libc.TLS, pParse uintptr, pExpr uintptr, pSrc uintptr) (r int32) { var aff1, aff2 int8 var pColl uintptr _, _, _ = aff1, aff2, pColl if !((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_Transitive)) == libc.Uint32FromInt32(0)) { return 0 - } + } /* (1) */ if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_EQ) && int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_IS) { return 0 - } + } /* (2) */ if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0) { return 0 + } /* (3) */ + if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_IS) && (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc != 0 && int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { + return 0 /* (4) */ } aff1 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft) aff2 = _sqlite3ExprAffinity(tls, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) if int32(aff1) != int32(aff2) && (!(int32(aff1) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC)) || !(int32(aff2) >= libc.Int32FromInt32(SQLITE_AFF_NUMERIC))) { - return 0 + return 0 /* (5) */ } pColl = _sqlite3ExprCompareCollSeq(tls, pParse, pExpr) - if _sqlite3IsBinary(tls, pColl) != 0 { - return int32(1) + if !(_sqlite3IsBinary(tls, pColl) != 0) && !(_sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) != 0) { + return 0 /* (6) */ } - return _sqlite3ExprCollSeqMatch(tls, pParse, (*TExpr)(unsafe.Pointer(pExpr)).FpLeft, (*TExpr)(unsafe.Pointer(pExpr)).FpRight) + return int32(1) } // C documentation @@ -212672,7 +204747,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { extraRight = x - uint64(1) /* ON clause terms may not be used with an index ** on left table of a LEFT JOIN. Ticket #3015 */ if prereqAll>>libc.Int32FromInt32(1) >= x { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23862, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24025, 0) return } } else { @@ -212684,10 +204759,10 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { ** if there is a RIGHT or FULL JOIN in the query. This makes SQLite ** more like other systems, and also preserves legacy. */ if (*TSrcList)(unsafe.Pointer(pSrc)).FnSrc > 0 && int32((*(*TSrcItem)(unsafe.Pointer(pSrc + 8))).Ffg.Fjointype)&int32(JT_LTORJ) != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23862, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24025, 0) return } - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_InnerON)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_InnerON)) } } } @@ -212746,7 +204821,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { pTerm = (*TWhereClause)(unsafe.Pointer(pWC)).Fa + uintptr(idxTerm)*48 p5 = pTerm + 10 *(*Tu16)(unsafe.Pointer(p5)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p5))) | libc.Int32FromInt32(TERM_COPIED)) - if _termIsEquivalence(tls, pParse, pDup) != 0 { + if _termIsEquivalence(tls, pParse, pDup, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList) != 0 { p6 = pTerm + 12 *(*Tu16)(unsafe.Pointer(p6)) = Tu16(int32(*(*Tu16)(unsafe.Pointer(p6))) | libc.Int32FromInt32(WO_EQUIV)) eExtraOp = uint16(WO_EQUIV) @@ -212768,7 +204843,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { } else { if op == int32(TK_ISNULL) && !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) && 0 == _sqlite3ExprCanBeNull(tls, pLeft) { (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_TRUEFALSE) /* See tag-20230504-1 */ - *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 9387 + *(*uintptr)(unsafe.Pointer(pExpr + 8)) = __ccgo_ts + 9474 *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_IsFalse)) (*TWhereTerm)(unsafe.Pointer(pTerm)).FprereqAll = uint64(0) (*TWhereTerm)(unsafe.Pointer(pTerm)).FeOperator = uint16(0) @@ -212869,7 +204944,7 @@ func _exprAnalyze(tls *libc.TLS, pSrc uintptr, pWC uintptr, idxTerm int32) { *(*Tu8)(unsafe.Pointer(pC))++ } if *(*int32)(unsafe.Pointer(bp + 8)) != 0 { - v13 = __ccgo_ts + 23903 + v13 = __ccgo_ts + 24066 } else { v13 = uintptr(unsafe.Pointer(&_sqlite3StrBINARY)) } @@ -213400,7 +205475,7 @@ func _sqlite3WhereTabFuncArgs(tls *libc.TLS, pParse uintptr, pItem uintptr, pWC k++ } if k >= int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23910, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24073, libc.VaList(bp+8, (*TTable)(unsafe.Pointer(pTab)).FzName, j)) return } pColRef = _sqlite3ExprAlloc(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_COLUMN), uintptr(0), 0) @@ -213472,22 +205547,10 @@ type THiddenIndexInfo = struct { FeDistinct int32 FmIn Tu32 FmHandleIn Tu32 - FaRhs [1]uintptr } type HiddenIndexInfo = THiddenIndexInfo -type THiddenIndexInfo1 = struct { - FpWC uintptr - FpParse uintptr - FeDistinct int32 - FmIn Tu32 - FmHandleIn Tu32 - FaRhs [1]uintptr -} - -type HiddenIndexInfo1 = THiddenIndexInfo1 - // C documentation // // /* @@ -213600,7 +205663,7 @@ func _sqlite3WhereMinMaxOptEarlyOut(tls *libc.TLS, v uintptr, pWInfo uintptr) { break } pInner = pWInfo + 760 + uintptr(i)*88 - if (*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { + if (*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pInner)).FpWLoop)).FwsFlags&uint32(WHERE_COLUMN_IN) != uint32(0) { _sqlite3VdbeGoto(tls, v, (*TWhereLevel)(unsafe.Pointer(pInner)).FaddrNxt) return } @@ -214516,7 +206579,7 @@ func _constructAutomaticIndex(tls *libc.TLS, pParse uintptr, pWC uintptr, notRea } cMask = v2 if !(sentWarning != 0) { - Xsqlite3_log(tls, libc.Int32FromInt32(SQLITE_WARNING)|libc.Int32FromInt32(1)<nOut */ @@ -216767,13 +208831,8 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } else { opMask = libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_ISNULL) | libc.Int32FromInt32(WO_IS) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 { - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) - } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 && int32(*(*uint32)(unsafe.Pointer(pSrc + 12 + 4))&0x2>>1) == 0 { - opMask &= ^(libc.Int32FromInt32(WO_EQ) | libc.Int32FromInt32(WO_IN) | libc.Int32FromInt32(WO_IS)) - } + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x4>>2)) != 0 { + opMask &= ^(libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_GE)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LT)-libc.Int32FromInt32(TK_EQ)) | libc.Int32FromInt32(WO_EQ)<<(libc.Int32FromInt32(TK_LE)-libc.Int32FromInt32(TK_EQ))) } saved_nEq = (*(*struct { FnEq Tu16 @@ -216873,6 +208932,7 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro if int32(eOp)&int32(WO_IN) != 0 { pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr if (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(EP_xIsSelect) != uint32(0) { + bRedundant = 0 nIn = int32(46) /* The expression may actually be of the form (x, y) IN (SELECT...). ** In this case there is a separate term for each of (x) and (y). @@ -216886,12 +208946,29 @@ func _whereLoopAddBtreeIndex(tls *libc.TLS, pBuilder uintptr, pSrc uintptr, pPro } if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) != 0 && (*TWhereTerm)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)))).FpExpr == pExpr { nIn = 0 + if (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(*(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) + 24))).FiField == (*(*struct { + FleftColumn int32 + FiField int32 + })(unsafe.Pointer(pTerm + 24))).FiField { + /* Detect when two or more columns of an index match the same + ** column of a vector IN operater, and avoid adding the column + ** to the WhereLoop more than once. See tag-20250707-01 + ** in test/rowvalue.test */ + bRedundant = int32(1) + } } goto _6 _6: ; i++ } + if bRedundant != 0 { + (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm-- + goto _1 + } } else { if *(*uintptr)(unsafe.Pointer(pExpr + 20)) != 0 && (*TExprList)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pExpr + 20)))).FnExpr != 0 { /* "x IN (value, value, ...)" */ @@ -217337,7 +209414,7 @@ func _whereUsablePartialIndex(tls *libc.TLS, iTab int32, jointype Tu8, pWC uintp break } pExpr = (*TWhereTerm)(unsafe.Pointer(pTerm)).FpExpr - if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (int32(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { + if (!((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != libc.Uint32FromInt32(0)) || *(*int32)(unsafe.Pointer(pExpr + 36)) == iTab) && (int32(jointype)&int32(JT_OUTER) == 0 || (*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_OuterON)) != uint32(0)) && _sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, iTab) != 0 && !(_sqlite3ExprImpliesExpr(tls, pParse, pExpr, pWhere, -int32(1)) != 0) && int32((*TWhereTerm)(unsafe.Pointer(pTerm)).FwtFlags)&int32(TERM_VNULL) == 0 { return int32(1) } goto _1 @@ -217388,15 +209465,6 @@ type TCoveringIndexCheck = struct { type CoveringIndexCheck = TCoveringIndexCheck -type TCoveringIndexCheck1 = struct { - FpIdx uintptr - FiTabCur int32 - FbExpr Tu8 - FbUnidx Tu8 -} - -type CoveringIndexCheck1 = TCoveringIndexCheck1 - // C documentation // // /* @@ -217428,7 +209496,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp if (*TExpr)(unsafe.Pointer(pExpr)).FiTable != (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FiTabCur { return WRC_Continue } - pIdx = (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FpIdx + pIdx = (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FpIdx aiColumn = (*TIndex)(unsafe.Pointer(pIdx)).FaiColumn nColumn = (*TIndex)(unsafe.Pointer(pIdx)).FnColumn i = 0 @@ -217447,7 +209515,7 @@ func _whereIsCoveringIndexWalkCallback(tls *libc.TLS, pWalk uintptr, pExpr uintp (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbUnidx = uint8(1) return int32(WRC_Abort) } else { - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x1000>>12)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck1)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FiTabCur) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x800>>11)) != 0 && _exprIsCoveredByIndex(tls, pExpr, pIdx, (*TCoveringIndexCheck)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pWalk + 24)))).FiTabCur) != 0 { (*TCoveringIndexCheck)(unsafe.Pointer(pCk)).FbExpr = uint8(1) return int32(WRC_Prune) } @@ -217484,7 +209552,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur bp := tls.Alloc(48) defer tls.Free(48) var i, rc int32 - var _ /* ck at bp+0 */ TCoveringIndexCheck1 + var _ /* ck at bp+0 */ TCoveringIndexCheck var _ /* w at bp+12 */ TWalker _, _ = i, rc if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect == uintptr(0) { @@ -217492,7 +209560,7 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur ** if pIdx is covering. Assume it is not. */ return uint32(0) } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x1000>>12)) == 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx + 56))&0x800>>11)) == 0 { i = 0 for { if !(i < int32((*TIndex)(unsafe.Pointer(pIdx)).FnColumn)) { @@ -217513,19 +209581,19 @@ func _whereIsCoveringIndex(tls *libc.TLS, pWInfo uintptr, pIdx uintptr, iTabCur return uint32(0) } } - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FpIdx = pIdx - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FiTabCur = iTabCur - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr = uint8(0) - (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FpIdx = pIdx + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FiTabCur = iTabCur + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr = uint8(0) + (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx = uint8(0) libc.Xmemset(tls, bp+12, 0, uint32(28)) (*(*TWalker)(unsafe.Pointer(bp + 12))).FxExprCallback = __ccgo_fp(_whereIsCoveringIndexWalkCallback) (*(*TWalker)(unsafe.Pointer(bp + 12))).FxSelectCallback = __ccgo_fp(_sqlite3SelectWalkNoop) *(*uintptr)(unsafe.Pointer(bp + 12 + 24)) = bp _sqlite3WalkSelect(tls, bp+12, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect) - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbUnidx != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbUnidx != 0 { rc = 0 } else { - if (*(*TCoveringIndexCheck1)(unsafe.Pointer(bp))).FbExpr != 0 { + if (*(*TCoveringIndexCheck)(unsafe.Pointer(bp))).FbExpr != 0 { rc = int32(WHERE_EXPRIDX) } else { rc = int32(WHERE_IDX_ONLY) @@ -217621,7 +209689,7 @@ func _wherePartIdxExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, pPart uintpt (*TIndexedExpr)(unsafe.Pointer(p)).Faff = aff (*TParse)(unsafe.Pointer(pParse)).FpIdxPartExpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 80 + pArg = pParse + 84 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } } @@ -217799,7 +209867,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in /* See ticket [98d973b8f5] */ goto _4 /* Partial index inappropriate for this query */ } - if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x200>>9)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x100>>8)) != 0 { goto _4 } rSize = *(*TLogEst)(unsafe.Pointer((*TIndex)(unsafe.Pointer(pProbe)).FaiRowLogEst)) @@ -217827,6 +209895,14 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in FpIndex uintptr FpOrderBy uintptr })(unsafe.Pointer(pNew + 24))).FnTop = uint16(0) + (*(*struct { + FnEq Tu16 + FnBtm Tu16 + FnTop Tu16 + FnDistinctCol Tu16 + FpIndex uintptr + FpOrderBy uintptr + })(unsafe.Pointer(pNew + 24))).FnDistinctCol = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnSkip = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FnLTerm = uint16(0) (*TWhereLoop)(unsafe.Pointer(pNew)).FiSortIdx = uint8(0) @@ -217903,7 +209979,7 @@ func _whereLoopAddBtree(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask) (r in _wherePartIdxExpr(tls, (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse, pProbe, (*TIndex)(unsafe.Pointer(pProbe)).FpPartIdxWhere, bp+112, 0, uintptr(0)) } (*TWhereLoop)(unsafe.Pointer(pNew)).FwsFlags = uint32(WHERE_INDEXED) - if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x1000>>12)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { + if *(*TBitmask)(unsafe.Pointer(bp + 112)) == libc.Uint64FromInt32(1)<<(int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8))-libc.Int32FromInt32(1)) || int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x800>>11)) != 0 && !(int32(uint32(*(*uint16)(unsafe.Pointer(pProbe + 56))&0x400>>10)) != 0) && *(*TBitmask)(unsafe.Pointer(bp + 112)) != uint64(0) { isCov = _whereIsCoveringIndex(tls, pWInfo, pProbe, (*TSrcItem)(unsafe.Pointer(pSrc)).FiCursor) if isCov == uint32(0) { } else { @@ -218140,7 +210216,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, pTerm1 = v4 } if v5 || v4 == uintptr(0) || *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(iTerm)*4)) != uintptr(0) || int32((*Tsqlite3_index_constraint)(unsafe.Pointer(pIdxCons)).Fusable) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23983, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24146, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -218215,7 +210291,7 @@ func _whereLoopAddVirtualOne(tls *libc.TLS, pBuilder uintptr, mPrereq TBitmask, if *(*uintptr)(unsafe.Pointer((*TWhereLoop)(unsafe.Pointer(pNew)).FaLTerm + uintptr(i)*4)) == uintptr(0) { /* The non-zero argvIdx values must be contiguous. Raise an ** error if they are not */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+23983, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24146, libc.VaList(bp+8, (*TTable)(unsafe.Pointer((*TSrcItem)(unsafe.Pointer(pSrc)).FpSTab)).FzName)) _freeIdxStr(tls, pIdxInfo) return int32(SQLITE_ERROR) } @@ -218369,7 +210445,7 @@ func Xsqlite3_vtab_rhs_value(tls *libc.TLS, pIdxInfo uintptr, iCons int32, ppVal pVal = uintptr(0) rc = SQLITE_OK if iCons < 0 || iCons >= (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FnConstraint { - rc = _sqlite3MisuseError(tls, int32(167885)) /* EV: R-30545-25046 */ + rc = _sqlite3MisuseError(tls, int32(168961)) /* EV: R-30545-25046 */ } else { if *(*uintptr)(unsafe.Pointer(pH + 20 + uintptr(iCons)*4)) == uintptr(0) { pTerm = _termFromWhereClause(tls, (*THiddenIndexInfo)(unsafe.Pointer(pH)).FpWC, (*(*Tsqlite3_index_constraint)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraint + uintptr(iCons)*12))).FiTermOffset) @@ -218805,7 +210881,7 @@ func _whereLoopAddAll(tls *libc.TLS, pBuilder uintptr) (r int32) { if rc != 0 || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { if rc == int32(SQLITE_DONE) { /* We hit the query planner search limit set by iPlanLimit */ - Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+24009, 0) + Xsqlite3_log(tls, int32(SQLITE_WARNING), __ccgo_ts+24172, 0) rc = SQLITE_OK } else { break @@ -219034,17 +211110,6 @@ func _wherePathSatisfiesOrderBy(tls *libc.TLS, pWInfo uintptr, pOrderBy uintptr, *(*TBitmask)(unsafe.Pointer(bp)) = obDone } break - } else { - if int32(wctrlFlags)&int32(WHERE_DISTINCTBY) != 0 { - (*(*struct { - FnEq Tu16 - FnBtm Tu16 - FnTop Tu16 - FnDistinctCol Tu16 - FpIndex uintptr - FpOrderBy uintptr - })(unsafe.Pointer(pLoop + 24))).FnDistinctCol = uint16(0) - } } iCur = (*(*TSrcItem)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpTabList + 8 + uintptr((*TWhereLoop)(unsafe.Pointer(pLoop)).FiTab)*48))).FiCursor /* Mark off any ORDER BY term X that is a column in the table of @@ -220013,7 +212078,7 @@ func _wherePathSolver(tls *libc.TLS, pWInfo uintptr, nRowEst TLogEst) (r int32) iLoop++ } if nFrom == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24044, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24207, 0) _sqlite3DbFreeNN(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pSpace) return int32(SQLITE_ERROR) } @@ -220591,7 +212656,7 @@ func _whereAddIndexedExpr(tls *libc.TLS, pParse uintptr, pIdx uintptr, iIdxCur i } (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr = p if (*TIndexedExpr)(unsafe.Pointer(p)).FpIENext == uintptr(0) { - pArg = pParse + 76 + pArg = pParse + 80 _sqlite3ParserAddCleanup(tls, pParse, __ccgo_fp(_whereIndexedExprCleanup), pArg) } goto _1 @@ -220747,7 +212812,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** bits in a Bitmask */ if (*TSrcList)(unsafe.Pointer(pTabList)).FnSrc > int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24062, libc.VaList(bp+40, int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24225, libc.VaList(bp+40, int32(libc.Uint32FromInt64(8)*libc.Uint32FromInt32(8)))) return uintptr(0) } /* This function normally generates a nested loop for all tables in @@ -220768,10 +212833,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** field (type Bitmask) it must be aligned on an 8-byte boundary on ** some architectures. Hence the ROUND8() below. */ - nByteWInfo = int32((libc.Uint32FromInt64(848) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) - if nTabList > int32(1) { - nByteWInfo = int32((uint32(nByteWInfo) + uint32(nTabList-libc.Int32FromInt32(1))*libc.Uint32FromInt64(88) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) - } + nByteWInfo = int32((uint32(libc.UintptrFromInt32(0)+760) + uint32(nTabList)*libc.Uint32FromInt64(88) + libc.Uint32FromInt32(7)) & uint32(^libc.Int32FromInt32(7))) pWInfo = _sqlite3DbMallocRawNN(tls, db, uint64(uint32(nByteWInfo)+uint32(72))) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { _sqlite3DbFree(tls, db, pWInfo) @@ -220820,7 +212882,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere (*TWhereInfo)(unsafe.Pointer(pWInfo)).FeDistinct = uint8(WHERE_DISTINCT_UNIQUE) } if (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect != 0 && (*TSelect)(unsafe.Pointer((*TWhereInfo)(unsafe.Pointer(pWInfo)).FpSelect)).FselFlags&uint32(SF_MultiValue) == uint32(0) { - _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+24090, 0) + _sqlite3VdbeExplain(tls, pParse, uint8(0), __ccgo_ts+24253, 0) } } else { /* Assign a bit from the bitmask to every term in the FROM clause. @@ -220965,7 +213027,8 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } } /* TUNING: Assume that a DISTINCT clause on a subquery reduces - ** the output size by a factor of 8 (LogEst -30). + ** the output size by a factor of 8 (LogEst -30). Search for + ** tag-20250414a to see other cases. */ if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FwctrlFlags)&int32(WHERE_WANT_DISTINCT) != 0 { p11 = pWInfo + 50 @@ -220999,7 +213062,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnLevel) >= int32(2) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_BloomFilter)) == uint32(0) { _whereCheckIfBloomFilterIsUseful(tls, pWInfo) } - p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 160 + p12 = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FpParse + 16 *(*TLogEst)(unsafe.Pointer(p12)) = TLogEst(int32(*(*TLogEst)(unsafe.Pointer(p12))) + int32((*TWhereInfo)(unsafe.Pointer(pWInfo)).FnRowOut)) /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. @@ -221021,7 +213084,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere ** that use the OR optimization. */ if int32(wctrlFlags)&int32(WHERE_ONEPASS_DESIRED) != 0 { - wsFlags = int32((*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags) + wsFlags = int32((*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags) bOnerow = libc.BoolInt32(wsFlags&int32(WHERE_ONEROW) != 0) if bOnerow != 0 || 0 != int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) && !(int32((*TTable)(unsafe.Pointer((*(*TSrcItem)(unsafe.Pointer(pTabList + 8))).FpSTab)).FeTabType) == libc.Int32FromInt32(TABTYP_VTAB)) && (0 == wsFlags&int32(WHERE_MULTI_OR) || int32(wctrlFlags)&int32(WHERE_DUPLICATES_OK) != 0) && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_OnePass)) == uint32(0) { if bOnerow != 0 { @@ -221034,7 +213097,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere if int32(wctrlFlags)&int32(WHERE_ONEPASS_MULTIROW) != 0 { bFordelete = uint8(OPFLAG_FORDELETE) } - (*TWhereLoop1)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags = uint32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) + (*TWhereLoop)(unsafe.Pointer((*(*TWhereLevel)(unsafe.Pointer(pWInfo + 760))).FpWLoop)).FwsFlags = uint32(wsFlags & ^libc.Int32FromInt32(WHERE_IDX_ONLY)) } } } @@ -221125,11 +213188,11 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere iIndexCur = iAuxArg op1 = int32(OP_ReopenIdx) } else { - v17 = pParse + 44 + v17 = pParse + 48 v16 = *(*int32)(unsafe.Pointer(v17)) *(*int32)(unsafe.Pointer(v17))++ iIndexCur = v16 - if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x1000>>12)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIx + 56))&0x800>>11)) != 0 && (*Tsqlite3)(unsafe.Pointer(db)).FdbOptFlags&uint32(libc.Int32FromInt32(SQLITE_IndexedExpr)) == uint32(0) { _whereAddIndexedExpr(tls, pParse, pIx, iIndexCur, pTabItem) } if (*TIndex)(unsafe.Pointer(pIx)).FpPartIdxWhere != 0 && int32((*TSrcItem)(unsafe.Pointer(pTabItem)).Ffg.Fjointype)&int32(JT_RIGHT) == 0 { @@ -221156,16 +213219,16 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere } if v19 && v18 != uintptr(0) { pRJ = (*TWhereLevel)(unsafe.Pointer(pLevel)).FpRJ - v21 = pParse + 44 + v21 = pParse + 48 v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(v21))++ (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FiMatch = v20 - v23 = pParse + 48 + v23 = pParse + 52 *(*int32)(unsafe.Pointer(v23))++ v22 = *(*int32)(unsafe.Pointer(v23)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom = v22 _sqlite3VdbeAddOp2(tls, v, int32(OP_Blob), int32(65536), (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregBloom) - v25 = pParse + 48 + v25 = pParse + 52 *(*int32)(unsafe.Pointer(v25))++ v24 = *(*int32)(unsafe.Pointer(v25)) (*TWhereRightJoin)(unsafe.Pointer(pRJ)).FregReturn = v24 @@ -221213,7 +213276,7 @@ func _sqlite3WhereBegin(tls *libc.TLS, pParse uintptr, pTabList uintptr, pWhere goto whereBeginError } pLevel = pWInfo + 760 + uintptr(ii)*88 - wsFlags1 = int32((*TWhereLoop1)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) + wsFlags1 = int32((*TWhereLoop)(unsafe.Pointer((*TWhereLevel)(unsafe.Pointer(pLevel)).FpWLoop)).FwsFlags) pSrc = pTabList + 8 + uintptr((*TWhereLevel)(unsafe.Pointer(pLevel)).FiFrom)*48 if int32(*(*uint32)(unsafe.Pointer(pSrc + 12 + 4))&0x20>>5) != 0 { iOnce = 0 @@ -221344,7 +213407,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { ; j++ } - *(*int32)(unsafe.Pointer(pParse + 48)) += n + int32(1) + *(*int32)(unsafe.Pointer(pParse + 52)) += n + int32(1) if int32((*TWhereLevel)(unsafe.Pointer(pLevel)).Fop) == int32(OP_Prev) { v7 = int32(OP_SeekLT) } else { @@ -221522,7 +213585,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { } else { last = (*TWhereInfo)(unsafe.Pointer(pWInfo)).FiEndWhere } - if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x1000>>12)) != 0 { + if int32(uint32(*(*uint16)(unsafe.Pointer(pIdx1 + 56))&0x800>>11)) != 0 { p = (*TParse)(unsafe.Pointer(pParse)).FpIdxEpr for p != 0 { if (*TIndexedExpr)(unsafe.Pointer(p)).FiIdxCur == (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur { @@ -221551,7 +213614,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { x = int32(_sqlite3StorageColumnToTable(tls, pTab, int16(x))) } } - x = int32(_sqlite3TableColumnToIndex(tls, pIdx1, int16(x))) + x = _sqlite3TableColumnToIndex(tls, pIdx1, x) if x >= 0 { (*TVdbeOp)(unsafe.Pointer(pOp)).Fp2 = x (*TVdbeOp)(unsafe.Pointer(pOp)).Fp1 = (*TWhereLevel)(unsafe.Pointer(pLevel)).FiIdxCur @@ -221561,7 +213624,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { /* An error. pLoop is supposed to be a covering index loop, ** and yet the VM code refers to a column of the table that ** is not part of the index. */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24108, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24271, 0) (*TParse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_INTERNAL) } else { /* The WHERE_EXPRIDX flag is set by the planner when it is likely @@ -221611,7 +213674,7 @@ func _sqlite3WhereEnd(tls *libc.TLS, pWInfo uintptr) { */ (*TParse)(unsafe.Pointer(pParse)).FnQueryLoop = int16((*TWhereInfo)(unsafe.Pointer(pWInfo)).FsavedNQueryLoop) _whereInfoFree(tls, db, pWInfo) - p12 = pParse + 26 + p12 = pParse + 25 *(*Tu8)(unsafe.Pointer(p12)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p12))) - nRJ) return } @@ -221883,7 +213946,7 @@ func _nth_valueStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) goto error_out error_out: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24137, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24300, -int32(1)) } func _nth_valueFinalizeFunc(tls *libc.TLS, pCtx uintptr) { @@ -222066,7 +214129,7 @@ func _ntileStepFunc(tls *libc.TLS, pCtx uintptr, nArg int32, apArg uintptr) { if (*TNtileCtx)(unsafe.Pointer(p)).FnTotal == 0 { (*TNtileCtx)(unsafe.Pointer(p)).FnParam = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(apArg))) if (*TNtileCtx)(unsafe.Pointer(p)).FnParam <= 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24193, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+24356, -int32(1)) } } (*TNtileCtx)(unsafe.Pointer(p)).FnTotal++ @@ -222392,7 +214455,7 @@ func _windowFind(tls *libc.TLS, pParse uintptr, pList uintptr, zName uintptr) (r p = (*TWindow)(unsafe.Pointer(p)).FpNextWin } if p == uintptr(0) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24238, libc.VaList(bp+8, zName)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24401, libc.VaList(bp+8, zName)) } return p } @@ -222443,12 +214506,12 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin _sqlite3WindowChain(tls, pParse, pWin, pList) } if int32((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) == int32(TK_RANGE) && ((*TWindow)(unsafe.Pointer(pWin)).FpStart != 0 || (*TWindow)(unsafe.Pointer(pWin)).FpEnd != 0) && ((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy == uintptr(0) || (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOrderBy)).FnExpr != int32(1)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24257, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24420, 0) } else { if (*TFuncDef)(unsafe.Pointer(pFunc)).FfuncFlags&uint32(SQLITE_FUNC_WINDOW) != 0 { db = (*TParse)(unsafe.Pointer(pParse)).Fdb if (*TWindow)(unsafe.Pointer(pWin)).FpFilter != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24328, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24491, 0) } else { aUp = [8]struct { FzFunc uintptr @@ -222521,7 +214584,7 @@ func _sqlite3WindowUpdate(tls *libc.TLS, pParse uintptr, pList uintptr, pWin uin (*TWindow)(unsafe.Pointer(pWin)).FeEnd = uint8(aUp[i].FeEnd) (*TWindow)(unsafe.Pointer(pWin)).FeExclude = uint8(0) if int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) == int32(TK_FOLLOWING) { - (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9626) + (*TWindow)(unsafe.Pointer(pWin)).FpStart = _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+9713) } break } @@ -222552,16 +214615,6 @@ type TWindowRewrite = struct { type WindowRewrite = TWindowRewrite -type TWindowRewrite1 = struct { - FpWin uintptr - FpSrc uintptr - FpSub uintptr - FpTab uintptr - FpSubSelect uintptr -} - -type WindowRewrite1 = TWindowRewrite1 - // C documentation // // /* @@ -222580,17 +214633,17 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( ** TK_COLUMN expressions that refer to it (the outer SELECT). Do ** not process aggregates or window functions at all, as they belong ** to the scalar sub-select. */ - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect != 0 { if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) != int32(TK_COLUMN) { return WRC_Continue } else { - nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc)).FnSrc + nSrc = (*TSrcList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc)).FnSrc i = 0 for { if !(i < nSrc) { break } - if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*48))).FiCursor { + if (*TExpr)(unsafe.Pointer(pExpr)).FiTable == (*(*TSrcItem)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSrc + 8 + uintptr(i)*48))).FiCursor { break } goto _1 @@ -222608,7 +214661,7 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if !((*TExpr)(unsafe.Pointer(pExpr)).Fflags&uint32(libc.Int32FromInt32(EP_WinFunc)) != libc.Uint32FromInt32(0)) { break } else { - pWin = (*TWindowRewrite1)(unsafe.Pointer(p)).FpWin + pWin = (*TWindowRewrite)(unsafe.Pointer(p)).FpWin for { if !(pWin != 0) { break @@ -222632,13 +214685,13 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { return int32(WRC_Abort) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { i1 = 0 for { - if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr) { + if !(i1 < (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr) { break } - if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*20))).FpExpr, pExpr, -int32(1)) { + if 0 == _sqlite3ExprCompare(tls, uintptr(0), (*(*TExprList_item)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub + 8 + uintptr(i1)*20))).FpExpr, pExpr, -int32(1)) { iCol = i1 break } @@ -222653,23 +214706,23 @@ func _selectWindowRewriteExprCb(tls *libc.TLS, pWalker uintptr, pExpr uintptr) ( if pDup != 0 && int32((*TExpr)(unsafe.Pointer(pDup)).Fop) == int32(TK_AGG_FUNCTION) { (*TExpr)(unsafe.Pointer(pDup)).Fop = uint8(TK_FUNCTION) } - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub, pDup) + (*TWindowRewrite)(unsafe.Pointer(p)).FpSub = _sqlite3ExprListAppend(tls, pParse, (*TWindowRewrite)(unsafe.Pointer(p)).FpSub, pDup) } - if (*TWindowRewrite1)(unsafe.Pointer(p)).FpSub != 0 { + if (*TWindowRewrite)(unsafe.Pointer(p)).FpSub != 0 { f = int32((*TExpr)(unsafe.Pointer(pExpr)).Fflags & uint32(EP_Collate)) *(*Tu32)(unsafe.Pointer(pExpr + 4)) |= uint32(libc.Int32FromInt32(EP_Static)) _sqlite3ExprDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pExpr) - *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= uint32(^libc.Int32FromInt32(EP_Static)) + *(*Tu32)(unsafe.Pointer(pExpr + 4)) &= ^uint32(libc.Int32FromInt32(EP_Static)) libc.Xmemset(tls, pExpr, 0, uint32(52)) (*TExpr)(unsafe.Pointer(pExpr)).Fop = uint8(TK_COLUMN) if iCol < 0 { - v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) + v4 = (*TExprList)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpSub)).FnExpr - int32(1) } else { v4 = iCol } (*TExpr)(unsafe.Pointer(pExpr)).FiColumn = int16(v4) - (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite1)(unsafe.Pointer(p)).FpWin)).FiEphCsr - (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TWindowRewrite1)(unsafe.Pointer(p)).FpTab + (*TExpr)(unsafe.Pointer(pExpr)).FiTable = (*TWindow)(unsafe.Pointer((*TWindowRewrite)(unsafe.Pointer(p)).FpWin)).FiEphCsr + (*TExpr)(unsafe.Pointer(pExpr)).Fy.FpTab = (*TWindowRewrite)(unsafe.Pointer(p)).FpTab (*TExpr)(unsafe.Pointer(pExpr)).Fflags = uint32(f) } if (*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).FmallocFailed != 0 { @@ -222685,13 +214738,13 @@ func _selectWindowRewriteSelectCb(tls *libc.TLS, pWalker uintptr, pSelect uintpt var p, pSave uintptr _, _ = p, pSave p = *(*uintptr)(unsafe.Pointer(pWalker + 24)) - pSave = (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect + pSave = (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect if pSave == pSelect { return WRC_Continue } else { - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSelect + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSelect _sqlite3WalkSelect(tls, pWalker, pSelect) - (*TWindowRewrite1)(unsafe.Pointer(p)).FpSubSelect = pSave + (*TWindowRewrite)(unsafe.Pointer(p)).FpSubSelect = pSave } return int32(WRC_Prune) } @@ -222803,7 +214856,7 @@ func _disallowAggregatesInOrderByCb(tls *libc.TLS, pWalker uintptr, pExpr uintpt bp := tls.Alloc(16) defer tls.Free(16) if int32((*TExpr)(unsafe.Pointer(pExpr)).Fop) == int32(TK_AGG_FUNCTION) && (*TExpr)(unsafe.Pointer(pExpr)).FpAggInfo == uintptr(0) { - _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+24391, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) + _sqlite3ErrorMsg(tls, (*TWalker)(unsafe.Pointer(pWalker)).FpParse, __ccgo_ts+24554, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(pExpr + 8)))) } return WRC_Continue } @@ -222839,7 +214892,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Expression list for sub-query */ pMWin = (*TSelect)(unsafe.Pointer(p)).FpWin selFlags = (*TSelect)(unsafe.Pointer(p)).FselFlags - pTab = _sqlite3DbMallocZero(tls, db, uint64(64)) + pTab = _sqlite3DbMallocZero(tls, db, uint64(80)) if pTab == uintptr(0) { return _sqlite3ErrorToParser(tls, db, int32(SQLITE_NOMEM)) } @@ -222854,7 +214907,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { (*TSelect)(unsafe.Pointer(p)).FpWhere = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpGroupBy = uintptr(0) (*TSelect)(unsafe.Pointer(p)).FpHaving = uintptr(0) - *(*Tu32)(unsafe.Pointer(p + 4)) &= uint32(^libc.Int32FromInt32(SF_Aggregate)) + *(*Tu32)(unsafe.Pointer(p + 4)) &= ^libc.Uint32FromInt32(SF_Aggregate) *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(SF_WinRewrite) /* Create the ORDER BY clause for the sub-select. This is the concatenation ** of the window PARTITION and ORDER BY clauses. Then, if this makes it @@ -222873,11 +214926,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { /* Assign a cursor number for the ephemeral table used to buffer rows. ** The OpenEphemeral instruction is coded later, after it is known how ** many columns the table will have. */ - v2 = pParse + 44 + v2 = pParse + 48 v1 = *(*int32)(unsafe.Pointer(v2)) *(*int32)(unsafe.Pointer(v2))++ (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr = v1 - *(*int32)(unsafe.Pointer(pParse + 44)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpEList, pTab, bp) _selectWindowRewriteEList(tls, pParse, pMWin, pSrc, (*TSelect)(unsafe.Pointer(p)).FpOrderBy, pTab, bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { @@ -222923,11 +214976,11 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { pFilter = _sqlite3ExprDup(tls, db, (*TWindow)(unsafe.Pointer(pWin)).FpFilter, 0) *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pFilter) } - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) (*TWindow)(unsafe.Pointer(pWin)).FregAccum = v7 - v10 = pParse + 48 + v10 = pParse + 52 *(*int32)(unsafe.Pointer(v10))++ v9 = *(*int32)(unsafe.Pointer(v10)) (*TWindow)(unsafe.Pointer(pWin)).FregResult = v9 @@ -222944,7 +214997,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** keep everything legal in this case. */ if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1793)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3ExprListAppend(tls, pParse, uintptr(0), _sqlite3Expr(tls, db, int32(TK_INTEGER), __ccgo_ts+1820)) } pSub = _sqlite3SelectNew(tls, pParse, *(*uintptr)(unsafe.Pointer(bp)), pSrc, pWhere, pGroupBy, pHaving, pSort, uint32(0), uintptr(0)) (*TSelect)(unsafe.Pointer(p)).FpSrc = _sqlite3SrcListAppend(tls, pParse, uintptr(0), uintptr(0), uintptr(0)) @@ -222966,7 +215019,7 @@ func _sqlite3WindowRewrite(tls *libc.TLS, pParse uintptr, p uintptr) (r int32) { ** the correct error message regardless. */ rc = int32(SQLITE_NOMEM) } else { - libc.Xmemcpy(tls, pTab, pTab2, uint32(64)) + libc.Xmemcpy(tls, pTab, pTab2, uint32(80)) *(*Tu32)(unsafe.Pointer(pTab + 28)) |= uint32(TF_Ephemeral) (*(*TSrcItem)(unsafe.Pointer((*TSelect)(unsafe.Pointer(p)).FpSrc + 8))).FpSTab = pTab pTab = pTab2 @@ -223090,7 +215143,7 @@ func _sqlite3WindowAlloc(tls *libc.TLS, pParse uintptr, eType int32, eStart int3 ** frame boundary. */ if eStart == int32(TK_CURRENT) && eEnd == int32(TK_PRECEDING) || eStart == int32(TK_FOLLOWING) && (eEnd == int32(TK_PRECEDING) || eEnd == int32(TK_CURRENT)) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24417, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24580, 0) goto windowAllocErr } pWin = _sqlite3DbMallocZero(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, uint64(100)) @@ -223158,18 +215211,18 @@ func _sqlite3WindowChain(tls *libc.TLS, pParse uintptr, pWin uintptr, pList uint zErr = uintptr(0) /* Check for errors */ if (*TWindow)(unsafe.Pointer(pWin)).FpPartition != 0 { - zErr = __ccgo_ts + 24449 + zErr = __ccgo_ts + 24612 } else { if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 && (*TWindow)(unsafe.Pointer(pWin)).FpOrderBy != 0 { - zErr = __ccgo_ts + 24466 + zErr = __ccgo_ts + 24629 } else { if int32((*TWindow)(unsafe.Pointer(pExist)).FbImplicitFrame) == 0 { - zErr = __ccgo_ts + 24482 + zErr = __ccgo_ts + 24645 } } } if zErr != 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24502, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24665, libc.VaList(bp+8, zErr, (*TWindow)(unsafe.Pointer(pWin)).FzBase)) } else { (*TWindow)(unsafe.Pointer(pWin)).FpPartition = _sqlite3ExprListDup(tls, db, (*TWindow)(unsafe.Pointer(pExist)).FpPartition, 0) if (*TWindow)(unsafe.Pointer(pExist)).FpOrderBy != 0 { @@ -223193,7 +215246,7 @@ func _sqlite3WindowAttach(tls *libc.TLS, pParse uintptr, p uintptr, pWin uintptr *(*Tu32)(unsafe.Pointer(p + 4)) |= uint32(libc.Int32FromInt32(EP_WinFunc) | libc.Int32FromInt32(EP_FullSize)) (*TWindow)(unsafe.Pointer(pWin)).FpOwner = p if (*TExpr)(unsafe.Pointer(p)).Fflags&uint32(EP_Distinct) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeFrmType) != int32(TK_FILTER) { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24535, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24698, 0) } } else { _sqlite3WindowDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, pWin) @@ -223299,24 +215352,24 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TWindow)(unsafe.Pointer(pMWin)).FpPartition != 0 { nExpr = (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr (*TWindow)(unsafe.Pointer(pMWin)).FregPart = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nExpr + *(*int32)(unsafe.Pointer(pParse + 52)) += nExpr _sqlite3VdbeAddOp3(tls, v, int32(OP_Null), 0, (*TWindow)(unsafe.Pointer(pMWin)).FregPart, (*TWindow)(unsafe.Pointer(pMWin)).FregPart+nExpr-int32(1)) } - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) (*TWindow)(unsafe.Pointer(pMWin)).FregOne = v1 _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), int32(1), (*TWindow)(unsafe.Pointer(pMWin)).FregOne) if (*TWindow)(unsafe.Pointer(pMWin)).FeExclude != 0 { - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*TWindow)(unsafe.Pointer(pMWin)).FregStartRowid = v3 - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) (*TWindow)(unsafe.Pointer(pMWin)).FregEndRowid = v5 - v8 = pParse + 44 + v8 = pParse + 48 v7 = *(*int32)(unsafe.Pointer(v8)) *(*int32)(unsafe.Pointer(v8))++ (*TWindow)(unsafe.Pointer(pMWin)).FcsrApp = v7 @@ -223334,12 +215387,12 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { if (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_MINMAX) != 0 && int32((*TWindow)(unsafe.Pointer(pWin)).FeStart) != int32(TK_UNBOUNDED) { pList = *(*uintptr)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpOwner + 20)) pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pList, 0, 0) - v11 = pParse + 44 + v11 = pParse + 48 v10 = *(*int32)(unsafe.Pointer(v11)) *(*int32)(unsafe.Pointer(v11))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v10 (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(3) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(3) if pKeyInfo != 0 && int32(*(*int8)(unsafe.Pointer((*TFuncDef)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pWin)).FpWFunc)).FzName + 1))) == int32('i') { *(*Tu8)(unsafe.Pointer((*TKeyInfo)(unsafe.Pointer(pKeyInfo)).FaSortFlags)) = uint8(KEYINFO_ORDER_DESC) } @@ -223351,15 +215404,15 @@ func _sqlite3WindowCodeInit(tls *libc.TLS, pParse uintptr, pSelect uintptr) { /* Allocate two registers at pWin->regApp. These will be used to ** store the start and end index of the current frame. */ (*TWindow)(unsafe.Pointer(pWin)).FregApp = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - v13 = pParse + 44 + v13 = pParse + 48 v12 = *(*int32)(unsafe.Pointer(v13)) *(*int32)(unsafe.Pointer(v13))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v12 - *(*int32)(unsafe.Pointer(pParse + 48)) += int32(2) + *(*int32)(unsafe.Pointer(pParse + 52)) += int32(2) _sqlite3VdbeAddOp2(tls, v, int32(OP_OpenDup), (*TWindow)(unsafe.Pointer(pWin)).FcsrApp, (*TWindow)(unsafe.Pointer(pMWin)).FiEphCsr) } else { if (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_leadName)) || (*TFuncDef)(unsafe.Pointer(p)).FzName == uintptr(unsafe.Pointer(&_lagName)) { - v15 = pParse + 44 + v15 = pParse + 48 v14 = *(*int32)(unsafe.Pointer(v15)) *(*int32)(unsafe.Pointer(v15))++ (*TWindow)(unsafe.Pointer(pWin)).FcsrApp = v14 @@ -223392,7 +215445,7 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { _sqlite3VdbeAddOp2(tls, v, int32(OP_Integer), 0, regZero) if eCond >= int32(WINDOW_STARTING_NUM) { regString = _sqlite3GetTempReg(tls, pParse) - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1673, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1674, -int32(1)) _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, _sqlite3VdbeCurrentAddr(tls, v)+int32(2), reg) _sqlite3VdbeChangeP5(tls, v, uint16(libc.Int32FromInt32(SQLITE_AFF_NUMERIC)|libc.Int32FromInt32(SQLITE_JUMPIFNULL))) } else { @@ -223411,11 +215464,11 @@ func _windowCheckValue(tls *libc.TLS, pParse uintptr, reg int32, eCond int32) { } var _azErr = [5]uintptr{ - 0: __ccgo_ts + 24582, - 1: __ccgo_ts + 24635, - 2: __ccgo_ts + 24137, - 3: __ccgo_ts + 24686, - 4: __ccgo_ts + 24738, + 0: __ccgo_ts + 24745, + 1: __ccgo_ts + 24798, + 2: __ccgo_ts + 24300, + 3: __ccgo_ts + 24849, + 4: __ccgo_ts + 24901, } var _aOp1 = [5]int32{ @@ -223468,87 +215521,6 @@ type TWindowCsrAndReg = struct { type WindowCsrAndReg = TWindowCsrAndReg -/* -** See comments above struct WindowCodeArg. - */ -type TWindowCsrAndReg1 = struct { - Fcsr int32 - Freg int32 -} - -type WindowCsrAndReg1 = TWindowCsrAndReg1 - -/* -** A single instance of this structure is allocated on the stack by -** sqlite3WindowCodeStep() and a pointer to it passed to the various helper -** routines. This is to reduce the number of arguments required by each -** helper function. -** -** regArg: -** Each window function requires an accumulator register (just as an -** ordinary aggregate function does). This variable is set to the first -** in an array of accumulator registers - one for each window function -** in the WindowCodeArg.pMWin list. -** -** eDelete: -** The window functions implementation sometimes caches the input rows -** that it processes in a temporary table. If it is not zero, this -** variable indicates when rows may be removed from the temp table (in -** order to reduce memory requirements - it would always be safe just -** to leave them there). Possible values for eDelete are: -** -** WINDOW_RETURN_ROW: -** An input row can be discarded after it is returned to the caller. -** -** WINDOW_AGGINVERSE: -** An input row can be discarded after the window functions xInverse() -** callbacks have been invoked in it. -** -** WINDOW_AGGSTEP: -** An input row can be discarded after the window functions xStep() -** callbacks have been invoked in it. -** -** start,current,end -** Consider a window-frame similar to the following: -** -** (ORDER BY a, b GROUPS BETWEEN 2 PRECEDING AND 2 FOLLOWING) -** -** The windows functions implementation caches the input rows in a temp -** table, sorted by "a, b" (it actually populates the cache lazily, and -** aggressively removes rows once they are no longer required, but that's -** a mere detail). It keeps three cursors open on the temp table. One -** (current) that points to the next row to return to the query engine -** once its window function values have been calculated. Another (end) -** points to the next row to call the xStep() method of each window function -** on (so that it is 2 groups ahead of current). And a third (start) that -** points to the next row to call the xInverse() method of each window -** function on. -** -** Each cursor (start, current and end) consists of a VDBE cursor -** (WindowCsrAndReg.csr) and an array of registers (starting at -** WindowCodeArg.reg) that always contains a copy of the peer values -** read from the corresponding cursor. -** -** Depending on the window-frame in question, all three cursors may not -** be required. In this case both WindowCodeArg.csr and reg are set to -** 0. - */ -type TWindowCodeArg1 = struct { - FpParse uintptr - FpMWin uintptr - FpVdbe uintptr - FaddrGosub int32 - FregGosub int32 - FregArg int32 - FeDelete int32 - FregRowid int32 - Fstart TWindowCsrAndReg - Fcurrent TWindowCsrAndReg - Fend TWindowCsrAndReg -} - -type WindowCodeArg1 = TWindowCodeArg1 - // C documentation // // /* @@ -223995,7 +215967,7 @@ func _windowInitAccum(tls *libc.TLS, pParse uintptr, pMWin uintptr) (r int32) { pWin = (*TWindow)(unsafe.Pointer(pWin)).FpNextWin } regArg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nArg + *(*int32)(unsafe.Pointer(pParse + 52)) += nArg return regArg } @@ -224091,7 +216063,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal pOrderBy = (*TWindow)(unsafe.Pointer((*TWindowCodeArg)(unsafe.Pointer(p)).FpMWin)).FpOrderBy /* ORDER BY clause for window */ reg1 = _sqlite3GetTempReg(tls, pParse) /* Reg. for csr1.peerVal+regVal */ reg2 = _sqlite3GetTempReg(tls, pParse) - v2 = pParse + 48 + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) /* Reg. for csr2.peerVal */ regString = v1 /* Reg. for constant value '' */ @@ -224167,7 +216139,7 @@ func _windowCodeRangeTest(tls *libc.TLS, p uintptr, op int32, csr1 int32, regVal ** the add/subtract is skipped for these, as required. If reg1 is a NULL, ** then the arithmetic is performed, but since adding or subtracting from ** NULL is always NULL anyway, this case is handled as required too. */ - _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1673, -int32(1)) + _sqlite3VdbeAddOp4(tls, v, int32(OP_String8), 0, regString, 0, __ccgo_ts+1674, -int32(1)) addrGe = _sqlite3VdbeAddOp3(tls, v, int32(OP_Ge), regString, 0, reg1) if op == int32(OP_Ge) && arith == int32(OP_Add) || op == int32(OP_Le) && arith == int32(OP_Subtract) { _sqlite3VdbeAddOp3(tls, v, op, reg2, lbl, reg1) @@ -224808,12 +216780,12 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** same values in record form, and the rowid used to insert said record ** into the ephemeral table. */ regNew = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nInput - v2 = pParse + 48 + *(*int32)(unsafe.Pointer(pParse + 52)) += nInput + v2 = pParse + 52 *(*int32)(unsafe.Pointer(v2))++ v1 = *(*int32)(unsafe.Pointer(v2)) regRecord = v1 - v4 = pParse + 48 + v4 = pParse + 52 *(*int32)(unsafe.Pointer(v4))++ v3 = *(*int32)(unsafe.Pointer(v4)) (*(*TWindowCodeArg)(unsafe.Pointer(bp))).FregRowid = v3 @@ -224821,13 +216793,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin ** clause, allocate registers to store the results of evaluating each ** . */ if int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_PRECEDING) || int32((*TWindow)(unsafe.Pointer(pMWin)).FeStart) == int32(TK_FOLLOWING) { - v6 = pParse + 48 + v6 = pParse + 52 *(*int32)(unsafe.Pointer(v6))++ v5 = *(*int32)(unsafe.Pointer(v6)) regStart = v5 } if int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_PRECEDING) || int32((*TWindow)(unsafe.Pointer(pMWin)).FeEnd) == int32(TK_FOLLOWING) { - v8 = pParse + 48 + v8 = pParse + 52 *(*int32)(unsafe.Pointer(v8))++ v7 = *(*int32)(unsafe.Pointer(v8)) regEnd = v7 @@ -224847,13 +216819,13 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin regNewPeer += (*TExprList)(unsafe.Pointer((*TWindow)(unsafe.Pointer(pMWin)).FpPartition)).FnExpr } regPeer = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fstart.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fcurrent.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer (*(*TWindowCodeArg)(unsafe.Pointer(bp))).Fend.Freg = (*TParse)(unsafe.Pointer(pParse)).FnMem + int32(1) - *(*int32)(unsafe.Pointer(pParse + 48)) += nPeer + *(*int32)(unsafe.Pointer(pParse + 52)) += nPeer } /* Load the column values for the row returned by the sub-select ** into an array of registers starting at regNew. Assemble them into @@ -224880,7 +216852,7 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin nPart = (*TExprList)(unsafe.Pointer(pPart)).FnExpr regNewPart = regNew + (*TWindow)(unsafe.Pointer(pMWin)).FnBufferCol pKeyInfo = _sqlite3KeyInfoFromExprList(tls, pParse, pPart, 0, 0) - v12 = pParse + 48 + v12 = pParse + 52 *(*int32)(unsafe.Pointer(v12))++ v11 = *(*int32)(unsafe.Pointer(v12)) regFlushPart = v11 @@ -225099,6 +217071,10 @@ func _sqlite3WindowCodeStep(tls *libc.TLS, pParse uintptr, p uintptr, pWInfo uin /* #include "sqliteInt.h" */ +/* +** Verify that the pParse->isCreate field is set + */ + /* ** Disable all error recovery processing in the parser push-down ** automaton. @@ -225159,7 +217135,7 @@ type FrameBound = TFrameBound func _parserSyntaxError(tls *libc.TLS, pParse uintptr, p uintptr) { bp := tls.Alloc(16) defer tls.Free(16) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24788, libc.VaList(bp+8, p)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24951, libc.VaList(bp+8, p)) } // C documentation @@ -225173,6 +217149,7 @@ func _disableLookaside(tls *libc.TLS, pParse uintptr) { _ = db db = (*TParse)(unsafe.Pointer(pParse)).Fdb (*TParse)(unsafe.Pointer(pParse)).FdisableLookaside++ + libc.Xmemset(tls, pParse+188, 0, uint32(20)) (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FbDisable++ (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.Fsz = uint16(0) } @@ -225206,11 +217183,11 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { cnt++ if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != 0 || (*TSelect)(unsafe.Pointer(pLoop)).FpLimit != 0 { if (*TSelect)(unsafe.Pointer(pLoop)).FpOrderBy != uintptr(0) { - v1 = __ccgo_ts + 24812 + v1 = __ccgo_ts + 24975 } else { - v1 = __ccgo_ts + 24821 + v1 = __ccgo_ts + 24984 } - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24827, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24990, libc.VaList(bp+8, v1, _sqlite3SelectOpName(tls, int32((*TSelect)(unsafe.Pointer(pNext)).Fop)))) break } } @@ -225219,7 +217196,7 @@ func _parserDoubleLinkSelect(tls *libc.TLS, pParse uintptr, p uintptr) { mxSelect = v2 } if v3 && v2 > 0 && cnt > mxSelect { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24869, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25032, 0) } } } @@ -225325,7 +217302,7 @@ func _parserAddExprIdListTerm(tls *libc.TLS, pParse uintptr, pPrior uintptr, pId _ = p p = _sqlite3ExprListAppend(tls, pParse, pPrior, uintptr(0)) if (hasCollate != 0 || sortOrder != -int32(1)) && int32((*Tsqlite3)(unsafe.Pointer((*TParse)(unsafe.Pointer(pParse)).Fdb)).Finit1.Fbusy) == 0 { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24903, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25066, libc.VaList(bp+8, (*TToken)(unsafe.Pointer(pIdToken)).Fn, (*TToken)(unsafe.Pointer(pIdToken)).Fz)) } _sqlite3ExprListSetName(tls, pParse, p, pIdToken, int32(1)) return p @@ -231792,14 +223769,6 @@ var _yyFallback = [187]uint16{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type TyyStackEntry1 = struct { - Fstateno uint16 - Fmajor uint16 - Fminor TYYMINORTYPE -} - -type yyStackEntry1 = TyyStackEntry1 - type TyyStackEntry = struct { Fstateno uint16 Fmajor uint16 @@ -231810,16 +223779,6 @@ type yyStackEntry = TyyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type TyyParser1 = struct { - Fyytos uintptr - FpParse uintptr - FyystackEnd uintptr - Fyystack uintptr - Fyystk0 [100]TyyStackEntry -} - -type yyParser1 = TyyParser1 - type TyyParser = struct { Fyytos uintptr FpParse uintptr @@ -232967,19 +224926,19 @@ var _yyRuleInfoNRhs = [409]int8{ func _yy_reduce(tls *libc.TLS, yypParser uintptr, yyruleno uint32, yyLookahead int32, yyLookaheadToken TToken, pParse uintptr) (r uint16) { bp := tls.Alloc(96) defer tls.Free(96) - var bNot, bNot1, nExpr, yygoto, yysize int32 + var bNot, bNot1, nExpr, yygoto, yysize, v348 int32 var n Tu32 var op Tu8 - var p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v348, v349, v350 uintptr + var p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yymsp, v347, v349, v350, v351 uintptr var yyact uint16 - var v351 TToken + var v352 TToken var _ /* all at bp+64 */ TToken var _ /* as at bp+48 */ TToken var _ /* dest at bp+8 */ TSelectDest var _ /* t at bp+56 */ TToken var _ /* x at bp+40 */ TToken var _ /* yylhsminor at bp+0 */ TYYMINORTYPE - _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351 /* Amount to pop the stack */ + _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bNot, bNot1, n, nExpr, op, p, p1, p2, p3, p4, p5, pB, pDot, pFrom, pFromClause, pLeft, pLhs, pList, pList1, pList2, pList3, pList4, pNew, pOld, pRHS, pRhs, pRight, pSelect, pSelectRHS, pSrc, pSubquery, pSubquery1, temp1, temp11, temp2, temp21, temp3, temp4, yyact, yygoto, yymsp, yysize, v347, v348, v349, v350, v351, v352 /* Amount to pop the stack */ _ = yyLookahead _ = yyLookaheadToken yymsp = (*TyyParser)(unsafe.Pointer(yypParser)).Fyytos @@ -233782,20 +225741,20 @@ _30: goto _346 _31: ; /* table_option ::= WITHOUT nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+18161, int32(5)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(5) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+18324, int32(5)) == 0 { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = uint32(libc.Int32FromInt32(TF_WithoutRowid) | libc.Int32FromInt32(TF_NoVisibleRowid)) } else { *(*Tu32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24941, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25104, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } goto _346 _32: ; /* table_option ::= nm */ - if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+18074, int32(6)) == 0 { + if *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)) == uint32(6) && Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(yymsp + 4)), __ccgo_ts+18260, int32(6)) == 0 { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(TF_Strict) } else { *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) = uint32(0) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24941, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25104, libc.VaList(bp+80, *(*uint32)(unsafe.Pointer(yymsp + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)))) } *(*Tu32)(unsafe.Pointer(yymsp + 4)) = *(*Tu32)(unsafe.Pointer(&*(*TYYMINORTYPE)(unsafe.Pointer(bp)))) goto _346 @@ -233836,7 +225795,12 @@ _43: ; /* ccons ::= CONSTRAINT nm */ _42: ; - (*TParse)(unsafe.Pointer(pParse)).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 4)) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName = *(*TToken)(unsafe.Pointer(yymsp + 4)) goto _346 _44: ; /* ccons ::= DEFAULT scantok term */ @@ -233981,7 +225945,12 @@ _79: goto _346 _80: ; /* tconscomma ::= COMMA */ - (*TParse)(unsafe.Pointer(pParse)).FconstraintName.Fn = uint32(0) + (*(*struct { + FaddrCrTab int32 + FregRowid int32 + FregRoot int32 + FconstraintName TToken + })(unsafe.Pointer(pParse + 188))).FconstraintName.Fn = uint32(0) goto _346 _81: ; /* tcons ::= PRIMARY KEY LP sortlist autoinc RP onconf */ @@ -234071,9 +226040,9 @@ _98: (*TSelect)(unsafe.Pointer(pRhs)).Fop = uint8(*(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) (*TSelect)(unsafe.Pointer(pRhs)).FpPrior = pLhs if pLhs != 0 { - *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pLhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) } - *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= uint32(^libc.Int32FromInt32(SF_MultiValue)) + *(*Tu32)(unsafe.Pointer(pRhs + 4)) &= ^libc.Uint32FromInt32(SF_MultiValue) if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != int32(TK_ALL) { (*TParse)(unsafe.Pointer(pParse)).FhasCompound = uint8(1) } @@ -234428,7 +226397,7 @@ _176: _177: ; /* cmd ::= with UPDATE orconf xfullname indexed_opt SET setlist from where_opt_ret */ _sqlite3SrcListIndexedBy(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), yymsp+uintptr(-libc.Int32FromInt32(4))*12+4) - _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+24968) + _sqlite3ExprListCheckLength(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), __ccgo_ts+25131) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 { pFromClause = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) if (*TSrcList)(unsafe.Pointer(pFromClause)).FnSrc > int32(1) { @@ -234768,23 +226737,37 @@ _236: _237: ; /* expr ::= expr in_op LP exprlist RP */ if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) == uintptr(0) { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { + v347 = __ccgo_ts + 9469 + } else { + v347 = __ccgo_ts + 9474 + } /* Expressions of the form ** ** expr1 IN () ** expr1 NOT IN () ** - ** simplify to constants 0 (false) and 1 (true), respectively, - ** regardless of the value of expr1. + ** simplify to constants 0 (false) and 1 (true), respectively. + ** + ** Except, do not apply this optimization if expr1 contains a function + ** because that function might be an aggregate (we don't know yet whether + ** it is or not) and if it is an aggregate, that could change the meaning + ** of the whole query. */ - _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) - if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { - v347 = __ccgo_ts + 9382 - } else { - v347 = __ccgo_ts + 9387 + pB = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) + if pB != 0 { + _sqlite3ExprIdToTrueFalse(tls, pB) } - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3Expr(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, int32(TK_STRING), v347) - if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) != 0 { - _sqlite3ExprIdToTrueFalse(tls, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) + if !((*TExpr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)))).Fflags&uint32(libc.Int32FromInt32(EP_HasFunc)) != libc.Uint32FromInt32(0)) { + _sqlite3ExprUnmapAndDelete(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = pB + } else { + if *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) != 0 { + v348 = int32(TK_OR) + } else { + v348 = int32(TK_AND) + } + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, v348, pB, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) } } else { pRHS = (*(*TExprList_item)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) + 8))).FpExpr @@ -234842,11 +226825,11 @@ _240: pSelect = _sqlite3SelectNew(tls, pParse, uintptr(0), pSrc, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uint32(0), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + 4)) != 0 { if pSelect != 0 { - v348 = pSrc + v349 = pSrc } else { - v348 = uintptr(0) + v349 = uintptr(0) } - _sqlite3SrcListFuncArgs(tls, pParse, v348, *(*uintptr)(unsafe.Pointer(yymsp + 4))) + _sqlite3SrcListFuncArgs(tls, pParse, v349, *(*uintptr)(unsafe.Pointer(yymsp + 4))) } *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_IN), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), uintptr(0)) _sqlite3PExprAddSelect(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), pSelect) @@ -234856,9 +226839,9 @@ _240: goto _346 _241: ; /* expr ::= EXISTS LP select RP */ - v349 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) - *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) = v349 - p5 = v349 + v350 = _sqlite3PExpr(tls, pParse, int32(TK_EXISTS), uintptr(0), uintptr(0)) + *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)) = v350 + p5 = v350 _sqlite3PExprAddSelect(tls, pParse, p5, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) goto _346 _242: @@ -234866,11 +226849,11 @@ _242: *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) = _sqlite3PExpr(tls, pParse, int32(TK_CASE), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(3))*12 + 4)), uintptr(0)) if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) != 0 { if *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4)) != 0 { - v350 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) + v351 = _sqlite3ExprListAppend(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(1))*12 + 4))) } else { - v350 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) + v351 = *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) } - *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 20)) = v350 + *(*uintptr)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)) + 20)) = v351 _sqlite3ExprSetHeightAndFlags(tls, pParse, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4))) } else { _sqlite3ExprListDelete(tls, (*TParse)(unsafe.Pointer(pParse)).Fdb, *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4))) @@ -234968,11 +226951,11 @@ _264: ; /* trigger_decl ::= temp TRIGGER ifnotexists nm dbnm trigger_time trigger_event ON fullname foreach_clause when_clause */ _sqlite3BeginTrigger(tls, pParse, yymsp+uintptr(-libc.Int32FromInt32(7))*12+4, yymsp+uintptr(-libc.Int32FromInt32(6))*12+4, *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(5))*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(4))*12 + 4 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)), *(*uintptr)(unsafe.Pointer(yymsp + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)), *(*int32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(8))*12 + 4))) if *(*uint32)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4 + 4)) == uint32(0) { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(7))*12 + 4)) } else { - v351 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)) + v352 = *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(6))*12 + 4)) } - *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)) = v351 /*A-overwrites-T*/ + *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(10))*12 + 4)) = v352 /*A-overwrites-T*/ goto _346 _265: ; /* trigger_time ::= BEFORE|AFTER */ @@ -235022,15 +227005,15 @@ _276: _277: ; /* trnm ::= nm DOT nm */ *(*TToken)(unsafe.Pointer(yymsp + uintptr(-libc.Int32FromInt32(2))*12 + 4)) = *(*TToken)(unsafe.Pointer(yymsp + 4)) - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+24977, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25140, 0) goto _346 _278: ; /* tridxby ::= INDEXED BY nm */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25072, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25235, 0) goto _346 _279: ; /* tridxby ::= NOT INDEXED */ - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25156, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25319, 0) goto _346 _280: ; /* trigger_cmd ::= UPDATE orconf trnm tridxby SET setlist from where_opt scanpt */ @@ -235172,7 +227155,7 @@ _312: goto _346 _313: ; /* withnm ::= nm */ - (*TParse)(unsafe.Pointer(pParse)).FbHasWith = uint8(1) + libc.SetBitFieldPtr8Uint32(pParse+32, libc.Uint32FromInt32(1), 1, 0x2) goto _346 _314: ; /* wqlist ::= wqitem */ @@ -235366,7 +227349,7 @@ func _yy_syntax_error(tls *libc.TLS, yypParser uintptr, yymajor int32, _yyminor if *(*int8)(unsafe.Pointer((*(*TToken)(unsafe.Pointer(bp))).Fz)) != 0 { _parserSyntaxError(tls, pParse, bp) } else { - _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25241, 0) + _sqlite3ErrorMsg(tls, pParse, __ccgo_ts+25404, 0) } /************ End %syntax_error code ******************************************/ /* Suppress warning about unused %extra_argument variable */ @@ -237492,7 +229475,7 @@ func _getToken(tls *libc.TLS, pz uintptr) (r int32) { var _ /* t at bp+0 */ int32 _ = z z = *(*uintptr)(unsafe.Pointer(pz)) /* Token type to return */ - for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) { + for cond := true; cond; cond = *(*int32)(unsafe.Pointer(bp)) == int32(TK_SPACE) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) { z += uintptr(_sqlite3GetToken(tls, z, bp)) } if *(*int32)(unsafe.Pointer(bp)) == int32(TK_ID) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_STRING) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_JOIN_KW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_WINDOW) || *(*int32)(unsafe.Pointer(bp)) == int32(TK_OVER) || _sqlite3ParserFallback(tls, *(*int32)(unsafe.Pointer(bp))) == int32(TK_ID) { @@ -238097,14 +230080,16 @@ func _sqlite3RunParser(tls *libc.TLS, pParse uintptr, zSql uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == int32(TK_FILTER) { *(*int32)(unsafe.Pointer(bp)) = _analyzeFilterKeyword(tls, zSql+6, lastTokenParsed) } else { - if *(*int32)(unsafe.Pointer(bp)) == int32(TK_COMMENT) && (*Tsqlite3)(unsafe.Pointer(db)).Fflags&(uint64(libc.Int32FromInt32(0x00040))< int32(63) || libc.Uint64FromInt32(1)< 0 { return int32(SQLITE_BUSY) } @@ -238968,22 +230952,31 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 Xsqlite3_free(tls, (*Tsqlite3)(unsafe.Pointer(db)).Flookaside.FpStart) } /* The size of a lookaside slot after ROUNDDOWN8 needs to be larger - ** than a pointer to be useful. + ** than a pointer and small enough to fit in a u16. */ - sz = sz & ^libc.Int32FromInt32(7) /* IMP: R-33038-09382 */ + sz = sz & ^libc.Int32FromInt32(7) if sz <= libc.Int32FromInt64(4) { sz = 0 } - if cnt < 0 { + if sz > int32(65528) { + sz = int32(65528) + } + /* Count must be at least 1 to be useful, but not so large as to use + ** more than 0x7fff0000 total bytes for lookaside. */ + if cnt < int32(1) { cnt = 0 } - if sz == 0 || cnt == 0 { + if sz > 0 && cnt > int32(0x7fff0000)/sz { + cnt = int32(0x7fff0000) / sz + } + szAlloc = int64(sz) * int64(cnt) + if szAlloc == 0 { sz = 0 pStart = uintptr(0) } else { if pBuf == uintptr(0) { _sqlite3BeginBenignMalloc(tls) - pStart = _sqlite3Malloc(tls, uint64(szAlloc)) /* IMP: R-61949-35727 */ + pStart = _sqlite3Malloc(tls, uint64(szAlloc)) _sqlite3EndBenignMalloc(tls) if pStart != 0 { szAlloc = int64(_sqlite3MallocSize(tls, pStart)) @@ -238994,11 +230987,11 @@ func _setupLookaside(tls *libc.TLS, db uintptr, pBuf uintptr, sz int32, cnt int3 } if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(3) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(3)*libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz >= libc.Int32FromInt32(LOOKASIDE_SMALL)*libc.Int32FromInt32(2) { nBig = int32(szAlloc / int64(libc.Int32FromInt32(LOOKASIDE_SMALL)+sz)) - nSm = int32((szAlloc - int64(sz*nBig)) / int64(LOOKASIDE_SMALL)) + nSm = int32((szAlloc - int64(sz)*int64(nBig)) / int64(LOOKASIDE_SMALL)) } else { if sz > 0 { nBig = int32(szAlloc / int64(sz)) @@ -239579,7 +231572,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { return SQLITE_OK } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(182777)) + return _sqlite3MisuseError(tls, int32(183895)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if int32((*Tsqlite3)(unsafe.Pointer(db)).FmTrace)&int32(SQLITE_TRACE_CLOSE) != 0 { @@ -239599,7 +231592,7 @@ func _sqlite3Close(tls *libc.TLS, db uintptr, forceZombie int32) (r int32) { ** SQLITE_BUSY if the connection can not be closed immediately. */ if !(forceZombie != 0) && _connectionIsBusy(tls, db) != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25328, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25491, 0) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_BUSY) } @@ -239724,11 +231717,11 @@ func _sqlite3LeaveMutexAndCloseZombie(tls *libc.TLS, db uintptr) { break } pDb = (*Tsqlite3)(unsafe.Pointer(db)).FaDb + uintptr(j)*16 - if (*TDb1)(unsafe.Pointer(pDb)).FpBt != 0 { - _sqlite3BtreeClose(tls, (*TDb1)(unsafe.Pointer(pDb)).FpBt) - (*TDb1)(unsafe.Pointer(pDb)).FpBt = uintptr(0) + if (*TDb)(unsafe.Pointer(pDb)).FpBt != 0 { + _sqlite3BtreeClose(tls, (*TDb)(unsafe.Pointer(pDb)).FpBt) + (*TDb)(unsafe.Pointer(pDb)).FpBt = uintptr(0) if j != int32(1) { - (*TDb1)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) + (*TDb)(unsafe.Pointer(pDb)).FpSchema = uintptr(0) } } goto _1 @@ -239900,14 +231893,14 @@ func _sqlite3RollbackAll(tls *libc.TLS, db uintptr, tripCode int32) { func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { var zErr uintptr _ = zErr - zErr = __ccgo_ts + 25871 + zErr = __ccgo_ts + 26034 switch rc { case libc.Int32FromInt32(SQLITE_ABORT) | libc.Int32FromInt32(2)<= 0 && rc < int32(libc.Uint32FromInt64(116)/libc.Uint32FromInt64(4)) && _aMsg[rc] != uintptr(0) { @@ -239919,31 +231912,31 @@ func _sqlite3ErrStr(tls *libc.TLS, rc int32) (r uintptr) { } var _aMsg = [29]uintptr{ - 0: __ccgo_ts + 25396, - 1: __ccgo_ts + 25409, - 3: __ccgo_ts + 25425, - 4: __ccgo_ts + 25450, - 5: __ccgo_ts + 25464, - 6: __ccgo_ts + 25483, - 7: __ccgo_ts + 1643, - 8: __ccgo_ts + 25508, - 9: __ccgo_ts + 25545, - 10: __ccgo_ts + 25557, - 11: __ccgo_ts + 25572, - 12: __ccgo_ts + 25605, - 13: __ccgo_ts + 25623, - 14: __ccgo_ts + 25648, - 15: __ccgo_ts + 25677, - 17: __ccgo_ts + 7411, - 18: __ccgo_ts + 6813, - 19: __ccgo_ts + 25694, - 20: __ccgo_ts + 25712, - 21: __ccgo_ts + 25730, - 23: __ccgo_ts + 25764, - 25: __ccgo_ts + 25785, - 26: __ccgo_ts + 25811, - 27: __ccgo_ts + 25834, - 28: __ccgo_ts + 25855, + 0: __ccgo_ts + 25559, + 1: __ccgo_ts + 25572, + 3: __ccgo_ts + 25588, + 4: __ccgo_ts + 25613, + 5: __ccgo_ts + 25627, + 6: __ccgo_ts + 25646, + 7: __ccgo_ts + 1644, + 8: __ccgo_ts + 25671, + 9: __ccgo_ts + 25708, + 10: __ccgo_ts + 25720, + 11: __ccgo_ts + 25735, + 12: __ccgo_ts + 25768, + 13: __ccgo_ts + 25786, + 14: __ccgo_ts + 25811, + 15: __ccgo_ts + 25840, + 17: __ccgo_ts + 7497, + 18: __ccgo_ts + 6901, + 19: __ccgo_ts + 25857, + 20: __ccgo_ts + 25875, + 21: __ccgo_ts + 25893, + 23: __ccgo_ts + 25927, + 25: __ccgo_ts + 25948, + 26: __ccgo_ts + 25974, + 27: __ccgo_ts + 25997, + 28: __ccgo_ts + 26018, } // C documentation @@ -240037,15 +232030,17 @@ func _sqlite3InvokeBusyHandler(tls *libc.TLS, p uintptr) (r int32) { return rc } +type t__ccgo_fp__Xsqlite3_busy_handler_1 = func(*libc.TLS, uintptr, int32) int32 + // C documentation // // /* // ** This routine sets the busy callback for an Sqlite database to the // ** given callback function with the given argument. // */ -func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintptr) (r int32) { +func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, __ccgo_fp_xBusy uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = xBusy + (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FxBusyHandler = __ccgo_fp_xBusy (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FpBusyArg = pArg (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 (*Tsqlite3)(unsafe.Pointer(db)).FbusyTimeout = 0 @@ -240053,6 +232048,8 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_progress_handler_2 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -240060,10 +232057,10 @@ func Xsqlite3_busy_handler(tls *libc.TLS, db uintptr, xBusy uintptr, pArg uintpt // ** given callback function with the given argument. The progress callback will // ** be invoked every nOps opcodes. // */ -func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, xProgress uintptr, pArg uintptr) { +func Xsqlite3_progress_handler(tls *libc.TLS, db uintptr, nOps int32, __ccgo_fp_xProgress uintptr, pArg uintptr) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if nOps > 0 { - (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = xProgress + (*Tsqlite3)(unsafe.Pointer(db)).FxProgress = __ccgo_fp_xProgress (*Tsqlite3)(unsafe.Pointer(db)).FnProgressOps = uint32(nOps) (*Tsqlite3)(unsafe.Pointer(db)).FpProgressArg = pArg } else { @@ -240090,6 +232087,20 @@ func Xsqlite3_busy_timeout(tls *libc.TLS, db uintptr, ms int32) (r int32) { return SQLITE_OK } +// C documentation +// +// /* +// ** Set the setlk timeout value. +// */ +func Xsqlite3_setlk_timeout(tls *libc.TLS, db uintptr, ms int32, flags int32) (r int32) { + if ms < -int32(1) { + return int32(SQLITE_RANGE) + } + _ = db + _ = flags + return SQLITE_OK +} + // C documentation // // /* @@ -240117,12 +232128,12 @@ func Xsqlite3_is_interrupted(tls *libc.TLS, db uintptr) (r int32) { // ** that if a malloc() fails in sqlite3_create_function(), an error code // ** is returned and the mallocFailed flag cleared. // */ -func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, pDestructor uintptr) (r int32) { +func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, enc int32, pUserData uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, pDestructor uintptr) (r int32) { var extraFlags, rc int32 var p, v1 uintptr _, _, _, _ = extraFlags, p, rc, v1 - if zFunctionName == uintptr(0) || xSFunc != uintptr(0) && xFinal != uintptr(0) || libc.BoolInt32(xFinal == uintptr(0)) != libc.BoolInt32(xStep == uintptr(0)) || libc.BoolInt32(xValue == uintptr(0)) != libc.BoolInt32(xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { - return _sqlite3MisuseError(tls, int32(183428)) + if zFunctionName == uintptr(0) || __ccgo_fp_xSFunc != uintptr(0) && __ccgo_fp_xFinal != uintptr(0) || libc.BoolInt32(__ccgo_fp_xFinal == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xStep == uintptr(0)) || libc.BoolInt32(__ccgo_fp_xValue == uintptr(0)) != libc.BoolInt32(__ccgo_fp_xInverse == uintptr(0)) || (nArg < -int32(1) || nArg > int32(SQLITE_MAX_FUNCTION_ARG)) || int32(255) < _sqlite3Strlen30(tls, zFunctionName) { + return _sqlite3MisuseError(tls, int32(184586)) } extraFlags = enc & (libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_DIRECTONLY) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_INNOCUOUS) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_SELFORDER1)) enc &= libc.Int32FromInt32(SQLITE_FUNC_ENCMASK) | libc.Int32FromInt32(SQLITE_ANY) @@ -240140,9 +232151,9 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i case int32(SQLITE_UTF16): enc = int32(SQLITE_UTF16LE) case int32(SQLITE_ANY): - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF8)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) if rc == SQLITE_OK { - rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, xSFunc, xStep, xFinal, xValue, xInverse, pDestructor) + rc = _sqlite3CreateFunc(tls, db, zFunctionName, nArg, int32(SQLITE_UTF16LE)|extraFlags^int32(SQLITE_FUNC_UNSAFE), pUserData, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pDestructor) } if rc != SQLITE_OK { return rc @@ -240165,13 +232176,13 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i p = _sqlite3FindFunction(tls, db, zFunctionName, nArg, uint8(enc), uint8(0)) if p != 0 && (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) == uint32(enc) && int32((*TFuncDef)(unsafe.Pointer(p)).FnArg) == nArg { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+25952, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26115, 0) return int32(SQLITE_BUSY) } else { _sqlite3ExpirePreparedStatements(tls, db, 0) } } else { - if xSFunc == uintptr(0) && xFinal == uintptr(0) { + if __ccgo_fp_xSFunc == uintptr(0) && __ccgo_fp_xFinal == uintptr(0) { /* Trying to delete a function that does not exist. This is a no-op. ** https://sqlite.org/forum/forumpost/726219164b */ return SQLITE_OK @@ -240189,15 +232200,15 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i } *(*uintptr)(unsafe.Pointer(p + 36)) = pDestructor (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags = (*TFuncDef)(unsafe.Pointer(p)).FfuncFlags&uint32(SQLITE_FUNC_ENCMASK) | uint32(extraFlags) - if xSFunc != 0 { - v1 = xSFunc + if __ccgo_fp_xSFunc != 0 { + v1 = __ccgo_fp_xSFunc } else { - v1 = xStep + v1 = __ccgo_fp_xStep } (*TFuncDef)(unsafe.Pointer(p)).FxSFunc = v1 - (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = xFinal - (*TFuncDef)(unsafe.Pointer(p)).FxValue = xValue - (*TFuncDef)(unsafe.Pointer(p)).FxInverse = xInverse + (*TFuncDef)(unsafe.Pointer(p)).FxFinalize = __ccgo_fp_xFinal + (*TFuncDef)(unsafe.Pointer(p)).FxValue = __ccgo_fp_xValue + (*TFuncDef)(unsafe.Pointer(p)).FxInverse = __ccgo_fp_xInverse (*TFuncDef)(unsafe.Pointer(p)).FpUserData = pUserData (*TFuncDef)(unsafe.Pointer(p)).FnArg = int16(uint16(nArg)) return SQLITE_OK @@ -240212,27 +232223,27 @@ func _sqlite3CreateFunc(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg i // ** sqlite3_create_function_v2() // ** sqlite3_create_window_function() // */ -func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { +func _createFunctionApi(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { var pArg uintptr var rc int32 _, _ = pArg, rc rc = int32(SQLITE_ERROR) pArg = uintptr(0) Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - if xDestroy != 0 { + if __ccgo_fp_xDestroy != 0 { pArg = _sqlite3Malloc(tls, uint64(12)) if !(pArg != 0) { _sqlite3OomFault(tls, db) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) goto out } (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef = 0 - (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = xDestroy + (*TFuncDestructor)(unsafe.Pointer(pArg)).FxDestroy = __ccgo_fp_xDestroy (*TFuncDestructor)(unsafe.Pointer(pArg)).FpUserData = p } - rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, xValue, xInverse, pArg) + rc = _sqlite3CreateFunc(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, pArg) if pArg != 0 && (*TFuncDestructor)(unsafe.Pointer(pArg)).FnRef == 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestroy})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestroy})))(tls, p) Xsqlite3_free(tls, pArg) } goto out @@ -240243,30 +232254,60 @@ out: return rc } +type t__ccgo_fp__Xsqlite3_create_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_7 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Create new user functions. // */ -func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) +func Xsqlite3_create_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) } -func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), xDestroy) +type t__ccgo_fp__Xsqlite3_create_function_v2_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function_v2_8 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function_v2(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), __ccgo_fp_xDestroy) } -func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, xStep uintptr, xFinal uintptr, xValue uintptr, xInverse uintptr, xDestroy uintptr) (r int32) { - return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), xStep, xFinal, xValue, xInverse, xDestroy) +type t__ccgo_fp__Xsqlite3_create_window_function_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_6 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_7 = func(*libc.TLS, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_8 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_window_function_9 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_window_function(tls *libc.TLS, db uintptr, zFunc uintptr, nArg int32, enc int32, p uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr, __ccgo_fp_xValue uintptr, __ccgo_fp_xInverse uintptr, __ccgo_fp_xDestroy uintptr) (r int32) { + return _createFunctionApi(tls, db, zFunc, nArg, enc, p, uintptr(0), __ccgo_fp_xStep, __ccgo_fp_xFinal, __ccgo_fp_xValue, __ccgo_fp_xInverse, __ccgo_fp_xDestroy) } -func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, xSFunc uintptr, xStep uintptr, xFinal uintptr) (r int32) { +type t__ccgo_fp__Xsqlite3_create_function16_5 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_6 = func(*libc.TLS, uintptr, int32, uintptr) + +type t__ccgo_fp__Xsqlite3_create_function16_7 = func(*libc.TLS, uintptr) + +func Xsqlite3_create_function16(tls *libc.TLS, db uintptr, zFunctionName uintptr, nArg int32, eTextRep int32, p uintptr, __ccgo_fp_xSFunc uintptr, __ccgo_fp_xStep uintptr, __ccgo_fp_xFinal uintptr) (r int32) { var rc int32 var zFunc8 uintptr _, _ = rc, zFunc8 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zFunc8 = _sqlite3Utf16to8(tls, db, zFunctionName, -int32(1), uint8(SQLITE_UTF16LE)) - rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, xSFunc, xStep, xFinal, uintptr(0), uintptr(0), uintptr(0)) + rc = _sqlite3CreateFunc(tls, db, zFunc8, nArg, eTextRep, p, __ccgo_fp_xSFunc, __ccgo_fp_xStep, __ccgo_fp_xFinal, uintptr(0), uintptr(0), uintptr(0)) _sqlite3DbFree(tls, db, zFunc8) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -240291,7 +232332,7 @@ func _sqlite3InvalidFunction(tls *libc.TLS, context uintptr, NotUsed int32, NotU zName = Xsqlite3_user_data(tls, context) _ = NotUsed _ = NotUsed2 - zErr = Xsqlite3_mprintf(tls, __ccgo_ts+26015, libc.VaList(bp+8, zName)) + zErr = Xsqlite3_mprintf(tls, __ccgo_ts+26178, libc.VaList(bp+8, zName)) Xsqlite3_result_error(tls, context, zErr, -int32(1)) Xsqlite3_free(tls, zErr) } @@ -240322,13 +232363,15 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i if rc != 0 { return SQLITE_OK } - zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, zName)) + zCopy = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, zName)) if zCopy == uintptr(0) { return int32(SQLITE_NOMEM) } return Xsqlite3_create_function_v2(tls, db, zName, nArg, int32(SQLITE_UTF8), zCopy, __ccgo_fp(_sqlite3InvalidFunction), uintptr(0), uintptr(0), __ccgo_fp(Xsqlite3_free)) } +type t__ccgo_fp__Xsqlite3_trace_1 = func(*libc.TLS, uintptr, uintptr) + // C documentation // // /* @@ -240339,43 +232382,47 @@ func Xsqlite3_overload_function(tls *libc.TLS, db uintptr, zName uintptr, nArg i // ** trace is a pointer to a function that is invoked at the start of each // ** SQL statement. // */ -func Xsqlite3_trace(tls *libc.TLS, db uintptr, xTrace uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_trace(tls *libc.TLS, db uintptr, __ccgo_fp_xTrace uintptr, pArg uintptr) (r uintptr) { var pOld uintptr var v1 int32 _, _ = pOld, v1 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg - if xTrace != 0 { + if __ccgo_fp_xTrace != 0 { v1 = int32(SQLITE_TRACE_LEGACY) } else { v1 = 0 } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(v1) - *(*uintptr)(unsafe.Pointer(db + 216)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 216)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_trace_v2_2 = func(*libc.TLS, uint32, uintptr, uintptr, uintptr) int32 + // C documentation // // /* Register a trace callback using the version-2 interface. // */ -func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, pArg uintptr) (r int32) { +func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, __ccgo_fp_xTrace uintptr, pArg uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if mTrace == uint32(0) { - xTrace = uintptr(0) + __ccgo_fp_xTrace = uintptr(0) } - if xTrace == uintptr(0) { + if __ccgo_fp_xTrace == uintptr(0) { mTrace = uint32(0) } (*Tsqlite3)(unsafe.Pointer(db)).FmTrace = uint8(mTrace) - *(*uintptr)(unsafe.Pointer(db + 216)) = xTrace + *(*uintptr)(unsafe.Pointer(db + 216)) = __ccgo_fp_xTrace (*Tsqlite3)(unsafe.Pointer(db)).FpTraceArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_profile_1 = func(*libc.TLS, uintptr, uintptr, uint64) + // C documentation // // /* @@ -240386,12 +232433,12 @@ func Xsqlite3_trace_v2(tls *libc.TLS, db uintptr, mTrace uint32, xTrace uintptr, // ** profile is a pointer to a function that is invoked at the conclusion of // ** each SQL statement that is run. // */ -func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_profile(tls *libc.TLS, db uintptr, __ccgo_fp_xProfile uintptr, pArg uintptr) (r uintptr) { var pOld, p1, p2 uintptr _, _, _ = pOld, p1, p2 Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg - (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = xProfile + (*Tsqlite3)(unsafe.Pointer(db)).FxProfile = __ccgo_fp_xProfile (*Tsqlite3)(unsafe.Pointer(db)).FpProfileArg = pArg p1 = db + 94 *(*Tu8)(unsafe.Pointer(p1)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p1))) & libc.Int32FromInt32(SQLITE_TRACE_NONLEGACY_MASK)) @@ -240403,6 +232450,8 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) return pOld } +type t__ccgo_fp__Xsqlite3_commit_hook_1 = func(*libc.TLS, uintptr) int32 + // C documentation // // /* @@ -240410,82 +232459,92 @@ func Xsqlite3_profile(tls *libc.TLS, db uintptr, xProfile uintptr, pArg uintptr) // ** If the invoked function returns non-zero, then the commit becomes a // ** rollback. // */ -func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_commit_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pOld uintptr _ = pOld Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pOld = (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg - (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxCommitCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpCommitArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pOld } +type t__ccgo_fp__Xsqlite3_update_hook_1 = func(*libc.TLS, uintptr, int32, uintptr, uintptr, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_update_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_rollback_hook_1 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is rolled // ** back by this database connection. // */ -func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_rollback_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg - (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxRollbackCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpRollbackArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_preupdate_hook_1 = func(*libc.TLS, uintptr, uintptr, int32, uintptr, uintptr, int64, int64) + // C documentation // // /* // ** Register a callback to be invoked each time a row is updated, // ** inserted or deleted using this database connection. // */ -func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_preupdate_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg - (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxPreUpdateCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpPreUpdateArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet } +type t__ccgo_fp__Xsqlite3_autovacuum_pages_1 = func(*libc.TLS, uintptr, uintptr, uint32, uint32, uint32) uint32 + +type t__ccgo_fp__Xsqlite3_autovacuum_pages_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a function to be invoked prior to each autovacuum that // ** determines the number of pages to vacuum. // */ -func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_autovacuum_pages(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr != 0 { (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr})))(tls, (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg) } - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacPages = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpAutovacPagesArg = pArg - (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = xDestructor + (*Tsqlite3)(unsafe.Pointer(db)).FxAutovacDestr = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -240529,18 +232588,20 @@ func Xsqlite3_wal_autocheckpoint(tls *libc.TLS, db uintptr, nFrame int32) (r int return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_wal_hook_1 = func(*libc.TLS, uintptr, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Register a callback to be invoked each time a transaction is written // ** into the write-ahead-log by this database connection. // */ -func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, xCallback uintptr, pArg uintptr) (r uintptr) { +func Xsqlite3_wal_hook(tls *libc.TLS, db uintptr, __ccgo_fp_xCallback uintptr, pArg uintptr) (r uintptr) { var pRet uintptr _ = pRet Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) pRet = (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg - (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = xCallback + (*Tsqlite3)(unsafe.Pointer(db)).FxWalCallback = __ccgo_fp_xCallback (*Tsqlite3)(unsafe.Pointer(db)).FpWalArg = pArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return pRet @@ -240566,7 +232627,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in if eMode < SQLITE_CHECKPOINT_PASSIVE || eMode > int32(SQLITE_CHECKPOINT_TRUNCATE) { /* EVIDENCE-OF: R-03996-12088 The M parameter must be a valid checkpoint ** mode: */ - return _sqlite3MisuseError(tls, int32(184044)) + return _sqlite3MisuseError(tls, int32(185202)) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if zDb != 0 && *(*int8)(unsafe.Pointer(zDb)) != 0 { @@ -240576,7 +232637,7 @@ func Xsqlite3_wal_checkpoint_v2(tls *libc.TLS, db uintptr, zDb uintptr, eMode in } if iDb < 0 { rc = int32(SQLITE_ERROR) - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+26066, libc.VaList(bp+8, zDb)) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_ERROR), __ccgo_ts+26229, libc.VaList(bp+8, zDb)) } else { (*Tsqlite3)(unsafe.Pointer(db)).FbusyHandler.FnBusy = 0 rc = _sqlite3Checkpoint(tls, db, iDb, eMode, pnLog, pnCkpt) @@ -240698,7 +232759,7 @@ func Xsqlite3_errmsg(tls *libc.TLS, db uintptr) (r uintptr) { return _sqlite3ErrStr(tls, int32(SQLITE_NOMEM)) } if !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(184180))) + return _sqlite3ErrStr(tls, _sqlite3MisuseError(tls, int32(185338))) } Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -240830,7 +232891,7 @@ var _misuse = [34]Tu16{ // */ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184259)) + return _sqlite3MisuseError(tls, int32(185417)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240840,7 +232901,7 @@ func Xsqlite3_errcode(tls *libc.TLS, db uintptr) (r int32) { func Xsqlite3_extended_errcode(tls *libc.TLS, db uintptr) (r int32) { if db != 0 && !(_sqlite3SafetyCheckSickOrOk(tls, db) != 0) { - return _sqlite3MisuseError(tls, int32(184268)) + return _sqlite3MisuseError(tls, int32(185426)) } if !(db != 0) || (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { return int32(SQLITE_NOMEM) @@ -240876,7 +232937,7 @@ func Xsqlite3_errstr(tls *libc.TLS, rc int32) (r uintptr) { // ** Create a new collating function for database "db". The name is zName // ** and the encoding is enc. // */ -func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var aColl, p, pColl uintptr var enc2, j int32 _, _, _, _, _ = aColl, enc2, j, p, pColl @@ -240889,7 +232950,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui enc2 = int32(SQLITE_UTF16LE) } if enc2 < int32(SQLITE_UTF8) || enc2 > int32(SQLITE_UTF16BE) { - return _sqlite3MisuseError(tls, int32(184316)) + return _sqlite3MisuseError(tls, int32(185474)) } /* Check if this call is removing or replacing an existing collation ** sequence. If so, and there are active VMs, return busy. If there @@ -240898,7 +232959,7 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui pColl = _sqlite3FindCollSeq(tls, db, uint8(enc2), zName, 0) if pColl != 0 && (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp != 0 { if (*Tsqlite3)(unsafe.Pointer(db)).FnVdbeActive != 0 { - _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26087, 0) + _sqlite3ErrorWithMsg(tls, db, int32(SQLITE_BUSY), __ccgo_ts+26250, 0) return int32(SQLITE_BUSY) } _sqlite3ExpirePreparedStatements(tls, db, 0) @@ -240933,9 +232994,9 @@ func _createCollation(tls *libc.TLS, db uintptr, zName uintptr, enc Tu8, pCtx ui if pColl == uintptr(0) { return int32(SQLITE_NOMEM) } - (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = xCompare + (*TCollSeq)(unsafe.Pointer(pColl)).FxCmp = __ccgo_fp_xCompare (*TCollSeq)(unsafe.Pointer(pColl)).FpUser = pCtx - (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = xDel + (*TCollSeq)(unsafe.Pointer(pColl)).FxDel = __ccgo_fp_xDel (*TCollSeq)(unsafe.Pointer(pColl)).Fenc = uint8(enc2 | int32(enc)&libc.Int32FromInt32(SQLITE_UTF16_ALIGNED)) _sqlite3Error(tls, db, SQLITE_OK) return SQLITE_OK @@ -241045,7 +233106,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u flags = *(*uint32)(unsafe.Pointer(pFlags)) zVfs = zDefaultVfs nUri = _sqlite3Strlen30(tls, zUri) - if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+26155, uint32(5)) == 0 { /* Input character index */ + if (flags&uint32(SQLITE_OPEN_URI) != 0 || libc.AtomicLoadNUint8(uintptr(unsafe.Pointer(&_sqlite3Config))+6, libc.Int32FromInt32(__ATOMIC_RELAXED)) != 0) && nUri >= int32(5) && libc.Xmemcmp(tls, zUri, __ccgo_ts+26318, uint32(5)) == 0 { /* Input character index */ iOut = 0 /* Output character index */ nByte = uint64(nUri + int32(8)) /* Bytes of space to allocate */ /* Make sure the SQLITE_OPEN_URI flag is set to indicate to the VFS xOpen @@ -241075,8 +233136,8 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u for *(*int8)(unsafe.Pointer(zUri + uintptr(iIn))) != 0 && int32(*(*int8)(unsafe.Pointer(zUri + uintptr(iIn)))) != int32('/') { iIn++ } - if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+26161, zUri+7, uint32(9)) != 0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26171, libc.VaList(bp+8, iIn-int32(7), zUri+7)) + if iIn != int32(7) && (iIn != int32(16) || libc.Xmemcmp(tls, __ccgo_ts+26324, zUri+7, uint32(9)) != 0) { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26334, libc.VaList(bp+8, iIn-int32(7), zUri+7)) rc = int32(SQLITE_ERROR) goto parse_uri_out } @@ -241165,24 +233226,24 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u nOpt = _sqlite3Strlen30(tls, zOpt) zVal = zOpt + uintptr(nOpt+int32(1)) nVal = _sqlite3Strlen30(tls, zVal) - if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+26199, zOpt, uint32(3)) == 0 { + if nOpt == int32(3) && libc.Xmemcmp(tls, __ccgo_ts+26362, zOpt, uint32(3)) == 0 { zVfs = zVal } else { aMode = uintptr(0) zModeType = uintptr(0) mask = 0 limit = 0 - if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+26203, zOpt, uint32(5)) == 0 { + if nOpt == int32(5) && libc.Xmemcmp(tls, __ccgo_ts+26366, zOpt, uint32(5)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_SHAREDCACHE) | libc.Int32FromInt32(SQLITE_OPEN_PRIVATECACHE) aMode = uintptr(unsafe.Pointer(&_aCacheMode)) limit = mask - zModeType = __ccgo_ts + 26203 + zModeType = __ccgo_ts + 26366 } - if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26224, zOpt, uint32(4)) == 0 { + if nOpt == int32(4) && libc.Xmemcmp(tls, __ccgo_ts+26387, zOpt, uint32(4)) == 0 { mask = libc.Int32FromInt32(SQLITE_OPEN_READONLY) | libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE) | libc.Int32FromInt32(SQLITE_OPEN_MEMORY) aMode = uintptr(unsafe.Pointer(&_aOpenMode)) limit = int32(uint32(mask) & flags) - zModeType = __ccgo_ts + 26239 + zModeType = __ccgo_ts + 26402 } if aMode != 0 { mode = 0 @@ -241211,12 +233272,12 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u i++ } if mode == 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26246, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26409, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_ERROR) goto parse_uri_out } if mode & ^libc.Int32FromInt32(SQLITE_OPEN_MEMORY) > limit { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26266, libc.VaList(bp+8, zModeType, zVal)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26429, libc.VaList(bp+8, zModeType, zVal)) rc = int32(SQLITE_PERM) goto parse_uri_out } @@ -241240,7 +233301,7 @@ func _sqlite3ParseUri(tls *libc.TLS, zDefaultVfs uintptr, zUri uintptr, pFlags u } *(*uintptr)(unsafe.Pointer(ppVfs)) = Xsqlite3_vfs_find(tls, zVfs) if *(*uintptr)(unsafe.Pointer(ppVfs)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26290, libc.VaList(bp+8, zVfs)) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+26453, libc.VaList(bp+8, zVfs)) rc = int32(SQLITE_ERROR) } goto parse_uri_out @@ -241260,11 +233321,11 @@ var _aCacheMode = [3]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26209, + Fz: __ccgo_ts + 26372, Fmode: int32(SQLITE_OPEN_SHAREDCACHE), }, 1: { - Fz: __ccgo_ts + 26216, + Fz: __ccgo_ts + 26379, Fmode: int32(SQLITE_OPEN_PRIVATECACHE), }, 2: {}, @@ -241275,19 +233336,19 @@ var _aOpenMode = [5]struct { Fmode int32 }{ 0: { - Fz: __ccgo_ts + 26229, + Fz: __ccgo_ts + 26392, Fmode: int32(SQLITE_OPEN_READONLY), }, 1: { - Fz: __ccgo_ts + 26232, + Fz: __ccgo_ts + 26395, Fmode: int32(SQLITE_OPEN_READWRITE), }, 2: { - Fz: __ccgo_ts + 26235, + Fz: __ccgo_ts + 26398, Fmode: libc.Int32FromInt32(SQLITE_OPEN_READWRITE) | libc.Int32FromInt32(SQLITE_OPEN_CREATE), }, 3: { - Fz: __ccgo_ts + 19242, + Fz: __ccgo_ts + 19405, Fmode: int32(SQLITE_OPEN_MEMORY), }, 4: {}, @@ -241415,8 +233476,8 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16BE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) _createCollation(tls, db, uintptr(unsafe.Pointer(&_sqlite3StrBINARY)), uint8(SQLITE_UTF16LE), uintptr(0), __ccgo_fp(_binCollFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+23903, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) - _createCollation(tls, db, __ccgo_ts+26306, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+24066, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_nocaseCollatingFunc), uintptr(0)) + _createCollation(tls, db, __ccgo_ts+26469, uint8(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rtrimCollFunc), uintptr(0)) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { goto opendb_out } @@ -241437,10 +233498,10 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* READWRITE */ /* READWRITE | CREATE */ if int32(1)<<(*(*uint32)(unsafe.Pointer(bp))&uint32(7))&int32(0x46) == 0 { - rc = _sqlite3MisuseError(tls, int32(184991)) /* IMP: R-18321-05872 */ + rc = _sqlite3MisuseError(tls, int32(186149)) /* IMP: R-18321-05872 */ } else { if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 5564 + zFilename = __ccgo_ts + 5652 } rc = _sqlite3ParseUri(tls, zVfs, zFilename, bp, db, bp+4, bp+8) } @@ -241449,7 +233510,7 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 _sqlite3OomFault(tls, db) } if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { - v2 = __ccgo_ts + 4710 + v2 = __ccgo_ts + 4829 } else { v2 = uintptr(0) } @@ -241476,9 +233537,9 @@ func _openDatabase(tls *libc.TLS, zFilename uintptr, ppDb uintptr, _flags uint32 /* The default safety_level for the main database is FULL; for the temp ** database it is OFF. This matches the pager layer defaults. */ - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 8020 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).FzDbSName = __ccgo_ts + 8107 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb))).Fsafety_level = uint8(libc.Int32FromInt32(SQLITE_DEFAULT_SYNCHRONOUS) + libc.Int32FromInt32(1)) - (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 25301 + (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).FzDbSName = __ccgo_ts + 25464 (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer(db)).FaDb + 1*16))).Fsafety_level = uint8(PAGER_SYNCHRONOUS_OFF) (*Tsqlite3)(unsafe.Pointer(db)).FeOpenState = uint8(SQLITE_STATE_OPEN) if (*Tsqlite3)(unsafe.Pointer(db)).FmallocFailed != 0 { @@ -241572,7 +233633,7 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc } if zFilename == uintptr(0) { - zFilename = __ccgo_ts + 26312 + zFilename = __ccgo_ts + 26475 } pVal = _sqlite3ValueNew(tls, uintptr(0)) _sqlite3ValueSetStr(tls, pVal, -int32(1), zFilename, uint8(SQLITE_UTF16LE), libc.UintptrFromInt32(0)) @@ -241591,36 +233652,44 @@ func Xsqlite3_open16(tls *libc.TLS, zFilename uintptr, ppDb uintptr) (r int32) { return rc & int32(0xff) } +type t__ccgo_fp__Xsqlite3_create_collation_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { - return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, xCompare, uintptr(0)) +func Xsqlite3_create_collation(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { + return Xsqlite3_create_collation_v2(tls, db, zName, enc, pCtx, __ccgo_fp_xCompare, uintptr(0)) } +type t__ccgo_fp__Xsqlite3_create_collation_v2_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_create_collation_v2_5 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr, xDel uintptr) (r int32) { +func Xsqlite3_create_collation_v2(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr, __ccgo_fp_xDel uintptr) (r int32) { var rc int32 _ = rc Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - rc = _createCollation(tls, db, zName, uint8(enc), pCtx, xCompare, xDel) + rc = _createCollation(tls, db, zName, uint8(enc), pCtx, __ccgo_fp_xCompare, __ccgo_fp_xDel) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return rc } +type t__ccgo_fp__Xsqlite3_create_collation16_4 = func(*libc.TLS, uintptr, int32, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Register a new collation sequence with the database handle db. // */ -func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, xCompare uintptr) (r int32) { +func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc int32, pCtx uintptr, __ccgo_fp_xCompare uintptr) (r int32) { var rc int32 var zName8 uintptr _, _ = rc, zName8 @@ -241628,7 +233697,7 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) zName8 = _sqlite3Utf16to8(tls, db, zName, -int32(1), uint8(SQLITE_UTF16LE)) if zName8 != 0 { - rc = _createCollation(tls, db, zName8, uint8(enc), pCtx, xCompare, uintptr(0)) + rc = _createCollation(tls, db, zName8, uint8(enc), pCtx, __ccgo_fp_xCompare, uintptr(0)) _sqlite3DbFree(tls, db, zName8) } rc = _sqlite3ApiExit(tls, db, rc) @@ -241636,31 +233705,35 @@ func Xsqlite3_create_collation16(tls *libc.TLS, db uintptr, zName uintptr, enc i return rc } +type t__ccgo_fp__Xsqlite3_collation_needed_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded uintptr) (r int32) { +func Xsqlite3_collation_needed(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = xCollNeeded + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = __ccgo_fp_xCollNeeded (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } +type t__ccgo_fp__Xsqlite3_collation_needed16_2 = func(*libc.TLS, uintptr, uintptr, int32, uintptr) + // C documentation // // /* // ** Register a collation sequence factory callback with the database handle // ** db. Replace any previously installed collation sequence factory. // */ -func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, xCollNeeded16 uintptr) (r int32) { +func Xsqlite3_collation_needed16(tls *libc.TLS, db uintptr, pCollNeededArg uintptr, __ccgo_fp_xCollNeeded16 uintptr) (r int32) { Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded = uintptr(0) - (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = xCollNeeded16 + (*Tsqlite3)(unsafe.Pointer(db)).FxCollNeeded16 = __ccgo_fp_xCollNeeded16 (*Tsqlite3)(unsafe.Pointer(db)).FpCollNeededArg = pCollNeededArg Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK @@ -241694,12 +233767,14 @@ func Xsqlite3_get_clientdata(tls *libc.TLS, db uintptr, zName uintptr) (r uintpt return uintptr(0) } +type t__ccgo_fp__Xsqlite3_set_clientdata_3 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Add new client data to a database connection. // */ -func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var n Tsize_t var p, pp uintptr _, _, _ = n, p, pp @@ -241732,10 +233807,10 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin return SQLITE_OK } else { n = libc.Xstrlen(tls, zName) - p = Xsqlite3_malloc64(tls, uint64(uint32(16)+n+uint32(1))) + p = Xsqlite3_malloc64(tls, uint64(uint32(libc.UintptrFromInt32(0)+12)+(n+libc.Uint32FromInt32(1)))) if p == uintptr(0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pData) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pData) } Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return int32(SQLITE_NOMEM) @@ -241746,7 +233821,7 @@ func Xsqlite3_set_clientdata(tls *libc.TLS, db uintptr, zName uintptr, pData uin } } (*TDbClientData)(unsafe.Pointer(p)).FpData = pData - (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = xDestructor + (*TDbClientData)(unsafe.Pointer(p)).FxDestructor = __ccgo_fp_xDestructor Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) return SQLITE_OK } @@ -241789,20 +233864,20 @@ func Xsqlite3_get_autocommit(tls *libc.TLS, db uintptr) (r int32) { func _sqlite3ReportError(tls *libc.TLS, iErr int32, lineno int32, zType uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) - Xsqlite3_log(tls, iErr, __ccgo_ts+26315, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) + Xsqlite3_log(tls, iErr, __ccgo_ts+26478, libc.VaList(bp+8, zType, lineno, uintptr(20)+Xsqlite3_sourceid(tls))) return iErr } func _sqlite3CorruptError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+26340) + return _sqlite3ReportError(tls, int32(SQLITE_CORRUPT), lineno, __ccgo_ts+26503) } func _sqlite3MisuseError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26360) + return _sqlite3ReportError(tls, int32(SQLITE_MISUSE), lineno, __ccgo_ts+26523) } func _sqlite3CantopenError(tls *libc.TLS, lineno int32) (r int32) { - return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26367) + return _sqlite3ReportError(tls, int32(SQLITE_CANTOPEN), lineno, __ccgo_ts+26530) } // C documentation @@ -241827,9 +233902,9 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, bp := tls.Alloc(32) defer tls.Free(32) var autoinc, iCol, notnull, primarykey, rc int32 - var pCol, pTab, zCollSeq, zDataType, v2, v3 uintptr + var pCol, pTab, zCollSeq, zDataType, v1, v2 uintptr var _ /* zErrMsg at bp+0 */ uintptr - _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v2, v3 + _, _, _, _, _, _, _, _, _, _, _ = autoinc, iCol, notnull, pCol, pTab, primarykey, rc, zCollSeq, zDataType, v1, v2 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) pTab = uintptr(0) pCol = uintptr(0) @@ -241856,29 +233931,18 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, if zColumnName == uintptr(0) { /* Query for existence of table only */ } else { - iCol = 0 - for { - if !(iCol < int32((*TTable)(unsafe.Pointer(pTab)).FnCol)) { - break - } + iCol = _sqlite3ColumnIndex(tls, pTab, zColumnName) + if iCol >= 0 { pCol = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 - if 0 == _sqlite3StrICmp(tls, (*TColumn)(unsafe.Pointer(pCol)).FzCnName, zColumnName) { - break - } - goto _1 - _1: - ; - iCol++ - } - if iCol == int32((*TTable)(unsafe.Pointer(pTab)).FnCol) { + } else { if (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_WithoutRowid) == uint32(0) && _sqlite3IsRowid(tls, zColumnName) != 0 { iCol = int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) if iCol >= 0 { - v2 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 + v1 = (*TTable)(unsafe.Pointer(pTab)).FaCol + uintptr(iCol)*12 } else { - v2 = uintptr(0) + v1 = uintptr(0) } - pCol = v2 + pCol = v1 } else { pTab = uintptr(0) goto error_out @@ -241902,7 +233966,7 @@ func Xsqlite3_table_column_metadata(tls *libc.TLS, db uintptr, zDbName uintptr, primarykey = libc.BoolInt32(int32((*TColumn)(unsafe.Pointer(pCol)).FcolFlags)&int32(COLFLAG_PRIMKEY) != 0) autoinc = libc.BoolInt32(int32((*TTable)(unsafe.Pointer(pTab)).FiPKey) == iCol && (*TTable)(unsafe.Pointer(pTab)).FtabFlags&uint32(TF_Autoincrement) != uint32(0)) } else { - zDataType = __ccgo_ts + 1147 + zDataType = __ccgo_ts + 1148 primarykey = int32(1) } if !(zCollSeq != 0) { @@ -241933,15 +233997,15 @@ error_out: } if SQLITE_OK == rc && !(pTab != 0) { _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) - *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+26384, libc.VaList(bp+16, zTableName, zColumnName)) + *(*uintptr)(unsafe.Pointer(bp)) = _sqlite3MPrintf(tls, db, __ccgo_ts+26547, libc.VaList(bp+16, zTableName, zColumnName)) rc = int32(SQLITE_ERROR) } if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - v3 = __ccgo_ts + 4710 + v2 = __ccgo_ts + 4829 } else { - v3 = uintptr(0) + v2 = uintptr(0) } - _sqlite3ErrorWithMsg(tls, db, rc, v3, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) + _sqlite3ErrorWithMsg(tls, db, rc, v2, libc.VaList(bp+16, *(*uintptr)(unsafe.Pointer(bp)))) _sqlite3DbFree(tls, db, *(*uintptr)(unsafe.Pointer(bp))) rc = _sqlite3ApiExit(tls, db, rc) Xsqlite3_mutex_leave(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) @@ -242120,8 +234184,8 @@ func Xsqlite3_test_control(tls *libc.TLS, op int32, va uintptr) (r int32) { /* sqlite3_test_control(SQLITE_TESTCTRL_FK_NO_ACTION, sqlite3 *db, int b); ** ** If b is true, then activate the SQLITE_FkNoAction setting. If b is - ** false then clearn that setting. If the SQLITE_FkNoAction setting is - ** abled, all foreign key ON DELETE and ON UPDATE actions behave as if + ** false then clear that setting. If the SQLITE_FkNoAction setting is + ** enabled, all foreign key ON DELETE and ON UPDATE actions behave as if ** they were NO ACTION, regardless of how they are defined. ** ** NB: One must usually run "PRAGMA writable_schema=RESET" after @@ -242961,7 +235025,7 @@ func Xsqlite3_compileoption_used(tls *libc.TLS, zOptName uintptr) (r int32) { var _ /* nOpt at bp+0 */ int32 _, _, _ = azCompileOpt, i, n azCompileOpt = _sqlite3CompileOptions(tls, bp) - if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+26412, int32(7)) == 0 { + if Xsqlite3_strnicmp(tls, zOptName, __ccgo_ts+26575, int32(7)) == 0 { zOptName += uintptr(7) } n = _sqlite3Strlen30(tls, zOptName) @@ -243109,6 +235173,8 @@ func _leaveMutex(tls *libc.TLS) { Xsqlite3_mutex_leave(tls, _sqlite3MutexAlloc(tls, int32(SQLITE_MUTEX_STATIC_MAIN))) } +type t__ccgo_fp__Xsqlite3_unlock_notify_1 = func(*libc.TLS, uintptr, int32) + // C documentation // // /* @@ -243132,7 +235198,7 @@ func _leaveMutex(tls *libc.TLS) { // ** on the same "db". If xNotify==0 then any prior callbacks are immediately // ** cancelled. // */ -func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg uintptr) (r int32) { +func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, __ccgo_fp_xNotify uintptr, _pArg uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*uintptr)(unsafe.Pointer(bp)) = _pArg @@ -243142,7 +235208,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = SQLITE_OK Xsqlite3_mutex_enter(tls, (*Tsqlite3)(unsafe.Pointer(db)).Fmutex) _enterMutex(tls) - if xNotify == uintptr(0) { + if __ccgo_fp_xNotify == uintptr(0) { _removeFromBlockedList(tls, db) (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection = uintptr(0) (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = uintptr(0) @@ -243154,7 +235220,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui ** blocking transaction. In either case, invoke the notify callback ** immediately. */ - (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xNotify})))(tls, bp, int32(1)) + (*(*func(*libc.TLS, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xNotify})))(tls, bp, int32(1)) } else { p = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection for { @@ -243170,7 +235236,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui rc = int32(SQLITE_LOCKED) /* Deadlock detected. */ } else { (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockConnection = (*Tsqlite3)(unsafe.Pointer(db)).FpBlockingConnection - (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = xNotify + (*Tsqlite3)(unsafe.Pointer(db)).FxUnlockNotify = __ccgo_fp_xNotify (*Tsqlite3)(unsafe.Pointer(db)).FpUnlockArg = *(*uintptr)(unsafe.Pointer(bp)) _removeFromBlockedList(tls, db) _addToBlockedList(tls, db) @@ -243179,7 +235245,7 @@ func Xsqlite3_unlock_notify(tls *libc.TLS, db uintptr, xNotify uintptr, _pArg ui } _leaveMutex(tls) if rc != 0 { - v2 = __ccgo_ts + 26420 + v2 = __ccgo_ts + 26583 } else { v2 = uintptr(0) } @@ -243425,7 +235491,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Here, array { X } means zero or more occurrences of X, adjacent in ** memory. A "position" is an index of a token in the token stream ** generated by the tokenizer. Note that POS_END and POS_COLUMN occur -** in the same logical place as the position element, and act as sentinals +** in the same logical place as the position element, and act as sentinels ** ending a position list array. POS_END is 0. POS_COLUMN is 1. ** The positions numbers are not stored literally but rather as two more ** than the difference from the prior position, or the just the position plus @@ -243642,6 +235708,13 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ +/* #include */ + /* FTS3/FTS4 require virtual tables */ /* @@ -243954,8 +236027,8 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** Beginning with version 3.45.0 (circa 2024-01-01), these routines also ** accept BLOB values that have JSON encoded using a binary representation ** called "JSONB". The name JSONB comes from PostgreSQL, however the on-disk -** format SQLite JSONB is completely different and incompatible with -** PostgreSQL JSONB. +** format for SQLite-JSONB is completely different and incompatible with +** PostgreSQL-JSONB. ** ** Decoding and interpreting JSONB is still O(N) where N is the size of ** the input, the same as text JSON. However, the constant of proportionality @@ -244012,7 +236085,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** ** The payload size need not be expressed in its minimal form. For example, ** if the payload size is 10, the size can be expressed in any of 5 different -** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by on 0x0a byte, +** ways: (1) (X>>4)==10, (2) (X>>4)==12 following by one 0x0a byte, ** (3) (X>>4)==13 followed by 0x00 and 0x0a, (4) (X>>4)==14 followed by ** 0x00 0x00 0x00 0x0a, or (5) (X>>4)==15 followed by 7 bytes of 0x00 and ** a single byte of 0x0a. The shorter forms are preferred, of course, but @@ -244022,7 +236095,7 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { ** the size when it becomes known, resulting in a non-minimal encoding. ** ** The value (X>>4)==15 is not actually used in the current implementation -** (as SQLite is currently unable handle BLOBs larger than about 2GB) +** (as SQLite is currently unable to handle BLOBs larger than about 2GB) ** but is included in the design to allow for future enhancements. ** ** The payload follows the header. NULL, TRUE, and FALSE have no payload and @@ -244059,23 +236132,23 @@ func _sqlite3ConnectionClosed(tls *libc.TLS, db uintptr) { // ** string must correspond to the JSONB_* integer above. // */ var _jsonbType = [17]uintptr{ - 0: __ccgo_ts + 1659, - 1: __ccgo_ts + 9382, - 2: __ccgo_ts + 9387, - 3: __ccgo_ts + 7696, - 4: __ccgo_ts + 7696, - 5: __ccgo_ts + 7691, - 6: __ccgo_ts + 7691, - 7: __ccgo_ts + 9693, - 8: __ccgo_ts + 9693, - 9: __ccgo_ts + 9693, - 10: __ccgo_ts + 9693, - 11: __ccgo_ts + 26443, - 12: __ccgo_ts + 26449, - 13: __ccgo_ts + 1673, - 14: __ccgo_ts + 1673, - 15: __ccgo_ts + 1673, - 16: __ccgo_ts + 1673, + 0: __ccgo_ts + 1660, + 1: __ccgo_ts + 9469, + 2: __ccgo_ts + 9474, + 3: __ccgo_ts + 7783, + 4: __ccgo_ts + 7783, + 5: __ccgo_ts + 7778, + 6: __ccgo_ts + 7778, + 7: __ccgo_ts + 9780, + 8: __ccgo_ts + 9780, + 9: __ccgo_ts + 9780, + 10: __ccgo_ts + 9780, + 11: __ccgo_ts + 26606, + 12: __ccgo_ts + 26612, + 13: __ccgo_ts + 1674, + 14: __ccgo_ts + 1674, + 15: __ccgo_ts + 1674, + 16: __ccgo_ts + 1674, } // C documentation @@ -244381,108 +236454,6 @@ type TJsonParse = struct { type JsonParse = TJsonParse -/* -** Magic number used for the JSON parse cache in sqlite3_get_auxdata() - */ - -/* -** jsonUnescapeOneChar() returns this invalid code point if it encounters -** a syntax error. - */ - -/* A cache mapping JSON text into JSONB blobs. -** -** Each cache entry is a JsonParse object with the following restrictions: -** -** * The bReadOnly flag must be set -** -** * The aBlob[] array must be owned by the JsonParse object. In other -** words, nBlobAlloc must be non-zero. -** -** * eEdit and delta must be zero. -** -** * zJson must be an RCStr. In other words bJsonIsRCStr must be true. - */ -type TJsonCache1 = struct { - Fdb uintptr - FnUsed int32 - Fa [4]uintptr -} - -type JsonCache1 = TJsonCache1 - -/* An instance of this object represents a JSON string -** under construction. Really, this is a generic string accumulator -** that can be and is used to create strings other than JSON. -** -** If the generated string is longer than will fit into the zSpace[] buffer, -** then it will be an RCStr string. This aids with caching of large -** JSON strings. - */ -type TJsonString1 = struct { - F__ccgo_align [0]uint32 - FpCtx uintptr - FzBuf uintptr - FnAlloc Tu64 - FnUsed Tu64 - FbStatic Tu8 - FeErr Tu8 - FzSpace [100]int8 - F__ccgo_pad7 [2]byte -} - -type JsonString1 = TJsonString1 - -/* Allowed values for JsonString.eErr */ - -/* The "subtype" set for text JSON values passed through using -** sqlite3_result_subtype() and sqlite3_value_subtype(). - */ - -/* -** Bit values for the flags passed into various SQL function implementations -** via the sqlite3_user_data() value. - */ - -/* A parsed JSON value. Lifecycle: -** -** 1. JSON comes in and is parsed into a JSONB value in aBlob. The -** original text is stored in zJson. This step is skipped if the -** input is JSONB instead of text JSON. -** -** 2. The aBlob[] array is searched using the JSON path notation, if needed. -** -** 3. Zero or more changes are made to aBlob[] (via json_remove() or -** json_replace() or json_patch() or similar). -** -** 4. New JSON text is generated from the aBlob[] for output. This step -** is skipped if the function is one of the jsonb_* functions that -** returns JSONB instead of text JSON. - */ -type TJsonParse1 = struct { - FaBlob uintptr - FnBlob Tu32 - FnBlobAlloc Tu32 - FzJson uintptr - Fdb uintptr - FnJson int32 - FnJPRef Tu32 - FiErr Tu32 - FiDepth Tu16 - FnErr Tu8 - Foom Tu8 - FbJsonIsRCStr Tu8 - FhasNonstd Tu8 - FbReadOnly Tu8 - FeEdit Tu8 - Fdelta int32 - FnIns Tu32 - FiLabel Tu32 - FaIns uintptr -} - -type JsonParse1 = TJsonParse1 - /************************************************************************** ** Utility routines for dealing with JsonCache objects **************************************************************************/ @@ -244562,7 +236533,7 @@ func _jsonCacheInsert(tls *libc.TLS, ctx uintptr, pParse uintptr) (r int32) { // ** most-recently used entry if it isn't so already. // ** // ** The JsonParse object returned still belongs to the Cache and might -// ** be deleted at any moment. If the caller whants the JsonParse to +// ** be deleted at any moment. If the caller wants the JsonParse to // ** linger, it needs to increment the nPJRef reference counter. // */ func _jsonCacheSearch(tls *libc.TLS, ctx uintptr, pArg uintptr) (r uintptr) { @@ -244860,8 +236831,8 @@ func _jsonAppendControlChar(tls *libc.TLS, p uintptr, c Tu8) { *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(1)))) = int8('u') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(2)))) = int8('0') *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(3)))) = int8('0') - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 26456 + uintptr(int32(c)>>int32(4)))) - *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 26456 + uintptr(int32(c)&int32(0xf)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(4)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1696 + uintptr(int32(c)>>int32(4)))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(p)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(p)).FnUsed+uint64(5)))) = *(*int8)(unsafe.Pointer(__ccgo_ts + 1696 + uintptr(int32(c)&int32(0xf)))) *(*Tu64)(unsafe.Pointer(p + 16)) += uint64(6) } } @@ -244995,9 +236966,9 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _, _, _, _ = n, n1, z, z1 switch Xsqlite3_value_type(tls, pValue) { case int32(SQLITE_NULL): - _jsonAppendRawNZ(tls, p, __ccgo_ts+1659, uint32(4)) + _jsonAppendRawNZ(tls, p, __ccgo_ts+1660, uint32(4)) case int32(SQLITE_FLOAT): - _jsonPrintf(tls, int32(100), p, __ccgo_ts+16792, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) + _jsonPrintf(tls, int32(100), p, __ccgo_ts+16908, libc.VaList(bp+64, Xsqlite3_value_double(tls, pValue))) case int32(SQLITE_INTEGER): z = Xsqlite3_value_text(tls, pValue) n = uint32(Xsqlite3_value_bytes(tls, pValue)) @@ -245011,14 +236982,12 @@ func _jsonAppendSqlValue(tls *libc.TLS, p uintptr, pValue uintptr) { _jsonAppendString(tls, p, z1, n1) } default: - if _jsonFuncArgMightBeBinary(tls, pValue) != 0 { - libc.Xmemset(tls, bp, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, pValue) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, pValue)) + libc.Xmemset(tls, bp, 0, uint32(56)) + if _jsonArgIsJsonb(tls, pValue, bp) != 0 { _jsonTranslateBlobToText(tls, bp, uint32(0), p) } else { if int32((*TJsonString)(unsafe.Pointer(p)).FeErr) == 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26473, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26619, -int32(1)) (*TJsonString)(unsafe.Pointer(p)).FeErr = uint8(JSTRING_ERR) _jsonStringReset(tls, p) } @@ -245072,7 +237041,7 @@ func _jsonReturnString(tls *libc.TLS, p uintptr, pParse uintptr, ctx uintptr) { Xsqlite3_result_error_nomem(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx) } else { if int32((*TJsonString)(unsafe.Pointer(p)).FeErr)&int32(JSTRING_MALFORMED) != 0 { - Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, (*TJsonString)(unsafe.Pointer(p)).FpCtx, __ccgo_ts+26648, -int32(1)) } } } @@ -245355,8 +237324,8 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(3), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26517, - FzRepl: __ccgo_ts + 26521, + FzMatch: __ccgo_ts + 26663, + FzRepl: __ccgo_ts + 26667, }, 1: { Fc1: int8('i'), @@ -245364,32 +237333,32 @@ var _aNanInfName = [5]TNanInfName{ Fn: int8(8), FeType: int8(JSONB_FLOAT), FnRepl: int8(7), - FzMatch: __ccgo_ts + 26529, - FzRepl: __ccgo_ts + 26521, + FzMatch: __ccgo_ts + 26675, + FzRepl: __ccgo_ts + 26667, }, 2: { Fc1: int8('n'), Fc2: int8('N'), Fn: int8(3), FnRepl: int8(4), - FzMatch: __ccgo_ts + 1664, - FzRepl: __ccgo_ts + 1659, + FzMatch: __ccgo_ts + 1665, + FzRepl: __ccgo_ts + 1660, }, 3: { Fc1: int8('q'), Fc2: int8('Q'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26538, - FzRepl: __ccgo_ts + 1659, + FzMatch: __ccgo_ts + 26684, + FzRepl: __ccgo_ts + 1660, }, 4: { Fc1: int8('s'), Fc2: int8('S'), Fn: int8(4), FnRepl: int8(4), - FzMatch: __ccgo_ts + 26543, - FzRepl: __ccgo_ts + 1659, + FzMatch: __ccgo_ts + 26689, + FzRepl: __ccgo_ts + 1660, }, } @@ -245404,7 +237373,7 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26548, libc.VaList(bp+8, zFuncName)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26694, libc.VaList(bp+8, zFuncName)) Xsqlite3_result_error(tls, pCtx, zMsg, -int32(1)) Xsqlite3_free(tls, zMsg) } @@ -245422,23 +237391,23 @@ func _jsonWrongNumArgs(tls *libc.TLS, pCtx uintptr, zFuncName uintptr) { // */ func _jsonBlobExpand(tls *libc.TLS, pParse uintptr, N Tu32) (r int32) { var aNew uintptr - var t Tu32 + var t Tu64 _, _ = aNew, t if (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc == uint32(0) { - t = uint32(100) + t = uint64(100) } else { - t = (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2) + t = uint64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc * uint32(2)) } - if t < N { - t = N + uint32(100) + if t < uint64(N) { + t = uint64(N + uint32(100)) } - aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, uint64(t)) + aNew = _sqlite3DbRealloc(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob, t) if aNew == uintptr(0) { (*TJsonParse)(unsafe.Pointer(pParse)).Foom = uint8(1) return int32(1) } (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = aNew - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = t + (*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc = uint32(t) return 0 } @@ -245516,7 +237485,7 @@ func _jsonBlobExpandAndAppendNode(tls *libc.TLS, pParse uintptr, eType Tu8, szPa // C documentation // -// /* Append an node type byte together with the payload size and +// /* Append a node type byte together with the payload size and // ** possibly also the payload. // ** // ** If aPayload is not NULL, then it is a pointer to the payload which @@ -245587,7 +237556,11 @@ func _jsonBlobChangePayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, szPayload if int32(szType) == int32(13) { nExtra = uint8(2) } else { - nExtra = uint8(4) + if int32(szType) == int32(14) { + nExtra = uint8(4) + } else { + nExtra = uint8(8) + } } } } @@ -245862,7 +237835,7 @@ func _jsonbValidityCheck(tls *libc.TLS, pParse uintptr, i Tu32, iEnd Tu32, iDept if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j)))) != int32('\\') || j+uint32(1) >= k { return j + uint32(1) } else { - if libc.Xstrchr(tls, __ccgo_ts+26591, int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { + if libc.Xstrchr(tls, __ccgo_ts+26737, int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) != uintptr(0) { j++ } else { if int32(*(*Tu8)(unsafe.Pointer(z + uintptr(j+uint32(1))))) == int32('u') { @@ -246292,7 +238265,7 @@ parse_string: opcode = uint8(JSONB_TEXTJ) } } else { - if int32(c) == int32('\'') || int32(c) == int32('0') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { + if int32(c) == int32('\'') || int32(c) == int32('v') || int32(c) == int32('\n') || int32(c) == int32('0') && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))])&libc.Int32FromInt32(0x04) != 0) || int32(0xe2) == int32(uint8(c)) && int32(0x80) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(1)))))) && (int32(0xa8) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2)))))) || int32(0xa9) == int32(uint8(*(*int8)(unsafe.Pointer(z + uintptr(j+uint32(2))))))) || int32(c) == int32('x') && _jsonIs2Hex(tls, z+uintptr(j+uint32(1))) != 0 { opcode = uint8(JSONB_TEXT5) (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) } else { @@ -246331,7 +238304,7 @@ parse_string: return int32(j + uint32(1)) _5: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9382, uint32(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9469, uint32(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_TRUE)) return int32(i + uint32(4)) } @@ -246339,7 +238312,7 @@ _5: return -int32(1) _6: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9387, uint32(5)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+9474, uint32(5)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(5)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_FALSE)) return int32(i + uint32(5)) } @@ -246416,14 +238389,14 @@ parse_number: /* JSON5 allows for "+Infinity" and "-Infinity" using exactly ** that case. SQLite also allows these in any case and it allows ** "+inf" and "-inf". */ - if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+26517, int32(3)) == 0 { + if (int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('I') || int32(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(1))))) == int32('i')) && Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(1)), __ccgo_ts+26663, int32(3)) == 0 { (*TJsonParse)(unsafe.Pointer(pParse)).FhasNonstd = uint8(1) if int32(*(*int8)(unsafe.Pointer(z + uintptr(i)))) == int32('-') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26600) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26746) } else { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26607) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26753) } - if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26613, int32(5)) == 0 { + if Xsqlite3_strnicmp(tls, z+uintptr(i+uint32(4)), __ccgo_ts+26759, int32(5)) == 0 { v48 = int32(9) } else { v48 = int32(4) @@ -246584,7 +238557,7 @@ _29: return -int32(1) _37: ; - if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1659, uint32(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { + if libc.Xstrncmp(tls, z+uintptr(i), __ccgo_ts+1660, uint32(4)) == 0 && !(int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + uintptr(i+uint32(4)))))])&libc.Int32FromInt32(0x06) != 0) { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) return int32(i + uint32(4)) } @@ -246608,7 +238581,7 @@ _38: goto _51 } if int32(_aNanInfName[k1].FeType) == int32(JSONB_FLOAT) { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26607) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26753) } else { _jsonBlobAppendOneByte(tls, pParse, uint8(JSONB_NULL)) } @@ -246653,7 +238626,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 i += _json5Whitespace(tls, zJson+uintptr(i)) if *(*int8)(unsafe.Pointer(zJson + uintptr(i))) != 0 { if pCtx != 0 { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) } _jsonParseReset(tls, pParse) return int32(1) @@ -246666,7 +238639,7 @@ func _jsonConvertTextToBlob(tls *libc.TLS, pParse uintptr, pCtx uintptr) (r int3 if (*TJsonParse)(unsafe.Pointer(pParse)).Foom != 0 { Xsqlite3_result_error_nomem(tls, pCtx) } else { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) } } _jsonParseReset(tls, pParse) @@ -246715,10 +238688,6 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu var n, sz Tu32 var x Tu8 _, _, _ = n, sz, x - if i > (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob { - *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) - return uint32(0) - } x = uint8(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) >> int32(4)) if int32(x) <= int32(11) { sz = uint32(x) @@ -246752,15 +238721,15 @@ func _jsonbPayloadSize(tls *libc.TLS, pParse uintptr, i Tu32, pSz uintptr) (r Tu *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) return uint32(0) } - sz = uint32(int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+uint32(5)))))< int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob) && int64(i)+int64(sz)+int64(n) > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob-uint32((*TJsonParse)(unsafe.Pointer(pParse)).Fdelta)) { - sz = uint32(0) - n = uint32(0) + *(*Tu32)(unsafe.Pointer(pSz)) = uint32(0) + return uint32(0) } *(*Tu32)(unsafe.Pointer(pSz)) = sz return n @@ -246829,15 +238798,15 @@ func _jsonTranslateBlobToText(tls *libc.TLS, pParse uintptr, i Tu32, pOut uintpt goto _16 _2: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1659, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+1660, uint32(4)) return i + uint32(1) _3: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9382, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9469, uint32(4)) return i + uint32(1) _4: ; - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9387, uint32(5)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+9474, uint32(5)) return i + uint32(1) _6: ; @@ -246886,9 +238855,9 @@ _7: k++ } if bOverflow != 0 { - v19 = __ccgo_ts + 26521 + v19 = __ccgo_ts + 26667 } else { - v19 = __ccgo_ts + 13249 + v19 = __ccgo_ts + 13365 } _jsonPrintf(tls, int32(100), pOut, v19, libc.VaList(bp+16, u)) goto _16 @@ -246924,9 +238893,12 @@ _10: ; _9: ; - _jsonAppendChar(tls, pOut, int8('"')) - _jsonAppendRaw(tls, pOut, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) - _jsonAppendChar(tls, pOut, int8('"')) + if (*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(2) <= (*TJsonString)(unsafe.Pointer(pOut)).FnAlloc || _jsonStringGrow(tls, pOut, *(*Tu32)(unsafe.Pointer(bp))+uint32(2)) == 0 { + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed))) = int8('"') + libc.Xmemcpy(tls, (*TJsonString)(unsafe.Pointer(pOut)).FzBuf+uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed)+uintptr(1), (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(i+n), *(*Tu32)(unsafe.Pointer(bp))) + *(*int8)(unsafe.Pointer((*TJsonString)(unsafe.Pointer(pOut)).FzBuf + uintptr((*TJsonString)(unsafe.Pointer(pOut)).FnUsed+uint64(*(*Tu32)(unsafe.Pointer(bp)))+uint64(1)))) = int8('"') + *(*Tu64)(unsafe.Pointer(pOut + 16)) += uint64(*(*Tu32)(unsafe.Pointer(bp)) + uint32(2)) + } goto _16 _11: ; @@ -246953,7 +238925,7 @@ _11: sz2 -= k2 } if int32(*(*int8)(unsafe.Pointer(zIn2))) == int32('"') { - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26619, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26765, uint32(2)) zIn2++ sz2-- continue @@ -246976,7 +238948,7 @@ _11: case int32('\''): _jsonAppendChar(tls, pOut, int8('\'')) case int32('v'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26622, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26768, uint32(6)) case int32('x'): if sz2 < uint32(4) { p23 = pOut + 25 @@ -246984,12 +238956,12 @@ _11: sz2 = uint32(2) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26629, uint32(4)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26775, uint32(4)) _jsonAppendRawNZ(tls, pOut, zIn2+2, uint32(2)) zIn2 += uintptr(2) sz2 -= uint32(2) case int32('0'): - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26634, uint32(6)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26780, uint32(6)) case int32('\r'): if sz2 > uint32(2) && int32(*(*int8)(unsafe.Pointer(zIn2 + 2))) == int32('\n') { zIn2++ @@ -247092,16 +239064,6 @@ type TJsonPretty = struct { type JsonPretty = TJsonPretty -type TJsonPretty1 = struct { - FpParse uintptr - FpOut uintptr - FzIndent uintptr - FszIndent Tu32 - FnIndent Tu32 -} - -type JsonPretty1 = TJsonPretty1 - // C documentation // // /* Append indentation to the pretty JSON under construction */ @@ -247169,7 +239131,7 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26641, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -247192,12 +239154,12 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T *(*Tu8)(unsafe.Pointer(p2)) = Tu8(int32(*(*Tu8)(unsafe.Pointer(p2))) | libc.Int32FromInt32(JSTRING_MALFORMED)) break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26644, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26790, uint32(2)) j = _jsonTranslateBlobToPrettyText(tls, pPretty, j) if j >= iEnd { break } - _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26641, uint32(2)) + _jsonAppendRawNZ(tls, pOut, __ccgo_ts+26787, uint32(2)) } _jsonAppendChar(tls, pOut, int8('\n')) (*TJsonPretty)(unsafe.Pointer(pPretty)).FnIndent-- @@ -247212,50 +239174,6 @@ func _jsonTranslateBlobToPrettyText(tls *libc.TLS, pPretty uintptr, i Tu32) (r T return i } -// C documentation -// -// /* Return true if the input pJson -// ** -// ** For performance reasons, this routine does not do a detailed check of the -// ** input BLOB to ensure that it is well-formed. Hence, false positives are -// ** possible. False negatives should never occur, however. -// */ -func _jsonFuncArgMightBeBinary(tls *libc.TLS, pJson uintptr) (r int32) { - bp := tls.Alloc(64) - defer tls.Free(64) - var aBlob uintptr - var n Tu32 - var nBlob int32 - var _ /* s at bp+4 */ TJsonParse - var _ /* sz at bp+0 */ Tu32 - _, _, _ = aBlob, n, nBlob - if Xsqlite3_value_type(tls, pJson) != int32(SQLITE_BLOB) { - return 0 - } - aBlob = Xsqlite3_value_blob(tls, pJson) - nBlob = Xsqlite3_value_bytes(tls, pJson) - if nBlob < int32(1) { - return 0 - } - if aBlob == uintptr(0) || int32(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) > int32(JSONB_OBJECT) { - return 0 - } - libc.Xmemset(tls, bp+4, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FaBlob = aBlob - (*(*TJsonParse)(unsafe.Pointer(bp + 4))).FnBlob = uint32(nBlob) - n = _jsonbPayloadSize(tls, bp+4, uint32(0), bp) - if n == uint32(0) { - return 0 - } - if *(*Tu32)(unsafe.Pointer(bp))+n != uint32(nBlob) { - return 0 - } - if int32(*(*Tu8)(unsafe.Pointer(aBlob)))&int32(0x0f) <= int32(JSONB_FALSE) && *(*Tu32)(unsafe.Pointer(bp)) > uint32(0) { - return 0 - } - return libc.BoolInt32(*(*Tu32)(unsafe.Pointer(bp))+n == uint32(nBlob)) -} - // C documentation // // /* @@ -247307,6 +239225,84 @@ func _jsonAfterEditSizeAdjust(tls *libc.TLS, pParse uintptr, iRoot Tu32) { *(*int32)(unsafe.Pointer(pParse + 40)) += _jsonBlobChangePayloadSize(tls, pParse, iRoot, *(*Tu32)(unsafe.Pointer(bp))) } +// C documentation +// +// /* +// ** If the JSONB at aIns[0..nIns-1] can be expanded (by denormalizing the +// ** size field) by d bytes, then write the expansion into aOut[] and +// ** return true. In this way, an overwrite happens without changing the +// ** size of the JSONB, which reduces memcpy() operations and also make it +// ** faster and easier to update the B-Tree entry that contains the JSONB +// ** in the database. +// ** +// ** If the expansion of aIns[] by d bytes cannot be (easily) accomplished +// ** then return false. +// ** +// ** The d parameter is guaranteed to be between 1 and 8. +// ** +// ** This routine is an optimization. A correct answer is obtained if it +// ** always leaves the output unchanged and returns false. +// */ +func _jsonBlobOverwrite(tls *libc.TLS, aOut uintptr, aIns uintptr, nIns Tu32, d Tu32) (r int32) { + var i, szPayload Tu32 + var szHdr Tu8 + _, _, _ = i, szHdr, szPayload /* Size of header before expansion */ + if int32(*(*Tu8)(unsafe.Pointer(aIns)))&int32(0x0f) <= int32(2) { + return 0 + } /* Cannot enlarge NULL, true, false */ + switch int32(*(*Tu8)(unsafe.Pointer(aIns))) >> libc.Int32FromInt32(4) { + default: /* aIns[] header size 1 */ + if int32(1)<>= uint32(8) + } + return int32(1) +} + +/* Lookup table for finding the upper 4 bits of the first byte of the + ** expanded aIns[], based on the size of the expanded aIns[] header: + ** + ** 2 3 4 5 6 7 8 9 */ +var _aType1 = [8]Tu8{ + 0: uint8(0xc0), + 1: uint8(0xd0), + 3: uint8(0xe0), + 7: uint8(0xf0), +} + // C documentation // // /* @@ -247327,6 +239323,9 @@ func _jsonBlobEdit(tls *libc.TLS, pParse uintptr, iDel Tu32, nDel Tu32, aIns uin var p1, p2 uintptr _, _, _ = d, p1, p2 d = int64(nIns) - int64(nDel) + if d < 0 && d >= int64(-libc.Int32FromInt32(8)) && aIns != uintptr(0) && _jsonBlobOverwrite(tls, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob+uintptr(iDel), aIns, nIns, uint32(int32(-d))) != 0 { + return + } if d != 0 { if int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d > int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlobAlloc) { _jsonBlobExpand(tls, pParse, uint32(int64((*TJsonParse)(unsafe.Pointer(pParse)).FnBlob)+d)) @@ -247399,9 +239398,9 @@ func _jsonBytesToBypass(tls *libc.TLS, z uintptr, n Tu32) (r Tu32) { // */ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu32) { var nSkip, v, vlo, v1 Tu32 - var sz int32 + var sz, v3 int32 var v2 bool - _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2 + _, _, _, _, _, _, _ = nSkip, sz, v, vlo, v1, v2, v3 if n < uint32(2) { *(*Tu32)(unsafe.Pointer(piOut)) = uint32(JSON_INVALID_CHAR) return n @@ -247444,7 +239443,18 @@ func _jsonUnescapeOneChar(tls *libc.TLS, z uintptr, n Tu32, piOut uintptr) (r Tu *(*Tu32)(unsafe.Pointer(piOut)) = uint32('\v') return uint32(2) case int32('0'): - *(*Tu32)(unsafe.Pointer(piOut)) = uint32(0) + /* JSON5 requires that the \0 escape not be followed by a digit. + ** But SQLite did not enforce this restriction in versions 3.42.0 + ** through 3.49.2. That was a bug. But some applications might have + ** come to depend on that bug. Use the SQLITE_BUG_COMPATIBLE_20250510 + ** option to restore the old buggy behavior. */ + /* Correct behavior */ + if n > uint32(2) && int32(_sqlite3CtypeMap[uint8(*(*int8)(unsafe.Pointer(z + 2)))])&int32(0x04) != 0 { + v3 = int32(JSON_INVALID_CHAR) + } else { + v3 = 0 + } + *(*Tu32)(unsafe.Pointer(piOut)) = uint32(v3) return uint32(2) case int32('\''): fallthrough @@ -247932,7 +239942,7 @@ func _jsonReturnFromBlob(tls *libc.TLS, pParse uintptr, i Tu32, pCtx uintptr, te db = Xsqlite3_context_db_handle(tls, pCtx) n = _jsonbPayloadSize(tls, pParse, i, bp) if n == uint32(0) { - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) return } switch int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i)))) & libc.Int32FromInt32(0x0f) { @@ -248067,7 +240077,7 @@ _10: ; nOut = *(*Tu32)(unsafe.Pointer(bp)) z2 = (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob + uintptr(i+n) - zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut+uint32(1))) + zOut = _sqlite3DbMallocRaw(tls, db, uint64(nOut)+uint64(1)) if zOut == uintptr(0) { goto returnfromblob_oom } @@ -248168,7 +240178,7 @@ returnfromblob_oom: goto returnfromblob_malformed returnfromblob_malformed: ; - Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, pCtx, __ccgo_ts+26648, -int32(1)) return } @@ -248205,11 +240215,8 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(1) return 0 case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, pArg) != 0 { - (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(pParse)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) - } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26473, -int32(1)) + if !(_jsonArgIsJsonb(tls, pArg, pParse) != 0) { + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26619, -int32(1)) return int32(1) } case int32(SQLITE_TEXT): @@ -248222,7 +240229,7 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin (*TJsonParse)(unsafe.Pointer(pParse)).FzJson = zJson (*TJsonParse)(unsafe.Pointer(pParse)).FnJson = nJson if _jsonConvertTextToBlob(tls, pParse, ctx) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) _sqlite3DbFree(tls, (*TJsonParse)(unsafe.Pointer(pParse)).Fdb, (*TJsonParse)(unsafe.Pointer(pParse)).FaBlob) libc.Xmemset(tls, pParse, 0, uint32(56)) return int32(1) @@ -248241,10 +240248,10 @@ func _jsonFunctionArgToBlob(tls *libc.TLS, ctx uintptr, pArg uintptr, pParse uin return int32(1) } if int32(*(*int8)(unsafe.Pointer(z))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26607) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(5), __ccgo_ts+26753) } else { if int32(*(*int8)(unsafe.Pointer(z))) == int32('-') && int32(*(*int8)(unsafe.Pointer(z + 1))) == int32('I') { - _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26600) + _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(6), __ccgo_ts+26746) } else { _jsonBlobAppendNode(tls, pParse, uint8(JSONB_FLOAT), uint32(n), z) } @@ -248283,7 +240290,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { defer tls.Free(16) var zMsg uintptr _ = zMsg - zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26647, libc.VaList(bp+8, zPath)) + zMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26793, libc.VaList(bp+8, zPath)) if ctx == uintptr(0) { return zMsg } @@ -248299,7 +240306,7 @@ func _jsonBadPathError(tls *libc.TLS, ctx uintptr, zPath uintptr) (r uintptr) { // C documentation // // /* argv[0] is a BLOB that seems likely to be a JSONB. Subsequent -// ** arguments come in parse where each pair contains a JSON path and +// ** arguments come in pairs where each pair contains a JSON path and // ** content to insert or set at that patch. Do the updates // ** and return the result. // ** @@ -248380,7 +240387,7 @@ jsonInsertIntoBlob_patherror: ; _jsonParseFree(tls, p) if rc == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } else { _jsonBadPathError(tls, ctx, zPath) } @@ -248392,34 +240399,54 @@ jsonInsertIntoBlob_patherror: // /* // ** If pArg is a blob that seems like a JSONB blob, then initialize // ** p to point to that JSONB and return TRUE. If pArg does not seem like -// ** a JSONB blob, then return FALSE; -// ** -// ** This routine is only called if it is already known that pArg is a -// ** blob. The only open question is whether or not the blob appears -// ** to be a JSONB blob. +// ** a JSONB blob, then return FALSE. +// ** +// ** For small BLOBs (having no more than 7 bytes of payload) a full +// ** validity check is done. So for small BLOBs this routine only returns +// ** true if the value is guaranteed to be a valid JSONB. For larger BLOBs +// ** (8 byte or more of payload) only the size of the outermost element is +// ** checked to verify that the BLOB is superficially valid JSONB. +// ** +// ** A full JSONB validation is done on smaller BLOBs because those BLOBs might +// ** also be text JSON that has been incorrectly cast into a BLOB. +// ** (See tag-20240123-a and https://sqlite.org/forum/forumpost/012136abd5) +// ** If the BLOB is 9 bytes are larger, then it is not possible for the +// ** superficial size check done here to pass if the input is really text +// ** JSON so we do not need to look deeper in that case. +// ** +// ** Why we only need to do full JSONB validation for smaller BLOBs: +// ** +// ** The first byte of valid JSON text must be one of: '{', '[', '"', ' ', '\n', +// ** '\r', '\t', '-', or a digit '0' through '9'. Of these, only a subset +// ** can also be the first byte of JSONB: '{', '[', and digits '3' +// ** through '9'. In every one of those cases, the payload size is 7 bytes +// ** or less. So if we do full JSONB validation for every BLOB where the +// ** payload is less than 7 bytes, we will never get a false positive for +// ** JSONB on an input that is really text JSON. // */ func _jsonArgIsJsonb(tls *libc.TLS, pArg uintptr, p uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) - var n, v1 Tu32 - var v2 bool + var c, v1 Tu8 + var n, v3 Tu32 + var v2, v4 bool var _ /* sz at bp+0 */ Tu32 - _, _, _ = n, v1, v2 + _, _, _, _, _, _ = c, n, v1, v2, v3, v4 *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) - (*TJsonParse)(unsafe.Pointer(p)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) - if (*TJsonParse)(unsafe.Pointer(p)).FnBlob == uint32(0) { - (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) + if Xsqlite3_value_type(tls, pArg) != int32(SQLITE_BLOB) { return 0 } - if (*TJsonParse)(unsafe.Pointer(p)).FaBlob == uintptr(0) { - return 0 + (*TJsonParse)(unsafe.Pointer(p)).FaBlob = Xsqlite3_value_blob(tls, pArg) + (*TJsonParse)(unsafe.Pointer(p)).FnBlob = uint32(Xsqlite3_value_bytes(tls, pArg)) + if v2 = (*TJsonParse)(unsafe.Pointer(p)).FnBlob > uint32(0) && (*TJsonParse)(unsafe.Pointer(p)).FaBlob != uintptr(0); v2 { + v1 = *(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)) + c = v1 } - if v2 = int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) <= int32(JSONB_OBJECT); v2 { - v1 = _jsonbPayloadSize(tls, p, uint32(0), bp) - n = v1 + if v4 = v2 && int32(v1)&int32(0x0f) <= int32(JSONB_OBJECT); v4 { + v3 = _jsonbPayloadSize(tls, p, uint32(0), bp) + n = v3 } - if v2 && v1 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (int32(*(*Tu8)(unsafe.Pointer((*TJsonParse)(unsafe.Pointer(p)).FaBlob)))&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) { + if v4 && v3 > uint32(0) && *(*Tu32)(unsafe.Pointer(bp))+n == (*TJsonParse)(unsafe.Pointer(p)).FnBlob && (int32(c)&int32(0x0f) > int32(JSONB_FALSE) || *(*Tu32)(unsafe.Pointer(bp)) == uint32(0)) && (*(*Tu32)(unsafe.Pointer(bp)) > uint32(7) || int32(c) != int32(0x7b) && int32(c) != int32(0x5b) && !(int32(_sqlite3CtypeMap[c])&libc.Int32FromInt32(0x04) != 0) || _jsonbValidityCheck(tls, p, uint32(0), (*TJsonParse)(unsafe.Pointer(p)).FnBlob, uint32(1)) == uint32(0)) { return int32(1) } (*TJsonParse)(unsafe.Pointer(p)).FaBlob = uintptr(0) @@ -248502,7 +240529,7 @@ rebuild_from_cache: ** JSON functions were suppose to work. From the beginning, blob was ** reserved for expansion and a blob value should have raised an error. ** But it did not, due to a bug. And many applications came to depend - ** upon this buggy behavior, espeically when using the CLI and reading + ** upon this buggy behavior, especially when using the CLI and reading ** JSON text using readfile(), which returns a blob. For this reason ** we will continue to support the bug moving forward. ** See for example https://sqlite.org/forum/forumpost/012136abd5292b8d @@ -248562,7 +240589,7 @@ json_pfa_malformed: return p } else { _jsonParseFree(tls, p) - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) return uintptr(0) } goto json_pfa_oom @@ -248697,7 +240724,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('$') { v1 = zPath + uintptr(1) } else { - v1 = __ccgo_ts + 26665 + v1 = __ccgo_ts + 26811 } i = _jsonLookupStep(tls, p, uint32(0), v1, uint32(0)) if i >= uint32(JSON_LOOKUP_PATHERROR) { @@ -248707,7 +240734,7 @@ func _jsonArrayLengthFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } eErr = uint8(1) @@ -248817,23 +240844,23 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { */ _jsonStringInit(tls, bp, ctx) if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) == int32(SQLITE_INTEGER) { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26667, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26813, uint32(1)) if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('-') { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26669, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26815, uint32(1)) } _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+6535, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+6623, uint32(2)) } else { if _jsonAllAlphanum(tls, zPath, nPath) != 0 { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1686, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1713, uint32(1)) _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) } else { if int32(*(*int8)(unsafe.Pointer(zPath))) == int32('[') && nPath >= int32(3) && int32(*(*int8)(unsafe.Pointer(zPath + uintptr(nPath-int32(1))))) == int32(']') { _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) } else { - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26671, uint32(2)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26817, uint32(2)) _jsonAppendRaw(tls, bp, zPath, uint32(nPath)) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+26674, uint32(1)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+26820, uint32(1)) } } } @@ -248869,11 +240896,11 @@ func _jsonExtractFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { goto json_extract_error /* Return NULL if not found */ } else { _jsonAppendSeparator(tls, bp) - _jsonAppendRawNZ(tls, bp, __ccgo_ts+1659, uint32(4)) + _jsonAppendRawNZ(tls, bp, __ccgo_ts+1660, uint32(4)) } } else { if j == uint32(JSON_LOOKUP_ERROR) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) goto json_extract_error } else { _jsonBadPathError(tls, ctx, zPath) @@ -249141,7 +241168,7 @@ func _jsonPatchFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == int32(JSON_MERGE_OOM) { Xsqlite3_result_error_nomem(tls, ctx) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } _jsonParseFree(tls, pPatch) @@ -249165,7 +241192,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { var _ /* jx at bp+0 */ TJsonString _, _, _ = i, n, z if argc&int32(1) != 0 { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26676, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26822, -int32(1)) return } _jsonStringInit(tls, bp, ctx) @@ -249176,7 +241203,7 @@ func _jsonObjectFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { break } if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) != int32(SQLITE_TEXT) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26727, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26873, -int32(1)) _jsonStringReset(tls, bp) return } @@ -249248,7 +241275,7 @@ func _jsonRemoveFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if rc == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } goto json_remove_done @@ -249285,7 +241312,7 @@ func _jsonReplaceFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { return } if argc&int32(1) == 0 { - _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17265) + _jsonWrongNumArgs(tls, ctx, __ccgo_ts+17428) return } _jsonInsertIntoBlob(tls, ctx, argc, argv, int32(JEDIT_REPL)) @@ -249316,9 +241343,9 @@ func _jsonSetFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { } if argc&int32(1) == 0 { if bIsSet != 0 { - v1 = __ccgo_ts + 26761 + v1 = __ccgo_ts + 26907 } else { - v1 = __ccgo_ts + 26765 + v1 = __ccgo_ts + 26911 } _jsonWrongNumArgs(tls, ctx, v1) return @@ -249366,7 +241393,7 @@ func _jsonTypeFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { if i == uint32(JSON_LOOKUP_PATHERROR) { _jsonBadPathError(tls, ctx, zPath) } else { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26502, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26648, -int32(1)) } } goto json_type_done @@ -249413,7 +241440,7 @@ func _jsonPrettyFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = v1 } if v2 || v1 == uintptr(0) { - (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 26772 + (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent = __ccgo_ts + 26918 (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = uint32(4) } else { (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FszIndent = libc.Xstrlen(tls, (*(*TJsonPretty)(unsafe.Pointer(bp + 128))).FzIndent) @@ -249487,17 +241514,16 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { defer tls.Free(112) var f Ti64 var flags, res Tu8 - var iErr Tu32 var p uintptr - var _ /* px at bp+0 */ TJsonParse var _ /* px at bp+56 */ TJsonParse - _, _, _, _, _ = f, flags, iErr, p, res /* The parse */ + var _ /* py at bp+0 */ TJsonParse + _, _, _, _ = f, flags, p, res /* The parse */ flags = uint8(1) res = uint8(0) if argc == int32(2) { f = Xsqlite3_value_int64(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) if f < int64(1) || f > int64(15) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+26777, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+26923, -int32(1)) return } flags = uint8(f & int64(0x0f)) @@ -249506,18 +241532,17 @@ func _jsonValidFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { case int32(SQLITE_NULL): return case int32(SQLITE_BLOB): - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { + libc.Xmemset(tls, bp, 0, uint32(56)) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { if int32(flags)&int32(0x04) != 0 { /* Superficial checking only - accomplished by the - ** jsonFuncArgMightBeBinary() call above. */ + ** jsonArgIsJsonb() call above. */ res = uint8(1) } else { if int32(flags)&int32(0x08) != 0 { - libc.Xmemset(tls, bp, 0, uint32(56)) - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - iErr = _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1)) - res = libc.BoolUint8(iErr == uint32(0)) + /* Strict checking. Check by translating BLOB->TEXT->BLOB. If + ** no errors occur, call that a "strict check". */ + res = libc.BoolUint8(uint32(0) == _jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } } break @@ -249579,9 +241604,7 @@ func _jsonErrorFunc(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc libc.Xmemset(tls, bp, 0, uint32(56)) (*(*TJsonParse)(unsafe.Pointer(bp))).Fdb = Xsqlite3_context_db_handle(tls, ctx) - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*(*TJsonParse)(unsafe.Pointer(bp))).FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) - (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), bp) != 0 { iErrPos = int64(_jsonbValidityCheck(tls, bp, uint32(0), (*(*TJsonParse)(unsafe.Pointer(bp))).FnBlob, uint32(1))) } else { (*(*TJsonParse)(unsafe.Pointer(bp))).FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -249688,7 +241711,7 @@ func _jsonArrayCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26834, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26980, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249780,20 +241803,22 @@ func _jsonObjectStep(tls *libc.TLS, ctx uintptr, argc int32, argv uintptr) { _ = argc pStr = Xsqlite3_aggregate_context(tls, ctx, int32(128)) if pStr != 0 { + z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) + n = uint32(_sqlite3Strlen30(tls, z)) if (*TJsonString)(unsafe.Pointer(pStr)).FzBuf == uintptr(0) { _jsonStringInit(tls, pStr, ctx) _jsonAppendChar(tls, pStr, int8('{')) } else { - if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) { + if (*TJsonString)(unsafe.Pointer(pStr)).FnUsed > uint64(1) && z != uintptr(0) { _jsonAppendChar(tls, pStr, int8(',')) } } (*TJsonString)(unsafe.Pointer(pStr)).FpCtx = ctx - z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) - n = uint32(_sqlite3Strlen30(tls, z)) - _jsonAppendString(tls, pStr, z, n) - _jsonAppendChar(tls, pStr, int8(':')) - _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*4))) + if z != uintptr(0) { + _jsonAppendString(tls, pStr, z, n) + _jsonAppendChar(tls, pStr, int8(':')) + _jsonAppendSqlValue(tls, pStr, *(*uintptr)(unsafe.Pointer(argv + 1*4))) + } } } @@ -249837,7 +241862,7 @@ func _jsonObjectCompute(tls *libc.TLS, ctx uintptr, isFinal int32) { } } } else { - Xsqlite3_result_text(tls, ctx, __ccgo_ts+26837, int32(2), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, ctx, __ccgo_ts+26983, int32(2), libc.UintptrFromInt32(0)) } Xsqlite3_result_subtype(tls, ctx, uint32(JSON_SUBTYPE)) } @@ -249866,17 +241891,6 @@ type TJsonParent = struct { type JsonParent = TJsonParent -type TJsonParent1 = struct { - F__ccgo_align [0]uint32 - FiHead Tu32 - FiValue Tu32 - FiEnd Tu32 - FnPath Tu32 - FiKey Ti64 -} - -type JsonParent1 = TJsonParent1 - type TJsonEachCursor = struct { F__ccgo_align [0]uint32 Fbase Tsqlite3_vtab_cursor @@ -249896,25 +241910,6 @@ type TJsonEachCursor = struct { type JsonEachCursor = TJsonEachCursor -type TJsonEachCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FiRowid Tu32 - Fi Tu32 - FiEnd Tu32 - FnRoot Tu32 - FeType Tu8 - FbRecursive Tu8 - FnParent Tu32 - FnParentAlloc Tu32 - FaParent uintptr - Fdb uintptr - Fpath TJsonString - FsParse TJsonParse -} - -type JsonEachCursor1 = TJsonEachCursor1 - type TJsonEachConnection = struct { Fbase Tsqlite3_vtab Fdb uintptr @@ -249922,13 +241917,6 @@ type TJsonEachConnection = struct { type JsonEachConnection = TJsonEachConnection -type TJsonEachConnection1 = struct { - Fbase Tsqlite3_vtab - Fdb uintptr -} - -type JsonEachConnection1 = TJsonEachConnection1 - // C documentation // // /* Constructor for the json_each virtual table */ @@ -249944,7 +241932,7 @@ func _jsonEachConnect(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv _ = argv _ = argc _ = pAux - rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26840) + rc = Xsqlite3_declare_vtab(tls, db, __ccgo_ts+26986) if rc == SQLITE_OK { pNew = _sqlite3DbMallocZero(tls, db, uint64(16)) *(*uintptr)(unsafe.Pointer(ppVtab)) = pNew @@ -250078,7 +242066,7 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { var _ /* sz at bp+0 */ Tu32 _, _, _, _, _ = i, k, n, needQuote, z if int32((*TJsonEachCursor)(unsafe.Pointer(p)).FeType) == int32(JSONB_ARRAY) { - _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+26923, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) + _jsonPrintf(tls, int32(30), p+40, __ccgo_ts+27069, libc.VaList(bp+16, (*(*TJsonParent)(unsafe.Pointer((*TJsonEachCursor)(unsafe.Pointer(p)).FaParent + uintptr((*TJsonEachCursor)(unsafe.Pointer(p)).FnParent-uint32(1))*24))).FiKey)) } else { *(*Tu32)(unsafe.Pointer(bp)) = uint32(0) needQuote = 0 @@ -250104,9 +242092,9 @@ func _jsonAppendPathName(tls *libc.TLS, p uintptr) { } } if needQuote != 0 { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+26930, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(4)), p+40, __ccgo_ts+27076, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } else { - _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+26938, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) + _jsonPrintf(tls, int32(*(*Tu32)(unsafe.Pointer(bp))+uint32(2)), p+40, __ccgo_ts+27084, libc.VaList(bp+16, *(*Tu32)(unsafe.Pointer(bp)), z)) } } } @@ -250417,9 +242405,8 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a libc.Xmemset(tls, p+168, 0, uint32(56)) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJPRef = uint32(1) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.Fdb = (*TJsonEachCursor)(unsafe.Pointer(p)).Fdb - if _jsonFuncArgMightBeBinary(tls, *(*uintptr)(unsafe.Pointer(argv))) != 0 { - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnBlob = uint32(Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv)))) - (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FaBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(argv))) + if _jsonArgIsJsonb(tls, *(*uintptr)(unsafe.Pointer(argv)), p+168) != 0 { + /* We have JSONB */ } else { (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FzJson = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv))) (*TJsonEachCursor)(unsafe.Pointer(p)).FsParse.FnJson = Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(argv))) @@ -250492,7 +242479,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a i = v5 (*TJsonEachCursor)(unsafe.Pointer(p)).FeType = uint8(0) (*TJsonEachCursor)(unsafe.Pointer(p)).FnRoot = uint32(1) - _jsonAppendRaw(tls, p+40, __ccgo_ts+26944, uint32(1)) + _jsonAppendRaw(tls, p+40, __ccgo_ts+27090, uint32(1)) } (*TJsonEachCursor)(unsafe.Pointer(p)).FnParent = uint32(0) n = _jsonbPayloadSize(tls, p+168, i, bp) @@ -250516,7 +242503,7 @@ func _jsonEachFilter(tls *libc.TLS, cur uintptr, idxNum int32, idxStr uintptr, a json_each_malformed_input: ; Xsqlite3_free(tls, (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg) - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26502, 0) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+26648, 0) _jsonEachCursorReset(tls, p) if (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(cur)).FpVtab)).FzErrMsg != 0 { v6 = int32(SQLITE_ERROR) @@ -250577,186 +242564,186 @@ var _aJsonFunc = [34]TFuncDef{ 0: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26946, + FzName: __ccgo_ts + 27092, }, 1: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 26951, + FzName: __ccgo_ts + 27097, }, 2: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26957, + FzName: __ccgo_ts + 27103, }, 3: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 26968, + FzName: __ccgo_ts + 27114, }, 4: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26980, + FzName: __ccgo_ts + 27126, }, 5: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26980, + FzName: __ccgo_ts + 27126, }, 6: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 26998, + FzName: __ccgo_ts + 27144, }, 7: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27018, + FzName: __ccgo_ts + 27164, }, 8: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27031, + FzName: __ccgo_ts + 27177, }, 9: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_JSON) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27045, + FzName: __ccgo_ts + 27191, }, 10: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_SQL) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27048, + FzName: __ccgo_ts + 27194, }, 11: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27052, + FzName: __ccgo_ts + 27198, }, 12: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27064, + FzName: __ccgo_ts + 27210, }, 13: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27077, + FzName: __ccgo_ts + 27223, }, 14: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27089, + FzName: __ccgo_ts + 27235, }, 15: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27102, + FzName: __ccgo_ts + 27248, }, 16: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27113, + FzName: __ccgo_ts + 27259, }, 17: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27125, + FzName: __ccgo_ts + 27271, }, 18: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27125, + FzName: __ccgo_ts + 27271, }, 19: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27137, + FzName: __ccgo_ts + 27283, }, 20: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27148, + FzName: __ccgo_ts + 27294, }, 21: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27160, + FzName: __ccgo_ts + 27306, }, 22: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27173, + FzName: __ccgo_ts + 27319, }, 23: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(0) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27186, + FzName: __ccgo_ts + 27332, }, 24: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(0)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27200, + FzName: __ccgo_ts + 27346, }, 25: { FnArg: int16(-int32(1)), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), FpUserData: uintptr(libc.Int32FromInt32(JSON_ISSET) | libc.Int32FromInt32(1)*libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27209, + FzName: __ccgo_ts + 27355, }, 26: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27219, + FzName: __ccgo_ts + 27365, }, 27: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27219, + FzName: __ccgo_ts + 27365, }, 28: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27229, + FzName: __ccgo_ts + 27375, }, 29: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_DETERMINISTIC) | libc.Int32FromInt32(SQLITE_FUNC_CONSTANT) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(1)*libc.Int32FromInt32(SQLITE_FUNC_RUNONLY) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE)), - FzName: __ccgo_ts + 27229, + FzName: __ccgo_ts + 27375, }, 30: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 27240, + FzName: __ccgo_ts + 27386, }, 31: { FnArg: int16(1), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27257, + FzName: __ccgo_ts + 27403, }, 32: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), - FzName: __ccgo_ts + 27275, + FzName: __ccgo_ts + 27421, }, 33: { FnArg: int16(2), FfuncFlags: uint32(libc.Int32FromInt32(SQLITE_FUNC_BUILTIN) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(0)*libc.Int32FromInt32(SQLITE_FUNC_NEEDCOLL) | libc.Int32FromInt32(SQLITE_SUBTYPE) | libc.Int32FromInt32(SQLITE_RESULT_SUBTYPE) | libc.Int32FromInt32(SQLITE_UTF8) | libc.Int32FromInt32(SQLITE_DETERMINISTIC)), FpUserData: uintptr(libc.Int32FromInt32(JSON_BLOB)), - FzName: __ccgo_ts + 27293, + FzName: __ccgo_ts + 27439, }, } @@ -250839,17 +242826,19 @@ var _aMod = [2]struct { FpModule uintptr }{ 0: { - FzName: __ccgo_ts + 27312, + FzName: __ccgo_ts + 27458, FpModule: uintptr(unsafe.Pointer(&_jsonEachModule)), }, 1: { - FzName: __ccgo_ts + 27322, + FzName: __ccgo_ts + 27468, FpModule: uintptr(unsafe.Pointer(&_jsonTreeModule)), }, } /* In the SQLite core */ +/* #include */ + /* ** If building separately, we will need some setup that is normally ** found in sqliteInt.h @@ -250962,13 +242951,12 @@ type TRtreeConstraint = struct { type RtreeConstraint = TRtreeConstraint type TRtreeMatchArg = struct { - F__ccgo_align [0]uint32 - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - F__ccgo_align4 [4]byte - FaParam [1]TRtreeDValue + F__ccgo_align [0]uint32 + FiSize Tu32 + Fcb TRtreeGeomCallback + FnParam int32 + FapSqlParam uintptr + F__ccgo_pad5 [4]byte } type RtreeMatchArg = TRtreeMatchArg @@ -251002,64 +242990,6 @@ type TRtreeSearchPoint = struct { type RtreeSearchPoint = TRtreeSearchPoint -/* The rtree may have between 1 and RTREE_MAX_DIMENSIONS dimensions. */ - -/* Maximum number of auxiliary columns */ - -/* Size of hash table Rtree.aHash. This hash table is not expected to -** ever contain very many entries, so a fixed number of buckets is -** used. - */ - -/* The xBestIndex method of this virtual table requires an estimate of -** the number of rows in the virtual table to calculate the costs of -** various strategies. If possible, this estimate is loaded from the -** sqlite_stat1 table (with RTREE_MIN_ROWEST as a hard-coded minimum). -** Otherwise, if no sqlite_stat1 entry is available, use -** RTREE_DEFAULT_ROWEST. - */ - -/* -** An rtree virtual-table object. - */ -type TRtree1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab - Fdb uintptr - FiNodeSize int32 - FnDim Tu8 - FnDim2 Tu8 - FeCoordType Tu8 - FnBytesPerCell Tu8 - FinWrTrans Tu8 - FnAux Tu8 - FnAuxNotNull Tu8 - FiDepth int32 - FzDb uintptr - FzName uintptr - FzNodeName uintptr - FnBusy Tu32 - FnRowEst Ti64 - FnCursor Tu32 - FnNodeRef Tu32 - FzReadAuxSql uintptr - FpDeleted uintptr - FpNodeBlob uintptr - FpWriteNode uintptr - FpDeleteNode uintptr - FpReadRowid uintptr - FpWriteRowid uintptr - FpDeleteRowid uintptr - FpReadParent uintptr - FpWriteParent uintptr - FpDeleteParent uintptr - FpWriteAux uintptr - FaHash [97]uintptr - F__ccgo_pad31 [4]byte -} - -type Rtree1 = TRtree1 - /* Possible values for Rtree.eCoordType: */ // C documentation @@ -251079,197 +243009,7 @@ type TRtreeValue = float32 type RtreeValue = TRtreeValue -/* Low accuracy coordinate */ - -/* -** Set the Rtree.bCorrupt flag - */ - -/* -** When doing a search of an r-tree, instances of the following structure -** record intermediate results from the tree walk. -** -** The id is always a node-id. For iLevel>=1 the id is the node-id of -** the node that the RtreeSearchPoint represents. When iLevel==0, however, -** the id is of the parent node and the cell that RtreeSearchPoint -** represents is the iCell-th entry in the parent node. - */ -type TRtreeSearchPoint1 = struct { - F__ccgo_align [0]uint32 - FrScore TRtreeDValue - Fid Tsqlite3_int64 - FiLevel Tu8 - FeWithin Tu8 - FiCell Tu8 - F__ccgo_pad5 [5]byte -} - -type RtreeSearchPoint1 = TRtreeSearchPoint1 - -/* -** The minimum number of cells allowed for a node is a third of the -** maximum. In Gutman's notation: -** -** m = M/3 -** -** If an R*-tree "Reinsert" operation is required, the same number of -** cells are removed from the overfull node and reinserted into the tree. - */ - -/* -** The smallest possible node-size is (512-64)==448 bytes. And the largest -** supported cell size is 48 bytes (8 byte rowid + ten 4 byte coordinates). -** Therefore all non-root nodes must contain at least 3 entries. Since -** 3^40 is greater than 2^64, an r-tree structure always has a depth of -** 40 or less. - */ - -/* -** Number of entries in the cursor RtreeNode cache. The first entry is -** used to cache the RtreeNode for RtreeCursor.sPoint. The remaining -** entries cache the RtreeNode for the first elements of the priority queue. - */ - -/* -** An rtree cursor object. - */ -type TRtreeCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FatEOF Tu8 - FbPoint Tu8 - FbAuxValid Tu8 - FiStrategy int32 - FnConstraint int32 - FaConstraint uintptr - FnPointAlloc int32 - FnPoint int32 - FmxLevel int32 - FaPoint uintptr - FpReadAux uintptr - FsPoint TRtreeSearchPoint - FaNode [5]uintptr - FanQueue [41]Tu32 -} - -type RtreeCursor1 = TRtreeCursor1 - -/* Return the Rtree of a RtreeCursor */ - -/* -** A coordinate can be either a floating point number or a integer. All -** coordinates within a single R-Tree are always of the same time. - */ -type TRtreeCoord1 = struct { - Fi [0]int32 - Fu [0]Tu32 - Ff TRtreeValue -} - -type RtreeCoord1 = TRtreeCoord1 - -/* -** The argument is an RtreeCoord. Return the value stored within the RtreeCoord -** formatted as a RtreeDValue (double or int64). This macro assumes that local -** variable pRtree points to the Rtree structure associated with the -** RtreeCoord. - */ - -/* -** A search constraint. - */ -type TRtreeConstraint1 = struct { - F__ccgo_align [0]uint32 - FiCoord int32 - Fop int32 - Fu struct { - F__ccgo_align [0]uint32 - FxGeom [0]uintptr - FxQueryFunc [0]uintptr - FrValue TRtreeDValue - } - FpInfo uintptr - F__ccgo_pad4 [4]byte -} - -type RtreeConstraint1 = TRtreeConstraint1 - -/* Possible values for RtreeConstraint.op */ - -/* Special operators available only on cursors. Needs to be consecutive -** with the normal values above, but must be less than RTREE_MATCH. These -** are used in the cursor for contraints such as x=NULL (RTREE_FALSE) or -** x<'xyz' (RTREE_TRUE) */ - -/* -** An rtree structure node. - */ -type TRtreeNode1 = struct { - F__ccgo_align [0]uint32 - FpParent uintptr - F__ccgo_align1 [4]byte - FiNode Ti64 - FnRef int32 - FisDirty int32 - FzData uintptr - FpNext uintptr -} - -type RtreeNode1 = TRtreeNode1 - -/* Return the number of cells in a node */ - -/* -** A single cell from a node, deserialized - */ -type TRtreeCell1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FaCoord [10]TRtreeCoord -} - -type RtreeCell1 = TRtreeCell1 - -/* -** This object becomes the sqlite3_user_data() for the SQL functions -** that are created by sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() and which appear on the right of MATCH -** operators in order to constrain a search. -** -** xGeom and xQueryFunc are the callback functions. Exactly one of -** xGeom and xQueryFunc fields is non-NULL, depending on whether the -** SQL function was created using sqlite3_rtree_geometry_callback() or -** sqlite3_rtree_query_callback(). -** -** This object is deleted automatically by the destructor mechanism in -** sqlite3_create_function_v2(). - */ -type TRtreeGeomCallback1 = struct { - FxGeom uintptr - FxQueryFunc uintptr - FxDestructor uintptr - FpContext uintptr -} - -type RtreeGeomCallback1 = TRtreeGeomCallback1 - -/* -** An instance of this structure (in the form of a BLOB) is returned by -** the SQL functions that sqlite3_rtree_geometry_callback() and -** sqlite3_rtree_query_callback() create, and is read as the right-hand -** operand to the MATCH operator of an R-Tree. - */ -type TRtreeMatchArg1 = struct { - F__ccgo_align [0]uint32 - FiSize Tu32 - Fcb TRtreeGeomCallback - FnParam int32 - FapSqlParam uintptr - F__ccgo_align4 [4]byte - FaParam [1]TRtreeDValue -} - -type RtreeMatchArg1 = TRtreeMatchArg1 +/* Size of an RtreeMatchArg object with N parameters */ /* What version of GCC is being used. 0 means GCC is not being used . ** Note that the GCC_VERSION macro will also be set correctly when using @@ -251515,7 +243255,7 @@ func _nodeAcquire(tls *libc.TLS, pRtree uintptr, iNode Ti64, pParent uintptr, pp } } if (*TRtree)(unsafe.Pointer(pRtree)).FpNodeBlob == uintptr(0) { - rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+27332, iNode, 0, pRtree+72) + rc = Xsqlite3_blob_open(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, __ccgo_ts+27478, iNode, 0, pRtree+72) } if rc != 0 { *(*uintptr)(unsafe.Pointer(ppNode)) = uintptr(0) @@ -251820,7 +243560,7 @@ func _rtreeDestroy(tls *libc.TLS, pVtab uintptr) (r int32) { var rc int32 _, _, _ = pRtree, rc, zCreate pRtree = pVtab - zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+27337, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zCreate = Xsqlite3_mprintf(tls, __ccgo_ts+27483, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if !(zCreate != 0) { rc = int32(SQLITE_NOMEM) } else { @@ -252737,7 +244477,7 @@ func _findLeafNode(tls *libc.TLS, pRtree uintptr, iRowid Ti64, ppLeaf uintptr, p func _deserializeGeometry(tls *libc.TLS, pValue uintptr, pCons uintptr) (r int32) { var pBlob, pInfo, pSrc uintptr _, _, _ = pBlob, pInfo, pSrc /* Callback information */ - pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+27419) + pSrc = Xsqlite3_value_pointer(tls, pValue, __ccgo_ts+27565) if pSrc == uintptr(0) { return int32(SQLITE_ERROR) } @@ -253046,7 +244786,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { libc.Xmemcpy(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr, bp, uint32(iIdx+int32(1))) } nRow = (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst >> (iIdx / int32(2)) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = libc.Float64FromFloat64(6) * float64(nRow) + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(libc.Float64FromFloat64(6) * float64(nRow)) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = nRow return rc } @@ -253054,7 +244794,7 @@ func _rtreeBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { // C documentation // // /* -// ** Return the N-dimensional volumn of the cell stored in *p. +// ** Return the N-dimensional volume of the cell stored in *p. // */ func _cellArea(tls *libc.TLS, pRtree uintptr, p uintptr) (r TRtreeDValue) { var area TRtreeDValue @@ -253292,7 +245032,7 @@ func _cellOverlap(tls *libc.TLS, pRtree uintptr, p uintptr, aCell uintptr, nCell o = libc.Float64FromInt32(0) break } else { - o = o * (x2 - x1) + o = TRtreeDValue(o * (x2 - x1)) } goto _2 _2: @@ -254223,11 +245963,11 @@ func _rtreeValueDown(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) > d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -254240,11 +245980,11 @@ func _rtreeValueUp(tls *libc.TLS, v uintptr) (r TRtreeValue) { f = float32(d) if float64(f) < d { if d < libc.Float64FromInt32(0) { - v1 = float64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) - libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } else { - v1 = float64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) + v1 = libc.Float64FromFloat64(1) + libc.Float64FromFloat64(1)/libc.Float64FromFloat64(8.388608e+06) } - f = float32(d * v1) + f = float32(float64(d * v1)) } return f } @@ -254272,7 +246012,7 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) var _ /* pStmt at bp+0 */ uintptr _, _, _, _, _, _ = rc, zCol, zCol1, zCol2, zSql, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27433, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27579, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) if zSql != 0 { rc = Xsqlite3_prepare_v2(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, -int32(1), bp, uintptr(0)) } else { @@ -254282,11 +246022,11 @@ func _rtreeConstraintError(tls *libc.TLS, pRtree uintptr, iCol int32) (r int32) if rc == SQLITE_OK { if iCol == 0 { zCol = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27453, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27599, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol)) } else { zCol1 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol) zCol2 = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+int32(1)) - (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27485, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) + (*TRtree)(unsafe.Pointer(pRtree)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+27631, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zCol1, zCol2)) } } Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -254500,7 +246240,7 @@ func _rtreeRename(tls *libc.TLS, pVtab uintptr, zNewName uintptr) (r int32) { _, _, _ = pRtree, rc, zSql pRtree = pVtab rc = int32(SQLITE_NOMEM) - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27522, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+27668, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, zNewName)) if zSql != 0 { _nodeBlobReset(tls, pRtree) rc = Xsqlite3_exec(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, zSql, uintptr(0), uintptr(0), uintptr(0)) @@ -254554,9 +246294,9 @@ func _rtreeQueryStat1(tls *libc.TLS, db uintptr, pRtree uintptr) (r int32) { var v2 int64 var _ /* p at bp+0 */ uintptr _, _, _, _, _, _ = nRow, rc, zFmt, zSql, v1, v2 - zFmt = __ccgo_ts + 27667 + zFmt = __ccgo_ts + 27813 nRow = int64(RTREE_MIN_ROWEST) - rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+13078, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_table_column_metadata(tls, db, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, __ccgo_ts+13194, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc != SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FnRowEst = int64(RTREE_DEFAULT_ROWEST) if rc == int32(SQLITE_ERROR) { @@ -254614,9 +246354,9 @@ func _rtreeShadowName(tls *libc.TLS, zName uintptr) (r int32) { } var _azName1 = [3]uintptr{ - 0: __ccgo_ts + 27723, - 1: __ccgo_ts + 6874, - 2: __ccgo_ts + 18161, + 0: __ccgo_ts + 27869, + 1: __ccgo_ts + 6962, + 2: __ccgo_ts + 18324, } var _rtreeModule = Tsqlite3_module{ @@ -254660,21 +246400,21 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref (*TRtree)(unsafe.Pointer(pRtree)).Fdb = db if isCreate != 0 { p = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28137, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28283, libc.VaList(bp+8, zDb, zPrefix)) ii = 0 for { if !(ii < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28199, libc.VaList(bp+8, ii)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28345, libc.VaList(bp+8, ii)) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28204, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28268, libc.VaList(bp+8, zDb, zPrefix)) - Xsqlite3_str_appendf(tls, p, __ccgo_ts+28338, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28350, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28414, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p, __ccgo_ts+28484, libc.VaList(bp+8, zDb, zPrefix, (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize)) zCreate = Xsqlite3_str_finish(tls, p) if !(zCreate != 0) { return int32(SQLITE_NOMEM) @@ -254704,7 +246444,7 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } else { /* An UPSERT is very slightly slower than REPLACE, but it is needed ** if there are auxiliary columns */ - zFormat = __ccgo_ts + 28387 + zFormat = __ccgo_ts + 28533 } zSql = Xsqlite3_mprintf(tls, zFormat, libc.VaList(bp+8, zDb, zPrefix)) if zSql != 0 { @@ -254719,31 +246459,31 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref i++ } if (*TRtree)(unsafe.Pointer(pRtree)).FnAux != 0 && rc != int32(SQLITE_NOMEM) { - (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+28495, libc.VaList(bp+8, zDb, zPrefix)) + (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql = Xsqlite3_mprintf(tls, __ccgo_ts+28641, libc.VaList(bp+8, zDb, zPrefix)) if (*TRtree)(unsafe.Pointer(pRtree)).FzReadAuxSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { p1 = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28540, libc.VaList(bp+8, zDb, zPrefix)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28686, libc.VaList(bp+8, zDb, zPrefix)) ii1 = 0 for { if !(ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux)) { break } if ii1 != 0 { - Xsqlite3_str_append(tls, p1, __ccgo_ts+14586, int32(1)) + Xsqlite3_str_append(tls, p1, __ccgo_ts+14702, int32(1)) } if ii1 < int32((*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull) { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28567, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28713, libc.VaList(bp+8, ii1, ii1+int32(2), ii1)) } else { - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28589, libc.VaList(bp+8, ii1, ii1+int32(2))) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28735, libc.VaList(bp+8, ii1, ii1+int32(2))) } goto _3 _3: ; ii1++ } - Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28597, 0) + Xsqlite3_str_appendf(tls, p1, __ccgo_ts+28743, 0) zSql1 = Xsqlite3_str_finish(tls, p1) if zSql1 == uintptr(0) { rc = int32(SQLITE_NOMEM) @@ -254757,14 +246497,14 @@ func _rtreeSqlInit(tls *libc.TLS, pRtree uintptr, db uintptr, zDb uintptr, zPref } var _azSql = [8]uintptr{ - 0: __ccgo_ts + 27728, - 1: __ccgo_ts + 27781, - 2: __ccgo_ts + 27826, - 3: __ccgo_ts + 27878, - 4: __ccgo_ts + 27932, - 5: __ccgo_ts + 27977, - 6: __ccgo_ts + 28035, - 7: __ccgo_ts + 28090, + 0: __ccgo_ts + 27874, + 1: __ccgo_ts + 27927, + 2: __ccgo_ts + 27972, + 3: __ccgo_ts + 28024, + 4: __ccgo_ts + 28078, + 5: __ccgo_ts + 28123, + 6: __ccgo_ts + 28181, + 7: __ccgo_ts + 28236, } // C documentation @@ -254822,7 +246562,7 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE _, _ = rc, zSql if isCreate != 0 { *(*int32)(unsafe.Pointer(bp)) = 0 - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28613, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28759, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb)) rc = _getIntFromStmt(tls, db, zSql, bp) if rc == SQLITE_OK { (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = *(*int32)(unsafe.Pointer(bp)) - int32(64) @@ -254830,17 +246570,17 @@ func _getNodeSize(tls *libc.TLS, db uintptr, pRtree uintptr, isCreate int32, pzE (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize = int32(4) + int32((*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell)*int32(RTREE_MAXCELLS) } } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } } else { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28633, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+28779, libc.VaList(bp+16, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName)) rc = _getIntFromStmt(tls, db, zSql, pRtree+16) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, db))) } else { if (*TRtree)(unsafe.Pointer(pRtree)).FiNodeSize < libc.Int32FromInt32(512)-libc.Int32FromInt32(64) { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< libc.Int32FromInt32(RTREE_MAX_AUX_COLUMN)+libc.Int32FromInt32(3) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, aErrMsg[int32(2)+libc.BoolInt32(argc >= int32(6))])) return int32(SQLITE_ERROR) } Xsqlite3_vtab_config(tls, db, int32(SQLITE_VTAB_CONSTRAINT_SUPPORT), libc.VaList(bp+8, int32(1))) @@ -254917,13 +246657,13 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28876, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+29022, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28882, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29028, libc.VaList(bp+8, _rtreeTokenLength(tls, *(*uintptr)(unsafe.Pointer(argv + 3*4))), *(*uintptr)(unsafe.Pointer(argv + 3*4)))) ii = int32(4) for { if !(ii < argc) { @@ -254932,7 +246672,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt zArg = *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)) if int32(*(*int8)(unsafe.Pointer(zArg))) == int32('+') { (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28906, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29052, libc.VaList(bp+8, _rtreeTokenLength(tls, zArg+uintptr(1)), zArg+uintptr(1))) } else { if int32((*TRtree)(unsafe.Pointer(pRtree)).FnAux) > 0 { break @@ -254946,19 +246686,19 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28933, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) } else { if ii < argc { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, aErrMsg[int32(4)])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, aErrMsg[int32(4)])) rc = int32(SQLITE_ERROR) } else { v3 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v3 if SQLITE_OK != v3 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } } @@ -254981,7 +246721,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } } if iErr != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, aErrMsg[iErr])) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, aErrMsg[iErr])) goto rtreeInit_fail } (*TRtree)(unsafe.Pointer(pRtree)).FnBytesPerCell = uint8(int32(8) + int32((*TRtree)(unsafe.Pointer(pRtree)).FnDim2)*int32(4)) @@ -254992,7 +246732,7 @@ func _rtreeInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uintpt } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto rtreeInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -255008,8 +246748,8 @@ rtreeInit_fail: } var _azFormat = [2]uintptr{ - 0: __ccgo_ts + 28912, - 1: __ccgo_ts + 28923, + 0: __ccgo_ts + 29058, + 1: __ccgo_ts + 29069, } // C documentation @@ -255067,21 +246807,21 @@ func _rtreenode(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { } _nodeGetCell(tls, bp+32, bp, ii, bp+536) if ii > 0 { - Xsqlite3_str_append(tls, pOut, __ccgo_ts+12698, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+12814, int32(1)) } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28936, libc.VaList(bp+592, (*(*TRtreeCell)(unsafe.Pointer(bp + 536))).FiRowid)) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29082, libc.VaList(bp+592, (*(*TRtreeCell)(unsafe.Pointer(bp + 536))).FiRowid)) jj = 0 for { if !(jj < int32((*(*TRtree)(unsafe.Pointer(bp + 32))).FnDim2)) { break } - Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+28942, libc.VaList(bp+592, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 536 + 8 + uintptr(jj)*4))))) + Xsqlite3_str_appendf(tls, pOut, __ccgo_ts+29088, libc.VaList(bp+592, float64(*(*TRtreeValue)(unsafe.Pointer(bp + 536 + 8 + uintptr(jj)*4))))) goto _2 _2: ; jj++ } - Xsqlite3_str_append(tls, pOut, __ccgo_ts+28946, int32(1)) + Xsqlite3_str_append(tls, pOut, __ccgo_ts+29092, int32(1)) goto _1 _1: ; @@ -255108,7 +246848,7 @@ func _rtreedepth(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { _ = zBlob _ = nArg if Xsqlite3_value_type(tls, *(*uintptr)(unsafe.Pointer(apArg))) != int32(SQLITE_BLOB) || Xsqlite3_value_bytes(tls, *(*uintptr)(unsafe.Pointer(apArg))) < int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+28948, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29094, -int32(1)) } else { zBlob = Xsqlite3_value_blob(tls, *(*uintptr)(unsafe.Pointer(apArg))) if zBlob != 0 { @@ -255142,23 +246882,6 @@ type TRtreeCheck = struct { type RtreeCheck = TRtreeCheck -type TRtreeCheck1 = struct { - Fdb uintptr - FzDb uintptr - FzTab uintptr - FbInt int32 - FnDim int32 - FpGetNode uintptr - FaCheckMapping [2]uintptr - FnLeaf int32 - FnNonLeaf int32 - Frc int32 - FzReport uintptr - FnErr int32 -} - -type RtreeCheck1 = TRtreeCheck1 - // C documentation // // /* @@ -255211,7 +246934,7 @@ func _rtreeCheckPrepare(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) // /* // ** The second and subsequent arguments to this function are a printf() // ** style format string and arguments. This function formats the string and -// ** appends it to the report being accumuated in pCheck. +// ** appends it to the report being accumulated in pCheck. // */ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintptr) { bp := tls.Alloc(32) @@ -255226,11 +246949,11 @@ func _rtreeCheckAppendMsg(tls *libc.TLS, pCheck uintptr, zFmt uintptr, va uintpt (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } else { if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport != 0 { - v1 = __ccgo_ts + 5577 + v1 = __ccgo_ts + 5665 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+28981, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport = Xsqlite3_mprintf(tls, __ccgo_ts+29127, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport, v1, z)) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzReport == uintptr(0) { (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = int32(SQLITE_NOMEM) } @@ -255264,7 +246987,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt _, _, _ = nNode, pNode, pRet pRet = uintptr(0) /* Return value */ if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode == uintptr(0) { - (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+28988, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) + (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29134, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) } if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { Xsqlite3_bind_int64(tls, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode, int32(1), iNode) @@ -255281,7 +247004,7 @@ func _rtreeCheckGetNode(tls *libc.TLS, pCheck uintptr, iNode Ti64, pnNode uintpt } _rtreeCheckReset(tls, pCheck, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FpGetNode) if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK && pRet == uintptr(0) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29033, libc.VaList(bp+8, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29179, libc.VaList(bp+8, iNode)) } } return pRet @@ -255310,8 +247033,8 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i var rc int32 _, _, _, _, _, _ = azSql, ii, pStmt, rc, v1, v2 azSql = [2]uintptr{ - 0: __ccgo_ts + 29065, - 1: __ccgo_ts + 29119, + 0: __ccgo_ts + 29211, + 1: __ccgo_ts + 29265, } if *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) == uintptr(0) { *(*uintptr)(unsafe.Pointer(pCheck + 24 + uintptr(bLeaf)*4)) = _rtreeCheckPrepare(tls, pCheck, azSql[bLeaf], libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab)) @@ -255324,21 +247047,21 @@ func _rtreeCheckMapping(tls *libc.TLS, pCheck uintptr, bLeaf int32, iKey Ti64, i rc = Xsqlite3_step(tls, pStmt) if rc == int32(SQLITE_DONE) { if bLeaf != 0 { - v1 = __ccgo_ts + 29167 + v1 = __ccgo_ts + 29313 } else { - v1 = __ccgo_ts + 29175 + v1 = __ccgo_ts + 29321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29184, libc.VaList(bp+8, iKey, iVal, v1)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29330, libc.VaList(bp+8, iKey, iVal, v1)) } else { if rc == int32(SQLITE_ROW) { ii = Xsqlite3_column_int64(tls, pStmt, 0) if ii != iVal { if bLeaf != 0 { - v2 = __ccgo_ts + 29167 + v2 = __ccgo_ts + 29313 } else { - v2 = __ccgo_ts + 29175 + v2 = __ccgo_ts + 29321 } - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29229, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29375, libc.VaList(bp+8, iKey, ii, v2, iKey, iVal)) } } } @@ -255383,7 +247106,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 v2 = libc.BoolInt32(*(*TRtreeValue)(unsafe.Pointer(bp)) > *(*TRtreeValue)(unsafe.Pointer(bp + 4))) } if v2 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29287, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29433, libc.VaList(bp+24, i, iCell, iNode)) } if pParent != 0 { _readCoord(tls, pParent+uintptr(libc.Int32FromInt32(4)*libc.Int32FromInt32(2)*i), bp+8) @@ -255401,7 +247124,7 @@ func _rtreeCheckCellCoord(tls *libc.TLS, pCheck uintptr, iNode Ti64, iCell int32 } } if v5 || v4 != 0 { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29335, libc.VaList(bp+24, i, iCell, iNode)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29481, libc.VaList(bp+24, i, iCell, iNode)) } } goto _1 @@ -255434,19 +247157,19 @@ func _rtreeCheckNode(tls *libc.TLS, pCheck uintptr, iDepth int32, aParent uintpt aNode = _rtreeCheckGetNode(tls, pCheck, iNode, bp) if aNode != 0 { if *(*int32)(unsafe.Pointer(bp)) < int32(4) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29402, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29548, libc.VaList(bp+16, iNode, *(*int32)(unsafe.Pointer(bp)))) } else { /* Used to iterate through cells */ if aParent == uintptr(0) { iDepth = _readInt16(tls, aNode) if iDepth > int32(RTREE_MAX_DEPTH) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29436, libc.VaList(bp+16, iDepth)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29582, libc.VaList(bp+16, iDepth)) Xsqlite3_free(tls, aNode) return } } nCell = _readInt16(tls, aNode+2) if int32(4)+nCell*(int32(8)+(*TRtreeCheck)(unsafe.Pointer(pCheck)).FnDim*int32(2)*int32(4)) > *(*int32)(unsafe.Pointer(bp)) { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29466, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29612, libc.VaList(bp+16, iNode, nCell, *(*int32)(unsafe.Pointer(bp)))) } else { i = 0 for { @@ -255491,12 +247214,12 @@ func _rtreeCheckCount(tls *libc.TLS, pCheck uintptr, zTbl uintptr, nExpect Ti64) var pCount uintptr _, _ = nActual, pCount if (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc == SQLITE_OK { - pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29521, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) + pCount = _rtreeCheckPrepare(tls, pCheck, __ccgo_ts+29667, libc.VaList(bp+8, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzDb, (*TRtreeCheck)(unsafe.Pointer(pCheck)).FzTab, zTbl)) if pCount != 0 { if Xsqlite3_step(tls, pCount) == int32(SQLITE_ROW) { nActual = Xsqlite3_column_int64(tls, pCount, 0) if nActual != nExpect { - _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29552, libc.VaList(bp+8, zTbl, nExpect, nActual)) + _rtreeCheckAppendMsg(tls, pCheck, __ccgo_ts+29698, libc.VaList(bp+8, zTbl, nExpect, nActual)) } } (*TRtreeCheck)(unsafe.Pointer(pCheck)).Frc = Xsqlite3_finalize(tls, pCount) @@ -255525,7 +247248,7 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzDb = zDb (*(*TRtreeCheck)(unsafe.Pointer(bp))).FzTab = zTab /* Find the number of auxiliary columns */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+29619, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+29765, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { nAux = Xsqlite3_column_count(tls, pStmt) - int32(2) Xsqlite3_finalize(tls, pStmt) @@ -255535,11 +247258,11 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe } } /* Find number of dimensions in the rtree table. */ - pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+27433, libc.VaList(bp+64, zDb, zTab)) + pStmt = _rtreeCheckPrepare(tls, bp, __ccgo_ts+27579, libc.VaList(bp+64, zDb, zTab)) if pStmt != 0 { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim = (Xsqlite3_column_count(tls, pStmt) - int32(1) - nAux) / int32(2) if (*(*TRtreeCheck)(unsafe.Pointer(bp))).FnDim < int32(1) { - _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+29647, 0) + _rtreeCheckAppendMsg(tls, bp, __ccgo_ts+29793, 0) } else { if int32(SQLITE_ROW) == Xsqlite3_step(tls, pStmt) { (*(*TRtreeCheck)(unsafe.Pointer(bp))).FbInt = libc.BoolInt32(Xsqlite3_column_type(tls, pStmt, int32(1)) == int32(SQLITE_INTEGER)) @@ -255555,8 +247278,8 @@ func _rtreeCheckTable(tls *libc.TLS, db uintptr, zDb uintptr, zTab uintptr, pzRe if (*(*TRtreeCheck)(unsafe.Pointer(bp))).Frc == SQLITE_OK { _rtreeCheckNode(tls, bp, 0, uintptr(0), int64(1)) } - _rtreeCheckCount(tls, bp, __ccgo_ts+29678, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) - _rtreeCheckCount(tls, bp, __ccgo_ts+29685, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29824, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnLeaf)) + _rtreeCheckCount(tls, bp, __ccgo_ts+29831, int64((*(*TRtreeCheck)(unsafe.Pointer(bp))).FnNonLeaf)) } /* Finalize SQL statements used by the integrity-check */ Xsqlite3_finalize(tls, (*(*TRtreeCheck)(unsafe.Pointer(bp))).FpGetNode) @@ -255583,7 +247306,7 @@ func _rtreeIntegrity(tls *libc.TLS, pVtab uintptr, zSchema uintptr, zName uintpt _ = isQuick rc = _rtreeCheckTable(tls, (*TRtree)(unsafe.Pointer(pRtree)).Fdb, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, pzErr) if rc == SQLITE_OK && *(*uintptr)(unsafe.Pointer(pzErr)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+29693, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+29839, libc.VaList(bp+8, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(pzErr)))) if *(*uintptr)(unsafe.Pointer(pzErr)) == uintptr(0) { rc = int32(SQLITE_NOMEM) } @@ -255634,13 +247357,13 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { var _ /* zReport at bp+0 */ uintptr _, _, _, _ = rc, zDb, zTab, v1 if nArg != int32(1) && nArg != int32(2) { - Xsqlite3_result_error(tls, ctx, __ccgo_ts+29712, -int32(1)) + Xsqlite3_result_error(tls, ctx, __ccgo_ts+29858, -int32(1)) } else { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zDb = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg))) if nArg == int32(1) { zTab = zDb - zDb = __ccgo_ts + 8020 + zDb = __ccgo_ts + 8107 } else { zTab = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apArg + 1*4))) } @@ -255649,7 +247372,7 @@ func _rtreecheck(tls *libc.TLS, ctx uintptr, nArg int32, apArg uintptr) { if *(*uintptr)(unsafe.Pointer(bp)) != 0 { v1 = *(*uintptr)(unsafe.Pointer(bp)) } else { - v1 = __ccgo_ts + 19939 + v1 = __ccgo_ts + 20102 } Xsqlite3_result_text(tls, ctx, v1, -int32(1), uintptr(-libc.Int32FromInt32(1))) } else { @@ -255743,14 +247466,6 @@ type TGeoPoly = struct { type GeoPoly = TGeoPoly -type TGeoPoly1 = struct { - FnVertex int32 - Fhdr [4]uint8 - Fa [8]TGeoCoord -} - -type GeoPoly1 = TGeoPoly1 - /* The size of a memory allocation needed for a GeoPoly object sufficient ** to hold N coordinate pairs. */ @@ -255775,16 +247490,6 @@ type TGeoParse = struct { type GeoParse = TGeoParse -type TGeoParse1 = struct { - Fz uintptr - FnVertex int32 - FnAlloc int32 - FnErr int32 - Fa uintptr -} - -type GeoParse1 = TGeoParse1 - // C documentation // // /* Do a 4-byte byte swap */ @@ -256116,19 +247821,19 @@ func _geopolyJsonFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) if p != 0 { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) - Xsqlite3_str_append(tls, x, __ccgo_ts+26667, int32(1)) + Xsqlite3_str_append(tls, x, __ccgo_ts+26813, int32(1)) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29763, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29909, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29774, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29920, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -256157,20 +247862,20 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { db = Xsqlite3_context_db_handle(tls, context) x = Xsqlite3_str_new(tls, db) cSep = int8('\'') - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29785, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29931, 0) i = 0 for { if !(i < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex) { break } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29803, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29949, libc.VaList(bp+8, int32(cSep), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(i*int32(2)+int32(1))*4))))) cSep = int8(' ') goto _1 _1: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29811, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29957, libc.VaList(bp+8, float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4))), float64(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4))))) i = int32(1) for { if !(i < argc) { @@ -256178,14 +247883,14 @@ func _geopolySvgFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { } z = Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(argv + uintptr(i)*4))) if z != 0 && *(*int8)(unsafe.Pointer(z)) != 0 { - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29819, libc.VaList(bp+8, z)) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29965, libc.VaList(bp+8, z)) } goto _2 _2: ; i++ } - Xsqlite3_str_appendf(tls, x, __ccgo_ts+29823, 0) + Xsqlite3_str_appendf(tls, x, __ccgo_ts+29969, 0) Xsqlite3_result_text(tls, context, Xsqlite3_str_finish(tls, x), -int32(1), __ccgo_fp(Xsqlite3_free)) Xsqlite3_free(tls, p) } @@ -256231,8 +247936,8 @@ func _geopolyXformFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) } x0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) y0 = *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) - x1 = float32(A*float64(x0) + B*float64(y0) + E) - y1 = float32(C*float64(x0) + D*float64(y0) + F) + x1 = float32(float64(A*float64(x0)) + float64(B*float64(y0)) + E) + y1 = float32(float64(C*float64(x0)) + float64(D*float64(y0)) + F) *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4)) = x1 *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4)) = y1 goto _1 @@ -256264,13 +247969,13 @@ func _geopolyArea(tls *libc.TLS, p uintptr) (r float64) { if !(ii < (*TGeoPoly)(unsafe.Pointer(p)).FnVertex-int32(1)) { break } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr((ii+int32(1))*int32(2)+int32(1))*4)))) * float64(0.5)) goto _1 _1: ; ii++ } - rArea += float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5) + rArea += float64(float64((*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2))*4))-*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2))*4)))*(*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(ii*int32(2)+int32(1))*4))+*(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(libc.Int32FromInt32(0)*libc.Int32FromInt32(2)+libc.Int32FromInt32(1))*4)))) * float64(0.5)) return rArea } @@ -256350,16 +248055,16 @@ func _geopolyCcwFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr) { func _geopolySine(tls *libc.TLS, r float64) (r1 float64) { var r2, r3, r5 float64 _, _, _ = r2, r3, r5 - if r >= libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793) { - r -= libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) + if r >= float64(libc.Float64FromFloat64(1.5)*libc.Float64FromFloat64(3.141592653589793)) { + r -= float64(libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793)) } - if r >= libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793) { + if r >= float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793)) { return -_geopolySine(tls, r-float64(3.141592653589793)) } else { - r2 = r * r - r3 = r2 * r - r5 = r3 * r2 - return float64(0.9996949)*r - float64(0.16567)*r3 + float64(0.0075134)*r5 + r2 = float64(r * r) + r3 = float64(r2 * r) + r5 = float64(r3 * r2) + return float64(float64(0.9996949)*r) - float64(float64(0.16567)*r3) + float64(float64(0.0075134)*r5) } return r1 } @@ -256406,9 +248111,9 @@ func _geopolyRegularFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt if !(*(*int32)(unsafe.Pointer(bp)) < n) { break } - rAngle = libc.Float64FromFloat64(2) * libc.Float64FromFloat64(3.141592653589793) * float64(*(*int32)(unsafe.Pointer(bp))) / float64(n) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - r*_geopolySine(tls, rAngle-libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))) - *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + r*_geopolySine(tls, rAngle)) + rAngle = float64(float64(libc.Float64FromFloat64(2)*libc.Float64FromFloat64(3.141592653589793))*float64(*(*int32)(unsafe.Pointer(bp)))) / float64(n) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2))*4)) = float32(x - float64(r*_geopolySine(tls, rAngle-float64(libc.Float64FromFloat64(0.5)*libc.Float64FromFloat64(3.141592653589793))))) + *(*TGeoCoord)(unsafe.Pointer(p + 8 + uintptr(*(*int32)(unsafe.Pointer(bp))*int32(2)+int32(1))*4)) = float32(y + float64(r*_geopolySine(tls, rAngle))) goto _1 _1: ; @@ -256567,13 +248272,6 @@ type TGeoBBox = struct { type GeoBBox = TGeoBBox -type TGeoBBox1 = struct { - FisInit int32 - Fa [4]TRtreeCoord -} - -type GeoBBox1 = TGeoBBox1 - // C documentation // // /* @@ -256634,7 +248332,7 @@ func _geopolyBBoxFinal(tls *libc.TLS, context uintptr) { // ** Determine if point (x0,y0) is beneath line segment (x1,y1)->(x2,y2). // ** Returns: // ** -// ** +2 x0,y0 is on the line segement +// ** +2 x0,y0 is on the line segment // ** // ** +1 x0,y0 is beneath line segment // ** @@ -256673,7 +248371,7 @@ func _pointBeneathLine(tls *libc.TLS, x0 float64, y0 float64, x1 float64, y1 flo return int32(2) } } - y = y1 + (y2-y1)*(x0-x1)/(x2-x1) + y = y1 + float64((y2-y1)*(x0-x1))/(x2-x1) if y0 == y { return int32(2) } @@ -256777,7 +248475,7 @@ func _geopolyWithinFunc(tls *libc.TLS, context uintptr, argc int32, argv uintptr // C documentation // -// /* Objects used by the overlap algorihm. */ +// /* Objects used by the overlap algorithm. */ type TGeoEvent = struct { F__ccgo_align [0]uint32 Fx float64 @@ -256811,39 +248509,6 @@ type TGeoOverlap = struct { type GeoOverlap = TGeoOverlap -type TGeoEvent1 = struct { - F__ccgo_align [0]uint32 - Fx float64 - FeType int32 - FpSeg uintptr - FpNext uintptr - F__ccgo_pad4 [4]byte -} - -type GeoEvent1 = TGeoEvent1 - -type TGeoSegment1 = struct { - F__ccgo_align [0]uint32 - FC float64 - FB float64 - Fy float64 - Fy0 float32 - Fside uint8 - Fidx uint32 - FpNext uintptr -} - -type GeoSegment1 = TGeoSegment1 - -type TGeoOverlap1 = struct { - FaEvent uintptr - FaSegment uintptr - FnEvent int32 - FnSegment int32 -} - -type GeoOverlap1 = TGeoOverlap1 - // C documentation // // /* @@ -256867,7 +248532,7 @@ func _geopolyAddOneSegment(tls *libc.TLS, p uintptr, x0 TGeoCoord, y0 TGeoCoord, pSeg = (*TGeoOverlap)(unsafe.Pointer(p)).FaSegment + uintptr((*TGeoOverlap)(unsafe.Pointer(p)).FnSegment)*40 (*TGeoOverlap)(unsafe.Pointer(p)).FnSegment++ (*TGeoSegment)(unsafe.Pointer(pSeg)).FC = float64((y1 - y0) / (x1 - x0)) - (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB = float64(y1) - float64(float64(x1)*(*TGeoSegment)(unsafe.Pointer(pSeg)).FC) (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy0 = y0 (*TGeoSegment)(unsafe.Pointer(pSeg)).Fside = side (*TGeoSegment)(unsafe.Pointer(pSeg)).Fidx = idx @@ -257151,7 +248816,7 @@ func _geopolyOverlap(tls *libc.TLS, p1 uintptr, p2 uintptr) (r int32) { if !(pSeg != 0) { break } - y = (*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB + y = float64((*TGeoSegment)(unsafe.Pointer(pSeg)).FC*rX) + (*TGeoSegment)(unsafe.Pointer(pSeg)).FB (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy = y if pPrev != 0 { if (*TGeoSegment)(unsafe.Pointer(pPrev)).Fy > (*TGeoSegment)(unsafe.Pointer(pSeg)).Fy && int32((*TGeoSegment)(unsafe.Pointer(pPrev)).Fside) != int32((*TGeoSegment)(unsafe.Pointer(pSeg)).Fside) { @@ -257320,13 +248985,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzDb, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(nDb)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName, *(*uintptr)(unsafe.Pointer(argv + 2*4)), uint32(nName)) - libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+28876, uint32(6)) + libc.Xmemcpy(tls, (*TRtree)(unsafe.Pointer(pRtree)).FzNodeName+uintptr(nName), __ccgo_ts+29022, uint32(6)) /* Create/Connect to the underlying relational database schema. If ** that is successful, call sqlite3_declare_vtab() to configure ** the r-tree table schema. */ pSql = Xsqlite3_str_new(tls, db) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29836, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29982, 0) (*TRtree)(unsafe.Pointer(pRtree)).FnAux = uint8(1) /* Add one for _shape */ (*TRtree)(unsafe.Pointer(pRtree)).FnAuxNotNull = uint8(1) /* The _shape column is always not-null */ ii = int32(3) @@ -257335,13 +249000,13 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint break } (*TRtree)(unsafe.Pointer(pRtree)).FnAux++ - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29858, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+30004, libc.VaList(bp+8, *(*uintptr)(unsafe.Pointer(argv + uintptr(ii)*4)))) goto _1 _1: ; ii++ } - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+28933, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+29079, 0) zSql = Xsqlite3_str_finish(tls, pSql) if !(zSql != 0) { rc = int32(SQLITE_NOMEM) @@ -257349,7 +249014,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint v2 = Xsqlite3_declare_vtab(tls, db, zSql) rc = v2 if SQLITE_OK != v2 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } Xsqlite3_free(tls, zSql) @@ -257364,7 +249029,7 @@ func _geopolyInit(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, argv uint } rc = _rtreeSqlInit(tls, pRtree, db, *(*uintptr)(unsafe.Pointer(argv + 1*4)), *(*uintptr)(unsafe.Pointer(argv + 2*4)), isCreate) if rc != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) goto geopolyInit_fail } *(*uintptr)(unsafe.Pointer(ppVtab)) = pRtree @@ -257576,7 +249241,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iRowidTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(1) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 18161 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 18324 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iRowidTerm)*8))).Fomit = uint8(1) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(30) @@ -257586,7 +249251,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { } if iFuncTerm >= 0 { (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = idxNum - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29862 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 30008 (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).FargvIndex = int32(1) (*(*Tsqlite3_index_constraint_usage)(unsafe.Pointer((*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FaConstraintUsage + uintptr(iFuncTerm)*8))).Fomit = uint8(0) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(300) @@ -257594,7 +249259,7 @@ func _geopolyBestIndex(tls *libc.TLS, tab uintptr, pIdxInfo uintptr) (r int32) { return SQLITE_OK } (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxNum = int32(4) - (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 29868 + (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FidxStr = __ccgo_ts + 30014 (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedCost = float64(3e+06) (*Tsqlite3_index_info)(unsafe.Pointer(pIdxInfo)).FestimatedRows = int64(100000) return SQLITE_OK @@ -257714,7 +249379,7 @@ func _geopolyUpdate(tls *libc.TLS, pVtab uintptr, nData int32, aData uintptr, pR _geopolyBBox(tls, uintptr(0), *(*uintptr)(unsafe.Pointer(aData + 2*4)), bp+8+8, bp) if *(*int32)(unsafe.Pointer(bp)) != 0 { if *(*int32)(unsafe.Pointer(bp)) == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+29877, 0) + (*Tsqlite3_vtab)(unsafe.Pointer(pVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+30023, 0) } goto geopoly_update_end } @@ -257814,16 +249479,16 @@ geopoly_update_end: // ** Report that geopoly_overlap() is an overloaded function suitable // ** for use in xBestIndex. // */ -func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, pxFunc uintptr, ppArg uintptr) (r int32) { +func _geopolyFindFunction(tls *libc.TLS, pVtab uintptr, nArg int32, zName uintptr, __ccgo_fp_pxFunc uintptr, ppArg uintptr) (r int32) { _ = pVtab _ = nArg - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29917) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30063) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyOverlapFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return int32(SQLITE_INDEX_CONSTRAINT_FUNCTION) } - if Xsqlite3_stricmp(tls, zName, __ccgo_ts+29933) == 0 { - *(*uintptr)(unsafe.Pointer(pxFunc)) = __ccgo_fp(_geopolyWithinFunc) + if Xsqlite3_stricmp(tls, zName, __ccgo_ts+30079) == 0 { + *(*uintptr)(unsafe.Pointer(__ccgo_fp_pxFunc)) = __ccgo_fp(_geopolyWithinFunc) *(*uintptr)(unsafe.Pointer(ppArg)) = uintptr(0) return libc.Int32FromInt32(SQLITE_INDEX_CONSTRAINT_FUNCTION) + libc.Int32FromInt32(1) } @@ -257893,7 +249558,7 @@ func _sqlite3_geopoly_init(tls *libc.TLS, db uintptr) (r int32) { i++ } if rc == SQLITE_OK { - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30110, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30256, uintptr(unsafe.Pointer(&_geopolyModule)), uintptr(0), uintptr(0)) } return rc } @@ -257907,61 +249572,61 @@ var _aFunc = [12]struct { 0: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29948, + FzName: __ccgo_ts + 30094, }, 1: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29961, + FzName: __ccgo_ts + 30107, }, 2: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 29974, + FzName: __ccgo_ts + 30120, }, 3: { FnArg: int8(-int32(1)), FbPure: uint8(1), - FzName: __ccgo_ts + 29987, + FzName: __ccgo_ts + 30133, }, 4: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29933, + FzName: __ccgo_ts + 30079, }, 5: { FnArg: int8(3), FbPure: uint8(1), - FzName: __ccgo_ts + 29999, + FzName: __ccgo_ts + 30145, }, 6: { FnArg: int8(2), FbPure: uint8(1), - FzName: __ccgo_ts + 29917, + FzName: __ccgo_ts + 30063, }, 7: { FnArg: int8(1), - FzName: __ccgo_ts + 30022, + FzName: __ccgo_ts + 30168, }, 8: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30036, + FzName: __ccgo_ts + 30182, }, 9: { FnArg: int8(7), FbPure: uint8(1), - FzName: __ccgo_ts + 30049, + FzName: __ccgo_ts + 30195, }, 10: { FnArg: int8(4), FbPure: uint8(1), - FzName: __ccgo_ts + 30063, + FzName: __ccgo_ts + 30209, }, 11: { FnArg: int8(1), FbPure: uint8(1), - FzName: __ccgo_ts + 30079, + FzName: __ccgo_ts + 30225, }, } @@ -257987,7 +249652,7 @@ var _aAgg = [1]struct { FzName uintptr }{ 0: { - FzName: __ccgo_ts + 30091, + FzName: __ccgo_ts + 30237, }, } @@ -258012,20 +249677,20 @@ func _sqlite3RtreeInit(tls *libc.TLS, db uintptr) (r int32) { var rc, utf8 int32 _, _, _, _ = c, c1, rc, utf8 utf8 = int32(SQLITE_UTF8) - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30118, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30264, int32(2), utf8, uintptr(0), __ccgo_fp(_rtreenode), uintptr(0), uintptr(0)) if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30128, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30274, int32(1), utf8, uintptr(0), __ccgo_fp(_rtreedepth), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30139, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) + rc = Xsqlite3_create_function(tls, db, __ccgo_ts+30285, -int32(1), utf8, uintptr(0), __ccgo_fp(_rtreecheck), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { c = libc.UintptrFromInt32(RTREE_COORD_REAL32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+29862, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30008, uintptr(unsafe.Pointer(&_rtreeModule)), c, uintptr(0)) } if rc == SQLITE_OK { c1 = libc.UintptrFromInt32(RTREE_COORD_INT32) - rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30150, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) + rc = Xsqlite3_create_module_v2(tls, db, __ccgo_ts+30296, uintptr(unsafe.Pointer(&_rtreeModule)), c1, uintptr(0)) } if rc == SQLITE_OK { rc = _sqlite3_geopoly_init(tls, db) @@ -258099,7 +249764,7 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { _, _, _, _, _ = i, memErr, nBlob, pBlob, pGeomCtx pGeomCtx = Xsqlite3_user_data(tls, ctx) memErr = 0 - nBlob = int64(uint32(40) + uint32(nArg-libc.Int32FromInt32(1))*uint32(8) + uint32(nArg)*uint32(4)) + nBlob = int64(uint32(libc.UintptrFromInt32(0)+32) + uint32(nArg)*uint32(8) + uint32(nArg)*uint32(4)) pBlob = Xsqlite3_malloc64(tls, uint64(nBlob)) if !(pBlob != 0) { Xsqlite3_result_error_nomem(tls, ctx) @@ -258127,17 +249792,19 @@ func _geomCallback(tls *libc.TLS, ctx uintptr, nArg int32, aArg uintptr) { Xsqlite3_result_error_nomem(tls, ctx) _rtreeMatchArgFree(tls, pBlob) } else { - Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+27419, __ccgo_fp(_rtreeMatchArgFree)) + Xsqlite3_result_pointer(tls, ctx, pBlob, __ccgo_ts+27565, __ccgo_fp(_rtreeMatchArgFree)) } } } +type t__ccgo_fp__Xsqlite3_rtree_geometry_callback_2 = func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32 + // C documentation // // /* // ** Register a new geometry function for use with the r-tree MATCH operator. // */ -func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, xGeom uintptr, pContext uintptr) (r int32) { +func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, __ccgo_fp_xGeom uintptr, pContext uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ @@ -258145,33 +249812,37 @@ func Xsqlite3_rtree_geometry_callback(tls *libc.TLS, db uintptr, zGeom uintptr, if !(pGeomCtx != 0) { return int32(SQLITE_NOMEM) } - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = xGeom + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = __ccgo_fp_xGeom (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = uintptr(0) (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zGeom, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } +type t__ccgo_fp__Xsqlite3_rtree_query_callback_2 = func(*libc.TLS, uintptr) int32 + +type t__ccgo_fp__Xsqlite3_rtree_query_callback_4 = func(*libc.TLS, uintptr) + // C documentation // // /* // ** Register a new 2nd-generation geometry function for use with the // ** r-tree MATCH operator. // */ -func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, xQueryFunc uintptr, pContext uintptr, xDestructor uintptr) (r int32) { +func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr, __ccgo_fp_xQueryFunc uintptr, pContext uintptr, __ccgo_fp_xDestructor uintptr) (r int32) { var pGeomCtx uintptr _ = pGeomCtx /* Context object for new user-function */ /* Allocate and populate the context object. */ pGeomCtx = Xsqlite3_malloc(tls, int32(16)) if !(pGeomCtx != 0) { - if xDestructor != 0 { - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{xDestructor})))(tls, pContext) + if __ccgo_fp_xDestructor != 0 { + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xDestructor})))(tls, pContext) } return int32(SQLITE_NOMEM) } (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxGeom = uintptr(0) - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = xQueryFunc - (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = xDestructor + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxQueryFunc = __ccgo_fp_xQueryFunc + (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FxDestructor = __ccgo_fp_xDestructor (*TRtreeGeomCallback)(unsafe.Pointer(pGeomCtx)).FpContext = pContext return Xsqlite3_create_function_v2(tls, db, zQueryFunc, -int32(1), int32(SQLITE_ANY), pGeomCtx, __ccgo_fp(_geomCallback), uintptr(0), uintptr(0), __ccgo_fp(_rtreeFreeCallback)) } @@ -258368,7 +250039,7 @@ func Xsqlite3_rtree_query_callback(tls *libc.TLS, db uintptr, zQueryFunc uintptr ** ** "RBU" stands for "Resumable Bulk Update". As in a large database update ** transmitted via a wireless network to a mobile device. A transaction -** applied using this extension is hence refered to as an "RBU update". +** applied using this extension is hence referred to as an "RBU update". ** ** ** LIMITATIONS @@ -258796,255 +250467,6 @@ type TRbuUpdateStmt = struct { type RbuUpdateStmt = TRbuUpdateStmt -/* -** These values must match the values defined in wal.c for the equivalent -** locks. These are not magic numbers as they are part of the SQLite file -** format. - */ - -/* -** A structure to store values read from the rbu_state table in memory. - */ -type TRbuState1 = struct { - F__ccgo_align [0]uint32 - FeStage int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiWalCksum Ti64 - FnRow int32 - F__ccgo_align6 [4]byte - FnProgress Ti64 - FiCookie Tu32 - F__ccgo_align8 [4]byte - FiOalSz Ti64 - FnPhaseOneStep Ti64 -} - -type RbuState1 = TRbuState1 - -type TRbuUpdateStmt1 = struct { - FzMask uintptr - FpUpdate uintptr - FpNext uintptr -} - -type RbuUpdateStmt1 = TRbuUpdateStmt1 - -type TRbuSpan1 = struct { - FzSpan uintptr - FnSpan int32 -} - -type RbuSpan1 = TRbuSpan1 - -/* -** An iterator of this type is used to iterate through all objects in -** the target database that require updating. For each such table, the -** iterator visits, in order: -** -** * the table itself, -** * each index of the table (zero or more points to visit), and -** * a special "cleanup table" state. -** -** abIndexed: -** If the table has no indexes on it, abIndexed is set to NULL. Otherwise, -** it points to an array of flags nTblCol elements in size. The flag is -** set for each column that is either a part of the PK or a part of an -** index. Or clear otherwise. -** -** If there are one or more partial indexes on the table, all fields of -** this array set set to 1. This is because in that case, the module has -** no way to tell which fields will be required to add and remove entries -** from the partial indexes. -** - */ -type TRbuObjIter1 = struct { - FpTblIter uintptr - FpIdxIter uintptr - FnTblCol int32 - FazTblCol uintptr - FazTblType uintptr - FaiSrcOrder uintptr - FabTblPk uintptr - FabNotNull uintptr - FabIndexed uintptr - FeType int32 - FbCleanup int32 - FzTbl uintptr - FzDataTbl uintptr - FzIdx uintptr - FiTnum int32 - FiPkTnum int32 - FbUnique int32 - FnIndex int32 - FnCol int32 - FpSelect uintptr - FpInsert uintptr - FpDelete uintptr - FpTmpInsert uintptr - FnIdxCol int32 - FaIdxCol uintptr - FzIdxSql uintptr - FpRbuUpdate uintptr -} - -type RbuObjIter1 = TRbuObjIter1 - -/* -** Values for RbuObjIter.eType -** -** 0: Table does not exist (error) -** 1: Table has an implicit rowid. -** 2: Table has an explicit IPK column. -** 3: Table has an external PK index. -** 4: Table is WITHOUT ROWID. -** 5: Table is a virtual table. - */ - -/* -** Within the RBU_STAGE_OAL stage, each call to sqlite3rbu_step() performs -** one of the following operations. - */ - -/* -** A single step of an incremental checkpoint - frame iWalFrame of the wal -** file should be copied to page iDbPage of the database file. - */ -type TRbuFrame1 = struct { - FiDbPage Tu32 - FiWalFrame Tu32 -} - -type RbuFrame1 = TRbuFrame1 - -/* -** RBU handle. -** -** nPhaseOneStep: -** If the RBU database contains an rbu_count table, this value is set to -** a running estimate of the number of b-tree operations required to -** finish populating the *-oal file. This allows the sqlite3_bp_progress() -** API to calculate the permyriadage progress of populating the *-oal file -** using the formula: -** -** permyriadage = (10000 * nProgress) / nPhaseOneStep -** -** nPhaseOneStep is initialized to the sum of: -** -** nRow * (nIndex + 1) -** -** for all source tables in the RBU database, where nRow is the number -** of rows in the source table and nIndex the number of indexes on the -** corresponding target database table. -** -** This estimate is accurate if the RBU update consists entirely of -** INSERT operations. However, it is inaccurate if: -** -** * the RBU update contains any UPDATE operations. If the PK specified -** for an UPDATE operation does not exist in the target table, then -** no b-tree operations are required on index b-trees. Or if the -** specified PK does exist, then (nIndex*2) such operations are -** required (one delete and one insert on each index b-tree). -** -** * the RBU update contains any DELETE operations for which the specified -** PK does not exist. In this case no operations are required on index -** b-trees. -** -** * the RBU update contains REPLACE operations. These are similar to -** UPDATE operations. -** -** nPhaseOneStep is updated to account for the conditions above during the -** first pass of each source table. The updated nPhaseOneStep value is -** stored in the rbu_state table if the RBU update is suspended. - */ -type Tsqlite3rbu1 = struct { - F__ccgo_align [0]uint32 - FeStage int32 - FdbMain uintptr - FdbRbu uintptr - FzTarget uintptr - FzRbu uintptr - FzState uintptr - FzStateDb [5]int8 - Frc int32 - FzErrmsg uintptr - FnStep int32 - F__ccgo_align10 [4]byte - FnProgress Tsqlite3_int64 - Fobjiter TRbuObjIter - FzVfsName uintptr - FpTargetFd uintptr - FnPagePerSector int32 - FiOalSz Ti64 - FnPhaseOneStep Ti64 - FpRenameArg uintptr - FxRename uintptr - FiMaxFrame Tu32 - FmLock Tu32 - FnFrame int32 - FnFrameAlloc int32 - FaFrame uintptr - Fpgsz int32 - FaBuf uintptr - F__ccgo_align26 [4]byte - FiWalCksum Ti64 - FszTemp Ti64 - FszTempLimit Ti64 - FnRbu int32 - FpRbuFd uintptr -} - -type sqlite3rbu1 = Tsqlite3rbu1 - -/* -** An rbu VFS is implemented using an instance of this structure. -** -** Variable pRbu is only non-NULL for automatically created RBU VFS objects. -** It is NULL for RBU VFS objects created explicitly using -** sqlite3rbu_create_vfs(). It is used to track the total amount of temp -** space used by the RBU handle. - */ -type Trbu_vfs1 = struct { - Fbase Tsqlite3_vfs - FpRealVfs uintptr - Fmutex uintptr - FpRbu uintptr - FpMain uintptr - FpMainRbu uintptr -} - -type rbu_vfs1 = Trbu_vfs1 - -/* -** Each file opened by an rbu VFS is represented by an instance of -** the following structure. -** -** If this is a temporary file (pRbu!=0 && flags&DELETE_ON_CLOSE), variable -** "sz" is set to the current size of the database file. - */ -type Trbu_file1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_file - FpReal uintptr - FpRbuVfs uintptr - FpRbu uintptr - Fsz Ti64 - FopenFlags int32 - FiCookie Tu32 - FiWriteVer Tu8 - FbNolock Tu8 - FnShm int32 - FapShm uintptr - FzDel uintptr - FzWal uintptr - FpWalFd uintptr - FpMainNext uintptr - FpMainRbuNext uintptr -} - -type rbu_file1 = Trbu_file1 - /* ** True for an RBU vacuum handle, or false otherwise. */ @@ -259358,7 +250780,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt /* Figure out the size of the output */ nOut = _rbuDeltaOutputSize(tls, aDelta, nDelta) if nOut < 0 { - Xsqlite3_result_error(tls, context, __ccgo_ts+30160, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30306, -int32(1)) return } aOut = Xsqlite3_malloc(tls, nOut+int32(1)) @@ -259368,7 +250790,7 @@ func _rbuFossilDeltaFunc(tls *libc.TLS, context uintptr, argc int32, argv uintpt nOut2 = _rbuDeltaApply(tls, aOrig, nOrig, aDelta, nDelta, aOut) if nOut2 != nOut { Xsqlite3_free(tls, aOut) - Xsqlite3_result_error(tls, context, __ccgo_ts+30160, -int32(1)) + Xsqlite3_result_error(tls, context, __ccgo_ts+30306, -int32(1)) } else { Xsqlite3_result_blob(tls, context, aOut, nOut, __ccgo_fp(Xsqlite3_free)) } @@ -259394,7 +250816,7 @@ func _prepareAndCollectError(tls *libc.TLS, db uintptr, ppStmt uintptr, pzErrmsg _ = rc rc = Xsqlite3_prepare_v2(tls, db, zSql, -int32(1), ppStmt, uintptr(0)) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) } return rc @@ -259417,7 +250839,7 @@ func _resetAndCollectError(tls *libc.TLS, pStmt uintptr, pzErrmsg uintptr) (r in _ = rc rc = Xsqlite3_reset(tls, pStmt) if rc != SQLITE_OK { - *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) + *(*uintptr)(unsafe.Pointer(pzErrmsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, Xsqlite3_db_handle(tls, pStmt)))) } return rc } @@ -259549,7 +250971,7 @@ func _rbuObjIterNext(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { /* Free any SQLite statements used while processing the previous object */ _rbuObjIterClearStatements(tls, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30181, uintptr(0), uintptr(0), p+36) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+30327, uintptr(0), uintptr(0), p+36) } if rc == SQLITE_OK { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -259638,7 +251060,7 @@ func _rbuTargetNameFunc(tls *libc.TLS, pCtx uintptr, argc int32, argv uintptr) { Xsqlite3_result_text(tls, pCtx, zIn, -int32(1), libc.UintptrFromInt32(0)) } } else { - if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+27332, zIn, uint32(4)) == 0 { + if libc.Xstrlen(tls, zIn) > uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+27478, zIn, uint32(4)) == 0 { i = int32(4) for { if !(int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(zIn + uintptr(i)))) <= int32('9')) { @@ -259675,13 +251097,13 @@ func _rbuObjIterFirst(tls *libc.TLS, p uintptr, pIter uintptr) (r int32) { _, _ = rc, v1 libc.Xmemset(tls, pIter, 0, uint32(108)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 30352 + v1 = __ccgo_ts + 30498 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30393, libc.VaList(bp+8, v1))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30539, libc.VaList(bp+8, v1))) if rc == SQLITE_OK { - rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+30543) + rc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+4, p+36, __ccgo_ts+30689) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup = int32(1) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -259848,7 +251270,7 @@ func _rbuFinalize(tls *libc.TLS, p uintptr, pStmt uintptr) { rc = Xsqlite3_finalize(tls, pStmt) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && rc != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, Xsqlite3_errmsg(tls, db))) } } @@ -259909,7 +251331,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu *(*[4]uintptr)(unsafe.Pointer(bp)) = [4]uintptr{} *(*int32)(unsafe.Pointer(peType)) = RBU_PK_NOTABLE *(*int32)(unsafe.Pointer(piPk)) = 0 - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30668, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30814, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK || Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0]) != int32(SQLITE_ROW) { /* Either an error, or no such table. */ goto rbuTableType_end @@ -259919,7 +251341,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } *(*int32)(unsafe.Pointer(piTnum)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[0], int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30787, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+1*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30933, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { goto rbuTableType_end } @@ -259927,7 +251349,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu zOrig = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(3)) zIdx = Xsqlite3_column_text(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(1)], int32(1)) if zOrig != 0 && zIdx != 0 && int32(*(*Tu8)(unsafe.Pointer(zOrig))) == int32('p') { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30808, libc.VaList(bp+24, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+2*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30954, libc.VaList(bp+24, zIdx))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)]) == int32(SQLITE_ROW) { *(*int32)(unsafe.Pointer(piPk)) = Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(2)], 0) @@ -259939,7 +251361,7 @@ func _rbuTableType(tls *libc.TLS, p uintptr, zTab uintptr, peType uintptr, piTnu goto rbuTableType_end } } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30859, libc.VaList(bp+24, zTab))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+3*4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31005, libc.VaList(bp+24, zTab))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { for Xsqlite3_step(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)]) == int32(SQLITE_ROW) { if Xsqlite3_column_int(tls, (*(*[4]uintptr)(unsafe.Pointer(bp)))[int32(3)], int32(5)) > 0 { @@ -259983,7 +251405,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { bIndex = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { libc.Xmemcpy(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk, uint32(1)*uint32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30880, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31026, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } (*TRbuObjIter)(unsafe.Pointer(pIter)).FnIndex = 0 for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -259996,7 +251418,7 @@ func _rbuObjIterCacheIndexedCols(tls *libc.TLS, p uintptr, pIter uintptr) { if bPartial != 0 { libc.Xmemset(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed, int32(0x01), uint32(1)*uint32((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)) } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+16, zIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) if iCid >= 0 { @@ -260049,7 +251471,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 _rbuTableType(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, pIter+36, bp+4, pIter+60) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == RBU_PK_NOTABLE { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+21447, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+21610, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc @@ -260060,7 +251482,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 /* Populate the azTblCol[] and nTblCol variables based on the columns ** of the input table. Ignore any input table columns that begin with ** "rbu_". */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30937, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31083, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { nCol = Xsqlite3_column_count(tls, *(*uintptr)(unsafe.Pointer(bp))) _rbuAllocateIterArrays(tls, p, pIter, nCol) @@ -260071,7 +251493,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 break } zName = Xsqlite3_column_name(tls, *(*uintptr)(unsafe.Pointer(bp)), i) - if Xsqlite3_strnicmp(tls, __ccgo_ts+30956, zName, int32(4)) != 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+31102, zName, int32(4)) != 0 { zCopy = _rbuStrndup(tls, zName, p+32) *(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr((*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol)*4)) = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol v3 = pIter + 8 @@ -260079,7 +251501,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 *(*int32)(unsafe.Pointer(v3))++ *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(v2)*4)) = zCopy } else { - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+30961, zName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+31107, zName) { bRbuRowid = int32(1) } } @@ -260093,17 +251515,17 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && bRbuRowid != libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) if bRbuRowid != 0 { - v4 = __ccgo_ts + 30971 + v4 = __ccgo_ts + 31117 } else { - v4 = __ccgo_ts + 30984 + v4 = __ccgo_ts + 31130 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+30993, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31139, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v4)) } /* Check that all non-HIDDEN columns in the destination table are also ** present in the input table. Populate the abTblPk[], azTblType[] and ** aiTblOrder[] arrays at the same time. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31022, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31168, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zName1 = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -260125,7 +251547,7 @@ func _rbuObjIterCacheTableInfo(tls *libc.TLS, p uintptr, pIter uintptr) (r int32 } if i == (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31044, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31190, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zName1)) } else { iPk = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) bNotNull = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) @@ -260164,15 +251586,15 @@ func _rbuObjIterGetCollist(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) var z, zList, zSep uintptr _, _, _, _ = i, z, zList, zSep zList = uintptr(0) - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } z = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+31071, libc.VaList(bp+8, zList, zSep, z)) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31217, libc.VaList(bp+8, zList, zSep, z)) + zSep = __ccgo_ts + 16575 goto _1 _1: ; @@ -260197,7 +251619,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, _, _, _, _, _ = i, iPk, zCol, zRet, zSep iPk = int32(1) zRet = uintptr(0) - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 for int32(1) != 0 { i = 0 for { @@ -260206,7 +251628,7 @@ func _rbuObjIterGetPkList(tls *libc.TLS, p uintptr, pIter uintptr, zPre uintptr, } if int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == iPk { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31080, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31226, libc.VaList(bp+8, zRet, zSep, zPre, zCol, zPost)) zSep = zSeparator break } @@ -260254,21 +251676,21 @@ func _rbuVacuumTableStart(tls *libc.TLS, p uintptr, pIter uintptr, bRowid int32, *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) zRet = uintptr(0) if bRowid != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31093, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31239, libc.VaList(bp+16, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iMax = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31125, libc.VaList(bp+16, iMax)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31271, libc.VaList(bp+16, iMax)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1673, __ccgo_ts+16459, __ccgo_ts+31148) - zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31154, __ccgo_ts+31161, __ccgo_ts+6480) - zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1673, __ccgo_ts+16459, __ccgo_ts+1673) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16575, __ccgo_ts+31294) + zSelect = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+31300, __ccgo_ts+31307, __ccgo_ts+6568) + zList = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16575, __ccgo_ts+1674) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31169, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31315, libc.VaList(bp+16, zSelect, zWrite, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zVal = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31211, libc.VaList(bp+16, zList, zVal)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31357, libc.VaList(bp+16, zList, zVal)) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -260317,10 +251739,10 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { zVector = uintptr(0) zRet = uintptr(0) bFailed = 0 - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 iCol = 0 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(4)) @@ -260342,15 +251764,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { - zCol = __ccgo_ts + 31231 + zCol = __ccgo_ts + 31377 } } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) } - zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31239, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31260, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) - zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31296, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) - zSep = __ccgo_ts + 16459 + zLhs = _rbuMPrintf(tls, p, __ccgo_ts+31385, libc.VaList(bp+16, zLhs, zSep, zCol, zCollate)) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31406, libc.VaList(bp+16, zOrder, zSep, iCol, zCol, zCollate)) + zSelect = _rbuMPrintf(tls, p, __ccgo_ts+31442, libc.VaList(bp+16, zSelect, zSep, iCol, zCol)) + zSep = __ccgo_ts + 16575 iCol++ } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) @@ -260359,9 +251781,9 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31323, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31469, libc.VaList(bp+16, zSelect, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zOrder))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 iCol = 0 for { if !(iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol) { @@ -260376,15 +251798,15 @@ func _rbuVacuumIndexStart(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { break } } - zVector = _rbuMPrintf(tls, p, __ccgo_ts+31371, libc.VaList(bp+16, zVector, zSep, zQuoted)) - zSep = __ccgo_ts + 16459 + zVector = _rbuMPrintf(tls, p, __ccgo_ts+31517, libc.VaList(bp+16, zVector, zSep, zQuoted)) + zSep = __ccgo_ts + 16575 goto _2 _2: ; iCol++ } if !(bFailed != 0) { - zRet = _rbuMPrintf(tls, p, __ccgo_ts+31378, libc.VaList(bp+16, zLhs, zVector)) + zRet = _rbuMPrintf(tls, p, __ccgo_ts+31524, libc.VaList(bp+16, zLhs, zVector)) } } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -260438,11 +251860,11 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zImpPK = uintptr(0) /* String to return via *pzImposterPK */ zWhere = uintptr(0) /* String to return via *pzWhere */ nBind = 0 /* Value to return via *pnBind */ - zCom = __ccgo_ts + 1673 /* Set to ", " later on */ - zAnd = __ccgo_ts + 1673 /* Set to " AND " later on */ + zCom = __ccgo_ts + 1674 /* Set to ", " later on */ + zAnd = __ccgo_ts + 1674 /* Set to " AND " later on */ *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_xinfo = ? */ if rc == SQLITE_OK { - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx))) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -260451,8 +251873,8 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = uintptr(0) if iCid == -int32(2) { iSeq = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31390, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) - zType = __ccgo_ts + 1673 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31536, libc.VaList(bp+16, zRet, zCom, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FnSpan, (*(*TRbuSpan)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaIdxCol + uintptr(iSeq)*8))).FzSpan, zCollate)) + zType = __ccgo_ts + 1674 } else { if iCid < 0 { /* An integer primary key. If the table has an explicit IPK, use @@ -260471,34 +251893,34 @@ func _rbuObjIterGetIndexCols(tls *libc.TLS, p uintptr, pIter uintptr, pzImposter zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zCol = __ccgo_ts + 31231 + zCol = __ccgo_ts + 31377 } else { - zCol = __ccgo_ts + 30961 + zCol = __ccgo_ts + 31107 } } - zType = __ccgo_ts + 1147 + zType = __ccgo_ts + 1148 } else { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCid)*4)) zType = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)) } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31412, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+31558, libc.VaList(bp+16, zRet, zCom, zCol, zCollate)) } if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbUnique == 0 || Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(5)) != 0 { if bDesc != 0 { - v2 = __ccgo_ts + 31148 + v2 = __ccgo_ts + 31294 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } zOrder = v2 - zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31432, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) + zImpPK = Xsqlite3_mprintf(tls, __ccgo_ts+31578, libc.VaList(bp+16, zImpPK, zCom, nBind, zCol, zOrder)) } - zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31453, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) - zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31486, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) + zImpCols = Xsqlite3_mprintf(tls, __ccgo_ts+31599, libc.VaList(bp+16, zImpCols, zCom, nBind, zCol, zType, zCollate)) + zWhere = Xsqlite3_mprintf(tls, __ccgo_ts+31632, libc.VaList(bp+16, zWhere, zAnd, nBind, zCol)) if zRet == uintptr(0) || zImpPK == uintptr(0) || zImpCols == uintptr(0) || zWhere == uintptr(0) { rc = int32(SQLITE_NOMEM) } - zCom = __ccgo_ts + 16459 - zAnd = __ccgo_ts + 23556 + zCom = __ccgo_ts + 16575 + zAnd = __ccgo_ts + 23719 nBind++ } rc2 = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -260544,7 +251966,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr _, _, _, _ = i, zCol, zList, zS zList = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zS = __ccgo_ts + 1673 + zS = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -260552,11 +251974,11 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed + uintptr(i))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)) - zList = Xsqlite3_mprintf(tls, __ccgo_ts+31510, libc.VaList(bp+8, zList, zS, zObj, zCol)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31656, libc.VaList(bp+8, zList, zS, zObj, zCol)) } else { - zList = Xsqlite3_mprintf(tls, __ccgo_ts+31522, libc.VaList(bp+8, zList, zS)) + zList = Xsqlite3_mprintf(tls, __ccgo_ts+31668, libc.VaList(bp+8, zList, zS)) } - zS = __ccgo_ts + 16459 + zS = __ccgo_ts + 16575 if zList == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) break @@ -260568,7 +251990,7 @@ func _rbuObjIterGetOldlist(tls *libc.TLS, p uintptr, pIter uintptr, zObj uintptr } /* For a table with implicit rowids, append "old._rowid_" to the list. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31531, libc.VaList(bp+8, zList, zObj)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31677, libc.VaList(bp+8, zList, zObj)) } } return zList @@ -260594,27 +252016,27 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _ = i, i1, zCol, zList, zSep, zSep1 zList = uintptr(0) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31546, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31692, libc.VaList(bp+8, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1))) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31560, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) - zSep = __ccgo_ts + 23556 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31706, libc.VaList(bp+8, zList, zSep, i, i+int32(1))) + zSep = __ccgo_ts + 23719 } goto _1 _1: ; i++ } - zList = _rbuMPrintf(tls, p, __ccgo_ts+31572, libc.VaList(bp+8, zList)) + zList = _rbuMPrintf(tls, p, __ccgo_ts+31718, libc.VaList(bp+8, zList)) } else { - zSep1 = __ccgo_ts + 1673 + zSep1 = __ccgo_ts + 1674 i1 = 0 for { if !(i1 < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -260622,8 +252044,8 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i1))) != 0 { zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i1)*4)) - zList = _rbuMPrintf(tls, p, __ccgo_ts+31622, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) - zSep1 = __ccgo_ts + 23556 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31768, libc.VaList(bp+8, zList, zSep1, zCol, i1+int32(1))) + zSep1 = __ccgo_ts + 23719 } goto _2 _2: @@ -260646,7 +252068,7 @@ func _rbuObjIterGetWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { // */ func _rbuBadControlError(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31635, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+31781, 0) } // C documentation @@ -260680,7 +252102,7 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt if int32(libc.Xstrlen(tls, zMask)) != (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol { _rbuBadControlError(tls, p) } else { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { @@ -260688,16 +252110,16 @@ func _rbuObjIterGetSetlist(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintpt } c = *(*int8)(unsafe.Pointer(zMask + uintptr(*(*int32)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FaiSrcOrder + uintptr(i)*4))))) if int32(c) == int32('x') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31622, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31768, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 16575 } else { if int32(c) == int32('d') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31661, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31807, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 16575 } else { if int32(c) == int32('f') { - zList = _rbuMPrintf(tls, p, __ccgo_ts+31691, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) - zSep = __ccgo_ts + 16459 + zList = _rbuMPrintf(tls, p, __ccgo_ts+31837, libc.VaList(bp+8, zList, zSep, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(i)*4)), i+int32(1))) + zSep = __ccgo_ts + 16575 } } } @@ -260781,16 +252203,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { _, _, _, _, _, _, _ = z, zCol, zDesc, zIdx, zOrig, zSep, v1 z = uintptr(0) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zSep = __ccgo_ts + 31728 + zSep = __ccgo_ts + 31874 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* PRAGMA index_list = (pIter->zTbl) */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* PRAGMA index_xinfo = */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30880, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31026, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zOrig = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(3)) - if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+18049) == 0 { + if zOrig != 0 && libc.Xstrcmp(tls, zOrig, __ccgo_ts+18212) == 0 { zIdx = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+16, zIdx))) } break } @@ -260801,16 +252223,16 @@ func _rbuWithoutRowidPK(tls *libc.TLS, p uintptr, pIter uintptr) (r uintptr) { /* int iCid = sqlite3_column_int(pXInfo, 0); */ zCol = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(2)) if Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) != 0 { - v1 = __ccgo_ts + 31148 + v1 = __ccgo_ts + 31294 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } zDesc = v1 - z = _rbuMPrintf(tls, p, __ccgo_ts+31741, libc.VaList(bp+16, z, zSep, zCol, zDesc)) - zSep = __ccgo_ts + 16459 + z = _rbuMPrintf(tls, p, __ccgo_ts+31887, libc.VaList(bp+16, z, zSep, zCol, zDesc)) + zSep = __ccgo_ts + 16575 } } - z = _rbuMPrintf(tls, p, __ccgo_ts+31752, libc.VaList(bp+16, z)) + z = _rbuMPrintf(tls, p, __ccgo_ts+31898, libc.VaList(bp+16, z)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) } return z @@ -260850,13 +252272,13 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT name ... WHERE rootpage = $tnum */ zIdx = uintptr(0) /* Name of PK index */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) /* PRAGMA main.index_xinfo = $zIdx */ - zComma = __ccgo_ts + 1673 + zComma = __ccgo_ts + 1674 zCols = uintptr(0) /* Used to build up list of table cols */ zPk = uintptr(0) /* Used to build up table PK declaration */ /* Figure out the name of the primary key index for the current table. ** This is needed for the argument to "PRAGMA index_xinfo". Set ** zIdx to point to a nul-terminated string containing this name. */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+31756) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+31902) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), tnum) if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -260864,7 +252286,7 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { } } if zIdx != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+30908, libc.VaList(bp+16, zIdx))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+31054, libc.VaList(bp+16, zIdx))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { @@ -260873,21 +252295,21 @@ func _rbuCreateImposterTable2(tls *libc.TLS, p uintptr, pIter uintptr) { iCid = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(1)) bDesc = Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(3)) zCollate = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), int32(4)) - zCols = _rbuMPrintf(tls, p, __ccgo_ts+31806, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+31952, libc.VaList(bp+16, zCols, zComma, iCid, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCid)*4)), zCollate)) if bDesc != 0 { - v1 = __ccgo_ts + 31148 + v1 = __ccgo_ts + 31294 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - zPk = _rbuMPrintf(tls, p, __ccgo_ts+31828, libc.VaList(bp+16, zPk, zComma, iCid, v1)) - zComma = __ccgo_ts + 16459 + zPk = _rbuMPrintf(tls, p, __ccgo_ts+31974, libc.VaList(bp+16, zPk, zComma, iCid, v1)) + zComma = __ccgo_ts + 16575 } } - zCols = _rbuMPrintf(tls, p, __ccgo_ts+31838, libc.VaList(bp+16, zCols)) + zCols = _rbuMPrintf(tls, p, __ccgo_ts+31984, libc.VaList(bp+16, zCols)) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31853, libc.VaList(bp+16, zCols, zPk)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31999, libc.VaList(bp+16, zCols, zPk)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, 0)) } } @@ -260922,30 +252344,30 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { _, _, _, _, _, _, _, _, _ = iCol, tnum, zCol, zComma, zPk, zPk1, zSql, v2, v3 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { tnum = (*TRbuObjIter)(unsafe.Pointer(pIter)).FiTnum - zComma = __ccgo_ts + 1673 + zComma = __ccgo_ts + 1674 zSql = uintptr(0) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, int32(1))) iCol = 0 for { if !((*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && iCol < (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol) { break } - zPk = __ccgo_ts + 1673 + zPk = __ccgo_ts + 1674 zCol = *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblCol + uintptr(iCol)*4)) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_table_column_metadata(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zCol, uintptr(0), bp, uintptr(0), uintptr(0), uintptr(0)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(iCol))) != 0 { /* If the target table column is an "INTEGER PRIMARY KEY", add ** "PRIMARY KEY" to the imposter table column declaration. */ - zPk = __ccgo_ts + 31915 + zPk = __ccgo_ts + 32061 } if *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabNotNull + uintptr(iCol))) != 0 { - v2 = __ccgo_ts + 31928 + v2 = __ccgo_ts + 32074 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31938, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) - zComma = __ccgo_ts + 16459 + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32084, libc.VaList(bp+16, zSql, zComma, zCol, *(*uintptr)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FazTblType + uintptr(iCol)*4)), zPk, *(*uintptr)(unsafe.Pointer(bp)), v2)) + zComma = __ccgo_ts + 16575 goto _1 _1: ; @@ -260954,17 +252376,17 @@ func _rbuCreateImposterTable(tls *libc.TLS, p uintptr, pIter uintptr) { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { zPk1 = _rbuWithoutRowidPK(tls, p, pIter) if zPk1 != 0 { - zSql = _rbuMPrintf(tls, p, __ccgo_ts+31965, libc.VaList(bp+16, zSql, zPk1)) + zSql = _rbuMPrintf(tls, p, __ccgo_ts+32111, libc.VaList(bp+16, zSql, zPk1)) } } - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(1), tnum)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(1), tnum)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_WITHOUT_ROWID) { - v3 = __ccgo_ts + 31972 + v3 = __ccgo_ts + 32118 } else { - v3 = __ccgo_ts + 1673 + v3 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+31987, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, 0)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32133, libc.VaList(bp+16, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSql, v3)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, 0)) } } @@ -260990,7 +252412,7 @@ func _rbuObjIterPrepareTmpInsert(tls *libc.TLS, p uintptr, pIter uintptr, zColli bRbuRowid = libc.BoolInt32((*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE)) zBind = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+int32(1)+bRbuRowid) if zBind != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32019, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+88, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32165, libc.VaList(bp+8, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zCollist, zRbuRowid, zBind))) } } @@ -261036,7 +252458,7 @@ func _rbuObjIterGetIndexWhere(tls *libc.TLS, p uintptr, pIter uintptr) (r uintpt *(*int32)(unsafe.Pointer(bp + 4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc zRet = uintptr(0) if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+32076) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp, p+36, __ccgo_ts+32222) } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp + 4)) = Xsqlite3_bind_text(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1), (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx, -int32(1), libc.UintptrFromInt32(0)) @@ -261205,7 +252627,7 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zIdx = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx zLimit = uintptr(0) if nOffset != 0 { - zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+32142, libc.VaList(bp+24, nOffset)) + zLimit = Xsqlite3_mprintf(tls, __ccgo_ts+32288, libc.VaList(bp+24, nOffset)) if !(zLimit != 0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } @@ -261222,18 +252644,18 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zCollist = _rbuObjIterGetIndexCols(tls, p, pIter, bp, bp+4, bp+8, bp+12) zBind = _rbuObjIterGetBindlist(tls, p, *(*int32)(unsafe.Pointer(bp + 12))) /* Create the imposter table used to write to this index. */ - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, int32(1))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(1), tnum)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32162, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) - Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, 0, 0)) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, int32(1))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(1), tnum)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32308, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + Xsqlite3_test_control(tls, int32(SQLITE_TESTCTRL_IMPOSTER), libc.VaList(bp+24, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, 0, 0)) /* Create the statement to insert index entries */ (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = *(*int32)(unsafe.Pointer(bp + 12)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32227, libc.VaList(bp+24, zTbl, zBind))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32373, libc.VaList(bp+24, zTbl, zBind))) } /* And to delete index entries */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32263, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+32409, libc.VaList(bp+24, zTbl, *(*uintptr)(unsafe.Pointer(bp + 8))))) } /* Create the SELECT statement to read keys in sorted order */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -261248,26 +252670,26 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } if zStart != 0 { if zPart != 0 { - v2 = __ccgo_ts + 32297 + v2 = __ccgo_ts + 32443 } else { - v2 = __ccgo_ts + 32301 + v2 = __ccgo_ts + 32447 } v1 = v2 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32307, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32453, libc.VaList(bp+24, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v1, zStart, zCollist, zLimit)) Xsqlite3_free(tls, zStart) } else { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32368, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32514, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, zLimit)) } else { if zPart != 0 { - v3 = __ccgo_ts + 32297 + v3 = __ccgo_ts + 32443 } else { - v3 = __ccgo_ts + 32301 + v3 = __ccgo_ts + 32447 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32429, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+32575, libc.VaList(bp+24, zCollist, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, zCollist, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, zPart, v3, zCollist, zLimit)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -261286,62 +252708,62 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 zTbl1 = (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl /* Imposter table name */ zBindings = _rbuObjIterGetBindlist(tls, p, (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol+bRbuRowid) zWhere1 = _rbuObjIterGetWhere(tls, p, pIter) - zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8031) - zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8027) + zOldlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8118) + zNewlist = _rbuObjIterGetOldlist(tls, p, pIter, __ccgo_ts+8114) zCollist = _rbuObjIterGetCollist(tls, p, pIter) (*TRbuObjIter)(unsafe.Pointer(pIter)).FnCol = (*TRbuObjIter)(unsafe.Pointer(pIter)).FnTblCol /* Create the imposter table or tables (if required). */ _rbuCreateImposterTable(tls, p, pIter) _rbuCreateImposterTable2(tls, p, pIter) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_VTAB) { - v4 = __ccgo_ts + 1673 + v4 = __ccgo_ts + 1674 } else { - v4 = __ccgo_ts + 32588 + v4 = __ccgo_ts + 32734 } zWrite = v4 /* Create the INSERT statement to write to the target PK b-tree */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if bRbuRowid != 0 { - v5 = __ccgo_ts + 32597 + v5 = __ccgo_ts + 32743 } else { - v5 = __ccgo_ts + 1673 + v5 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32607, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+80, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32753, libc.VaList(bp+24, zWrite, zTbl1, zCollist, v5, zBindings))) } /* Create the DELETE statement to write to the target PK b-tree. ** Because it only performs INSERT operations, this is not required for ** an rbu vacuum handle. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32643, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pIter+84, pz, Xsqlite3_mprintf(tls, __ccgo_ts+32789, libc.VaList(bp+24, zWrite, zTbl1, zWhere1))) } if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - zRbuRowid = __ccgo_ts + 1673 + zRbuRowid = __ccgo_ts + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - zRbuRowid = __ccgo_ts + 32671 + zRbuRowid = __ccgo_ts + 32817 } /* Create the rbu_tmp_xxx table and the triggers to populate it. */ if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) { - v6 = __ccgo_ts + 32683 + v6 = __ccgo_ts + 32829 } else { - v6 = __ccgo_ts + 1673 + v6 = __ccgo_ts + 1674 } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32700, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32776, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+32846, libc.VaList(bp+24, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v6, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+32922, libc.VaList(bp+24, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zOldlist, zWrite, zTbl1, zNewlist)) if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_EXTERNAL) || (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_NONE) { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33075, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33221, libc.VaList(bp+24, zWrite, zTbl1, zNewlist)) } _rbuObjIterPrepareTmpInsert(tls, p, pIter, zCollist, zRbuRowid) } /* Create the SELECT statement to read keys from data_xxx */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - zRbuRowid1 = __ccgo_ts + 1673 + zRbuRowid1 = __ccgo_ts + 1674 zStart1 = uintptr(0) zOrder = uintptr(0) if bRbuRowid != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v7 = __ccgo_ts + 33174 + v7 = __ccgo_ts + 33320 } else { - v7 = __ccgo_ts + 33184 + v7 = __ccgo_ts + 33330 } zRbuRowid1 = v7 } @@ -261354,28 +252776,28 @@ func _rbuObjIterPrepareAll(tls *libc.TLS, p uintptr, pIter uintptr, nOffset int3 } } if bRbuRowid != 0 { - zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31231, 0) + zOrder = _rbuMPrintf(tls, p, __ccgo_ts+31377, 0) } else { - zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1673, __ccgo_ts+16459, __ccgo_ts+1673) + zOrder = _rbuObjIterGetPkList(tls, p, pIter, __ccgo_ts+1674, __ccgo_ts+16575, __ccgo_ts+1674) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v8 = __ccgo_ts + 33195 + v8 = __ccgo_ts + 33341 } else { - v8 = __ccgo_ts + 1673 + v8 = __ccgo_ts + 1674 } if zStart1 != 0 { v9 = zStart1 } else { - v9 = __ccgo_ts + 1673 + v9 = __ccgo_ts + 1674 } if zOrder != 0 { - v10 = __ccgo_ts + 24812 + v10 = __ccgo_ts + 24975 } else { - v10 = __ccgo_ts + 1673 + v10 = __ccgo_ts + 1674 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+33201, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, pIter+76, pz, Xsqlite3_mprintf(tls, __ccgo_ts+33347, libc.VaList(bp+24, zCollist, v8, zRbuRowid1, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl, v9, v10, zOrder, zLimit))) } Xsqlite3_free(tls, zStart1) Xsqlite3_free(tls, zOrder) @@ -261461,11 +252883,11 @@ func _rbuGetUpdateStmt(tls *libc.TLS, p uintptr, pIter uintptr, zMask uintptr, p (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpNext = (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate (*TRbuObjIter)(unsafe.Pointer(pIter)).FpRbuUpdate = pUp if zSet != 0 { - zPrefix = __ccgo_ts + 1673 + zPrefix = __ccgo_ts + 1674 if (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType != int32(RBU_PK_VTAB) { - zPrefix = __ccgo_ts + 32588 + zPrefix = __ccgo_ts + 32734 } - zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33249, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) + zUpdate = Xsqlite3_mprintf(tls, __ccgo_ts+33395, libc.VaList(bp+8, zPrefix, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl, zSet, zWhere)) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, pUp+4, p+36, zUpdate) *(*uintptr)(unsafe.Pointer(ppStmt)) = (*TRbuUpdateStmt)(unsafe.Pointer(pUp)).FpUpdate } @@ -261492,7 +252914,7 @@ func _rbuOpenDbhandle(tls *libc.TLS, p uintptr, zName uintptr, bUseVfs int32) (r } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_open_v2(tls, zName, bp, flags, v1) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, *(*uintptr)(unsafe.Pointer(bp))))) Xsqlite3_close(tls, *(*uintptr)(unsafe.Pointer(bp))) *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) } @@ -261539,7 +252961,7 @@ func _rbuLoadState(tls *libc.TLS, p uintptr) (r uintptr) { if pRet == uintptr(0) { return uintptr(0) } - *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+33279, libc.VaList(bp+16, p+24))) + *(*int32)(unsafe.Pointer(bp + 4)) = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+33425, libc.VaList(bp+16, p+24))) for *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { switch Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) { case int32(RBU_STATE_STAGE): @@ -261598,27 +253020,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu = _rbuOpenDbhandle(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, int32(1)) (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain = dbMain if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBUCNT), p) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBUCNT), p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState == uintptr(0) { - zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+33309, libc.VaList(bp+8, zFile, zFile)) + zFile = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+33455, libc.VaList(bp+8, zFile, zFile)) } } /* If using separate RBU and state databases, attach the state database to ** the RBU db handle now. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33337, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) - libc.Xmemcpy(tls, p+24, __ccgo_ts+15317, uint32(4)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33483, libc.VaList(bp+8, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState)) + libc.Xmemcpy(tls, p+24, __ccgo_ts+15433, uint32(4)) } else { - libc.Xmemcpy(tls, p+24, __ccgo_ts+8020, uint32(4)) + libc.Xmemcpy(tls, p+24, __ccgo_ts+8107, uint32(4)) } /* If it has not already been created, create the rbu_state table */ - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33355, libc.VaList(bp+8, p+24)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33501, libc.VaList(bp+8, p+24)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { bOpen = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FnRbu = 0 (*Tsqlite3rbu)(unsafe.Pointer(p)).FpRbuFd = uintptr(0) - rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBUCNT), p) + rc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBUCNT), p) if rc != int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc } @@ -261651,10 +253073,10 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) return } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33421, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33567, 0) } else { zExtra = uintptr(0) - if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26155, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { + if libc.Xstrlen(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu) >= uint32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+26318, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, uint32(5)) { zExtra = (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu + 5 for *(*int8)(unsafe.Pointer(zExtra)) != 0 { v1 = zExtra @@ -261668,16 +253090,16 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if zExtra == uintptr(0) { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 33453 + v2 = __ccgo_ts + 33599 } if zExtra == uintptr(0) { - v3 = __ccgo_ts + 1673 + v3 = __ccgo_ts + 1674 } else { v3 = zExtra } - zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33455, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020), v2, v3)) + zTarget = Xsqlite3_mprintf(tls, __ccgo_ts+33601, libc.VaList(bp+8, Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107), v2, v3)) if zTarget == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) return @@ -261688,27 +253110,27 @@ func _rbuOpenDatabase(tls *libc.TLS, p uintptr, dbMain uintptr, pbRetry uintptr) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33487, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33633, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTmpInsertFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33502, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33648, int32(2), int32(SQLITE_UTF8), uintptr(0), __ccgo_fp(_rbuFossilDeltaFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33519, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+33665, -int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuTargetNameFunc), uintptr(0), uintptr(0)) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBU), p) } - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33535, 0) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33681, 0) /* Mark the database file just opened as an RBU target database. If ** this call returns SQLITE_NOTFOUND, then the RBU vfs is not in use. ** This is an error. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(SQLITE_FCNTL_RBU), p) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(SQLITE_FCNTL_RBU), p) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_NOTFOUND) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33563, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+33709, 0) } } @@ -261758,7 +253180,7 @@ func _rbuShmChecksum(tls *libc.TLS, p uintptr) (r Ti64) { iRet = 0 if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { iRet = int64(uint64(libc.AtomicLoadPUint32(*(*uintptr)(unsafe.Pointer(bp))+libc.UintptrFromInt32(10)*4))< (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPagePerSector = nSectorSize / (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz } else { @@ -261860,7 +253282,7 @@ func _rbuSetupCheckpoint(tls *libc.TLS, p uintptr, pState uintptr) { ** directory in which the target database and the wal file reside, in ** case it has not been synced since the rename() call in ** rbuMoveOalFile(). */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxSync})))(tls, pWal, int32(SQLITE_SYNC_NORMAL)) } } } @@ -261933,12 +253355,12 @@ func _rbuCheckpointFrame(tls *libc.TLS, p uintptr, pFrame uintptr) { pWal = (*Trbu_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd)).FpReal pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal iOff = int64((*TRbuFrame)(unsafe.Pointer(pFrame)).FiWalFrame-libc.Uint32FromInt32(1))*int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz+libc.Int32FromInt32(24)) + int64(32) + int64(24) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pWal)).FpMethods)).FxRead})))(tls, pWal, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != 0 { return } iOff = int64((*TRbuFrame)(unsafe.Pointer(pFrame)).FiDbPage-libc.Uint32FromInt32(1)) * int64((*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxWrite})))(tls, pDb, (*Tsqlite3rbu)(unsafe.Pointer(p)).FaBuf, (*Tsqlite3rbu)(unsafe.Pointer(p)).Fpgsz, iOff) } /* @@ -261960,21 +253382,21 @@ func _rbuLockDatabase(tls *libc.TLS, db uintptr) (r int32) { _ = rc rc = SQLITE_OK *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(SQLITE_FCNTL_FILE_POINTER), bp) - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(SQLITE_FCNTL_FILE_POINTER), bp) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxUnlock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), SQLITE_LOCK_NONE) } - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(RBU_ZIPVFS_CTRL_FILE_POINTER), bp) } else { - Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(SQLITE_FCNTL_FILE_POINTER), bp) + Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(SQLITE_FCNTL_FILE_POINTER), bp) } if rc == SQLITE_OK && (*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods != 0 { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_SHARED)) if rc == SQLITE_OK { - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FpMethods)).FxLock})))(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(SQLITE_LOCK_EXCLUSIVE)) } } return rc @@ -261991,7 +253413,7 @@ func _rbuExclusiveCheckpoint(tls *libc.TLS, db uintptr) (r int32) { var zUri uintptr _ = zUri zUri = Xsqlite3_db_filename(tls, db, uintptr(0)) - return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+33616, 0) + return Xsqlite3_uri_boolean(tls, zUri, __ccgo_ts+33762, 0) } // C documentation @@ -262008,13 +253430,13 @@ func _rbuMoveOalFile(tls *libc.TLS, p uintptr) { defer tls.Free(16) var dbMain, zBase, zMove, zOal, zWal uintptr _, _, _, _, _ = dbMain, zBase, zMove, zOal, zWal - zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020) + zBase = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107) zMove = zBase if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8020) + zMove = Xsqlite3_db_filename(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+8107) } - zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33641, libc.VaList(bp+8, zMove)) - zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33648, libc.VaList(bp+8, zMove)) + zOal = Xsqlite3_mprintf(tls, __ccgo_ts+33787, libc.VaList(bp+8, zMove)) + zWal = Xsqlite3_mprintf(tls, __ccgo_ts+33794, libc.VaList(bp+8, zMove)) if zWal == uintptr(0) || zOal == uintptr(0) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) } else { @@ -262146,7 +253568,7 @@ func _rbuStepOneOp(tls *libc.TLS, p uintptr, eType int32) { ** to write a NULL into the IPK column. That is not permitted. */ if eType == int32(RBU_INSERT) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzIdx == uintptr(0) && (*TRbuObjIter)(unsafe.Pointer(pIter)).FeType == int32(RBU_PK_IPK) && *(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i))) != 0 && Xsqlite3_column_type(tls, (*TRbuObjIter)(unsafe.Pointer(pIter)).FpSelect, i) == int32(SQLITE_NULL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_MISMATCH) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+25712, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+25875, 0) return } if eType == int32(RBU_DELETE) && int32(*(*Tu8)(unsafe.Pointer((*TRbuObjIter)(unsafe.Pointer(pIter)).FabTblPk + uintptr(i)))) == 0 { @@ -262282,7 +253704,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { } dbread = v1 iCookie = int32(1000000) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+33655) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, dbread, bp, p+36, __ccgo_ts+33801) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Coverage: it may be that this sqlite3_step() cannot fail. There ** is already a transaction open, so the prepared statement cannot @@ -262295,7 +253717,7 @@ func _rbuIncrSchemaCookie(tls *libc.TLS, p uintptr) { _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33677, libc.VaList(bp+16, iCookie+int32(1))) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33823, libc.VaList(bp+16, iCookie+int32(1))) } } } @@ -262322,7 +253744,7 @@ func _rbuSaveState(tls *libc.TLS, p uintptr, eStage int32) { v1 = (*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd } pFd = v1 - rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+33704, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), int64((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) + rc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+33850, libc.VaList(bp+16, p+24, int32(RBU_STATE_STAGE), eStage, int32(RBU_STATE_TBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzTbl, int32(RBU_STATE_IDX), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzIdx, int32(RBU_STATE_ROW), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep, int32(RBU_STATE_PROGRESS), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress, int32(RBU_STATE_CKPT), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiWalCksum, int32(RBU_STATE_COOKIE), int64((*Trbu_file)(unsafe.Pointer(pFd)).FiCookie), int32(RBU_STATE_OALSZ), (*Tsqlite3rbu)(unsafe.Pointer(p)).FiOalSz, int32(RBU_STATE_PHASEONESTEP), (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep, int32(RBU_STATE_DATATBL), (*Tsqlite3rbu)(unsafe.Pointer(p)).Fobjiter.FzDataTbl))) if rc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) @@ -262358,9 +253780,9 @@ func _rbuCopyPragma(tls *libc.TLS, p uintptr, zPragma uintptr) { var _ /* pPragma at bp+0 */ uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+33864, libc.VaList(bp+16, zPragma))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareFreeAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, Xsqlite3_mprintf(tls, __ccgo_ts+34010, libc.VaList(bp+16, zPragma))) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33879, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34025, libc.VaList(bp+16, zPragma, Xsqlite3_column_int(tls, *(*uintptr)(unsafe.Pointer(bp)), 0))) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) } @@ -262383,9 +253805,9 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { _, _ = i, zSql *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+33899, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34045, uintptr(0), uintptr(0), p+36) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+33924) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34070) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { zSql = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -262396,10 +253818,10 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { return } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34032) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34178) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+34097) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, bp+4, p+36, __ccgo_ts+34243) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) == int32(SQLITE_ROW) { i = 0 @@ -262417,7 +253839,7 @@ func _rbuCreateTargetSchema(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34141, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34287, uintptr(0), uintptr(0), p+36) } _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp))) _rbuFinalize(tls, p, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -262444,8 +253866,8 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** when this handle was opened, create the target database schema. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).FnProgress == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { _rbuCreateTargetSchema(tls, p) - _rbuCopyPragma(tls, p, __ccgo_ts+19155) - _rbuCopyPragma(tls, p, __ccgo_ts+18245) + _rbuCopyPragma(tls, p, __ccgo_ts+19318) + _rbuCopyPragma(tls, p, __ccgo_ts+18408) } for (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0 { if (*TRbuObjIter)(unsafe.Pointer(pIter)).FbCleanup != 0 { @@ -262453,7 +253875,7 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { ** cannot be dropped as there are currently active SQL statements. ** But the contents can be deleted. */ if libc.BoolInt32((*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0)) == 0 && (*TRbuObjIter)(unsafe.Pointer(pIter)).FabIndexed != 0 { - _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34166, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) + _rbuMPrintfExec(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34312, libc.VaList(bp+16, p+24, (*TRbuObjIter)(unsafe.Pointer(pIter)).FzDataTbl)) } } else { _rbuObjIterPrepareAll(tls, p, pIter, 0) @@ -262475,10 +253897,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { _rbuSaveState(tls, p, int32(RBU_STAGE_MOVE)) _rbuIncrSchemaCookie(tls, p) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16363, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16479, uintptr(0), uintptr(0), p+36) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16363, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16479, uintptr(0), uintptr(0), p+36) } (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_MOVE) } @@ -262492,10 +253914,10 @@ func Xsqlite3rbu_step(tls *libc.TLS, p uintptr) (r int32) { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep >= (*Tsqlite3rbu)(unsafe.Pointer(p)).FnFrame { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal /* Sync the db file */ - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) /* Update nBackfill */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32, int32, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxShmMap})))(tls, pDb, 0, libc.Int32FromInt32(32)*libc.Int32FromInt32(1024), 0, bp) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { *(*Tu32)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)) + 24*4)) = (*Tsqlite3rbu)(unsafe.Pointer(p)).FiMaxFrame } @@ -262565,7 +253987,7 @@ func _rbuSetupOal(tls *libc.TLS, p uintptr, pState uintptr) { } if rc == SQLITE_OK && !((*TRbuObjIter)(unsafe.Pointer(pIter)).FzTbl != 0) { rc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34194, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34340, 0) } if rc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnStep = (*TRbuState)(unsafe.Pointer(pState)).FnRow @@ -262588,10 +254010,10 @@ func _rbuDeleteOalFile(tls *libc.TLS, p uintptr) { var zOal uintptr var _ /* pVfs at bp+0 */ uintptr _ = zOal - zOal = _rbuMPrintf(tls, p, __ccgo_ts+33641, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) + zOal = _rbuMPrintf(tls, p, __ccgo_ts+33787, libc.VaList(bp+16, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget)) if zOal != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8020, int32(SQLITE_FCNTL_VFS_POINTER), bp) + Xsqlite3_file_control(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+8107, int32(SQLITE_FCNTL_VFS_POINTER), bp) (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_vfs)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FxDelete})))(tls, *(*uintptr)(unsafe.Pointer(bp)), zOal, 0) Xsqlite3_free(tls, zOal) } @@ -262613,7 +254035,7 @@ func _rbuCreateVfs(tls *libc.TLS, p uintptr) { var _ /* zRnd at bp+4 */ [64]int8 _ = pVfs Xsqlite3_randomness(tls, int32(4), bp) - Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+34219, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) + Xsqlite3_snprintf(tls, int32(64), bp+4, __ccgo_ts+34365, libc.VaList(bp+80, *(*int32)(unsafe.Pointer(bp)))) (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3rbu_create_vfs(tls, bp+4, uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { pVfs = Xsqlite3_vfs_find(tls, bp+4) @@ -262660,7 +254082,7 @@ func _rbuIndexCntFunc(tls *libc.TLS, pCtx uintptr, nVal int32, apVal uintptr) { } db = v1 _ = nVal - rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+34230, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) + rc = _prepareFreeAndCollectError(tls, db, bp, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+34376, libc.VaList(bp+16, Xsqlite3_value_text(tls, *(*uintptr)(unsafe.Pointer(apVal)))))) if rc != SQLITE_OK { Xsqlite3_result_error(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 4)), -int32(1)) } else { @@ -262705,11 +254127,11 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) bExists = 0 /* True if rbu_count exists */ (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = int64(-int32(1)) - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34302, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_create_function(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34448, int32(1), int32(SQLITE_UTF8), p, __ccgo_fp(_rbuIndexCntFunc), uintptr(0), uintptr(0)) /* Check for the rbu_count table. If it does not exist, or if an error ** occurs, nPhaseOneStep will be left set to -1. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34316) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34462) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { @@ -262718,7 +254140,7 @@ func _rbuInitPhaseOneSteps(tls *libc.TLS, p uintptr) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && bExists != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34373) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _prepareAndCollectError(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, bp, p+36, __ccgo_ts+34519) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FnPhaseOneStep = Xsqlite3_column_int64(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) @@ -262766,7 +254188,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr libc.Xmemcpy(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzRbu, zRbu, nRbu+uint32(1)) pCsr += uintptr(nRbu + uint32(1)) if zState != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+4710, libc.VaList(bp+16, zState)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzState = _rbuMPrintf(tls, p, __ccgo_ts+4829, libc.VaList(bp+16, zState)) } /* If the first attempt to open the database file fails and the bRetry ** flag it set, this means that the db was not opened because it seemed @@ -262798,7 +254220,7 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpWalFd != 0 { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_ERROR) - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34447, 0) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34593, 0) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_MOVE) { (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_CKPT) @@ -262820,17 +254242,17 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr ** page 1 of the database file. */ (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = int32(SQLITE_BUSY) if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v3 = __ccgo_ts + 34479 + v3 = __ccgo_ts + 34625 } else { - v3 = __ccgo_ts + 34486 + v3 = __ccgo_ts + 34632 } - (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34493, libc.VaList(bp+16, v3)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg = Xsqlite3_mprintf(tls, __ccgo_ts+34639, libc.VaList(bp+16, v3)) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { db = (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16348, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16464, uintptr(0), uintptr(0), p+36) /* Point the object iterator at the first object */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = _rbuObjIterFirst(tls, p, p+56) @@ -262842,21 +254264,21 @@ func _openRbuHandle(tls *libc.TLS, zTarget uintptr, zRbu uintptr, zState uintptr (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage = int32(RBU_STAGE_DONE) } else { if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*TRbuState)(unsafe.Pointer(pState)).FeStage == 0 && (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - _rbuCopyPragma(tls, p, __ccgo_ts+18869) - _rbuCopyPragma(tls, p, __ccgo_ts+18260) + _rbuCopyPragma(tls, p, __ccgo_ts+19032) + _rbuCopyPragma(tls, p, __ccgo_ts+18423) } /* Open transactions both databases. The *-oal file is opened or ** created at this point. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34525, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34671, uintptr(0), uintptr(0), p+36) } /* Check if the main database is a zipvfs db. If it is, set the upper ** level pager to use "journal_mode=off". This prevents it from ** generating a large journal using a temp file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { - frc = Xsqlite3_file_control(tls, db, __ccgo_ts+8020, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) + frc = Xsqlite3_file_control(tls, db, __ccgo_ts+8107, int32(SQLITE_FCNTL_ZIPVFS), uintptr(0)) if frc == SQLITE_OK { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34541, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, db, __ccgo_ts+34687, uintptr(0), uintptr(0), p+36) } } if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK { @@ -262934,7 +254356,7 @@ func Xsqlite3rbu_vacuum(tls *libc.TLS, zTarget uintptr, zState uintptr) (r uintp } if zState != 0 { n = libc.Xstrlen(tls, zState) - if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+34565, zState+uintptr(n-uint32(7)), uint32(7)) { + if n >= uint32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+34711, zState+uintptr(n-uint32(7)), uint32(7)) { return _rbuMisuseError(tls) } } @@ -262981,7 +254403,7 @@ func _rbuEditErrmsg(tls *libc.TLS, p uintptr) { if !(i < nErrmsg-uint32(8)) { break } - if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+32588, uint32(8)) == 0 { + if libc.Xmemcmp(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg+uintptr(i), __ccgo_ts+32734, uint32(8)) == 0 { nDel = int32(8) for int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) >= int32('0') && int32(*(*int8)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FzErrmsg + uintptr(i+uint32(nDel))))) <= int32('9') { nDel++ @@ -263009,16 +254431,16 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { if p != 0 { /* Commit the transaction to the *-oal file. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16363, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16479, uintptr(0), uintptr(0), p+36) } /* Sync the db file if currently doing an incremental checkpoint */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { - (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16363, uintptr(0), uintptr(0), p+36) + (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16479, uintptr(0), uintptr(0), p+36) } /* Close any open statement handles. */ _rbuObjIterFinalize(tls, p+56) @@ -263028,7 +254450,7 @@ func Xsqlite3rbu_close(tls *libc.TLS, p uintptr, pzErrmsg uintptr) (r int32) { ** specifying the current target and state databases to start a new ** vacuum from scratch. */ if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) && (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc != SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu != 0 { - rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34573, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+34719, uintptr(0), uintptr(0), uintptr(0)) if (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc == int32(SQLITE_DONE) && rc2 != SQLITE_OK { (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc2 } @@ -263129,32 +254551,32 @@ func Xsqlite3rbu_savestate(tls *libc.TLS, p uintptr) (r int32) { } if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16363, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+16479, uintptr(0), uintptr(0), uintptr(0)) } } /* Sync the db file */ if rc == SQLITE_OK && (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_CKPT) { pDb = (*Trbu_file)(unsafe.Pointer((*Tsqlite3rbu)(unsafe.Pointer(p)).FpTargetFd)).FpReal - rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) + rc = (*(*func(*libc.TLS, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer(pDb)).FpMethods)).FxSync})))(tls, pDb, int32(SQLITE_SYNC_NORMAL)) } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc _rbuSaveState(tls, p, (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage) rc = (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc if (*Tsqlite3rbu)(unsafe.Pointer(p)).FeStage == int32(RBU_STAGE_OAL) { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16363, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, __ccgo_ts+16479, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { if (*Tsqlite3rbu)(unsafe.Pointer(p)).FzTarget == uintptr(0) { - v1 = __ccgo_ts + 16348 + v1 = __ccgo_ts + 16464 } else { - v1 = __ccgo_ts + 34525 + v1 = __ccgo_ts + 34671 } zBegin = v1 rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbRbu, zBegin, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34525, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, (*Tsqlite3rbu)(unsafe.Pointer(p)).FdbMain, __ccgo_ts+34671, uintptr(0), uintptr(0), uintptr(0)) } } (*Tsqlite3rbu)(unsafe.Pointer(p)).Frc = rc @@ -263180,9 +254602,11 @@ func _xDefaultRename(tls *libc.TLS, pArg uintptr, zOld uintptr, zNew uintptr) (r return rc } -func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, xRename uintptr) { - if xRename != 0 { - (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = xRename +type t__ccgo_fp__Xsqlite3rbu_rename_handler_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3rbu_rename_handler(tls *libc.TLS, pRbu uintptr, pArg uintptr, __ccgo_fp_xRename uintptr) { + if __ccgo_fp_xRename != 0 { + (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp_xRename (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FpRenameArg = pArg } else { (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FxRename = __ccgo_fp(_xDefaultRename) @@ -263254,7 +254678,7 @@ func _rbuUnlockShm(tls *libc.TLS, p uintptr) { var xShmLock uintptr _, _ = i, xShmLock if (*Trbu_file)(unsafe.Pointer(p)).FpRbu != 0 { - xShmLock = (*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock + xShmLock = (*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxShmLock i = 0 for { if !(i < int32(SQLITE_SHM_NLOCK)) { @@ -263457,7 +254881,7 @@ func _rbuVfsClose(tls *libc.TLS, pFile uintptr) (r int32) { } } /* Close the underlying file handle */ - rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) + rc = (*(*func(*libc.TLS, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxClose})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal) return rc } @@ -263508,14 +254932,14 @@ func _rbuVfsRead(tls *libc.TLS, pFile uintptr, zBuf uintptr, iAmt int32, iOfst T rc = SQLITE_OK libc.Xmemset(tls, zBuf, 0, uint32(iAmt)) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods1)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, Tsqlite3_int64) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tsqlite3_io_methods)(unsafe.Pointer((*Tsqlite3_file)(unsafe.Pointer((*Trbu_file)(unsafe.Pointer(p)).FpReal)).FpMethods)).FxRead})))(tls, (*Trbu_file)(unsafe.Pointer(p)).FpReal, zBuf, iAmt, iOfst) /* If this is being called to read the first page of the target ** database as part of an rbu vacuum operation, synthesize the ** contents of the first page if it does not yet exist. Otherwise, ** SQLite will not check for a *-wal file. */ if pRbu != 0 && (*Tsqlite3rbu)(unsafe.Pointer(pRbu)).FzTarget == uintptr(0) && rc == libc.Int32FromInt32(SQLITE_IOERR)|libc.Int32FromInt32(2)<= int32(libc.Uint32FromInt64(1280)/libc.Uint32FromInt64(40)) { _statResetCsr(tls, pCsr) - return _sqlite3CorruptError(tls, int32(226027)) + return _sqlite3CorruptError(tls, int32(227381)) } if (*TStatPage)(unsafe.Pointer(p)).FiCell == (*TStatPage)(unsafe.Pointer(p)).FnCell { (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiPgno = (*TStatPage)(unsafe.Pointer(p)).FiRightChildPg @@ -265093,7 +256455,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnPage++ (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FiCell = 0 if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v4 = Xsqlite3_mprintf(tls, __ccgo_ts+34668, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) + v4 = Xsqlite3_mprintf(tls, __ccgo_ts+34814, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p)).FzPath, (*TStatPage)(unsafe.Pointer(p)).FiCell)) z = v4 (*(*TStatPage)(unsafe.Pointer(p + 1*40))).FzPath = v4 if z == uintptr(0) { @@ -265116,13 +256478,13 @@ statNextRestart: case int32(0x05): /* table internal */ fallthrough case int32(0x02): /* index internal */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34676 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34822 case int32(0x0D): /* table leaf */ fallthrough case int32(0x0A): /* index leaf */ - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34685 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34831 default: - (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34690 + (*TStatCursor)(unsafe.Pointer(pCsr)).FzPagetype = __ccgo_ts + 34836 break } *(*int32)(unsafe.Pointer(pCsr + 1320)) += (*TStatPage)(unsafe.Pointer(p1)).FnCell @@ -265131,7 +256493,7 @@ statNextRestart: (*TStatCursor)(unsafe.Pointer(pCsr)).FnMxPayload = (*TStatPage)(unsafe.Pointer(p1)).FnMxPayload } if !((*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg != 0) { - v5 = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) + v5 = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, (*TStatPage)(unsafe.Pointer(p1)).FzPath)) z = v5 (*TStatCursor)(unsafe.Pointer(pCsr)).FzPath = v5 if z == uintptr(0) { @@ -265220,12 +256582,12 @@ func _statFilter(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uintptr, a (*TStatCursor)(unsafe.Pointer(pCsr)).FisAgg = uint8(0) } pSql = Xsqlite3_str_new(tls, (*TStatTable)(unsafe.Pointer(pTab)).Fdb) - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34700, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34846, libc.VaList(bp+8, (*(*TDb)(unsafe.Pointer((*Tsqlite3)(unsafe.Pointer((*TStatTable)(unsafe.Pointer(pTab)).Fdb)).FaDb + uintptr((*TStatCursor)(unsafe.Pointer(pCsr)).FiDb)*16))).FzDbSName)) if zName != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34855, libc.VaList(bp+8, zName)) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+35001, libc.VaList(bp+8, zName)) } if idxNum&int32(0x08) != 0 { - Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+34869, 0) + Xsqlite3_str_appendf(tls, pSql, __ccgo_ts+35015, 0) } zSql = Xsqlite3_str_finish(tls, pSql) if zSql == uintptr(0) { @@ -265302,7 +256664,7 @@ func _statRowid(tls *libc.TLS, pCursor uintptr, pRowid uintptr) (r int32) { // ** Invoke this routine to register the "dbstat" virtual table module // */ func _sqlite3DbstatRegister(tls *libc.TLS, db uintptr) (r int32) { - return Xsqlite3_create_module(tls, db, __ccgo_ts+34884, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) + return Xsqlite3_create_module(tls, db, __ccgo_ts+35030, uintptr(unsafe.Pointer(&_dbstat_module)), uintptr(0)) } var _dbstat_module = Tsqlite3_module{} @@ -265442,316 +256804,6 @@ type TSessionHook = struct { type SessionHook = TSessionHook -type TSessionHook1 = struct { - FpCtx uintptr - FxOld uintptr - FxNew uintptr - FxCount uintptr - FxDepth uintptr -} - -type SessionHook1 = TSessionHook1 - -/* -** Session handle structure. - */ -type Tsqlite3_session1 = struct { - F__ccgo_align [0]uint32 - Fdb uintptr - FzDb uintptr - FbEnableSize int32 - FbEnable int32 - FbIndirect int32 - FbAutoAttach int32 - FbImplicitPK int32 - Frc int32 - FpFilterCtx uintptr - FxTableFilter uintptr - FnMalloc Ti64 - FnMaxChangesetSize Ti64 - FpZeroBlob uintptr - FpNext uintptr - FpTable uintptr - Fhook TSessionHook -} - -type sqlite3_session1 = Tsqlite3_session1 - -/* -** Instances of this structure are used to build strings or binary records. - */ -type TSessionBuffer1 = struct { - FaBuf uintptr - FnBuf int32 - FnAlloc int32 -} - -type SessionBuffer1 = TSessionBuffer1 - -/* -** An object of this type is used internally as an abstraction for -** input data. Input data may be supplied either as a single large buffer -** (e.g. sqlite3changeset_start()) or using a stream function (e.g. -** sqlite3changeset_start_strm()). -** -** bNoDiscard: -** If true, then the only time data is discarded is as a result of explicit -** sessionDiscardData() calls. Not within every sessionInputBuffer() call. - */ -type TSessionInput1 = struct { - FbNoDiscard int32 - FiCurrent int32 - FiNext int32 - FaData uintptr - FnData int32 - Fbuf TSessionBuffer - FxInput uintptr - FpIn uintptr - FbEof int32 -} - -type SessionInput1 = TSessionInput1 - -/* -** Structure for changeset iterators. - */ -type Tsqlite3_changeset_iter1 = struct { - Fin TSessionInput - Ftblhdr TSessionBuffer - FbPatchset int32 - FbInvert int32 - FbSkipEmpty int32 - Frc int32 - FpConflict uintptr - FzTab uintptr - FnCol int32 - Fop int32 - FbIndirect int32 - FabPK uintptr - FapValue uintptr -} - -type sqlite3_changeset_iter1 = Tsqlite3_changeset_iter1 - -/* -** Each session object maintains a set of the following structures, one -** for each table the session object is monitoring. The structures are -** stored in a linked list starting at sqlite3_session.pTable. -** -** The keys of the SessionTable.aChange[] hash table are all rows that have -** been modified in any way since the session object was attached to the -** table. -** -** The data associated with each hash-table entry is a structure containing -** a subset of the initial values that the modified row contained at the -** start of the session. Or no initial values if the row was inserted. -** -** pDfltStmt: -** This is only used by the sqlite3changegroup_xxx() APIs, not by -** regular sqlite3_session objects. It is a SELECT statement that -** selects the default value for each table column. For example, -** if the table is -** -** CREATE TABLE xx(a DEFAULT 1, b, c DEFAULT 'abc') -** -** then this variable is the compiled version of: -** -** SELECT 1, NULL, 'abc' - */ -type TSessionTable1 = struct { - FpNext uintptr - FzName uintptr - FnCol int32 - FnTotalCol int32 - FbStat1 int32 - FbRowid int32 - FazCol uintptr - FazDflt uintptr - FaiIdx uintptr - FabPK uintptr - FnEntry int32 - FnChange int32 - FapChange uintptr - FpDfltStmt uintptr -} - -type SessionTable1 = TSessionTable1 - -/* -** RECORD FORMAT: -** -** The following record format is similar to (but not compatible with) that -** used in SQLite database files. This format is used as part of the -** change-set binary format, and so must be architecture independent. -** -** Unlike the SQLite database record format, each field is self-contained - -** there is no separation of header and data. Each field begins with a -** single byte describing its type, as follows: -** -** 0x00: Undefined value. -** 0x01: Integer value. -** 0x02: Real value. -** 0x03: Text value. -** 0x04: Blob value. -** 0x05: SQL NULL value. -** -** Note that the above match the definitions of SQLITE_INTEGER, SQLITE_TEXT -** and so on in sqlite3.h. For undefined and NULL values, the field consists -** only of the single type byte. For other types of values, the type byte -** is followed by: -** -** Text values: -** A varint containing the number of bytes in the value (encoded using -** UTF-8). Followed by a buffer containing the UTF-8 representation -** of the text value. There is no nul terminator. -** -** Blob values: -** A varint containing the number of bytes in the value, followed by -** a buffer containing the value itself. -** -** Integer values: -** An 8-byte big-endian integer value. -** -** Real values: -** An 8-byte big-endian IEEE 754-2008 real value. -** -** Varint values are encoded in the same way as varints in the SQLite -** record format. -** -** CHANGESET FORMAT: -** -** A changeset is a collection of DELETE, UPDATE and INSERT operations on -** one or more tables. Operations on a single table are grouped together, -** but may occur in any order (i.e. deletes, updates and inserts are all -** mixed together). -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** old.* record: (delete and update only) -** new.* record: (insert and update only) -** -** The "old.*" and "new.*" records, if present, are N field records in the -** format described above under "RECORD FORMAT", where N is the number of -** columns in the table. The i'th field of each record is associated with -** the i'th column of the table, counting from left to right in the order -** in which columns were declared in the CREATE TABLE statement. -** -** The new.* record that is part of each INSERT change contains the values -** that make up the new row. Similarly, the old.* record that is part of each -** DELETE change contains the values that made up the row that was deleted -** from the database. In the changeset format, the records that are part -** of INSERT or DELETE changes never contain any undefined (type byte 0x00) -** fields. -** -** Within the old.* record associated with an UPDATE change, all fields -** associated with table columns that are not PRIMARY KEY columns and are -** not modified by the UPDATE change are set to "undefined". Other fields -** are set to the values that made up the row before the UPDATE that the -** change records took place. Within the new.* record, fields associated -** with table columns modified by the UPDATE change contain the new -** values. Fields associated with table columns that are not modified -** are set to "undefined". -** -** PATCHSET FORMAT: -** -** A patchset is also a collection of changes. It is similar to a changeset, -** but leaves undefined those fields that are not useful if no conflict -** resolution is required when applying the changeset. -** -** Each group of changes begins with a table header: -** -** 1 byte: Constant 0x50 (capital 'P') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more changes to the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), UPDATE (0x17) or DELETE (0x09). -** 1 byte: The "indirect-change" flag. -** single record: (PK fields for DELETE, PK and modified fields for UPDATE, -** full record for INSERT). -** -** As in the changeset format, each field of the single record that is part -** of a patchset change is associated with the correspondingly positioned -** table column, counting from left to right within the CREATE TABLE -** statement. -** -** For a DELETE change, all fields within the record except those associated -** with PRIMARY KEY columns are omitted. The PRIMARY KEY fields contain the -** values identifying the row to delete. -** -** For an UPDATE change, all fields except those associated with PRIMARY KEY -** columns and columns that are modified by the UPDATE are set to "undefined". -** PRIMARY KEY fields contain the values identifying the table row to update, -** and fields associated with modified columns contain the new column values. -** -** The records associated with INSERT changes are in the same format as for -** changesets. It is not possible for a record associated with an INSERT -** change to contain a field set to "undefined". -** -** REBASE BLOB FORMAT: -** -** A rebase blob may be output by sqlite3changeset_apply_v2() and its -** streaming equivalent for use with the sqlite3_rebaser APIs to rebase -** existing changesets. A rebase blob contains one entry for each conflict -** resolved using either the OMIT or REPLACE strategies within the apply_v2() -** call. -** -** The format used for a rebase blob is very similar to that used for -** changesets. All entries related to a single table are grouped together. -** -** Each group of entries begins with a table header in changeset format: -** -** 1 byte: Constant 0x54 (capital 'T') -** Varint: Number of columns in the table. -** nCol bytes: 0x01 for PK columns, 0x00 otherwise. -** N bytes: Unqualified table name (encoded using UTF-8). Nul-terminated. -** -** Followed by one or more entries associated with the table. -** -** 1 byte: Either SQLITE_INSERT (0x12), DELETE (0x09). -** 1 byte: Flag. 0x01 for REPLACE, 0x00 for OMIT. -** record: (in the record format defined above). -** -** In a rebase blob, the first field is set to SQLITE_INSERT if the change -** that caused the conflict was an INSERT or UPDATE, or to SQLITE_DELETE if -** it was a DELETE. The second field is set to 0x01 if the conflict -** resolution strategy was REPLACE, or 0x00 if it was OMIT. -** -** If the change that caused the conflict was a DELETE, then the single -** record is a copy of the old.* record from the original changeset. If it -** was an INSERT, then the single record is a copy of the new.* record. If -** the conflicting change was an UPDATE, then the single record is a copy -** of the new.* record with the PK fields filled in based on the original -** old.* record. - */ - -/* -** For each row modified during a session, there exists a single instance of -** this structure stored in a SessionTable.aChange[] hash table. - */ -type TSessionChange1 = struct { - Fop Tu8 - FbIndirect Tu8 - FnRecordField Tu16 - FnMaxSize int32 - FnRecord int32 - FaRecord uintptr - FpNext uintptr -} - -type SessionChange1 = TSessionChange1 - // C documentation // // /* @@ -266597,20 +257649,20 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, *(*uintptr)(unsafe.Pointer(pazDflt)) = uintptr(0) } nThis = _sqlite3Strlen30(tls, zThis) - if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13078, zThis) { + if nThis == int32(12) && 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13194, zThis) { rc = Xsqlite3_table_column_metadata(tls, db, zDb, zThis, uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { /* For sqlite_stat1, pretend that (tbl,idx) is the PRIMARY KEY. */ - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+34891, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35037, 0) } else { if rc == int32(SQLITE_ERROR) { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1673, 0) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+1674, 0) } else { return rc } } } else { - zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35021, libc.VaList(bp+16, zDb, zThis)) + zPragma = Xsqlite3_mprintf(tls, __ccgo_ts+35167, libc.VaList(bp+16, zDb, zThis)) } if !(zPragma != 0) { return int32(SQLITE_NOMEM) @@ -266636,7 +257688,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, bRowid = 0 } nDbCol += bRowid - nByte += int64(libc.Xstrlen(tls, __ccgo_ts+31231)) + nByte += int64(libc.Xstrlen(tls, __ccgo_ts+31377)) rc = Xsqlite3_reset(tls, *(*uintptr)(unsafe.Pointer(bp))) if rc == SQLITE_OK { nByte += int64(uint32(nDbCol) * (libc.Uint32FromInt64(4)*libc.Uint32FromInt32(2) + libc.Uint32FromInt64(4) + libc.Uint32FromInt64(1) + libc.Uint32FromInt32(1) + libc.Uint32FromInt32(1))) @@ -266660,8 +257712,8 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, } i = 0 if bRowid != 0 { - nName = libc.Xstrlen(tls, __ccgo_ts+31231) - libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31231, nName+uint32(1)) + nName = libc.Xstrlen(tls, __ccgo_ts+31377) + libc.Xmemcpy(tls, pAlloc, __ccgo_ts+31377, nName+uint32(1)) *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)) = pAlloc pAlloc += uintptr(nName + uint32(1)) *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) = uint8(1) @@ -266725,7 +257777,7 @@ func _sessionTableInfo(tls *libc.TLS, pSession uintptr, db uintptr, zDb uintptr, // /* // ** This function is called to initialize the SessionTable.nCol, azCol[] // ** abPK[] and azDflt[] members of SessionTable object pTab. If these -// ** fields are already initilialized, this function is a no-op. +// ** fields are already initialized, this function is a no-op. // ** // ** If an error occurs, an error code is stored in sqlite3_session.rc and // ** non-zero returned. Or, if no error occurs but the table has no primary @@ -266742,6 +257794,8 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr _, _, _ = i, rc, v1 rc = SQLITE_OK if (*TSessionTable)(unsafe.Pointer(pTab)).FnCol == 0 { + Xsqlite3_free(tls, (*TSessionTable)(unsafe.Pointer(pTab)).FazCol) + (*TSessionTable)(unsafe.Pointer(pTab)).FabPK = uintptr(0) if pSession == uintptr(0) || (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { v1 = pTab + 20 } else { @@ -266763,7 +257817,7 @@ func _sessionInitTable(tls *libc.TLS, pSession uintptr, pTab uintptr, db uintptr ; i++ } - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13078, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13194, (*TSessionTable)(unsafe.Pointer(pTab)).FzName) { (*TSessionTable)(unsafe.Pointer(pTab)).FbStat1 = int32(1) } if pSession != 0 && (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbEnableSize != 0 { @@ -267057,10 +258111,10 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin _, _, _, _ = ii, zDflt, zSep, v2 *(*TSessionBuffer)(unsafe.Pointer(bp)) = TSessionBuffer{} *(*int32)(unsafe.Pointer(bp + 12)) = SQLITE_OK - zSep = __ccgo_ts + 12698 + zSep = __ccgo_ts + 12814 ii = 0 *(*uintptr)(unsafe.Pointer(ppStmt)) = uintptr(0) - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+35051, 0) + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+35197, 0) ii = 0 for { if !(ii < (*TSessionTable)(unsafe.Pointer(pTab)).FnCol) { @@ -267069,11 +258123,11 @@ func _sessionPrepareDfltStmt(tls *libc.TLS, db uintptr, pTab uintptr, ppStmt uin if *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*4)) != 0 { v2 = *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazDflt + uintptr(ii)*4)) } else { - v2 = __ccgo_ts + 1674 + v2 = __ccgo_ts + 1675 } zDflt = v2 - _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+6450, libc.VaList(bp+24, zSep, zDflt)) - zSep = __ccgo_ts + 16459 + _sessionAppendPrintf(tls, bp, bp+12, __ccgo_ts+6538, libc.VaList(bp+24, zSep, zDflt)) + zSep = __ccgo_ts + 16575 goto _1 _1: ; @@ -267154,13 +258208,6 @@ type TSessionStat1Ctx = struct { type SessionStat1Ctx = TSessionStat1Ctx -type TSessionStat1Ctx1 = struct { - Fhook TSessionHook - FpSession uintptr -} - -type SessionStat1Ctx1 = TSessionStat1Ctx1 - func _sessionStat1Old(tls *libc.TLS, pCtx uintptr, iCol int32, ppVal uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -267392,7 +258439,7 @@ func _sessionPreupdateOneChange(tls *libc.TLS, op int32, iRowid Ti64, pSession u rc = int32(SQLITE_NOMEM) goto error_out } - _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1673, uint8(0), libc.UintptrFromInt32(0)) + _sqlite3ValueSetStr(tls, p, 0, __ccgo_ts+1674, uint8(0), libc.UintptrFromInt32(0)) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpZeroBlob = p } } @@ -267652,14 +258699,6 @@ type TSessionDiffCtx = struct { type SessionDiffCtx = TSessionDiffCtx -type TSessionDiffCtx1 = struct { - FpStmt uintptr - FbRowid int32 - FnOldOff int32 -} - -type SessionDiffCtx1 = TSessionDiffCtx1 - // C documentation // // /* @@ -267719,7 +258758,7 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr var i int32 var zRet, zSep uintptr _, _, _ = i, zRet, zSep - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 zRet = uintptr(0) i = 0 for { @@ -267727,8 +258766,8 @@ func _sessionExprComparePK(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uintptr break } if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35058, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 23556 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35204, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zSep = __ccgo_ts + 23719 if zRet == uintptr(0) { break } @@ -267747,7 +258786,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint var bHave, i int32 var zRet, zSep uintptr _, _, _, _ = bHave, i, zRet, zSep - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 zRet = uintptr(0) bHave = 0 i = 0 @@ -267757,8 +258796,8 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint } if int32(*(*Tu8)(unsafe.Pointer(abPK + uintptr(i)))) == 0 { bHave = int32(1) - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35092, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) - zSep = __ccgo_ts + 35133 + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35238, libc.VaList(bp+8, zRet, zSep, zDb1, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), zDb2, zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + zSep = __ccgo_ts + 35279 if zRet == uintptr(0) { break } @@ -267769,7 +258808,7 @@ func _sessionExprCompareOther(tls *libc.TLS, nCol int32, zDb1 uintptr, zDb2 uint i++ } if bHave == 0 { - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1793, 0) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+1820, 0) } return zRet } @@ -267780,12 +258819,12 @@ func _sessionSelectFindNew(tls *libc.TLS, zDb1 uintptr, zDb2 uintptr, bRowid int var zRet, zSel, v1 uintptr _, _, _ = zRet, zSel, v1 if bRowid != 0 { - v1 = __ccgo_ts + 35138 + v1 = __ccgo_ts + 35284 } else { - v1 = __ccgo_ts + 8025 + v1 = __ccgo_ts + 8112 } zSel = v1 - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35149, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35295, libc.VaList(bp+8, zSel, zDb1, zTbl, zDb2, zTbl, zExpr)) return zRet } @@ -267846,11 +258885,11 @@ func _sessionAllCols(tls *libc.TLS, zDb uintptr, pTab uintptr) (r uintptr) { break } if zRet != 0 { - v2 = __ccgo_ts + 16459 + v2 = __ccgo_ts + 16575 } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35228, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) + zRet = Xsqlite3_mprintf(tls, __ccgo_ts+35374, libc.VaList(bp+8, zRet, v2, zDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, *(*uintptr)(unsafe.Pointer((*TSessionTable)(unsafe.Pointer(pTab)).FazCol + uintptr(ii)*4)))) if !(zRet != 0) { break } @@ -267878,7 +258917,7 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } else { z1 = _sessionAllCols(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, pTab) z2 = _sessionAllCols(tls, zFrom, pTab) - zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+35247, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) + zStmt = Xsqlite3_mprintf(tls, __ccgo_ts+35393, libc.VaList(bp+16, z1, z2, (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zFrom, (*TSessionTable)(unsafe.Pointer(pTab)).FzName, zExpr, zExpr2)) if zStmt == uintptr(0) || z1 == uintptr(0) || z2 == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -267907,17 +258946,18 @@ func _sessionDiffFindModified(tls *libc.TLS, pSession uintptr, pTab uintptr, zFr } func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl uintptr, pzErrMsg uintptr) (r int32) { - bp := tls.Alloc(32) - defer tls.Free(32) + bp := tls.Alloc(64) + defer tls.Free(64) var bHasPk, bMismatch, i, rc int32 - var db, zDb, zExpr, v1 uintptr + var db, zDb, zDbExists, zExpr, v1 uintptr var _ /* abPK at bp+24 */ uintptr var _ /* azCol at bp+28 */ uintptr var _ /* bRowid at bp+20 */ int32 var _ /* d at bp+0 */ TSessionDiffCtx var _ /* nCol at bp+16 */ int32 + var _ /* pDbExists at bp+32 */ uintptr var _ /* pTo at bp+12 */ uintptr - _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zExpr, v1 + _, _, _, _, _, _, _, _, _ = bHasPk, bMismatch, db, i, rc, zDb, zDbExists, zExpr, v1 zDb = (*Tsqlite3_session)(unsafe.Pointer(pSession)).FzDb rc = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc libc.Xmemset(tls, bp, 0, uint32(12)) @@ -267930,7 +258970,9 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u zExpr = uintptr(0) db = (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb /* Table zTbl */ /* Locate and if necessary initialize the target table object */ + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach++ rc = _sessionFindTable(tls, pSession, zTbl, bp+12) + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach-- if *(*uintptr)(unsafe.Pointer(bp + 12)) == uintptr(0) { goto diff_out } @@ -267941,18 +258983,44 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u /* Check the table schemas match */ if rc == SQLITE_OK { bHasPk = 0 - bMismatch = 0 /* Columns in zFrom.zTbl */ + bMismatch = 0 + *(*int32)(unsafe.Pointer(bp + 16)) = 0 /* Columns in zFrom.zTbl */ *(*int32)(unsafe.Pointer(bp + 20)) = 0 + *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 28)) = uintptr(0) - if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { - v1 = bp + 20 + zDbExists = uintptr(0) + /* Check that database zFrom is attached. */ + zDbExists = Xsqlite3_mprintf(tls, __ccgo_ts+35450, libc.VaList(bp+48, zFrom)) + if zDbExists == uintptr(0) { + rc = int32(SQLITE_NOMEM) } else { - v1 = uintptr(0) + *(*uintptr)(unsafe.Pointer(bp + 32)) = uintptr(0) + rc = Xsqlite3_prepare_v2(tls, db, zDbExists, -int32(1), bp+32, uintptr(0)) + if rc == int32(SQLITE_ERROR) { + rc = SQLITE_OK + *(*int32)(unsafe.Pointer(bp + 16)) = -int32(1) + } + Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 32))) + Xsqlite3_free(tls, zDbExists) + } + if rc == SQLITE_OK && *(*int32)(unsafe.Pointer(bp + 16)) == 0 { + if (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbImplicitPK != 0 { + v1 = bp + 20 + } else { + v1 = uintptr(0) + } + rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+16, uintptr(0), uintptr(0), bp+28, uintptr(0), uintptr(0), bp+24, v1) } - rc = _sessionTableInfo(tls, uintptr(0), db, zFrom, zTbl, bp+16, uintptr(0), uintptr(0), bp+28, uintptr(0), uintptr(0), bp+24, v1) if rc == SQLITE_OK { if (*TSessionTable)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FnCol != *(*int32)(unsafe.Pointer(bp + 16)) { - bMismatch = int32(1) + if *(*int32)(unsafe.Pointer(bp + 16)) <= 0 { + rc = int32(SQLITE_SCHEMA) + if pzErrMsg != 0 { + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35481, libc.VaList(bp+48, zFrom, zTbl)) + } + } else { + bMismatch = int32(1) + } } else { i = 0 for { @@ -267978,7 +259046,7 @@ func Xsqlite3session_diff(tls *libc.TLS, pSession uintptr, zFrom uintptr, zTbl u Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp + 28))) if bMismatch != 0 { if pzErrMsg != 0 { - *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35304, 0) + *(*uintptr)(unsafe.Pointer(pzErrMsg)) = Xsqlite3_mprintf(tls, __ccgo_ts+35502, 0) } rc = int32(SQLITE_SCHEMA) } @@ -268138,15 +259206,17 @@ func Xsqlite3session_delete(tls *libc.TLS, pSession uintptr) { Xsqlite3_free(tls, pSession) } +type t__ccgo_fp__Xsqlite3session_table_filter_1 = func(*libc.TLS, uintptr, uintptr) int32 + // C documentation // // /* // ** Set a table filter on a Session Object. // */ -func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, xFilter uintptr, pCtx uintptr) { +func Xsqlite3session_table_filter(tls *libc.TLS, pSession uintptr, __ccgo_fp_xFilter uintptr, pCtx uintptr) { (*Tsqlite3_session)(unsafe.Pointer(pSession)).FbAutoAttach = int32(1) (*Tsqlite3_session)(unsafe.Pointer(pSession)).FpFilterCtx = pCtx - (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = xFilter + (*Tsqlite3_session)(unsafe.Pointer(pSession)).FxTableFilter = __ccgo_fp_xFilter } // C documentation @@ -268310,7 +259380,7 @@ func _sessionAppendInteger(tls *libc.TLS, p uintptr, iVal int32, pRc uintptr) { bp := tls.Alloc(48) defer tls.Free(48) var _ /* aBuf at bp+0 */ [24]int8 - Xsqlite3_snprintf(tls, int32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+6512, libc.VaList(bp+32, iVal)) + Xsqlite3_snprintf(tls, int32(libc.Uint32FromInt64(24)-libc.Uint32FromInt32(1)), bp, __ccgo_ts+6600, libc.VaList(bp+32, iVal)) _sessionAppendStr(tls, p, bp, pRc) } @@ -268604,18 +259674,18 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt _, _, _, _, _ = i, nSql, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK zSql = uintptr(0) - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 nSql = -int32(1) *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 16)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 28)) = TSessionBuffer{} *(*TSessionBuffer)(unsafe.Pointer(bp + 40)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+16, __ccgo_ts+35331, bp) - if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13078, zTab) { - _sessionAppendStr(tls, bp+16, __ccgo_ts+35335, bp) - _sessionAppendStr(tls, bp+28, __ccgo_ts+35359, bp) - _sessionAppendStr(tls, bp+40, __ccgo_ts+35368, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35413, bp) + _sessionAppendStr(tls, bp+16, __ccgo_ts+35529, bp) + if 0 == Xsqlite3_stricmp(tls, __ccgo_ts+13194, zTab) { + _sessionAppendStr(tls, bp+16, __ccgo_ts+35533, bp) + _sessionAppendStr(tls, bp+28, __ccgo_ts+35557, bp) + _sessionAppendStr(tls, bp+40, __ccgo_ts+35566, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35611, bp) } else { i = 0 for { @@ -268623,17 +259693,17 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt break } if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+16459, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+16575, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) if *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { _sessionAppendStr(tls, bp+28, zSep, bp) _sessionAppendStr(tls, bp+40, zSep, bp) - zSep = __ccgo_ts + 16459 + zSep = __ccgo_ts + 16575 _sessionAppendIdent(tls, bp+28, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)), bp) - _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+35427, libc.VaList(bp+64, i+int32(1))) + _sessionAppendPrintf(tls, bp+40, bp, __ccgo_ts+35625, libc.VaList(bp+64, i+int32(1))) } else { - _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+35431, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) + _sessionAppendPrintf(tls, bp+16, bp, __ccgo_ts+35629, libc.VaList(bp+64, i+int32(1)+nCol, i+int32(1), zTab, *(*uintptr)(unsafe.Pointer(azCol + uintptr(i)*4)))) } goto _1 _1: @@ -268645,9 +259715,9 @@ func _sessionSelectStmt(tls *libc.TLS, db uintptr, bIgnoreNoop int32, zDb uintpt if bIgnoreNoop != 0 { v2 = (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+35458, libc.VaList(bp+64, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+35656, libc.VaList(bp+64, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, v2, zDb, zTab, (*(*TSessionBuffer)(unsafe.Pointer(bp + 28))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 40))).FaBuf)) if zSql == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } @@ -268768,7 +259838,7 @@ func _sessionAppendTableHdr(tls *libc.TLS, pBuf uintptr, bPatchset int32, pTab u // ** occurs, an SQLite error code is returned and both output variables set // ** to 0. // */ -func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { +func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, __ccgo_fp_xOutput uintptr, pOut uintptr, pnChangeset uintptr, ppChangeset uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var db, p, pTab, zName uintptr @@ -268782,14 +259852,14 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, /* Zero the output variables in case an error occurs. If this session ** object is already in the error state (sqlite3_session.rc != SQLITE_OK), ** this call will be a no-op. */ - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = 0 *(*uintptr)(unsafe.Pointer(ppChangeset)) = uintptr(0) } if (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc != 0 { return (*Tsqlite3_session)(unsafe.Pointer(pSession)).Frc } - *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+35500, uintptr(0), uintptr(0), uintptr(0)) + *(*int32)(unsafe.Pointer(bp + 12)) = Xsqlite3_exec(tls, (*Tsqlite3_session)(unsafe.Pointer(pSession)).Fdb, __ccgo_ts+35698, uintptr(0), uintptr(0), uintptr(0)) if *(*int32)(unsafe.Pointer(bp + 12)) != SQLITE_OK { return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -268858,8 +259928,8 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, } /* If the buffer is now larger than sessions_strm_chunk_size, pass ** its contents to the xOutput() callback. */ - if xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + if __ccgo_fp_xOutput != 0 && *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > nNoop && (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) nNoop = -int32(1) (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf = 0 } @@ -268884,18 +259954,18 @@ func _sessionGenerateChangeset(tls *libc.TLS, pSession uintptr, bPatchset int32, pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp + 12)) == SQLITE_OK { - if xOutput == uintptr(0) { + if __ccgo_fp_xOutput == uintptr(0) { *(*int32)(unsafe.Pointer(pnChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf *(*uintptr)(unsafe.Pointer(ppChangeset)) = (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf = uintptr(0) } else { if (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) + *(*int32)(unsafe.Pointer(bp + 12)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FnBuf) } } } Xsqlite3_free(tls, (*(*TSessionBuffer)(unsafe.Pointer(bp))).FaBuf) - Xsqlite3_exec(tls, db, __ccgo_ts+35520, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+35718, uintptr(0), uintptr(0), uintptr(0)) Xsqlite3_mutex_leave(tls, Xsqlite3_db_mutex(tls, db)) return *(*int32)(unsafe.Pointer(bp + 12)) } @@ -268919,28 +259989,32 @@ func Xsqlite3session_changeset(tls *libc.TLS, pSession uintptr, pnChangeset uint return rc } +type t__ccgo_fp__Xsqlite3session_changeset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_changeset(). // */ -func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_changeset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, 0, xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, 0, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } +type t__ccgo_fp__Xsqlite3session_patchset_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3session_patchset(). // */ -func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, xOutput uintptr, pOut uintptr) (r int32) { - if xOutput == uintptr(0) { +func Xsqlite3session_patchset_strm(tls *libc.TLS, pSession uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + if __ccgo_fp_xOutput == uintptr(0) { return int32(SQLITE_MISUSE) } - return _sessionGenerateChangeset(tls, pSession, int32(1), xOutput, pOut, uintptr(0), uintptr(0)) + return _sessionGenerateChangeset(tls, pSession, int32(1), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -269079,7 +260153,7 @@ func Xsqlite3session_changeset_size(tls *libc.TLS, pSession uintptr) (r Tsqlite3 // /* // ** Do the work for either sqlite3changeset_start() or start_strm(). // */ -func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { +func _sessionChangesetStart(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, nChangeset int32, pChangeset uintptr, bInvert int32, bSkipEmpty int32) (r int32) { var nByte, v1 int32 var pRet uintptr _, _, _ = nByte, pRet, v1 /* Number of bytes to allocate for iterator */ @@ -269094,9 +260168,9 @@ func _sessionChangesetStart(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintp libc.Xmemset(tls, pRet, 0, uint32(100)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FaData = pChangeset (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FnData = nChangeset - (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = xInput + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FxInput = __ccgo_fp_xInput (*Tsqlite3_changeset_iter)(unsafe.Pointer(pRet)).Fin.FpIn = pIn - if xInput != 0 { + if __ccgo_fp_xInput != 0 { v1 = 0 } else { v1 = int32(1) @@ -269125,20 +260199,24 @@ func Xsqlite3changeset_start_v2(tls *libc.TLS, pp uintptr, nChangeset int32, pCh return _sessionChangesetStart(tls, pp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInvert, 0) } +type t__ccgo_fp__Xsqlite3changeset_start_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_start(). // */ -func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr) (r int32) { - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), 0, 0) +func Xsqlite3changeset_start_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), 0, 0) } -func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, pIn uintptr, flags int32) (r int32) { +type t__ccgo_fp__Xsqlite3changeset_start_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, flags int32) (r int32) { var bInvert int32 _ = bInvert bInvert = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETSTART_INVERT) != 0)) - return _sessionChangesetStart(tls, pp, xInput, pIn, 0, uintptr(0), bInvert, 0) + return _sessionChangesetStart(tls, pp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInvert, 0) } // C documentation @@ -269150,13 +260228,14 @@ func Xsqlite3changeset_start_v2_strm(tls *libc.TLS, pp uintptr, xInput uintptr, func _sessionDiscardData(tls *libc.TLS, pIn uintptr) { var nMove int32 _ = nMove - if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= _sessions_strm_chunk_size { - nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext + if (*TSessionInput)(unsafe.Pointer(pIn)).FxInput != 0 && (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent >= _sessions_strm_chunk_size { + nMove = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf - (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent if nMove > 0 { - libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiNext), uint32(nMove)) + libc.Xmemmove(tls, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf, (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FaBuf+uintptr((*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent), uint32(nMove)) } - (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiNext - (*TSessionInput)(unsafe.Pointer(pIn)).FiNext = 0 + (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + *(*int32)(unsafe.Pointer(pIn + 8)) -= (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent + (*TSessionInput)(unsafe.Pointer(pIn)).FiCurrent = 0 (*TSessionInput)(unsafe.Pointer(pIn)).FnData = (*TSessionInput)(unsafe.Pointer(pIn)).Fbuf.FnBuf } } @@ -269312,7 +260391,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, int32(9)) if rc == SQLITE_OK { if (*TSessionInput)(unsafe.Pointer(pIn)).FiNext >= (*TSessionInput)(unsafe.Pointer(pIn)).FnData { - rc = _sqlite3CorruptError(tls, int32(230283)) + rc = _sqlite3CorruptError(tls, int32(231668)) } else { v3 = pIn + 8 v2 = *(*int32)(unsafe.Pointer(v3)) @@ -269336,7 +260415,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap rc = _sessionInputBuffer(tls, pIn, *(*int32)(unsafe.Pointer(bp))) if rc == SQLITE_OK { if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext { - rc = _sqlite3CorruptError(tls, int32(230303)) + rc = _sqlite3CorruptError(tls, int32(231688)) } else { if eType == int32(SQLITE_TEXT) { v4 = int32(SQLITE_UTF8) @@ -269351,7 +260430,7 @@ func _sessionReadRecord(tls *libc.TLS, pIn uintptr, nCol int32, abPK uintptr, ap } if eType == int32(SQLITE_INTEGER) || eType == int32(SQLITE_FLOAT) { if (*TSessionInput)(unsafe.Pointer(pIn)).FnData-(*TSessionInput)(unsafe.Pointer(pIn)).FiNext < int32(8) { - rc = _sqlite3CorruptError(tls, int32(230313)) + rc = _sqlite3CorruptError(tls, int32(231698)) } else { *(*Tsqlite3_int64)(unsafe.Pointer(bp + 8)) = _sessionGetI64(tls, aVal) if eType == int32(SQLITE_INTEGER) { @@ -269407,7 +260486,7 @@ func _sessionChangesetBufferTblhdr(tls *libc.TLS, pIn uintptr, pnByte uintptr) ( ** large value for nCol may cause nRead to wrap around and become ** negative. Leading to a crash. */ if *(*int32)(unsafe.Pointer(bp)) < 0 || *(*int32)(unsafe.Pointer(bp)) > int32(65536) { - rc = _sqlite3CorruptError(tls, int32(230361)) + rc = _sqlite3CorruptError(tls, int32(231746)) } else { rc = _sessionInputBuffer(tls, pIn, nRead+*(*int32)(unsafe.Pointer(bp))+int32(100)) nRead += *(*int32)(unsafe.Pointer(bp)) @@ -269512,7 +260591,7 @@ func _sessionChangesetReadTblhdr(tls *libc.TLS, p uintptr) (r int32) { (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Ftblhdr.FnBuf = 0 _sessionBufferGrow(tls, p+44, int64(nByte), bp) } else { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230449)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(231834)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -269583,8 +260662,8 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc != SQLITE_OK { return (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc } - _sessionDiscardData(tls, p) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiCurrent = (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext + _sessionDiscardData(tls, p) /* If the iterator is already at the end of the changeset, return DONE. */ if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FiNext >= (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FnData { return int32(SQLITE_DONE) @@ -269618,7 +260697,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FzTab == uintptr(0) || (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbPatchset != 0 && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbInvert != 0 { /* The first record in the changeset is not a table header. Must be a ** corrupt changeset. */ - v7 = _sqlite3CorruptError(tls, int32(230535)) + v7 = _sqlite3CorruptError(tls, int32(231920)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v7 return v7 } @@ -269628,7 +260707,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin *(*int32)(unsafe.Pointer(v9))++ (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FbIndirect = int32(*(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fin.FaData + uintptr(v8)))) if (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_UPDATE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_DELETE) && (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Fop != int32(SQLITE_INSERT) { - v10 = _sqlite3CorruptError(tls, int32(230541)) + v10 = _sqlite3CorruptError(tls, int32(231926)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v10 return v10 } @@ -269707,7 +260786,7 @@ func _sessionChangesetNextOne(tls *libc.TLS, p uintptr, paRec uintptr, pnRec uin if *(*Tu8)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) = *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i+(*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FnCol)*4)) if *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).FapValue + uintptr(i)*4)) == uintptr(0) { - v16 = _sqlite3CorruptError(tls, int32(230585)) + v16 = _sqlite3CorruptError(tls, int32(231970)) (*Tsqlite3_changeset_iter)(unsafe.Pointer(p)).Frc = v16 return v16 } @@ -269968,7 +261047,7 @@ func Xsqlite3changeset_finalize(tls *libc.TLS, p uintptr) (r int32) { return rc } -func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { +func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnInverted uintptr, ppInverted uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var abPK, apVal, pVal, pVal1, v7 uintptr @@ -270117,11 +261196,11 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu goto finished_invert } default: - *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(230950)) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3CorruptError(tls, int32(232335)) goto finished_invert } - if xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf = 0 if *(*int32)(unsafe.Pointer(bp)) != SQLITE_OK { goto finished_invert @@ -270133,8 +261212,8 @@ func _sessionChangesetInvert(tls *libc.TLS, pInput uintptr, xOutput uintptr, pOu *(*uintptr)(unsafe.Pointer(ppInverted)) = (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf = uintptr(0) } else { - if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 && xOutput != uintptr(0) { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 && __ccgo_fp_xOutput != uintptr(0) { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } goto finished_invert @@ -270162,12 +261241,16 @@ func Xsqlite3changeset_invert(tls *libc.TLS, nChangeset int32, pChangeset uintpt return _sessionChangesetInvert(tls, bp, uintptr(0), uintptr(0), pnInverted, ppInverted) } +type t__ccgo_fp__Xsqlite3changeset_invert_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_invert_strm_2 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_invert(). // */ -func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_invert_strm(tls *libc.TLS, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) var rc int32 @@ -270175,9 +261258,9 @@ func Xsqlite3changeset_invert_strm(tls *libc.TLS, xInput uintptr, pIn uintptr, x _ = rc /* Set up the input stream */ libc.Xmemset(tls, bp, 0, uint32(44)) - (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = xInput + (*(*TSessionInput)(unsafe.Pointer(bp))).FxInput = __ccgo_fp_xInput (*(*TSessionInput)(unsafe.Pointer(bp))).FpIn = pIn - rc = _sessionChangesetInvert(tls, bp, xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionChangesetInvert(tls, bp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3_free(tls, (*(*TSessionInput)(unsafe.Pointer(bp))).Fbuf.FaBuf) return rc } @@ -270190,14 +261273,6 @@ type TSessionUpdate = struct { type SessionUpdate = TSessionUpdate -type TSessionUpdate1 = struct { - FpStmt uintptr - FaMask uintptr - FpNext uintptr -} - -type SessionUpdate1 = TSessionUpdate1 - type TSessionApplyCtx = struct { Fdb uintptr FpDelete uintptr @@ -270221,29 +261296,6 @@ type TSessionApplyCtx = struct { type SessionApplyCtx = TSessionApplyCtx -type TSessionApplyCtx1 = struct { - Fdb uintptr - FpDelete uintptr - FpInsert uintptr - FpSelect uintptr - FnCol int32 - FazCol uintptr - FabPK uintptr - FaUpdateMask uintptr - FpUp uintptr - FbStat1 int32 - FbDeferConstraints int32 - FbInvertConstraints int32 - Fconstraints TSessionBuffer - Frebase TSessionBuffer - FbRebaseStarted Tu8 - FbRebase Tu8 - FbIgnoreNoop Tu8 - FbRowid int32 -} - -type SessionApplyCtx1 = TSessionApplyCtx1 - /* Number of prepared UPDATE statements to cache. */ // C documentation @@ -270320,18 +261372,18 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 } if pUp == uintptr(0) { nByte = int32(uint32(12) * uint32(nU32) * uint32(4)) - bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+13078) == 0) + bStat1 = libc.BoolInt32(Xsqlite3_stricmp(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, __ccgo_ts+13194) == 0) pUp = Xsqlite3_malloc(tls, nByte) if pUp == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 libc.Xmemset(tls, bp+4, 0, uint32(12)) (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask = pUp + 1*12 libc.Xmemcpy(tls, (*TSessionUpdate)(unsafe.Pointer(pUp)).FaMask, (*TSessionApplyCtx)(unsafe.Pointer(p)).FaUpdateMask, uint32(nU32)*uint32(4)) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35538, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35736, bp) _sessionAppendIdent(tls, bp+4, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FzTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35551, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35749, bp) /* Create the assignments part of the UPDATE */ ii = 0 for { @@ -270341,9 +261393,9 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if int32(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii)))) == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol+ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35557, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35755, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(1), bp) - zSep = __ccgo_ts + 16459 + zSep = __ccgo_ts + 16575 } goto _2 _2: @@ -270351,8 +261403,8 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 ii++ } /* Create the WHERE clause part of the UPDATE */ - zSep = __ccgo_ts + 1673 - _sessionAppendStr(tls, bp+4, __ccgo_ts+35562, bp) + zSep = __ccgo_ts + 1674 + _sessionAppendStr(tls, bp+4, __ccgo_ts+35760, bp) ii = 0 for { if !(ii < (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FnCol) { @@ -270361,13 +261413,13 @@ func _sessionUpdateFind(tls *libc.TLS, pIter uintptr, p uintptr, bPatchset int32 if *(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(ii))) != 0 || bPatchset == 0 && *(*uintptr)(unsafe.Pointer((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FapValue + uintptr(ii)*4)) != 0 { _sessionAppendStr(tls, bp+4, zSep, bp) if bStat1 != 0 && ii == int32(1) { - _sessionAppendStr(tls, bp+4, __ccgo_ts+35570, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35768, bp) } else { _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(ii)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35645, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35843, bp) _sessionAppendInteger(tls, bp+4, ii*int32(2)+int32(2), bp) } - zSep = __ccgo_ts + 23556 + zSep = __ccgo_ts + 23719 } goto _3 _3: @@ -270450,13 +261502,13 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in var _ /* buf at bp+4 */ TSessionBuffer var _ /* rc at bp+0 */ int32 _, _, _ = i, nPk, zSep - zSep = __ccgo_ts + 1673 + zSep = __ccgo_ts + 1674 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} nPk = 0 - _sessionAppendStr(tls, bp+4, __ccgo_ts+35651, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35849, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35562, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35760, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -270466,9 +261518,9 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in nPk++ _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35557, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35755, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 23556 + zSep = __ccgo_ts + 23719 } goto _1 _1: @@ -270476,10 +261528,10 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in i++ } if nPk < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol { - _sessionAppendStr(tls, bp+4, __ccgo_ts+35669, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35867, bp) _sessionAppendInteger(tls, bp+4, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol+int32(1), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35133, bp) - zSep = __ccgo_ts + 1673 + _sessionAppendStr(tls, bp+4, __ccgo_ts+35279, bp) + zSep = __ccgo_ts + 1674 i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { @@ -270488,16 +261540,16 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in if !(*(*Tu8)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK + uintptr(i))) != 0) { _sessionAppendStr(tls, bp+4, zSep, bp) _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+35645, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35843, bp) _sessionAppendInteger(tls, bp+4, i+int32(1), bp) - zSep = __ccgo_ts + 35677 + zSep = __ccgo_ts + 35875 } goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+6480, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+6568, bp) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf, p+4, uintptr(0)) @@ -270523,7 +261575,7 @@ func _sessionDeleteRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in // */ func _sessionSelectRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r int32) { /* TODO */ - return _sessionSelectStmt(tls, db, int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+8020, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) + return _sessionSelectStmt(tls, db, int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop), __ccgo_ts+8107, zTab, (*TSessionApplyCtx)(unsafe.Pointer(p)).FbRowid, (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol, (*TSessionApplyCtx)(unsafe.Pointer(p)).FabPK, p+12) } // C documentation @@ -270546,16 +261598,16 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TSessionBuffer)(unsafe.Pointer(bp + 4)) = TSessionBuffer{} - _sessionAppendStr(tls, bp+4, __ccgo_ts+35682, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35880, bp) _sessionAppendIdent(tls, bp+4, zTab, bp) - _sessionAppendStr(tls, bp+4, __ccgo_ts+23562, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+23725, bp) i = 0 for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } if i != 0 { - _sessionAppendStr(tls, bp+4, __ccgo_ts+16459, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+16575, bp) } _sessionAppendIdent(tls, bp+4, *(*uintptr)(unsafe.Pointer((*TSessionApplyCtx)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)), bp) goto _1 @@ -270563,19 +261615,19 @@ func _sessionInsertRow(tls *libc.TLS, db uintptr, zTab uintptr, p uintptr) (r in ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+35700, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35898, bp) i = int32(1) for { if !(i < (*TSessionApplyCtx)(unsafe.Pointer(p)).FnCol) { break } - _sessionAppendStr(tls, bp+4, __ccgo_ts+35711, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+35909, bp) goto _2 _2: ; i++ } - _sessionAppendStr(tls, bp+4, __ccgo_ts+6480, bp) + _sessionAppendStr(tls, bp+4, __ccgo_ts+6568, bp) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, db, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf, p+8, uintptr(0)) } @@ -270598,12 +261650,12 @@ func _sessionPrepare(tls *libc.TLS, db uintptr, pp uintptr, zSql uintptr) (r int func _sessionStat1Sql(tls *libc.TLS, db uintptr, p uintptr) (r int32) { var rc int32 _ = rc - rc = _sessionSelectRow(tls, db, __ccgo_ts+13078, p) + rc = _sessionSelectRow(tls, db, __ccgo_ts+13194, p) if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35715) + rc = _sessionPrepare(tls, db, p+8, __ccgo_ts+35913) } if rc == SQLITE_OK { - rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+35828) + rc = _sessionPrepare(tls, db, p+4, __ccgo_ts+36026) } return rc } @@ -270647,7 +261699,7 @@ func _sessionBindValue(tls *libc.TLS, pStmt uintptr, i int32, pVal uintptr) (r i // ** // ** An SQLite error code is returned if an error occurs. Otherwise, SQLITE_OK. // */ -func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { +func _sessionBindRow(tls *libc.TLS, pIter uintptr, __ccgo_fp_xValue uintptr, nCol int32, abPK uintptr, pStmt uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i, rc int32 @@ -270665,11 +261717,11 @@ func _sessionBindRow(tls *libc.TLS, pIter uintptr, xValue uintptr, nCol int32, a } if !(abPK != 0) || *(*Tu8)(unsafe.Pointer(abPK + uintptr(i))) != 0 { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) - (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xValue})))(tls, pIter, i, bp) + (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xValue})))(tls, pIter, i, bp) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { /* The value in the changeset was "undefined". This indicates a ** corrupt changeset blob. */ - rc = _sqlite3CorruptError(tls, int32(231432)) + rc = _sqlite3CorruptError(tls, int32(232817)) } else { rc = _sessionBindValue(tls, pStmt, i+int32(1), *(*uintptr)(unsafe.Pointer(bp))) } @@ -270846,7 +261898,7 @@ func _sessionRebaseAdd(tls *libc.TLS, p uintptr, eType int32, pIter uintptr) (r // ** SQLITE_MISUSE. If the conflict handler returns SQLITE_CHANGESET_OMIT, // ** this function returns SQLITE_OK. // */ -func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { +func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var aBlob uintptr @@ -270870,7 +261922,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt res = SQLITE_CHANGESET_OMIT } else { (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType, pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType, pIter) (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FpConflict = uintptr(0) } *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpSelect) @@ -270885,7 +261937,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt return SQLITE_OK } else { /* No other row with the new.* primary key. */ - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, eType+int32(1), pIter) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, eType+int32(1), pIter) if res == int32(SQLITE_CHANGESET_REPLACE) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_MISUSE) } @@ -270936,7 +261988,7 @@ func _sessionConflictHandler(tls *libc.TLS, eType int32, p uintptr, pIter uintpt // ** returns SQLITE_ABORT. Otherwise, if no error occurs, SQLITE_OK is // ** returned. // */ -func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { +func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, pbReplace uintptr, pbRetry uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var abPK, pNew, pOld, v1 uintptr @@ -270976,10 +262028,10 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp Xsqlite3_step(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpDelete) if rc == SQLITE_OK && Xsqlite3_changes(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).Fdb) == 0 && int32((*TSessionApplyCtx)(unsafe.Pointer(p)).FbIgnoreNoop) == 0 { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -271017,11 +262069,11 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp /* A NOTFOUND or DATA error. Search the table to see if it contains ** a row with a matching primary key. If so, this is a DATA conflict. ** Otherwise, if there is no primary key match, it is a NOTFOUND. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, xConflict, pCtx, pbRetry) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_DATA), p, pIter, __ccgo_fp_xConflict, pCtx, pbRetry) } else { if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { /* This is always a CONSTRAINT conflict. */ - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, uintptr(0)) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, uintptr(0)) } } } else { @@ -271044,7 +262096,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(p)).FpInsert) } if rc&int32(0xff) == int32(SQLITE_CONSTRAINT) { - rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, xConflict, pCtx, pbReplace) + rc = _sessionConflictHandler(tls, int32(SQLITE_CHANGESET_CONFLICT), p, pIter, __ccgo_fp_xConflict, pCtx, pbReplace) } } } @@ -271063,7 +262115,7 @@ func _sessionApplyOneOp(tls *libc.TLS, pIter uintptr, p uintptr, xConflict uintp // ** returns SQLITE_CHANGESET_REPLACE - indicating that the change should be // ** retried in some manner. // */ -func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -271072,7 +262124,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply _ = rc *(*int32)(unsafe.Pointer(bp)) = 0 *(*int32)(unsafe.Pointer(bp + 4)) = 0 - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, bp, bp+4) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, bp, bp+4) if rc == SQLITE_OK { /* If the bRetry flag is set, the change has not been applied due to an ** SQLITE_CHANGESET_DATA problem (i.e. this is an UPDATE or DELETE and @@ -271082,10 +262134,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply ** but pass NULL as the final argument so that sessionApplyOneOp() ignores ** the SQLITE_CHANGESET_DATA problem. */ if *(*int32)(unsafe.Pointer(bp + 4)) != 0 { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } else { if *(*int32)(unsafe.Pointer(bp)) != 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35972, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36170, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = _sessionBindRow(tls, pIter, __ccgo_fp(Xsqlite3changeset_new), (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FabPK, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) Xsqlite3_bind_int(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FnCol+int32(1), int32(1)) @@ -271095,10 +262147,10 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply rc = Xsqlite3_reset(tls, (*TSessionApplyCtx)(unsafe.Pointer(pApply)).FpDelete) } if rc == SQLITE_OK { - rc = _sessionApplyOneOp(tls, pIter, pApply, xConflict, pCtx, uintptr(0), uintptr(0)) + rc = _sessionApplyOneOp(tls, pIter, pApply, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+35993, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36191, uintptr(0), uintptr(0), uintptr(0)) } } } @@ -271111,7 +262163,7 @@ func _sessionApplyOneWithRetry(tls *libc.TLS, db uintptr, pIter uintptr, pApply // /* // ** Retry the changes accumulated in the pApply->constraints buffer. // */ -func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, xConflict uintptr, pCtx uintptr) (r int32) { +func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab uintptr, pApply uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var cons TSessionBuffer @@ -271138,7 +262190,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u libc.Xmemset(tls, (*Tsqlite3_changeset_iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 4)))).FapValue, 0, nByte) } for *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) { - *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4)), pApply, xConflict, pCtx) + *(*int32)(unsafe.Pointer(bp)) = _sessionApplyOneWithRetry(tls, db, *(*uintptr)(unsafe.Pointer(bp + 4)), pApply, __ccgo_fp_xConflict, pCtx) } rc2 = Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -271166,7 +262218,7 @@ func _sessionRetryConstraints(tls *libc.TLS, db uintptr, bPatchset int32, zTab u // ** conflict handler callback is invoked to resolve any conflicts encountered // ** while applying the change. // */ -func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(240) defer tls.Free(240) var bPatchset, i, nMinCol, nTab, rc, rc2, res, schemaMismatch, v2, v3, v4, v6 int32 @@ -271198,15 +262250,15 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbInvertConstraints = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbIgnoreNoop = libc.BoolUint8(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_IGNORENOOP) != 0)) if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36012, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36210, uintptr(0), uintptr(0), uintptr(0)) } if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36038, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36236, uintptr(0), uintptr(0), uintptr(0)) } for rc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3changeset_next(tls, pIter) { Xsqlite3changeset_op(tls, pIter, bp+92, bp+84, bp+88, uintptr(0)) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) || Xsqlite3_strnicmp(tls, *(*uintptr)(unsafe.Pointer(bp + 92)), *(*uintptr)(unsafe.Pointer(bp)), nTab+int32(1)) != 0 { - rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, __ccgo_fp_xConflict, pCtx) if rc != SQLITE_OK { break } @@ -271230,9 +262282,9 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui /* If an xFilter() callback was specified, invoke it now. If the ** xFilter callback returns zero, skip this table. If it returns ** non-zero, proceed. */ - schemaMismatch = libc.BoolInt32(xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 92)))) + schemaMismatch = libc.BoolInt32(__ccgo_fp_xFilter != 0 && 0 == (*(*func(*libc.TLS, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xFilter})))(tls, pCtx, *(*uintptr)(unsafe.Pointer(bp + 92)))) if schemaMismatch != 0 { - *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp + 92)))) + *(*uintptr)(unsafe.Pointer(bp)) = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp + 92)))) if *(*uintptr)(unsafe.Pointer(bp)) == uintptr(0) { rc = int32(SQLITE_NOMEM) break @@ -271242,7 +262294,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } else { nMinCol = 0 Xsqlite3changeset_pk(tls, pIter, bp+96, uintptr(0)) - rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+8020, *(*uintptr)(unsafe.Pointer(bp + 92)), bp+4+16, uintptr(0), bp, bp+4+20, uintptr(0), uintptr(0), bp+4+24, bp+4+76) + rc = _sessionTableInfo(tls, uintptr(0), db, __ccgo_ts+8107, *(*uintptr)(unsafe.Pointer(bp + 92)), bp+4+16, uintptr(0), bp, bp+4+20, uintptr(0), uintptr(0), bp+4+24, bp+4+76) if rc != SQLITE_OK { break } @@ -271261,18 +262313,18 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui } if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol == 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36068, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36266, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { if (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol < *(*int32)(unsafe.Pointer(bp + 84)) { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36112, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36310, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)), (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol, *(*int32)(unsafe.Pointer(bp + 84)))) } else { if *(*int32)(unsafe.Pointer(bp + 84)) < nMinCol || libc.Xmemcmp(tls, (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FabPK, *(*uintptr)(unsafe.Pointer(bp + 96)), uint32(*(*int32)(unsafe.Pointer(bp + 84)))) != 0 { schemaMismatch = int32(1) - Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36183, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) + Xsqlite3_log(tls, int32(SQLITE_SCHEMA), __ccgo_ts+36381, libc.VaList(bp+216, *(*uintptr)(unsafe.Pointer(bp)))) } else { (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FnCol = *(*int32)(unsafe.Pointer(bp + 84)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+13078) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_ts+13194) { v2 = _sessionStat1Sql(tls, db, bp+4) rc = v2 if v2 != 0 { @@ -271306,7 +262358,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui if schemaMismatch != 0 { continue } - rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+4, xConflict, pCtx) + rc = _sessionApplyOneWithRetry(tls, db, pIter, bp+4, __ccgo_fp_xConflict, pCtx) } bPatchset = (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbPatchset if rc == SQLITE_OK { @@ -271315,7 +262367,7 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui Xsqlite3changeset_finalize(tls, pIter) } if rc == SQLITE_OK { - rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, xConflict, pCtx) + rc = _sessionRetryConstraints(tls, db, bPatchset, *(*uintptr)(unsafe.Pointer(bp)), bp+4, __ccgo_fp_xConflict, pCtx) } if rc == SQLITE_OK { Xsqlite3_db_status(tls, db, int32(SQLITE_DBSTATUS_DEFERRED_FKS), bp+100, bp+104, 0) @@ -271323,23 +262375,23 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui res = int32(SQLITE_CHANGESET_ABORT) libc.Xmemset(tls, bp+108, 0, uint32(100)) (*(*Tsqlite3_changeset_iter)(unsafe.Pointer(bp + 108))).FnCol = *(*int32)(unsafe.Pointer(bp + 100)) - res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+108) + res = (*(*func(*libc.TLS, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xConflict})))(tls, pCtx, int32(SQLITE_CHANGESET_FOREIGN_KEY), bp+108) if res != SQLITE_CHANGESET_OMIT { rc = int32(SQLITE_CONSTRAINT) } } } - rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36243, uintptr(0), uintptr(0), uintptr(0)) + rc2 = Xsqlite3_exec(tls, db, __ccgo_ts+36441, uintptr(0), uintptr(0), uintptr(0)) if rc == SQLITE_OK { rc = rc2 } if flags&int32(SQLITE_CHANGESETAPPLY_NOSAVEPOINT) == 0 { if rc == SQLITE_OK { - rc = Xsqlite3_exec(tls, db, __ccgo_ts+36273, uintptr(0), uintptr(0), uintptr(0)) + rc = Xsqlite3_exec(tls, db, __ccgo_ts+36471, uintptr(0), uintptr(0), uintptr(0)) } if rc != SQLITE_OK { - Xsqlite3_exec(tls, db, __ccgo_ts+36297, uintptr(0), uintptr(0), uintptr(0)) - Xsqlite3_exec(tls, db, __ccgo_ts+36273, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36495, uintptr(0), uintptr(0), uintptr(0)) + Xsqlite3_exec(tls, db, __ccgo_ts+36471, uintptr(0), uintptr(0), uintptr(0)) } } if rc == SQLITE_OK && bPatchset == 0 && (*(*TSessionApplyCtx)(unsafe.Pointer(bp + 4))).FbRebase != 0 { @@ -271362,13 +262414,17 @@ func _sessionChangesetApply(tls *libc.TLS, db uintptr, pIter uintptr, xFilter ui return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* // ** Apply the changeset passed via pChangeset/nChangeset to the main // ** database attached to handle "db". // */ -func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInv, rc int32 @@ -271377,11 +262433,15 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh bInv = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) rc = _sessionChangesetStart(tls, bp, uintptr(0), uintptr(0), nChangeset, pChangeset, bInv, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } +type t__ccgo_fp__Xsqlite3changeset_apply_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -271389,10 +262449,16 @@ func Xsqlite3changeset_apply_v2(tls *libc.TLS, db uintptr, nChangeset int32, pCh // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) +func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChangeset uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2(tls, db, nChangeset, pChangeset, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) } +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_apply_v2_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + // C documentation // // /* @@ -271400,37 +262466,29 @@ func Xsqlite3changeset_apply(tls *libc.TLS, db uintptr, nChangeset int32, pChang // ** attached to handle "db". Invoke the supplied conflict handler callback // ** to resolve any conflicts encountered while applying the change. // */ -func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { +func Xsqlite3changeset_apply_v2_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr, ppRebase uintptr, pnRebase uintptr, flags int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bInverse, rc int32 var _ /* pIter at bp+0 */ uintptr _, _ = bInverse, rc /* Iterator to skip through changeset */ bInverse = libc.BoolInt32(!!(flags&libc.Int32FromInt32(SQLITE_CHANGESETAPPLY_INVERT) != 0)) - rc = _sessionChangesetStart(tls, bp, xInput, pIn, 0, uintptr(0), bInverse, int32(1)) + rc = _sessionChangesetStart(tls, bp, __ccgo_fp_xInput, pIn, 0, uintptr(0), bInverse, int32(1)) if rc == SQLITE_OK { - rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), xFilter, xConflict, pCtx, ppRebase, pnRebase, flags) + rc = _sessionChangesetApply(tls, db, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, ppRebase, pnRebase, flags) } return rc } -func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, xInput uintptr, pIn uintptr, xFilter uintptr, xConflict uintptr, pCtx uintptr) (r int32) { - return Xsqlite3changeset_apply_v2_strm(tls, db, xInput, pIn, xFilter, xConflict, pCtx, uintptr(0), uintptr(0), 0) -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 -/* -** sqlite3_changegroup handle. - */ -type Tsqlite3_changegroup1 = struct { - Frc int32 - FbPatch int32 - FpList uintptr - Frec TSessionBuffer - Fdb uintptr - FzDb uintptr -} +type t__ccgo_fp__Xsqlite3changeset_apply_strm_3 = func(*libc.TLS, uintptr, uintptr) int32 -type sqlite3_changegroup1 = Tsqlite3_changegroup1 +type t__ccgo_fp__Xsqlite3changeset_apply_strm_4 = func(*libc.TLS, uintptr, int32, uintptr) int32 + +func Xsqlite3changeset_apply_strm(tls *libc.TLS, db uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xFilter uintptr, __ccgo_fp_xConflict uintptr, pCtx uintptr) (r int32) { + return Xsqlite3changeset_apply_v2_strm(tls, db, __ccgo_fp_xInput, pIn, __ccgo_fp_xFilter, __ccgo_fp_xConflict, pCtx, uintptr(0), uintptr(0), 0) +} // C documentation // @@ -272006,7 +263064,7 @@ func _sessionChangesetToHash(tls *libc.TLS, pIter uintptr, pGrp uintptr, bRebase // ** error code. If an error occurs and xOutput is NULL, (*ppOut) and (*pnOut) // ** are both set to 0 before returning. // */ -func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var i int32 @@ -272041,8 +263099,8 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu _sessionAppendByte(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).Fop, bp) _sessionAppendByte(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).FbIndirect, bp) _sessionAppendBlob(tls, bp+4, (*TSessionChange)(unsafe.Pointer(p)).FaRecord, (*TSessionChange)(unsafe.Pointer(p)).FnRecord, bp) - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf >= _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf = 0 } goto _3 @@ -272061,9 +263119,9 @@ func _sessionChangegroupOutput(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOu pTab = (*TSessionTable)(unsafe.Pointer(pTab)).FpNext } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 4))).FnBuf) } } else { if ppOut != 0 { @@ -272115,7 +263173,7 @@ func Xsqlite3changegroup_schema(tls *libc.TLS, pGrp uintptr, db uintptr, zDb uin ** or after sqlite3changegroup_schema() has already been called. */ rc = int32(SQLITE_MISUSE) } else { - (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+8, zDb)) + (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+8, zDb)) if (*Tsqlite3_changegroup)(unsafe.Pointer(pGrp)).FzDb == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -272151,11 +263209,17 @@ func Xsqlite3changegroup_add(tls *libc.TLS, pGrp uintptr, nData int32, pData uin // ** Add a single change to a changeset-group. // */ func Xsqlite3changegroup_add_change(tls *libc.TLS, pGrp uintptr, pIter uintptr) (r int32) { + var rc int32 + _ = rc + rc = SQLITE_OK if (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiCurrent == (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FiNext || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Frc != SQLITE_OK || (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbInvert != 0 { /* Iterator does not point to any valid entry or is an INVERT iterator. */ - return int32(SQLITE_ERROR) + rc = int32(SQLITE_ERROR) + } else { + (*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).Fin.FbNoDiscard = int32(1) + rc = _sessionOneChangeToHash(tls, pGrp, pIter, 0) } - return _sessionOneChangeToHash(tls, pGrp, pIter, 0) + return rc } // C documentation @@ -272168,18 +263232,20 @@ func Xsqlite3changegroup_output(tls *libc.TLS, pGrp uintptr, pnData uintptr, ppD return _sessionChangegroupOutput(tls, pGrp, uintptr(0), uintptr(0), pnData, ppData) } +type t__ccgo_fp__Xsqlite3changegroup_add_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + // C documentation // // /* // ** Streaming versions of changegroup_add(). // */ -func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, pIn uintptr) (r int32) { +func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xInput uintptr, pIn uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc /* Return code */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { rc = _sessionChangesetToHash(tls, *(*uintptr)(unsafe.Pointer(bp)), pGrp, 0) } @@ -272187,13 +263253,15 @@ func Xsqlite3changegroup_add_strm(tls *libc.TLS, pGrp uintptr, xInput uintptr, p return rc } +type t__ccgo_fp__Xsqlite3changegroup_output_strm_1 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming versions of changegroup_output(). // */ -func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, xOutput uintptr, pOut uintptr) (r int32) { - return _sessionChangegroupOutput(tls, pGrp, xOutput, pOut, uintptr(0), uintptr(0)) +func Xsqlite3changegroup_output_strm(tls *libc.TLS, pGrp uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { + return _sessionChangegroupOutput(tls, pGrp, __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) } // C documentation @@ -272235,12 +263303,18 @@ func Xsqlite3changeset_concat(tls *libc.TLS, nLeft int32, pLeft uintptr, nRight return rc } +type t__ccgo_fp__Xsqlite3changeset_concat_strm_0 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_2 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3changeset_concat_strm_4 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Streaming version of sqlite3changeset_concat(). // */ -func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, xInputB uintptr, pInB uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3changeset_concat_strm(tls *libc.TLS, __ccgo_fp_xInputA uintptr, pInA uintptr, __ccgo_fp_xInputB uintptr, pInB uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 @@ -272248,27 +263322,18 @@ func Xsqlite3changeset_concat_strm(tls *libc.TLS, xInputA uintptr, pInA uintptr, _ = rc rc = Xsqlite3changegroup_new(tls, bp) if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputA, pInA) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputA, pInA) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xInputB, pInB) + rc = Xsqlite3changegroup_add_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xInputB, pInB) } if rc == SQLITE_OK { - rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut) + rc = Xsqlite3changegroup_output_strm(tls, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut) } Xsqlite3changegroup_delete(tls, *(*uintptr)(unsafe.Pointer(bp))) return rc } -/* -** Changeset rebaser handle. - */ -type Tsqlite3_rebaser1 = struct { - Fgrp Tsqlite3_changegroup -} - -type sqlite3_rebaser1 = Tsqlite3_rebaser1 - // C documentation // // /* @@ -272423,7 +263488,7 @@ func _sessionAppendPartialUpdate(tls *libc.TLS, pBuf uintptr, pIter uintptr, aRe // ** pnOut are not NULL, then the two output parameters are set to 0 before // ** returning. // */ -func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { +func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr, pnOut uintptr, ppOut uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var bDone, iHash, v2 int32 @@ -272531,8 +263596,8 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO _sessionAppendByte(tls, bp+16, uint8((*Tsqlite3_changeset_iter)(unsafe.Pointer(pIter)).FbIndirect), bp) _sessionAppendBlob(tls, bp+16, *(*uintptr)(unsafe.Pointer(bp + 4)), *(*int32)(unsafe.Pointer(bp + 8)), bp) } - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > _sessions_strm_chunk_size { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && __ccgo_fp_xOutput != 0 && (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > _sessions_strm_chunk_size { + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf = 0 } if *(*int32)(unsafe.Pointer(bp)) != 0 { @@ -272544,9 +263609,9 @@ func _sessionRebase(tls *libc.TLS, p uintptr, pIter uintptr, xOutput uintptr, pO libc.Xmemset(tls, bp+16, 0, uint32(12)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - if xOutput != 0 { + if __ccgo_fp_xOutput != 0 { if (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf > 0 { - *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) + *(*int32)(unsafe.Pointer(bp)) = (*(*func(*libc.TLS, uintptr, uintptr, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xOutput})))(tls, pOut, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FaBuf, (*(*TSessionBuffer)(unsafe.Pointer(bp + 16))).FnBuf) } } else { if ppOut != 0 { @@ -272620,21 +263685,25 @@ func Xsqlite3rebaser_rebase(tls *libc.TLS, p uintptr, nIn int32, pIn uintptr, pn return rc } +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_1 = func(*libc.TLS, uintptr, uintptr, uintptr) int32 + +type t__ccgo_fp__Xsqlite3rebaser_rebase_strm_3 = func(*libc.TLS, uintptr, uintptr, int32) int32 + // C documentation // // /* // ** Rebase a changeset according to current rebaser configuration // */ -func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, xInput uintptr, pIn uintptr, xOutput uintptr, pOut uintptr) (r int32) { +func Xsqlite3rebaser_rebase_strm(tls *libc.TLS, p uintptr, __ccgo_fp_xInput uintptr, pIn uintptr, __ccgo_fp_xOutput uintptr, pOut uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var rc int32 var _ /* pIter at bp+0 */ uintptr _ = rc *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* Iterator to skip through input */ - rc = Xsqlite3changeset_start_strm(tls, bp, xInput, pIn) + rc = Xsqlite3changeset_start_strm(tls, bp, __ccgo_fp_xInput, pIn) if rc == SQLITE_OK { - rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), xOutput, pOut, uintptr(0), uintptr(0)) + rc = _sessionRebase(tls, p, *(*uintptr)(unsafe.Pointer(bp)), __ccgo_fp_xOutput, pOut, uintptr(0), uintptr(0)) Xsqlite3changeset_finalize(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -272740,6 +263809,7 @@ func Xsqlite3session_config(tls *libc.TLS, op int32, pArg uintptr) (r int32) { /* #include */ /* #include */ +/* #include */ /* Truncate very long tokens to this many bytes. Hard limit is ** (65536-1-1-4-9)==65521 bytes. The limiting factor is the 16-bit offset @@ -272787,24 +263857,12 @@ type TFts5Global = struct { type Fts5Global = TFts5Global type TFts5Colset = struct { - FnCol int32 - FaiCol [1]int32 + FnCol int32 } type Fts5Colset = TFts5Colset -/* If a NEAR() clump or phrase may only match a specific set of columns, -** then an object of the following type is used to record the set of columns. -** Each entry in the aiCol[] array is a column that may be matched. -** -** This object is used by fts5_expr.c and fts5_index.c. - */ -type TFts5Colset1 = struct { - FnCol int32 - FaiCol [1]int32 -} - -type Fts5Colset1 = TFts5Colset1 +/* Size (int bytes) of a complete Fts5Colset object with N columns. */ /************************************************************************** ** Interface to code in fts5_config.c. fts5_config.c contains contains code @@ -272848,113 +263906,20 @@ type TFts5Config = struct { FpzErrmsg uintptr } -type Fts5Config = TFts5Config - -type TFts5TokenizerConfig = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig = TFts5TokenizerConfig - -type TFts5TokenizerConfig1 = struct { - FpTok uintptr - FpApi2 uintptr - FpApi1 uintptr - FazArg uintptr - FnArg int32 - FePattern int32 - FpLocale uintptr - FnLocale int32 -} - -type Fts5TokenizerConfig1 = TFts5TokenizerConfig1 - -/* -** An instance of the following structure encodes all information that can -** be gleaned from the CREATE VIRTUAL TABLE statement. -** -** And all information loaded from the %_config table. -** -** nAutomerge: -** The minimum number of segments that an auto-merge operation should -** attempt to merge together. A value of 1 sets the object to use the -** compile time default. Zero disables auto-merge altogether. -** -** bContentlessDelete: -** True if the contentless_delete option was present in the CREATE -** VIRTUAL TABLE statement. -** -** zContent: -** -** zContentRowid: -** The value of the content_rowid= option, if one was specified. Or -** the string "rowid" otherwise. This text is not quoted - if it is -** used as part of an SQL statement it needs to be quoted appropriately. -** -** zContentExprlist: -** -** pzErrmsg: -** This exists in order to allow the fts5_index.c module to return a -** decent error message if it encounters a file-format version it does -** not understand. -** -** bColumnsize: -** True if the %_docsize table is created. -** -** bPrefixIndex: -** This is only used for debugging. If set to false, any prefix indexes -** are ignored. This value is configured using: -** -** INSERT INTO tbl(tbl, rank) VALUES('prefix-index', $bPrefixIndex); -** -** bLocale: -** Set to true if locale=1 was specified when the table was created. - */ -type TFts5Config1 = struct { - Fdb uintptr - FpGlobal uintptr - FzDb uintptr - FzName uintptr - FnCol int32 - FazCol uintptr - FabUnindexed uintptr - FnPrefix int32 - FaPrefix uintptr - FeContent int32 - FbContentlessDelete int32 - FbContentlessUnindexed int32 - FzContent uintptr - FzContentRowid uintptr - FbColumnsize int32 - FbTokendata int32 - FbLocale int32 - FeDetail int32 - FzContentExprlist uintptr - Ft TFts5TokenizerConfig - FbLock int32 - FiVersion int32 - FiCookie int32 - Fpgsz int32 - FnAutomerge int32 - FnCrisisMerge int32 - FnUsermerge int32 - FnHashSize int32 - FzRank uintptr - FzRankArgs uintptr - FbSecureDelete int32 - FnDeleteMerge int32 - FbPrefixInsttoken int32 - FpzErrmsg uintptr -} - -type Fts5Config1 = TFts5Config1 +type Fts5Config = TFts5Config + +type TFts5TokenizerConfig = struct { + FpTok uintptr + FpApi2 uintptr + FpApi1 uintptr + FazArg uintptr + FnArg int32 + FePattern int32 + FpLocale uintptr + FnLocale int32 +} + +type Fts5TokenizerConfig = TFts5TokenizerConfig /* ** End of interface to code in fts5_config.c. @@ -272977,14 +263942,6 @@ type TFts5Buffer = struct { type Fts5Buffer = TFts5Buffer -type TFts5Buffer1 = struct { - Fp uintptr - Fn int32 - FnSpace int32 -} - -type Fts5Buffer1 = TFts5Buffer1 - type TFts5PoslistReader = struct { F__ccgo_align [0]uint32 Fa uintptr @@ -272998,19 +263955,6 @@ type TFts5PoslistReader = struct { type Fts5PoslistReader = TFts5PoslistReader -type TFts5PoslistReader1 = struct { - F__ccgo_align [0]uint32 - Fa uintptr - Fn int32 - Fi int32 - FbFlag Tu8 - FbEof Tu8 - F__ccgo_align5 [2]byte - FiPos Ti64 -} - -type Fts5PoslistReader1 = TFts5PoslistReader1 - type TFts5PoslistWriter = struct { F__ccgo_align [0]uint32 FiPrev Ti64 @@ -273018,13 +263962,6 @@ type TFts5PoslistWriter = struct { type Fts5PoslistWriter = TFts5PoslistWriter -type TFts5PoslistWriter1 = struct { - F__ccgo_align [0]uint32 - FiPrev Ti64 -} - -type Fts5PoslistWriter1 = TFts5PoslistWriter1 - // C documentation // // /* Bucket of terms object used by the integrity-check in offsets=0 mode. */ @@ -273086,17 +264023,6 @@ type TFts5IndexIter = struct { type Fts5IndexIter = TFts5IndexIter -type TFts5IndexIter1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FpData uintptr - FnData int32 - FbEof Tu8 - F__ccgo_pad4 [7]byte -} - -type Fts5IndexIter1 = TFts5IndexIter1 - /* ** End of interface to code in fts5_varint.c. **************************************************************************/ @@ -273118,14 +264044,6 @@ type TFts5Table = struct { type Fts5Table = TFts5Table -type TFts5Table1 = struct { - Fbase Tsqlite3_vtab - FpConfig uintptr - FpIndex uintptr -} - -type Fts5Table1 = TFts5Table1 - /* ** End of interface to code in fts5.c. **************************************************************************/ @@ -273200,8 +264118,6 @@ type TFts5ExprNode = struct { FiRowid Ti64 FpNear uintptr FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte } type Fts5ExprNode = TFts5ExprNode @@ -273229,27 +264145,18 @@ type TFts5ExprPhrase = struct { FpNode uintptr Fposlist TFts5Buffer FnTerm int32 - FaTerm [1]TFts5ExprTerm } type Fts5ExprPhrase = TFts5ExprPhrase type TFts5ExprNearset = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr + FnNear int32 + FpColset uintptr + FnPhrase int32 } type Fts5ExprNearset = TFts5ExprNearset -type TFts5Token1 = struct { - Fp uintptr - Fn int32 -} - -type Fts5Token1 = TFts5Token1 - type TFts5PoslistPopulator = struct { F__ccgo_align [0]uint32 Fwriter TFts5PoslistWriter @@ -273281,7 +264188,7 @@ type Fts5PoslistPopulator = TFts5PoslistPopulator ** ** The "lemon" program processes an LALR(1) input grammar file, then uses ** this template to construct a parser. The "lemon" program inserts text -** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the +** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the ** interstitial "-" characters) contained in this template is changed into ** the value of the %name directive from the grammar. Otherwise, the content ** of this template is copied straight through into the generate parser @@ -273817,14 +264724,6 @@ var _fts5yy_default = [35]uint8{ ** actually contains the reduce action for the second half of the ** SHIFTREDUCE. */ -type Tfts5yyStackEntry1 = struct { - Fstateno uint8 - Fmajor uint8 - Fminor Tfts5YYMINORTYPE -} - -type fts5yyStackEntry1 = Tfts5yyStackEntry1 - type Tfts5yyStackEntry = struct { Fstateno uint8 Fmajor uint8 @@ -273835,16 +264734,6 @@ type fts5yyStackEntry = Tfts5yyStackEntry /* The state of the parser is completely contained in an instance of ** the following structure */ -type Tfts5yyParser1 = struct { - Ffts5yytos uintptr - FpParse uintptr - Ffts5yystackEnd uintptr - Ffts5yystack uintptr - Ffts5yystk0 [100]Tfts5yyStackEntry -} - -type fts5yyParser1 = Tfts5yyParser1 - type Tfts5yyParser = struct { Ffts5yytos uintptr FpParse uintptr @@ -273896,10 +264785,10 @@ func _sqlite3Fts5ParserInit(tls *libc.TLS, fts5yypRawParser uintptr) { // ** A pointer to a parser. This pointer is used in subsequent calls // ** to sqlite3Fts5Parser and sqlite3Fts5ParserFree. // */ -func _sqlite3Fts5ParserAlloc(tls *libc.TLS, mallocProc uintptr) (r uintptr) { +func _sqlite3Fts5ParserAlloc(tls *libc.TLS, __ccgo_fp_mallocProc uintptr) (r uintptr) { var fts5yypParser uintptr _ = fts5yypParser - fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{mallocProc})))(tls, libc.Uint64FromInt64(1216)) + fts5yypParser = (*(*func(*libc.TLS, Tu64) uintptr)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_mallocProc})))(tls, libc.Uint64FromInt64(1216)) if fts5yypParser != 0 { _sqlite3Fts5ParserInit(tls, fts5yypParser) } @@ -274005,12 +264894,12 @@ func _sqlite3Fts5ParserFinalize(tls *libc.TLS, p uintptr) { // ** is defined in a %include section of the input grammar) then it is // ** assumed that the input pointer is never NULL. // */ -func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, freeProc uintptr) { +func _sqlite3Fts5ParserFree(tls *libc.TLS, p uintptr, __ccgo_fp_freeProc uintptr) { if p == uintptr(0) { return } _sqlite3Fts5ParserFinalize(tls, p) - (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{freeProc})))(tls, p) + (*(*func(*libc.TLS, uintptr))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_freeProc})))(tls, p) } /* @@ -274085,7 +264974,7 @@ func _fts5yyStackOverflow(tls *libc.TLS, fts5yypParser uintptr) { /* Here code is inserted which will execute if the parser ** stack every overflows */ /******** Begin %stack_overflow code ******************************************/ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36325, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36523, 0) /******** End %stack_overflow code ********************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument var */ } @@ -274441,7 +265330,7 @@ func _fts5yy_syntax_error(tls *libc.TLS, fts5yypParser uintptr, fts5yymajor int3 pParse = (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse /************ Begin %syntax_error code ****************************************/ _ = fts5yymajor /* Silence a compiler warning */ - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36353, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36551, libc.VaList(bp+8, fts5yyminor.Fn, fts5yyminor.Fp)) /************ End %syntax_error code ******************************************/ (*Tfts5yyParser)(unsafe.Pointer(fts5yypParser)).FpParse = pParse /* Suppress warning about unused %extra_argument variable */ } @@ -274602,18 +265491,6 @@ type TCInstIter = struct { type CInstIter = TCInstIter -type TCInstIter1 = struct { - FpApi uintptr - FpFts uintptr - FiCol int32 - FiInst int32 - FnInst int32 - FiStart int32 - FiEnd int32 -} - -type CInstIter1 = TCInstIter1 - // C documentation // // /* @@ -274696,22 +265573,6 @@ type THighlightContext = struct { type HighlightContext = THighlightContext -type THighlightContext1 = struct { - FiRangeStart int32 - FiRangeEnd int32 - FzOpen uintptr - FzClose uintptr - FzIn uintptr - FnIn int32 - Fiter TCInstIter - FiPos int32 - FiOff int32 - FbOpen int32 - FzOut uintptr -} - -type HighlightContext1 = THighlightContext1 - // C documentation // // /* @@ -274730,7 +265591,7 @@ func _fts5HighlightAppend(tls *libc.TLS, pRc uintptr, p uintptr, z uintptr, n in if n < 0 { n = int32(libc.Xstrlen(tls, z)) } - (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+36384, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) + (*THighlightContext)(unsafe.Pointer(p)).FzOut = Xsqlite3_mprintf(tls, __ccgo_ts+36582, libc.VaList(bp+8, (*THighlightContext)(unsafe.Pointer(p)).FzOut, n, z)) if (*THighlightContext)(unsafe.Pointer(p)).FzOut == uintptr(0) { *(*int32)(unsafe.Pointer(pRc)) = int32(SQLITE_NOMEM) } @@ -274829,7 +265690,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint var _ /* rc at bp+68 */ int32 _, _ = iCol, zErr if nVal != int32(3) { - zErr = __ccgo_ts + 36391 + zErr = __ccgo_ts + 36589 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -274840,7 +265701,7 @@ func _fts5HighlightFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint (*(*THighlightContext)(unsafe.Pointer(bp))).FiRangeEnd = -int32(1) *(*int32)(unsafe.Pointer(bp + 68)) = (*(*func(*libc.TLS, uintptr, int32, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TFts5ExtensionApi)(unsafe.Pointer(pApi)).FxColumnText})))(tls, pFts, iCol, bp+16, bp+20) if *(*int32)(unsafe.Pointer(bp + 68)) == int32(SQLITE_RANGE) { - Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1673, -int32(1), libc.UintptrFromInt32(0)) + Xsqlite3_result_text(tls, pCtx, __ccgo_ts+1674, -int32(1), libc.UintptrFromInt32(0)) *(*int32)(unsafe.Pointer(bp + 68)) = SQLITE_OK } else { if (*(*THighlightContext)(unsafe.Pointer(bp))).FzIn != 0 { @@ -274889,16 +265750,6 @@ type TFts5SFinder = struct { type Fts5SFinder = TFts5SFinder -type TFts5SFinder1 = struct { - FiPos int32 - FnFirstAlloc int32 - FnFirst int32 - FaFirst uintptr - FzDoc uintptr -} - -type Fts5SFinder1 = TFts5SFinder1 - // C documentation // // /* @@ -275046,7 +265897,7 @@ func _fts5ValueToText(tls *libc.TLS, pVal uintptr) (r uintptr) { if zRet != 0 { v1 = zRet } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } return v1 } @@ -275084,7 +265935,7 @@ func _fts5SnippetFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintpt nBestScore = 0 /* Score of best snippet */ *(*int32)(unsafe.Pointer(bp + 76)) = 0 if nVal != int32(5) { - zErr = __ccgo_ts + 36441 + zErr = __ccgo_ts + 36639 Xsqlite3_result_error(tls, pCtx, zErr, -int32(1)) return } @@ -275268,17 +266119,6 @@ type TFts5Bm25Data = struct { type Fts5Bm25Data = TFts5Bm25Data -type TFts5Bm25Data1 = struct { - F__ccgo_align [0]uint32 - FnPhrase int32 - F__ccgo_align1 [4]byte - Favgdl float64 - FaIDF uintptr - FaFreq uintptr -} - -type Fts5Bm25Data1 = TFts5Bm25Data1 - // C documentation // // /* @@ -275359,7 +266199,7 @@ func _fts5Bm25GetData(tls *libc.TLS, pApi uintptr, pFts uintptr, ppData uintptr) ** under consideration. ** ** The problem with this is that if (N < 2*nHit), the IDF is - ** negative. Which is undesirable. So the mimimum allowable IDF is + ** negative. Which is undesirable. So the minimum allowable IDF is ** (1e-6) - roughly the same as a term that appears in just over ** half of set of 5,000,000 documents. */ idf = libc.Xlog(tls, (float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp))-*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))/(float64(*(*Tsqlite3_int64)(unsafe.Pointer(bp + 16)))+float64(0.5))) @@ -275451,13 +266291,13 @@ func _fts5Bm25Function(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uintptr, if !(i < (*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FnPhrase) { break } - score += *(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) * (k1 + libc.Float64FromFloat64(1)) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + k1*(libc.Float64FromInt32(1)-b+b*D/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))) + score += float64(*(*float64)(unsafe.Pointer((*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).FaIDF + uintptr(i)*8)) * (float64(*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8))*(k1+libc.Float64FromFloat64(1))) / (*(*float64)(unsafe.Pointer(aFreq + uintptr(i)*8)) + float64(k1*(libc.Float64FromInt32(1)-b+float64(b*D)/(*TFts5Bm25Data)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp)))).Favgdl))))) goto _3 _3: ; i++ } - Xsqlite3_result_double(tls, pCtx, -libc.Float64FromFloat64(1)*score) + Xsqlite3_result_double(tls, pCtx, float64(-libc.Float64FromFloat64(1)*score)) } else { Xsqlite3_result_error_code(tls, pCtx, rc) } @@ -275483,13 +266323,13 @@ func _fts5GetLocaleFunction(tls *libc.TLS, pApi uintptr, pFts uintptr, pCtx uint *(*int32)(unsafe.Pointer(bp + 4)) = 0 /* xColumnLocale() must be available */ if nVal != int32(1) { - z = __ccgo_ts + 36489 + z = __ccgo_ts + 36687 Xsqlite3_result_error(tls, pCtx, z, -int32(1)) return } eType = Xsqlite3_value_numeric_type(tls, *(*uintptr)(unsafe.Pointer(apVal))) if eType != int32(SQLITE_INTEGER) { - z1 = __ccgo_ts + 36545 + z1 = __ccgo_ts + 36743 Xsqlite3_result_error(tls, pCtx, z1, -int32(1)) return } @@ -275522,19 +266362,19 @@ func _sqlite3Fts5AuxInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDestroy uintptr }{ 0: { - FzFunc: __ccgo_ts + 36603, + FzFunc: __ccgo_ts + 36801, FxFunc: __ccgo_fp(_fts5SnippetFunction), }, 1: { - FzFunc: __ccgo_ts + 36611, + FzFunc: __ccgo_ts + 36809, FxFunc: __ccgo_fp(_fts5HighlightFunction), }, 2: { - FzFunc: __ccgo_ts + 36621, + FzFunc: __ccgo_ts + 36819, FxFunc: __ccgo_fp(_fts5Bm25Function), }, 3: { - FzFunc: __ccgo_ts + 36626, + FzFunc: __ccgo_ts + 36824, FxFunc: __ccgo_fp(_fts5GetLocaleFunction), }, } @@ -275922,7 +266762,7 @@ func _sqlite3Fts5Strndup(tls *libc.TLS, pRc uintptr, pIn uintptr, nIn int32) (r // ** * The 52 upper and lower case ASCII characters, and // ** * The 10 integer ASCII characters. // ** * The underscore character "_" (0x5F). -// ** * The unicode "subsitute" character (0x1A). +// ** * The unicode "substitute" character (0x1A). // */ func _sqlite3Fts5IsBareword(tls *libc.TLS, t int8) (r int32) { var aBareword [128]Tu8 @@ -276009,21 +266849,6 @@ type TFts5TermsetEntry = struct { type Fts5TermsetEntry = TFts5TermsetEntry -type TFts5TermsetEntry1 = struct { - FpTerm uintptr - FnTerm int32 - FiIdx int32 - FpNext uintptr -} - -type Fts5TermsetEntry1 = TFts5TermsetEntry1 - -type TFts5Termset1 = struct { - FapHash [512]uintptr -} - -type Fts5Termset1 = TFts5Termset1 - func _sqlite3Fts5TermsetNew(tls *libc.TLS, pp uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) @@ -276194,7 +267019,7 @@ func _fts5ConfigSkipLiteral(tls *libc.TLS, pIn uintptr) (r uintptr) { case int32('n'): fallthrough case int32('N'): - if Xsqlite3_strnicmp(tls, __ccgo_ts+1659, p, int32(4)) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+1660, p, int32(4)) == 0 { p = p + 4 } else { p = uintptr(0) @@ -276332,13 +267157,6 @@ func _sqlite3Fts5Dequote(tls *libc.TLS, z uintptr) { } } -type TFts5Enum1 = struct { - FzName uintptr - FeVal int32 -} - -type Fts5Enum1 = TFts5Enum1 - type TFts5Enum = struct { FzName uintptr FeVal int32 @@ -276398,7 +267216,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg _, _, _, _, _, _, _, _, _, _, _ = azArg, bFirst, nArg, nByte, nCmd, nPre, p, p1, p2, pSpace, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK nCmd = int32(libc.Xstrlen(tls, zCmd)) - if Xsqlite3_strnicmp(tls, __ccgo_ts+36642, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36840, zCmd, nCmd) == 0 { nByte = int32(libc.Uint32FromInt64(4) * libc.Uint32FromInt32(FTS5_MAX_PREFIX_INDEXES)) bFirst = int32(1) if (*TFts5Config)(unsafe.Pointer(pConfig)).FaPrefix == uintptr(0) { @@ -276424,12 +267242,12 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } } if int32(*(*int8)(unsafe.Pointer(p))) < int32('0') || int32(*(*int8)(unsafe.Pointer(p))) > int32('9') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36649, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36847, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FnPrefix == int32(FTS5_MAX_PREFIX_INDEXES) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36680, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36878, libc.VaList(bp+48, int32(FTS5_MAX_PREFIX_INDEXES))) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -276438,7 +267256,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg p++ } if nPre <= 0 || nPre >= int32(1000) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36713, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36911, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) break } @@ -276448,14 +267266,14 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36750, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+36948, zCmd, nCmd) == 0 { p1 = zArg nArg = int64(libc.Xstrlen(tls, zArg) + uint32(1)) azArg = _sqlite3Fts5MallocZero(tls, bp, int64(libc.Uint32FromInt64(4)+libc.Uint32FromInt32(2))*nArg) if azArg != 0 { pSpace = azArg + uintptr(nArg)*4 if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36759, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36957, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { nArg = 0 @@ -276482,7 +267300,7 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg nArg++ } if p1 == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36792, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36990, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FazArg = azArg @@ -276494,76 +267312,76 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg Xsqlite3_free(tls, azArg) return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36826, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37024, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent != FTS5_CONTENT_NORMAL { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36834, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37032, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if *(*int8)(unsafe.Pointer(zArg)) != 0 { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_EXTERNAL) - (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+36866, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) + (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37064, libc.VaList(bp+48, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, zArg)) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent = int32(FTS5_CONTENT_NONE) } } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36872, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37070, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36891, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37089, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36934, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37132, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36891, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37089, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessUnindexed = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+36956, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37154, zCmd, nCmd) == 0 { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+36970, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37168, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, zArg, -int32(1)) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37008, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37206, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37019, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37217, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37054, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37252, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37061, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37259, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+6889, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+6977, zCmd, nCmd) == 0 { *(*[4]TFts5Enum)(unsafe.Pointer(bp + 4)) = [4]TFts5Enum{ 0: { - FzName: __ccgo_ts + 9714, + FzName: __ccgo_ts + 9801, FeVal: int32(FTS5_DETAIL_NONE), }, 1: { - FzName: __ccgo_ts + 19225, + FzName: __ccgo_ts + 19388, }, 2: { - FzName: __ccgo_ts + 37092, + FzName: __ccgo_ts + 37290, FeVal: int32(FTS5_DETAIL_COLUMNS), }, 3: {}, @@ -276571,20 +267389,20 @@ func _fts5ConfigParseSpecial(tls *libc.TLS, pConfig uintptr, zCmd uintptr, zArg v2 = _fts5ConfigSetEnum(tls, bp+4, zArg, pConfig+68) *(*int32)(unsafe.Pointer(bp)) = v2 if v2 != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37100, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37298, 0) } return *(*int32)(unsafe.Pointer(bp)) } - if Xsqlite3_strnicmp(tls, __ccgo_ts+37131, zCmd, nCmd) == 0 { + if Xsqlite3_strnicmp(tls, __ccgo_ts+37329, zCmd, nCmd) == 0 { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || int32(*(*int8)(unsafe.Pointer(zArg + 1))) != int32('\000') { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37141, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37339, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FbTokendata = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('1')) } return *(*int32)(unsafe.Pointer(bp)) } - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37175, libc.VaList(bp+48, nCmd, zCmd)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37373, libc.VaList(bp+48, nCmd, zCmd)) return int32(SQLITE_ERROR) } @@ -276645,16 +267463,16 @@ func _fts5ConfigParseColumn(tls *libc.TLS, p uintptr, zCol uintptr, zArg uintptr var v2 uintptr _, _, _ = rc, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+37203) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18161) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37208, libc.VaList(bp+8, zCol)) + if 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+37401) || 0 == Xsqlite3_stricmp(tls, zCol, __ccgo_ts+18324) { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37406, libc.VaList(bp+8, zCol)) rc = int32(SQLITE_ERROR) } else { if zArg != 0 { - if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37238) { + if 0 == Xsqlite3_stricmp(tls, zArg, __ccgo_ts+37436) { *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr((*TFts5Config)(unsafe.Pointer(p)).FnCol))) = uint8(1) *(*int32)(unsafe.Pointer(pbUnindexed)) = int32(1) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37248, libc.VaList(bp+8, zArg)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37446, libc.VaList(bp+8, zArg)) rc = int32(SQLITE_ERROR) } } @@ -276680,7 +267498,7 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { _ = i *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK *(*TFts5Buffer)(unsafe.Pointer(bp + 4)) = TFts5Buffer{} - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37279, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37477, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(p)).FzContentRowid)) if (*TFts5Config)(unsafe.Pointer(p)).FeContent != int32(FTS5_CONTENT_NONE) { i = 0 for { @@ -276688,12 +267506,12 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if (*TFts5Config)(unsafe.Pointer(p)).FeContent == int32(FTS5_CONTENT_EXTERNAL) { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37284, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37482, libc.VaList(bp+24, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FazCol + uintptr(i)*4)))) } else { if (*TFts5Config)(unsafe.Pointer(p)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i))) != 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37291, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37489, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37299, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37497, 0) } } goto _1 @@ -276709,9 +267527,9 @@ func _fts5ConfigMakeExprlist(tls *libc.TLS, p uintptr) (r int32) { break } if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(p)).FabUnindexed + uintptr(i)))) == 0 { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37306, libc.VaList(bp+24, i)) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37504, libc.VaList(bp+24, i)) } else { - _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37299, 0) + _sqlite3Fts5BufferAppendPrintf(tls, bp, bp+4, __ccgo_ts+37497, 0) } goto _2 _2: @@ -276774,8 +267592,8 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in (*TFts5Config)(unsafe.Pointer(pRet)).FzName = _sqlite3Fts5Strndup(tls, bp, *(*uintptr)(unsafe.Pointer(azArg + 2*4)), -int32(1)) (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize = int32(1) (*TFts5Config)(unsafe.Pointer(pRet)).FeDetail = FTS5_DETAIL_FULL - if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+37203) == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37314, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) + if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && Xsqlite3_stricmp(tls, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, __ccgo_ts+37401) == 0 { + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37512, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzName)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } i = int32(3) @@ -276806,19 +267624,19 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { if z == uintptr(0) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37343, libc.VaList(bp+32, zOrig)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37541, libc.VaList(bp+32, zOrig)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bOption != 0 { if *(*uintptr)(unsafe.Pointer(bp + 8)) != 0 { v4 = *(*uintptr)(unsafe.Pointer(bp + 8)) } else { - v4 = __ccgo_ts + 1673 + v4 = __ccgo_ts + 1674 } if *(*uintptr)(unsafe.Pointer(bp + 12)) != 0 { v5 = *(*uintptr)(unsafe.Pointer(bp + 12)) } else { - v5 = __ccgo_ts + 1673 + v5 = __ccgo_ts + 1674 } *(*int32)(unsafe.Pointer(bp)) = _fts5ConfigParseSpecial(tls, pRet, v4, v5, pzErr) } else { @@ -276836,7 +267654,7 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in } /* We only allow contentless_delete=1 if the table is indeed contentless. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37363, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37561, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_delete=1 if columnsize=0 is not present. @@ -276844,37 +267662,37 @@ func _sqlite3Fts5ConfigParse(tls *libc.TLS, pGlobal uintptr, db uintptr, nArg in ** This restriction may be removed at some point. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessDelete != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37413, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37611, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* We only allow contentless_unindexed=1 if the table is actually a ** contentless one. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FeContent != int32(FTS5_CONTENT_NONE) { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37468, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+37666, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } /* If no zContent option was specified, fill in the default values. */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContent == uintptr(0) { zTail = uintptr(0) if (*TFts5Config)(unsafe.Pointer(pRet)).FeContent == FTS5_CONTENT_NORMAL { - zTail = __ccgo_ts + 36826 + zTail = __ccgo_ts + 37024 } else { if *(*int32)(unsafe.Pointer(bp + 4)) != 0 && (*TFts5Config)(unsafe.Pointer(pRet)).FbContentlessUnindexed != 0 { (*TFts5Config)(unsafe.Pointer(pRet)).FeContent = int32(FTS5_CONTENT_UNINDEXED) - zTail = __ccgo_ts + 36826 + zTail = __ccgo_ts + 37024 } else { if (*TFts5Config)(unsafe.Pointer(pRet)).FbColumnsize != 0 { - zTail = __ccgo_ts + 37521 + zTail = __ccgo_ts + 37719 } } } if zTail != 0 { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37529, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContent = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37727, libc.VaList(bp+32, (*TFts5Config)(unsafe.Pointer(pRet)).FzDb, (*TFts5Config)(unsafe.Pointer(pRet)).FzName, zTail)) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid == uintptr(0) { - (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+18161, -int32(1)) + (*TFts5Config)(unsafe.Pointer(pRet)).FzContentRowid = _sqlite3Fts5Strndup(tls, bp, __ccgo_ts+18324, -int32(1)) } /* Formulate the zContentExprlist text */ if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { @@ -276943,25 +267761,25 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { var _ /* rc at bp+0 */ int32 _, _, _, _ = i, zSep, zSql, v2 *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37540, 0) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37738, 0) i = 0 for { if !(zSql != 0 && i < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) { break } if i == 0 { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } else { - v2 = __ccgo_ts + 16459 + v2 = __ccgo_ts + 16575 } zSep = v2 - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37556, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37754, libc.VaList(bp+16, zSql, zSep, *(*uintptr)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FazCol + uintptr(i)*4)))) goto _1 _1: ; i++ } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37563, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37203)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+37761, libc.VaList(bp+16, zSql, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, __ccgo_ts+37401)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql) Xsqlite3_free(tls, zSql) @@ -276994,7 +267812,7 @@ func _sqlite3Fts5ConfigDeclareVtab(tls *libc.TLS, pConfig uintptr) (r int32) { // ** because the callback returned another non-zero value, it is assumed // ** to be an SQLite error code and returned to the caller. // */ -func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, xToken uintptr) (r int32) { +func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uintptr, nText int32, pCtx uintptr, __ccgo_fp_xToken uintptr) (r int32) { var rc int32 _ = rc rc = SQLITE_OK @@ -277004,9 +267822,9 @@ func _sqlite3Fts5Tokenize(tls *libc.TLS, pConfig uintptr, flags int32, pText uin } if rc == SQLITE_OK { if (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1 != 0 { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi1)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, __ccgo_fp_xToken) } else { - rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, xToken) + rc = (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_tokenizer_v2)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpApi2)).FxTokenize})))(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpTok, pCtx, flags, pText, nText, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FpLocale, (*TFts5Config)(unsafe.Pointer(pConfig)).Ft.FnLocale, __ccgo_fp_xToken) } } } @@ -277119,7 +267937,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV var _ /* zRankArgs at bp+4 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _ = bVal, bVal1, nAutomerge, nCrisisMerge, nHashSize, nUsermerge, nVal, pgsz, rc, zIn, v1, v2 rc = SQLITE_OK - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37589) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37787) { pgsz = 0 if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { pgsz = Xsqlite3_value_int(tls, pVal) @@ -277130,7 +267948,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).Fpgsz = pgsz } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37594) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37792) { nHashSize = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nHashSize = Xsqlite3_value_int(tls, pVal) @@ -277141,7 +267959,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnHashSize = nHashSize } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37603) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37801) { nAutomerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nAutomerge = Xsqlite3_value_int(tls, pVal) @@ -277155,7 +267973,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnAutomerge = nAutomerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37613) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37811) { nUsermerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nUsermerge = Xsqlite3_value_int(tls, pVal) @@ -277166,7 +267984,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnUsermerge = nUsermerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37623) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37821) { nCrisisMerge = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nCrisisMerge = Xsqlite3_value_int(tls, pVal) @@ -277183,7 +268001,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FnCrisisMerge = nCrisisMerge } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37635) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37833) { nVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { nVal = Xsqlite3_value_int(tls, pVal) @@ -277198,7 +268016,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } (*TFts5Config)(unsafe.Pointer(pConfig)).FnDeleteMerge = nVal } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37203) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37401) { zIn = Xsqlite3_value_text(tls, pVal) rc = _sqlite3Fts5ConfigParseRank(tls, zIn, bp, bp+4) if rc == SQLITE_OK { @@ -277213,7 +268031,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV } } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37647) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37845) { bVal = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal = Xsqlite3_value_int(tls, pVal) @@ -277229,7 +268047,7 @@ func _sqlite3Fts5ConfigSetValue(tls *libc.TLS, pConfig uintptr, zKey uintptr, pV (*TFts5Config)(unsafe.Pointer(pConfig)).FbSecureDelete = v1 } } else { - if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37661) { + if 0 == Xsqlite3_stricmp(tls, zKey, __ccgo_ts+37859) { bVal1 = -int32(1) if int32(SQLITE_INTEGER) == Xsqlite3_value_numeric_type(tls, pVal) { bVal1 = Xsqlite3_value_int(tls, pVal) @@ -277272,7 +268090,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in var _ /* p at bp+0 */ uintptr var _ /* rc at bp+4 */ int32 _, _, _, _, _ = iVersion, pVal, zK, zSelect, zSql - zSelect = __ccgo_ts + 37671 + zSelect = __ccgo_ts + 37869 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 4)) = SQLITE_OK iVersion = 0 @@ -277292,7 +268110,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in for int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { zK = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), 0) pVal = Xsqlite3_column_value(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) - if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+37703) { + if 0 == Xsqlite3_stricmp(tls, zK, __ccgo_ts+37901) { iVersion = Xsqlite3_value_int(tls, pVal) } else { *(*int32)(unsafe.Pointer(bp + 8)) = 0 @@ -277303,7 +268121,7 @@ func _sqlite3Fts5ConfigLoad(tls *libc.TLS, pConfig uintptr, iCookie int32) (r in } if *(*int32)(unsafe.Pointer(bp + 4)) == SQLITE_OK && iVersion != int32(FTS5_CURRENT_VERSION) && iVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { *(*int32)(unsafe.Pointer(bp + 4)) = int32(SQLITE_ERROR) - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+37711, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+37909, libc.VaList(bp+24, iVersion, int32(FTS5_CURRENT_VERSION), int32(FTS5_CURRENT_VERSION_SECUREDELETE))) } else { (*TFts5Config)(unsafe.Pointer(pConfig)).FiVersion = iVersion } @@ -277368,115 +268186,6 @@ type TFts5ExprTerm = struct { type Fts5ExprTerm = TFts5ExprTerm -type TFts5Expr1 = struct { - FpIndex uintptr - FpConfig uintptr - FpRoot uintptr - FbDesc int32 - FnPhrase int32 - FapExprPhrase uintptr -} - -type Fts5Expr1 = TFts5Expr1 - -/* -** eType: -** Expression node type. Usually one of: -** -** FTS5_AND (nChild, apChild valid) -** FTS5_OR (nChild, apChild valid) -** FTS5_NOT (nChild, apChild valid) -** FTS5_STRING (pNear valid) -** FTS5_TERM (pNear valid) -** -** An expression node with eType==0 may also exist. It always matches zero -** rows. This is created when a phrase containing no tokens is parsed. -** e.g. "". -** -** iHeight: -** Distance from this node to furthest leaf. This is always 0 for nodes -** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one -** greater than the largest child value. - */ -type TFts5ExprNode1 = struct { - F__ccgo_align [0]uint32 - FeType int32 - FbEof int32 - FbNomatch int32 - FiHeight int32 - FxNext uintptr - F__ccgo_align5 [4]byte - FiRowid Ti64 - FpNear uintptr - FnChild int32 - FapChild [1]uintptr - F__ccgo_pad9 [4]byte -} - -type Fts5ExprNode1 = TFts5ExprNode1 - -/* -** Invoke the xNext method of an Fts5ExprNode object. This macro should be -** used as if it has the same signature as the xNext() methods themselves. - */ - -/* -** An instance of the following structure represents a single search term -** or term prefix. - */ -type TFts5ExprTerm1 = struct { - FbPrefix Tu8 - FbFirst Tu8 - FpTerm uintptr - FnQueryTerm int32 - FnFullTerm int32 - FpIter uintptr - FpSynonym uintptr -} - -type Fts5ExprTerm1 = TFts5ExprTerm1 - -/* -** A phrase. One or more terms that must appear in a contiguous sequence -** within a document for it to match. - */ -type TFts5ExprPhrase1 = struct { - FpNode uintptr - Fposlist TFts5Buffer - FnTerm int32 - FaTerm [1]TFts5ExprTerm -} - -type Fts5ExprPhrase1 = TFts5ExprPhrase1 - -/* -** One or more phrases that must appear within a certain token distance of -** each other within each matching document. - */ -type TFts5ExprNearset1 = struct { - FnNear int32 - FpColset uintptr - FnPhrase int32 - FapPhrase [1]uintptr -} - -type Fts5ExprNearset1 = TFts5ExprNearset1 - -/* -** Parse context. - */ -type TFts5Parse1 = struct { - FpConfig uintptr - FzErr uintptr - Frc int32 - FnPhrase int32 - FapPhrase uintptr - FpExpr uintptr - FbPhraseToAnd int32 -} - -type Fts5Parse1 = TFts5Parse1 - /* ** Check that the Fts5ExprNode.iHeight variables are set correctly in ** the expression tree passed as the only argument. @@ -277552,7 +268261,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr } } if int32(*(*int8)(unsafe.Pointer(z2))) == int32('\000') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37782, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37980, 0) return FTS5_EOF } goto _1 @@ -277563,7 +268272,7 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z2) - int32(z) default: if _sqlite3Fts5IsBareword(tls, *(*int8)(unsafe.Pointer(z))) == 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37802, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38000, libc.VaList(bp+8, z)) return FTS5_EOF } tok = int32(FTS5_STRING) @@ -277578,13 +268287,13 @@ func _fts5ExprGetToken(tls *libc.TLS, pParse uintptr, pz uintptr, pToken uintptr z21++ } (*TFts5Token)(unsafe.Pointer(pToken)).Fn = int32(z21) - int32(z) - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37833, uint32(2)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(2) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38031, uint32(2)) == 0 { tok = int32(FTS5_OR) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+37836, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+38034, uint32(3)) == 0 { tok = int32(FTS5_NOT) } - if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+32297, uint32(3)) == 0 { + if (*TFts5Token)(unsafe.Pointer(pToken)).Fn == int32(3) && libc.Xmemcmp(tls, (*TFts5Token)(unsafe.Pointer(pToken)).Fp, __ccgo_ts+32443, uint32(3)) == 0 { tok = int32(FTS5_AND) } break @@ -277628,7 +268337,7 @@ func _sqlite3Fts5ExprNew(tls *libc.TLS, pConfig uintptr, bPhraseToAnd int32, iCo /* If the LHS of the MATCH expression was a user column, apply the ** implicit column-filter. */ if (*(*TFts5Parse)(unsafe.Pointer(bp))).Frc == SQLITE_OK && iCol < (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - n = int32(8) + n = int32(libc.Uint32FromInt64(8) * uint32((libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp+8, int64(n)) if pColset != 0 { (*TFts5Colset)(unsafe.Pointer(pColset)).FnCol = int32(1) @@ -278163,18 +268872,6 @@ type TFts5LookaheadReader = struct { type Fts5LookaheadReader = TFts5LookaheadReader -type TFts5LookaheadReader1 = struct { - F__ccgo_align [0]uint32 - Fa uintptr - Fn int32 - Fi int32 - F__ccgo_align3 [4]byte - FiPos Ti64 - FiLookahead Ti64 -} - -type Fts5LookaheadReader1 = TFts5LookaheadReader1 - func _fts5LookaheadReaderNext(tls *libc.TLS, p uintptr) (r int32) { (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiPos = (*TFts5LookaheadReader)(unsafe.Pointer(p)).FiLookahead if _sqlite3Fts5PoslistNext64(tls, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fa, (*TFts5LookaheadReader)(unsafe.Pointer(p)).Fn, p+8, p+24) != 0 { @@ -278201,16 +268898,6 @@ type TFts5NearTrimmer = struct { type Fts5NearTrimmer = TFts5NearTrimmer -type TFts5NearTrimmer1 = struct { - F__ccgo_align [0]uint32 - Freader TFts5LookaheadReader - Fwriter TFts5PoslistWriter - FpOut uintptr - F__ccgo_pad3 [4]byte -} - -type Fts5NearTrimmer1 = TFts5NearTrimmer1 - // C documentation // // /* @@ -279275,7 +269962,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr pRet = uintptr(0) if (*TFts5Parse)(unsafe.Pointer(pParse)).Frc == SQLITE_OK { if pNear == uintptr(0) { - nByte = int64(uint32(16) + uint32(SZALLOC)*uint32(4)) + nByte = int64(uint32(libc.UintptrFromInt32(0)+12) + uint32(SZALLOC+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = Xsqlite3_malloc64(tls, uint64(nByte)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -279285,7 +269972,7 @@ func _sqlite3Fts5ParseNearset(tls *libc.TLS, pParse uintptr, pNear uintptr, pPhr } else { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase%SZALLOC == 0 { nNew = (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase + SZALLOC - nByte1 = int64(uint32(16) + uint32(nNew)*uint32(4)) + nByte1 = int64(uint32(libc.UintptrFromInt32(0)+12) + uint32(nNew+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = Xsqlite3_realloc64(tls, pNear, uint64(nByte1)) if pRet == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) @@ -279331,14 +270018,6 @@ type TTokenCtx = struct { type TokenCtx = TTokenCtx -type TTokenCtx1 = struct { - FpPhrase uintptr - FpConfig uintptr - Frc int32 -} - -type TokenCtx1 = TTokenCtx1 - // C documentation // // /* @@ -279391,12 +270070,12 @@ func _fts5ParseTokenize(tls *libc.TLS, pContext uintptr, tflags int32, pToken ui v2 = 0 } nNew = SZALLOC + v2 - pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(44)+uint32(24)*uint32(nNew))) + pNew = Xsqlite3_realloc64(tls, pPhrase, uint64(uint32(libc.UintptrFromInt32(0)+20)+uint32(nNew+libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if pNew == uintptr(0) { *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_NOMEM) } else { if pPhrase == uintptr(0) { - libc.Xmemset(tls, pNew, 0, uint32(44)) + libc.Xmemset(tls, pNew, 0, uint32(libc.UintptrFromInt32(0)+20)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24)) } v3 = pNew pPhrase = v3 @@ -279530,7 +270209,7 @@ func _sqlite3Fts5ParseTerm(tls *libc.TLS, pParse uintptr, pAppend uintptr, pToke if (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase == uintptr(0) { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(44)) + (*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(uint32(libc.UintptrFromInt32(0)+20)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) } else { if (*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm != 0 { (*(*TFts5ExprTerm)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase + 20 + uintptr((*TFts5ExprPhrase)(unsafe.Pointer((*(*TTokenCtx)(unsafe.Pointer(bp))).FpPhrase)).FnTerm-int32(1))*24))).FbPrefix = uint8(bPrefix) @@ -279570,15 +270249,15 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp (*TFts5Expr)(unsafe.Pointer(pNew)).FapExprPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(4)) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(48)) + (*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot = _sqlite3Fts5MallocZero(tls, bp, int64(uint32(libc.UintptrFromInt32(0)+40)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(4))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, int64(libc.Uint32FromInt64(16)+libc.Uint32FromInt64(4))) + (*TFts5ExprNode)(unsafe.Pointer((*TFts5Expr)(unsafe.Pointer(pNew)).FpRoot)).FpNear = _sqlite3Fts5MallocZero(tls, bp, int64(uint32(libc.UintptrFromInt32(0)+12)+uint32(libc.Int32FromInt32(2))*libc.Uint32FromInt64(4))) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && pOrig != uintptr(0) { pColsetOrig = (*TFts5ExprNearset)(unsafe.Pointer((*TFts5ExprNode)(unsafe.Pointer((*TFts5ExprPhrase)(unsafe.Pointer(pOrig)).FpNode)).FpNear)).FpColset if pColsetOrig != 0 { - nByte = int64(uint32(8) + uint32((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = int64(libc.Uint32FromInt64(8) * uint32(((*TFts5Colset)(unsafe.Pointer(pColsetOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pColset = _sqlite3Fts5MallocZero(tls, bp, nByte) if pColset != 0 { libc.Xmemcpy(tls, pColset, pColsetOrig, uint32(nByte)) @@ -279619,7 +270298,7 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp } else { /* This happens when parsing a token or quoted phrase that contains ** no token characters at all. (e.g ... MATCH '""'). */ - (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(44)) + (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase = _sqlite3Fts5MallocZero(tls, bp, int64(uint32(libc.UintptrFromInt32(0)+20)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) } } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK && (*(*TTokenCtx)(unsafe.Pointer(bp + 4))).FpPhrase != 0 { @@ -279657,8 +270336,8 @@ func _sqlite3Fts5ExprClonePhrase(tls *libc.TLS, pExpr uintptr, iPhrase int32, pp func _sqlite3Fts5ParseNear(tls *libc.TLS, pParse uintptr, pTok uintptr) { bp := tls.Alloc(32) defer tls.Free(32) - if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+37840, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36353, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) + if (*TFts5Token)(unsafe.Pointer(pTok)).Fn != int32(4) || libc.Xmemcmp(tls, __ccgo_ts+38038, (*TFts5Token)(unsafe.Pointer(pTok)).Fp, uint32(4)) != 0 { + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+36551, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(pTok)).Fn, (*TFts5Token)(unsafe.Pointer(pTok)).Fp)) } } @@ -279678,10 +270357,13 @@ func _sqlite3Fts5ParseSetDistance(tls *libc.TLS, pParse uintptr, pNear uintptr, } c = *(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i))) if int32(c) < int32('0') || int32(c) > int32('9') { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37845, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38043, libc.VaList(bp+8, (*TFts5Token)(unsafe.Pointer(p)).Fn, (*TFts5Token)(unsafe.Pointer(p)).Fp)) return } - nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + if nNear < int32(214748363) { + nNear = nNear*int32(10) + (int32(*(*int8)(unsafe.Pointer((*TFts5Token)(unsafe.Pointer(p)).Fp + uintptr(i)))) - int32('0')) + } + /* ^^^^^^^^^^^^^^^--- Prevent integer overflow */ goto _1 _1: ; @@ -279715,7 +270397,7 @@ func _fts5ParseColset(tls *libc.TLS, pParse uintptr, p uintptr, iCol int32) (r u v1 = 0 } nCol = v1 /* New colset object to return */ - pNew = Xsqlite3_realloc64(tls, p, uint64(uint32(8)+uint32(4)*uint32(nCol))) + pNew = Xsqlite3_realloc64(tls, p, uint64(libc.Uint32FromInt64(8)*uint32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pNew == uintptr(0) { (*TFts5Parse)(unsafe.Pointer(pParse)).Frc = int32(SQLITE_NOMEM) } else { @@ -279765,7 +270447,7 @@ func _sqlite3Fts5ParseColsetInvert(tls *libc.TLS, pParse uintptr, p uintptr) (r var pRet, v3 uintptr _, _, _, _, _, _ = i, iOld, nCol, pRet, v2, v3 nCol = (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FnCol - pRet = _sqlite3Fts5MallocZero(tls, pParse+8, int64(uint32(8)+uint32(4)*uint32(nCol))) + pRet = _sqlite3Fts5MallocZero(tls, pParse+8, int64(libc.Uint32FromInt64(8)*uint32((nCol+libc.Int32FromInt32(1)+libc.Int32FromInt32(2))/libc.Int32FromInt32(2)))) if pRet != 0 { iOld = 0 i = 0 @@ -279816,7 +270498,7 @@ func _sqlite3Fts5ParseColset(tls *libc.TLS, pParse uintptr, pColset uintptr, p u iCol++ } if iCol == (*TFts5Config)(unsafe.Pointer(pConfig)).FnCol { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+22559, libc.VaList(bp+8, z)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+22722, libc.VaList(bp+8, z)) } else { pRet = _fts5ParseColset(tls, pParse, pColset, iCol) } @@ -279843,7 +270525,7 @@ func _fts5CloneColset(tls *libc.TLS, pRc uintptr, pOrig uintptr) (r uintptr) { var pRet uintptr _, _ = nByte, pRet if pOrig != 0 { - nByte = int64(uint32(8) + uint32((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol-libc.Int32FromInt32(1))*uint32(4)) + nByte = int64(libc.Uint32FromInt64(8) * uint32(((*TFts5Colset)(unsafe.Pointer(pOrig)).FnCol+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))) pRet = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pRet != 0 { libc.Xmemcpy(tls, pRet, pOrig, uint32(nByte)) @@ -279940,7 +270622,7 @@ func _sqlite3Fts5ParseSetColset(tls *libc.TLS, pParse uintptr, pExpr uintptr, pC var _ /* pFree at bp+0 */ uintptr *(*uintptr)(unsafe.Pointer(bp)) = pColset if (*TFts5Config)(unsafe.Pointer((*TFts5Parse)(unsafe.Pointer(pParse)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37874, 0) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38072, 0) } else { _fts5ParseSetColset(tls, pParse, pExpr, pColset, bp) } @@ -280025,7 +270707,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint var p, pPhrase, pRet, pTo, v3 uintptr _, _, _, _, _, _, _, _, _ = ii, nByte, nTerm, p, pPhrase, pRet, pTo, v2, v3 nTerm = (*TFts5ExprPhrase)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(pNear + 12)))).FnTerm - nByte = int32(uint32(48) + uint32(nTerm)*uint32(4)) + nByte = int32(uint32(libc.UintptrFromInt32(0)+40) + uint32(nTerm+libc.Int32FromInt32(1))*libc.Uint32FromInt64(4)) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, int64(nByte)) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = int32(FTS5_AND) @@ -280038,7 +270720,7 @@ func _fts5ParsePhraseToAnd(tls *libc.TLS, pParse uintptr, pNear uintptr) (r uint if !(ii < nTerm) { break } - pPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(44)) + pPhrase = _sqlite3Fts5MallocZero(tls, pParse+8, int64(uint32(libc.UintptrFromInt32(0)+20)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(24))) if pPhrase != 0 { if _parseGrowPhraseArray(tls, pParse) != 0 { _fts5ExprPhraseFree(tls, pPhrase) @@ -280112,7 +270794,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin } } } - nByte = int64(uint32(48) + uint32(4)*uint32(nChild-libc.Int32FromInt32(1))) + nByte = int64(uint32(libc.UintptrFromInt32(0)+40) + uint32(nChild)*libc.Uint32FromInt64(4)) pRet = _sqlite3Fts5MallocZero(tls, pParse+8, nByte) if pRet != 0 { (*TFts5ExprNode)(unsafe.Pointer(pRet)).FeType = eType @@ -280138,11 +270820,11 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pPhrase = *(*uintptr)(unsafe.Pointer(pNear + 12)) if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase != int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > int32(1) || (*TFts5ExprPhrase)(unsafe.Pointer(pPhrase)).FnTerm > 0 && (*(*TFts5ExprTerm)(unsafe.Pointer(pPhrase + 20))).FbFirst != 0 { if (*TFts5ExprNearset)(unsafe.Pointer(pNear)).FnPhrase == int32(1) { - v2 = __ccgo_ts + 37927 + v2 = __ccgo_ts + 38125 } else { - v2 = __ccgo_ts + 37840 + v2 = __ccgo_ts + 38038 } - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37934, libc.VaList(bp+8, v2)) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38132, libc.VaList(bp+8, v2)) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) pNear = uintptr(0) @@ -280155,7 +270837,7 @@ func _sqlite3Fts5ParseNode(tls *libc.TLS, pParse uintptr, eType int32, pLeft uin pRight = v3 pLeft = v3 if (*TFts5ExprNode)(unsafe.Pointer(pRet)).FiHeight > int32(SQLITE_FTS5_MAX_EXPR_DEPTH) { - _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+37984, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) + _sqlite3Fts5ParseError(tls, pParse, __ccgo_ts+38182, libc.VaList(bp+8, int32(SQLITE_FTS5_MAX_EXPR_DEPTH))) _sqlite3Fts5ParseNodeFree(tls, pRet) pRet = uintptr(0) } @@ -280276,15 +270958,6 @@ func _sqlite3Fts5ExprPoslist(tls *libc.TLS, pExpr uintptr, iPhrase int32, pa uin return nRet } -type TFts5PoslistPopulator1 = struct { - F__ccgo_align [0]uint32 - Fwriter TFts5PoslistWriter - FbOk int32 - FbMiss int32 -} - -type Fts5PoslistPopulator1 = TFts5PoslistPopulator1 - // C documentation // // /* @@ -280324,15 +270997,6 @@ func _sqlite3Fts5ExprClearPoslists(tls *libc.TLS, pExpr uintptr, bLive int32) (r return pRet } -type TFts5ExprCtx1 = struct { - F__ccgo_align [0]uint32 - FpExpr uintptr - FaPopulator uintptr - FiOff Ti64 -} - -type Fts5ExprCtx1 = TFts5ExprCtx1 - type TFts5ExprCtx = struct { F__ccgo_align [0]uint32 FpExpr uintptr @@ -280635,7 +271299,7 @@ func _sqlite3Fts5ExprInstToken(tls *libc.TLS, pExpr uintptr, iRowid Ti64, iPhras // C documentation // // /* -// ** Clear the token mappings for all Fts5IndexIter objects mannaged by +// ** Clear the token mappings for all Fts5IndexIter objects managed by // ** the expression passed as the only argument. // */ func _sqlite3Fts5ExprClearTokens(tls *libc.TLS, pExpr uintptr) { @@ -280699,68 +271363,7 @@ type TFts5HashEntry = struct { type Fts5HashEntry = TFts5HashEntry /* -** This file contains the implementation of an in-memory hash table used -** to accumuluate "term -> doclist" content before it is flused to a level-0 -** segment. - */ - -type TFts5Hash1 = struct { - FeDetail int32 - FpnByte uintptr - FnEntry int32 - FnSlot int32 - FpScan uintptr - FaSlot uintptr -} - -type Fts5Hash1 = TFts5Hash1 - -/* -** Each entry in the hash table is represented by an object of the -** following type. Each object, its key, and its current data are stored -** in a single memory allocation. The key immediately follows the object -** in memory. The position list data immediately follows the key data -** in memory. -** -** The key is Fts5HashEntry.nKey bytes in size. It consists of a single -** byte identifying the index (either the main term index or a prefix-index), -** followed by the term data. For example: "0token". There is no -** nul-terminator - in this case nKey=6. -** -** The data that follows the key is in a similar, but not identical format -** to the doclist data stored in the database. It is: -** -** * Rowid, as a varint -** * Position list, without 0x00 terminator. -** * Size of previous position list and rowid, as a 4 byte -** big-endian integer. -** -** iRowidOff: -** Offset of last rowid written to data area. Relative to first byte of -** structure. -** -** nData: -** Bytes of data written since iRowidOff. - */ -type TFts5HashEntry1 = struct { - F__ccgo_align [0]uint32 - FpHashNext uintptr - FpScanNext uintptr - FnAlloc int32 - FiSzPoslist int32 - FnData int32 - FnKey int32 - FbDel Tu8 - FbContent Tu8 - FiCol Ti16 - FiPos int32 - FiRowid Ti64 -} - -type Fts5HashEntry1 = TFts5HashEntry1 - -/* -** Eqivalent to: +** Equivalent to: ** ** char *fts5EntryKey(Fts5HashEntry *pEntry){ return zKey; } */ @@ -281645,7 +272248,6 @@ type TFts5DlidxIter = struct { F__ccgo_align [0]uint32 FnLvl int32 FiSegid int32 - FaLvl [1]TFts5DlidxLvl } type Fts5DlidxIter = TFts5DlidxIter @@ -281688,8 +272290,7 @@ type TFts5Iter = struct { F__ccgo_align9 [3]byte FiSwitchRowid Ti64 FaFirst uintptr - F__ccgo_align11 [4]byte - FaSeg [1]TFts5SegIter + F__ccgo_pad12 [4]byte } type Fts5Iter = TFts5Iter @@ -281773,8 +272374,6 @@ type TFts5Structure = struct { FnOriginCntr Tu64 FnSegment int32 FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte } type Fts5Structure = TFts5Structure @@ -281812,7 +272411,6 @@ type TFts5TokenDataIter = struct { FnIterAlloc int32 FaPoslistReader uintptr FaPoslistToIter uintptr - FapIter [1]uintptr } type Fts5TokenDataIter = TFts5TokenDataIter @@ -281828,166 +272426,12 @@ type TFts5TokenDataMap = struct { type Fts5TokenDataMap = TFts5TokenDataMap type TFts5TombstoneArray = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr + FnRef int32 + FnTombstone int32 } type Fts5TombstoneArray = TFts5TombstoneArray -type TFts5Data1 = struct { - Fp uintptr - Fnn int32 - FszLeaf int32 -} - -type Fts5Data1 = TFts5Data1 - -/* -** One object per %_data table. -** -** nContentlessDelete: -** The number of contentless delete operations since the most recent -** call to fts5IndexFlush() or fts5IndexDiscardData(). This is tracked -** so that extra auto-merge work can be done by fts5IndexFlush() to -** account for the delete operations. - */ -type TFts5Index1 = struct { - F__ccgo_align [0]uint32 - FpConfig uintptr - FzDataTbl uintptr - FnWorkUnit int32 - FpHash uintptr - FnPendingData int32 - F__ccgo_align5 [4]byte - FiWriteRowid Ti64 - FbDelete int32 - FnContentlessDelete int32 - FnPendingRow int32 - Frc int32 - FflushRc int32 - FpReader uintptr - FpWriter uintptr - FpDeleter uintptr - FpIdxWriter uintptr - FpIdxDeleter uintptr - FpIdxSelect uintptr - FpIdxNextSelect uintptr - FnRead int32 - FpDeleteFromIdx uintptr - FpDataVersion uintptr - F__ccgo_align21 [4]byte - FiStructVersion Ti64 - FpStruct uintptr - F__ccgo_pad23 [4]byte -} - -type Fts5Index1 = TFts5Index1 - -type TFts5DoclistIter1 = struct { - F__ccgo_align [0]uint32 - FaEof uintptr - F__ccgo_align1 [4]byte - FiRowid Ti64 - FaPoslist uintptr - FnPoslist int32 - FnSize int32 - F__ccgo_pad5 [4]byte -} - -type Fts5DoclistIter1 = TFts5DoclistIter1 - -/* -** The contents of the "structure" record for each index are represented -** using an Fts5Structure record in memory. Which uses instances of the -** other Fts5StructureXXX types as components. -** -** nOriginCntr: -** This value is set to non-zero for structure records created for -** contentlessdelete=1 tables only. In that case it represents the -** origin value to apply to the next top-level segment created. - */ -type TFts5StructureSegment1 = struct { - F__ccgo_align [0]uint32 - FiSegid int32 - FpgnoFirst int32 - FpgnoLast int32 - F__ccgo_align3 [4]byte - FiOrigin1 Tu64 - FiOrigin2 Tu64 - FnPgTombstone int32 - F__ccgo_align6 [4]byte - FnEntryTombstone Tu64 - FnEntry Tu64 -} - -type Fts5StructureSegment1 = TFts5StructureSegment1 - -type TFts5StructureLevel1 = struct { - FnMerge int32 - FnSeg int32 - FaSeg uintptr -} - -type Fts5StructureLevel1 = TFts5StructureLevel1 - -type TFts5Structure1 = struct { - F__ccgo_align [0]uint32 - FnRef int32 - F__ccgo_align1 [4]byte - FnWriteCounter Tu64 - FnOriginCntr Tu64 - FnSegment int32 - FnLevel int32 - FaLevel [1]TFts5StructureLevel - F__ccgo_pad6 [4]byte -} - -type Fts5Structure1 = TFts5Structure1 - -/* -** An object of type Fts5SegWriter is used to write to segments. - */ -type TFts5PageWriter1 = struct { - Fpgno int32 - FiPrevPgidx int32 - Fbuf TFts5Buffer - Fpgidx TFts5Buffer - Fterm TFts5Buffer -} - -type Fts5PageWriter1 = TFts5PageWriter1 - -type TFts5DlidxWriter1 = struct { - F__ccgo_align [0]uint32 - Fpgno int32 - FbPrevValid int32 - FiPrev Ti64 - Fbuf TFts5Buffer - F__ccgo_pad4 [4]byte -} - -type Fts5DlidxWriter1 = TFts5DlidxWriter1 - -type TFts5SegWriter1 = struct { - F__ccgo_align [0]uint32 - FiSegid int32 - Fwriter TFts5PageWriter - FiPrevRowid Ti64 - FbFirstRowidInDoclist Tu8 - FbFirstRowidInPage Tu8 - FbFirstTermInPage Tu8 - FnLeafWritten int32 - FnEmpty int32 - FnDlidx int32 - FaDlidx uintptr - Fbtterm TFts5Buffer - FiBtPage int32 - F__ccgo_pad12 [4]byte -} - -type Fts5SegWriter1 = TFts5SegWriter1 - type TFts5CResult = struct { FiFirst Tu16 FbTermEq Tu8 @@ -281995,197 +272439,7 @@ type TFts5CResult = struct { type Fts5CResult = TFts5CResult -type TFts5CResult1 = struct { - FiFirst Tu16 - FbTermEq Tu8 -} - -type Fts5CResult1 = TFts5CResult1 - -/* -** Object for iterating through a single segment, visiting each term/rowid -** pair in the segment. -** -** pSeg: -** The segment to iterate through. -** -** iLeafPgno: -** Current leaf page number within segment. -** -** iLeafOffset: -** Byte offset within the current leaf that is the first byte of the -** position list data (one byte passed the position-list size field). -** -** pLeaf: -** Buffer containing current leaf page data. Set to NULL at EOF. -** -** iTermLeafPgno, iTermLeafOffset: -** Leaf page number containing the last term read from the segment. And -** the offset immediately following the term data. -** -** flags: -** Mask of FTS5_SEGITER_XXX values. Interpreted as follows: -** -** FTS5_SEGITER_ONETERM: -** If set, set the iterator to point to EOF after the current doclist -** has been exhausted. Do not proceed to the next term in the segment. -** -** FTS5_SEGITER_REVERSE: -** This flag is only ever set if FTS5_SEGITER_ONETERM is also set. If -** it is set, iterate through rowid in descending order instead of the -** default ascending order. -** -** iRowidOffset/nRowidOffset/aRowidOffset: -** These are used if the FTS5_SEGITER_REVERSE flag is set. -** -** For each rowid on the page corresponding to the current term, the -** corresponding aRowidOffset[] entry is set to the byte offset of the -** start of the "position-list-size" field within the page. -** -** iTermIdx: -** Index of current term on iTermLeafPgno. -** -** apTombstone/nTombstone: -** These are used for contentless_delete=1 tables only. When the cursor -** is first allocated, the apTombstone[] array is allocated so that it -** is large enough for all tombstones hash pages associated with the -** segment. The pages themselves are loaded lazily from the database as -** they are required. - */ -type TFts5SegIter1 = struct { - F__ccgo_align [0]uint32 - FpSeg uintptr - Fflags int32 - FiLeafPgno int32 - FpLeaf uintptr - FpNextLeaf uintptr - F__ccgo_align5 [4]byte - FiLeafOffset Ti64 - FpTombArray uintptr - FxNext uintptr - FiTermLeafPgno int32 - FiTermLeafOffset int32 - FiPgidxOff int32 - FiEndofDoclist int32 - FiRowidOffset int32 - FnRowidOffset int32 - FaRowidOffset uintptr - FpDlidx uintptr - Fterm TFts5Buffer - F__ccgo_align17 [4]byte - FiRowid Ti64 - FnPos int32 - FbDel Tu8 - F__ccgo_pad20 [3]byte -} - -type Fts5SegIter1 = TFts5SegIter1 - -/* -** Array of tombstone pages. Reference counted. - */ -type TFts5TombstoneArray1 = struct { - FnRef int32 - FnTombstone int32 - FapTombstone [1]uintptr -} - -type Fts5TombstoneArray1 = TFts5TombstoneArray1 - -/* -** Argument is a pointer to an Fts5Data structure that contains a -** leaf page. - */ - -/* -** Argument is a pointer to an Fts5Data structure that contains a leaf -** page. This macro evaluates to true if the leaf contains no terms, or -** false if it contains at least one term. - */ - -/* -** Object for iterating through the merged results of one or more segments, -** visiting each term/rowid pair in the merged data. -** -** nSeg is always a power of two greater than or equal to the number of -** segments that this object is merging data from. Both the aSeg[] and -** aFirst[] arrays are sized at nSeg entries. The aSeg[] array is padded -** with zeroed objects - these are handled as if they were iterators opened -** on empty segments. -** -** The results of comparing segments aSeg[N] and aSeg[N+1], where N is an -** even number, is stored in aFirst[(nSeg+N)/2]. The "result" of the -** comparison in this context is the index of the iterator that currently -** points to the smaller term/rowid combination. Iterators at EOF are -** considered to be greater than all other iterators. -** -** aFirst[1] contains the index in aSeg[] of the iterator that points to -** the smallest key overall. aFirst[0] is unused. -** -** poslist: -** Used by sqlite3Fts5IterPoslist() when the poslist needs to be buffered. -** There is no way to tell if this is populated or not. -** -** pColset: -** If not NULL, points to an object containing a set of column indices. -** Only matches that occur in one of these columns will be returned. -** The Fts5Iter does not own the Fts5Colset object, and so it is not -** freed when the iterator is closed - it is owned by the upper layer. - */ -type TFts5Iter1 = struct { - F__ccgo_align [0]uint32 - Fbase TFts5IndexIter - FpTokenDataIter uintptr - FpIndex uintptr - Fposlist TFts5Buffer - FpColset uintptr - FxSetOutputs uintptr - FnSeg int32 - FbRev int32 - FbSkipEmpty Tu8 - F__ccgo_align9 [3]byte - FiSwitchRowid Ti64 - FaFirst uintptr - F__ccgo_align11 [4]byte - FaSeg [1]TFts5SegIter -} - -type Fts5Iter1 = TFts5Iter1 - -/* -** An instance of the following type is used to iterate through the contents -** of a doclist-index record. -** -** pData: -** Record containing the doclist-index data. -** -** bEof: -** Set to true once iterator has reached EOF. -** -** iOff: -** Set to the current offset within record pData. - */ -type TFts5DlidxLvl1 = struct { - F__ccgo_align [0]uint32 - FpData uintptr - FiOff int32 - FbEof int32 - FiFirstOff int32 - FiLeafPgno int32 - F__ccgo_align5 [4]byte - FiRowid Ti64 -} - -type Fts5DlidxLvl1 = TFts5DlidxLvl1 - -type TFts5DlidxIter1 = struct { - F__ccgo_align [0]uint32 - FnLvl int32 - FiSegid int32 - FaLvl [1]TFts5DlidxLvl -} - -type Fts5DlidxIter1 = TFts5DlidxIter1 +/* Size (in bytes) of an Fts5DlidxIter object with up to N levels */ func _fts5PutU16(tls *libc.TLS, aOut uintptr, iVal Tu16) { *(*Tu8)(unsafe.Pointer(aOut)) = uint8(int32(iVal) >> libc.Int32FromInt32(8)) @@ -282365,7 +272619,7 @@ func _fts5DataRead(tls *libc.TLS, p uintptr, iRowid Ti64) (r uintptr) { ** to the requested entry. */ if (*TFts5Index)(unsafe.Pointer(p)).FpReader == uintptr(0) && rc == SQLITE_OK { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38037, iRowid, 0, p+52) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38235, iRowid, 0, p+52) } /* If either of the sqlite3_blob_open() or sqlite3_blob_reopen() calls ** above returned SQLITE_ERROR, return SQLITE_CORRUPT_VTAB instead. @@ -282470,7 +272724,7 @@ func _fts5DataWrite(tls *libc.TLS, p uintptr, iRowid Ti64, pData uintptr, nData } if (*TFts5Index)(unsafe.Pointer(p)).FpWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+56, Xsqlite3_mprintf(tls, __ccgo_ts+38043, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+56, Xsqlite3_mprintf(tls, __ccgo_ts+38241, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -282499,7 +272753,7 @@ func _fts5DataDelete(tls *libc.TLS, p uintptr, iFirst Ti64, iLast Ti64) { } if (*TFts5Index)(unsafe.Pointer(p)).FpDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38094, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+38292, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if _fts5IndexPrepareStmt(tls, p, p+60, zSql) != 0 { return } @@ -282533,7 +272787,7 @@ func _fts5DataRemoveSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { } if (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+38143, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+68, Xsqlite3_mprintf(tls, __ccgo_ts+38341, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpIdxDeleter, int32(1), iSegid) @@ -282611,7 +272865,7 @@ func _fts5StructureMakeWritable(tls *libc.TLS, pRc uintptr, pp uintptr) { _, _, _, _, _ = i, nByte, p, pLvl, pNew p = *(*uintptr)(unsafe.Pointer(pp)) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK && (*TFts5Structure)(unsafe.Pointer(p)).FnRef > int32(1) { - nByte = int64(uint32(48) + uint32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel-libc.Int32FromInt32(1))*uint32(12)) + nByte = int64(uint32(libc.UintptrFromInt32(0)+32) + uint32((*TFts5Structure)(unsafe.Pointer(p)).FnLevel)*libc.Uint32FromInt64(12)) pNew = _sqlite3Fts5MallocZero(tls, pRc, nByte) if pNew != 0 { libc.Xmemcpy(tls, pNew, p, uint32(nByte)) @@ -282702,7 +272956,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui } i = int32(4) /* Check if this is a V2 structure record. Set bStructureV2 if it is. */ - if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+38183, uint32(4)) { + if 0 == libc.Xmemcmp(tls, pData+uintptr(i), __ccgo_ts+38381, uint32(4)) { i += int32(4) bStructureV2 = int32(1) } @@ -282713,7 +272967,7 @@ func _fts5StructureDecode(tls *libc.TLS, pData uintptr, nData int32, piCookie ui if *(*int32)(unsafe.Pointer(bp + 4)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 4)) < 0 || *(*int32)(unsafe.Pointer(bp + 8)) > int32(FTS5_MAX_SEGMENT) || *(*int32)(unsafe.Pointer(bp + 8)) < 0 { return libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< uint64(0) { - libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+38183, uint32(4)) + libc.Xmemcpy(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), __ccgo_ts+38381, uint32(4)) *(*int32)(unsafe.Pointer(bp + 4)) += int32(4) } *(*int32)(unsafe.Pointer(bp + 4)) += _sqlite3Fts5PutVarint(tls, (*TFts5Buffer)(unsafe.Pointer(bp)).Fp+uintptr((*TFts5Buffer)(unsafe.Pointer(bp)).Fn), uint64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel)) @@ -283394,7 +273648,7 @@ func _fts5DlidxIterInit(tls *libc.TLS, p uintptr, bRev int32, iSegid int32, iLea if !((*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && bDone == 0) { break } - nByte = int64(uint32(40) + uint32(i)*uint32(32)) + nByte = int64(uint32(libc.UintptrFromInt32(0)+8) + uint32(i+libc.Int32FromInt32(1))*libc.Uint32FromInt64(32)) pNew = Xsqlite3_realloc64(tls, pIter, uint64(nByte)) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -283639,15 +273893,15 @@ func _fts5SegIterSetNext(tls *libc.TLS, p uintptr, pIter uintptr) { // ** leave an error in the Fts5Index object. // */ func _fts5SegIterAllocTombstone(tls *libc.TLS, p uintptr, pIter uintptr) { - var nByte, nTomb int32 + var nByte, nTomb Ti64 var pNew uintptr _, _, _ = nByte, nTomb, pNew - nTomb = (*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone + nTomb = int64((*TFts5StructureSegment)(unsafe.Pointer((*TFts5SegIter)(unsafe.Pointer(pIter)).FpSeg)).FnPgTombstone) if nTomb > 0 { - nByte = int32(uint32(nTomb)*uint32(4) + uint32(12)) - pNew = _sqlite3Fts5MallocZero(tls, p+44, int64(nByte)) + nByte = int64(uint32(libc.UintptrFromInt32(0)+8)) + (nTomb+libc.Int64FromInt32(1))*libc.Int64FromInt64(4) + pNew = _sqlite3Fts5MallocZero(tls, p+44, nByte) if pNew != 0 { - (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = nTomb + (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnTombstone = int32(nTomb) (*TFts5TombstoneArray)(unsafe.Pointer(pNew)).FnRef = int32(1) (*TFts5SegIter)(unsafe.Pointer(pIter)).FpTombArray = pNew } @@ -284354,7 +274608,7 @@ func _fts5IdxSelectStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+38211, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+72, Xsqlite3_mprintf(tls, __ccgo_ts+38409, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxSelect } @@ -284443,7 +274697,7 @@ func _fts5IdxNextStmt(tls *libc.TLS, p uintptr) (r uintptr) { _ = pConfig if (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+76, Xsqlite3_mprintf(tls, __ccgo_ts+38295, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+76, Xsqlite3_mprintf(tls, __ccgo_ts+38493, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } return (*TFts5Index)(unsafe.Pointer(p)).FpIdxNextSelect } @@ -285090,7 +275344,7 @@ func _fts5MultiIterAlloc(tls *libc.TLS, p uintptr, nSeg int32) (r uintptr) { ; nSlot = nSlot * int64(2) } - pNew = _fts5IdxMalloc(tls, p, int64(184)+int64(104)*(nSlot-int64(1))+int64(4)*nSlot) + pNew = _fts5IdxMalloc(tls, p, int64(uint32(libc.UintptrFromInt32(0)+80))+nSlot*int64(104)+int64(4)*nSlot) if pNew != 0 { (*TFts5Iter)(unsafe.Pointer(pNew)).FnSeg = int32(nSlot) (*TFts5Iter)(unsafe.Pointer(pNew)).FaFirst = pNew + 80 + uintptr(nSlot)*104 @@ -285116,14 +275370,6 @@ type TPoslistCallbackCtx = struct { type PoslistCallbackCtx = TPoslistCallbackCtx -type TPoslistCallbackCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FeState int32 -} - -type PoslistCallbackCtx1 = TPoslistCallbackCtx1 - type TPoslistOffsetsCtx = struct { FpBuf uintptr FpColset uintptr @@ -285133,15 +275379,6 @@ type TPoslistOffsetsCtx = struct { type PoslistOffsetsCtx = TPoslistOffsetsCtx -type TPoslistOffsetsCtx1 = struct { - FpBuf uintptr - FpColset uintptr - FiRead int32 - FiWrite int32 -} - -type PoslistOffsetsCtx1 = TPoslistOffsetsCtx1 - // C documentation // // /* @@ -285255,7 +275492,7 @@ func _fts5PoslistFilterCallback(tls *libc.TLS, pUnused uintptr, pContext uintptr } } -func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xChunk uintptr) { +func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, __ccgo_fp_xChunk uintptr) { var nChunk, nRem, pgno, pgnoSave, v2 int32 var pChunk, pData uintptr var v1 int64 @@ -285276,7 +275513,7 @@ func _fts5ChunkIterate(tls *libc.TLS, p uintptr, pSeg uintptr, pCtx uintptr, xCh pgnoSave = pgno + int32(1) } for int32(1) != 0 { - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xChunk})))(tls, p, pCtx, pChunk, nChunk) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xChunk})))(tls, p, pCtx, pChunk, nChunk) nRem -= nChunk _fts5DataRelease(tls, pData) if nRem <= 0 { @@ -286058,7 +276295,7 @@ func _fts5WriteFlushBtree(tls *libc.TLS, p uintptr, pWriter uintptr) { if (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fn > 0 { v1 = (*TFts5SegWriter)(unsafe.Pointer(pWriter)).Fbtterm.Fp } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } z = v1 /* The following was already done in fts5WriteInit(): */ @@ -286413,7 +276650,7 @@ func _fts5WriteInit(tls *libc.TLS, p uintptr, pWriter uintptr, iSegid int32) { _sqlite3Fts5BufferSize(tls, p+44, pWriter+4+8, uint32(nBuffer)) if (*TFts5Index)(unsafe.Pointer(p)).FpIdxWriter == uintptr(0) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig - _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+38377, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+64, Xsqlite3_mprintf(tls, __ccgo_ts+38575, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Initialize the 4-byte leaf-page header to 0x00. */ @@ -286870,15 +277107,6 @@ type TFts5FlushCtx = struct { type Fts5FlushCtx = TFts5FlushCtx -type TFts5FlushCtx1 = struct { - F__ccgo_align [0]uint32 - FpIdx uintptr - F__ccgo_align1 [4]byte - Fwriter TFts5SegWriter -} - -type Fts5FlushCtx1 = TFts5FlushCtx1 - // C documentation // // /* @@ -286923,7 +277151,7 @@ func _fts5SecureDeleteIdxEntry(tls *libc.TLS, p uintptr, iSegid int32, iPgno int defer tls.Free(32) if iPgno != int32(1) { if (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx == uintptr(0) { - _fts5IndexPrepareStmt(tls, p, p+84, Xsqlite3_mprintf(tls, __ccgo_ts+38434, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) + _fts5IndexPrepareStmt(tls, p, p+84, Xsqlite3_mprintf(tls, __ccgo_ts+38632, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzDb, (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FzName))) } if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_bind_int(tls, (*TFts5Index)(unsafe.Pointer(p)).FpDeleteFromIdx, int32(1), iSegid) @@ -287092,7 +277320,7 @@ func _fts5DoSecureDelete(tls *libc.TLS, p uintptr, pSeg uintptr) { iStart = 0 iDelKeyOff = 0 /* Offset of deleted key, if any */ nIdx = nPg - iPgIdx - aIdx = _sqlite3Fts5MallocZero(tls, p+44, int64(nIdx+int32(16))) + aIdx = _sqlite3Fts5MallocZero(tls, p+44, int64(nIdx)+int64(16)) if (*TFts5Index)(unsafe.Pointer(p)).Frc != 0 { return } @@ -287410,7 +277638,7 @@ func _fts5FlushSecureDelete(tls *libc.TLS, p uintptr, pStruct uintptr, zTerm uin if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FiVersion != int32(FTS5_CURRENT_VERSION_SECUREDELETE) { pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) - _fts5IndexPrepareStmt(tls, p, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+38495, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) + _fts5IndexPrepareStmt(tls, p, bp+4, Xsqlite3_mprintf(tls, __ccgo_ts+38693, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, int32(FTS5_CURRENT_VERSION_SECUREDELETE)))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) rc = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -287685,7 +277913,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint var pLvl, pNew uintptr _, _, _, _, _, _, _, _, _, _, _, _ = i, iLvl, iSeg, iSegOut, nByte, nMerge, nSeg, nThis, pLvl, pNew, v2, v5 pNew = uintptr(0) - nByte = int64(48) + nByte = int64(uint32(libc.UintptrFromInt32(0)+32) + uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(12)) nSeg = (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment /* Figure out if this structure requires optimization. A structure does ** not require optimization if either: @@ -287720,7 +277948,7 @@ func _fts5IndexOptimizeStruct(tls *libc.TLS, p uintptr, pStruct uintptr) (r uint ; i++ } - nByte += int64(uint32((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel+libc.Int32FromInt32(1)) * uint32(12)) + nByte += (int64((*TFts5Structure)(unsafe.Pointer(pStruct)).FnLevel) + int64(1)) * int64(12) pNew = _sqlite3Fts5MallocZero(tls, p+44, nByte) if pNew != 0 { nByte = int64(uint32(nSeg) * uint32(56)) @@ -288001,18 +278229,6 @@ type TPrefixMerger = struct { type PrefixMerger = TPrefixMerger -type TPrefixMerger1 = struct { - F__ccgo_align [0]uint32 - Fiter TFts5DoclistIter - FiPos Ti64 - FiOff int32 - FaPos uintptr - FpNext uintptr - F__ccgo_pad5 [4]byte -} - -type PrefixMerger1 = TPrefixMerger1 - func _fts5PrefixMergerInsertByRowid(tls *libc.TLS, ppHead uintptr, p uintptr) { var pp uintptr _ = pp @@ -288230,7 +278446,7 @@ func _fts5MergePrefixLists(tls *libc.TLS, p uintptr, p1 uintptr, nBuf int32, aBu // ** If parameter pColset is not NULL, then it is used to filter entries before // ** the callback is invoked. // */ -func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, xVisit uintptr, pCtx uintptr) (r int32) { +func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr, nToken int32, bPrefix int32, __ccgo_fp_xVisit uintptr, pCtx uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var flags, nNew, v1 int32 @@ -288267,7 +278483,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr break } } - (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) + (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, int32))(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xVisit})))(tls, p, pCtx, *(*uintptr)(unsafe.Pointer(bp)), pNew, nNew) goto _2 _2: ; @@ -288278,71 +278494,7 @@ func _fts5VisitEntries(tls *libc.TLS, p uintptr, pColset uintptr, pToken uintptr return (*TFts5Index)(unsafe.Pointer(p)).Frc } -/* -** Usually, a tokendata=1 iterator (struct Fts5TokenDataIter) accumulates an -** array of these for each row it visits (so all iRowid fields are the same). -** Or, for an iterator used by an "ORDER BY rank" query, it accumulates an -** array of these for the entire query (in which case iRowid fields may take -** a variety of values). -** -** Each instance in the array indicates the iterator (and therefore term) -** associated with position iPos of rowid iRowid. This is used by the -** xInstToken() API. -** -** iRowid: -** Rowid for the current entry. -** -** iPos: -** Position of current entry within row. In the usual ((iCol<<32)+iOff) -** format (e.g. see macros FTS5_POS2COLUMN() and FTS5_POS2OFFSET()). -** -** iIter: -** If the Fts5TokenDataIter iterator that the entry is part of is -** actually an iterator (i.e. with nIter>0, not just a container for -** Fts5TokenDataMap structures), then this variable is an index into -** the apIter[] array. The corresponding term is that which the iterator -** at apIter[iIter] currently points to. -** -** Or, if the Fts5TokenDataIter iterator is just a container object -** (nIter==0), then iIter is an index into the term.p[] buffer where -** the term is stored. -** -** nByte: -** In the case where iIter is an index into term.p[], this variable -** is the size of the term in bytes. If iIter is an index into apIter[], -** this variable is unused. - */ -type TFts5TokenDataMap1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FiPos Ti64 - FiIter int32 - FnByte int32 -} - -type Fts5TokenDataMap1 = TFts5TokenDataMap1 - -/* -** An object used to supplement Fts5Iter for tokendata=1 iterators. -** -** This object serves two purposes. The first is as a container for an array -** of Fts5TokenDataMap structures, which are used to find the token required -** when the xInstToken() API is used. This is done by the nMapAlloc, nMap and -** aMap[] variables. - */ -type TFts5TokenDataIter1 = struct { - FnMapAlloc int32 - FnMap int32 - FaMap uintptr - Fterms TFts5Buffer - FnIter int32 - FnIterAlloc int32 - FaPoslistReader uintptr - FaPoslistToIter uintptr - FapIter [1]uintptr -} - -type Fts5TokenDataIter1 = TFts5TokenDataIter1 +/* Size in bytes of an Fts5TokenDataIter object holding up to N iterators */ // C documentation // @@ -288411,7 +278563,7 @@ func _fts5TokendataIterAppendMap(tls *libc.TLS, p uintptr, pT uintptr, iIter int // /* // ** Sort the contents of the pT->aMap[] array. // ** -// ** The sorting algorithm requries a malloc(). If this fails, an error code +// ** The sorting algorithm requires a malloc(). If this fails, an error code // ** is left in Fts5Index.rc before returning. // */ func _fts5TokendataIterSortMap(tls *libc.TLS, p uintptr, pT uintptr) { @@ -288510,14 +278662,6 @@ type TTokendataSetupCtx = struct { type TokendataSetupCtx = TTokendataSetupCtx -type TTokendataSetupCtx1 = struct { - FpT uintptr - FiTermOff int32 - FnTermByte int32 -} - -type TokendataSetupCtx1 = TTokendataSetupCtx1 - // C documentation // // /* @@ -288566,21 +278710,6 @@ type TPrefixSetupCtx = struct { type PrefixSetupCtx = TPrefixSetupCtx -type TPrefixSetupCtx1 = struct { - F__ccgo_align [0]uint32 - FxMerge uintptr - FxAppend uintptr - FiLastRowid Ti64 - FnMerge int32 - FaBuf uintptr - FnBuf int32 - Fdoclist TFts5Buffer - FpTokendata uintptr - F__ccgo_pad8 [4]byte -} - -type PrefixSetupCtx1 = TPrefixSetupCtx1 - // C documentation // // /* @@ -288659,7 +278788,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnBuf = int32(32) if iIdx == 0 && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == FTS5_DETAIL_FULL && (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbPrefixInsttoken != 0 { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FpTokendata = bp + 48 - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 48))).FpT = _fts5IdxMalloc(tls, p, int64(44)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 48))).FpT = _fts5IdxMalloc(tls, p, int64(uint32(libc.UintptrFromInt32(0)+40)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(80))) } if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FeDetail == int32(FTS5_DETAIL_NONE) { (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FxMerge = __ccgo_fp(_fts5MergeRowidLists) @@ -288709,7 +278838,7 @@ func _fts5SetupPrefixIter(tls *libc.TLS, p uintptr, bDesc int32, iIdx int32, pTo ; i += (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).FnMerge } - pData = _fts5IdxMalloc(tls, p, int64(uint32(12)+uint32((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+uint32(FTS5_DATA_ZERO_PADDING))) + pData = _fts5IdxMalloc(tls, p, int64(12)+int64((*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn)+int64(FTS5_DATA_ZERO_PADDING)) if pData != 0 { (*TFts5Data)(unsafe.Pointer(pData)).Fp = pData + 1*12 v3 = (*(*TPrefixSetupCtx)(unsafe.Pointer(bp))).Fdoclist.Fn @@ -288791,15 +278920,18 @@ func _sqlite3Fts5IndexRollback(tls *libc.TLS, p uintptr) (r int32) { func _sqlite3Fts5IndexReinit(tls *libc.TLS, p uintptr) (r int32) { bp := tls.Alloc(48) defer tls.Free(48) - var _ /* s at bp+0 */ TFts5Structure + var pTmp uintptr + var _ /* tmpSpace at bp+0 */ [44]Tu8 + _ = pTmp _fts5StructureInvalidate(tls, p) _fts5IndexDiscardData(tls, p) - libc.Xmemset(tls, bp, 0, uint32(48)) + pTmp = bp + libc.Xmemset(tls, pTmp, 0, uint32(libc.UintptrFromInt32(0)+32)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(12)) if (*TFts5Config)(unsafe.Pointer((*TFts5Index)(unsafe.Pointer(p)).FpConfig)).FbContentlessDelete != 0 { - (*(*TFts5Structure)(unsafe.Pointer(bp))).FnOriginCntr = uint64(1) + (*TFts5Structure)(unsafe.Pointer(pTmp)).FnOriginCntr = uint64(1) } - _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1673, 0) - _fts5StructureWrite(tls, p, bp) + _fts5DataWrite(tls, p, int64(FTS5_AVERAGES_ROWID), __ccgo_ts+1674, 0) + _fts5StructureWrite(tls, p, pTmp) return _fts5IndexReturn(tls, p) } @@ -288825,11 +278957,11 @@ func _sqlite3Fts5IndexOpen(tls *libc.TLS, pConfig uintptr, bCreate int32, pp uin if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { (*TFts5Index)(unsafe.Pointer(p)).FpConfig = pConfig (*TFts5Index)(unsafe.Pointer(p)).FnWorkUnit = int32(FTS5_WORK_UNIT) - (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38546, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38744, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl != 0 && bCreate != 0 { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+27332, __ccgo_ts+38554, 0, pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+27478, __ccgo_ts+38752, 0, pzErr) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13289, __ccgo_ts+38589, int32(1), pzErr) + *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+13405, __ccgo_ts+38787, int32(1), pzErr) } if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5IndexReinit(tls, p) @@ -289027,7 +279159,7 @@ func _fts5AppendTokendataIter(tls *libc.TLS, p uintptr, pIn uintptr, pAppend uin v1 = int32(16) } nAlloc = v1 - nByte = int32(uint32(nAlloc)*uint32(4) + uint32(44)) + nByte = int32(uint32(libc.UintptrFromInt32(0)+40) + uint32(nAlloc+libc.Int32FromInt32(1))*libc.Uint32FromInt64(80)) pNew = Xsqlite3_realloc(tls, pIn, nByte) if pNew == uintptr(0) { (*TFts5Index)(unsafe.Pointer(p)).Frc = int32(SQLITE_NOMEM) @@ -289282,7 +279414,7 @@ func _fts5SetupTokendataIter(tls *libc.TLS, p uintptr, pToken uintptr, nToken in pNew = _fts5MultiIterAlloc(tls, p, (*TFts5Structure)(unsafe.Pointer(pStruct)).FnSegment) if pSmall != 0 { _sqlite3Fts5BufferSet(tls, p+44, bp, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fn, (*TFts5Buffer)(unsafe.Pointer(pSmall)).Fp) - _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(1), __ccgo_ts+38633) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(1), __ccgo_ts+38831) } else { _sqlite3Fts5BufferSet(tls, p+44, bp, nToken, pToken) } @@ -289633,7 +279765,7 @@ func _fts5SetupPrefixIterTokendata(tls *libc.TLS, pIter uintptr, pToken uintptr, if !(uint32((*TFts5Buffer)(unsafe.Pointer(bp)).Fn)+uint32(nToken+libc.Int32FromInt32(1)) <= uint32((*TFts5Buffer)(unsafe.Pointer(bp)).FnSpace)) { _sqlite3Fts5BufferSize(tls, p+44, bp, uint32(nToken+int32(1)+(*TFts5Buffer)(unsafe.Pointer(bp)).Fn)) } - (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 12))).FpT = _sqlite3Fts5MallocZero(tls, p+44, int64(44)) + (*(*TTokendataSetupCtx)(unsafe.Pointer(bp + 12))).FpT = _sqlite3Fts5MallocZero(tls, p+44, int64(uint32(libc.UintptrFromInt32(0)+40)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(80))) if (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK { /* Fill in the token prefix to search for */ *(*Tu8)(unsafe.Pointer((*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp)) = uint8('0') @@ -289755,7 +279887,7 @@ func _sqlite3Fts5IndexIterWriteTokendata(tls *libc.TLS, pIndexIter uintptr, pTok if (*TFts5Iter)(unsafe.Pointer(pIter)).FnSeg > 0 { /* This is a prefix term iterator. */ if pT == uintptr(0) { - pT = _sqlite3Fts5MallocZero(tls, p+44, int64(44)) + pT = _sqlite3Fts5MallocZero(tls, p+44, int64(uint32(libc.UintptrFromInt32(0)+40)+uint32(libc.Int32FromInt32(1))*libc.Uint32FromInt64(80))) (*TFts5Iter)(unsafe.Pointer(pIter)).FpTokenDataIter = pT } if pT != 0 { @@ -289875,7 +280007,7 @@ func _sqlite3Fts5IndexSetCookie(tls *libc.TLS, p uintptr, iNew int32) (r int32) pConfig = (*TFts5Index)(unsafe.Pointer(p)).FpConfig /* Binary representation of iNew */ *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) _sqlite3Fts5Put32(tls, bp, iNew) - rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38037, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) + rc = Xsqlite3_blob_open(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Index)(unsafe.Pointer(p)).FzDataTbl, __ccgo_ts+38235, int64(FTS5_STRUCTURE_ROWID), int32(1), bp+4) if rc == SQLITE_OK { Xsqlite3_blob_write(tls, *(*uintptr)(unsafe.Pointer(bp + 4)), bp, int32(4), 0) rc = Xsqlite3_blob_close(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) @@ -290469,7 +280601,7 @@ func _fts5IndexIntegrityCheckSegment(tls *libc.TLS, p uintptr, pSeg uintptr) { if (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FpgnoFirst == 0 { return } - _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+38635, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) + _fts5IndexPrepareStmt(tls, p, bp, Xsqlite3_mprintf(tls, __ccgo_ts+38833, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5StructureSegment)(unsafe.Pointer(pSeg)).FiSegid))) /* Iterate through the b-tree hierarchy. */ for (*TFts5Index)(unsafe.Pointer(p)).Frc == SQLITE_OK && int32(SQLITE_ROW) == Xsqlite3_step(tls, *(*uintptr)(unsafe.Pointer(bp))) { /* Data for this leaf */ zIdxTerm = Xsqlite3_column_blob(tls, *(*uintptr)(unsafe.Pointer(bp)), int32(1)) @@ -290700,7 +280832,7 @@ func _sqlite3Fts5IndexIntegrityCheck(tls *libc.TLS, p uintptr, cksum Tu64, bUseC } else { (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn = 0 _fts5SegiterPoslist(tls, p, *(*uintptr)(unsafe.Pointer(bp + 12))+80+uintptr((*(*TFts5CResult)(unsafe.Pointer((*TFts5Iter)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(bp + 12)))).FaFirst + 1*4))).FiFirst)*104, uintptr(0), bp) - _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(4), __ccgo_ts+38721) + _sqlite3Fts5BufferAppendBlob(tls, p+44, bp, uint32(4), __ccgo_ts+38919) for 0 == _sqlite3Fts5PoslistNext64(tls, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fp, (*(*TFts5Buffer)(unsafe.Pointer(bp))).Fn, bp+32, bp+24) { iCol = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) >> libc.Int32FromInt32(32) & libc.Int64FromInt32(0x7FFFFFFF)) iTokOff = int32(*(*Ti64)(unsafe.Pointer(bp + 24)) & libc.Int64FromInt32(0x7FFFFFFF)) @@ -290843,8 +280975,6 @@ type TFts5Sorter = struct { FiRowid Ti64 FaPoslist uintptr FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte } type Fts5Sorter = TFts5Sorter @@ -290899,89 +281029,6 @@ type TFts5TransactionState = struct { type Fts5TransactionState = TFts5TransactionState -/* -** A single object of this type is allocated when the FTS5 module is -** registered with a database handle. It is used to store pointers to -** all registered FTS5 extensions - tokenizers and auxiliary functions. - */ -type TFts5Global1 = struct { - F__ccgo_align [0]uint32 - Fapi Tfts5_api - Fdb uintptr - F__ccgo_align2 [4]byte - FiNextId Ti64 - FpAux uintptr - FpTok uintptr - FpDfltTok uintptr - FpCsr uintptr - FaLocaleHdr [4]Tu32 -} - -type Fts5Global1 = TFts5Global1 - -/* -** Size of header on fts5_locale() values. And macro to access a buffer -** containing a copy of the header from an Fts5Config pointer. - */ - -/* -** Each auxiliary function registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pAux list. - */ -type TFts5Auxiliary1 = struct { - FpGlobal uintptr - FzFunc uintptr - FpUserData uintptr - FxFunc Tfts5_extension_function - FxDestroy uintptr - FpNext uintptr -} - -type Fts5Auxiliary1 = TFts5Auxiliary1 - -/* -** Each tokenizer module registered with the FTS5 module is represented -** by an object of the following type. All such objects are stored as part -** of the Fts5Global.pTok list. -** -** bV2Native: -** True if the tokenizer was registered using xCreateTokenizer_v2(), false -** for xCreateTokenizer(). If this variable is true, then x2 is populated -** with the routines as supplied by the caller and x1 contains synthesized -** wrapper routines. In this case the user-data pointer passed to -** x1.xCreate should be a pointer to the Fts5TokenizerModule structure, -** not a copy of pUserData. -** -** Of course, if bV2Native is false, then x1 contains the real routines and -** x2 the synthesized ones. In this case a pointer to the Fts5TokenizerModule -** object should be passed to x2.xCreate. -** -** The synthesized wrapper routines are necessary for xFindTokenizer(_v2) -** calls. - */ -type TFts5TokenizerModule1 = struct { - FzName uintptr - FpUserData uintptr - FbV2Native int32 - Fx1 Tfts5_tokenizer - Fx2 Tfts5_tokenizer_v2 - FxDestroy uintptr - FpNext uintptr -} - -type Fts5TokenizerModule1 = TFts5TokenizerModule1 - -type TFts5FullTable1 = struct { - Fp TFts5Table - FpStorage uintptr - FpGlobal uintptr - FpSortCsr uintptr - FiSavepoint int32 -} - -type Fts5FullTable1 = TFts5FullTable1 - type TFts5MatchPhrase = struct { FpPoslist uintptr FnTerm int32 @@ -290989,101 +281036,6 @@ type TFts5MatchPhrase = struct { type Fts5MatchPhrase = TFts5MatchPhrase -/* -** pStmt: -** SELECT rowid, FROM ORDER BY +rank; -** -** aIdx[]: -** There is one entry in the aIdx[] array for each phrase in the query, -** the value of which is the offset within aPoslist[] following the last -** byte of the position list for the corresponding phrase. - */ -type TFts5Sorter1 = struct { - F__ccgo_align [0]uint32 - FpStmt uintptr - F__ccgo_align1 [4]byte - FiRowid Ti64 - FaPoslist uintptr - FnIdx int32 - FaIdx [1]int32 - F__ccgo_pad5 [4]byte -} - -type Fts5Sorter1 = TFts5Sorter1 - -/* -** Virtual-table cursor object. -** -** iSpecial: -** If this is a 'special' query (refer to function fts5SpecialMatch()), -** then this variable contains the result of the query. -** -** iFirstRowid, iLastRowid: -** These variables are only used for FTS5_PLAN_MATCH cursors. Assuming the -** cursor iterates in ascending order of rowids, iFirstRowid is the lower -** limit of rowids to return, and iLastRowid the upper. In other words, the -** WHERE clause in the user's query might have been: -** -** MATCH AND rowid BETWEEN $iFirstRowid AND $iLastRowid -** -** If the cursor iterates in descending order of rowid, iFirstRowid -** is the upper limit (i.e. the "first" rowid visited) and iLastRowid -** the lower. - */ -type TFts5Cursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FpNext uintptr - FaColumnSize uintptr - F__ccgo_align3 [4]byte - FiCsrId Ti64 - FePlan int32 - FbDesc int32 - FiFirstRowid Ti64 - FiLastRowid Ti64 - FpStmt uintptr - FpExpr uintptr - FpSorter uintptr - Fcsrflags int32 - FiSpecial Ti64 - FzRank uintptr - FzRankArgs uintptr - FpRank uintptr - FnRankArg int32 - FapRankArg uintptr - FpRankArgStmt uintptr - FpAux uintptr - FpAuxdata uintptr - FaInstIter uintptr - FnInstAlloc int32 - FnInstCount int32 - FaInst uintptr -} - -type Fts5Cursor1 = TFts5Cursor1 - -/* -** Bits that make up the "idxNum" parameter passed indirectly by -** xBestIndex() to xFilter(). - */ - -/* -** Values for Fts5Cursor.csrflags - */ - -/* -** Macros to Set(), Clear() and Test() cursor flags. - */ - -type TFts5Auxdata1 = struct { - FpAux uintptr - FpPtr uintptr - FxDelete uintptr - FpNext uintptr -} - -type Fts5Auxdata1 = TFts5Auxdata1 - // C documentation // // /* @@ -291334,7 +281286,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) nSeenMatch = 0 bSeenRank = 0 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLock != 0 { - (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38726, 0) + (*TFts5Table)(unsafe.Pointer(pTab)).Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38924, 0) return int32(SQLITE_ERROR) } idxStr = Xsqlite3_malloc(tls, (*Tsqlite3_index_info)(unsafe.Pointer(pInfo)).FnConstraint*int32(8)+int32(1)) @@ -291371,7 +281323,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v3 = iIdxStr iIdxStr++ *(*int8)(unsafe.Pointer(idxStr + uintptr(v3))) = int8('M') - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6512, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6600, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) } iCons++ @@ -291390,7 +281342,7 @@ func _fts5BestIndexMethod(tls *libc.TLS, pVTab uintptr, pInfo uintptr) (r int32) v6 = int32('G') } *(*int8)(unsafe.Pointer(idxStr + uintptr(v5))) = int8(v6) - Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6512, libc.VaList(bp+8, iCol)) + Xsqlite3_snprintf(tls, int32(6), idxStr+uintptr(iIdxStr), __ccgo_ts+6600, libc.VaList(bp+8, iCol)) idxStr += uintptr(libc.Xstrlen(tls, idxStr+uintptr(iIdxStr))) iCons++ v7 = iCons @@ -291840,7 +281792,7 @@ func _fts5NextMethod(tls *libc.TLS, pCursor uintptr) (r int32) { *(*int32)(unsafe.Pointer(pCsr + 60)) |= int32(FTS5CSR_EOF) rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc != SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + (*Tsqlite3_vtab)(unsafe.Pointer((*Tsqlite3_vtab_cursor)(unsafe.Pointer(pCursor)).FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } } else { rc = SQLITE_OK @@ -291868,7 +281820,7 @@ func _fts5PrepareStatement(tls *libc.TLS, ppStmt uintptr, pConfig uintptr, zFmt } else { rc = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp, uintptr(0)) if rc != SQLITE_OK { - _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+4710, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) + _sqlite3Fts5ConfigErrmsg(tls, pConfig, __ccgo_ts+4829, libc.VaList(bp+16, Xsqlite3_errmsg(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb))) } Xsqlite3_free(tls, zSql) } @@ -291888,7 +281840,7 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs nPhrase = _sqlite3Fts5ExprPhraseCount(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpExpr) - nByte = int64(uint32(32) + uint32(4)*uint32(nPhrase-libc.Int32FromInt32(1))) + nByte = int64(uint32(libc.UintptrFromInt32(0)+20) + uint32((nPhrase+libc.Int32FromInt32(2))/libc.Int32FromInt32(2))*libc.Uint32FromInt64(8)) pSorter = Xsqlite3_malloc64(tls, uint64(nByte)) if pSorter == uintptr(0) { return int32(SQLITE_NOMEM) @@ -291903,21 +281855,21 @@ func _fts5CursorFirstSorted(tls *libc.TLS, pTab uintptr, pCsr uintptr, bDesc int ** ** If SQLite a built-in statement cache, this wouldn't be a problem. */ if zRankArgs != 0 { - v1 = __ccgo_ts + 16459 + v1 = __ccgo_ts + 16575 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } if zRankArgs != 0 { v2 = zRankArgs } else { - v2 = __ccgo_ts + 1673 + v2 = __ccgo_ts + 1674 } if bDesc != 0 { - v3 = __ccgo_ts + 38765 + v3 = __ccgo_ts + 38963 } else { - v3 = __ccgo_ts + 38770 + v3 = __ccgo_ts + 38968 } - rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+38774, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) + rc = _fts5PrepareStatement(tls, pSorter, pConfig, __ccgo_ts+38972, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zRank, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, v1, v2, v3)) (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpSorter = pSorter if rc == SQLITE_OK { (*TFts5FullTable)(unsafe.Pointer(pTab)).FpSortCsr = pCsr @@ -291975,14 +281927,14 @@ func _fts5SpecialMatch(tls *libc.TLS, pTab uintptr, pCsr uintptr, zQuery uintptr n++ } (*TFts5Cursor)(unsafe.Pointer(pCsr)).FePlan = int32(FTS5_PLAN_SPECIAL) - if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+38829, z, n) { + if n == int32(5) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+39027, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = int64(_sqlite3Fts5IndexReads(tls, (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.FpIndex)) } else { - if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+6871, z, n) { + if n == int32(2) && 0 == Xsqlite3_strnicmp(tls, __ccgo_ts+6959, z, n) { (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiSpecial = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FiCsrId } else { /* An unrecognized directive. Return an error message. */ - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38835, libc.VaList(bp+8, n, z)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39033, libc.VaList(bp+8, n, z)) rc = int32(SQLITE_ERROR) } } @@ -292032,7 +281984,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { zRank = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank zRankArgs = (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs if zRankArgs != 0 { - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38863, libc.VaList(bp+16, zRankArgs)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39061, libc.VaList(bp+16, zRankArgs)) if zSql != 0 { *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v3(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, zSql, -int32(1), uint32(SQLITE_PREPARE_PERSISTENT), bp+4, uintptr(0)) @@ -292065,7 +282017,7 @@ func _fts5FindRankFunction(tls *libc.TLS, pCsr uintptr) (r int32) { if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { pAux = _fts5FindAuxiliary(tls, pTab, zRank) if pAux == uintptr(0) { - (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38873, libc.VaList(bp+16, zRank)) + (*TFts5FullTable)(unsafe.Pointer(pTab)).Fp.Fbase.FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39071, libc.VaList(bp+16, zRank)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -292099,7 +282051,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui *(*int32)(unsafe.Pointer(pCsr + 60)) |= int32(FTS5CSR_FREE_ZRANK) } else { if rc == int32(SQLITE_ERROR) { - (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+38894, libc.VaList(bp+16, z)) + (*Tsqlite3_vtab)(unsafe.Pointer((*TFts5Cursor)(unsafe.Pointer(pCsr)).Fbase.FpVtab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+39092, libc.VaList(bp+16, z)) } } } else { @@ -292107,7 +282059,7 @@ func _fts5CursorParseRank(tls *libc.TLS, pConfig uintptr, pCsr uintptr, pRank ui (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRank (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = (*TFts5Config)(unsafe.Pointer(pConfig)).FzRankArgs } else { - (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 36621 + (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRank = __ccgo_ts + 36819 (*TFts5Cursor)(unsafe.Pointer(pCsr)).FzRankArgs = uintptr(0) } } @@ -292264,7 +282216,7 @@ func _fts5ExtractExprText(tls *libc.TLS, pConfig uintptr, pVal uintptr, pzText u *(*uintptr)(unsafe.Pointer(bp + 12)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 16)) = 0 *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+4, bp+8, bp+12, bp+16) - *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+38927, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) + *(*uintptr)(unsafe.Pointer(pzText)) = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+39125, libc.VaList(bp+32, *(*int32)(unsafe.Pointer(bp + 8)), *(*uintptr)(unsafe.Pointer(bp + 4)))) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5SetLocale(tls, pConfig, *(*uintptr)(unsafe.Pointer(bp + 12)), *(*int32)(unsafe.Pointer(bp + 16))) } @@ -292335,7 +282287,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint goto filter_out } if *(*uintptr)(unsafe.Pointer(bp + 4)) == uintptr(0) { - *(*uintptr)(unsafe.Pointer(bp + 4)) = __ccgo_ts + 1673 + *(*uintptr)(unsafe.Pointer(bp + 4)) = __ccgo_ts + 1674 } if Xsqlite3_value_subtype(tls, *(*uintptr)(unsafe.Pointer(apVal + uintptr(i)*4))) == uint32(FTS5_INSTTOKEN_SUBTYPE) { (*TFts5Config)(unsafe.Pointer(pConfig)).FbPrefixInsttoken = int32(1) @@ -292464,7 +282416,7 @@ func _fts5FilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, idxStr uint } } else { if (*TFts5Config)(unsafe.Pointer(pConfig)).FzContent == uintptr(0) { - _fts5SetVtabError(tls, pTab, __ccgo_ts+38932, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + _fts5SetVtabError(tls, pTab, __ccgo_ts+39130, libc.VaList(bp+24, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) rc = int32(SQLITE_ERROR) } else { /* This is either a full-table scan (ePlan==FTS5_PLAN_SCAN) or a lookup @@ -292597,10 +282549,10 @@ func _fts5SeekCursor(tls *libc.TLS, pCsr uintptr, bErrormsg int32) (r int32) { rc = Xsqlite3_reset(tls, (*TFts5Cursor)(unsafe.Pointer(pCsr)).FpStmt) if rc == SQLITE_OK { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< int32(FTS5_STMT_LOOKUP2) && eStmt < int32(FTS5_STMT_SCAN) { /* One of the internal tables - not the %_content table - is missing. @@ -295138,12 +285025,12 @@ func _sqlite3Fts5DropAll(tls *libc.TLS, pConfig uintptr) (r int32) { defer tls.Free(64) var rc int32 _ = rc - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40281, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40479, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40385, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40583, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40423, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40621, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } return rc } @@ -295152,7 +285039,7 @@ func _fts5StorageRenameOne(tls *libc.TLS, pConfig uintptr, pRc uintptr, zTail ui bp := tls.Alloc(48) defer tls.Free(48) if *(*int32)(unsafe.Pointer(pRc)) == SQLITE_OK { - *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40461, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) + *(*int32)(unsafe.Pointer(pRc)) = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40659, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zTail, zName, zTail)) } } @@ -295164,14 +285051,14 @@ func _sqlite3Fts5StorageRename(tls *libc.TLS, pStorage uintptr, zName uintptr) ( _ = pConfig pConfig = (*TFts5Storage)(unsafe.Pointer(pStorage)).FpConfig *(*int32)(unsafe.Pointer(bp)) = _sqlite3Fts5StorageSync(tls, pStorage) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+27332, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13289, zName) - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39615, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+27478, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+13405, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+39813, zName) if (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37521, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37719, zName) } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { - _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+36826, zName) + _fts5StorageRenameOne(tls, pConfig, bp, __ccgo_ts+37024, zName) } return *(*int32)(unsafe.Pointer(bp)) } @@ -295191,13 +285078,13 @@ func _sqlite3Fts5CreateTable(tls *libc.TLS, pConfig uintptr, zPost uintptr, zDef _, _ = rc, v1 *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) if bWithout != 0 { - v1 = __ccgo_ts + 31972 + v1 = __ccgo_ts + 32118 } else { - v1 = __ccgo_ts + 1673 + v1 = __ccgo_ts + 1674 } - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+40503, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, bp, __ccgo_ts+40701, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, zDefn, v1)) if *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40533, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+40731, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zPost, *(*uintptr)(unsafe.Pointer(bp)))) Xsqlite3_free(tls, *(*uintptr)(unsafe.Pointer(bp))) } return rc @@ -295238,7 +285125,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr if zDefn == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { - Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+40577, 0) + Xsqlite3_snprintf(tls, nDefn, zDefn, __ccgo_ts+40775, 0) iOff = int32(libc.Xstrlen(tls, zDefn)) i = 0 for { @@ -295246,7 +285133,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL || *(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i))) != 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40600, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40798, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _2 @@ -295261,7 +285148,7 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr break } if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(i)))) == 0 { - Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40606, libc.VaList(bp+8, i)) + Xsqlite3_snprintf(tls, nDefn-iOff, zDefn+uintptr(iOff), __ccgo_ts+40804, libc.VaList(bp+8, i)) iOff += int32(libc.Xstrlen(tls, zDefn+uintptr(iOff))) } goto _3 @@ -295270,22 +285157,22 @@ func _sqlite3Fts5StorageOpen(tls *libc.TLS, pConfig uintptr, pIndex uintptr, bCr i++ } } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+36826, zDefn, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37024, zDefn, 0, pzErr) } Xsqlite3_free(tls, zDefn) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - zCols = __ccgo_ts + 40612 + zCols = __ccgo_ts + 40810 if (*TFts5Config)(unsafe.Pointer(pConfig)).FbContentlessDelete != 0 { - zCols = __ccgo_ts + 40644 + zCols = __ccgo_ts + 40842 } - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37521, zCols, 0, pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+37719, zCols, 0, pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39615, __ccgo_ts+40692, int32(1), pzErr) + rc = _sqlite3Fts5CreateTable(tls, pConfig, __ccgo_ts+39813, __ccgo_ts+40890, int32(1), pzErr) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37703, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37901, uintptr(0), int32(FTS5_CURRENT_VERSION)) } } if rc != 0 { @@ -295330,14 +285217,6 @@ type TFts5InsertCtx = struct { type Fts5InsertCtx = TFts5InsertCtx -type TFts5InsertCtx1 = struct { - FpStorage uintptr - FiCol int32 - FszCol int32 -} - -type Fts5InsertCtx1 = TFts5InsertCtx1 - // C documentation // // /* @@ -295407,14 +285286,14 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint bp := tls.Alloc(32) defer tls.Free(32) var iCol, rc, rc2 int32 - var pConfig, pVal uintptr + var pConfig, pFree, pVal, v2 uintptr var _ /* ctx at bp+4 */ TFts5InsertCtx var _ /* nLoc at bp+28 */ int32 var _ /* nText at bp+20 */ int32 var _ /* pLoc at bp+24 */ uintptr var _ /* pSeek at bp+0 */ uintptr var _ /* pText at bp+16 */ uintptr - _, _, _, _, _ = iCol, pConfig, pVal, rc, rc2 + _, _, _, _, _, _, _ = iCol, pConfig, pFree, pVal, rc, rc2, v2 pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig *(*uintptr)(unsafe.Pointer(bp)) = uintptr(0) /* SELECT to read row iDel from %_data */ rc = SQLITE_OK @@ -295442,6 +285321,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } if int32(*(*Tu8)(unsafe.Pointer((*TFts5Config)(unsafe.Pointer(pConfig)).FabUnindexed + uintptr(iCol-int32(1))))) == 0 { pVal = uintptr(0) + pFree = uintptr(0) *(*uintptr)(unsafe.Pointer(bp + 16)) = uintptr(0) *(*int32)(unsafe.Pointer(bp + 20)) = 0 *(*uintptr)(unsafe.Pointer(bp + 24)) = uintptr(0) @@ -295454,11 +285334,24 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && _sqlite3Fts5IsLocaleValue(tls, pConfig, pVal) != 0 { rc = _sqlite3Fts5DecodeLocaleValue(tls, pVal, bp+16, bp+20, bp+24, bp+28) } else { - *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_text(tls, pVal) - *(*int32)(unsafe.Pointer(bp + 20)) = Xsqlite3_value_bytes(tls, pVal) - if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { - *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) - *(*int32)(unsafe.Pointer(bp + 28)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + if Xsqlite3_value_type(tls, pVal) != int32(SQLITE_TEXT) { + /* Make a copy of the value to work with. This is because the call + ** to sqlite3_value_text() below forces the type of the value to + ** SQLITE_TEXT, and we may need to use it again later. */ + v2 = Xsqlite3_value_dup(tls, pVal) + pVal = v2 + pFree = v2 + if pVal == uintptr(0) { + rc = int32(SQLITE_NOMEM) + } + } + if rc == SQLITE_OK { + *(*uintptr)(unsafe.Pointer(bp + 16)) = Xsqlite3_value_text(tls, pVal) + *(*int32)(unsafe.Pointer(bp + 20)) = Xsqlite3_value_bytes(tls, pVal) + if (*TFts5Config)(unsafe.Pointer(pConfig)).FbLocale != 0 && *(*uintptr)(unsafe.Pointer(bp)) != 0 { + *(*uintptr)(unsafe.Pointer(bp + 24)) = Xsqlite3_column_text(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + *(*int32)(unsafe.Pointer(bp + 28)) = Xsqlite3_column_bytes(tls, *(*uintptr)(unsafe.Pointer(bp)), iCol+(*TFts5Config)(unsafe.Pointer(pConfig)).FnCol) + } } } if rc == SQLITE_OK { @@ -295471,6 +285364,7 @@ func _fts5StorageDeleteFromIndex(tls *libc.TLS, p uintptr, iDel Ti64, apVal uint } _sqlite3Fts5ClearLocale(tls, pConfig) } + Xsqlite3_value_free(tls, pFree) } goto _1 _1: @@ -295705,12 +285599,12 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig (*TFts5Storage)(unsafe.Pointer(p)).FbTotalsValid = 0 /* Delete the contents of the %_data and %_docsize tables. */ - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40709, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40907, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FbColumnsize != 0 { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40759, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40957, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == int32(FTS5_CONTENT_UNINDEXED) { - rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40788, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) + rc = _fts5ExecPrintf(tls, (*TFts5Config)(unsafe.Pointer(pConfig)).Fdb, uintptr(0), __ccgo_ts+40986, libc.VaList(bp+8, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName)) } /* Reinitialize the %_data table. This call creates the initial structure ** and averages records. */ @@ -295718,7 +285612,7 @@ func _sqlite3Fts5StorageDeleteAll(tls *libc.TLS, p uintptr) (r int32) { rc = _sqlite3Fts5IndexReinit(tls, (*TFts5Storage)(unsafe.Pointer(p)).FpIndex) } if rc == SQLITE_OK { - rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37703, uintptr(0), int32(FTS5_CURRENT_VERSION)) + rc = _sqlite3Fts5StorageConfigValue(tls, p, __ccgo_ts+37901, uintptr(0), int32(FTS5_CURRENT_VERSION)) } return rc } @@ -296020,7 +285914,7 @@ func _fts5StorageCount(tls *libc.TLS, p uintptr, zSuffix uintptr, pnRow uintptr) var _ /* pCnt at bp+0 */ uintptr _, _, _ = pConfig, rc, zSql pConfig = (*TFts5Storage)(unsafe.Pointer(p)).FpConfig - zSql = Xsqlite3_mprintf(tls, __ccgo_ts+40817, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) + zSql = Xsqlite3_mprintf(tls, __ccgo_ts+41015, libc.VaList(bp+16, (*TFts5Config)(unsafe.Pointer(pConfig)).FzDb, (*TFts5Config)(unsafe.Pointer(pConfig)).FzName, zSuffix)) if zSql == uintptr(0) { rc = int32(SQLITE_NOMEM) } else { @@ -296054,18 +285948,6 @@ type TFts5IntegrityCtx = struct { type Fts5IntegrityCtx = TFts5IntegrityCtx -type TFts5IntegrityCtx1 = struct { - F__ccgo_align [0]uint32 - FiRowid Ti64 - FiCol int32 - FszCol int32 - Fcksum Tu64 - FpTermset uintptr - FpConfig uintptr -} - -type Fts5IntegrityCtx1 = TFts5IntegrityCtx1 - // C documentation // // /* @@ -296254,14 +286136,14 @@ func _sqlite3Fts5StorageIntegrity(tls *libc.TLS, p uintptr, iArg int32) (r int32 ** number of rows. */ if rc == SQLITE_OK && (*TFts5Config)(unsafe.Pointer(pConfig)).FeContent == FTS5_CONTENT_NORMAL { *(*Ti64)(unsafe.Pointer(bp + 56)) = 0 - rc = _fts5StorageCount(tls, p, __ccgo_ts+36826, bp+56) + rc = _fts5StorageCount(tls, p, __ccgo_ts+37024, bp+56) if rc == SQLITE_OK && *(*Ti64)(unsafe.Pointer(bp + 56)) != (*TFts5Storage)(unsafe.Pointer(p)).FnTotalRow { rc = libc.Int32FromInt32(SQLITE_CORRUPT) | libc.Int32FromInt32(1)< 0 { zBase = *(*uintptr)(unsafe.Pointer(azArg)) @@ -297293,14 +287149,6 @@ type TPorterContext = struct { type PorterContext = TPorterContext -type TPorterContext1 = struct { - FpCtx uintptr - FxToken uintptr - FaBuf uintptr -} - -type PorterContext1 = TPorterContext1 - type TPorterRule = struct { FzSuffix uintptr FnSuffix int32 @@ -297311,16 +287159,6 @@ type TPorterRule = struct { type PorterRule = TPorterRule -type TPorterRule1 = struct { - FzSuffix uintptr - FnSuffix int32 - FxCond uintptr - FzOutput uintptr - FnOutput int32 -} - -type PorterRule1 = TPorterRule1 - func _fts5PorterIsVowel(tls *libc.TLS, c int8, bYIsVowel int32) (r int32) { return libc.BoolInt32(int32(c) == int32('a') || int32(c) == int32('e') || int32(c) == int32('i') || int32(c) == int32('o') || int32(c) == int32('u') || bYIsVowel != 0 && int32(c) == int32('y')) } @@ -297466,64 +287304,64 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40919, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41117, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40922, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41120, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40927, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41125, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('e'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40932, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41130, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40935, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41133, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } case int32('l'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40938, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41136, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40943, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41141, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40948, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41146, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40952, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41150, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40958, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41156, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40963, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41161, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -297532,49 +287370,49 @@ func _fts5PorterStep4(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40967, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41165, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1_and_S_or_T(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40971, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41169, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) } } } case int32('s'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40974, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41172, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('t'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40978, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41176, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40982, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41180, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40986, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41184, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40990, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41188, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('z'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40994, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41192, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt1(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } @@ -297591,20 +287429,20 @@ func _fts5PorterStep1B2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+40998, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40978, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41196, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41176, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('b'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41001, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41004, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41199, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41202, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } case int32('i'): - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41008, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+40994, uint32(3)) + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41206, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(2)), __ccgo_ts+41192, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) + int32(3) ret = int32(1) } @@ -297620,75 +287458,75 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41011, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41209, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40978, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41176, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41019, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41217, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41026, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41224, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(4) } } } case int32('c'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41031, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41229, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40927, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41125, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41036, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41234, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40922, uint32(4)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41120, uint32(4)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(4) } } } case int32('e'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41041, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41239, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40994, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41192, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('g'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41046, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41244, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+17362, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+17525, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } case int32('l'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41051, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41249, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41004, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41202, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41055, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41253, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40919, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41117, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41060, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41258, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40963, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41161, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41066, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41264, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41070, uint32(1)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41268, uint32(1)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(1) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41072, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41270, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40986, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41184, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } @@ -297697,48 +287535,48 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('o'): - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41078, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41276, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40994, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41192, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41086, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41284, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40978, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41176, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41092, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41290, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40978, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41176, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(3) } } } } case int32('s'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41097, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41295, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40919, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41117, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41103, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41301, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40990, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41188, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41111, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41309, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41119, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41317, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } else { - if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41123, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { + if nBuf > int32(7) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41321, aBuf+uintptr(nBuf-int32(7)), uint32(7)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(7)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+40986, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(7)), __ccgo_ts+41184, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(7) + int32(3) } } @@ -297746,21 +287584,21 @@ func _fts5PorterStep2(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41131, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41329, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40919, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41117, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41137, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41335, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40990, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41188, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(3) } } else { - if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41143, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { + if nBuf > int32(6) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41341, aBuf+uintptr(nBuf-int32(6)), uint32(6)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(6)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41004, uint32(3)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(6)), __ccgo_ts+41202, uint32(3)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(6) + int32(3) } } @@ -297778,48 +287616,48 @@ func _fts5PorterStep3(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('a'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41150, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41348, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+40935, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(4)), __ccgo_ts+41133, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) + int32(2) } } case int32('s'): - if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41155, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { + if nBuf > int32(4) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41353, aBuf+uintptr(nBuf-int32(4)), uint32(4)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(4)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(4) } } case int32('t'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41160, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41358, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40935, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41133, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } else { - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41166, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41364, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40935, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41133, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } } case int32('u'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41119, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41317, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) } } case int32('v'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41172, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41370, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) } } case int32('z'): - if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41178, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { + if nBuf > int32(5) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41376, aBuf+uintptr(nBuf-int32(5)), uint32(5)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(5)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+40919, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(5)), __ccgo_ts+41117, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(5) + int32(2) } } @@ -297835,13 +287673,13 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { nBuf = *(*int32)(unsafe.Pointer(pnBuf)) switch int32(*(*int8)(unsafe.Pointer(aBuf + uintptr(nBuf-int32(2))))) { case int32('e'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41184, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41382, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_MGt0(tls, aBuf, nBuf-int32(3)) != 0 { - libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41188, uint32(2)) + libc.Xmemcpy(tls, aBuf+uintptr(nBuf-int32(3)), __ccgo_ts+41386, uint32(2)) *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) + int32(2) } } else { - if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41191, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { + if nBuf > int32(2) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41389, aBuf+uintptr(nBuf-int32(2)), uint32(2)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(2)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(2) ret = int32(1) @@ -297849,7 +287687,7 @@ func _fts5PorterStep1B(tls *libc.TLS, aBuf uintptr, pnBuf uintptr) (r int32) { } } case int32('n'): - if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41194, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { + if nBuf > int32(3) && 0 == libc.Xmemcmp(tls, __ccgo_ts+41392, aBuf+uintptr(nBuf-int32(3)), uint32(3)) { if _fts5Porter_Vowel(tls, aBuf, nBuf-int32(3)) != 0 { *(*int32)(unsafe.Pointer(pnBuf)) = nBuf - int32(3) ret = int32(1) @@ -297946,14 +287784,14 @@ pass_through: // /* // ** Tokenize using the porter tokenizer. // */ -func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, xToken uintptr) (r int32) { +func _fts5PorterTokenize(tls *libc.TLS, pTokenizer uintptr, pCtx uintptr, flags int32, pText uintptr, nText int32, pLoc uintptr, nLoc int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var p uintptr var _ /* sCtx at bp+0 */ TPorterContext _ = p p = pTokenizer - (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = xToken + (*(*TPorterContext)(unsafe.Pointer(bp))).FxToken = __ccgo_fp_xToken (*(*TPorterContext)(unsafe.Pointer(bp))).FpCtx = pCtx (*(*TPorterContext)(unsafe.Pointer(bp))).FaBuf = p + 20 return (*(*func(*libc.TLS, uintptr, uintptr, int32, uintptr, int32, uintptr, int32, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*TPorterTokenizer)(unsafe.Pointer(p)).Ftokenizer_v2.FxTokenize})))(tls, (*TPorterTokenizer)(unsafe.Pointer(p)).FpTokenizer, bp, flags, pText, nText, pLoc, nLoc, __ccgo_fp(_fts5PorterCb)) @@ -297971,13 +287809,6 @@ type TTrigramTokenizer = struct { type TrigramTokenizer = TTrigramTokenizer -type TTrigramTokenizer1 = struct { - FbFold int32 - FiFoldParam int32 -} - -type TrigramTokenizer1 = TTrigramTokenizer1 - // C documentation // // /* @@ -298014,14 +287845,14 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p break } zArg = *(*uintptr)(unsafe.Pointer(azArg + uintptr(i+int32(1))*4)) - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+41198) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+41396) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { (*TTrigramTokenizer)(unsafe.Pointer(pNew)).FbFold = libc.BoolInt32(int32(*(*int8)(unsafe.Pointer(zArg))) == int32('0')) } } else { - if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+40891) { + if 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer(azArg + uintptr(i)*4)), __ccgo_ts+41089) { if int32(*(*int8)(unsafe.Pointer(zArg))) != int32('0') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('1') && int32(*(*int8)(unsafe.Pointer(zArg))) != int32('2') || *(*int8)(unsafe.Pointer(zArg + 1)) != 0 { rc = int32(SQLITE_ERROR) } else { @@ -298059,7 +287890,7 @@ func _fts5TriCreate(tls *libc.TLS, pUnused uintptr, azArg uintptr, nArg int32, p // /* // ** Trigram tokenizer tokenize routine. // */ -func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, xToken uintptr) (r int32) { +func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int32, pText uintptr, nText int32, __ccgo_fp_xToken uintptr) (r int32) { bp := tls.Alloc(32) defer tls.Free(32) var aStart [3]int32 @@ -298187,7 +288018,7 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int } } /* Pass the current trigram back to fts5 */ - rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{xToken})))(tls, pCtx, 0, bp, int32(zOut)-t__predefined_ptrdiff_t(bp), aStart[0], iNext) + rc = (*(*func(*libc.TLS, uintptr, int32, uintptr, int32, int32, int32) int32)(unsafe.Pointer(&struct{ uintptr }{__ccgo_fp_xToken})))(tls, pCtx, 0, bp, int32(zOut)-t__predefined_ptrdiff_t(bp), aStart[0], iNext) if iCode == uint32(0) || rc != SQLITE_OK { break } @@ -298263,11 +288094,11 @@ func _fts5TriTokenize(tls *libc.TLS, pTok uintptr, pCtx uintptr, unusedFlags int // ** "trigram" tokenizer, case_sensitive=0 (the default) - FTS5_PATTERN_LIKE // ** all other tokenizers - FTS5_PATTERN_NONE // */ -func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) (r int32) { +func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, __ccgo_fp_xCreate uintptr, pTok uintptr) (r int32) { var p uintptr var v1 int32 _, _ = p, v1 - if xCreate == __ccgo_fp(_fts5TriCreate) { + if __ccgo_fp_xCreate == __ccgo_fp(_fts5TriCreate) { p = pTok if (*TTrigramTokenizer)(unsafe.Pointer(p)).FiFoldParam == 0 { if (*TTrigramTokenizer)(unsafe.Pointer(p)).FbFold != 0 { @@ -298289,7 +288120,7 @@ func _sqlite3Fts5TokenizerPattern(tls *libc.TLS, xCreate uintptr, pTok uintptr) // ** called for the first time in order to correctly handle LIKE/GLOB. // */ func _sqlite3Fts5TokenizerPreload(tls *libc.TLS, p uintptr) (r int32) { - return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+41213)) + return libc.BoolInt32((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FnArg >= int32(1) && 0 == Xsqlite3_stricmp(tls, *(*uintptr)(unsafe.Pointer((*TFts5TokenizerConfig)(unsafe.Pointer(p)).FazArg)), __ccgo_ts+41411)) } // C documentation @@ -298315,7 +288146,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { Fx Tfts5_tokenizer }{ 0: { - FzName: __ccgo_ts + 40909, + FzName: __ccgo_ts + 41107, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5UnicodeCreate), FxDelete: __ccgo_fp(_fts5UnicodeDelete), @@ -298323,7 +288154,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 1: { - FzName: __ccgo_ts + 41221, + FzName: __ccgo_ts + 41419, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5AsciiCreate), FxDelete: __ccgo_fp(_fts5AsciiDelete), @@ -298331,7 +288162,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { }, }, 2: { - FzName: __ccgo_ts + 41213, + FzName: __ccgo_ts + 41411, Fx: Tfts5_tokenizer{ FxCreate: __ccgo_fp(_fts5TriCreate), FxDelete: __ccgo_fp(_fts5TriDelete), @@ -298361,7 +288192,7 @@ func _sqlite3Fts5TokenizerInit(tls *libc.TLS, pApi uintptr) (r int32) { FxDelete: __ccgo_fp(_fts5PorterDelete), FxTokenize: __ccgo_fp(_fts5PorterTokenize), } - rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+41227, pApi, bp+48, uintptr(0)) + rc = (*(*func(*libc.TLS, uintptr, uintptr, uintptr, uintptr, uintptr) int32)(unsafe.Pointer(&struct{ uintptr }{(*Tfts5_api)(unsafe.Pointer(pApi)).FxCreateTokenizer_v2})))(tls, pApi, __ccgo_ts+41425, pApi, bp+48, uintptr(0)) } return rc } @@ -303825,42 +293656,6 @@ type TFts5VocabCursor = struct { type Fts5VocabCursor = TFts5VocabCursor -type TFts5VocabTable1 = struct { - Fbase Tsqlite3_vtab - FzFts5Tbl uintptr - FzFts5Db uintptr - Fdb uintptr - FpGlobal uintptr - FeType int32 - FbBusy uint32 -} - -type Fts5VocabTable1 = TFts5VocabTable1 - -type TFts5VocabCursor1 = struct { - F__ccgo_align [0]uint32 - Fbase Tsqlite3_vtab_cursor - FpStmt uintptr - FpFts5 uintptr - FbEof int32 - FpIter uintptr - FpStruct uintptr - FnLeTerm int32 - FzLeTerm uintptr - FcolUsed int32 - FiCol int32 - FaCnt uintptr - FaDoc uintptr - Frowid Ti64 - Fterm TFts5Buffer - F__ccgo_align14 [4]byte - FiInstPos Ti64 - FiInstOff int32 - F__ccgo_pad16 [4]byte -} - -type Fts5VocabCursor1 = TFts5VocabCursor1 - /* ** Bits for the mask used as the idxNum value by xBestIndex/xFilter. */ @@ -303883,16 +293678,16 @@ func _fts5VocabTableType(tls *libc.TLS, zType uintptr, pzErr uintptr, peType uin zCopy = _sqlite3Fts5Strndup(tls, bp, zType, -int32(1)) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { _sqlite3Fts5Dequote(tls, zCopy) - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41234) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41432) == 0 { *(*int32)(unsafe.Pointer(peType)) = FTS5_VOCAB_COL } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41238) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41436) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_ROW) } else { - if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41242) == 0 { + if Xsqlite3_stricmp(tls, zCopy, __ccgo_ts+41440) == 0 { *(*int32)(unsafe.Pointer(peType)) = int32(FTS5_VOCAB_INSTANCE) } else { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41251, libc.VaList(bp+16, zCopy)) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41449, libc.VaList(bp+16, zCopy)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } @@ -303955,21 +293750,22 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg bp := tls.Alloc(16) defer tls.Free(16) var azSchema [3]uintptr - var bDb, nByte, nDb, nTab int32 + var bDb int32 + var nByte, nDb, nTab Ti64 var pRet, zDb, zTab, zType, v1, v2, v3 uintptr var _ /* eType at bp+4 */ int32 var _ /* rc at bp+0 */ int32 _, _, _, _, _, _, _, _, _, _, _, _ = azSchema, bDb, nByte, nDb, nTab, pRet, zDb, zTab, zType, v1, v2, v3 azSchema = [3]uintptr{ - 0: __ccgo_ts + 41285, - 1: __ccgo_ts + 41325, - 2: __ccgo_ts + 41360, + 0: __ccgo_ts + 41483, + 1: __ccgo_ts + 41523, + 2: __ccgo_ts + 41558, } pRet = uintptr(0) *(*int32)(unsafe.Pointer(bp)) = SQLITE_OK - bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+25301, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) + bDb = libc.BoolInt32(argc == int32(6) && libc.Xstrlen(tls, *(*uintptr)(unsafe.Pointer(argv + 1*4))) == uint32(4) && libc.Xmemcmp(tls, __ccgo_ts+25464, *(*uintptr)(unsafe.Pointer(argv + 1*4)), uint32(4)) == 0) if argc != int32(5) && bDb == 0 { - *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41403, 0) + *(*uintptr)(unsafe.Pointer(pzErr)) = Xsqlite3_mprintf(tls, __ccgo_ts+41601, 0) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } else { if bDb != 0 { @@ -303990,15 +293786,15 @@ func _fts5VocabInitVtab(tls *libc.TLS, db uintptr, pAux uintptr, argc int32, arg v3 = *(*uintptr)(unsafe.Pointer(argv + 4*4)) } zType = v3 - nDb = int32(libc.Xstrlen(tls, zDb)) + int32(1) - nTab = int32(libc.Xstrlen(tls, zTab)) + int32(1) + nDb = int64(libc.Xstrlen(tls, zDb) + uint32(1)) + nTab = int64(libc.Xstrlen(tls, zTab) + uint32(1)) *(*int32)(unsafe.Pointer(bp + 4)) = 0 *(*int32)(unsafe.Pointer(bp)) = _fts5VocabTableType(tls, zType, pzErr, bp+4) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_declare_vtab(tls, db, azSchema[*(*int32)(unsafe.Pointer(bp + 4))]) } - nByte = int32(uint32(36) + uint32(nDb) + uint32(nTab)) - pRet = _sqlite3Fts5MallocZero(tls, bp, int64(nByte)) + nByte = int64(36) + nDb + nTab + pRet = _sqlite3Fts5MallocZero(tls, bp, nByte) if pRet != 0 { (*TFts5VocabTable)(unsafe.Pointer(pRet)).FpGlobal = pAux (*TFts5VocabTable)(unsafe.Pointer(pRet)).FeType = *(*int32)(unsafe.Pointer(bp + 4)) @@ -304139,10 +293935,10 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) zSql = uintptr(0) if (*TFts5VocabTable)(unsafe.Pointer(pTab)).FbBusy != 0 { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41436, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41634, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) return int32(SQLITE_ERROR) } - zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+41467, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + zSql = _sqlite3Fts5Mprintf(tls, bp, __ccgo_ts+41665, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) if zSql != 0 { *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_prepare_v2(tls, (*TFts5VocabTable)(unsafe.Pointer(pTab)).Fdb, zSql, -int32(1), bp+4, uintptr(0)) } @@ -304161,7 +293957,7 @@ func _fts5VocabOpenMethod(tls *libc.TLS, pVTab uintptr, ppCsr uintptr) (r int32) *(*int32)(unsafe.Pointer(bp)) = Xsqlite3_finalize(tls, *(*uintptr)(unsafe.Pointer(bp + 4))) *(*uintptr)(unsafe.Pointer(bp + 4)) = uintptr(0) if *(*int32)(unsafe.Pointer(bp)) == SQLITE_OK { - (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41518, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) + (*Tsqlite3_vtab)(unsafe.Pointer(pVTab)).FzErrMsg = Xsqlite3_mprintf(tls, __ccgo_ts+41716, libc.VaList(bp+16, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Db, (*TFts5VocabTable)(unsafe.Pointer(pTab)).FzFts5Tbl)) *(*int32)(unsafe.Pointer(bp)) = int32(SQLITE_ERROR) } } else { @@ -304487,7 +294283,7 @@ func _fts5VocabFilterMethod(tls *libc.TLS, pCursor uintptr, idxNum int32, zUnuse if pLe != 0 { zCopy = Xsqlite3_value_text(tls, pLe) if zCopy == uintptr(0) { - zCopy = __ccgo_ts + 1673 + zCopy = __ccgo_ts + 1674 } (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm = Xsqlite3_value_bytes(tls, pLe) (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FzLeTerm = Xsqlite3_malloc(tls, (*TFts5VocabCursor)(unsafe.Pointer(pCsr)).FnLeTerm+int32(1)) @@ -304611,7 +294407,7 @@ func _sqlite3Fts5VocabInit(tls *libc.TLS, pGlobal uintptr, db uintptr) (r int32) var p uintptr _ = p p = pGlobal - return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+41544, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) + return Xsqlite3_create_module_v2(tls, db, __ccgo_ts+41742, uintptr(unsafe.Pointer(&_fts5Vocab)), p, uintptr(0)) } var _fts5Vocab = Tsqlite3_module{ @@ -304666,15 +294462,15 @@ func init() { // /************** End of stmt.c ************************************************/ // /* Return the source-id for this library */ func Xsqlite3_sourceid(tls *libc.TLS) (r uintptr) { - return __ccgo_ts + 41554 + return __ccgo_ts + 41752 } type TAggInfo_col = struct { FpTab uintptr FpCExpr uintptr FiTable int32 - FiColumn Ti16 - FiSorterColumn Ti16 + FiColumn int32 + FiSorterColumn int32 } type AggInfo_col = TAggInfo_col @@ -305051,7 +294847,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see ** ** Since [version 3.6.18] ([dateof:3.6.18]), ** SQLite source code has been stored in the -** Fossil configuration management +** Fossil configuration management ** system. ^The SQLITE_SOURCE_ID macro evaluates to ** a string which identifies a particular check-in of SQLite ** within its configuration management system. ^The SQLITE_SOURCE_ID @@ -305099,11 +294895,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // ** // ** See also: [sqlite_version()] and [sqlite_source_id()]. // */ -var Xsqlite3_version = [7]int8{'3', '.', '4', '9', '.', '0'} +var Xsqlite3_version = [7]int8{'3', '.', '5', '0', '.', '4'} var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data -var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12-win32\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_W32\x00OMIT_SEH\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00AreFileApisANSI\x00CharLowerW\x00CharUpperW\x00CloseHandle\x00CreateFileA\x00CreateFileW\x00CreateFileMappingA\x00CreateFileMappingW\x00CreateMutexW\x00DeleteFileA\x00DeleteFileW\x00FileTimeToLocalFileTime\x00FileTimeToSystemTime\x00FlushFileBuffers\x00FormatMessageA\x00FormatMessageW\x00FreeLibrary\x00GetCurrentProcessId\x00GetDiskFreeSpaceA\x00GetDiskFreeSpaceW\x00GetFileAttributesA\x00GetFileAttributesW\x00GetFileAttributesExW\x00GetFileSize\x00GetFullPathNameA\x00GetFullPathNameW\x00GetLastError\x00GetProcAddressA\x00GetSystemInfo\x00GetSystemTime\x00GetSystemTimeAsFileTime\x00GetTempPathA\x00GetTempPathW\x00GetTickCount\x00GetVersionExA\x00GetVersionExW\x00HeapAlloc\x00HeapCreate\x00HeapDestroy\x00HeapFree\x00HeapReAlloc\x00HeapSize\x00HeapValidate\x00HeapCompact\x00LoadLibraryA\x00LoadLibraryW\x00LocalFree\x00LockFile\x00LockFileEx\x00MapViewOfFile\x00MultiByteToWideChar\x00QueryPerformanceCounter\x00ReadFile\x00SetEndOfFile\x00SetFilePointer\x00Sleep\x00SystemTimeToFileTime\x00UnlockFile\x00UnlockFileEx\x00UnmapViewOfFile\x00WideCharToMultiByte\x00WriteFile\x00CreateEventExW\x00WaitForSingleObject\x00WaitForSingleObjectEx\x00SetFilePointerEx\x00GetFileInformationByHandleEx\x00MapViewOfFileFromApp\x00CreateFile2\x00LoadPackagedLibrary\x00GetTickCount64\x00GetNativeSystemInfo\x00OutputDebugStringA\x00OutputDebugStringW\x00GetProcessHeap\x00CreateFileMappingFromApp\x00InterlockedCompareExchange\x00UuidCreate\x00UuidCreateSequential\x00FlushViewOfFile\x00%s\x00OsError 0x%lx (%lu)\x00os_win.c:%d: (%lu) %s(%s) - %s\x00delayed %dms for lock/sharing conflict at line %d\x00winSeekFile\x00winClose\x00winRead\x00winWrite1\x00winWrite2\x00winTruncate1\x00winTruncate2\x00winSync1\x00winSync2\x00winFileSize\x00winUnlockReadLock\x00winUnlock\x00winLockSharedMemory\x00%s-shm\x00readonly_shm\x00winOpenShm\x00winShmMap1\x00winShmMap2\x00winShmMap3\x00winUnmapfile1\x00winUnmapfile2\x00winMapfile1\x00winMapfile2\x00etilqs_\x00winGetTempname1\x00winGetTempname2\x00winGetTempname3\x00winGetTempname4\x00winGetTempname5\x00exclusive\x00winOpen\x00psow\x00winDelete\x00winAccess\x00%s%c%s\x00winFullPathname1\x00winFullPathname2\x00winFullPathname3\x00winFullPathname4\x00win32\x00win32-longpath\x00win32-none\x00win32-longpath-none\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d in [%s]: %s\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: [%s] %s\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00stat\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%Q\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dll\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00builtin\x00enc\x00narg\x00flags\x00wdth\x00hght\x00flgs\x00unique\x00origin\x00partial\x00rowid\x00fkid\x00file\x00busy\x00checkpointed\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_store_directory\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00access\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x000123456789abcdef\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-02-06 11:55:18 4a7dd425dc2a0e5082a9049c9b4a9d4f199a71583d014c24b4cfe276c5a77cde\x00" +var __ccgo_ts1 = "ATOMIC_INTRINSICS=1\x00COMPILER=gcc-12-win32\x00DEFAULT_AUTOVACUUM\x00DEFAULT_CACHE_SIZE=-2000\x00DEFAULT_FILE_FORMAT=4\x00DEFAULT_JOURNAL_SIZE_LIMIT=-1\x00DEFAULT_MEMSTATUS=0\x00DEFAULT_MMAP_SIZE=0\x00DEFAULT_PAGE_SIZE=4096\x00DEFAULT_PCACHE_INITSZ=20\x00DEFAULT_RECURSIVE_TRIGGERS\x00DEFAULT_SECTOR_SIZE=4096\x00DEFAULT_SYNCHRONOUS=2\x00DEFAULT_WAL_AUTOCHECKPOINT=1000\x00DEFAULT_WAL_SYNCHRONOUS=2\x00DEFAULT_WORKER_THREADS=0\x00DIRECT_OVERFLOW_READ\x00ENABLE_COLUMN_METADATA\x00ENABLE_DBSTAT_VTAB\x00ENABLE_FTS5\x00ENABLE_GEOPOLY\x00ENABLE_MATH_FUNCTIONS\x00ENABLE_MEMORY_MANAGEMENT\x00ENABLE_OFFSET_SQL_FUNC\x00ENABLE_PREUPDATE_HOOK\x00ENABLE_RBU\x00ENABLE_RTREE\x00ENABLE_SESSION\x00ENABLE_SNAPSHOT\x00ENABLE_STAT4\x00ENABLE_UNLOCK_NOTIFY\x00LIKE_DOESNT_MATCH_BLOBS\x00MALLOC_SOFT_LIMIT=1024\x00MAX_ATTACHED=10\x00MAX_COLUMN=2000\x00MAX_COMPOUND_SELECT=500\x00MAX_DEFAULT_PAGE_SIZE=8192\x00MAX_EXPR_DEPTH=1000\x00MAX_FUNCTION_ARG=1000\x00MAX_LENGTH=1000000000\x00MAX_LIKE_PATTERN_LENGTH=50000\x00MAX_MMAP_SIZE=0x7fff0000\x00MAX_PAGE_COUNT=0xfffffffe\x00MAX_PAGE_SIZE=65536\x00MAX_SQL_LENGTH=1000000000\x00MAX_TRIGGER_DEPTH=1000\x00MAX_VARIABLE_NUMBER=32766\x00MAX_VDBE_OP=250000000\x00MAX_WORKER_THREADS=8\x00MUTEX_NOOP\x00OMIT_SEH\x00SOUNDEX\x00SYSTEM_MALLOC\x00TEMP_STORE=1\x00THREADSAFE=1\x00ANY\x00BLOB\x00INT\x00INTEGER\x00REAL\x00TEXT\x0020b:20e\x0020c:20e\x0020e\x0040f-21a-21d\x00now\x00subsec\x00subsecond\x00local time unavailable\x00auto\x00ceiling\x00floor\x00julianday\x00localtime\x00unixepoch\x00utc\x00weekday \x00start of \x00month\x00year\x00day\x0040f\x0050f\x0040f-20a-20d\x0050f-20a-20d\x00%02d\x00%2d\x00%06.3f\x00%04d-%02d-%02d\x00%04d\x00%03d\x00%.16g\x00PM\x00pm\x00AM\x00am\x00%02d:%02d\x00%.3f\x00%lld\x00%02d:%02d:%02d\x00%c%04d-%02d-%02d %02d:%02d:%06.3f\x00date\x00time\x00datetime\x00strftime\x00timediff\x00current_time\x00current_timestamp\x00current_date\x00failed to allocate %u bytes of memory\x00failed memory resize %u to %u bytes\x00out of memory\x00%\x00null\x00NaN\x00-Inf\x00\x00NULL\x00(NULL)\x00unistr('\x000123456789abcdef\x00.\x00(join-%u)\x00%u-ROW VALUES CLAUSE\x00(subquery-%u)\x00unrecognized token: \"%s\"\x00922337203685477580\x00+- \n\t0123456789\x000\x00API call with %s database connection pointer\x00unopened\x00invalid\x00Savepoint\x00AutoCommit\x00Transaction\x00Checkpoint\x00JournalMode\x00Vacuum\x00VFilter\x00VUpdate\x00Init\x00Goto\x00Gosub\x00InitCoroutine\x00Yield\x00MustBeInt\x00Jump\x00Once\x00If\x00IfNot\x00IsType\x00Not\x00IfNullRow\x00SeekLT\x00SeekLE\x00SeekGE\x00SeekGT\x00IfNotOpen\x00IfNoHope\x00NoConflict\x00NotFound\x00Found\x00SeekRowid\x00NotExists\x00Last\x00IfSizeBetween\x00SorterSort\x00Sort\x00Rewind\x00SorterNext\x00Prev\x00Next\x00IdxLE\x00IdxGT\x00IdxLT\x00Or\x00And\x00IdxGE\x00RowSetRead\x00RowSetTest\x00Program\x00FkIfZero\x00IfPos\x00IsNull\x00NotNull\x00Ne\x00Eq\x00Gt\x00Le\x00Lt\x00Ge\x00ElseEq\x00IfNotZero\x00DecrJumpZero\x00IncrVacuum\x00VNext\x00Filter\x00PureFunc\x00Function\x00Return\x00EndCoroutine\x00HaltIfNull\x00Halt\x00Integer\x00Int64\x00String\x00BeginSubrtn\x00Null\x00SoftNull\x00Blob\x00Variable\x00Move\x00Copy\x00SCopy\x00IntCopy\x00FkCheck\x00ResultRow\x00CollSeq\x00AddImm\x00RealAffinity\x00Cast\x00Permutation\x00Compare\x00IsTrue\x00ZeroOrNull\x00Offset\x00Column\x00TypeCheck\x00Affinity\x00MakeRecord\x00Count\x00ReadCookie\x00SetCookie\x00ReopenIdx\x00OpenRead\x00BitAnd\x00BitOr\x00ShiftLeft\x00ShiftRight\x00Add\x00Subtract\x00Multiply\x00Divide\x00Remainder\x00Concat\x00OpenWrite\x00OpenDup\x00BitNot\x00OpenAutoindex\x00OpenEphemeral\x00String8\x00SorterOpen\x00SequenceTest\x00OpenPseudo\x00Close\x00ColumnsUsed\x00SeekScan\x00SeekHit\x00Sequence\x00NewRowid\x00Insert\x00RowCell\x00Delete\x00ResetCount\x00SorterCompare\x00SorterData\x00RowData\x00Rowid\x00NullRow\x00SeekEnd\x00IdxInsert\x00SorterInsert\x00IdxDelete\x00DeferredSeek\x00IdxRowid\x00FinishSeek\x00Destroy\x00Clear\x00ResetSorter\x00CreateBtree\x00SqlExec\x00ParseSchema\x00LoadAnalysis\x00DropTable\x00DropIndex\x00DropTrigger\x00Real\x00IntegrityCk\x00RowSetAdd\x00Param\x00FkCounter\x00MemMax\x00OffsetLimit\x00AggInverse\x00AggStep\x00AggStep1\x00AggValue\x00AggFinal\x00Expire\x00CursorLock\x00CursorUnlock\x00TableLock\x00VBegin\x00VCreate\x00VDestroy\x00VOpen\x00VCheck\x00VInitIn\x00VColumn\x00VRename\x00Pagecount\x00MaxPgcnt\x00ClrSubtype\x00GetSubtype\x00SetSubtype\x00FilterAdd\x00Trace\x00CursorHint\x00ReleaseReg\x00Noop\x00Explain\x00Abortable\x00AreFileApisANSI\x00CharLowerW\x00CharUpperW\x00CloseHandle\x00CreateFileA\x00CreateFileW\x00CreateFileMappingA\x00CreateFileMappingW\x00CreateMutexW\x00DeleteFileA\x00DeleteFileW\x00FileTimeToLocalFileTime\x00FileTimeToSystemTime\x00FlushFileBuffers\x00FormatMessageA\x00FormatMessageW\x00FreeLibrary\x00GetCurrentProcessId\x00GetDiskFreeSpaceA\x00GetDiskFreeSpaceW\x00GetFileAttributesA\x00GetFileAttributesW\x00GetFileAttributesExW\x00GetFileSize\x00GetFullPathNameA\x00GetFullPathNameW\x00GetLastError\x00GetProcAddressA\x00GetSystemInfo\x00GetSystemTime\x00GetSystemTimeAsFileTime\x00GetTempPathA\x00GetTempPathW\x00GetTickCount\x00GetVersionExA\x00GetVersionExW\x00HeapAlloc\x00HeapCreate\x00HeapDestroy\x00HeapFree\x00HeapReAlloc\x00HeapSize\x00HeapValidate\x00HeapCompact\x00LoadLibraryA\x00LoadLibraryW\x00LocalFree\x00LockFile\x00LockFileEx\x00MapViewOfFile\x00MultiByteToWideChar\x00QueryPerformanceCounter\x00ReadFile\x00SetEndOfFile\x00SetFilePointer\x00Sleep\x00SystemTimeToFileTime\x00UnlockFile\x00UnlockFileEx\x00UnmapViewOfFile\x00WideCharToMultiByte\x00WriteFile\x00CreateEventExW\x00WaitForSingleObject\x00WaitForSingleObjectEx\x00SetFilePointerEx\x00GetFileInformationByHandleEx\x00MapViewOfFileFromApp\x00CreateFile2\x00LoadPackagedLibrary\x00GetTickCount64\x00GetNativeSystemInfo\x00OutputDebugStringA\x00OutputDebugStringW\x00GetProcessHeap\x00CreateFileMappingFromApp\x00InterlockedCompareExchange\x00UuidCreate\x00UuidCreateSequential\x00FlushViewOfFile\x00CreateEvent\x00CancelIo\x00GetModuleHandleW\x00getenv\x00getcwd\x00readlink\x00lstat\x00__errno\x00cygwin_conv_path\x00%s\x00OsError 0x%lx (%lu)\x00os_win.c:%d: (%lu) %s(%s) - %s\x00delayed %dms for lock/sharing conflict at line %d\x00winSeekFile\x00winClose\x00winRead\x00winWrite1\x00winWrite2\x00winTruncate1\x00winTruncate2\x00winSync1\x00winSync2\x00winFileSize\x00winUnlockReadLock\x00winUnlock\x00%s-shm\x00readonly_shm\x00winShmMap1\x00winShmMap2\x00winShmMap3\x00winUnmapfile1\x00winUnmapfile2\x00winMapfile1\x00winMapfile2\x00etilqs_\x00winGetTempname1\x00winGetTempname2\x00winGetTempname3\x00winGetTempname4\x00winGetTempname5\x00exclusive\x00winOpen\x00psow\x00winDelete\x00winAccess\x00%s%c%s\x00winFullPathname1\x00winFullPathname2\x00winFullPathname3\x00winFullPathname4\x00win32\x00win32-longpath\x00win32-none\x00win32-longpath-none\x00memdb\x00memdb(%p,%lld)\x00PRAGMA \"%w\".page_count\x00BEGIN IMMEDIATE; COMMIT;\x00ATTACH x AS %Q\x00recovered %d pages from %s\x00-journal\x00-wal\x00nolock\x00immutable\x00PRAGMA table_list\x00recovered %d frames from WAL file %s\x00cannot limit WAL size: %s\x00:memory:\x00@ \x00\n\x00invalid page number %u\x002nd reference to page %u\x00Failed to read ptrmap key=%u\x00Bad ptr map entry key=%u expected=(%u,%u) got=(%u,%u)\x00failed to get page %u\x00freelist leaf count too big on page %u\x00size\x00overflow list length\x00%s is %u but should be %u\x00Tree %u page %u: \x00unable to get the page. error code=%d\x00btreeInitPage() returns error code %d\x00free space corruption\x00Tree %u page %u cell %u: \x00Tree %u page %u right child: \x00Offset %u out of range %u..%u\x00Extends off end of page\x00Rowid %lld out of order\x00Child page depth differs\x00Multiple uses for byte %u of page %u\x00Fragmentation of %u bytes reported as %u on page %u\x00Freelist: \x00max rootpage (%u) disagrees with header (%u)\x00incremental_vacuum enabled with a max rootpage of zero\x00Page %u: never used\x00Page %u: pointer map referenced\x00unknown database %s\x00destination database is in use\x00source and destination must be distinct\x00%!.15g\x00-\x00%s%s\x00k(%d\x00BINARY\x00B\x00N.\x00,%s%s%s\x00)\x00?\x008\x0016LE\x0016BE\x00%.18s-%s\x00%s(%d)\x00%d\x00(blob)\x00vtab:%p\x00%c%u\x00]\x00program\x00subrtnsig:%d,%s\x00%.4c%s%.16c\x00MJ delete: %s\x00MJ collide: %s\x00-mj%06X9%02X\x00FOREIGN KEY constraint failed\x00a CHECK constraint\x00a generated column\x00an index\x00non-deterministic use of %s() in %s\x00API called with finalized prepared statement\x00API called with NULL prepared statement\x00string or blob too big\x00addr\x00opcode\x00p1\x00p2\x00p3\x00p4\x00p5\x00comment\x00id\x00parent\x00notused\x00detail\x00bind on a busy prepared statement: [%s]\x00-- \x00'%.*q'\x00zeroblob(%d)\x00x'\x00%02x\x00'\x00NOT NULL\x00UNIQUE\x00CHECK\x00FOREIGN KEY\x00%s constraint failed\x00%z: %s\x00abort at %d: %s; [%s]\x00cannot store %s value in %s column %s.%s\x00cannot open savepoint - SQL statements in progress\x00no such savepoint: %s\x00cannot release savepoint - SQL statements in progress\x00cannot commit transaction - SQL statements in progress\x00cannot start a transaction within a transaction\x00cannot rollback - no transaction is active\x00cannot commit - no transaction is active\x00database schema has changed\x00index corruption\x00sqlite_master\x00SELECT*FROM\"%w\".%s WHERE %s ORDER BY rowid\x00too many levels of trigger recursion\x00into\x00out of\x00cannot change %s wal mode from within a transaction\x00database table is locked: %s\x00ValueList\x00-- %s\x00statement aborts at %d: %s; [%s]\x00real\x00integer\x00cannot open value of type %s\x00no such rowid: %lld\x00cannot open virtual table: %s\x00cannot open table without rowid: %s\x00cannot open table with generated columns: %s\x00cannot open view: %s\x00no such column: \"%s\"\x00foreign key\x00indexed\x00cannot open %s column for writing\x00sqlite_\x00sqlite_temp_master\x00sqlite_temp_schema\x00sqlite_schema\x00main\x00*\x00new\x00old\x00excluded\x00misuse of aliased aggregate %s\x00misuse of aliased window function %s\x00row value misused\x00double-quoted string literal: \"%w\"\x00coalesce\x00no such column\x00ambiguous column name\x00%s: %s.%s.%s\x00%s: %s.%s\x00%s: \"%s\" - should this be a string literal in single-quotes?\x00%s: %s\x00partial index WHERE clauses\x00index expressions\x00CHECK constraints\x00generated columns\x00%s prohibited in %s\x00the \".\" operator\x00second argument to %#T() must be a constant between 0.0 and 1.0\x00not authorized to use function: %#T\x00non-deterministic functions\x00%#T() may not be used as a window function\x00window\x00aggregate\x00misuse of %s function %#T()\x00no such function: %#T\x00wrong number of arguments to function %#T()\x00FILTER may not be used with non-aggregate %#T()\x00subqueries\x00parameters\x00%r %s BY term out of range - should be between 1 and %d\x00too many terms in ORDER BY clause\x00ORDER\x00%r ORDER BY term does not match any column in the result set\x00too many terms in %s BY clause\x00HAVING clause on a non-aggregate query\x00GROUP\x00aggregate functions are not allowed in the GROUP BY clause\x00Expression tree is too large (maximum depth %d)\x00s\x00IN(...) element has %d term%s - expected %d\x00too many arguments on function %T\x00ORDER BY may not be used with non-aggregate %#T()\x00unsafe use of %#T()\x00variable number must be between ?1 and ?%d\x00too many SQL variables\x00%d columns assigned %d values\x00too many columns in %s\x00true\x00false\x00_ROWID_\x00ROWID\x00OID\x00USING ROWID SEARCH ON TABLE %s FOR IN-OPERATOR\x00USING INDEX %s FOR IN-OPERATOR\x00sub-select returns %d columns - expected %d\x00REUSE LIST SUBQUERY %d\x00CORRELATED \x00%sLIST SUBQUERY %d\x00REUSE SUBQUERY %d\x00%sSCALAR SUBQUERY %d\x001\x000x\x00hex literal too big: %s%#T\x00generated column loop on \"%s\"\x00blob\x00text\x00numeric\x00flexnum\x00none\x00misuse of aggregate: %#T()\x00unknown function: %#T()\x00RAISE() may only be used within a trigger-program\x00more than %d aggregate terms\x00table %s may not be altered\x00SELECT 1 FROM \"%w\".sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %d)=NULL \x00SELECT 1 FROM temp.sqlite_master WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%' AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %d)=NULL \x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_quotefix(%Q, sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_quotefix('temp', sql)WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND sql NOT LIKE 'create virtual%%'\x00there is already another table or index with this name: %s\x00table\x00view %s may not be altered\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, %d) WHERE (type!='index' OR tbl_name=%Q COLLATE nocase)AND name NOT LIKE 'sqliteX_%%' ESCAPE 'X'\x00UPDATE %Q.sqlite_master SET tbl_name = %Q, name = CASE WHEN type='table' THEN %Q WHEN name LIKE 'sqliteX_autoindex%%' ESCAPE 'X' AND type='index' THEN 'sqlite_autoindex_' || %Q || substr(name,%d+18) ELSE name END WHERE tbl_name=%Q COLLATE nocase AND (type='table' OR type='index' OR type='trigger');\x00sqlite_sequence\x00UPDATE \"%w\".sqlite_sequence set name = %Q WHERE name = %Q\x00UPDATE sqlite_temp_schema SET sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), tbl_name = CASE WHEN tbl_name=%Q COLLATE nocase AND sqlite_rename_test(%Q, sql, type, name, 1, 'after rename', 0) THEN %Q ELSE tbl_name END WHERE type IN ('view', 'trigger')\x00after rename\x00SELECT raise(ABORT,%Q) FROM \"%w\".\"%w\"\x00Cannot add a PRIMARY KEY column\x00Cannot add a UNIQUE column\x00Cannot add a REFERENCES column with non-NULL default value\x00Cannot add a NOT NULL column with default value NULL\x00Cannot add a column with non-constant default\x00cannot add a STORED column\x00UPDATE \"%w\".sqlite_master SET sql = printf('%%.%ds, ',sql) || %Q || substr(sql,1+length(printf('%%.%ds',sql))) WHERE type = 'table' AND name = %Q\x00SELECT CASE WHEN quick_check GLOB 'CHECK*' THEN raise(ABORT,'CHECK constraint failed') WHEN quick_check GLOB 'non-* value in*' THEN raise(ABORT,'type mismatch on DEFAULT') ELSE raise(ABORT,'NOT NULL constraint failed') END FROM pragma_quick_check(%Q,%Q) WHERE quick_check GLOB 'CHECK*' OR quick_check GLOB 'NULL*' OR quick_check GLOB 'non-* value in*'\x00virtual tables may not be altered\x00Cannot add a column to a view\x00sqlite_altertab_%s\x00view\x00virtual table\x00drop column from\x00rename columns of\x00cannot %s %s \"%s\"\x00no such column: \"%T\"\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, %d) WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X' AND (type != 'index' OR tbl_name = %Q)\x00UPDATE temp.sqlite_master SET sql = sqlite_rename_column(sql, type, name, %Q, %Q, %d, %Q, %d, 1) WHERE type IN ('trigger', 'view')\x00 \x00error in %s %s%s%s: %s\x00CREATE \x00\"%w\" \x00%Q%s\x00%.*s%s\x00PRIMARY KEY\x00cannot drop %s column: \"%s\"\x00cannot drop column \"%s\": no other columns exist\x00UPDATE \"%w\".sqlite_master SET sql = sqlite_drop_column(%d, sql, %d) WHERE (type=='table' AND tbl_name=%Q COLLATE nocase)\x00after drop column\x00sqlite_rename_column\x00sqlite_rename_table\x00sqlite_rename_test\x00sqlite_drop_column\x00sqlite_rename_quotefix\x00sqlite_stat1\x00tbl,idx,stat\x00sqlite_stat4\x00tbl,idx,neq,nlt,ndlt,sample\x00sqlite_stat3\x00CREATE TABLE %Q.%s(%s)\x00DELETE FROM %Q.%s WHERE %s=%Q\x00DELETE FROM %Q.%s\x00stat_init\x00stat_push\x00%llu\x00 %llu\x00%llu \x00stat_get\x00sqlite\\_%\x00BBB\x00idx\x00tbl\x00unordered*\x00sz=[0-9]*\x00noskipscan*\x00SELECT idx,count(*) FROM %Q.sqlite_stat4 GROUP BY idx COLLATE nocase\x00SELECT idx,neq,nlt,ndlt,sample FROM %Q.sqlite_stat4\x00SELECT tbl,idx,stat FROM %Q.sqlite_stat1\x00x\x00\x00too many attached databases - max %d\x00database %s is already in use\x00database is already attached\x00attached databases must use the same text encoding as main database\x00unable to open database: %s\x00no such database: %s\x00cannot detach database %s\x00database %s is locked\x00sqlite_detach\x00sqlite_attach\x00%s cannot use variables\x00%s %T cannot reference objects in database %s\x00authorizer malfunction\x00%s.%s\x00%s.%z\x00access to %z is prohibited\x00not authorized\x00pragma_\x00no such view\x00no such table\x00corrupt database\x00unknown database %T\x00object name reserved for internal use: %s\x00temporary table name must be unqualified\x00%s %T already exists\x00there is already an index named %s\x00cannot use RETURNING in a trigger\x00sqlite_returning_%p\x00too many columns on %s\x00always\x00generated\x00duplicate column name: %s\x00default value of column [%s] is not constant\x00cannot use DEFAULT on a generated column\x00generated columns cannot be part of the PRIMARY KEY\x00table \"%s\" has more than one primary key\x00AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY\x00virtual tables cannot use computed columns\x00virtual\x00stored\x00error in generated column \"%s\"\x00,\x00\n \x00,\n \x00\n)\x00CREATE TABLE \x00 TEXT\x00 NUM\x00 INT\x00 REAL\x00unknown datatype for %s.%s: \"%s\"\x00missing datatype for %s.%s\x00AUTOINCREMENT not allowed on WITHOUT ROWID tables\x00PRIMARY KEY missing on table %s\x00must have at least one non-generated column\x00TABLE\x00VIEW\x00CREATE %s %.*s\x00UPDATE %Q.sqlite_master SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q WHERE rowid=#%d\x00CREATE TABLE %Q.sqlite_sequence(name,seq)\x00tbl_name='%q' AND type!='trigger'\x00SELECT*FROM\"%w\".\"%w\"\x00parameters are not allowed in views\x00view %s is circularly defined\x00corrupt schema\x00UPDATE %Q.sqlite_master SET rootpage=%d WHERE #%d AND rootpage=#%d\x00sqlite_stat%d\x00DELETE FROM %Q.sqlite_sequence WHERE name=%Q\x00DELETE FROM %Q.sqlite_master WHERE tbl_name=%Q and type!='trigger'\x00stat\x00table %s may not be dropped\x00use DROP TABLE to delete table %s\x00use DROP VIEW to delete view %s\x00foreign key on %s should reference only one column of table %T\x00number of columns in foreign key does not match the number of columns in the referenced table\x00unknown column \"%s\" in foreign key definition\x00FIRST\x00LAST\x00unsupported use of NULLS %s\x00index\x00cannot create a TEMP index on non-TEMP table \"%s\"\x00table %s may not be indexed\x00views may not be indexed\x00virtual tables may not be indexed\x00there is already a table named %s\x00index %s already exists\x00sqlite_autoindex_%s_%d\x00expressions prohibited in PRIMARY KEY and UNIQUE constraints\x00conflicting ON CONFLICT clauses specified\x00invalid rootpage\x00 UNIQUE\x00CREATE%s INDEX %.*s\x00INSERT INTO %Q.sqlite_master VALUES('index',%Q,%Q,#%d,%Q);\x00name='%q' AND type='index'\x00no such index: %S\x00index associated with UNIQUE or PRIMARY KEY constraint cannot be dropped\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='index'\x00too many FROM clause terms, max: %d\x00ON\x00USING\x00a JOIN clause is required before %s\x00BEGIN\x00ROLLBACK\x00COMMIT\x00RELEASE\x00unable to open a temporary database file for storing temporary tables\x00index '%q'\x00, \x00%s.rowid\x00unable to identify the object to be reindexed\x00duplicate WITH table name: %s\x00no such collation sequence: %s\x00unsafe use of virtual table \"%s\"\x00table %s may not be modified\x00cannot modify %s because it is a view\x00rows deleted\x00integer overflow\x00%!.*f\x00LIKE or GLOB pattern too complex\x00ESCAPE expression must be a single character\x00%!0.15g\x00%!0.20e\x00%#Q\x00%Q\x00invalid Unicode escape\x00?000\x00MATCH\x00like\x00implies_nonnull_row\x00expr_compare\x00expr_implies_expr\x00affinity\x00soundex\x00load_extension\x00sqlite_compileoption_used\x00sqlite_compileoption_get\x00unlikely\x00likelihood\x00likely\x00sqlite_offset\x00ltrim\x00rtrim\x00trim\x00min\x00max\x00typeof\x00subtype\x00length\x00octet_length\x00instr\x00printf\x00format\x00unicode\x00char\x00abs\x00round\x00upper\x00lower\x00hex\x00unhex\x00concat\x00concat_ws\x00ifnull\x00random\x00randomblob\x00nullif\x00sqlite_version\x00sqlite_source_id\x00sqlite_log\x00unistr\x00quote\x00unistr_quote\x00last_insert_rowid\x00changes\x00total_changes\x00replace\x00zeroblob\x00substr\x00substring\x00sum\x00total\x00avg\x00count\x00group_concat\x00string_agg\x00glob\x00ceil\x00trunc\x00ln\x00log\x00log10\x00log2\x00exp\x00pow\x00power\x00mod\x00acos\x00asin\x00atan\x00atan2\x00cos\x00sin\x00tan\x00cosh\x00sinh\x00tanh\x00acosh\x00asinh\x00atanh\x00sqrt\x00radians\x00degrees\x00pi\x00sign\x00iif\x00if\x00foreign key mismatch - \"%w\" referencing \"%w\"\x00cannot INSERT into generated column \"%s\"\x00table %S has no column named %s\x00SCAN %S\x00table %S has %d columns but %d values were supplied\x00%d values for %d columns\x00UPSERT not implemented for virtual table \"%s\"\x00cannot UPSERT a view\x00rows inserted\x00dll\x00sqlite3_extension_init\x00sqlite3_\x00lib\x00_init\x00no entry point [%s] in shared library [%s]\x00error during initialization: %s\x00unable to open shared library [%.*s]\x00automatic extension loading failed: %s\x00seq\x00from\x00to\x00on_update\x00on_delete\x00match\x00cid\x00name\x00type\x00notnull\x00dflt_value\x00pk\x00hidden\x00builtin\x00enc\x00narg\x00flags\x00schema\x00ncol\x00wr\x00strict\x00seqno\x00desc\x00coll\x00key\x00unique\x00origin\x00partial\x00wdth\x00hght\x00flgs\x00rowid\x00fkid\x00busy\x00checkpointed\x00file\x00database\x00status\x00cache_size\x00timeout\x00analysis_limit\x00application_id\x00auto_vacuum\x00automatic_index\x00busy_timeout\x00cache_spill\x00case_sensitive_like\x00cell_size_check\x00checkpoint_fullfsync\x00collation_list\x00compile_options\x00count_changes\x00data_store_directory\x00data_version\x00database_list\x00default_cache_size\x00defer_foreign_keys\x00empty_result_callbacks\x00encoding\x00foreign_key_check\x00foreign_key_list\x00foreign_keys\x00freelist_count\x00full_column_names\x00fullfsync\x00function_list\x00hard_heap_limit\x00ignore_check_constraints\x00incremental_vacuum\x00index_info\x00index_list\x00index_xinfo\x00integrity_check\x00journal_mode\x00journal_size_limit\x00legacy_alter_table\x00locking_mode\x00max_page_count\x00mmap_size\x00module_list\x00optimize\x00page_count\x00page_size\x00pragma_list\x00query_only\x00quick_check\x00read_uncommitted\x00recursive_triggers\x00reverse_unordered_selects\x00schema_version\x00secure_delete\x00short_column_names\x00shrink_memory\x00soft_heap_limit\x00synchronous\x00table_info\x00table_list\x00table_xinfo\x00temp_store\x00temp_store_directory\x00threads\x00trusted_schema\x00user_version\x00wal_autocheckpoint\x00wal_checkpoint\x00writable_schema\x00normal\x00full\x00incremental\x00memory\x00temporary storage cannot be changed from within a transaction\x00SET NULL\x00SET DEFAULT\x00CASCADE\x00RESTRICT\x00NO ACTION\x00delete\x00persist\x00off\x00truncate\x00wal\x00utf8\x00utf16le\x00utf16be\x00w\x00a\x00sissii\x00-%T\x00fast\x00not a writable directory\x00Safety level may not be changed inside a transaction\x00reset\x00issisii\x00issisi\x00SELECT*FROM\"%w\"\x00shadow\x00sssiii\x00iisX\x00isiX\x00c\x00u\x00isisi\x00iss\x00is\x00iissssss\x00NONE\x00siX\x00*** in database %s ***\n\x00wrong # of entries in index \x00row not in PRIMARY KEY order for %s\x00NULL value in %s.%s\x00non-%s value in %s.%s\x00NUMERIC value in %s.%s\x00C\x00TEXT value in %s.%s\x00CHECK constraint failed in %s\x00row \x00 missing from index \x00rowid not at end-of-record for row \x00 of index \x00 values differ from index \x00non-unique entry in index \x00ok\x00UTF8\x00UTF-8\x00UTF-16le\x00UTF-16be\x00UTF16le\x00UTF16be\x00UTF-16\x00UTF16\x00unsupported encoding: %s\x00restart\x00ANALYZE \"%w\".\"%w\"\x00CREATE TABLE x\x00%c\"%s\"\x00(\"%s\"\x00,arg HIDDEN\x00,schema HIDDEN\x00PRAGMA \x00%Q.\x00=%Q\x00rename\x00drop column\x00add column\x00error in %s %s after %s: %s\x00malformed database schema (%s)\x00%z - %s\x00orphan index\x00CREATE TABLE x(type text,name text,tbl_name text,rootpage int,sql text)\x00unsupported file format\x00SELECT*FROM\"%w\".%s ORDER BY rowid\x00database schema is locked: %s\x00statement too long\x00unknown join type: %T%s%T%s%T\x00a NATURAL join may not have an ON or USING clause\x00cannot join using column %s - column not present in both tables\x00ambiguous reference to %s in USING()\x00CREATE BLOOM FILTER\x00UNION ALL\x00INTERSECT\x00EXCEPT\x00UNION\x00USE TEMP B-TREE FOR %s\x00LAST TERM OF \x00USE TEMP B-TREE FOR %sORDER BY\x00USE TEMP B-TREE FOR LAST %d TERMS OF ORDER BY\x00column%d\x00%.*z:%u\x00NUM\x00cannot use window functions in recursive queries\x00recursive aggregate queries not supported\x00SETUP\x00RECURSIVE STEP\x00S\x00SCAN %d CONSTANT ROW%s\x00COMPOUND QUERY\x00LEFT-MOST SUBQUERY\x00%s USING TEMP B-TREE\x00all VALUES must have the same number of terms\x00SELECTs to the left and right of %s do not have the same number of result columns\x00MERGE (%s)\x00LEFT\x00RIGHT\x00no such index: %s\x00'%s' is not a function\x00no such index: \"%s\"\x00multiple references to recursive table: %s\x00circular reference: %s\x00table %s has %d values for %d columns\x00multiple recursive references: %s\x00recursive reference in a subquery: %s\x00%!S\x00too many references to \"%s\": max 65535\x00access to view \"%s\" prohibited\x00..%s\x00%s.%s.%s\x00no such table: %s\x00no tables specified\x00too many columns in result set\x00DISTINCT aggregates must have exactly one argument\x00USE TEMP B-TREE FOR %s(DISTINCT)\x00USE TEMP B-TREE FOR %s(ORDER BY)\x00 USING COVERING INDEX \x00SCAN %s%s%s\x00target object/alias may not appear in FROM clause: %s\x00expected %d columns for '%s' but got %d\x00CO-ROUTINE %!S\x00MATERIALIZE %!S\x00DISTINCT\x00GROUP BY\x00sqlite3_get_table() called with two or more incompatible queries\x00temporary trigger may not have qualified name\x00trigger\x00cannot create triggers on virtual tables\x00cannot create triggers on shadow tables\x00trigger %T already exists\x00cannot create trigger on system table\x00BEFORE\x00AFTER\x00cannot create %s trigger on view: %S\x00cannot create INSTEAD OF trigger on table: %S\x00trigger \"%s\" may not write to shadow table \"%s\"\x00INSERT INTO %Q.sqlite_master VALUES('trigger',%Q,%Q,0,'CREATE TRIGGER %q')\x00type='trigger' AND name='%q'\x00no such trigger: %S\x00DELETE FROM %Q.sqlite_master WHERE name=%Q AND type='trigger'\x00DELETE\x00UPDATE\x00%s RETURNING is not available on virtual tables\x00RETURNING may not use \"TABLE.*\" wildcards\x00-- TRIGGER %s\x00cannot UPDATE generated column \"%s\"\x00no such column: %s\x00rows updated\x00%r \x00%sON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint\x00CRE\x00INS\x00cannot VACUUM from within a transaction\x00cannot VACUUM - SQL statements in progress\x00non-text filename\x00vacuum_%016llx\x00ATTACH %Q AS %s\x00output file already exists\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='table'AND name<>'sqlite_sequence' AND coalesce(rootpage,1)>0\x00SELECT sql FROM \"%w\".sqlite_schema WHERE type='index'\x00SELECT'INSERT INTO %s.'||quote(name)||' SELECT*FROM\"%w\".'||quote(name)FROM %s.sqlite_schema WHERE type='table'AND coalesce(rootpage,1)>0\x00INSERT INTO %s.sqlite_schema SELECT*FROM \"%w\".sqlite_schema WHERE type IN('view','trigger') OR(type='table'AND rootpage=0)\x00CREATE VIRTUAL TABLE %T\x00UPDATE %Q.sqlite_master SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q WHERE rowid=#%d\x00name=%Q AND sql=%Q\x00vtable constructor called recursively: %s\x00vtable constructor failed: %s\x00vtable constructor did not declare schema: %s\x00no such module: %s\x00syntax error\x00\x00 AND \x00(\x00 (\x00%s=?\x00ANY(%s)\x00>\x00<\x00SEARCH\x00SCAN\x00%s %S\x00AUTOMATIC PARTIAL COVERING INDEX\x00AUTOMATIC COVERING INDEX\x00COVERING INDEX %s\x00INDEX %s\x00 USING \x00 USING INTEGER PRIMARY KEY (%s\x00>? AND %s\x00%c?)\x00 VIRTUAL TABLE INDEX \x000x%x:%s\x00%d:%s\x00 LEFT-JOIN\x00BLOOM FILTER ON %S (\x00rowid=?\x00MULTI-INDEX OR\x00INDEX %d\x00RIGHT-JOIN %s\x00regexp\x00ON clause references tables to its right\x00NOCASE\x00too many arguments on %s() - max %d\x00automatic index on %s(%s)\x00auto-index\x00%s.xBestIndex malfunction\x00abbreviated query algorithm search\x00no query solution\x00at most %d tables in a join\x00SCAN CONSTANT ROW\x00internal query planner error\x00second argument to nth_value must be a positive integer\x00argument of ntile must be a positive integer\x00no such window: %s\x00RANGE with offset PRECEDING/FOLLOWING requires one ORDER BY expression\x00FILTER clause may only be used with aggregate window functions\x00misuse of aggregate: %s()\x00unsupported frame specification\x00PARTITION clause\x00ORDER BY clause\x00frame specification\x00cannot override %s of window: %s\x00DISTINCT is not supported for window functions\x00frame starting offset must be a non-negative integer\x00frame ending offset must be a non-negative integer\x00frame starting offset must be a non-negative number\x00frame ending offset must be a non-negative number\x00near \"%T\": syntax error\x00ORDER BY\x00LIMIT\x00%s clause should come after %s not before\x00too many terms in compound SELECT\x00syntax error after column name \"%.*s\"\x00unknown table option: %.*s\x00set list\x00qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers\x00the INDEXED BY clause is not allowed on UPDATE or DELETE statements within triggers\x00the NOT INDEXED clause is not allowed on UPDATE or DELETE statements within triggers\x00incomplete input\x00unrecognized token: \"%T\"\x00%s in \"%s\"\x00create\x00temp\x00temporary\x00end\x00explain\x00unable to close due to unfinalized statements or unfinished backups\x00not an error\x00SQL logic error\x00access permission denied\x00query aborted\x00database is locked\x00database table is locked\x00attempt to write a readonly database\x00interrupted\x00disk I/O error\x00database disk image is malformed\x00unknown operation\x00database or disk is full\x00unable to open database file\x00locking protocol\x00constraint failed\x00datatype mismatch\x00bad parameter or other API misuse\x00authorization denied\x00column index out of range\x00file is not a database\x00notification message\x00warning message\x00unknown error\x00abort due to ROLLBACK\x00another row available\x00no more rows available\x00unable to delete/modify user-function due to active statements\x00unable to use function %s in the requested context\x00unknown database: %s\x00unable to delete/modify collation sequence due to active statements\x00file:\x00localhost\x00invalid uri authority: %.*s\x00vfs\x00cache\x00shared\x00private\x00mode\x00ro\x00rw\x00rwc\x00access\x00no such %s mode: %s\x00%s mode not allowed: %s\x00no such vfs: %s\x00RTRIM\x00\x00\x00\x00%s at line %d of [%.10s]\x00database corruption\x00misuse\x00cannot open file\x00no such table column: %s.%s\x00SQLITE_\x00database is deadlocked\x00array\x00object\x00JSON cannot hold BLOB values\x00malformed JSON\x00inf\x009.0e999\x00infinity\x00QNaN\x00SNaN\x00json_%s() needs an odd number of arguments\x00\"\\/bfnrt\x00-9e999\x009e999\x00inity\x00\\\"\x00\\u0009\x00\\u00\x00\\u0000\x00,\n\x00: \x00bad JSON path: %Q\x00@\x00[\x00#\x00.\"\x00\"\x00json_object() requires an even number of arguments\x00json_object() labels must be TEXT\x00set\x00insert\x00 \x00FLAGS parameter to json_valid() must be between 1 and 15\x00[]\x00{}\x00CREATE TABLE x(key,value,type,atom,id,parent,fullkey,path,json HIDDEN,root HIDDEN)\x00[%lld]\x00.\"%.*s\"\x00.%.*s\x00$\x00json\x00jsonb\x00json_array\x00jsonb_array\x00json_array_length\x00json_error_position\x00json_extract\x00jsonb_extract\x00->\x00->>\x00json_insert\x00jsonb_insert\x00json_object\x00jsonb_object\x00json_patch\x00jsonb_patch\x00json_pretty\x00json_quote\x00json_remove\x00jsonb_remove\x00json_replace\x00jsonb_replace\x00json_set\x00jsonb_set\x00json_type\x00json_valid\x00json_group_array\x00jsonb_group_array\x00json_group_object\x00jsonb_group_object\x00json_each\x00json_tree\x00data\x00DROP TABLE '%q'.'%q_node';DROP TABLE '%q'.'%q_rowid';DROP TABLE '%q'.'%q_parent';\x00RtreeMatchArg\x00SELECT * FROM %Q.%Q\x00UNIQUE constraint failed: %s.%s\x00rtree constraint failed: %s.(%s<=%s)\x00ALTER TABLE %Q.'%q_node' RENAME TO \"%w_node\";ALTER TABLE %Q.'%q_parent' RENAME TO \"%w_parent\";ALTER TABLE %Q.'%q_rowid' RENAME TO \"%w_rowid\";\x00SELECT stat FROM %Q.sqlite_stat1 WHERE tbl = '%q_rowid'\x00node\x00INSERT OR REPLACE INTO '%q'.'%q_node' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_node' WHERE nodeno = ?1\x00SELECT nodeno FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_rowid' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_rowid' WHERE rowid = ?1\x00SELECT parentnode FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00INSERT OR REPLACE INTO '%q'.'%q_parent' VALUES(?1, ?2)\x00DELETE FROM '%q'.'%q_parent' WHERE nodeno = ?1\x00CREATE TABLE \"%w\".\"%w_rowid\"(rowid INTEGER PRIMARY KEY,nodeno\x00,a%d\x00);CREATE TABLE \"%w\".\"%w_node\"(nodeno INTEGER PRIMARY KEY,data);\x00CREATE TABLE \"%w\".\"%w_parent\"(nodeno INTEGER PRIMARY KEY,parentnode);\x00INSERT INTO \"%w\".\"%w_node\"VALUES(1,zeroblob(%d))\x00INSERT INTO\"%w\".\"%w_rowid\"(rowid,nodeno)VALUES(?1,?2)ON CONFLICT(rowid)DO UPDATE SET nodeno=excluded.nodeno\x00SELECT * FROM \"%w\".\"%w_rowid\" WHERE rowid=?1\x00UPDATE \"%w\".\"%w_rowid\"SET \x00a%d=coalesce(?%d,a%d)\x00a%d=?%d\x00 WHERE rowid=?1\x00PRAGMA %Q.page_size\x00SELECT length(data) FROM '%q'.'%q_node' WHERE nodeno = 1\x00undersize RTree blobs in \"%q_node\"\x00Wrong number of columns for an rtree table\x00Too few columns for an rtree table\x00Too many columns for an rtree table\x00Auxiliary rtree columns must be last\x00_node\x00CREATE TABLE x(%.*s INT\x00,%.*s\x00,%.*s REAL\x00,%.*s INT\x00);\x00{%lld\x00 %g\x00}\x00Invalid argument to rtreedepth()\x00%z%s%z\x00SELECT data FROM %Q.'%q_node' WHERE nodeno=?\x00Node %lld missing from database\x00SELECT parentnode FROM %Q.'%q_parent' WHERE nodeno=?1\x00SELECT nodeno FROM %Q.'%q_rowid' WHERE rowid=?1\x00%_rowid\x00%_parent\x00Mapping (%lld -> %lld) missing from %s table\x00Found (%lld -> %lld) in %s table, expected (%lld -> %lld)\x00Dimension %d of cell %d on node %lld is corrupt\x00Dimension %d of cell %d on node %lld is corrupt relative to parent\x00Node %lld is too small (%d bytes)\x00Rtree depth out of range (%d)\x00Node %lld is too small for cell count of %d (%d bytes)\x00SELECT count(*) FROM %Q.'%q%s'\x00Wrong number of entries in %%%s table - expected %lld, actual %lld\x00SELECT * FROM %Q.'%q_rowid'\x00Schema corrupt or not an rtree\x00_rowid\x00_parent\x00In RTree %s.%s:\n%z\x00wrong number of arguments to function rtreecheck()\x00[%!g,%!g],\x00[%!g,%!g]]\x00\x00CREATE TABLE x(_shape\x00,%s\x00rtree\x00fullscan\x00_shape does not contain a valid polygon\x00geopoly_overlap\x00geopoly_within\x00geopoly_area\x00geopoly_blob\x00geopoly_json\x00geopoly_svg\x00geopoly_contains_point\x00geopoly_debug\x00geopoly_bbox\x00geopoly_xform\x00geopoly_regular\x00geopoly_ccw\x00geopoly_group_bbox\x00geopoly\x00rtreenode\x00rtreedepth\x00rtreecheck\x00rtree_i32\x00corrupt fossil delta\x00DROP TRIGGER IF EXISTS temp.rbu_insert_tr;DROP TRIGGER IF EXISTS temp.rbu_update1_tr;DROP TRIGGER IF EXISTS temp.rbu_update2_tr;DROP TRIGGER IF EXISTS temp.rbu_delete_tr;\x00AND rootpage!=0 AND rootpage IS NOT NULL\x00SELECT rbu_target_name(name, type='view') AS target, name FROM sqlite_schema WHERE type IN ('table', 'view') AND target IS NOT NULL %s ORDER BY name\x00SELECT name, rootpage, sql IS NULL OR substr(8, 6)=='UNIQUE' FROM main.sqlite_schema WHERE type='index' AND tbl_name = ?\x00SELECT (sql COLLATE nocase BETWEEN 'CREATE VIRTUAL' AND 'CREATE VIRTUAM'), rootpage FROM sqlite_schema WHERE name=%Q\x00PRAGMA index_list=%Q\x00SELECT rootpage FROM sqlite_schema WHERE name = %Q\x00PRAGMA table_info=%Q\x00PRAGMA main.index_list = %Q\x00PRAGMA main.index_xinfo = %Q\x00SELECT * FROM '%q'\x00rbu_\x00rbu_rowid\x00may not have\x00requires\x00table %q %s rbu_rowid column\x00PRAGMA table_info(%Q)\x00column missing from %q: %s\x00%z%s\"%w\"\x00%z%s%s\"%w\"%s\x00SELECT max(_rowid_) FROM \"%s%w\"\x00 WHERE _rowid_ > %lld \x00 DESC\x00quote(\x00||','||\x00SELECT %s FROM \"%s%w\" ORDER BY %s LIMIT 1\x00 WHERE (%s) > (%s) \x00_rowid_\x00%z%s \"%w\" COLLATE %Q\x00%z%s \"rbu_imp_%d%w\" COLLATE %Q DESC\x00%z%s quote(\"rbu_imp_%d%w\")\x00SELECT %s FROM \"rbu_imp_%w\" ORDER BY %s LIMIT 1\x00%z%s%s\x00(%s) > (%s)\x00%z%s(%.*s) COLLATE %Q\x00%z%s\"%w\" COLLATE %Q\x00%z%s\"rbu_imp_%d%w\"%s\x00%z%s\"rbu_imp_%d%w\" %s COLLATE %Q\x00%z%s\"rbu_imp_%d%w\" IS ?\x00%z%s%s.\"%w\"\x00%z%sNULL\x00%z, %s._rowid_\x00_rowid_ = ?%d\x00%z%sc%d=?%d\x00_rowid_ = (SELECT id FROM rbu_imposter2 WHERE %z)\x00%z%s\"%w\"=?%d\x00invalid rbu_control value\x00%z%s\"%w\"=rbu_delta(\"%w\", ?%d)\x00%z%s\"%w\"=rbu_fossil_delta(\"%w\", ?%d)\x00PRIMARY KEY(\x00%z%s\"%w\"%s\x00%z)\x00SELECT name FROM sqlite_schema WHERE rootpage = ?\x00%z%sc%d %s COLLATE %Q\x00%z%sc%d%s\x00%z, id INTEGER\x00CREATE TABLE rbu_imposter2(%z, PRIMARY KEY(%z)) WITHOUT ROWID\x00PRIMARY KEY \x00 NOT NULL\x00%z%s\"%w\" %s %sCOLLATE %Q%s\x00%z, %z\x00 WITHOUT ROWID\x00CREATE TABLE \"rbu_imp_%w\"(%z)%s\x00INSERT INTO %s.'rbu_tmp_%q'(rbu_control,%s%s) VALUES(%z)\x00SELECT trim(sql) FROM sqlite_schema WHERE type='index' AND name=?\x00 LIMIT -1 OFFSET %d\x00CREATE TABLE \"rbu_imp_%w\"( %s, PRIMARY KEY( %s ) ) WITHOUT ROWID\x00INSERT INTO \"rbu_imp_%w\" VALUES(%s)\x00DELETE FROM \"rbu_imp_%w\" WHERE %s\x00AND\x00WHERE\x00SELECT %s, 0 AS rbu_control FROM '%q' %s %s %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s ORDER BY %s%s\x00SELECT %s, rbu_control FROM %s.'rbu_tmp_%q' %s UNION ALL SELECT %s, rbu_control FROM '%q' %s %s typeof(rbu_control)='integer' AND rbu_control!=1 ORDER BY %s%s\x00rbu_imp_\x00, _rowid_\x00INSERT INTO \"%s%w\"(%s%s) VALUES(%s)\x00DELETE FROM \"%s%w\" WHERE %s\x00, rbu_rowid\x00, 0 AS rbu_rowid\x00CREATE TABLE IF NOT EXISTS %s.'rbu_tmp_%q' AS SELECT *%s FROM '%q' WHERE 0;\x00CREATE TEMP TRIGGER rbu_delete_tr BEFORE DELETE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update1_tr BEFORE UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(3, %s);END;CREATE TEMP TRIGGER rbu_update2_tr AFTER UPDATE ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(4, %s);END;\x00CREATE TEMP TRIGGER rbu_insert_tr AFTER INSERT ON \"%s%w\" BEGIN SELECT rbu_tmp_insert(0, %s);END;\x00,_rowid_ \x00,rbu_rowid\x000 AS \x00SELECT %s,%s rbu_control%s FROM '%q'%s %s %s %s\x00UPDATE \"%s%w\" SET %s WHERE %s\x00SELECT k, v FROM %s.rbu_state\x00file:///%s-vacuum?modeof=%s\x00ATTACH %Q AS stat\x00CREATE TABLE IF NOT EXISTS %s.rbu_state(k INTEGER PRIMARY KEY, v)\x00cannot vacuum wal mode database\x00&\x00file:%s-vactmp?rbu_memory=1%s%s\x00rbu_tmp_insert\x00rbu_fossil_delta\x00rbu_target_name\x00SELECT * FROM sqlite_schema\x00rbu vfs not found\x00PRAGMA main.wal_checkpoint=restart\x00rbu_exclusive_checkpoint\x00%s-oal\x00%s-wal\x00PRAGMA schema_version\x00PRAGMA schema_version = %d\x00INSERT OR REPLACE INTO %s.rbu_state(k, v) VALUES (%d, %d), (%d, %Q), (%d, %Q), (%d, %d), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %lld), (%d, %Q) \x00PRAGMA main.%s\x00PRAGMA main.%s = %d\x00PRAGMA writable_schema=1\x00SELECT sql FROM sqlite_schema WHERE sql!='' AND rootpage!=0 AND name!='sqlite_sequence' ORDER BY type DESC\x00SELECT * FROM sqlite_schema WHERE rootpage=0 OR rootpage IS NULL\x00INSERT INTO sqlite_schema VALUES(?,?,?,?,?)\x00PRAGMA writable_schema=0\x00DELETE FROM %s.'rbu_tmp_%q'\x00rbu_state mismatch error\x00rbu_vfs_%d\x00SELECT count(*) FROM sqlite_schema WHERE type='index' AND tbl_name = %Q\x00rbu_index_cnt\x00SELECT 1 FROM sqlite_schema WHERE tbl_name = 'rbu_count'\x00SELECT sum(cnt * (1 + rbu_index_cnt(rbu_target_name(tbl))))FROM rbu_count\x00cannot update wal mode database\x00vacuum\x00update\x00database modified during rbu %s\x00BEGIN IMMEDIATE\x00PRAGMA journal_mode=off\x00-vactmp\x00DELETE FROM stat.rbu_state\x00rbu/zipvfs setup error\x00rbu(%s)/%z\x00rbu_memory\x00/\x00overflow\x00%s%.3x+%.6x\x00%s%.3x/\x00internal\x00leaf\x00corrupted\x00SELECT * FROM (SELECT 'sqlite_schema' AS name,1 AS rootpage,'table' AS type UNION ALL SELECT name,rootpage,type FROM \"%w\".sqlite_schema WHERE rootpage!=0)\x00WHERE name=%Q\x00 ORDER BY name\x00dbstat\x00SELECT 0, 'tbl', '', 0, '', 1, 0 UNION ALL SELECT 1, 'idx', '', 0, '', 2, 0 UNION ALL SELECT 2, 'stat', '', 0, '', 0, 0\x00PRAGMA '%q'.table_xinfo('%q')\x00SELECT\x00%z%s\"%w\".\"%w\".\"%w\"=\"%w\".\"%w\".\"%w\"\x00%z%s\"%w\".\"%w\".\"%w\" IS NOT \"%w\".\"%w\".\"%w\"\x00 OR \x00_rowid_, *\x00SELECT %s FROM \"%w\".\"%w\" WHERE NOT EXISTS ( SELECT 1 FROM \"%w\".\"%w\" WHERE %s)\x00%z%s\"%w\".\"%w\".\"%w\"\x00SELECT %s,%s FROM \"%w\".\"%w\", \"%w\".\"%w\" WHERE %s AND (%z)\x00SELECT * FROM %Q.sqlite_schema\x00no such table: %s.%s\x00table schemas do not match\x00, 1\x00 AND (?6 OR ?3 IS stat)\x00tbl, idx\x00?1, (CASE WHEN ?2=X'' THEN NULL ELSE ?2 END)\x00tbl, ?2, stat\x00?%d\x00 AND (?%d OR ?%d IS %w.%w)\x00SELECT %s%s FROM %Q.%Q WHERE (%s) IS (%s)\x00SAVEPOINT changeset\x00RELEASE changeset\x00UPDATE main.\x00 SET \x00 = ?\x00 WHERE \x00idx IS CASE WHEN length(?4)=0 AND typeof(?4)='blob' THEN NULL ELSE ?4 END \x00 IS ?\x00DELETE FROM main.\x00 AND (?\x00AND \x00INSERT INTO main.\x00) VALUES(?\x00, ?\x00INSERT INTO main.sqlite_stat1 VALUES(?1, CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END, ?3)\x00DELETE FROM main.sqlite_stat1 WHERE tbl=?1 AND idx IS CASE WHEN length(?2)=0 AND typeof(?2)='blob' THEN NULL ELSE ?2 END AND (?4 OR stat IS ?3)\x00SAVEPOINT replace_op\x00RELEASE replace_op\x00SAVEPOINT changeset_apply\x00PRAGMA defer_foreign_keys = 1\x00sqlite3changeset_apply(): no such table: %s\x00sqlite3changeset_apply(): table %s has %d columns, expected %d or more\x00sqlite3changeset_apply(): primary key mismatch for table %s\x00PRAGMA defer_foreign_keys = 0\x00RELEASE changeset_apply\x00ROLLBACK TO changeset_apply\x00fts5: parser stack overflow\x00fts5: syntax error near \"%.*s\"\x00%z%.*s\x00wrong number of arguments to function highlight()\x00wrong number of arguments to function snippet()\x00wrong number of arguments to function fts5_get_locale()\x00non-integer argument passed to function fts5_get_locale()\x00snippet\x00highlight\x00bm25\x00fts5_get_locale\x00prefix\x00malformed prefix=... directive\x00too many prefix indexes (max %d)\x00prefix length out of range (max 999)\x00tokenize\x00multiple tokenize=... directives\x00parse error in tokenize directive\x00content\x00multiple content=... directives\x00%Q.%Q\x00contentless_delete\x00malformed contentless_delete=... directive\x00contentless_unindexed\x00content_rowid\x00multiple content_rowid=... directives\x00columnsize\x00malformed columnsize=... directive\x00locale\x00malformed locale=... directive\x00columns\x00malformed detail=... directive\x00tokendata\x00malformed tokendata=... directive\x00unrecognized option: \"%.*s\"\x00rank\x00reserved fts5 column name: %s\x00unindexed\x00unrecognized column option: %s\x00T.%Q\x00, T.%Q\x00, T.c%d\x00, NULL\x00, T.l%d\x00reserved fts5 table name: %s\x00parse error in \"%s\"\x00contentless_delete=1 requires a contentless table\x00contentless_delete=1 is incompatible with columnsize=0\x00contentless_unindexed=1 requires a contentless table\x00docsize\x00%Q.'%q_%s'\x00CREATE TABLE x(\x00%z%s%Q\x00%z, %Q HIDDEN, %s HIDDEN)\x00pgsz\x00hashsize\x00automerge\x00usermerge\x00crisismerge\x00deletemerge\x00secure-delete\x00insttoken\x00SELECT k, v FROM %Q.'%q_config'\x00version\x00invalid fts5 file format (found %d, expected %d or %d) - run 'rebuild'\x00unterminated string\x00fts5: syntax error near \"%.1s\"\x00OR\x00NOT\x00NEAR\x00expected integer, got \"%.*s\"\x00fts5: column queries are not supported (detail=none)\x00phrase\x00fts5: %s queries are not supported (detail!=full)\x00fts5 expression tree is too large (maximum depth %d)\x00block\x00REPLACE INTO '%q'.'%q_data'(id, block) VALUES(?,?)\x00DELETE FROM '%q'.'%q_data' WHERE id>=? AND id<=?\x00DELETE FROM '%q'.'%q_idx' WHERE segid=?\x00\xff\x00\x00\x01\x00PRAGMA %Q.data_version\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term<=? ORDER BY term DESC LIMIT 1\x00SELECT pgno FROM '%q'.'%q_idx' WHERE segid=? AND term>? ORDER BY term ASC LIMIT 1\x00INSERT INTO '%q'.'%q_idx'(segid,term,pgno) VALUES(?,?,?)\x00DELETE FROM '%q'.'%q_idx' WHERE (segid, (pgno/2)) = (?1, ?2)\x00REPLACE INTO %Q.'%q_config' VALUES ('version', %d)\x00%s_data\x00id INTEGER PRIMARY KEY, block BLOB\x00segid, term, pgno, PRIMARY KEY(segid, term)\x00\x00\x00SELECT segid, term, (pgno>>1), (pgno&1) FROM %Q.'%q_idx' WHERE segid=%d ORDER BY 1, 2\x00\x00\x00\x00\x00\x00recursively defined fts5 content table\x00DESC\x00ASC\x00SELECT rowid, rank FROM %Q.%Q ORDER BY %s(\"%w\"%s%s) %s\x00reads\x00unknown special query: %.*s\x00SELECT %s\x00no such function: %s\x00parse error in rank function: %s\x00%.*s\x00%s: table does not support scanning\x00fts5: missing row %lld from content table %s\x00delete-all\x00'delete-all' may only be used with a contentless or external content fts5 table\x00rebuild\x00'rebuild' may not be used with a contentless fts5 table\x00merge\x00integrity-check\x00flush\x00%s a subset of columns on fts5 contentless-delete table: %s\x00%s contentless fts5 table: %s\x00cannot UPDATE\x00'delete' may not be used with a contentless_delete=1 table\x00cannot DELETE from contentless fts5 table: %s\x00fts5_locale() requires locale=1\x00no such cursor: %lld\x00no such tokenizer: %s\x00error in tokenizer constructor\x00fts5_api_ptr\x00fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00config\x00malformed inverted index for FTS5 table %s.%s\x00unable to validate the inverted index for FTS5 table %s.%s: %s\x00fts5\x00fts5_source_id\x00fts5_locale\x00fts5_insttoken\x00SELECT %s FROM %s T WHERE T.%Q >= ? AND T.%Q <= ? ORDER BY T.%Q ASC\x00SELECT %s FROM %s T WHERE T.%Q <= ? AND T.%Q >= ? ORDER BY T.%Q DESC\x00SELECT %s FROM %s T WHERE T.%Q=?\x00INSERT INTO %Q.'%q_content' VALUES(%s)\x00REPLACE INTO %Q.'%q_content' VALUES(%s)\x00DELETE FROM %Q.'%q_content' WHERE id=?\x00REPLACE INTO %Q.'%q_docsize' VALUES(?,?%s)\x00DELETE FROM %Q.'%q_docsize' WHERE id=?\x00SELECT sz%s FROM %Q.'%q_docsize' WHERE id=?\x00REPLACE INTO %Q.'%q_config' VALUES(?,?)\x00SELECT %s FROM %s AS T\x00%z%s?%d\x00%z,?%d\x00,?\x00,origin\x00DROP TABLE IF EXISTS %Q.'%q_data';DROP TABLE IF EXISTS %Q.'%q_idx';DROP TABLE IF EXISTS %Q.'%q_config';\x00DROP TABLE IF EXISTS %Q.'%q_docsize';\x00DROP TABLE IF EXISTS %Q.'%q_content';\x00ALTER TABLE %Q.'%q_%s' RENAME TO '%q_%s';\x00CREATE TABLE %Q.'%q_%q'(%s)%s\x00fts5: error creating shadow table %q_%s: %s\x00id INTEGER PRIMARY KEY\x00, c%d\x00, l%d\x00id INTEGER PRIMARY KEY, sz BLOB\x00id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER\x00k PRIMARY KEY, v\x00DELETE FROM %Q.'%q_data';DELETE FROM %Q.'%q_idx';\x00DELETE FROM %Q.'%q_docsize';\x00DELETE FROM %Q.'%q_content';\x00SELECT count(*) FROM %Q.'%q_%s'\x00tokenchars\x00separators\x00L* N* Co\x00categories\x00remove_diacritics\x00unicode61\x00al\x00ance\x00ence\x00er\x00ic\x00able\x00ible\x00ant\x00ement\x00ment\x00ent\x00ion\x00ou\x00ism\x00ate\x00iti\x00ous\x00ive\x00ize\x00at\x00bl\x00ble\x00iz\x00ational\x00tional\x00tion\x00enci\x00anci\x00izer\x00logi\x00bli\x00alli\x00entli\x00eli\x00e\x00ousli\x00ization\x00ation\x00ator\x00alism\x00iveness\x00fulness\x00ful\x00ousness\x00aliti\x00iviti\x00biliti\x00ical\x00ness\x00icate\x00iciti\x00ative\x00alize\x00eed\x00ee\x00ed\x00ing\x00case_sensitive\x00trigram\x00ascii\x00porter\x00col\x00row\x00instance\x00fts5vocab: unknown table type: %Q\x00CREATE TABlE vocab(term, col, doc, cnt)\x00CREATE TABlE vocab(term, doc, cnt)\x00CREATE TABlE vocab(term, doc, col, offset)\x00wrong number of vtable arguments\x00recursive definition for %s.%s\x00SELECT t.%Q FROM %Q.%Q AS t WHERE t.%Q MATCH '*id'\x00no such fts5 table: %s.%s\x00fts5vocab\x002025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3\x00" type Sqlite3_int64 = sqlite3_int64 type Sqlite3_mutex_methods = sqlite3_mutex_methods diff --git a/vendor/modernc.org/sqlite/pre_update_hook.go b/vendor/modernc.org/sqlite/pre_update_hook.go new file mode 100644 index 0000000..9a00fe5 --- /dev/null +++ b/vendor/modernc.org/sqlite/pre_update_hook.go @@ -0,0 +1,227 @@ +package sqlite + +import ( + "errors" + "fmt" + "sync" + "unsafe" + + "modernc.org/libc" + "modernc.org/libc/sys/types" + sqlite3 "modernc.org/sqlite/lib" +) + +var ( + xPreUpdateHandlers = struct { + mu sync.RWMutex + m map[uintptr]func(SQLitePreUpdateData) + }{ + m: make(map[uintptr]func(SQLitePreUpdateData)), + } + xCommitHandlers = struct { + mu sync.RWMutex + m map[uintptr]CommitHookFn + }{ + m: make(map[uintptr]CommitHookFn), + } + xRollbackHandlers = struct { + mu sync.RWMutex + m map[uintptr]RollbackHookFn + }{ + m: make(map[uintptr]RollbackHookFn), + } +) + +type PreUpdateHookFn func(SQLitePreUpdateData) + +func (c *conn) RegisterPreUpdateHook(callback PreUpdateHookFn) { + + if callback == nil { + xPreUpdateHandlers.mu.Lock() + delete(xPreUpdateHandlers.m, c.db) + xPreUpdateHandlers.mu.Unlock() + sqlite3.Xsqlite3_preupdate_hook(c.tls, c.db, uintptr(unsafe.Pointer(nil)), uintptr(unsafe.Pointer(nil))) + return + } + xPreUpdateHandlers.mu.Lock() + xPreUpdateHandlers.m[c.db] = callback + xPreUpdateHandlers.mu.Unlock() + + sqlite3.Xsqlite3_preupdate_hook(c.tls, c.db, cFuncPointer(preUpdateHookTrampoline), c.db) +} + +type CommitHookFn func() int32 + +func (c *conn) RegisterCommitHook(callback CommitHookFn) { + if callback == nil { + xCommitHandlers.mu.Lock() + delete(xCommitHandlers.m, c.db) + xCommitHandlers.mu.Unlock() + sqlite3.Xsqlite3_commit_hook(c.tls, c.db, uintptr(unsafe.Pointer(nil)), uintptr(unsafe.Pointer(nil))) + return + } + xCommitHandlers.mu.Lock() + xCommitHandlers.m[c.db] = callback + xCommitHandlers.mu.Unlock() + sqlite3.Xsqlite3_commit_hook(c.tls, c.db, cFuncPointer(commitHookTrampoline), c.db) +} + +type RollbackHookFn func() + +func (c *conn) RegisterRollbackHook(callback RollbackHookFn) { + if callback == nil { + xRollbackHandlers.mu.Lock() + delete(xRollbackHandlers.m, c.db) + xRollbackHandlers.mu.Unlock() + sqlite3.Xsqlite3_rollback_hook(c.tls, c.db, uintptr(unsafe.Pointer(nil)), uintptr(unsafe.Pointer(nil))) + return + } + xRollbackHandlers.mu.Lock() + xRollbackHandlers.m[c.db] = callback + xRollbackHandlers.mu.Unlock() + sqlite3.Xsqlite3_rollback_hook(c.tls, c.db, cFuncPointer(rollbackHookTrampoline), c.db) +} + +type SQLitePreUpdateData struct { + tls *libc.TLS + pCsr uintptr + Op int32 + DatabaseName string + TableName string + OldRowID int64 + NewRowID int64 +} + +// Depth returns the source path of the write, see sqlite3_preupdate_depth() +func (d *SQLitePreUpdateData) Depth() int { + return int(sqlite3.Xsqlite3_preupdate_depth(d.tls, d.pCsr)) +} + +// Count returns the number of columns in the row +func (d *SQLitePreUpdateData) Count() int { + return int(sqlite3.Xsqlite3_preupdate_count(d.tls, d.pCsr)) +} + +func (d *SQLitePreUpdateData) row(dest []any, new bool) error { + count := d.Count() + ppValue, err := mallocValue(d.tls) + if err != nil { + return err + } + defer libc.Xfree(d.tls, ppValue) + + for i := 0; i < count && i < len(dest); i++ { + val, err := d.value(ppValue, i, new) + if err != nil { + return err + } + err = convertAssign(&dest[i], val) + if err != nil { + return err + } + } + return nil +} + +// Old populates dest with the row data to be replaced. This works similar to +// database/sql's Rows.Scan() +func (d *SQLitePreUpdateData) Old(dest ...any) error { + if d.Op == sqlite3.SQLITE_INSERT { + return errors.New("there is no old row for INSERT operations") + } + return d.row(dest, false) +} + +// New populates dest with the replacement row data. This works similar to +// database/sql's Rows.Scan() +func (d *SQLitePreUpdateData) New(dest ...any) error { + if d.Op == sqlite3.SQLITE_DELETE { + return errors.New("there is no new row for DELETE operations") + } + return d.row(dest, true) +} + +const ptrValSize = types.Size_t(unsafe.Sizeof(&sqlite3.Sqlite3_value{})) + +func mallocValue(tls *libc.TLS) (uintptr, error) { + p := libc.Xmalloc(tls, ptrValSize) + if p == 0 { + return 0, fmt.Errorf("out of memory") + } + return p, nil +} + +func (d *SQLitePreUpdateData) value(ppValue uintptr, i int, new bool) (any, error) { + var src any + if new { + sqlite3.Xsqlite3_preupdate_new(d.tls, d.pCsr, int32(i), ppValue) + } else { + sqlite3.Xsqlite3_preupdate_old(d.tls, d.pCsr, int32(i), ppValue) + } + ptrValue := *(*uintptr)(unsafe.Pointer(ppValue)) + switch sqlite3.Xsqlite3_value_type(d.tls, ptrValue) { + case sqlite3.SQLITE_INTEGER: + src = int64(sqlite3.Xsqlite3_value_int64(d.tls, ptrValue)) + case sqlite3.SQLITE_FLOAT: + src = float64(sqlite3.Xsqlite3_value_double(d.tls, ptrValue)) + case sqlite3.SQLITE_BLOB: + size := sqlite3.Xsqlite3_value_bytes(d.tls, ptrValue) + blobPtr := sqlite3.Xsqlite3_value_blob(d.tls, ptrValue) + + var v []byte + if size != 0 { + v = make([]byte, size) + copy(v, (*libc.RawMem)(unsafe.Pointer(blobPtr))[:size:size]) + } + src = v + case sqlite3.SQLITE_TEXT: + src = libc.GoString(sqlite3.Xsqlite3_value_text(d.tls, ptrValue)) + case sqlite3.SQLITE_NULL: + src = nil + } + return src, nil +} + +func preUpdateHookTrampoline(tls *libc.TLS, handle uintptr, pCsr uintptr, op int32, zDb uintptr, pTab uintptr, iKey1 int64, iReg int32, iBlobWrite int32) { + xPreUpdateHandlers.mu.RLock() + xPreUpdateHandler := xPreUpdateHandlers.m[handle] + xPreUpdateHandlers.mu.RUnlock() + + if xPreUpdateHandler == nil { + return + } + data := SQLitePreUpdateData{ + tls: tls, + pCsr: pCsr, + Op: op, + DatabaseName: libc.GoString(zDb), + TableName: libc.GoString(pTab), + OldRowID: iKey1, + NewRowID: int64(iReg), + } + xPreUpdateHandler(data) +} + +func commitHookTrampoline(tls *libc.TLS, handle uintptr, pCsr uintptr) int32 { + xCommitHandlers.mu.RLock() + xCommitHandler := xCommitHandlers.m[handle] + xCommitHandlers.mu.RUnlock() + + if xCommitHandler == nil { + return 0 + } + + return xCommitHandler() +} + +func rollbackHookTrampoline(tls *libc.TLS, handle uintptr, pCsr uintptr) { + xRollbackHandlers.mu.RLock() + xRollbackHandler := xRollbackHandlers.m[handle] + xRollbackHandlers.mu.RUnlock() + + if xRollbackHandler == nil { + return + } + + xRollbackHandler() +} diff --git a/vendor/modernc.org/sqlite/sqlite.go b/vendor/modernc.org/sqlite/sqlite.go index c60ca4c..01e6a03 100644 --- a/vendor/modernc.org/sqlite/sqlite.go +++ b/vendor/modernc.org/sqlite/sqlite.go @@ -255,7 +255,30 @@ func (r *rows) Next(dest []driver.Value) (err error) { return err } - dest[i] = v + if !r.c.intToTime { + dest[i] = v + } else { + // Inspired by mattn/go-sqlite3: + // https://github.com/mattn/go-sqlite3/blob/f76bae4b0044cbba8fb2c72b8e4559e8fbcffd86/sqlite3.go#L2254-L2262 + // but we put make this compatibility optional behind a DSN + // query parameter, because this changes API behavior, so an + // opt-in is needed. + switch r.ColumnTypeDatabaseTypeName(i) { + case "DATE", "DATETIME", "TIMESTAMP": + // Is it a seconds timestamp or a milliseconds + // timestamp? + if v > 1e12 || v < -1e12 { + // time.Unix expects nanoseconds, but this is a + // milliseconds timestamp, so convert ms->ns. + v *= int64(time.Millisecond) + dest[i] = time.Unix(0, v).UTC() + } else { + dest[i] = time.Unix(v, 0) + } + default: + dest[i] = v + } + } case sqlite3.SQLITE_FLOAT: v, err := r.c.columnDouble(r.pstmt, i) if err != nil { @@ -510,6 +533,9 @@ func (s *stmt) exec(ctx context.Context, args []driver.NamedValue) (r driver.Res } defer func() { + if ctx != nil && atomic.LoadInt32(&done) != 0 { + r, err = nil, ctx.Err() + } if pstmt != 0 { // ensure stmt finalized. e := s.c.finalize(pstmt) @@ -520,10 +546,6 @@ func (s *stmt) exec(ctx context.Context, args []driver.NamedValue) (r driver.Res err = e } } - - if ctx != nil && atomic.LoadInt32(&done) != 0 { - r, err = nil, ctx.Err() - } }() for psql := s.psql; *(*byte)(unsafe.Pointer(psql)) != 0 && atomic.LoadInt32(&done) == 0; { @@ -625,6 +647,15 @@ func (s *stmt) query(ctx context.Context, args []driver.NamedValue) (r driver.Ro var allocs []uintptr defer func() { + if ctx != nil && atomic.LoadInt32(&done) != 0 { + if r != nil { + r.Close() + } + r, err = nil, ctx.Err() + } else if r == nil && err == nil { + r, err = newRows(s.c, pstmt, allocs, true) + } + if pstmt != 0 { // ensure stmt finalized. e := s.c.finalize(pstmt) @@ -636,11 +667,6 @@ func (s *stmt) query(ctx context.Context, args []driver.NamedValue) (r driver.Ro } } - if ctx != nil && atomic.LoadInt32(&done) != 0 { - r, err = nil, ctx.Err() - } else if r == nil && err == nil { - r, err = newRows(s.c, pstmt, allocs, true) - } }() for psql := s.psql; *(*byte)(unsafe.Pointer(psql)) != 0 && atomic.LoadInt32(&done) == 0; { @@ -817,8 +843,10 @@ type conn struct { // concurrently. sync.Mutex - writeTimeFormat string - beginMode string + writeTimeFormat string + beginMode string + intToTime bool + integerTimeFormat string } func newConn(dsn string) (*conn, error) { @@ -923,6 +951,17 @@ func applyQueryParams(c *conn, query string) error { } c.writeTimeFormat = f } + if v := q.Get("_time_integer_format"); v != "" { + switch v { + case "unix": + case "unix_milli": + case "unix_micro": + case "unix_nano": + default: + return fmt.Errorf("unknown _time_integer_format %q", v) + } + c.integerTimeFormat = v + } if v := q.Get("_txlock"); v != "" { lower := strings.ToLower(v) @@ -932,6 +971,15 @@ func applyQueryParams(c *conn, query string) error { c.beginMode = v } + if v := q.Get("_inttotime"); v != "" { + onoff, err := strconv.ParseBool(v) + if err != nil { + return fmt.Errorf("unknown _inttotime %q, must be 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False", + v) + } + c.intToTime = onoff + } + return nil } @@ -1182,9 +1230,29 @@ func (c *conn) bind(pstmt uintptr, n int, args []driver.NamedValue) (allocs []ui return allocs, err } case time.Time: - if p, err = c.bindText(pstmt, i, c.formatTime(x)); err != nil { - return allocs, err + switch c.integerTimeFormat { + case "unix": + if err := c.bindInt64(pstmt, i, x.Unix()); err != nil { + return allocs, err + } + case "unix_milli": + if err := c.bindInt64(pstmt, i, x.UnixMilli()); err != nil { + return allocs, err + } + case "unix_micro": + if err := c.bindInt64(pstmt, i, x.UnixMicro()); err != nil { + return allocs, err + } + case "unix_nano": + if err := c.bindInt64(pstmt, i, x.UnixNano()); err != nil { + return allocs, err + } + default: + if p, err = c.bindText(pstmt, i, c.formatTime(x)); err != nil { + return allocs, err + } } + case nil: if p, err = c.bindNull(pstmt, i); err != nil { return allocs, err @@ -1923,6 +1991,12 @@ type ExecQuerierContext interface { driver.QueryerContext } +type HookRegisterer interface { + RegisterPreUpdateHook(PreUpdateHookFn) + RegisterCommitHook(CommitHookFn) + RegisterRollbackHook(RollbackHookFn) +} + // Commit releases all resources associated with the Backup object but does not // close the destination database connection. // @@ -1987,6 +2061,19 @@ func newDriver() *Driver { return d } // including the timezone specifier. If this parameter is not specified, then // the default String() format will be used. // +// _time_integer_format: The name of a integer format to use when writing time values. +// By default, the time is stored as string and the format can be set with _time_format +// parameter. If _time_integer_format is set, the time will be stored as an integer and +// the integer value will depend on the integer format. +// If you decide to set both _time_format and _time_integer_format, the time will be +// converted as integer and the _time_format value will be ignored. +// Currently the supported value are "unix","unix_milli", "unix_micro" and "unix_nano", +// which corresponds to seconds, milliseconds, microseconds or nanoseconds +// since unixepoch (1 January 1970 00:00:00 UTC). +// +// _inttotime: Enable conversion of time column (DATE, DATETIME,TIMESTAMP) from integer +// to time if the field contain integer (int64). +// // _txlock: The locking behavior to use when beginning a transaction. May be // "deferred" (the default), "immediate", or "exclusive" (case insensitive). See: // https://www.sqlite.org/lang_transaction.html#deferred_immediate_and_exclusive_transactions @@ -2228,7 +2315,9 @@ func functionArgs(tls *libc.TLS, argc int32, argv uintptr) []driver.Value { size := sqlite3.Xsqlite3_value_bytes(tls, valPtr) blobPtr := sqlite3.Xsqlite3_value_blob(tls, valPtr) v := make([]byte, size) - copy(v, (*libc.RawMem)(unsafe.Pointer(blobPtr))[:size:size]) + if size != 0 { + copy(v, (*libc.RawMem)(unsafe.Pointer(blobPtr))[:size:size]) + } args[i] = v default: panic(fmt.Sprintf("unexpected argument type %q passed by sqlite", valType)) @@ -2542,3 +2631,29 @@ func Limit(c *sql.Conn, id int, newVal int) (r int, err error) { return r, err } + +// C documentation +// +// int sqlite3_bind_blob(sqlite3_stmt*, int, const void*, int n, void(*)(void*)); +func (c *conn) bindBlob(pstmt uintptr, idx1 int, value []byte) (uintptr, error) { + if value == nil { + if rc := sqlite3.Xsqlite3_bind_null(c.tls, pstmt, int32(idx1)); rc != sqlite3.SQLITE_OK { + return 0, c.errstr(rc) + } + return 0, nil + } + + p, err := c.malloc(len(value)) + if err != nil { + return 0, err + } + if len(value) != 0 { + copy((*libc.RawMem)(unsafe.Pointer(p))[:len(value):len(value)], value) + } + if rc := sqlite3.Xsqlite3_bind_blob(c.tls, pstmt, int32(idx1), p, int32(len(value)), 0); rc != sqlite3.SQLITE_OK { + c.free(p) + return 0, c.errstr(rc) + } + + return p, nil +} diff --git a/vendor/modules.txt b/vendor/modules.txt index acf2650..b3de659 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -53,20 +53,23 @@ github.com/zeebo/blake3/internal/alg/hash/hash_avx2 github.com/zeebo/blake3/internal/alg/hash/hash_pure github.com/zeebo/blake3/internal/consts github.com/zeebo/blake3/internal/utils +# go.felesatra.moe/hash/ed2k v1.0.2 +## explicit; go 1.21.6 +go.felesatra.moe/hash/ed2k # golang.org/x/crypto v0.31.0 ## explicit; go 1.20 golang.org/x/crypto/md4 golang.org/x/crypto/sha3 -# golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 -## explicit; go 1.18 +# golang.org/x/exp v0.0.0-20250620022241-b7579e27df2b +## explicit; go 1.23.0 golang.org/x/exp/constraints -# golang.org/x/sys v0.30.0 -## explicit; go 1.18 +# golang.org/x/sys v0.36.0 +## explicit; go 1.24.0 golang.org/x/sys/cpu golang.org/x/sys/unix golang.org/x/sys/windows -# modernc.org/libc v1.61.13 -## explicit; go 1.21 +# modernc.org/libc v1.66.10 +## explicit; go 1.23.0 modernc.org/libc modernc.org/libc/errno modernc.org/libc/fcntl @@ -96,10 +99,10 @@ modernc.org/libc/wctype # modernc.org/mathutil v1.7.1 ## explicit; go 1.21 modernc.org/mathutil -# modernc.org/memory v1.8.2 -## explicit; go 1.21 +# modernc.org/memory v1.11.0 +## explicit; go 1.23.0 modernc.org/memory -# modernc.org/sqlite v1.36.0 -## explicit; go 1.21 +# modernc.org/sqlite v1.40.1 +## explicit; go 1.24.0 modernc.org/sqlite modernc.org/sqlite/lib